cetec-design-system 2.3.7 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { createContext, useContext, useMemo, forwardRef, createElement, useState, useSyncExternalStore, useLayoutEffect, useRef, useCallback, useEffect, useId as useId$1, isValidElement, Children, cloneElement, useReducer } from "react";
4
- import { b as breakpoints, c as containerSizes } from "./cetec-preset-CZJA5UR0.js";
5
- import { a } from "./cetec-preset-CZJA5UR0.js";
3
+ import { createContext, useContext, useMemo, forwardRef, createElement, useState, useLayoutEffect, useRef, useSyncExternalStore, useCallback, useEffect, useId as useId$1, isValidElement, Children, cloneElement, useReducer } from "react";
6
4
  import * as ReactDOM from "react-dom";
5
+ import { b as breakpoints, c as containerSizes } from "./cetec-preset-D23KFUx3.js";
6
+ import { a } from "./cetec-preset-D23KFUx3.js";
7
+ import { useForm } from "@tanstack/react-form";
8
+ import { useForm as useForm2 } from "@tanstack/react-form";
7
9
  function isObject(value) {
8
10
  return typeof value === "object" && value != null && !Array.isArray(value);
9
11
  }
@@ -240,7 +242,7 @@ function normalizeHTMLProps(props) {
240
242
  return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
241
243
  }
242
244
  normalizeHTMLProps.keys = htmlProps;
243
- const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_utility,_error,_success,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/2xs,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base";
245
+ const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_new,_utility,_error,_success,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/2xs,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base";
244
246
  const conditions = new Set(conditionsStr.split(","));
245
247
  const conditionRegex = /^@|&|&$/;
246
248
  function isCondition(value) {
@@ -737,6 +739,9 @@ const labelVariantMap = {
737
739
  "underline": [
738
740
  "true"
739
741
  ],
742
+ "dashedUnderline": [
743
+ "true"
744
+ ],
740
745
  "truncate": [
741
746
  "true"
742
747
  ],
@@ -803,6 +808,9 @@ const linkVariantMap = {
803
808
  "underline": [
804
809
  "true"
805
810
  ],
811
+ "dashedUnderline": [
812
+ "true"
813
+ ],
806
814
  "truncate": [
807
815
  "true"
808
816
  ],
@@ -830,9 +838,6 @@ const linkVariantMap = {
830
838
  "medium",
831
839
  "bold",
832
840
  "black"
833
- ],
834
- "_disabled": [
835
- "true"
836
841
  ]
837
842
  };
838
843
  const linkVariantKeys = Object.keys(linkVariantMap);
@@ -1553,6 +1558,9 @@ const textVariantMap = {
1553
1558
  "underline": [
1554
1559
  "true"
1555
1560
  ],
1561
+ "dashedUnderline": [
1562
+ "true"
1563
+ ],
1556
1564
  "truncate": [
1557
1565
  "true"
1558
1566
  ],
@@ -1681,7 +1689,8 @@ const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
1681
1689
  getVariantProps: getVariantProps$o
1682
1690
  });
1683
1691
  const autocompleteDefaultVariants = {
1684
- "size": "md"
1692
+ "size": "md",
1693
+ "layer": "elevated"
1685
1694
  };
1686
1695
  const autocompleteCompoundVariants = [];
1687
1696
  const autocompleteSlotNames = [
@@ -1731,6 +1740,7 @@ const autocompleteFn = memo((props = {}) => {
1731
1740
  return Object.fromEntries(autocompleteSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
1732
1741
  });
1733
1742
  const autocompleteVariantKeys = [
1743
+ "layer",
1734
1744
  "size"
1735
1745
  ];
1736
1746
  const getVariantProps$n = (variants) => ({ ...autocompleteDefaultVariants, ...compact(variants) });
@@ -1741,6 +1751,10 @@ const autocomplete = /* @__PURE__ */ Object.assign(autocompleteFn, {
1741
1751
  classNameMap: {},
1742
1752
  variantKeys: autocompleteVariantKeys,
1743
1753
  variantMap: {
1754
+ "layer": [
1755
+ "elevated",
1756
+ "modalFloating"
1757
+ ],
1744
1758
  "size": [
1745
1759
  "sm",
1746
1760
  "md",
@@ -2487,7 +2501,8 @@ const listItem = /* @__PURE__ */ Object.assign(listItemFn, {
2487
2501
  getVariantProps: getVariantProps$9
2488
2502
  });
2489
2503
  const menuDefaultVariants = {
2490
- "density": "compact"
2504
+ "density": "compact",
2505
+ "layer": "elevated"
2491
2506
  };
2492
2507
  const menuCompoundVariants = [];
2493
2508
  const menuSlotNames = [
@@ -2525,6 +2540,7 @@ const menuFn = memo((props = {}) => {
2525
2540
  return Object.fromEntries(menuSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
2526
2541
  });
2527
2542
  const menuVariantKeys = [
2543
+ "layer",
2528
2544
  "density",
2529
2545
  "panel"
2530
2546
  ];
@@ -2536,6 +2552,10 @@ const menu = /* @__PURE__ */ Object.assign(menuFn, {
2536
2552
  classNameMap: {},
2537
2553
  variantKeys: menuVariantKeys,
2538
2554
  variantMap: {
2555
+ "layer": [
2556
+ "elevated",
2557
+ "modalFloating"
2558
+ ],
2539
2559
  "density": [
2540
2560
  "compact",
2541
2561
  "comfortable",
@@ -3005,6 +3025,7 @@ const tooltip = /* @__PURE__ */ Object.assign(tooltipFn, {
3005
3025
  });
3006
3026
  const DS_CHAIN_SEPARATOR = ">";
3007
3027
  const DS_CHAIN_MAX_DEPTH = 5;
3028
+ const DS_OBJECT_ATTRIBUTE = "data-track-object";
3008
3029
  const EMPTY_CHAIN = Object.freeze([]);
3009
3030
  const DsChainContext = createContext(EMPTY_CHAIN);
3010
3031
  const useDsChain = () => useContext(DsChainContext);
@@ -3014,6 +3035,10 @@ const extendDsChain = (chain, testId) => {
3014
3035
  return next.length > DS_CHAIN_MAX_DEPTH ? next.slice(-DS_CHAIN_MAX_DEPTH) : next;
3015
3036
  };
3016
3037
  const dsChainValue = (chain) => chain.length > 0 ? chain.join(DS_CHAIN_SEPARATOR) : void 0;
3038
+ const dsObjectValue = (element) => {
3039
+ var _a;
3040
+ return ((_a = element == null ? void 0 : element.closest(`[${DS_OBJECT_ATTRIBUTE}]`)) == null ? void 0 : _a.getAttribute(DS_OBJECT_ATTRIBUTE)) || void 0;
3041
+ };
3017
3042
  const DsChainScope = ({ testId, children }) => {
3018
3043
  const parentChain = useDsChain();
3019
3044
  const chain = useMemo(
@@ -3022,7 +3047,7 @@ const DsChainScope = ({ testId, children }) => {
3022
3047
  );
3023
3048
  return /* @__PURE__ */ jsx(DsChainContext.Provider, { value: chain, children });
3024
3049
  };
3025
- var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,fontVariant,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,WebkitTextFillColor,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,fontVariantsProperty,filtersProperty,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_utility,_error,_success,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/2xs,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,textStyle,layerStyle";
3050
+ var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,fontVariant,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,WebkitTextFillColor,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,fontVariantsProperty,filtersProperty,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_new,_utility,_error,_success,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/2xs,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,textStyle,layerStyle";
3026
3051
  var userGenerated = userGeneratedStr.split(",");
3027
3052
  var cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical";
3028
3053
  var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
@@ -3328,6 +3353,7 @@ const IconNames = {
3328
3353
  "checkbox-focus": "checkbox-focus",
3329
3354
  "checkbox-indeterminate": "checkbox-indeterminate",
3330
3355
  checkbox: "checkbox",
3356
+ cheese: "cheese",
3331
3357
  "circle-change": "circle-change",
3332
3358
  "circle-check": "circle-check",
3333
3359
  circle: "circle",
@@ -3338,6 +3364,7 @@ const IconNames = {
3338
3364
  clock: "clock",
3339
3365
  "cloud-synced": "cloud-synced",
3340
3366
  code: "code",
3367
+ "collapse-vertical": "collapse-vertical",
3341
3368
  color: "color",
3342
3369
  compass: "compass",
3343
3370
  computer: "computer",
@@ -3367,6 +3394,7 @@ const IconNames = {
3367
3394
  eraser: "eraser",
3368
3395
  error: "error",
3369
3396
  "event-list": "event-list",
3397
+ "expand-vertical": "expand-vertical",
3370
3398
  export: "export",
3371
3399
  extension: "extension",
3372
3400
  "eye-slash": "eye-slash",
@@ -3434,6 +3462,7 @@ const IconNames = {
3434
3462
  "list-numbers": "list-numbers",
3435
3463
  "lock-open": "lock-open",
3436
3464
  lock: "lock",
3465
+ magnet: "magnet",
3437
3466
  "map-pin": "map-pin",
3438
3467
  map: "map",
3439
3468
  "mark-unread": "mark-unread",
@@ -3543,6 +3572,8 @@ const IconNames = {
3543
3572
  textbox: "textbox",
3544
3573
  "time-add": "time-add",
3545
3574
  timer: "timer",
3575
+ "to-date-backward": "to-date-backward",
3576
+ "to-date-forward": "to-date-forward",
3546
3577
  toolbox: "toolbox",
3547
3578
  tools: "tools",
3548
3579
  trash: "trash",
@@ -3762,6 +3793,7 @@ const Badge = (props) => {
3762
3793
  return /* @__PURE__ */ jsx(
3763
3794
  Box,
3764
3795
  {
3796
+ ...dsComponent("Badge"),
3765
3797
  as: "span",
3766
3798
  ref,
3767
3799
  className: cx(classes.root, className),
@@ -3825,761 +3857,267 @@ const Link = (props) => {
3825
3857
  }
3826
3858
  );
3827
3859
  };
3828
- const Text = (props) => {
3860
+ function hasWindow() {
3861
+ return typeof window !== "undefined";
3862
+ }
3863
+ function getNodeName(node) {
3864
+ if (isNode(node)) {
3865
+ return (node.nodeName || "").toLowerCase();
3866
+ }
3867
+ return "#document";
3868
+ }
3869
+ function getWindow(node) {
3870
+ var _node$ownerDocument;
3871
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
3872
+ }
3873
+ function getDocumentElement(node) {
3874
+ var _ref;
3875
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
3876
+ }
3877
+ function isNode(value) {
3878
+ if (!hasWindow()) {
3879
+ return false;
3880
+ }
3881
+ return value instanceof Node || value instanceof getWindow(value).Node;
3882
+ }
3883
+ function isElement(value) {
3884
+ if (!hasWindow()) {
3885
+ return false;
3886
+ }
3887
+ return value instanceof Element || value instanceof getWindow(value).Element;
3888
+ }
3889
+ function isHTMLElement(value) {
3890
+ if (!hasWindow()) {
3891
+ return false;
3892
+ }
3893
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
3894
+ }
3895
+ function isShadowRoot(value) {
3896
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
3897
+ return false;
3898
+ }
3899
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
3900
+ }
3901
+ const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
3902
+ function isOverflowElement(element) {
3829
3903
  const {
3830
- as = "span",
3831
- family,
3832
- italic,
3833
- bold,
3834
- underline,
3835
- size: size2,
3836
- children,
3837
- textStyle,
3838
- weight,
3839
- role,
3840
- // role if use in form input text for refrence, also semantic role overrides if non-semantic tag.
3841
- tabIndex,
3842
- // tabIndex main use for in list or loop select text using key press focus
3843
- truncate,
3844
- allCaps,
3845
- ...rest
3846
- } = props;
3847
- const [className, otherProps] = splitProps(rest);
3848
- return /* @__PURE__ */ jsx(
3849
- Box,
3850
- {
3851
- ...dsComponent("Text"),
3852
- as,
3853
- textStyle,
3854
- role,
3855
- tabIndex,
3856
- className: cx(
3857
- text({
3858
- family,
3859
- bold,
3860
- underline,
3861
- italic,
3862
- size: size2,
3863
- weight,
3864
- truncate,
3865
- allCaps
3866
- }),
3867
- className
3868
- ),
3869
- ...otherProps,
3870
- children
3871
- }
3872
- );
3873
- };
3874
- const Breadcrumbs = (props) => {
3875
- const { items, ...rest } = props;
3876
- const [className, otherProps] = splitProps(rest);
3877
- const classes = breadcrumbs();
3878
- return /* @__PURE__ */ jsx(
3879
- Text,
3880
- {
3881
- ...dsComponent("Breadcrumbs"),
3882
- as: "ul",
3883
- className: cx(classes.wrapper, className),
3884
- ...otherProps,
3885
- children: items == null ? void 0 : items.map((item, index2) => /* @__PURE__ */ jsxs(Text, { as: "li", children: [
3886
- item.href ? /* @__PURE__ */ jsx(Link, { href: item.href, className: classes.linkSegment, children: item.label }) : /* @__PURE__ */ jsx(Text, { className: classes.currentSegment, children: item.label }),
3887
- index2 < (items == null ? void 0 : items.length) - 1 && /* @__PURE__ */ jsx(Text, { className: classes.slash, children: "/" })
3888
- ] }, item.id))
3904
+ overflow,
3905
+ overflowX,
3906
+ overflowY,
3907
+ display
3908
+ } = getComputedStyle$1(element);
3909
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
3910
+ }
3911
+ const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
3912
+ function isTableElement(element) {
3913
+ return tableElements.has(getNodeName(element));
3914
+ }
3915
+ const topLayerSelectors = [":popover-open", ":modal"];
3916
+ function isTopLayer(element) {
3917
+ return topLayerSelectors.some((selector) => {
3918
+ try {
3919
+ return element.matches(selector);
3920
+ } catch (_e) {
3921
+ return false;
3889
3922
  }
3890
- );
3891
- };
3892
- function useMediaQuery(breakpoint, direction = "min") {
3893
- const query = useMemo(() => {
3894
- const breakpointValue = breakpoints[breakpoint];
3895
- const breakpointNum = Number.parseInt(breakpointValue, 10);
3896
- return direction === "min" ? `(min-width: ${breakpointValue})` : `(max-width: ${breakpointNum - 1}px)`;
3897
- }, [breakpoint, direction]);
3898
- const mediaQuery = useMemo(() => {
3899
- if (typeof window === "undefined") {
3900
- return {
3901
- matches: false,
3902
- addEventListener: () => {
3903
- },
3904
- removeEventListener: () => {
3905
- }
3906
- };
3923
+ });
3924
+ }
3925
+ const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
3926
+ const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
3927
+ const containValues = ["paint", "layout", "strict", "content"];
3928
+ function isContainingBlock(elementOrCss) {
3929
+ const webkit = isWebKit();
3930
+ const css2 = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
3931
+ return transformProperties.some((value) => css2[value] ? css2[value] !== "none" : false) || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || willChangeValues.some((value) => (css2.willChange || "").includes(value)) || containValues.some((value) => (css2.contain || "").includes(value));
3932
+ }
3933
+ function getContainingBlock(element) {
3934
+ let currentNode = getParentNode(element);
3935
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
3936
+ if (isContainingBlock(currentNode)) {
3937
+ return currentNode;
3938
+ } else if (isTopLayer(currentNode)) {
3939
+ return null;
3907
3940
  }
3908
- return window.matchMedia(query);
3909
- }, [query]);
3910
- return useSyncExternalStore(
3911
- (callback) => {
3912
- mediaQuery.addEventListener("change", callback);
3913
- return () => {
3914
- mediaQuery.removeEventListener("change", callback);
3915
- };
3916
- },
3917
- () => mediaQuery.matches,
3918
- () => false
3941
+ currentNode = getParentNode(currentNode);
3942
+ }
3943
+ return null;
3944
+ }
3945
+ function isWebKit() {
3946
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
3947
+ return CSS.supports("-webkit-backdrop-filter", "none");
3948
+ }
3949
+ const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
3950
+ function isLastTraversableNode(node) {
3951
+ return lastTraversableNodeNames.has(getNodeName(node));
3952
+ }
3953
+ function getComputedStyle$1(element) {
3954
+ return getWindow(element).getComputedStyle(element);
3955
+ }
3956
+ function getNodeScroll(element) {
3957
+ if (isElement(element)) {
3958
+ return {
3959
+ scrollLeft: element.scrollLeft,
3960
+ scrollTop: element.scrollTop
3961
+ };
3962
+ }
3963
+ return {
3964
+ scrollLeft: element.scrollX,
3965
+ scrollTop: element.scrollY
3966
+ };
3967
+ }
3968
+ function getParentNode(node) {
3969
+ if (getNodeName(node) === "html") {
3970
+ return node;
3971
+ }
3972
+ const result = (
3973
+ // Step into the shadow DOM of the parent of a slotted node.
3974
+ node.assignedSlot || // DOM Element detected.
3975
+ node.parentNode || // ShadowRoot detected.
3976
+ isShadowRoot(node) && node.host || // Fallback.
3977
+ getDocumentElement(node)
3919
3978
  );
3979
+ return isShadowRoot(result) ? result.host : result;
3920
3980
  }
3921
- function useContainerQuery(containerRef, size2, direction = "min") {
3922
- const query = useMemo(() => {
3923
- const sizeValue = containerSizes[size2];
3924
- const sizeNum = Number.parseFloat(sizeValue);
3925
- return direction === "min" ? `(min-width: ${sizeValue})` : `(max-width: ${sizeNum - 0.0625}rem)`;
3926
- }, [size2, direction]);
3927
- return useSyncExternalStore(
3928
- (callback) => {
3929
- if (typeof window === "undefined" || !containerRef.current) {
3930
- return () => {
3931
- };
3932
- }
3933
- const element = containerRef.current;
3934
- const sizeValue = containerSizes[size2];
3935
- const sizeNum = Number.parseFloat(sizeValue);
3936
- const threshold = direction === "min" ? sizeNum : sizeNum - 0.0625;
3937
- const checkSize = () => {
3938
- if (!element) return false;
3939
- const width = element.offsetWidth;
3940
- const widthInRem = width / Number.parseFloat(
3941
- getComputedStyle(document.documentElement).fontSize
3942
- );
3943
- return direction === "min" ? widthInRem >= threshold : widthInRem < threshold;
3944
- };
3945
- if ("queryContainer" in element) {
3946
- try {
3947
- const containerQuery = element.queryContainer(query);
3948
- containerQuery.addEventListener("change", callback);
3949
- return () => {
3950
- containerQuery.removeEventListener("change", callback);
3951
- };
3952
- } catch {
3953
- }
3954
- }
3955
- let currentMatches = checkSize();
3956
- const callbacks = /* @__PURE__ */ new Set();
3957
- let observer = null;
3958
- if (typeof ResizeObserver !== "undefined") {
3959
- observer = new ResizeObserver(() => {
3960
- const newMatches = checkSize();
3961
- if (newMatches !== currentMatches) {
3962
- currentMatches = newMatches;
3963
- callbacks.forEach((cb) => cb());
3964
- }
3965
- });
3966
- observer.observe(element);
3967
- }
3968
- callbacks.add(callback);
3969
- return () => {
3970
- callbacks.delete(callback);
3971
- if (callbacks.size === 0 && observer) {
3972
- observer.disconnect();
3973
- }
3974
- };
3975
- },
3976
- () => {
3977
- if (typeof window === "undefined" || !containerRef.current) {
3978
- return false;
3979
- }
3980
- const element = containerRef.current;
3981
- const sizeValue = containerSizes[size2];
3982
- const sizeNum = Number.parseFloat(sizeValue);
3983
- const threshold = direction === "min" ? sizeNum : sizeNum - 0.0625;
3984
- if ("queryContainer" in element) {
3985
- try {
3986
- const containerQuery = element.queryContainer(query);
3987
- return containerQuery.matches;
3988
- } catch {
3989
- }
3990
- }
3991
- const width = element.offsetWidth;
3992
- const widthInRem = width / Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
3993
- return direction === "min" ? widthInRem >= threshold : widthInRem < threshold;
3994
- },
3995
- () => false
3996
- );
3981
+ function getNearestOverflowAncestor(node) {
3982
+ const parentNode = getParentNode(node);
3983
+ if (isLastTraversableNode(parentNode)) {
3984
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
3985
+ }
3986
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
3987
+ return parentNode;
3988
+ }
3989
+ return getNearestOverflowAncestor(parentNode);
3997
3990
  }
3998
- const Tag = (props) => {
3999
- const { variant, hue, iconBefore, iconAfter, children, ...rest } = props;
4000
- const [className, otherProps] = splitProps(rest);
4001
- return /* @__PURE__ */ jsxs(
4002
- Box,
4003
- {
4004
- ...dsComponent("Tag"),
4005
- className: cx(
4006
- tag({
4007
- variant,
4008
- hue,
4009
- iconBefore: Boolean(iconBefore),
4010
- iconAfter: Boolean(iconAfter)
4011
- }),
4012
- className
4013
- ),
4014
- ...otherProps,
4015
- children: [
4016
- iconBefore && /* @__PURE__ */ jsx(Icon, { name: iconBefore, fill: "current", color: "inherit", size: "20" }),
4017
- children,
4018
- iconAfter && /* @__PURE__ */ jsx(Icon, { name: iconAfter, fill: "current", color: "inherit", size: "20" })
4019
- ]
4020
- }
4021
- );
4022
- };
4023
- const BreakpointIndicator = (props) => {
4024
- const isXs = useMediaQuery("xs");
4025
- const isSm = useMediaQuery("sm");
4026
- const isMd = useMediaQuery("md");
4027
- const isLg = useMediaQuery("lg");
4028
- const isXl = useMediaQuery("xl");
4029
- const is2Xl = useMediaQuery("2xl");
4030
- const { variant, ...rest } = props;
4031
- const [className, otherProps] = splitProps(rest);
4032
- const dsAttributes = dsComponent("BreakpointIndicator");
4033
- let breakpoint = /* @__PURE__ */ jsx(
4034
- Tag,
4035
- {
4036
- ...dsAttributes,
4037
- className: cx(breakpointIndicator({ variant }), className),
4038
- hue: "red",
4039
- variant: "bold",
4040
- ...otherProps,
4041
- children: "@media/base"
4042
- }
4043
- );
4044
- if (is2Xl) {
4045
- breakpoint = /* @__PURE__ */ jsx(
4046
- Tag,
4047
- {
4048
- ...dsAttributes,
4049
- className: cx(breakpointIndicator({ variant }), className),
4050
- hue: "blue",
4051
- variant: "bold",
4052
- ...otherProps,
4053
- children: "@media/2xl"
4054
- }
4055
- );
4056
- } else if (isXl) {
4057
- breakpoint = /* @__PURE__ */ jsx(
4058
- Tag,
4059
- {
4060
- ...dsAttributes,
4061
- className: cx(breakpointIndicator({ variant }), className),
4062
- hue: "magenta",
4063
- variant: "bold",
4064
- ...otherProps,
4065
- children: "@media/xl"
4066
- }
4067
- );
4068
- } else if (isLg) {
4069
- breakpoint = /* @__PURE__ */ jsx(
4070
- Tag,
4071
- {
4072
- ...dsAttributes,
4073
- className: cx(breakpointIndicator({ variant }), className),
4074
- hue: "green",
4075
- variant: "bold",
4076
- ...otherProps,
4077
- children: "@media/lg"
4078
- }
4079
- );
4080
- } else if (isMd) {
4081
- breakpoint = /* @__PURE__ */ jsx(
4082
- Tag,
4083
- {
4084
- ...dsAttributes,
4085
- className: cx(breakpointIndicator({ variant }), className),
4086
- hue: "indigo",
4087
- variant: "bold",
4088
- ...otherProps,
4089
- children: "@media/md"
4090
- }
4091
- );
4092
- } else if (isSm) {
4093
- breakpoint = /* @__PURE__ */ jsx(
4094
- Tag,
4095
- {
4096
- ...dsAttributes,
4097
- className: cx(breakpointIndicator({ variant }), className),
4098
- hue: "yellow",
4099
- variant: "bold",
4100
- ...otherProps,
4101
- children: "@media/sm"
4102
- }
4103
- );
4104
- } else if (isXs) {
4105
- breakpoint = /* @__PURE__ */ jsx(
4106
- Tag,
4107
- {
4108
- ...dsAttributes,
4109
- className: cx(breakpointIndicator({ variant }), className),
4110
- hue: "orange",
4111
- variant: "bold",
4112
- ...otherProps,
4113
- children: "@media/xs"
4114
- }
4115
- );
3991
+ function getOverflowAncestors(node, list2, traverseIframes) {
3992
+ var _node$ownerDocument2;
3993
+ if (list2 === void 0) {
3994
+ list2 = [];
4116
3995
  }
4117
- return /* @__PURE__ */ jsx(Fragment, { children: breakpoint });
4118
- };
4119
- const Spinner = (props) => {
4120
- const slotContext = useSlotContext();
4121
- const { size: sizeProp, inverse, centered, ...rest } = props;
4122
- const size2 = sizeProp ?? (slotContext == null ? void 0 : slotContext.size);
4123
- const [className, otherProps] = splitProps(rest);
4124
- const classes = spinner({
4125
- size: size2,
4126
- inverse,
4127
- centered
4128
- });
4129
- return /* @__PURE__ */ jsx(
4130
- Box,
4131
- {
4132
- ...dsComponent("Spinner"),
4133
- className: cx(classes.container, className),
4134
- ...otherProps,
4135
- children: /* @__PURE__ */ jsx(
4136
- Icon,
4137
- {
4138
- name: "spinner",
4139
- className: classes.spinnerSvg,
4140
- "data-inverse": inverse ? "true" : void 0
4141
- }
4142
- )
4143
- }
4144
- );
3996
+ if (traverseIframes === void 0) {
3997
+ traverseIframes = true;
3998
+ }
3999
+ const scrollableAncestor = getNearestOverflowAncestor(node);
4000
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
4001
+ const win = getWindow(scrollableAncestor);
4002
+ if (isBody) {
4003
+ const frameElement = getFrameElement(win);
4004
+ return list2.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
4005
+ }
4006
+ return list2.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4007
+ }
4008
+ function getFrameElement(win) {
4009
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
4010
+ }
4011
+ const min = Math.min;
4012
+ const max = Math.max;
4013
+ const round = Math.round;
4014
+ const floor = Math.floor;
4015
+ const createCoords = (v) => ({
4016
+ x: v,
4017
+ y: v
4018
+ });
4019
+ const oppositeSideMap = {
4020
+ left: "right",
4021
+ right: "left",
4022
+ bottom: "top",
4023
+ top: "bottom"
4145
4024
  };
4146
- const FieldContext = createContext(null);
4147
- const useFieldContext = () => {
4148
- return useContext(FieldContext);
4025
+ const oppositeAlignmentMap = {
4026
+ start: "end",
4027
+ end: "start"
4149
4028
  };
4150
- const Button = (props) => {
4151
- const fieldContext = useFieldContext();
4152
- const slotContext = useSlotContext();
4153
- const {
4154
- variant,
4155
- size: sizeProp,
4156
- href,
4157
- before,
4158
- after,
4159
- iconBefore,
4160
- iconAfter,
4161
- children,
4162
- loading,
4163
- error: errorProp,
4164
- invalid: invalidProp,
4165
- disabled: disabledProp,
4166
- type = "button",
4167
- fontSize,
4168
- fontVariant,
4169
- ...rest
4170
- } = props;
4171
- const size2 = sizeProp ?? (slotContext == null ? void 0 : slotContext.size) ?? (fieldContext == null ? void 0 : fieldContext.size);
4172
- const error2 = errorProp ?? (slotContext == null ? void 0 : slotContext.error) ?? (fieldContext == null ? void 0 : fieldContext.error);
4173
- const invalid = invalidProp ?? (slotContext == null ? void 0 : slotContext.invalid) ?? (fieldContext == null ? void 0 : fieldContext.invalid);
4174
- const disabled = disabledProp ?? (slotContext == null ? void 0 : slotContext.disabled) ?? (fieldContext == null ? void 0 : fieldContext.disabled);
4175
- const resolvedBefore = before ?? (iconBefore ? /* @__PURE__ */ jsx(Icon, { name: iconBefore, "aria-hidden": true }) : void 0);
4176
- const resolvedAfter = after ?? (iconAfter ? /* @__PURE__ */ jsx(Icon, { name: iconAfter, "aria-hidden": true }) : void 0);
4177
- const classes = button({
4178
- variant,
4179
- size: size2,
4180
- before: Boolean(resolvedBefore),
4181
- after: Boolean(resolvedAfter)
4182
- });
4183
- const [className, otherProps] = splitProps(rest);
4184
- const slotContexts = useMemo(
4185
- () => ({
4186
- before: {
4187
- owner: "Button",
4188
- placement: "before",
4189
- size: size2,
4190
- disabled,
4191
- error: error2,
4192
- invalid
4193
- },
4194
- after: {
4195
- owner: "Button",
4196
- placement: "after",
4197
- size: size2,
4198
- disabled,
4199
- error: error2,
4200
- invalid
4201
- }
4202
- }),
4203
- [disabled, error2, invalid, size2]
4204
- );
4205
- const renderSlot = (slot, placement) => {
4206
- if (!slot) {
4207
- return null;
4208
- }
4209
- return /* @__PURE__ */ jsx(SlotContext.Provider, { value: slotContexts[placement], children: /* @__PURE__ */ jsx(Box, { className: classes.slot, children: slot }) });
4210
- };
4211
- return /* @__PURE__ */ jsxs(
4212
- Box,
4213
- {
4214
- ...dsComponent("Button"),
4215
- ...href ? {
4216
- as: "a",
4217
- href,
4218
- ...disabled && {
4219
- onClick: (e) => e.preventDefault()
4220
- }
4221
- } : {
4222
- as: "button",
4223
- type,
4224
- disabled
4225
- },
4226
- className: `${cx(classes.container, className)} group`,
4227
- ...loading && {
4228
- "aria-busy": true,
4229
- "aria-live": "polite"
4230
- },
4231
- "aria-disabled": disabled,
4232
- "aria-invalid": invalid || void 0,
4233
- "data-error": error2 || void 0,
4234
- "data-invalid": invalid || void 0,
4235
- ...otherProps,
4236
- children: [
4237
- /* @__PURE__ */ jsxs(HStack, { gap: "0", opacity: loading ? 0 : 1, children: [
4238
- renderSlot(resolvedBefore, "before"),
4239
- /* @__PURE__ */ jsx(
4240
- Box,
4241
- {
4242
- className: classes.mainContent,
4243
- fontSize,
4244
- fontVariant,
4245
- children
4246
- }
4247
- ),
4248
- renderSlot(resolvedAfter, "after")
4249
- ] }),
4250
- loading && /* @__PURE__ */ jsx(
4251
- Spinner,
4252
- {
4253
- size: "sm",
4254
- inverse: variant === "primary" || variant === "danger" || variant === "selectedBold",
4255
- centered: true
4256
- }
4257
- )
4258
- ]
4259
- }
4260
- );
4261
- };
4262
- function daysInMonth$1(year, month) {
4263
- return new Date(year, month, 0).getDate();
4264
- }
4265
- function firstWeekdayOfMonth(year, month) {
4266
- return new Date(year, month - 1, 1).getDay();
4267
- }
4268
- function shiftMonth(year, month, delta) {
4269
- const zeroBased = month - 1 + delta;
4270
- const rolledYear = year + Math.floor(zeroBased / 12);
4271
- const rolledMonth = (zeroBased % 12 + 12) % 12;
4272
- return { year: rolledYear, month: rolledMonth + 1 };
4273
- }
4274
- function compareDates(a2, b) {
4275
- if (a2.year !== b.year) return a2.year - b.year;
4276
- if (a2.month !== b.month) return a2.month - b.month;
4277
- return a2.day - b.day;
4278
- }
4279
- function isSameDate(a2, b) {
4280
- return compareDates(a2, b) === 0;
4029
+ function clamp(start, value, end) {
4030
+ return max(start, min(value, end));
4281
4031
  }
4282
- function isDateBefore(date, bound) {
4283
- return bound !== void 0 && compareDates(date, bound) < 0;
4032
+ function evaluate(value, param) {
4033
+ return typeof value === "function" ? value(param) : value;
4284
4034
  }
4285
- function isDateAfter(date, bound) {
4286
- return bound !== void 0 && compareDates(date, bound) > 0;
4035
+ function getSide(placement) {
4036
+ return placement.split("-")[0];
4287
4037
  }
4288
- function isDateInRange(date, min2, max2) {
4289
- return !isDateBefore(date, min2) && !isDateAfter(date, max2);
4038
+ function getAlignment(placement) {
4039
+ return placement.split("-")[1];
4290
4040
  }
4291
- function getTodayDate() {
4292
- const now = /* @__PURE__ */ new Date();
4293
- return {
4294
- year: now.getFullYear(),
4295
- month: now.getMonth() + 1,
4296
- day: now.getDate()
4297
- };
4041
+ function getOppositeAxis(axis) {
4042
+ return axis === "x" ? "y" : "x";
4298
4043
  }
4299
- function to12Hour$1(hour24) {
4300
- if (hour24 === 0) return { hour12: 12, meridiem: "AM" };
4301
- if (hour24 < 12) return { hour12: hour24, meridiem: "AM" };
4302
- if (hour24 === 12) return { hour12: 12, meridiem: "PM" };
4303
- return { hour12: hour24 - 12, meridiem: "PM" };
4044
+ function getAxisLength(axis) {
4045
+ return axis === "y" ? "height" : "width";
4304
4046
  }
4305
- function to24Hour$1(hour12, meridiem) {
4306
- if (meridiem === "AM") return hour12 === 12 ? 0 : hour12;
4307
- return hour12 === 12 ? 12 : hour12 + 12;
4047
+ const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
4048
+ function getSideAxis(placement) {
4049
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
4308
4050
  }
4309
- function normalizeMinuteStep(minuteStep) {
4310
- const step = Math.floor(minuteStep);
4311
- if (!Number.isFinite(step) || step < 1) return 1;
4312
- return Math.min(step, 60);
4051
+ function getAlignmentAxis(placement) {
4052
+ return getOppositeAxis(getSideAxis(placement));
4313
4053
  }
4314
- function getMinuteValues(minuteStep) {
4315
- const step = normalizeMinuteStep(minuteStep);
4316
- const values = [];
4317
- for (let minute = 0; minute < 60; minute += step) {
4318
- values.push(minute);
4054
+ function getAlignmentSides(placement, rects, rtl) {
4055
+ if (rtl === void 0) {
4056
+ rtl = false;
4319
4057
  }
4320
- return values;
4321
- }
4322
- function hasWindow() {
4323
- return typeof window !== "undefined";
4324
- }
4325
- function getNodeName(node) {
4326
- if (isNode(node)) {
4327
- return (node.nodeName || "").toLowerCase();
4058
+ const alignment = getAlignment(placement);
4059
+ const alignmentAxis = getAlignmentAxis(placement);
4060
+ const length = getAxisLength(alignmentAxis);
4061
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
4062
+ if (rects.reference[length] > rects.floating[length]) {
4063
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
4328
4064
  }
4329
- return "#document";
4330
- }
4331
- function getWindow(node) {
4332
- var _node$ownerDocument;
4333
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4065
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
4334
4066
  }
4335
- function getDocumentElement(node) {
4336
- var _ref;
4337
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
4067
+ function getExpandedPlacements(placement) {
4068
+ const oppositePlacement = getOppositePlacement(placement);
4069
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
4338
4070
  }
4339
- function isNode(value) {
4340
- if (!hasWindow()) {
4341
- return false;
4342
- }
4343
- return value instanceof Node || value instanceof getWindow(value).Node;
4071
+ function getOppositeAlignmentPlacement(placement) {
4072
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
4344
4073
  }
4345
- function isElement(value) {
4346
- if (!hasWindow()) {
4347
- return false;
4074
+ const lrPlacement = ["left", "right"];
4075
+ const rlPlacement = ["right", "left"];
4076
+ const tbPlacement = ["top", "bottom"];
4077
+ const btPlacement = ["bottom", "top"];
4078
+ function getSideList(side, isStart, rtl) {
4079
+ switch (side) {
4080
+ case "top":
4081
+ case "bottom":
4082
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
4083
+ return isStart ? lrPlacement : rlPlacement;
4084
+ case "left":
4085
+ case "right":
4086
+ return isStart ? tbPlacement : btPlacement;
4087
+ default:
4088
+ return [];
4348
4089
  }
4349
- return value instanceof Element || value instanceof getWindow(value).Element;
4350
4090
  }
4351
- function isHTMLElement(value) {
4352
- if (!hasWindow()) {
4353
- return false;
4091
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
4092
+ const alignment = getAlignment(placement);
4093
+ let list2 = getSideList(getSide(placement), direction === "start", rtl);
4094
+ if (alignment) {
4095
+ list2 = list2.map((side) => side + "-" + alignment);
4096
+ if (flipAlignment) {
4097
+ list2 = list2.concat(list2.map(getOppositeAlignmentPlacement));
4098
+ }
4354
4099
  }
4355
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
4100
+ return list2;
4356
4101
  }
4357
- function isShadowRoot(value) {
4358
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
4359
- return false;
4360
- }
4361
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
4102
+ function getOppositePlacement(placement) {
4103
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
4362
4104
  }
4363
- const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
4364
- function isOverflowElement(element) {
4365
- const {
4366
- overflow,
4367
- overflowX,
4368
- overflowY,
4369
- display
4370
- } = getComputedStyle$1(element);
4371
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
4105
+ function expandPaddingObject(padding) {
4106
+ return {
4107
+ top: 0,
4108
+ right: 0,
4109
+ bottom: 0,
4110
+ left: 0,
4111
+ ...padding
4112
+ };
4372
4113
  }
4373
- const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
4374
- function isTableElement(element) {
4375
- return tableElements.has(getNodeName(element));
4376
- }
4377
- const topLayerSelectors = [":popover-open", ":modal"];
4378
- function isTopLayer(element) {
4379
- return topLayerSelectors.some((selector) => {
4380
- try {
4381
- return element.matches(selector);
4382
- } catch (_e) {
4383
- return false;
4384
- }
4385
- });
4386
- }
4387
- const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
4388
- const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
4389
- const containValues = ["paint", "layout", "strict", "content"];
4390
- function isContainingBlock(elementOrCss) {
4391
- const webkit = isWebKit();
4392
- const css2 = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
4393
- return transformProperties.some((value) => css2[value] ? css2[value] !== "none" : false) || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || willChangeValues.some((value) => (css2.willChange || "").includes(value)) || containValues.some((value) => (css2.contain || "").includes(value));
4394
- }
4395
- function getContainingBlock(element) {
4396
- let currentNode = getParentNode(element);
4397
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
4398
- if (isContainingBlock(currentNode)) {
4399
- return currentNode;
4400
- } else if (isTopLayer(currentNode)) {
4401
- return null;
4402
- }
4403
- currentNode = getParentNode(currentNode);
4404
- }
4405
- return null;
4406
- }
4407
- function isWebKit() {
4408
- if (typeof CSS === "undefined" || !CSS.supports) return false;
4409
- return CSS.supports("-webkit-backdrop-filter", "none");
4410
- }
4411
- const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
4412
- function isLastTraversableNode(node) {
4413
- return lastTraversableNodeNames.has(getNodeName(node));
4414
- }
4415
- function getComputedStyle$1(element) {
4416
- return getWindow(element).getComputedStyle(element);
4417
- }
4418
- function getNodeScroll(element) {
4419
- if (isElement(element)) {
4420
- return {
4421
- scrollLeft: element.scrollLeft,
4422
- scrollTop: element.scrollTop
4423
- };
4424
- }
4425
- return {
4426
- scrollLeft: element.scrollX,
4427
- scrollTop: element.scrollY
4428
- };
4429
- }
4430
- function getParentNode(node) {
4431
- if (getNodeName(node) === "html") {
4432
- return node;
4433
- }
4434
- const result = (
4435
- // Step into the shadow DOM of the parent of a slotted node.
4436
- node.assignedSlot || // DOM Element detected.
4437
- node.parentNode || // ShadowRoot detected.
4438
- isShadowRoot(node) && node.host || // Fallback.
4439
- getDocumentElement(node)
4440
- );
4441
- return isShadowRoot(result) ? result.host : result;
4442
- }
4443
- function getNearestOverflowAncestor(node) {
4444
- const parentNode = getParentNode(node);
4445
- if (isLastTraversableNode(parentNode)) {
4446
- return node.ownerDocument ? node.ownerDocument.body : node.body;
4447
- }
4448
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
4449
- return parentNode;
4450
- }
4451
- return getNearestOverflowAncestor(parentNode);
4452
- }
4453
- function getOverflowAncestors(node, list2, traverseIframes) {
4454
- var _node$ownerDocument2;
4455
- if (list2 === void 0) {
4456
- list2 = [];
4457
- }
4458
- if (traverseIframes === void 0) {
4459
- traverseIframes = true;
4460
- }
4461
- const scrollableAncestor = getNearestOverflowAncestor(node);
4462
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
4463
- const win = getWindow(scrollableAncestor);
4464
- if (isBody) {
4465
- const frameElement = getFrameElement(win);
4466
- return list2.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
4467
- }
4468
- return list2.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4469
- }
4470
- function getFrameElement(win) {
4471
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
4472
- }
4473
- const min = Math.min;
4474
- const max = Math.max;
4475
- const round = Math.round;
4476
- const floor = Math.floor;
4477
- const createCoords = (v) => ({
4478
- x: v,
4479
- y: v
4480
- });
4481
- const oppositeSideMap = {
4482
- left: "right",
4483
- right: "left",
4484
- bottom: "top",
4485
- top: "bottom"
4486
- };
4487
- const oppositeAlignmentMap = {
4488
- start: "end",
4489
- end: "start"
4490
- };
4491
- function clamp(start, value, end) {
4492
- return max(start, min(value, end));
4493
- }
4494
- function evaluate(value, param) {
4495
- return typeof value === "function" ? value(param) : value;
4496
- }
4497
- function getSide(placement) {
4498
- return placement.split("-")[0];
4499
- }
4500
- function getAlignment(placement) {
4501
- return placement.split("-")[1];
4502
- }
4503
- function getOppositeAxis(axis) {
4504
- return axis === "x" ? "y" : "x";
4505
- }
4506
- function getAxisLength(axis) {
4507
- return axis === "y" ? "height" : "width";
4508
- }
4509
- const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
4510
- function getSideAxis(placement) {
4511
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
4512
- }
4513
- function getAlignmentAxis(placement) {
4514
- return getOppositeAxis(getSideAxis(placement));
4515
- }
4516
- function getAlignmentSides(placement, rects, rtl) {
4517
- if (rtl === void 0) {
4518
- rtl = false;
4519
- }
4520
- const alignment = getAlignment(placement);
4521
- const alignmentAxis = getAlignmentAxis(placement);
4522
- const length = getAxisLength(alignmentAxis);
4523
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
4524
- if (rects.reference[length] > rects.floating[length]) {
4525
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
4526
- }
4527
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
4528
- }
4529
- function getExpandedPlacements(placement) {
4530
- const oppositePlacement = getOppositePlacement(placement);
4531
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
4532
- }
4533
- function getOppositeAlignmentPlacement(placement) {
4534
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
4535
- }
4536
- const lrPlacement = ["left", "right"];
4537
- const rlPlacement = ["right", "left"];
4538
- const tbPlacement = ["top", "bottom"];
4539
- const btPlacement = ["bottom", "top"];
4540
- function getSideList(side, isStart, rtl) {
4541
- switch (side) {
4542
- case "top":
4543
- case "bottom":
4544
- if (rtl) return isStart ? rlPlacement : lrPlacement;
4545
- return isStart ? lrPlacement : rlPlacement;
4546
- case "left":
4547
- case "right":
4548
- return isStart ? tbPlacement : btPlacement;
4549
- default:
4550
- return [];
4551
- }
4552
- }
4553
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
4554
- const alignment = getAlignment(placement);
4555
- let list2 = getSideList(getSide(placement), direction === "start", rtl);
4556
- if (alignment) {
4557
- list2 = list2.map((side) => side + "-" + alignment);
4558
- if (flipAlignment) {
4559
- list2 = list2.concat(list2.map(getOppositeAlignmentPlacement));
4560
- }
4561
- }
4562
- return list2;
4563
- }
4564
- function getOppositePlacement(placement) {
4565
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
4566
- }
4567
- function expandPaddingObject(padding) {
4568
- return {
4569
- top: 0,
4570
- right: 0,
4571
- bottom: 0,
4572
- left: 0,
4573
- ...padding
4574
- };
4575
- }
4576
- function getPaddingObject(padding) {
4577
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
4578
- top: padding,
4579
- right: padding,
4580
- bottom: padding,
4581
- left: padding
4582
- };
4114
+ function getPaddingObject(padding) {
4115
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
4116
+ top: padding,
4117
+ right: padding,
4118
+ bottom: padding,
4119
+ left: padding
4120
+ };
4583
4121
  }
4584
4122
  function rectToClientRect(rect) {
4585
4123
  const {
@@ -12480,6 +12018,10 @@ const tokens = {
12480
12018
  "value": 1101,
12481
12019
  "variable": "var(--cetec-z-index-1101)"
12482
12020
  },
12021
+ "zIndex.1102": {
12022
+ "value": 1102,
12023
+ "variable": "var(--cetec-z-index-1102)"
12024
+ },
12483
12025
  "zIndex.1200": {
12484
12026
  "value": 1200,
12485
12027
  "variable": "var(--cetec-z-index-1200)"
@@ -12620,6 +12162,18 @@ const tokens = {
12620
12162
  "value": "var(--cetec-colors-bg-success-bold-pressed)",
12621
12163
  "variable": "var(--cetec-colors-bg-success-bold-pressed)"
12622
12164
  },
12165
+ "colors.bg.success.subtle": {
12166
+ "value": "var(--cetec-colors-bg-success-subtle)",
12167
+ "variable": "var(--cetec-colors-bg-success-subtle)"
12168
+ },
12169
+ "colors.bg.success.subtle.hovered": {
12170
+ "value": "var(--cetec-colors-bg-success-subtle-hovered)",
12171
+ "variable": "var(--cetec-colors-bg-success-subtle-hovered)"
12172
+ },
12173
+ "colors.bg.success.subtle.pressed": {
12174
+ "value": "var(--cetec-colors-bg-success-subtle-pressed)",
12175
+ "variable": "var(--cetec-colors-bg-success-subtle-pressed)"
12176
+ },
12623
12177
  "colors.bg.warning": {
12624
12178
  "value": "var(--cetec-colors-bg-warning)",
12625
12179
  "variable": "var(--cetec-colors-bg-warning)"
@@ -12644,6 +12198,18 @@ const tokens = {
12644
12198
  "value": "var(--cetec-colors-bg-warning-bold-pressed)",
12645
12199
  "variable": "var(--cetec-colors-bg-warning-bold-pressed)"
12646
12200
  },
12201
+ "colors.bg.warning.subtle": {
12202
+ "value": "var(--cetec-colors-bg-warning-subtle)",
12203
+ "variable": "var(--cetec-colors-bg-warning-subtle)"
12204
+ },
12205
+ "colors.bg.warning.subtle.hovered": {
12206
+ "value": "var(--cetec-colors-bg-warning-subtle-hovered)",
12207
+ "variable": "var(--cetec-colors-bg-warning-subtle-hovered)"
12208
+ },
12209
+ "colors.bg.warning.subtle.pressed": {
12210
+ "value": "var(--cetec-colors-bg-warning-subtle-pressed)",
12211
+ "variable": "var(--cetec-colors-bg-warning-subtle-pressed)"
12212
+ },
12647
12213
  "colors.bg.danger": {
12648
12214
  "value": "var(--cetec-colors-bg-danger)",
12649
12215
  "variable": "var(--cetec-colors-bg-danger)"
@@ -12668,6 +12234,18 @@ const tokens = {
12668
12234
  "value": "var(--cetec-colors-bg-danger-bold-pressed)",
12669
12235
  "variable": "var(--cetec-colors-bg-danger-bold-pressed)"
12670
12236
  },
12237
+ "colors.bg.danger.subtle": {
12238
+ "value": "var(--cetec-colors-bg-danger-subtle)",
12239
+ "variable": "var(--cetec-colors-bg-danger-subtle)"
12240
+ },
12241
+ "colors.bg.danger.subtle.hovered": {
12242
+ "value": "var(--cetec-colors-bg-danger-subtle-hovered)",
12243
+ "variable": "var(--cetec-colors-bg-danger-subtle-hovered)"
12244
+ },
12245
+ "colors.bg.danger.subtle.pressed": {
12246
+ "value": "var(--cetec-colors-bg-danger-subtle-pressed)",
12247
+ "variable": "var(--cetec-colors-bg-danger-subtle-pressed)"
12248
+ },
12671
12249
  "colors.bg.info": {
12672
12250
  "value": "var(--cetec-colors-bg-info)",
12673
12251
  "variable": "var(--cetec-colors-bg-info)"
@@ -12692,6 +12270,18 @@ const tokens = {
12692
12270
  "value": "var(--cetec-colors-bg-info-bold-pressed)",
12693
12271
  "variable": "var(--cetec-colors-bg-info-bold-pressed)"
12694
12272
  },
12273
+ "colors.bg.info.subtle": {
12274
+ "value": "var(--cetec-colors-bg-info-subtle)",
12275
+ "variable": "var(--cetec-colors-bg-info-subtle)"
12276
+ },
12277
+ "colors.bg.info.subtle.hovered": {
12278
+ "value": "var(--cetec-colors-bg-info-subtle-hovered)",
12279
+ "variable": "var(--cetec-colors-bg-info-subtle-hovered)"
12280
+ },
12281
+ "colors.bg.info.subtle.pressed": {
12282
+ "value": "var(--cetec-colors-bg-info-subtle-pressed)",
12283
+ "variable": "var(--cetec-colors-bg-info-subtle-pressed)"
12284
+ },
12695
12285
  "colors.bg.cta": {
12696
12286
  "value": "var(--cetec-colors-bg-cta)",
12697
12287
  "variable": "var(--cetec-colors-bg-cta)"
@@ -13784,6 +13374,10 @@ const tokens = {
13784
13374
  "value": "var(--cetec-z-index-1101)",
13785
13375
  "variable": "var(--cetec-z-index-modal)"
13786
13376
  },
13377
+ "zIndex.modalFloating": {
13378
+ "value": "var(--cetec-z-index-1102)",
13379
+ "variable": "var(--cetec-z-index-modal-floating)"
13380
+ },
13787
13381
  "zIndex.tooltip": {
13788
13382
  "value": "var(--cetec-z-index-1200)",
13789
13383
  "variable": "var(--cetec-z-index-tooltip)"
@@ -14300,6 +13894,18 @@ const tokens = {
14300
13894
  "value": "var(--cetec-colors-color-palette-success-bold-pressed)",
14301
13895
  "variable": "var(--cetec-colors-color-palette-success-bold-pressed)"
14302
13896
  },
13897
+ "colors.colorPalette.success.subtle": {
13898
+ "value": "var(--cetec-colors-color-palette-success-subtle)",
13899
+ "variable": "var(--cetec-colors-color-palette-success-subtle)"
13900
+ },
13901
+ "colors.colorPalette.success.subtle.hovered": {
13902
+ "value": "var(--cetec-colors-color-palette-success-subtle-hovered)",
13903
+ "variable": "var(--cetec-colors-color-palette-success-subtle-hovered)"
13904
+ },
13905
+ "colors.colorPalette.success.subtle.pressed": {
13906
+ "value": "var(--cetec-colors-color-palette-success-subtle-pressed)",
13907
+ "variable": "var(--cetec-colors-color-palette-success-subtle-pressed)"
13908
+ },
14303
13909
  "colors.colorPalette.warning": {
14304
13910
  "value": "var(--cetec-colors-color-palette-warning)",
14305
13911
  "variable": "var(--cetec-colors-color-palette-warning)"
@@ -14324,6 +13930,18 @@ const tokens = {
14324
13930
  "value": "var(--cetec-colors-color-palette-warning-bold-pressed)",
14325
13931
  "variable": "var(--cetec-colors-color-palette-warning-bold-pressed)"
14326
13932
  },
13933
+ "colors.colorPalette.warning.subtle": {
13934
+ "value": "var(--cetec-colors-color-palette-warning-subtle)",
13935
+ "variable": "var(--cetec-colors-color-palette-warning-subtle)"
13936
+ },
13937
+ "colors.colorPalette.warning.subtle.hovered": {
13938
+ "value": "var(--cetec-colors-color-palette-warning-subtle-hovered)",
13939
+ "variable": "var(--cetec-colors-color-palette-warning-subtle-hovered)"
13940
+ },
13941
+ "colors.colorPalette.warning.subtle.pressed": {
13942
+ "value": "var(--cetec-colors-color-palette-warning-subtle-pressed)",
13943
+ "variable": "var(--cetec-colors-color-palette-warning-subtle-pressed)"
13944
+ },
14327
13945
  "colors.colorPalette.danger": {
14328
13946
  "value": "var(--cetec-colors-color-palette-danger)",
14329
13947
  "variable": "var(--cetec-colors-color-palette-danger)"
@@ -14348,6 +13966,18 @@ const tokens = {
14348
13966
  "value": "var(--cetec-colors-color-palette-danger-bold-pressed)",
14349
13967
  "variable": "var(--cetec-colors-color-palette-danger-bold-pressed)"
14350
13968
  },
13969
+ "colors.colorPalette.danger.subtle": {
13970
+ "value": "var(--cetec-colors-color-palette-danger-subtle)",
13971
+ "variable": "var(--cetec-colors-color-palette-danger-subtle)"
13972
+ },
13973
+ "colors.colorPalette.danger.subtle.hovered": {
13974
+ "value": "var(--cetec-colors-color-palette-danger-subtle-hovered)",
13975
+ "variable": "var(--cetec-colors-color-palette-danger-subtle-hovered)"
13976
+ },
13977
+ "colors.colorPalette.danger.subtle.pressed": {
13978
+ "value": "var(--cetec-colors-color-palette-danger-subtle-pressed)",
13979
+ "variable": "var(--cetec-colors-color-palette-danger-subtle-pressed)"
13980
+ },
14351
13981
  "colors.colorPalette.info": {
14352
13982
  "value": "var(--cetec-colors-color-palette-info)",
14353
13983
  "variable": "var(--cetec-colors-color-palette-info)"
@@ -14372,6 +14002,18 @@ const tokens = {
14372
14002
  "value": "var(--cetec-colors-color-palette-info-bold-pressed)",
14373
14003
  "variable": "var(--cetec-colors-color-palette-info-bold-pressed)"
14374
14004
  },
14005
+ "colors.colorPalette.info.subtle": {
14006
+ "value": "var(--cetec-colors-color-palette-info-subtle)",
14007
+ "variable": "var(--cetec-colors-color-palette-info-subtle)"
14008
+ },
14009
+ "colors.colorPalette.info.subtle.hovered": {
14010
+ "value": "var(--cetec-colors-color-palette-info-subtle-hovered)",
14011
+ "variable": "var(--cetec-colors-color-palette-info-subtle-hovered)"
14012
+ },
14013
+ "colors.colorPalette.info.subtle.pressed": {
14014
+ "value": "var(--cetec-colors-color-palette-info-subtle-pressed)",
14015
+ "variable": "var(--cetec-colors-color-palette-info-subtle-pressed)"
14016
+ },
14375
14017
  "colors.colorPalette.cta": {
14376
14018
  "value": "var(--cetec-colors-color-palette-cta)",
14377
14019
  "variable": "var(--cetec-colors-color-palette-cta)"
@@ -15257,130 +14899,641 @@ const tokens = {
15257
14899
  "variable": "var(--cetec-colors-color-palette-border-color)"
15258
14900
  }
15259
14901
  };
15260
- function token(path, fallback) {
15261
- var _a;
15262
- return ((_a = tokens[path]) == null ? void 0 : _a.value) || fallback;
15263
- }
15264
- function tokenVar(path, fallback) {
15265
- var _a;
15266
- return ((_a = tokens[path]) == null ? void 0 : _a.variable) || fallback;
15267
- }
15268
- token.var = tokenVar;
15269
- const createOverlayMiddleware = (options = {}) => {
15270
- const { offset: offset$12 = 4, shiftPadding = 8, extras = [] } = options;
15271
- return [
15272
- offset(offset$12),
15273
- flip(),
15274
- shift({ padding: shiftPadding }),
15275
- ...extras
15276
- ];
15277
- };
15278
- const useOverlayFloating = (options) => {
15279
- const {
15280
- open,
15281
- onOpenChange,
15282
- placement = "bottom-start",
15283
- strategy = "absolute",
15284
- middleware,
15285
- nodeId,
15286
- offset: offset2 = 4,
15287
- shiftPadding = 8
15288
- } = options;
15289
- return useFloating({
15290
- nodeId,
15291
- open,
15292
- onOpenChange,
15293
- placement,
15294
- strategy,
15295
- whileElementsMounted: autoUpdate,
15296
- middleware: middleware ?? createOverlayMiddleware({ offset: offset2, shiftPadding })
14902
+ function token(path, fallback) {
14903
+ var _a;
14904
+ return ((_a = tokens[path]) == null ? void 0 : _a.value) || fallback;
14905
+ }
14906
+ function tokenVar(path, fallback) {
14907
+ var _a;
14908
+ return ((_a = tokens[path]) == null ? void 0 : _a.variable) || fallback;
14909
+ }
14910
+ token.var = tokenVar;
14911
+ const createOverlayMiddleware = (options = {}) => {
14912
+ const { offset: offset$12 = 4, shiftPadding = 8, extras = [] } = options;
14913
+ return [
14914
+ offset(offset$12),
14915
+ flip(),
14916
+ shift({ padding: shiftPadding }),
14917
+ ...extras
14918
+ ];
14919
+ };
14920
+ const useOverlayFloating = (options) => {
14921
+ const {
14922
+ open,
14923
+ onOpenChange,
14924
+ placement = "bottom-start",
14925
+ strategy = "absolute",
14926
+ middleware,
14927
+ nodeId,
14928
+ offset: offset2 = 4,
14929
+ shiftPadding = 8
14930
+ } = options;
14931
+ return useFloating({
14932
+ nodeId,
14933
+ open,
14934
+ onOpenChange,
14935
+ placement,
14936
+ strategy,
14937
+ whileElementsMounted: autoUpdate,
14938
+ middleware: middleware ?? createOverlayMiddleware({ offset: offset2, shiftPadding })
14939
+ });
14940
+ };
14941
+ const DsChainPortalRoot = ({
14942
+ children,
14943
+ reference
14944
+ }) => {
14945
+ const chain = useDsChain();
14946
+ return (
14947
+ // The marker is unconditional; neither value is. An empty chain emits no
14948
+ // `data-ds-chain`, so without the marker an untagged portal is
14949
+ // indistinguishable from an ordinary element and a consumer walking up the
14950
+ // DOM continues past it into `document.body` — producing a chain from
14951
+ // whatever it finds there, with no error. The marker makes "portal
14952
+ // boundary, resolved to nothing" a state a reader can detect, and it is
14953
+ // what tells that reader to stop and take both values from here.
14954
+ /* @__PURE__ */ jsx(
14955
+ "div",
14956
+ {
14957
+ "data-ds-portal-root": "",
14958
+ "data-ds-chain": dsChainValue(chain),
14959
+ "data-track-object": dsObjectValue(reference),
14960
+ children
14961
+ }
14962
+ )
14963
+ );
14964
+ };
14965
+ const Tooltip = (props) => {
14966
+ const {
14967
+ caret = true,
14968
+ size: size2 = "md",
14969
+ text: text2,
14970
+ title,
14971
+ children,
14972
+ placement = "bottom",
14973
+ offset: offset2 = 8,
14974
+ delay,
14975
+ ...rest
14976
+ } = props;
14977
+ const [className, otherProps] = splitProps(rest);
14978
+ const [isOpen, setIsOpen] = useState(false);
14979
+ const arrowRef = useRef(null);
14980
+ const { refs, elements, floatingStyles, context: context2 } = useOverlayFloating({
14981
+ open: isOpen,
14982
+ onOpenChange: setIsOpen,
14983
+ placement,
14984
+ middleware: createOverlayMiddleware({
14985
+ offset: offset2,
14986
+ extras: [arrow({ element: arrowRef })]
14987
+ })
14988
+ });
14989
+ const hover = useHover(context2, { move: false, delay });
14990
+ const focus = useFocus(context2);
14991
+ const dismiss = useDismiss(context2);
14992
+ const role = useRole(context2, { role: "tooltip" });
14993
+ const { getReferenceProps, getFloatingProps } = useInteractions([
14994
+ hover,
14995
+ focus,
14996
+ dismiss,
14997
+ role
14998
+ ]);
14999
+ const classes = tooltip({ size: size2, hasTitle: !!title });
15000
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
15001
+ /* @__PURE__ */ jsx(
15002
+ Box,
15003
+ {
15004
+ as: "span",
15005
+ ref: refs.setReference,
15006
+ display: "inline-flex",
15007
+ alignItems: "center",
15008
+ lineHeight: "none",
15009
+ width: "fit",
15010
+ ...getReferenceProps(),
15011
+ children
15012
+ }
15013
+ ),
15014
+ isOpen && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: elements.domReference, children: /* @__PURE__ */ jsxs(
15015
+ Box,
15016
+ {
15017
+ ...dsComponent("Tooltip"),
15018
+ ref: refs.setFloating,
15019
+ style: floatingStyles,
15020
+ className: cx(classes.tooltipContent, className),
15021
+ ...getFloatingProps(),
15022
+ ...otherProps,
15023
+ children: [
15024
+ title && /* @__PURE__ */ jsx(Box, { className: classes.title, children: title }),
15025
+ text2 && /* @__PURE__ */ jsx(Box, { className: classes.text, children: text2 }),
15026
+ caret && /* @__PURE__ */ jsx(
15027
+ FloatingArrow,
15028
+ {
15029
+ ref: arrowRef,
15030
+ context: context2,
15031
+ fill: token.var("colors.bg.neutral.inverse")
15032
+ }
15033
+ )
15034
+ ]
15035
+ }
15036
+ ) }) })
15037
+ ] });
15038
+ };
15039
+ const Text = (props) => {
15040
+ const {
15041
+ as = "span",
15042
+ family,
15043
+ italic,
15044
+ bold,
15045
+ underline,
15046
+ dashedUnderline,
15047
+ definition,
15048
+ size: size2,
15049
+ children,
15050
+ textStyle,
15051
+ weight,
15052
+ role,
15053
+ // role if use in form input text for refrence, also semantic role overrides if non-semantic tag.
15054
+ tabIndex,
15055
+ // tabIndex main use for in list or loop select text using key press focus
15056
+ truncate,
15057
+ allCaps,
15058
+ ...rest
15059
+ } = props;
15060
+ const [className, otherProps] = splitProps(rest);
15061
+ const content = /* @__PURE__ */ jsx(
15062
+ Box,
15063
+ {
15064
+ ...dsComponent("Text"),
15065
+ as,
15066
+ textStyle,
15067
+ role,
15068
+ tabIndex: tabIndex ?? (definition ? 0 : void 0),
15069
+ className: cx(
15070
+ text({
15071
+ family,
15072
+ bold,
15073
+ underline,
15074
+ dashedUnderline: definition ? true : dashedUnderline,
15075
+ italic,
15076
+ size: size2,
15077
+ weight,
15078
+ truncate,
15079
+ allCaps
15080
+ }),
15081
+ className
15082
+ ),
15083
+ ...otherProps,
15084
+ children
15085
+ }
15086
+ );
15087
+ return definition ? /* @__PURE__ */ jsx(Tooltip, { text: definition, children: content }) : content;
15088
+ };
15089
+ const Breadcrumbs = (props) => {
15090
+ const { items, ...rest } = props;
15091
+ const [className, otherProps] = splitProps(rest);
15092
+ const classes = breadcrumbs();
15093
+ return /* @__PURE__ */ jsx(
15094
+ Text,
15095
+ {
15096
+ ...dsComponent("Breadcrumbs"),
15097
+ as: "ul",
15098
+ className: cx(classes.wrapper, className),
15099
+ ...otherProps,
15100
+ children: items == null ? void 0 : items.map((item, index2) => /* @__PURE__ */ jsxs(Text, { as: "li", children: [
15101
+ item.href ? /* @__PURE__ */ jsx(Link, { href: item.href, className: classes.linkSegment, children: item.label }) : /* @__PURE__ */ jsx(Text, { className: classes.currentSegment, children: item.label }),
15102
+ index2 < (items == null ? void 0 : items.length) - 1 && /* @__PURE__ */ jsx(Text, { className: classes.slash, children: "/" })
15103
+ ] }, item.id))
15104
+ }
15105
+ );
15106
+ };
15107
+ function useMediaQuery(breakpoint, direction = "min") {
15108
+ const query = useMemo(() => {
15109
+ const breakpointValue = breakpoints[breakpoint];
15110
+ const breakpointNum = Number.parseInt(breakpointValue, 10);
15111
+ return direction === "min" ? `(min-width: ${breakpointValue})` : `(max-width: ${breakpointNum - 1}px)`;
15112
+ }, [breakpoint, direction]);
15113
+ const mediaQuery = useMemo(() => {
15114
+ if (typeof window === "undefined") {
15115
+ return {
15116
+ matches: false,
15117
+ addEventListener: () => {
15118
+ },
15119
+ removeEventListener: () => {
15120
+ }
15121
+ };
15122
+ }
15123
+ return window.matchMedia(query);
15124
+ }, [query]);
15125
+ return useSyncExternalStore(
15126
+ (callback) => {
15127
+ mediaQuery.addEventListener("change", callback);
15128
+ return () => {
15129
+ mediaQuery.removeEventListener("change", callback);
15130
+ };
15131
+ },
15132
+ () => mediaQuery.matches,
15133
+ () => false
15134
+ );
15135
+ }
15136
+ function useContainerQuery(containerRef, size2, direction = "min") {
15137
+ const query = useMemo(() => {
15138
+ const sizeValue = containerSizes[size2];
15139
+ const sizeNum = Number.parseFloat(sizeValue);
15140
+ return direction === "min" ? `(min-width: ${sizeValue})` : `(max-width: ${sizeNum - 0.0625}rem)`;
15141
+ }, [size2, direction]);
15142
+ return useSyncExternalStore(
15143
+ (callback) => {
15144
+ if (typeof window === "undefined" || !containerRef.current) {
15145
+ return () => {
15146
+ };
15147
+ }
15148
+ const element = containerRef.current;
15149
+ const sizeValue = containerSizes[size2];
15150
+ const sizeNum = Number.parseFloat(sizeValue);
15151
+ const threshold = direction === "min" ? sizeNum : sizeNum - 0.0625;
15152
+ const checkSize = () => {
15153
+ if (!element) return false;
15154
+ const width = element.offsetWidth;
15155
+ const widthInRem = width / Number.parseFloat(
15156
+ getComputedStyle(document.documentElement).fontSize
15157
+ );
15158
+ return direction === "min" ? widthInRem >= threshold : widthInRem < threshold;
15159
+ };
15160
+ if ("queryContainer" in element) {
15161
+ try {
15162
+ const containerQuery = element.queryContainer(query);
15163
+ containerQuery.addEventListener("change", callback);
15164
+ return () => {
15165
+ containerQuery.removeEventListener("change", callback);
15166
+ };
15167
+ } catch {
15168
+ }
15169
+ }
15170
+ let currentMatches = checkSize();
15171
+ const callbacks = /* @__PURE__ */ new Set();
15172
+ let observer = null;
15173
+ if (typeof ResizeObserver !== "undefined") {
15174
+ observer = new ResizeObserver(() => {
15175
+ const newMatches = checkSize();
15176
+ if (newMatches !== currentMatches) {
15177
+ currentMatches = newMatches;
15178
+ callbacks.forEach((cb) => cb());
15179
+ }
15180
+ });
15181
+ observer.observe(element);
15182
+ }
15183
+ callbacks.add(callback);
15184
+ return () => {
15185
+ callbacks.delete(callback);
15186
+ if (callbacks.size === 0 && observer) {
15187
+ observer.disconnect();
15188
+ }
15189
+ };
15190
+ },
15191
+ () => {
15192
+ if (typeof window === "undefined" || !containerRef.current) {
15193
+ return false;
15194
+ }
15195
+ const element = containerRef.current;
15196
+ const sizeValue = containerSizes[size2];
15197
+ const sizeNum = Number.parseFloat(sizeValue);
15198
+ const threshold = direction === "min" ? sizeNum : sizeNum - 0.0625;
15199
+ if ("queryContainer" in element) {
15200
+ try {
15201
+ const containerQuery = element.queryContainer(query);
15202
+ return containerQuery.matches;
15203
+ } catch {
15204
+ }
15205
+ }
15206
+ const width = element.offsetWidth;
15207
+ const widthInRem = width / Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
15208
+ return direction === "min" ? widthInRem >= threshold : widthInRem < threshold;
15209
+ },
15210
+ () => false
15211
+ );
15212
+ }
15213
+ const Tag = (props) => {
15214
+ const { variant, hue, iconBefore, iconAfter, children, ...rest } = props;
15215
+ const [className, otherProps] = splitProps(rest);
15216
+ return /* @__PURE__ */ jsxs(
15217
+ Box,
15218
+ {
15219
+ ...dsComponent("Tag"),
15220
+ className: cx(
15221
+ tag({
15222
+ variant,
15223
+ hue,
15224
+ iconBefore: Boolean(iconBefore),
15225
+ iconAfter: Boolean(iconAfter)
15226
+ }),
15227
+ className
15228
+ ),
15229
+ ...otherProps,
15230
+ children: [
15231
+ iconBefore && /* @__PURE__ */ jsx(Icon, { name: iconBefore, fill: "current", color: "inherit", size: "20" }),
15232
+ children,
15233
+ iconAfter && /* @__PURE__ */ jsx(Icon, { name: iconAfter, fill: "current", color: "inherit", size: "20" })
15234
+ ]
15235
+ }
15236
+ );
15237
+ };
15238
+ const BreakpointIndicator = (props) => {
15239
+ const isXs = useMediaQuery("xs");
15240
+ const isSm = useMediaQuery("sm");
15241
+ const isMd = useMediaQuery("md");
15242
+ const isLg = useMediaQuery("lg");
15243
+ const isXl = useMediaQuery("xl");
15244
+ const is2Xl = useMediaQuery("2xl");
15245
+ const { variant, ...rest } = props;
15246
+ const [className, otherProps] = splitProps(rest);
15247
+ const dsAttributes = dsComponent("BreakpointIndicator");
15248
+ let breakpoint = /* @__PURE__ */ jsx(
15249
+ Tag,
15250
+ {
15251
+ ...dsAttributes,
15252
+ className: cx(breakpointIndicator({ variant }), className),
15253
+ hue: "red",
15254
+ variant: "bold",
15255
+ ...otherProps,
15256
+ children: "@media/base"
15257
+ }
15258
+ );
15259
+ if (is2Xl) {
15260
+ breakpoint = /* @__PURE__ */ jsx(
15261
+ Tag,
15262
+ {
15263
+ ...dsAttributes,
15264
+ className: cx(breakpointIndicator({ variant }), className),
15265
+ hue: "blue",
15266
+ variant: "bold",
15267
+ ...otherProps,
15268
+ children: "@media/2xl"
15269
+ }
15270
+ );
15271
+ } else if (isXl) {
15272
+ breakpoint = /* @__PURE__ */ jsx(
15273
+ Tag,
15274
+ {
15275
+ ...dsAttributes,
15276
+ className: cx(breakpointIndicator({ variant }), className),
15277
+ hue: "magenta",
15278
+ variant: "bold",
15279
+ ...otherProps,
15280
+ children: "@media/xl"
15281
+ }
15282
+ );
15283
+ } else if (isLg) {
15284
+ breakpoint = /* @__PURE__ */ jsx(
15285
+ Tag,
15286
+ {
15287
+ ...dsAttributes,
15288
+ className: cx(breakpointIndicator({ variant }), className),
15289
+ hue: "green",
15290
+ variant: "bold",
15291
+ ...otherProps,
15292
+ children: "@media/lg"
15293
+ }
15294
+ );
15295
+ } else if (isMd) {
15296
+ breakpoint = /* @__PURE__ */ jsx(
15297
+ Tag,
15298
+ {
15299
+ ...dsAttributes,
15300
+ className: cx(breakpointIndicator({ variant }), className),
15301
+ hue: "indigo",
15302
+ variant: "bold",
15303
+ ...otherProps,
15304
+ children: "@media/md"
15305
+ }
15306
+ );
15307
+ } else if (isSm) {
15308
+ breakpoint = /* @__PURE__ */ jsx(
15309
+ Tag,
15310
+ {
15311
+ ...dsAttributes,
15312
+ className: cx(breakpointIndicator({ variant }), className),
15313
+ hue: "yellow",
15314
+ variant: "bold",
15315
+ ...otherProps,
15316
+ children: "@media/sm"
15317
+ }
15318
+ );
15319
+ } else if (isXs) {
15320
+ breakpoint = /* @__PURE__ */ jsx(
15321
+ Tag,
15322
+ {
15323
+ ...dsAttributes,
15324
+ className: cx(breakpointIndicator({ variant }), className),
15325
+ hue: "orange",
15326
+ variant: "bold",
15327
+ ...otherProps,
15328
+ children: "@media/xs"
15329
+ }
15330
+ );
15331
+ }
15332
+ return /* @__PURE__ */ jsx(Fragment, { children: breakpoint });
15333
+ };
15334
+ const Spinner = (props) => {
15335
+ const slotContext = useSlotContext();
15336
+ const { size: sizeProp, inverse, centered, ...rest } = props;
15337
+ const size2 = sizeProp ?? (slotContext == null ? void 0 : slotContext.size);
15338
+ const [className, otherProps] = splitProps(rest);
15339
+ const classes = spinner({
15340
+ size: size2,
15341
+ inverse,
15342
+ centered
15297
15343
  });
15298
- };
15299
- const DsChainPortalRoot = ({ children }) => {
15300
- const chain = useDsChain();
15301
- return (
15302
- // The marker is unconditional; the chain value is not. An empty chain emits
15303
- // no `data-ds-chain`, so without the marker an untagged portal is
15304
- // indistinguishable from an ordinary element and a consumer walking up the
15305
- // DOM continues past it into `document.body` — producing a chain from
15306
- // whatever it finds there, with no error. The marker makes "portal
15307
- // boundary, chain resolved to nothing" a state a reader can detect.
15308
- /* @__PURE__ */ jsx("div", { "data-ds-portal-root": "", "data-ds-chain": dsChainValue(chain), children })
15344
+ return /* @__PURE__ */ jsx(
15345
+ Box,
15346
+ {
15347
+ ...dsComponent("Spinner"),
15348
+ className: cx(classes.container, className),
15349
+ ...otherProps,
15350
+ children: /* @__PURE__ */ jsx(
15351
+ Icon,
15352
+ {
15353
+ name: "spinner",
15354
+ className: classes.spinnerSvg,
15355
+ "data-inverse": inverse ? "true" : void 0
15356
+ }
15357
+ )
15358
+ }
15309
15359
  );
15310
15360
  };
15311
- const Tooltip = (props) => {
15361
+ const FieldContext = createContext(null);
15362
+ const useFieldContext = () => {
15363
+ return useContext(FieldContext);
15364
+ };
15365
+ const Button = (props) => {
15366
+ const fieldContext = useFieldContext();
15367
+ const slotContext = useSlotContext();
15312
15368
  const {
15313
- caret = true,
15314
- size: size2 = "md",
15315
- text: text2,
15316
- title,
15369
+ variant,
15370
+ size: sizeProp,
15371
+ href,
15372
+ before,
15373
+ after,
15374
+ iconBefore,
15375
+ iconAfter,
15317
15376
  children,
15318
- placement = "bottom",
15319
- offset: offset2 = 8,
15320
- delay,
15377
+ loading,
15378
+ error: errorProp,
15379
+ invalid: invalidProp,
15380
+ disabled: disabledProp,
15381
+ type = "button",
15382
+ fontSize,
15383
+ fontVariant,
15321
15384
  ...rest
15322
15385
  } = props;
15323
- const [className, otherProps] = splitProps(rest);
15324
- const [isOpen, setIsOpen] = useState(false);
15325
- const arrowRef = useRef(null);
15326
- const { refs, floatingStyles, context: context2 } = useOverlayFloating({
15327
- open: isOpen,
15328
- onOpenChange: setIsOpen,
15329
- placement,
15330
- middleware: createOverlayMiddleware({
15331
- offset: offset2,
15332
- extras: [arrow({ element: arrowRef })]
15333
- })
15386
+ const size2 = sizeProp ?? (slotContext == null ? void 0 : slotContext.size) ?? (fieldContext == null ? void 0 : fieldContext.size);
15387
+ const error2 = errorProp ?? (slotContext == null ? void 0 : slotContext.error) ?? (fieldContext == null ? void 0 : fieldContext.error);
15388
+ const invalid = invalidProp ?? (slotContext == null ? void 0 : slotContext.invalid) ?? (fieldContext == null ? void 0 : fieldContext.invalid);
15389
+ const disabled = disabledProp ?? (slotContext == null ? void 0 : slotContext.disabled) ?? (fieldContext == null ? void 0 : fieldContext.disabled);
15390
+ const resolvedBefore = before ?? (iconBefore ? /* @__PURE__ */ jsx(Icon, { name: iconBefore, "aria-hidden": true }) : void 0);
15391
+ const resolvedAfter = after ?? (iconAfter ? /* @__PURE__ */ jsx(Icon, { name: iconAfter, "aria-hidden": true }) : void 0);
15392
+ const classes = button({
15393
+ variant,
15394
+ size: size2,
15395
+ before: Boolean(resolvedBefore),
15396
+ after: Boolean(resolvedAfter)
15334
15397
  });
15335
- const hover = useHover(context2, { move: false, delay });
15336
- const focus = useFocus(context2);
15337
- const dismiss = useDismiss(context2);
15338
- const role = useRole(context2, { role: "tooltip" });
15339
- const { getReferenceProps, getFloatingProps } = useInteractions([
15340
- hover,
15341
- focus,
15342
- dismiss,
15343
- role
15344
- ]);
15345
- const classes = tooltip({ size: size2, hasTitle: !!title });
15346
- return /* @__PURE__ */ jsxs(Fragment, { children: [
15347
- /* @__PURE__ */ jsx(
15348
- Box,
15349
- {
15350
- as: "span",
15351
- ref: refs.setReference,
15352
- display: "inline-flex",
15353
- alignItems: "center",
15354
- lineHeight: "none",
15355
- ...getReferenceProps(),
15356
- children
15398
+ const [className, otherProps] = splitProps(rest);
15399
+ const slotContexts = useMemo(
15400
+ () => ({
15401
+ before: {
15402
+ owner: "Button",
15403
+ placement: "before",
15404
+ size: size2,
15405
+ disabled,
15406
+ error: error2,
15407
+ invalid
15408
+ },
15409
+ after: {
15410
+ owner: "Button",
15411
+ placement: "after",
15412
+ size: size2,
15413
+ disabled,
15414
+ error: error2,
15415
+ invalid
15357
15416
  }
15358
- ),
15359
- isOpen && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsxs(
15360
- Box,
15361
- {
15362
- ...dsComponent("Tooltip"),
15363
- ref: refs.setFloating,
15364
- style: floatingStyles,
15365
- className: cx(classes.tooltipContent, className),
15366
- ...getFloatingProps(),
15367
- ...otherProps,
15368
- children: [
15369
- title && /* @__PURE__ */ jsx(Text, { className: classes.title, children: title }),
15370
- text2 && /* @__PURE__ */ jsx(Text, { className: classes.text, children: text2 }),
15371
- caret && /* @__PURE__ */ jsx(
15372
- FloatingArrow,
15417
+ }),
15418
+ [disabled, error2, invalid, size2]
15419
+ );
15420
+ const renderSlot = (slot, placement) => {
15421
+ if (!slot) {
15422
+ return null;
15423
+ }
15424
+ return /* @__PURE__ */ jsx(SlotContext.Provider, { value: slotContexts[placement], children: /* @__PURE__ */ jsx(Box, { className: classes.slot, children: slot }) });
15425
+ };
15426
+ return /* @__PURE__ */ jsxs(
15427
+ Box,
15428
+ {
15429
+ ...dsComponent("Button"),
15430
+ ...href ? {
15431
+ as: "a",
15432
+ href,
15433
+ ...disabled && {
15434
+ onClick: (e) => e.preventDefault()
15435
+ }
15436
+ } : {
15437
+ as: "button",
15438
+ type,
15439
+ disabled
15440
+ },
15441
+ className: `${cx(classes.container, className)} group`,
15442
+ ...loading && {
15443
+ "aria-busy": true,
15444
+ "aria-live": "polite"
15445
+ },
15446
+ "aria-disabled": disabled,
15447
+ "aria-invalid": invalid || void 0,
15448
+ "data-error": error2 || void 0,
15449
+ "data-invalid": invalid || void 0,
15450
+ ...otherProps,
15451
+ children: [
15452
+ /* @__PURE__ */ jsxs(HStack, { gap: "0", opacity: loading ? 0 : 1, children: [
15453
+ renderSlot(resolvedBefore, "before"),
15454
+ /* @__PURE__ */ jsx(
15455
+ Box,
15373
15456
  {
15374
- ref: arrowRef,
15375
- context: context2,
15376
- fill: token.var("colors.bg.neutral.inverse")
15457
+ className: classes.mainContent,
15458
+ fontSize,
15459
+ fontVariant,
15460
+ children
15377
15461
  }
15378
- )
15379
- ]
15380
- }
15381
- ) }) })
15382
- ] });
15462
+ ),
15463
+ renderSlot(resolvedAfter, "after")
15464
+ ] }),
15465
+ loading && /* @__PURE__ */ jsx(
15466
+ Spinner,
15467
+ {
15468
+ size: "sm",
15469
+ inverse: variant === "primary" || variant === "danger" || variant === "selectedBold",
15470
+ centered: true
15471
+ }
15472
+ )
15473
+ ]
15474
+ }
15475
+ );
15383
15476
  };
15477
+ function daysInMonth$1(year, month) {
15478
+ return new Date(year, month, 0).getDate();
15479
+ }
15480
+ function firstWeekdayOfMonth(year, month) {
15481
+ return new Date(year, month - 1, 1).getDay();
15482
+ }
15483
+ function shiftMonth(year, month, delta) {
15484
+ const zeroBased = month - 1 + delta;
15485
+ const rolledYear = year + Math.floor(zeroBased / 12);
15486
+ const rolledMonth = (zeroBased % 12 + 12) % 12;
15487
+ return { year: rolledYear, month: rolledMonth + 1 };
15488
+ }
15489
+ function compareDates(a2, b) {
15490
+ if (a2.year !== b.year) return a2.year - b.year;
15491
+ if (a2.month !== b.month) return a2.month - b.month;
15492
+ return a2.day - b.day;
15493
+ }
15494
+ function isSameDate(a2, b) {
15495
+ return compareDates(a2, b) === 0;
15496
+ }
15497
+ function isDateBefore(date, bound) {
15498
+ return bound !== void 0 && compareDates(date, bound) < 0;
15499
+ }
15500
+ function isDateAfter(date, bound) {
15501
+ return bound !== void 0 && compareDates(date, bound) > 0;
15502
+ }
15503
+ function isDateInRange(date, min2, max2) {
15504
+ return !isDateBefore(date, min2) && !isDateAfter(date, max2);
15505
+ }
15506
+ function getTodayDate() {
15507
+ const now = /* @__PURE__ */ new Date();
15508
+ return {
15509
+ year: now.getFullYear(),
15510
+ month: now.getMonth() + 1,
15511
+ day: now.getDate()
15512
+ };
15513
+ }
15514
+ function to12Hour$1(hour24) {
15515
+ if (hour24 === 0) return { hour12: 12, meridiem: "AM" };
15516
+ if (hour24 < 12) return { hour12: hour24, meridiem: "AM" };
15517
+ if (hour24 === 12) return { hour12: 12, meridiem: "PM" };
15518
+ return { hour12: hour24 - 12, meridiem: "PM" };
15519
+ }
15520
+ function to24Hour$1(hour12, meridiem) {
15521
+ if (meridiem === "AM") return hour12 === 12 ? 0 : hour12;
15522
+ return hour12 === 12 ? 12 : hour12 + 12;
15523
+ }
15524
+ function normalizeMinuteStep(minuteStep) {
15525
+ const step = Math.floor(minuteStep);
15526
+ if (!Number.isFinite(step) || step < 1) return 1;
15527
+ return Math.min(step, 60);
15528
+ }
15529
+ function getMinuteValues(minuteStep) {
15530
+ const step = normalizeMinuteStep(minuteStep);
15531
+ const values = [];
15532
+ for (let minute = 0; minute < 60; minute += step) {
15533
+ values.push(minute);
15534
+ }
15535
+ return values;
15536
+ }
15384
15537
  const IconButton = (props) => {
15385
15538
  const fieldContext = useFieldContext();
15386
15539
  const slotContext = useSlotContext();
@@ -16415,12 +16568,17 @@ const Code = (props) => {
16415
16568
  );
16416
16569
  };
16417
16570
  const Pre = (props) => {
16418
- const { children, lang, ...rest } = props;
16571
+ const {
16572
+ children,
16573
+ lang,
16574
+ "data-ds-component": dsComponentName,
16575
+ ...rest
16576
+ } = props;
16419
16577
  const [className, otherProps] = splitProps(rest);
16420
16578
  return /* @__PURE__ */ jsx(
16421
16579
  Box,
16422
16580
  {
16423
- ...dsComponent("Pre"),
16581
+ ...dsComponent("Pre", dsComponentName),
16424
16582
  as: "pre",
16425
16583
  className: cx(pre({}), className),
16426
16584
  ...otherProps,
@@ -17595,6 +17753,8 @@ const DateTimeInput = (props) => {
17595
17753
  }
17596
17754
  );
17597
17755
  };
17756
+ const FloatingLayerContext = createContext("elevated");
17757
+ const useFloatingLayer = () => useContext(FloatingLayerContext);
17598
17758
  const MENU_COMPONENT_TYPES = {
17599
17759
  group: "MenuGroup",
17600
17760
  item: "MenuItem",
@@ -17838,6 +17998,7 @@ const withLevelScopedKeys = (nodes, levelKey) => {
17838
17998
  const Menu = (props) => {
17839
17999
  var _a;
17840
18000
  const nodeId = useFloatingNodeId();
18001
+ const floatingLayer = useFloatingLayer();
17841
18002
  const {
17842
18003
  trigger,
17843
18004
  children,
@@ -17864,7 +18025,7 @@ const Menu = (props) => {
17864
18025
  } = props;
17865
18026
  const [className, otherProps] = splitProps(rest);
17866
18027
  const userStyle = otherProps.style;
17867
- const classes = menu({ density, panel });
18028
+ const classes = menu({ density, panel, layer: floatingLayer });
17868
18029
  const listClassName = list({ density });
17869
18030
  const hasReference = Boolean(trigger) && !inline;
17870
18031
  const [uncontrolledOpen, setUncontrolledOpen] = useState(
@@ -18252,7 +18413,7 @@ const Menu = (props) => {
18252
18413
  onKeyDown: composedTriggerOnKeyDown
18253
18414
  }
18254
18415
  ),
18255
- isOpen && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsx(
18416
+ isOpen && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: floating.elements.domReference, children: /* @__PURE__ */ jsx(
18256
18417
  FloatingFocusManager,
18257
18418
  {
18258
18419
  context: floating.context,
@@ -18639,6 +18800,7 @@ const SubMenu = (props) => {
18639
18800
  const nodeId = useFloatingNodeId();
18640
18801
  const parentId = useFloatingParentNodeId();
18641
18802
  const tree = useFloatingTree();
18803
+ const floatingLayer = useFloatingLayer();
18642
18804
  const {
18643
18805
  label: label2,
18644
18806
  description,
@@ -18661,7 +18823,10 @@ const SubMenu = (props) => {
18661
18823
  const parentListContext = useMenuListContext();
18662
18824
  const resolvedInteraction = interaction ?? rootContext.subMenuInteraction;
18663
18825
  const resolvedDensity = typeof density === "string" ? density : rootContext.density;
18664
- const classes = menu({ density: resolvedDensity });
18826
+ const classes = menu({
18827
+ density: resolvedDensity,
18828
+ layer: floatingLayer
18829
+ });
18665
18830
  const listClassName = list({ density: resolvedDensity });
18666
18831
  const itemClassName = listItem({
18667
18832
  density: resolvedDensity,
@@ -19062,7 +19227,7 @@ const SubMenu = (props) => {
19062
19227
  ]
19063
19228
  }
19064
19229
  ),
19065
- open && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsx(
19230
+ open && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: floating.elements.domReference, children: /* @__PURE__ */ jsx(
19066
19231
  FloatingFocusManager,
19067
19232
  {
19068
19233
  context: floating.context,
@@ -19340,6 +19505,8 @@ const ListItem = (props) => {
19340
19505
  iconBeforeFill,
19341
19506
  iconAfterFill,
19342
19507
  href,
19508
+ rowId,
19509
+ "data-ds-component": dsComponentName,
19343
19510
  ...rest
19344
19511
  } = props;
19345
19512
  const [className, otherProps] = splitProps(rest);
@@ -19360,12 +19527,19 @@ const ListItem = (props) => {
19360
19527
  iconAfter: Boolean(iconAfter)
19361
19528
  });
19362
19529
  if (variant === "divider") {
19363
- return /* @__PURE__ */ jsx(Box, { className: classes.divider, children: /* @__PURE__ */ jsx(Divider, { role: "separator" }) });
19530
+ return /* @__PURE__ */ jsx(
19531
+ Box,
19532
+ {
19533
+ ...dsComponent("ListItem", dsComponentName),
19534
+ className: classes.divider,
19535
+ children: /* @__PURE__ */ jsx(Divider, { role: "separator" })
19536
+ }
19537
+ );
19364
19538
  }
19365
19539
  return /* @__PURE__ */ jsx(
19366
19540
  Box,
19367
19541
  {
19368
- ...dsComponent("ListItem"),
19542
+ ...dsComponent("ListItem", dsComponentName),
19369
19543
  ...href ? {
19370
19544
  as: "a",
19371
19545
  href
@@ -19377,6 +19551,7 @@ const ListItem = (props) => {
19377
19551
  role: "option",
19378
19552
  "aria-selected": isSelected,
19379
19553
  "data-selected": isSelected || void 0,
19554
+ "data-row-id": rowId,
19380
19555
  ...otherProps,
19381
19556
  children: hasCustomChildren ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
19382
19557
  before && /* @__PURE__ */ jsx(Box, { className: classes.beforeSlot, "aria-hidden": true, children: before }),
@@ -20724,11 +20899,13 @@ const Kbd = (props) => {
20724
20899
  );
20725
20900
  return /* @__PURE__ */ jsx(Tooltip, { text: tooltipText, children: content });
20726
20901
  };
20727
- const ModalContext = createContext(null);
20728
- const useModalContext = () => {
20729
- const context2 = useContext(ModalContext);
20902
+ const ModalWrapperContext = createContext(null);
20903
+ const useModalWrapperContext = () => {
20904
+ const context2 = useContext(ModalWrapperContext);
20730
20905
  if (!context2) {
20731
- throw new Error("Modal components must be used within a <Modal> provider");
20906
+ throw new Error(
20907
+ "Modal components must be used within a <ModalWrapper> provider"
20908
+ );
20732
20909
  }
20733
20910
  return context2;
20734
20911
  };
@@ -20747,12 +20924,13 @@ const modalStateReducer = (state, action) => {
20747
20924
  return state;
20748
20925
  }
20749
20926
  };
20750
- const Modal = (props) => {
20927
+ const ModalWrapper = (props) => {
20751
20928
  const {
20752
20929
  open,
20753
20930
  onOpenChange,
20754
20931
  size: size2 = "md",
20755
20932
  preventOverlayClose = false,
20933
+ initialFocus,
20756
20934
  children,
20757
20935
  id,
20758
20936
  position = "centered",
@@ -20806,7 +20984,7 @@ const Modal = (props) => {
20806
20984
  return null;
20807
20985
  }
20808
20986
  const dataState = phase === "closing" ? "closing" : "open";
20809
- return /* @__PURE__ */ jsx(ModalContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsxs(Box, { className: classes.positionWrapper, children: [
20987
+ return /* @__PURE__ */ jsx(FloatingLayerContext.Provider, { value: "modalFloating", children: /* @__PURE__ */ jsx(ModalWrapperContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsxs(Box, { className: classes.positionWrapper, children: [
20810
20988
  /* @__PURE__ */ jsx(
20811
20989
  FloatingOverlay,
20812
20990
  {
@@ -20817,33 +20995,54 @@ const Modal = (props) => {
20817
20995
  "aria-hidden": "true"
20818
20996
  }
20819
20997
  ),
20820
- /* @__PURE__ */ jsx(FloatingFocusManager, { context: context2, modal: true, children: /* @__PURE__ */ jsx(
20821
- Box,
20998
+ /* @__PURE__ */ jsx(
20999
+ FloatingFocusManager,
20822
21000
  {
20823
- ...dsComponent("Modal"),
20824
- ref: refs.setFloating,
20825
- className: cx(classes.container, className),
20826
- "data-state": dataState,
20827
- id,
20828
- role: "dialog",
20829
- "aria-modal": "true",
20830
- ...getFloatingProps(),
20831
- ...otherProps,
20832
- children
21001
+ context: context2,
21002
+ modal: true,
21003
+ initialFocus,
21004
+ children: /* @__PURE__ */ jsx(
21005
+ Box,
21006
+ {
21007
+ ...dsComponent("ModalWrapper"),
21008
+ ref: refs.setFloating,
21009
+ className: cx(classes.container, className),
21010
+ "data-state": dataState,
21011
+ id,
21012
+ role: "dialog",
21013
+ "aria-modal": "true",
21014
+ ...getFloatingProps(),
21015
+ ...otherProps,
21016
+ children
21017
+ }
21018
+ )
20833
21019
  }
20834
- ) })
20835
- ] }) }) }) });
21020
+ )
21021
+ ] }) }) }) }) });
21022
+ };
21023
+ const ModalBody = (props) => {
21024
+ const { children, ...rest } = props;
21025
+ const [className, otherProps] = splitProps(rest);
21026
+ const classes = modal();
21027
+ return /* @__PURE__ */ jsx(Box, { className: cx(classes.body, className), ...otherProps, children });
21028
+ };
21029
+ const ModalFooter = (props) => {
21030
+ const { children, ...rest } = props;
21031
+ const [className, otherProps] = splitProps(rest);
21032
+ const classes = modal();
21033
+ return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
20836
21034
  };
20837
21035
  const ModalHeader = (props) => {
20838
- const { title, showCloseButton = true, children, ...rest } = props;
21036
+ const { title, titleId, showCloseButton = true, children, ...rest } = props;
20839
21037
  const [className, otherProps] = splitProps(rest);
20840
21038
  const classes = modal();
20841
- const { onClose } = useModalContext();
21039
+ const { onClose } = useModalWrapperContext();
20842
21040
  const isSm = useMediaQuery("sm");
20843
21041
  return /* @__PURE__ */ jsx(Box, { className: cx(classes.header, className), ...otherProps, children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
20844
21042
  title && /* @__PURE__ */ jsx(
20845
21043
  Heading,
20846
21044
  {
21045
+ id: titleId,
20847
21046
  level: "h3",
20848
21047
  textStyle: { base: "heading.sm", sm: "heading.xs" },
20849
21048
  className: classes.title,
@@ -20864,17 +21063,173 @@ const ModalHeader = (props) => {
20864
21063
  )
20865
21064
  ] }) });
20866
21065
  };
20867
- const ModalBody = (props) => {
20868
- const { children, ...rest } = props;
20869
- const [className, otherProps] = splitProps(rest);
20870
- const classes = modal();
20871
- return /* @__PURE__ */ jsx(Box, { className: cx(classes.body, className), ...otherProps, children });
21066
+ const Modal = (props) => {
21067
+ const {
21068
+ open,
21069
+ onOpenChange,
21070
+ title,
21071
+ defaultValues,
21072
+ onSubmit,
21073
+ children,
21074
+ submitLabel = "Submit",
21075
+ cancelLabel = "Cancel",
21076
+ submitDisabled = false,
21077
+ footer,
21078
+ size: size2,
21079
+ preventOverlayClose,
21080
+ showCloseButton = true
21081
+ } = props;
21082
+ const titleId = useId$1();
21083
+ const close = useCallback(() => onOpenChange(false), [onOpenChange]);
21084
+ const form = useForm({
21085
+ defaultValues,
21086
+ onSubmit: async ({ value }) => {
21087
+ await onSubmit({ value, close });
21088
+ }
21089
+ });
21090
+ useEffect(() => {
21091
+ form.reset(defaultValues);
21092
+ }, [form, open]);
21093
+ const handleFormSubmit = (event) => {
21094
+ event.preventDefault();
21095
+ event.stopPropagation();
21096
+ void form.handleSubmit();
21097
+ };
21098
+ const formBody = /* @__PURE__ */ jsx(ModalBody, { ...dsComponent("ModalBody"), children: children(form) });
21099
+ const defaultFooter = /* @__PURE__ */ jsx(ModalFooter, { ...dsComponent("ModalFooter"), children: /* @__PURE__ */ jsx(
21100
+ form.Subscribe,
21101
+ {
21102
+ selector: (state) => [state.canSubmit, state.isSubmitting],
21103
+ children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsxs(Fragment, { children: [
21104
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", onClick: close, children: cancelLabel }),
21105
+ /* @__PURE__ */ jsx(
21106
+ Button,
21107
+ {
21108
+ type: "submit",
21109
+ variant: "primary",
21110
+ disabled: !canSubmit || submitDisabled,
21111
+ loading: isSubmitting,
21112
+ children: submitLabel
21113
+ }
21114
+ )
21115
+ ] })
21116
+ }
21117
+ ) });
21118
+ return /* @__PURE__ */ jsxs(
21119
+ ModalWrapper,
21120
+ {
21121
+ ...dsComponent("Modal"),
21122
+ open,
21123
+ onOpenChange,
21124
+ size: size2,
21125
+ preventOverlayClose,
21126
+ "aria-labelledby": titleId,
21127
+ children: [
21128
+ /* @__PURE__ */ jsx(
21129
+ ModalHeader,
21130
+ {
21131
+ title,
21132
+ titleId,
21133
+ showCloseButton
21134
+ }
21135
+ ),
21136
+ footer ? /* @__PURE__ */ jsxs(Fragment, { children: [
21137
+ /* @__PURE__ */ jsx("form", { onSubmit: handleFormSubmit, children: formBody }),
21138
+ /* @__PURE__ */ jsx(ModalFooter, { ...dsComponent("ModalFooter"), children: footer })
21139
+ ] }) : /* @__PURE__ */ jsxs("form", { onSubmit: handleFormSubmit, children: [
21140
+ formBody,
21141
+ defaultFooter
21142
+ ] })
21143
+ ]
21144
+ }
21145
+ );
20872
21146
  };
20873
- const ModalFooter = (props) => {
20874
- const { children, ...rest } = props;
20875
- const [className, otherProps] = splitProps(rest);
20876
- const classes = modal();
20877
- return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
21147
+ const typeDefaults = {
21148
+ default: {
21149
+ preventOverlayClose: false,
21150
+ showCloseButton: true
21151
+ },
21152
+ delete: {
21153
+ preventOverlayClose: true,
21154
+ showCloseButton: false
21155
+ }
21156
+ };
21157
+ const ConfirmationModal = (props) => {
21158
+ const {
21159
+ open,
21160
+ onOpenChange,
21161
+ title,
21162
+ description,
21163
+ confirmLabel,
21164
+ cancelLabel = "Cancel",
21165
+ type = "default",
21166
+ onConfirm,
21167
+ confirmLoading = false,
21168
+ confirmDisabled = false,
21169
+ preventOverlayClose,
21170
+ showCloseButton,
21171
+ size: size2 = "sm"
21172
+ } = props;
21173
+ const titleId = useId$1();
21174
+ const descriptionId = useId$1();
21175
+ const cancelRef = useRef(null);
21176
+ const defaults2 = typeDefaults[type];
21177
+ const resolvedPreventOverlayClose = preventOverlayClose ?? defaults2.preventOverlayClose;
21178
+ const resolvedShowCloseButton = showCloseButton ?? defaults2.showCloseButton;
21179
+ const confirmButtonVariant = type === "delete" ? "danger" : "primary";
21180
+ const dismiss = useCallback(() => onOpenChange(false), [onOpenChange]);
21181
+ const handleConfirm = () => {
21182
+ void onConfirm();
21183
+ };
21184
+ return /* @__PURE__ */ jsxs(
21185
+ ModalWrapper,
21186
+ {
21187
+ ...dsComponent("ConfirmationModal"),
21188
+ open,
21189
+ onOpenChange,
21190
+ size: size2,
21191
+ preventOverlayClose: resolvedPreventOverlayClose,
21192
+ initialFocus: type === "delete" ? cancelRef : void 0,
21193
+ role: "alertdialog",
21194
+ "aria-labelledby": titleId,
21195
+ "aria-describedby": descriptionId,
21196
+ children: [
21197
+ /* @__PURE__ */ jsx(
21198
+ ModalHeader,
21199
+ {
21200
+ title,
21201
+ titleId,
21202
+ showCloseButton: resolvedShowCloseButton
21203
+ }
21204
+ ),
21205
+ /* @__PURE__ */ jsx(ModalBody, { ...dsComponent("ModalBody"), children: /* @__PURE__ */ jsx(Text, { id: descriptionId, children: description }) }),
21206
+ /* @__PURE__ */ jsxs(ModalFooter, { ...dsComponent("ModalFooter"), children: [
21207
+ /* @__PURE__ */ jsx(
21208
+ Button,
21209
+ {
21210
+ ref: cancelRef,
21211
+ type: "button",
21212
+ variant: "ghost",
21213
+ onClick: dismiss,
21214
+ disabled: confirmLoading,
21215
+ children: cancelLabel
21216
+ }
21217
+ ),
21218
+ /* @__PURE__ */ jsx(
21219
+ Button,
21220
+ {
21221
+ type: "button",
21222
+ variant: confirmButtonVariant,
21223
+ onClick: handleConfirm,
21224
+ disabled: confirmDisabled || confirmLoading,
21225
+ loading: confirmLoading,
21226
+ children: confirmLabel
21227
+ }
21228
+ )
21229
+ ] })
21230
+ ]
21231
+ }
21232
+ );
20878
21233
  };
20879
21234
  const Radio = (props) => {
20880
21235
  const fieldContext = useFieldContext();
@@ -21055,6 +21410,7 @@ const dsPart = (part) => ({
21055
21410
  [DS_PART_ATTRIBUTE]: part
21056
21411
  });
21057
21412
  const AutocompleteListbox = (props) => {
21413
+ const floatingLayer = useFloatingLayer();
21058
21414
  const {
21059
21415
  activeIndex,
21060
21416
  baseId,
@@ -21079,7 +21435,7 @@ const AutocompleteListbox = (props) => {
21079
21435
  statusClassName,
21080
21436
  value
21081
21437
  } = props;
21082
- const menuClasses = menu({ density });
21438
+ const menuClasses = menu({ density, layer: floatingLayer });
21083
21439
  const showInitialLoading = loading && items.length === 0;
21084
21440
  const showNoOptions = !loading && items.length === 0;
21085
21441
  const selectedValueSet = new Set(selectedValues);
@@ -21115,6 +21471,7 @@ const AutocompleteListbox = (props) => {
21115
21471
  {
21116
21472
  name: selected ? "checkbox-checked" : "checkbox",
21117
21473
  fill: selected ? "icon" : "icon.subtlest",
21474
+ display: "block",
21118
21475
  "aria-hidden": true
21119
21476
  }
21120
21477
  ) : void 0,
@@ -21150,6 +21507,7 @@ const AutocompleteToken = (props) => {
21150
21507
  className,
21151
21508
  disabled,
21152
21509
  dismissButtonRef,
21510
+ isNew,
21153
21511
  label: label2,
21154
21512
  onDismiss,
21155
21513
  onKeyDown,
@@ -21159,6 +21517,7 @@ const AutocompleteToken = (props) => {
21159
21517
  Chip,
21160
21518
  {
21161
21519
  className,
21520
+ "data-new": isNew || void 0,
21162
21521
  size: size2,
21163
21522
  dismissable: true,
21164
21523
  disabled,
@@ -21184,7 +21543,6 @@ const useAutocompleteState = ({
21184
21543
  defaultOpen = false,
21185
21544
  onOpenChange,
21186
21545
  multiple = false,
21187
- selectedOptionLabel,
21188
21546
  disabled = false,
21189
21547
  readOnly = false
21190
21548
  }) => {
@@ -21230,7 +21588,7 @@ const useAutocompleteState = ({
21230
21588
  return;
21231
21589
  }
21232
21590
  commitInputValue(nextValue, "input");
21233
- if (!multiple && typeof value === "string" && nextValue !== selectedOptionLabel) {
21591
+ if (!multiple && typeof value === "string") {
21234
21592
  commitValue(null, "clear");
21235
21593
  }
21236
21594
  commitOpen(true, "input");
@@ -21241,7 +21599,6 @@ const useAutocompleteState = ({
21241
21599
  commitValue,
21242
21600
  isInteractionBlocked,
21243
21601
  multiple,
21244
- selectedOptionLabel,
21245
21602
  value
21246
21603
  ]
21247
21604
  );
@@ -21267,7 +21624,7 @@ const useAutocompleteState = ({
21267
21624
  return;
21268
21625
  }
21269
21626
  commitValue(option.value, reason);
21270
- commitInputValue(option.label, "selection");
21627
+ commitInputValue("", "selection");
21271
21628
  commitOpen(false, "selection");
21272
21629
  },
21273
21630
  [
@@ -21398,7 +21755,7 @@ const getAutocompleteValueArray = (value, multiple) => {
21398
21755
  };
21399
21756
  const getFirstEnabledOptionIndex = (options) => options.findIndex((option) => !option.disabled);
21400
21757
  const LOAD_MORE_THRESHOLD_PX = 32;
21401
- const defaultGetCreateOptionLabel = (inputValue) => `Create “${inputValue}”`;
21758
+ const defaultGetCreateOptionLabel = (inputValue) => `Add “${inputValue}”`;
21402
21759
  const chipSizeByAutocompleteSize = {
21403
21760
  sm: "sm",
21404
21761
  md: "sm",
@@ -21419,7 +21776,7 @@ const getDismissReason = (reason) => {
21419
21776
  return reason === "escape-key" ? "escape" : "outside-press";
21420
21777
  };
21421
21778
  const useAutocompleteController = (props) => {
21422
- var _a, _b, _c;
21779
+ const floatingLayer = useFloatingLayer();
21423
21780
  const fieldContext = useFieldContext();
21424
21781
  const {
21425
21782
  value: controlledValue,
@@ -21492,8 +21849,6 @@ const useAutocompleteController = (props) => {
21492
21849
  () => new Map(options.map((option) => [option.value, option])),
21493
21850
  [options]
21494
21851
  );
21495
- const initialValue = controlledValue ?? defaultValue;
21496
- const initialSelectedLabel = typeof initialValue === "string" ? ((_a = optionByValue.get(initialValue)) == null ? void 0 : _a.label) ?? initialValue : "";
21497
21852
  const handleValueChange = useCallback(
21498
21853
  (nextValue, reason) => {
21499
21854
  if (multiple) {
@@ -21529,13 +21884,12 @@ const useAutocompleteController = (props) => {
21529
21884
  defaultValue,
21530
21885
  onValueChange: handleValueChange,
21531
21886
  inputValue: controlledInputValue,
21532
- defaultInputValue: defaultInputValue ?? initialSelectedLabel,
21887
+ defaultInputValue,
21533
21888
  onInputValueChange: handleInputValueChange,
21534
21889
  open: controlledOpen,
21535
21890
  defaultOpen,
21536
21891
  onOpenChange,
21537
21892
  multiple,
21538
- selectedOptionLabel: typeof controlledValue === "string" ? ((_b = optionByValue.get(controlledValue)) == null ? void 0 : _b.label) ?? controlledValue : void 0,
21539
21893
  disabled,
21540
21894
  readOnly
21541
21895
  });
@@ -21546,14 +21900,18 @@ const useAutocompleteController = (props) => {
21546
21900
  () => getAutocompleteValueArray(currentValue, Boolean(multiple)),
21547
21901
  [currentValue, multiple]
21548
21902
  );
21903
+ const selectedOptions = useMemo(
21904
+ () => selectedValues.map((selectedValue) => optionByValue.get(selectedValue)),
21905
+ [optionByValue, selectedValues]
21906
+ );
21549
21907
  const selectedLabels = useMemo(
21550
21908
  () => selectedValues.map(
21551
- (selectedValue) => {
21552
- var _a2;
21553
- return ((_a2 = optionByValue.get(selectedValue)) == null ? void 0 : _a2.label) ?? selectedValue;
21909
+ (selectedValue, index2) => {
21910
+ var _a;
21911
+ return ((_a = selectedOptions[index2]) == null ? void 0 : _a.label) ?? selectedValue;
21554
21912
  }
21555
21913
  ),
21556
- [optionByValue, selectedValues]
21914
+ [selectedOptions, selectedValues]
21557
21915
  );
21558
21916
  const visibleOptions = useMemo(() => {
21559
21917
  const query = currentInputValue.trim();
@@ -21577,7 +21935,7 @@ const useAutocompleteController = (props) => {
21577
21935
  };
21578
21936
  }, [allowCustomValue, currentInputValue, getCreateOptionLabel, options]);
21579
21937
  const navigationItems = useMemo(
21580
- () => createOption ? [...visibleOptions, createOption] : visibleOptions,
21938
+ () => createOption ? [createOption, ...visibleOptions] : visibleOptions,
21581
21939
  [createOption, visibleOptions]
21582
21940
  );
21583
21941
  const disabledIndices = useMemo(
@@ -21630,21 +21988,19 @@ const useAutocompleteController = (props) => {
21630
21988
  const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(
21631
21989
  [dismiss, role, listNavigation]
21632
21990
  );
21633
- const classes = autocomplete({ size: size$12 });
21991
+ const classes = autocomplete({ size: size$12, layer: floatingLayer });
21634
21992
  const chipSize = resolveChipSize$1(size$12);
21635
21993
  const shouldLimitTags = Boolean(multiple) && typeof limitTags === "number" && limitTags >= 0 && !focusedWithin;
21636
21994
  const visibleTagCount = shouldLimitTags ? limitTags : selectedValues.length;
21637
21995
  const visibleSelectedValues = selectedValues.slice(0, visibleTagCount);
21638
21996
  const hiddenTagCount = selectedValues.length - visibleSelectedValues.length;
21639
- const selectedSingleLabel = typeof currentValue === "string" ? ((_c = optionByValue.get(currentValue)) == null ? void 0 : _c.label) ?? currentValue : "";
21640
- const displayedInputValue = !multiple && typeof currentValue === "string" && !currentInputValue ? selectedSingleLabel : currentInputValue;
21641
21997
  const focusInput = useCallback(() => {
21642
- var _a2;
21643
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
21998
+ var _a;
21999
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
21644
22000
  }, []);
21645
22001
  const focusToken = useCallback((index2) => {
21646
- var _a2;
21647
- (_a2 = tokenRefs.current[index2]) == null ? void 0 : _a2.focus();
22002
+ var _a;
22003
+ (_a = tokenRefs.current[index2]) == null ? void 0 : _a.focus();
21648
22004
  }, []);
21649
22005
  const handleOptionSelect = useCallback(
21650
22006
  (option) => {
@@ -21723,26 +22079,10 @@ const useAutocompleteController = (props) => {
21723
22079
  },
21724
22080
  [state]
21725
22081
  );
21726
- const handleInputFocus = useCallback(
21727
- (event) => {
21728
- setFocusedWithin(true);
21729
- state.openPopup("focus");
21730
- if (!multiple && typeof currentValue === "string") {
21731
- event.currentTarget.select();
21732
- }
21733
- },
21734
- [currentValue, multiple, state]
21735
- );
21736
- const handleInputMouseDown = useCallback(
21737
- (event) => {
21738
- if (!multiple && typeof currentValue === "string" && document.activeElement !== event.currentTarget) {
21739
- event.preventDefault();
21740
- event.currentTarget.focus();
21741
- event.currentTarget.select();
21742
- }
21743
- },
21744
- [currentValue, multiple]
21745
- );
22082
+ const handleInputFocus = useCallback(() => {
22083
+ setFocusedWithin(true);
22084
+ state.openPopup("focus");
22085
+ }, [state]);
21746
22086
  const handleInputKeyDown = useCallback(
21747
22087
  (event) => {
21748
22088
  if (disabled || readOnly) {
@@ -21766,12 +22106,12 @@ const useAutocompleteController = (props) => {
21766
22106
  }
21767
22107
  return;
21768
22108
  }
21769
- if ((event.key === "Backspace" || event.key === "Delete") && currentInputValue.length === 0 && multiple && visibleSelectedValues.length > 0) {
22109
+ if ((event.key === "Backspace" || event.key === "Delete") && currentInputValue.length === 0 && visibleSelectedValues.length > 0) {
21770
22110
  event.preventDefault();
21771
22111
  focusToken(visibleSelectedValues.length - 1);
21772
22112
  return;
21773
22113
  }
21774
- if (event.key === "ArrowLeft" && currentInputValue.length === 0 && multiple && visibleSelectedValues.length > 0) {
22114
+ if (event.key === "ArrowLeft" && currentInputValue.length === 0 && visibleSelectedValues.length > 0) {
21775
22115
  event.preventDefault();
21776
22116
  focusToken(visibleSelectedValues.length - 1);
21777
22117
  }
@@ -21782,7 +22122,6 @@ const useAutocompleteController = (props) => {
21782
22122
  focusToken,
21783
22123
  handleOptionSelect,
21784
22124
  isOpen,
21785
- multiple,
21786
22125
  navigationItems,
21787
22126
  readOnly,
21788
22127
  resolvedActiveIndex,
@@ -21794,10 +22133,10 @@ const useAutocompleteController = (props) => {
21794
22133
  (event) => {
21795
22134
  const nextTarget = event.relatedTarget;
21796
22135
  requestAnimationFrame(() => {
21797
- var _a2, _b2, _c2, _d;
22136
+ var _a, _b, _c, _d;
21798
22137
  const activeElement2 = document.activeElement;
21799
- const isInsideRoot = nextTarget && ((_a2 = rootRef.current) == null ? void 0 : _a2.contains(nextTarget)) || activeElement2 && ((_b2 = rootRef.current) == null ? void 0 : _b2.contains(activeElement2));
21800
- const isInsideFloating = nextTarget && ((_c2 = floatingElementRef.current) == null ? void 0 : _c2.contains(nextTarget)) || activeElement2 && ((_d = floatingElementRef.current) == null ? void 0 : _d.contains(activeElement2));
22138
+ const isInsideRoot = nextTarget && ((_a = rootRef.current) == null ? void 0 : _a.contains(nextTarget)) || activeElement2 && ((_b = rootRef.current) == null ? void 0 : _b.contains(activeElement2));
22139
+ const isInsideFloating = nextTarget && ((_c = floatingElementRef.current) == null ? void 0 : _c.contains(nextTarget)) || activeElement2 && ((_d = floatingElementRef.current) == null ? void 0 : _d.contains(activeElement2));
21801
22140
  if (!isInsideRoot && !isInsideFloating) {
21802
22141
  setFocusedWithin(false);
21803
22142
  setActiveIndex(null);
@@ -21865,7 +22204,6 @@ const useAutocompleteController = (props) => {
21865
22204
  currentValue,
21866
22205
  density,
21867
22206
  disabled,
21868
- displayedInputValue,
21869
22207
  error: error2,
21870
22208
  floating,
21871
22209
  getFloatingProps,
@@ -21877,7 +22215,6 @@ const useAutocompleteController = (props) => {
21877
22215
  handleInputChange,
21878
22216
  handleInputFocus,
21879
22217
  handleInputKeyDown,
21880
- handleInputMouseDown,
21881
22218
  handleListScroll,
21882
22219
  handleOptionSelect,
21883
22220
  handleTokenDismiss,
@@ -21900,6 +22237,7 @@ const useAutocompleteController = (props) => {
21900
22237
  readOnly,
21901
22238
  rootRef,
21902
22239
  selectedLabels,
22240
+ selectedOptions,
21903
22241
  selectedValues,
21904
22242
  setFloatingRef,
21905
22243
  setItemRef,
@@ -21925,7 +22263,6 @@ const Autocomplete = (props) => {
21925
22263
  currentValue,
21926
22264
  density,
21927
22265
  disabled,
21928
- displayedInputValue,
21929
22266
  error: error2,
21930
22267
  floating,
21931
22268
  getFloatingProps,
@@ -21937,7 +22274,6 @@ const Autocomplete = (props) => {
21937
22274
  handleInputChange,
21938
22275
  handleInputFocus,
21939
22276
  handleInputKeyDown,
21940
- handleInputMouseDown,
21941
22277
  handleListScroll,
21942
22278
  handleOptionSelect,
21943
22279
  handleTokenDismiss,
@@ -21960,6 +22296,7 @@ const Autocomplete = (props) => {
21960
22296
  readOnly,
21961
22297
  rootRef,
21962
22298
  selectedLabels,
22299
+ selectedOptions,
21963
22300
  selectedValues,
21964
22301
  setFloatingRef,
21965
22302
  setItemRef,
@@ -22003,7 +22340,8 @@ const Autocomplete = (props) => {
22003
22340
  onMouseDown: handleControlMouseDown,
22004
22341
  children: [
22005
22342
  /* @__PURE__ */ jsxs(Box, { className: classes.valueContainer, children: [
22006
- multiple && visibleSelectedValues.map((selectedValue, index2) => {
22343
+ visibleSelectedValues.map((selectedValue, index2) => {
22344
+ var _a;
22007
22345
  const label2 = selectedLabels[index2] ?? selectedValue;
22008
22346
  return /* @__PURE__ */ jsx(
22009
22347
  AutocompleteToken,
@@ -22011,6 +22349,7 @@ const Autocomplete = (props) => {
22011
22349
  className: classes.token,
22012
22350
  size: chipSize,
22013
22351
  label: label2,
22352
+ isNew: (_a = selectedOptions[index2]) == null ? void 0 : _a.created,
22014
22353
  disabled: disabled || readOnly,
22015
22354
  dismissButtonRef: (node) => setTokenRef(index2, node),
22016
22355
  onDismiss: () => handleTokenDismiss(selectedValue, label2),
@@ -22051,13 +22390,12 @@ const Autocomplete = (props) => {
22051
22390
  disabled,
22052
22391
  readOnly,
22053
22392
  placeholder: selectedValues.length === 0 ? placeholder : void 0,
22054
- value: displayedInputValue,
22393
+ value: currentInputValue,
22055
22394
  className: classes.input,
22056
22395
  onChange: handleInputChange,
22057
22396
  ...getReferenceProps({
22058
22397
  onFocus: handleInputFocus,
22059
- onKeyDown: handleInputKeyDown,
22060
- onMouseDown: handleInputMouseDown
22398
+ onKeyDown: handleInputKeyDown
22061
22399
  }),
22062
22400
  autoComplete: "off"
22063
22401
  }
@@ -22078,7 +22416,7 @@ const Autocomplete = (props) => {
22078
22416
  children: announcement
22079
22417
  }
22080
22418
  ),
22081
- isOpen && !disabled && !readOnly && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsx(
22419
+ isOpen && !disabled && !readOnly && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: floating.elements.domReference, children: /* @__PURE__ */ jsx(
22082
22420
  FloatingFocusManager,
22083
22421
  {
22084
22422
  context: floating.context,
@@ -22174,6 +22512,7 @@ const getSelectedOptions = (options, value, multiple) => {
22174
22512
  return options.filter((option) => selectedValueSet.has(option.props.value));
22175
22513
  };
22176
22514
  const Select = (props) => {
22515
+ const floatingLayer = useFloatingLayer();
22177
22516
  const {
22178
22517
  value: controlledValue,
22179
22518
  defaultValue = null,
@@ -22308,7 +22647,7 @@ const Select = (props) => {
22308
22647
  );
22309
22648
  const selectedOptions = getSelectedOptions(options, value, multiple);
22310
22649
  const classes = select({ size: size$12, multiple, autoSize });
22311
- const menuClasses = menu({ density });
22650
+ const menuClasses = menu({ density, layer: floatingLayer });
22312
22651
  const hasValue = value !== null && value !== void 0 && value !== "";
22313
22652
  const chipSize = resolveChipSize(size$12);
22314
22653
  const accessibleName = typeof displayValue === "string" && displayValue.length > 0 ? displayValue : placeholder;
@@ -22430,7 +22769,7 @@ const Select = (props) => {
22430
22769
  children: /* @__PURE__ */ jsx(Icon, { name: "caret-down" })
22431
22770
  }
22432
22771
  ),
22433
- isOpen && !disabled && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { children: /* @__PURE__ */ jsx(
22772
+ isOpen && !disabled && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(DsChainPortalRoot, { reference: floating.elements.domReference, children: /* @__PURE__ */ jsx(
22434
22773
  FloatingFocusManager,
22435
22774
  {
22436
22775
  context: floating.context,
@@ -22777,6 +23116,7 @@ export {
22777
23116
  Chip,
22778
23117
  ChipGroup,
22779
23118
  Code,
23119
+ ConfirmationModal,
22780
23120
  DateInput,
22781
23121
  DateMenu,
22782
23122
  DatePicker,
@@ -22810,6 +23150,7 @@ export {
22810
23150
  ModalBody,
22811
23151
  ModalFooter,
22812
23152
  ModalHeader,
23153
+ ModalWrapper,
22813
23154
  Option,
22814
23155
  Pre,
22815
23156
  Radio,
@@ -22847,13 +23188,14 @@ export {
22847
23188
  splitProps,
22848
23189
  useChipGroup,
22849
23190
  useContainerQuery,
23191
+ useForm2 as useForm,
22850
23192
  useIconConfig,
22851
23193
  useListContext,
22852
23194
  useMediaQuery,
22853
23195
  useMenuFilterContext,
22854
23196
  useMenuListContext,
22855
23197
  useMenuRootContext,
22856
- useModalContext,
23198
+ useModalWrapperContext,
22857
23199
  useTheme
22858
23200
  };
22859
23201
  //# sourceMappingURL=index.js.map