xmlui 0.10.24 → 0.10.25

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.
Files changed (36) hide show
  1. package/dist/lib/{index-DoIVkz5T.mjs → index-CCEPGw_x.mjs} +476 -477
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-CSGEd746.mjs → initMock-DFcCR7ey.mjs} +1 -1
  4. package/dist/lib/xmlui.d.ts +1 -0
  5. package/dist/lib/xmlui.mjs +1 -1
  6. package/dist/metadata/{collectedComponentMetadata-B3Hs8_cV.mjs → collectedComponentMetadata-mwkNkxN_.mjs} +472 -473
  7. package/dist/metadata/{initMock-DQrGwkya.mjs → initMock-BVxHA6wu.mjs} +1 -1
  8. package/dist/metadata/style.css +1 -1
  9. package/dist/metadata/xmlui-metadata.mjs +1 -1
  10. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  11. package/dist/scripts/package.json +1 -1
  12. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +2 -1
  13. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +1 -1
  14. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +30 -5
  15. package/dist/scripts/src/components/Form/Form.spec.js +2 -2
  16. package/dist/scripts/src/components/FormItem/FormItemNative.js +5 -1
  17. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +4 -6
  18. package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +19 -0
  19. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +103 -11
  20. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +6 -1
  21. package/dist/scripts/src/components/Option/Option.spec.js +3 -1
  22. package/dist/scripts/src/components/Select/HiddenOption.js +3 -3
  23. package/dist/scripts/src/components/Select/Select.js +2 -3
  24. package/dist/scripts/src/components/Select/Select.spec.js +4 -6
  25. package/dist/scripts/src/components/Select/SelectNative.js +187 -47
  26. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +11 -0
  27. package/dist/scripts/src/components-core/rendering/Container.js +3 -4
  28. package/dist/scripts/src/components-core/rendering/StateContainer.js +16 -18
  29. package/dist/scripts/src/components-core/rendering/reducer.js +6 -3
  30. package/dist/scripts/src/testing/ComponentDrivers.js +1 -1
  31. package/dist/standalone/xmlui-standalone.es.d.ts +1 -0
  32. package/dist/standalone/xmlui-standalone.umd.js +18 -18
  33. package/package.json +1 -1
  34. package/dist/scripts/src/components/Select/MultiSelectOption.js +0 -42
  35. package/dist/scripts/src/components/Select/SelectOption.js +0 -34
  36. package/dist/scripts/src/components/Select/SimpleSelect.js +0 -57
@@ -29,12 +29,10 @@ import { RenderPropSticky } from "react-sticky-el";
29
29
  import * as dropzone from "react-dropzone";
30
30
  import toast, { Toaster, ToastBar } from "react-hot-toast";
31
31
  import memoizeOne from "memoize-one";
32
- import { Popover, PopoverTrigger, Portal as Portal$1, PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
33
- import { FocusScope } from "@radix-ui/react-focus-scope";
34
- import { Item as Item$1, ItemText, ItemIndicator, Root, Trigger, Portal, Content, ScrollUpButton, Viewport, ScrollDownButton, SelectItemText } from "@radix-ui/react-select";
32
+ import { Popover, PopoverTrigger, Portal, PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
35
33
  import * as InnerRadioGroup from "@radix-ui/react-radio-group";
36
34
  import { DayPicker } from "react-day-picker";
37
- import { Root as Root$1, Track, Range, Thumb } from "@radix-ui/react-slider";
35
+ import { Root, Track, Range, Thumb } from "@radix-ui/react-slider";
38
36
  import * as RadixTooltip from "@radix-ui/react-tooltip";
39
37
  import ReactMarkdown from "react-markdown";
40
38
  import remarkGfm from "remark-gfm";
@@ -44,7 +42,7 @@ import EmojiPicker, { EmojiStyle } from "emoji-picker-react";
44
42
  import * as HoverCard from "@radix-ui/react-hover-card";
45
43
  import { useSpring, useInView, animated } from "@react-spring/web";
46
44
  import Papa from "papaparse";
47
- import { Root as Root$2, List, Trigger as Trigger$1, Content as Content$1 } from "@radix-ui/react-tabs";
45
+ import { Root as Root$1, List, Trigger, Content } from "@radix-ui/react-tabs";
48
46
  import scrollIntoView from "scroll-into-view-if-needed";
49
47
  import * as RAccordion from "@radix-ui/react-accordion";
50
48
  import useEmblaCarousel from "embla-carousel-react";
@@ -751,18 +749,19 @@ function getElementRef(element) {
751
749
  return element.props.ref || element.ref;
752
750
  }
753
751
  const themeVars$11 = `'{"textColor-FormItemLabel": "var(--xmlui-textColor-FormItemLabel)", "fontFamily-FormItemLabel": "var(--xmlui-fontFamily-FormItemLabel)", "fontSize-FormItemLabel": "var(--xmlui-fontSize-FormItemLabel)", "fontWeight-FormItemLabel": "var(--xmlui-fontWeight-FormItemLabel)", "fontStyle-FormItemLabel": "var(--xmlui-fontStyle-FormItemLabel)", "textTransform-FormItemLabel": "var(--xmlui-textTransform-FormItemLabel)", "textColor-FormItemLabel-required": "var(--xmlui-textColor-FormItemLabel-required)", "fontSize-FormItemLabel-required": "var(--xmlui-fontSize-FormItemLabel-required)", "fontWeight-FormItemLabel-required": "var(--xmlui-fontWeight-FormItemLabel-required)", "fontStyle-FormItemLabel-required": "var(--xmlui-fontStyle-FormItemLabel-required)", "textTransform-FormItemLabel-required": "var(--xmlui-textTransform-FormItemLabel-required)", "textColor-FormItemLabel-requiredMark": "var(--xmlui-textColor-FormItemLabel-requiredMark)"}'`;
754
- const container$3 = "_container_1pi4w_14";
755
- const top$1 = "_top_1pi4w_21";
756
- const end = "_end_1pi4w_26";
757
- const bottom$1 = "_bottom_1pi4w_32";
758
- const start = "_start_1pi4w_37";
759
- const shrinkToLabel = "_shrinkToLabel_1pi4w_43";
760
- const inputLabel = "_inputLabel_1pi4w_46";
761
- const disabled$c = "_disabled_1pi4w_59";
762
- const labelBreak = "_labelBreak_1pi4w_63";
763
- const required = "_required_1pi4w_68";
764
- const requiredMark = "_requiredMark_1pi4w_75";
765
- const itemWithLabel = "_itemWithLabel_1pi4w_79";
752
+ const container$3 = "_container_1bx6o_14";
753
+ const top$1 = "_top_1bx6o_21";
754
+ const end = "_end_1bx6o_26";
755
+ const bottom$1 = "_bottom_1bx6o_32";
756
+ const start = "_start_1bx6o_37";
757
+ const shrinkToLabel = "_shrinkToLabel_1bx6o_43";
758
+ const inputLabel = "_inputLabel_1bx6o_46";
759
+ const disabled$c = "_disabled_1bx6o_59";
760
+ const labelBreak = "_labelBreak_1bx6o_63";
761
+ const required = "_required_1bx6o_68";
762
+ const requiredMark = "_requiredMark_1bx6o_75";
763
+ const itemWithLabel = "_itemWithLabel_1bx6o_79";
764
+ const helperTextContainer = "_helperTextContainer_1bx6o_85";
766
765
  const styles$1k = {
767
766
  themeVars: themeVars$11,
768
767
  container: container$3,
@@ -776,7 +775,8 @@ const styles$1k = {
776
775
  labelBreak,
777
776
  required,
778
777
  requiredMark,
779
- itemWithLabel
778
+ itemWithLabel,
779
+ helperTextContainer
780
780
  };
781
781
  const themeVars$10 = `'{"size-Spinner": "var(--xmlui-size-Spinner)", "thickness-Spinner": "var(--xmlui-thickness-Spinner)", "borderColor-Spinner": "var(--xmlui-borderColor-Spinner)"}'`;
782
782
  const fullScreenSpinnerWrapper = "_fullScreenSpinnerWrapper_b1pgc_50";
@@ -4671,6 +4671,7 @@ const AppLayoutContext = createContext(null);
4671
4671
  function useAppLayoutContext() {
4672
4672
  return useContext(AppLayoutContext);
4673
4673
  }
4674
+ const PART_HAMBURGER = "hamburger";
4674
4675
  const defaultProps$1a = {
4675
4676
  showLogo: true,
4676
4677
  showNavPanelIf: true
@@ -4721,6 +4722,7 @@ const AppHeader = ({
4721
4722
  hasRegisteredNavPanel && showNavPanelIf && /* @__PURE__ */ jsx(
4722
4723
  Button,
4723
4724
  {
4725
+ "data-part-id": PART_HAMBURGER,
4724
4726
  onClick: toggleDrawer,
4725
4727
  icon: /* @__PURE__ */ jsx(Icon, { name: "hamburger" }),
4726
4728
  variant: "ghost",
@@ -5555,13 +5557,18 @@ const ExpandableNavGroup = forwardRef(function ExpandableNavGroup2({
5555
5557
  ...style2,
5556
5558
  "--nav-link-level": layoutIsVertical ? level : 0
5557
5559
  };
5560
+ const handleClick = (e) => {
5561
+ e.preventDefault();
5562
+ e.stopPropagation();
5563
+ setExpanded((prev) => !prev);
5564
+ };
5558
5565
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5559
5566
  /* @__PURE__ */ jsxs(
5560
5567
  NavLink,
5561
5568
  {
5562
5569
  ...rest,
5563
5570
  style: toggleStyle,
5564
- onClick: () => setExpanded((prev) => !prev),
5571
+ onClick: handleClick,
5565
5572
  icon: icon2,
5566
5573
  to,
5567
5574
  disabled: disabled2,
@@ -6034,7 +6041,7 @@ const themeVars$N = `'{"backgroundColor-Tree-row--selected": "var(--xmlui-backgr
6034
6041
  const wrapper$j = "_wrapper_eyur1_14";
6035
6042
  const rowWrapper = "_rowWrapper_eyur1_22";
6036
6043
  const selected$2 = "_selected_eyur1_39";
6037
- const focused$3 = "_focused_eyur1_46";
6044
+ const focused$2 = "_focused_eyur1_46";
6038
6045
  const gutter = "_gutter_eyur1_56";
6039
6046
  const toggleWrapper = "_toggleWrapper_eyur1_63";
6040
6047
  const hidden$2 = "_hidden_eyur1_72";
@@ -6046,7 +6053,7 @@ const styles$16 = {
6046
6053
  wrapper: wrapper$j,
6047
6054
  rowWrapper,
6048
6055
  selected: selected$2,
6049
- focused: focused$3,
6056
+ focused: focused$2,
6050
6057
  gutter,
6051
6058
  toggleWrapper,
6052
6059
  hidden: hidden$2,
@@ -11740,7 +11747,7 @@ const showInHeader = "_showInHeader_1ylgd_138";
11740
11747
  const selected$1 = "_selected_1ylgd_142";
11741
11748
  const allSelected = "_allSelected_1ylgd_142";
11742
11749
  const cellContent = "_cellContent_1ylgd_173";
11743
- const focused$2 = "_focused_1ylgd_200";
11750
+ const focused$1 = "_focused_1ylgd_200";
11744
11751
  const disabled$8 = "_disabled_1ylgd_212";
11745
11752
  const noBottomBorder = "_noBottomBorder_1ylgd_219";
11746
11753
  const noRows$1 = "_noRows_1ylgd_244";
@@ -11769,7 +11776,7 @@ const styles$12 = {
11769
11776
  selected: selected$1,
11770
11777
  allSelected,
11771
11778
  cellContent,
11772
- focused: focused$2,
11779
+ focused: focused$1,
11773
11780
  disabled: disabled$8,
11774
11781
  noBottomBorder,
11775
11782
  noRows: noRows$1,
@@ -15709,6 +15716,7 @@ const modalViewComponentRenderer = createComponentRenderer(
15709
15716
  ModalDialogMd,
15710
15717
  ({
15711
15718
  node,
15719
+ contextVars,
15712
15720
  extractValue,
15713
15721
  className,
15714
15722
  renderChild: renderChild2,
@@ -15732,7 +15740,11 @@ const modalViewComponentRenderer = createComponentRenderer(
15732
15740
  node,
15733
15741
  renderChild: renderChild2,
15734
15742
  layoutContext: { _insideModalFrame: true },
15735
- contextVars: { $param: openParams == null ? void 0 : openParams[0], $params: openParams }
15743
+ contextVars: {
15744
+ ...contextVars,
15745
+ $param: openParams == null ? void 0 : openParams[0],
15746
+ $params: openParams
15747
+ }
15736
15748
  }
15737
15749
  );
15738
15750
  }
@@ -20533,72 +20545,48 @@ function useLongPress(elementRef, action2, delay2 = 500) {
20533
20545
  };
20534
20546
  }, [elementRef, action2, delay2]);
20535
20547
  }
20536
- const SelectContext = createContext({
20537
- value: null,
20538
- onChange: (selectedValue) => {
20539
- },
20540
- setOpen: (open) => {
20541
- },
20542
- setSelectedIndex: (index) => {
20543
- },
20544
- options: /* @__PURE__ */ new Set(),
20545
- optionRenderer: void 0
20546
- });
20547
- function useSelect() {
20548
- return useContext(SelectContext);
20549
- }
20550
- const OptionContext = createContext({
20551
- onOptionAdd: () => {
20552
- },
20553
- onOptionRemove: () => {
20554
- }
20555
- });
20556
- function useOption() {
20557
- return useContext(OptionContext);
20558
- }
20559
20548
  const themeVars$p = `'{"border-Select": "var(--xmlui-border-Select)", "borderHorizontal-Select": "var(--xmlui-borderHorizontal-Select, var(--xmlui-border-Select))", "borderVertical-Select": "var(--xmlui-borderVertical-Select, var(--xmlui-border-Select))", "borderLeft-Select": "var(--xmlui-borderLeft-Select, var(--xmlui-borderHorizontal-Select, var(--xmlui-border-Select)))", "borderRight-Select": "var(--xmlui-borderRight-Select, var(--xmlui-borderHorizontal-Select, var(--xmlui-border-Select)))", "borderTop-Select": "var(--xmlui-borderTop-Select, var(--xmlui-borderVertical-Select, var(--xmlui-border-Select)))", "borderBottom-Select": "var(--xmlui-borderBottom-Select, var(--xmlui-borderVertical-Select, var(--xmlui-border-Select)))", "borderWidth-Select": "var(--xmlui-borderWidth-Select)", "borderHorizontalWidth-Select": "var(--xmlui-borderHorizontalWidth-Select, var(--xmlui-borderWidth-Select))", "borderLeftWidth-Select": "var(--xmlui-borderLeftWidth-Select, var(--xmlui-borderHorizontalWidth-Select, var(--xmlui-borderWidth-Select)))", "borderRightWidth-Select": "var(--xmlui-borderRightWidth-Select, var(--xmlui-borderHorizontalWidth-Select, var(--xmlui-borderWidth-Select)))", "borderVerticalWidth-Select": "var(--xmlui-borderVerticalWidth-Select, var(--xmlui-borderWidth-Select))", "borderTopWidth-Select": "var(--xmlui-borderTopWidth-Select, var(--xmlui-borderVerticalWidth-Select, var(--xmlui-borderWidth-Select)))", "borderBottomWidth-Select": "var(--xmlui-borderBottomWidth-Select, var(--xmlui-borderVerticalWidth-Select, var(--xmlui-borderWidth-Select)))", "borderStyle-Select": "var(--xmlui-borderStyle-Select)", "borderHorizontalStyle-Select": "var(--xmlui-borderHorizontalStyle-Select, var(--xmlui-borderStyle-Select))", "borderLeftStyle-Select": "var(--xmlui-borderLeftStyle-Select, var(--xmlui-borderHorizontalStyle-Select, var(--xmlui-borderStyle-Select)))", "borderRightStyle-Select": "var(--xmlui-borderRightStyle-Select, var(--xmlui-borderHorizontalStyle-Select, var(--xmlui-borderStyle-Select)))", "borderVerticalStyle-Select": "var(--xmlui-borderVerticalStyle-Select, var(--xmlui-borderStyle-Select))", "borderTopStyle-Select": "var(--xmlui-borderTopStyle-Select, var(--xmlui-borderVerticalStyle-Select, var(--xmlui-borderStyle-Select)))", "borderBottomStyle-Select": "var(--xmlui-borderBottomStyle-Select, var(--xmlui-borderVerticalStyle-Select, var(--xmlui-borderStyle-Select)))", "borderColor-Select": "var(--xmlui-borderColor-Select)", "borderHorizontalColor-Select": "var(--xmlui-borderHorizontalColor-Select, var(--xmlui-borderColor-Select))", "borderLeftColor-Select": "var(--xmlui-borderLeftColor-Select, var(--xmlui-borderHorizontalColor-Select, var(--xmlui-borderColor-Select)))", "borderRightColor-Select": "var(--xmlui-borderRightColor-Select, var(--xmlui-borderHorizontalColor-Select, var(--xmlui-borderColor-Select)))", "borderVerticalColor-Select": "var(--xmlui-borderVerticalColor-Select, var(--xmlui-borderColor-Select))", "borderTopColor-Select": "var(--xmlui-borderTopColor-Select, var(--xmlui-borderVerticalColor-Select, var(--xmlui-borderColor-Select)))", "borderBottomColor-Select": "var(--xmlui-borderBottomColor-Select, var(--xmlui-borderVerticalColor-Select, var(--xmlui-borderColor-Select)))", "borderStartStartRadius-Select": "var(--xmlui-borderStartStartRadius-Select, var(--xmlui-borderRadius-Select))", "borderStartEndRadius-Select": "var(--xmlui-borderStartEndRadius-Select, var(--xmlui-borderRadius-Select))", "borderEndStartRadius-Select": "var(--xmlui-borderEndStartRadius-Select, var(--xmlui-borderRadius-Select))", "borderEndEndRadius-Select": "var(--xmlui-borderEndEndRadius-Select, var(--xmlui-borderRadius-Select))", "padding-Select": "var(--xmlui-padding-Select)", "paddingHorizontal-Select": "var(--xmlui-paddingHorizontal-Select, var(--xmlui-padding-Select))", "paddingVertical-Select": "var(--xmlui-paddingVertical-Select, var(--xmlui-padding-Select))", "paddingLeft-Select": "var(--xmlui-paddingLeft-Select, var(--xmlui-paddingHorizontal-Select, var(--xmlui-padding-Select)))", "paddingRight-Select": "var(--xmlui-paddingRight-Select, var(--xmlui-paddingHorizontal-Select, var(--xmlui-padding-Select)))", "paddingTop-Select": "var(--xmlui-paddingTop-Select, var(--xmlui-paddingVertical-Select, var(--xmlui-padding-Select)))", "paddingBottom-Select": "var(--xmlui-paddingBottom-Select, var(--xmlui-paddingVertical-Select, var(--xmlui-padding-Select)))", "padding-item-Select": "var(--xmlui-padding-item-Select)", "paddingHorizontal-item-Select": "var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select))", "paddingVertical-item-Select": "var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select))", "paddingLeft-item-Select": "var(--xmlui-paddingLeft-item-Select, var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select)))", "paddingRight-item-Select": "var(--xmlui-paddingRight-item-Select, var(--xmlui-paddingHorizontal-item-Select, var(--xmlui-padding-item-Select)))", "paddingTop-item-Select": "var(--xmlui-paddingTop-item-Select, var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select)))", "paddingBottom-item-Select": "var(--xmlui-paddingBottom-item-Select, var(--xmlui-paddingVertical-item-Select, var(--xmlui-padding-item-Select)))", "Input:borderRadius-Select-default": "var(--xmlui-borderRadius-Select-default)", "Input:borderColor-Select-default": "var(--xmlui-borderColor-Select-default)", "Input:borderWidth-Select-default": "var(--xmlui-borderWidth-Select-default)", "Input:borderStyle-Select-default": "var(--xmlui-borderStyle-Select-default)", "Input:fontSize-Select-default": "var(--xmlui-fontSize-Select-default)", "Input:backgroundColor-Select-default": "var(--xmlui-backgroundColor-Select-default)", "Input:boxShadow-Select-default": "var(--xmlui-boxShadow-Select-default)", "Input:textColor-Select-default": "var(--xmlui-textColor-Select-default)", "Input:borderColor-Select-default--hover": "var(--xmlui-borderColor-Select-default--hover)", "Input:backgroundColor-Select-default--hover": "var(--xmlui-backgroundColor-Select-default--hover)", "Input:boxShadow-Select-default--hover": "var(--xmlui-boxShadow-Select-default--hover)", "Input:textColor-Select-default--hover": "var(--xmlui-textColor-Select-default--hover)", "Input:outlineWidth-Select-default--focus": "var(--xmlui-outlineWidth-Select-default--focus)", "Input:outlineColor-Select-default--focus": "var(--xmlui-outlineColor-Select-default--focus)", "Input:outlineStyle-Select-default--focus": "var(--xmlui-outlineStyle-Select-default--focus)", "Input:outlineOffset-Select-default--focus": "var(--xmlui-outlineOffset-Select-default--focus)", "Input:textColor-placeholder-Select-default": "var(--xmlui-textColor-placeholder-Select-default)", "Input:fontSize-placeholder-Select-default": "var(--xmlui-fontSize-placeholder-Select-default)", "Input:borderRadius-Select-error": "var(--xmlui-borderRadius-Select-error)", "Input:borderColor-Select-error": "var(--xmlui-borderColor-Select-error)", "Input:borderWidth-Select-error": "var(--xmlui-borderWidth-Select-error)", "Input:borderStyle-Select-error": "var(--xmlui-borderStyle-Select-error)", "Input:fontSize-Select-error": "var(--xmlui-fontSize-Select-error)", "Input:backgroundColor-Select-error": "var(--xmlui-backgroundColor-Select-error)", "Input:boxShadow-Select-error": "var(--xmlui-boxShadow-Select-error)", "Input:textColor-Select-error": "var(--xmlui-textColor-Select-error)", "Input:borderColor-Select-error--hover": "var(--xmlui-borderColor-Select-error--hover)", "Input:backgroundColor-Select-error--hover": "var(--xmlui-backgroundColor-Select-error--hover)", "Input:boxShadow-Select-error--hover": "var(--xmlui-boxShadow-Select-error--hover)", "Input:textColor-Select-error--hover": "var(--xmlui-textColor-Select-error--hover)", "Input:outlineWidth-Select-error--focus": "var(--xmlui-outlineWidth-Select-error--focus)", "Input:outlineColor-Select-error--focus": "var(--xmlui-outlineColor-Select-error--focus)", "Input:outlineStyle-Select-error--focus": "var(--xmlui-outlineStyle-Select-error--focus)", "Input:outlineOffset-Select-error--focus": "var(--xmlui-outlineOffset-Select-error--focus)", "Input:textColor-placeholder-Select-error": "var(--xmlui-textColor-placeholder-Select-error)", "Input:fontSize-placeholder-Select-error": "var(--xmlui-fontSize-placeholder-Select-error)", "Input:borderRadius-Select-warning": "var(--xmlui-borderRadius-Select-warning)", "Input:borderColor-Select-warning": "var(--xmlui-borderColor-Select-warning)", "Input:borderWidth-Select-warning": "var(--xmlui-borderWidth-Select-warning)", "Input:borderStyle-Select-warning": "var(--xmlui-borderStyle-Select-warning)", "Input:fontSize-Select-warning": "var(--xmlui-fontSize-Select-warning)", "Input:backgroundColor-Select-warning": "var(--xmlui-backgroundColor-Select-warning)", "Input:boxShadow-Select-warning": "var(--xmlui-boxShadow-Select-warning)", "Input:textColor-Select-warning": "var(--xmlui-textColor-Select-warning)", "Input:borderColor-Select-warning--hover": "var(--xmlui-borderColor-Select-warning--hover)", "Input:backgroundColor-Select-warning--hover": "var(--xmlui-backgroundColor-Select-warning--hover)", "Input:boxShadow-Select-warning--hover": "var(--xmlui-boxShadow-Select-warning--hover)", "Input:textColor-Select-warning--hover": "var(--xmlui-textColor-Select-warning--hover)", "Input:outlineWidth-Select-warning--focus": "var(--xmlui-outlineWidth-Select-warning--focus)", "Input:outlineColor-Select-warning--focus": "var(--xmlui-outlineColor-Select-warning--focus)", "Input:outlineStyle-Select-warning--focus": "var(--xmlui-outlineStyle-Select-warning--focus)", "Input:outlineOffset-Select-warning--focus": "var(--xmlui-outlineOffset-Select-warning--focus)", "Input:textColor-placeholder-Select-warning": "var(--xmlui-textColor-placeholder-Select-warning)", "Input:fontSize-placeholder-Select-warning": "var(--xmlui-fontSize-placeholder-Select-warning)", "Input:borderRadius-Select-success": "var(--xmlui-borderRadius-Select-success)", "Input:borderColor-Select-success": "var(--xmlui-borderColor-Select-success)", "Input:borderWidth-Select-success": "var(--xmlui-borderWidth-Select-success)", "Input:borderStyle-Select-success": "var(--xmlui-borderStyle-Select-success)", "Input:fontSize-Select-success": "var(--xmlui-fontSize-Select-success)", "Input:backgroundColor-Select-success": "var(--xmlui-backgroundColor-Select-success)", "Input:boxShadow-Select-success": "var(--xmlui-boxShadow-Select-success)", "Input:textColor-Select-success": "var(--xmlui-textColor-Select-success)", "Input:borderColor-Select-success--hover": "var(--xmlui-borderColor-Select-success--hover)", "Input:backgroundColor-Select-success--hover": "var(--xmlui-backgroundColor-Select-success--hover)", "Input:boxShadow-Select-success--hover": "var(--xmlui-boxShadow-Select-success--hover)", "Input:textColor-Select-success--hover": "var(--xmlui-textColor-Select-success--hover)", "Input:outlineWidth-Select-success--focus": "var(--xmlui-outlineWidth-Select-success--focus)", "Input:outlineColor-Select-success--focus": "var(--xmlui-outlineColor-Select-success--focus)", "Input:outlineStyle-Select-success--focus": "var(--xmlui-outlineStyle-Select-success--focus)", "Input:outlineOffset-Select-success--focus": "var(--xmlui-outlineOffset-Select-success--focus)", "Input:textColor-placeholder-Select-success": "var(--xmlui-textColor-placeholder-Select-success)", "Input:fontSize-placeholder-Select-success": "var(--xmlui-fontSize-placeholder-Select-success)", "Input:backgroundColor-Select--disabled": "var(--xmlui-backgroundColor-Select--disabled)", "Input:textColor-Select--disabled": "var(--xmlui-textColor-Select--disabled)", "Input:borderColor-Select--disabled": "var(--xmlui-borderColor-Select--disabled)", "Input:outlineWidth-Select--focus": "var(--xmlui-outlineWidth-Select--focus)", "Input:outlineColor-Select--focus": "var(--xmlui-outlineColor-Select--focus)", "Input:outlineStyle-Select--focus": "var(--xmlui-outlineStyle-Select--focus)", "Input:outlineOffset-Select--focus": "var(--xmlui-outlineOffset-Select--focus)", "Input:textColor-placeholder-Select": "var(--xmlui-textColor-placeholder-Select)", "paddingVertical-Select-badge": "var(--xmlui-paddingVertical-Select-badge)", "paddingHorizontal-Select-badge": "var(--xmlui-paddingHorizontal-Select-badge)", "borderRadius-Select-badge": "var(--xmlui-borderRadius-Select-badge)", "Input:fontSize-Select-badge": "var(--xmlui-fontSize-Select-badge)", "Input:backgroundColor-Select-badge": "var(--xmlui-backgroundColor-Select-badge)", "Input:textColor-Select-badge": "var(--xmlui-textColor-Select-badge)", "Input:backgroundColor-Select-badge--hover": "var(--xmlui-backgroundColor-Select-badge--hover)", "Input:textColor-Select-badge--hover": "var(--xmlui-textColor-Select-badge--hover)", "Input:backgroundColor-Select-badge--active": "var(--xmlui-backgroundColor-Select-badge--active)", "Input:textColor-Select-badge--active": "var(--xmlui-textColor-Select-badge--active)", "Input:backgroundColor-menu-Select": "var(--xmlui-backgroundColor-menu-Select)", "Input:borderRadius-menu-Select": "var(--xmlui-borderRadius-menu-Select)", "Input:boxShadow-menu-Select": "var(--xmlui-boxShadow-menu-Select)", "Input:borderWidth-menu-Select": "var(--xmlui-borderWidth-menu-Select)", "Input:borderColor-menu-Select": "var(--xmlui-borderColor-menu-Select)", "backgroundColor-item-Select": "var(--xmlui-backgroundColor-item-Select)", "backgroundColor-item-Select--active": "var(--xmlui-backgroundColor-item-Select--active)", "backgroundColor-item-Select--hover": "var(--xmlui-backgroundColor-item-Select--hover)", "textColor-item-Select--disabled": "var(--xmlui-textColor-item-Select--disabled)", "opacity-text-item-Select--disabled": "var(--xmlui-opacity-text-item-Select--disabled)", "textColor-indicator-Select": "var(--xmlui-textColor-indicator-Select)"}'`;
20560
- const selectTrigger = "_selectTrigger_1v71t_17";
20561
- const error$9 = "_error_1v71t_54";
20562
- const warning$a = "_warning_1v71t_80";
20563
- const valid$9 = "_valid_1v71t_106";
20564
- const disabled$7 = "_disabled_1v71t_132";
20565
- const focused$1 = "_focused_1v71t_139";
20566
- const placeholder$1 = "_placeholder_1v71t_145";
20567
- const actions$1 = "_actions_1v71t_162";
20568
- const action$1 = "_action_1v71t_162";
20569
- const emptyList = "_emptyList_1v71t_173";
20570
- const badgeListContainer = "_badgeListContainer_1v71t_185";
20571
- const badgeList$1 = "_badgeList_1v71t_185";
20572
- const inputWrapper$1 = "_inputWrapper_1v71t_198";
20573
- const badge$1 = "_badge_1v71t_185";
20574
- const selectContent = "_selectContent_1v71t_233";
20575
- const command$1 = "_command_1v71t_241";
20576
- const commandInputContainer = "_commandInputContainer_1v71t_246";
20577
- const commandInput$1 = "_commandInput_1v71t_246";
20578
- const commandList$1 = "_commandList_1v71t_265";
20579
- const multiSelectOption = "_multiSelectOption_1v71t_272";
20580
- const multiSelectOptionContent = "_multiSelectOptionContent_1v71t_286";
20581
- const highlighted$1 = "_highlighted_1v71t_295";
20582
- const disabledOption$1 = "_disabledOption_1v71t_301";
20583
- const selectValue = "_selectValue_1v71t_316";
20584
- const selectDropdownContent = "_selectDropdownContent_1v71t_331";
20585
- const fadeIn = "_fadeIn_1v71t_1";
20586
- const zoomIn = "_zoomIn_1v71t_1";
20587
- const fadeOut = "_fadeOut_1v71t_1";
20588
- const zoomOut = "_zoomOut_1v71t_1";
20589
- const slideInFromTop = "_slideInFromTop_1v71t_1";
20590
- const slideInFromRight = "_slideInFromRight_1v71t_1";
20591
- const slideInFromLeft = "_slideInFromLeft_1v71t_1";
20592
- const slideInFromBottom = "_slideInFromBottom_1v71t_1";
20593
- const selectViewport = "_selectViewport_1v71t_364";
20594
- const selectScrollUpButton = "_selectScrollUpButton_1v71t_368";
20595
- const selectScrollDownButton = "_selectScrollDownButton_1v71t_376";
20596
- const selectEmpty = "_selectEmpty_1v71t_384";
20597
- const selectOption = "_selectOption_1v71t_397";
20598
- const selectOptionContent = "_selectOptionContent_1v71t_420";
20599
- const selectOptionIndicator = "_selectOptionIndicator_1v71t_434";
20600
- const loading = "_loading_1v71t_444";
20601
- const srOnly = "_srOnly_1v71t_447";
20549
+ const selectTrigger = "_selectTrigger_1rbu9_17";
20550
+ const error$9 = "_error_1rbu9_54";
20551
+ const warning$a = "_warning_1rbu9_80";
20552
+ const valid$9 = "_valid_1rbu9_106";
20553
+ const disabled$7 = "_disabled_1rbu9_132";
20554
+ const placeholder$1 = "_placeholder_1rbu9_145";
20555
+ const actions$1 = "_actions_1rbu9_162";
20556
+ const action$1 = "_action_1rbu9_162";
20557
+ const emptyList = "_emptyList_1rbu9_173";
20558
+ const badgeListContainer = "_badgeListContainer_1rbu9_185";
20559
+ const badgeList$1 = "_badgeList_1rbu9_185";
20560
+ const inputWrapper$1 = "_inputWrapper_1rbu9_198";
20561
+ const badge$1 = "_badge_1rbu9_185";
20562
+ const selectContent = "_selectContent_1rbu9_233";
20563
+ const command$1 = "_command_1rbu9_242";
20564
+ const commandInputContainer = "_commandInputContainer_1rbu9_247";
20565
+ const commandInput$1 = "_commandInput_1rbu9_247";
20566
+ const commandList$1 = "_commandList_1rbu9_266";
20567
+ const multiSelectOption = "_multiSelectOption_1rbu9_273";
20568
+ const multiSelectOptionContent = "_multiSelectOptionContent_1rbu9_287";
20569
+ const highlighted$1 = "_highlighted_1rbu9_296";
20570
+ const disabledOption$1 = "_disabledOption_1rbu9_302";
20571
+ const selectValue = "_selectValue_1rbu9_317";
20572
+ const selectDropdownContent = "_selectDropdownContent_1rbu9_332";
20573
+ const fadeIn = "_fadeIn_1rbu9_1";
20574
+ const zoomIn = "_zoomIn_1rbu9_1";
20575
+ const fadeOut = "_fadeOut_1rbu9_1";
20576
+ const zoomOut = "_zoomOut_1rbu9_1";
20577
+ const slideInFromTop = "_slideInFromTop_1rbu9_1";
20578
+ const slideInFromRight = "_slideInFromRight_1rbu9_1";
20579
+ const slideInFromLeft = "_slideInFromLeft_1rbu9_1";
20580
+ const slideInFromBottom = "_slideInFromBottom_1rbu9_1";
20581
+ const selectViewport = "_selectViewport_1rbu9_365";
20582
+ const selectScrollUpButton = "_selectScrollUpButton_1rbu9_369";
20583
+ const selectScrollDownButton = "_selectScrollDownButton_1rbu9_377";
20584
+ const selectEmpty = "_selectEmpty_1rbu9_385";
20585
+ const selectOption = "_selectOption_1rbu9_398";
20586
+ const selectOptionContent = "_selectOptionContent_1rbu9_421";
20587
+ const selectOptionIndicator = "_selectOptionIndicator_1rbu9_435";
20588
+ const loading = "_loading_1rbu9_445";
20589
+ const srOnly = "_srOnly_1rbu9_448";
20602
20590
  const styles$J = {
20603
20591
  themeVars: themeVars$p,
20604
20592
  selectTrigger,
@@ -20606,7 +20594,6 @@ const styles$J = {
20606
20594
  warning: warning$a,
20607
20595
  valid: valid$9,
20608
20596
  disabled: disabled$7,
20609
- focused: focused$1,
20610
20597
  placeholder: placeholder$1,
20611
20598
  actions: actions$1,
20612
20599
  action: action$1,
@@ -20644,57 +20631,20 @@ const styles$J = {
20644
20631
  loading,
20645
20632
  srOnly
20646
20633
  };
20647
- const SelectOption = forwardRef(
20648
- function SelectOption2(option, ref) {
20649
- const visibleContentRef = useRef(null);
20650
- const { value, label: label2, enabled: enabled2 = true, children, className } = option;
20651
- const { value: selectedValue, optionRenderer } = useSelect();
20652
- const { onOptionRemove, onOptionAdd } = useOption();
20653
- const opt = useMemo(() => {
20654
- return {
20655
- ...option,
20656
- label: label2 ?? "",
20657
- keywords: [label2 ?? ""]
20658
- };
20659
- }, [option, label2]);
20660
- useEffect(() => {
20661
- onOptionAdd(opt);
20662
- return () => onOptionRemove(opt);
20663
- }, [opt, onOptionAdd, onOptionRemove]);
20664
- return /* @__PURE__ */ jsxs(
20665
- Item$1,
20666
- {
20667
- ref,
20668
- className: classnames(className, styles$J.selectOption),
20669
- value,
20670
- textValue: label2,
20671
- disabled: !enabled2,
20672
- onClick: (event) => {
20673
- event.stopPropagation();
20674
- },
20675
- "data-state": selectedValue === value && "checked",
20676
- children: [
20677
- /* @__PURE__ */ jsx("span", { style: { display: "none" }, children: /* @__PURE__ */ jsx(ItemText, { children: label2 }) }),
20678
- children ? /* @__PURE__ */ jsxs(Fragment, { children: [
20679
- /* @__PURE__ */ jsx("div", { className: styles$J.selectOptionContent, ref: visibleContentRef, children }),
20680
- selectedValue === value && /* @__PURE__ */ jsx(ItemIndicator, { className: styles$J.selectOptionIndicator, children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) })
20681
- ] }) : optionRenderer ? /* @__PURE__ */ jsx("div", { className: styles$J.selectOptionContent, ref: visibleContentRef, children: optionRenderer(
20682
- {
20683
- label: label2,
20684
- value,
20685
- enabled: enabled2
20686
- },
20687
- selectedValue,
20688
- false
20689
- ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
20690
- /* @__PURE__ */ jsx("div", { className: styles$J.selectOptionContent, ref: visibleContentRef, children: label2 }),
20691
- selectedValue === value && /* @__PURE__ */ jsx(ItemIndicator, { className: styles$J.selectItemIndicator, children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) })
20692
- ] })
20693
- ]
20694
- }
20695
- );
20696
- }
20697
- );
20634
+ const SelectContext = createContext({
20635
+ value: null,
20636
+ onChange: (selectedValue) => {
20637
+ },
20638
+ setOpen: (open) => {
20639
+ },
20640
+ setSelectedIndex: (index) => {
20641
+ },
20642
+ options: /* @__PURE__ */ new Set(),
20643
+ optionRenderer: void 0
20644
+ });
20645
+ function useSelect() {
20646
+ return useContext(SelectContext);
20647
+ }
20698
20648
  const OptionTypeContext = React__default.createContext(null);
20699
20649
  function useOptionType() {
20700
20650
  return React__default.useContext(OptionTypeContext);
@@ -20705,9 +20655,18 @@ function OptionTypeProvider({
20705
20655
  }) {
20706
20656
  return /* @__PURE__ */ jsx(OptionTypeContext.Provider, { value: Component, children });
20707
20657
  }
20658
+ const OptionContext = createContext({
20659
+ onOptionAdd: () => {
20660
+ },
20661
+ onOptionRemove: () => {
20662
+ }
20663
+ });
20664
+ function useOption() {
20665
+ return useContext(OptionContext);
20666
+ }
20708
20667
  function HiddenOption(option) {
20709
20668
  const { label: label2 } = option;
20710
- const { onOptionRemove, onOptionAdd } = useOption();
20669
+ const { onOptionAdd } = useOption();
20711
20670
  const [node, setNode] = useState(null);
20712
20671
  const opt = useMemo(() => {
20713
20672
  return {
@@ -20719,165 +20678,10 @@ function HiddenOption(option) {
20719
20678
  }, [option, node, label2]);
20720
20679
  useEffect(() => {
20721
20680
  onOptionAdd(opt);
20722
- return () => onOptionRemove(opt);
20723
- }, [opt, onOptionAdd, onOptionRemove]);
20681
+ }, [opt, onOptionAdd]);
20724
20682
  return /* @__PURE__ */ jsx("div", { ref: (el) => setNode(el), style: { display: "none" }, children: option.children });
20725
20683
  }
20726
- const SimpleSelect = forwardRef(
20727
- function SimpleSelect2(props, forwardedRef) {
20728
- const { root: root2 } = useTheme();
20729
- const {
20730
- enabled: enabled2,
20731
- onBlur,
20732
- autoFocus,
20733
- onValueChange,
20734
- validationStatus,
20735
- value,
20736
- height,
20737
- style: style2,
20738
- placeholder: placeholder2,
20739
- id,
20740
- triggerRef,
20741
- onFocus,
20742
- width,
20743
- children,
20744
- readOnly: readOnly2,
20745
- emptyListNode,
20746
- className,
20747
- ...rest
20748
- } = props;
20749
- const { options: options2 } = useSelect();
20750
- const composedRef = forwardRef ? composeRefs(triggerRef, forwardedRef) : triggerRef;
20751
- const stringValue = useMemo(() => {
20752
- return value != void 0 ? String(value) : void 0;
20753
- }, [value]);
20754
- const handleValueChange = useCallback(
20755
- (val) => {
20756
- if (readOnly2) return;
20757
- onValueChange(val);
20758
- },
20759
- [onValueChange, readOnly2]
20760
- );
20761
- const optionsArray = useMemo(() => Array.from(options2), [options2]);
20762
- const selectedOption = useMemo(() => {
20763
- return optionsArray.find((option) => String(option.value) === String(value));
20764
- }, [optionsArray, value]);
20765
- return /* @__PURE__ */ jsxs(Root, { value: stringValue, onValueChange: handleValueChange, children: [
20766
- /* @__PURE__ */ jsxs(
20767
- Trigger,
20768
- {
20769
- ...rest,
20770
- id,
20771
- ref: composedRef,
20772
- "aria-haspopup": "listbox",
20773
- style: style2,
20774
- onFocus,
20775
- onBlur,
20776
- disabled: !enabled2,
20777
- className: classnames(className, styles$J.selectTrigger, {
20778
- [styles$J.error]: validationStatus === "error",
20779
- [styles$J.warning]: validationStatus === "warning",
20780
- [styles$J.valid]: validationStatus === "valid"
20781
- }),
20782
- onClick: (event) => {
20783
- event.stopPropagation();
20784
- },
20785
- autoFocus,
20786
- children: [
20787
- /* @__PURE__ */ jsx(
20788
- "div",
20789
- {
20790
- className: classnames(styles$J.selectValue, {
20791
- [styles$J.placeholder]: value === void 0
20792
- }),
20793
- children: selectedOption ? selectedOption.label : readOnly2 ? "" : placeholder2
20794
- }
20795
- ),
20796
- /* @__PURE__ */ jsx("span", { className: styles$J.action, children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" }) })
20797
- ]
20798
- }
20799
- ),
20800
- /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsxs(
20801
- Content,
20802
- {
20803
- className: styles$J.selectDropdownContent,
20804
- position: "popper",
20805
- style: { maxHeight: height, minWidth: width },
20806
- children: [
20807
- /* @__PURE__ */ jsx(ScrollUpButton, { className: styles$J.selectScrollUpButton, children: /* @__PURE__ */ jsx(Icon, { name: "chevronup" }) }),
20808
- /* @__PURE__ */ jsxs(Viewport, { className: styles$J.selectViewport, role: "listbox", children: [
20809
- children,
20810
- optionsArray.length === 0 && emptyListNode
20811
- ] }),
20812
- /* @__PURE__ */ jsx(ScrollDownButton, { className: styles$J.selectScrollDownButton, children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" }) })
20813
- ]
20814
- }
20815
- ) })
20816
- ] });
20817
- }
20818
- );
20819
- const MultiSelectOption = forwardRef(function MultiSelectOption2(option, forwardedRef) {
20820
- const id = useId();
20821
- const {
20822
- label: label2,
20823
- value,
20824
- enabled: enabled2 = true,
20825
- keywords,
20826
- readOnly: readOnly2,
20827
- children,
20828
- isHighlighted = false,
20829
- itemIndex
20830
- } = option;
20831
- const {
20832
- value: selectedValue,
20833
- onChange,
20834
- multiSelect,
20835
- setOpen,
20836
- setSelectedIndex,
20837
- optionRenderer
20838
- } = useSelect();
20839
- const selected2 = useMemo(() => {
20840
- return Array.isArray(selectedValue) && multiSelect ? selectedValue.map((v) => String(v)).includes(value) : String(selectedValue) === String(value);
20841
- }, [selectedValue, value, multiSelect]);
20842
- const handleClick = () => {
20843
- if (readOnly2) {
20844
- setOpen(false);
20845
- return;
20846
- }
20847
- if (enabled2) {
20848
- onChange(value);
20849
- }
20850
- };
20851
- return /* @__PURE__ */ jsx(
20852
- "div",
20853
- {
20854
- id,
20855
- ref: forwardedRef,
20856
- role: "option",
20857
- "aria-disabled": !enabled2,
20858
- "aria-selected": selected2,
20859
- className: classnames(styles$J.multiSelectOption, {
20860
- [styles$J.disabledOption]: !enabled2,
20861
- [styles$J.highlighted]: isHighlighted
20862
- }),
20863
- onMouseDown: (e) => {
20864
- e.preventDefault();
20865
- e.stopPropagation();
20866
- },
20867
- onMouseEnter: () => {
20868
- if (itemIndex !== void 0 && setSelectedIndex && enabled2) {
20869
- setSelectedIndex(itemIndex);
20870
- }
20871
- },
20872
- onClick: handleClick,
20873
- "data-state": selected2 ? "checked" : void 0,
20874
- children: /* @__PURE__ */ jsx("div", { className: styles$J.multiSelectOptionContent, children: optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2, keywords }, selectedValue, false) : /* @__PURE__ */ jsxs(Fragment, { children: [
20875
- children || label2,
20876
- selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
20877
- ] }) })
20878
- }
20879
- );
20880
- });
20684
+ const PART_LIST_WRAPPER$1 = "listWrapper";
20881
20685
  const defaultProps$F = {
20882
20686
  enabled: true,
20883
20687
  placeholder: "",
@@ -20999,7 +20803,6 @@ const Select = forwardRef(function Select2({
20999
20803
  const observer = useRef();
21000
20804
  const { root: root2 } = useTheme();
21001
20805
  const [options2, setOptions] = useState(/* @__PURE__ */ new Set());
21002
- const isInForm = useIsInsideForm();
21003
20806
  const [searchTerm, setSearchTerm] = useState("");
21004
20807
  const [selectedIndex, setSelectedIndex] = useState(-1);
21005
20808
  const filteredOptions = useMemo(() => {
@@ -21054,15 +20857,16 @@ const Select = forwardRef(function Select2({
21054
20857
  }, [multiSelect, updateState, onDidChange]);
21055
20858
  const findNextEnabledIndex = useCallback(
21056
20859
  (currentIndex) => {
20860
+ if (filteredOptions.length === 0) return -1;
21057
20861
  for (let i = currentIndex + 1; i < filteredOptions.length; i++) {
21058
20862
  const item2 = filteredOptions[i];
21059
- if (item2.enabled !== false) {
20863
+ if (item2 && item2.enabled !== false) {
21060
20864
  return i;
21061
20865
  }
21062
20866
  }
21063
20867
  for (let i = 0; i <= currentIndex; i++) {
21064
20868
  const item2 = filteredOptions[i];
21065
- if (item2.enabled !== false) {
20869
+ if (item2 && item2.enabled !== false) {
21066
20870
  return i;
21067
20871
  }
21068
20872
  }
@@ -21072,15 +20876,16 @@ const Select = forwardRef(function Select2({
21072
20876
  );
21073
20877
  const findPreviousEnabledIndex = useCallback(
21074
20878
  (currentIndex) => {
20879
+ if (filteredOptions.length === 0) return -1;
21075
20880
  for (let i = currentIndex - 1; i >= 0; i--) {
21076
20881
  const item2 = filteredOptions[i];
21077
- if (item2.enabled !== false) {
20882
+ if (item2 && item2.enabled !== false) {
21078
20883
  return i;
21079
20884
  }
21080
20885
  }
21081
20886
  for (let i = filteredOptions.length - 1; i >= currentIndex; i--) {
21082
20887
  const item2 = filteredOptions[i];
21083
- if (item2.enabled !== false) {
20888
+ if (item2 && item2.enabled !== false) {
21084
20889
  return i;
21085
20890
  }
21086
20891
  }
@@ -21110,8 +20915,11 @@ const Select = forwardRef(function Select2({
21110
20915
  event.preventDefault();
21111
20916
  if (selectedIndex >= 0 && selectedIndex < filteredOptions.length) {
21112
20917
  const selectedItem = filteredOptions[selectedIndex];
21113
- if (selectedItem.enabled !== false) {
20918
+ if (selectedItem && selectedItem.enabled !== false) {
21114
20919
  toggleOption(selectedItem.value);
20920
+ if (!multiSelect) {
20921
+ setOpen(false);
20922
+ }
21115
20923
  }
21116
20924
  }
21117
20925
  break;
@@ -21126,6 +20934,7 @@ const Select = forwardRef(function Select2({
21126
20934
  selectedIndex,
21127
20935
  filteredOptions,
21128
20936
  toggleOption,
20937
+ multiSelect,
21129
20938
  findNextEnabledIndex,
21130
20939
  findPreviousEnabledIndex
21131
20940
  ]
@@ -21159,7 +20968,15 @@ const Select = forwardRef(function Select2({
21159
20968
  [emptyListTemplate]
21160
20969
  );
21161
20970
  const onOptionAdd = useCallback((option) => {
21162
- setOptions((prev) => new Set(prev).add(option));
20971
+ setOptions((prev) => {
20972
+ const exists = Array.from(prev).some((opt) => opt.value === option.value);
20973
+ if (exists) {
20974
+ return prev;
20975
+ }
20976
+ const newSet = new Set(prev);
20977
+ newSet.add(option);
20978
+ return newSet;
20979
+ });
21163
20980
  }, []);
21164
20981
  const onOptionRemove = useCallback((option) => {
21165
20982
  setOptions((prev) => {
@@ -21178,138 +20995,286 @@ const Select = forwardRef(function Select2({
21178
20995
  const selectContextValue = useMemo(
21179
20996
  () => ({
21180
20997
  multiSelect,
20998
+ readOnly: readOnly2,
21181
20999
  value,
21182
21000
  onChange: toggleOption,
21183
21001
  setOpen,
21184
21002
  setSelectedIndex,
21185
21003
  options: options2,
21004
+ highlightedValue: selectedIndex >= 0 && selectedIndex < filteredOptions.length && filteredOptions[selectedIndex] ? filteredOptions[selectedIndex].value : void 0,
21186
21005
  optionRenderer
21187
21006
  }),
21188
- [multiSelect, toggleOption, value, options2, optionRenderer]
21007
+ [
21008
+ multiSelect,
21009
+ readOnly2,
21010
+ value,
21011
+ toggleOption,
21012
+ options2,
21013
+ selectedIndex,
21014
+ filteredOptions,
21015
+ optionRenderer
21016
+ ]
21189
21017
  );
21190
- return /* @__PURE__ */ jsx(SelectContext.Provider, { value: selectContextValue, children: /* @__PURE__ */ jsx(OptionContext.Provider, { value: optionContextValue, children: searchable || multiSelect ? /* @__PURE__ */ jsxs(OptionTypeProvider, { Component: HiddenOption, children: [
21191
- /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, modal: false, children: [
21192
- /* @__PURE__ */ jsxs(
21193
- PopoverTrigger,
21194
- {
21195
- ...rest,
21196
- ref: composeRefs(setReferenceElement, forwardedRef),
21197
- id,
21198
- "aria-haspopup": "listbox",
21199
- style: style2,
21200
- onFocus,
21201
- onBlur,
21202
- disabled: !enabled2,
21203
- "aria-expanded": open,
21204
- onClick: (event) => {
21205
- event.stopPropagation();
21206
- setOpen((prev) => !prev);
21207
- },
21208
- className: classnames(
21209
- styles$J.selectTrigger,
21210
- styles$J[validationStatus],
21018
+ return /* @__PURE__ */ jsx(SelectContext.Provider, { value: selectContextValue, children: /* @__PURE__ */ jsxs(OptionContext.Provider, { value: optionContextValue, children: [
21019
+ /* @__PURE__ */ jsx(OptionTypeProvider, { Component: VisibleSelectOption, children: /* @__PURE__ */ jsxs(
21020
+ Popover,
21021
+ {
21022
+ open,
21023
+ onOpenChange: (isOpen) => {
21024
+ if (!enabled2) return;
21025
+ setOpen(isOpen);
21026
+ setSelectedIndex(-1);
21027
+ },
21028
+ modal: false,
21029
+ children: [
21030
+ /* @__PURE__ */ jsxs(
21031
+ PopoverTrigger,
21211
21032
  {
21212
- [styles$J.disabled]: !enabled2,
21213
- [styles$J.multi]: multiSelect
21214
- },
21215
- className
21216
- ),
21217
- autoFocus,
21218
- children: [
21219
- /* @__PURE__ */ jsx(
21220
- SelectTriggerValue,
21221
- {
21222
- value,
21223
- placeholder: placeholder2,
21224
- readOnly: readOnly2,
21225
- multiSelect,
21226
- options: options2,
21227
- valueRenderer,
21228
- toggleOption
21229
- }
21230
- ),
21231
- /* @__PURE__ */ jsx(
21232
- SelectTriggerActions,
21233
- {
21234
- value,
21235
- multiSelect,
21236
- enabled: enabled2,
21237
- readOnly: readOnly2,
21238
- clearValue
21239
- }
21240
- )
21241
- ]
21242
- }
21243
- ),
21244
- open && /* @__PURE__ */ jsx(Portal$1, { container: root2, children: /* @__PURE__ */ jsx(FocusScope, { asChild: true, loop: true, trapped: true, children: /* @__PURE__ */ jsx(
21245
- PopoverContent,
21246
- {
21247
- style: { minWidth: width, height: dropdownHeight },
21248
- className: styles$J.selectContent,
21249
- onKeyDown: handleKeyDown,
21250
- children: /* @__PURE__ */ jsxs("div", { className: styles$J.command, children: [
21251
- searchable ? /* @__PURE__ */ jsxs("div", { className: styles$J.commandInputContainer, children: [
21252
- /* @__PURE__ */ jsx(Icon, { name: "search" }),
21253
- /* @__PURE__ */ jsx(
21254
- "input",
21255
- {
21256
- role: "combobox",
21257
- className: classnames(styles$J.commandInput),
21258
- placeholder: "Search...",
21259
- value: searchTerm,
21260
- onChange: (e) => setSearchTerm(e.target.value),
21261
- autoFocus: true
21033
+ ...rest,
21034
+ ref: composeRefs(setReferenceElement, forwardedRef),
21035
+ id,
21036
+ "aria-haspopup": "listbox",
21037
+ style: style2,
21038
+ onFocus,
21039
+ onBlur,
21040
+ disabled: !enabled2,
21041
+ "aria-expanded": open,
21042
+ "data-part-id": PART_LIST_WRAPPER$1,
21043
+ className: classnames(className, styles$J.selectTrigger, styles$J[validationStatus], {
21044
+ [styles$J.disabled]: !enabled2,
21045
+ [styles$J.multi]: multiSelect
21046
+ }),
21047
+ role: "combobox",
21048
+ onClick: (event) => {
21049
+ if (!enabled2) return;
21050
+ event.stopPropagation();
21051
+ setOpen((prev) => !prev);
21052
+ },
21053
+ onKeyDown: (event) => {
21054
+ if (!enabled2 || readOnly2) return;
21055
+ if (!open && (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === " " || event.key === "Enter")) {
21056
+ event.preventDefault();
21057
+ setOpen(true);
21058
+ if (filteredOptions.length > 0) {
21059
+ const firstEnabledIndex = findNextEnabledIndex(-1);
21060
+ setSelectedIndex(firstEnabledIndex !== -1 ? firstEnabledIndex : 0);
21061
+ }
21062
+ return;
21262
21063
  }
21263
- )
21264
- ] }) : /* @__PURE__ */ jsx("button", { autoFocus: true, "aria-hidden": "true", className: styles$J.srOnly }),
21265
- /* @__PURE__ */ jsxs("div", { role: "listbox", className: styles$J.commandList, children: [
21266
- inProgress && /* @__PURE__ */ jsx("div", { className: styles$J.loading, children: inProgressNotificationMessage }),
21267
- filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => /* @__PURE__ */ jsx(
21268
- MultiSelectOption,
21269
- {
21270
- readOnly: readOnly2,
21271
- value: value2,
21272
- label: label2,
21273
- enabled: enabled22,
21274
- keywords,
21275
- isHighlighted: selectedIndex === index,
21276
- itemIndex: index
21277
- },
21278
- value2
21279
- )),
21280
- !inProgress && filteredOptions.length === 0 && /* @__PURE__ */ jsx("div", { children: emptyListNode })
21281
- ] })
21282
- ] })
21283
- }
21284
- ) }) })
21285
- ] }),
21286
- children
21287
- ] }) : /* @__PURE__ */ jsx(OptionTypeProvider, { Component: SelectOption, children: /* @__PURE__ */ createElement(
21288
- SimpleSelect,
21289
- {
21290
- ...rest,
21291
- readOnly: !!readOnly2,
21292
- ref: forwardedRef,
21293
- key: isInForm ? value ? `status-${value}` : "status-initial" : void 0,
21294
- value,
21295
- onValueChange: toggleOption,
21296
- id,
21297
- style: style2,
21298
- className,
21299
- onFocus,
21300
- onBlur,
21301
- enabled: enabled2,
21302
- validationStatus,
21303
- triggerRef: setReferenceElement,
21304
- autoFocus,
21305
- placeholder: placeholder2,
21306
- height: dropdownHeight,
21307
- width,
21308
- emptyListNode
21309
- },
21310
- children
21311
- ) }) }) });
21064
+ if (open) {
21065
+ handleKeyDown(event);
21066
+ }
21067
+ },
21068
+ autoFocus,
21069
+ children: [
21070
+ /* @__PURE__ */ jsx(
21071
+ SelectTriggerValue,
21072
+ {
21073
+ value,
21074
+ placeholder: placeholder2,
21075
+ readOnly: readOnly2,
21076
+ multiSelect,
21077
+ options: options2,
21078
+ valueRenderer,
21079
+ toggleOption
21080
+ }
21081
+ ),
21082
+ /* @__PURE__ */ jsx(
21083
+ SelectTriggerActions,
21084
+ {
21085
+ value,
21086
+ multiSelect,
21087
+ enabled: enabled2,
21088
+ readOnly: readOnly2,
21089
+ clearValue
21090
+ }
21091
+ )
21092
+ ]
21093
+ }
21094
+ ),
21095
+ open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx(
21096
+ PopoverContent,
21097
+ {
21098
+ style: { minWidth: width, height: dropdownHeight },
21099
+ className: styles$J.selectContent,
21100
+ onKeyDown: handleKeyDown,
21101
+ children: /* @__PURE__ */ jsxs("div", { className: styles$J.command, children: [
21102
+ searchable ? /* @__PURE__ */ jsxs("div", { className: styles$J.commandInputContainer, children: [
21103
+ /* @__PURE__ */ jsx(Icon, { name: "search" }),
21104
+ /* @__PURE__ */ jsx(
21105
+ "input",
21106
+ {
21107
+ role: "searchbox",
21108
+ className: classnames(styles$J.commandInput),
21109
+ placeholder: "Search...",
21110
+ value: searchTerm,
21111
+ onChange: (e) => setSearchTerm(e.target.value)
21112
+ }
21113
+ )
21114
+ ] }) : /* @__PURE__ */ jsx("button", { "aria-hidden": "true", className: styles$J.srOnly }),
21115
+ /* @__PURE__ */ jsx("div", { role: "listbox", className: styles$J.commandList, children: inProgress ? /* @__PURE__ */ jsx("div", { className: styles$J.loading, children: inProgressNotificationMessage }) : searchable && searchTerm ? (
21116
+ // When searching, show only filtered options
21117
+ filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { children: emptyListNode }) : filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => /* @__PURE__ */ jsx(
21118
+ SelectOptionItem,
21119
+ {
21120
+ readOnly: readOnly2,
21121
+ value: value2,
21122
+ label: label2,
21123
+ enabled: enabled22,
21124
+ keywords,
21125
+ isHighlighted: selectedIndex === index,
21126
+ itemIndex: index
21127
+ },
21128
+ value2
21129
+ ))
21130
+ ) : (
21131
+ // When not searching, show all children (includes Options and other components like Button)
21132
+ /* @__PURE__ */ jsxs(Fragment, { children: [
21133
+ children,
21134
+ options2.size === 0 && /* @__PURE__ */ jsx("div", { children: emptyListNode })
21135
+ ] })
21136
+ ) })
21137
+ ] })
21138
+ }
21139
+ ) })
21140
+ ]
21141
+ }
21142
+ ) }),
21143
+ !open && /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx(OptionTypeProvider, { Component: HiddenOption, children }) })
21144
+ ] }) });
21312
21145
  });
21146
+ function VisibleSelectOption(option) {
21147
+ const { value, label: label2, enabled: enabled2 = true, children } = option;
21148
+ const { onOptionAdd } = useOption();
21149
+ const {
21150
+ value: selectedValue,
21151
+ onChange,
21152
+ multiSelect,
21153
+ readOnly: readOnly2,
21154
+ setOpen,
21155
+ highlightedValue,
21156
+ optionRenderer
21157
+ } = useSelect();
21158
+ const optionRef = useRef(null);
21159
+ const opt = useMemo(() => {
21160
+ return {
21161
+ ...option,
21162
+ label: label2 ?? "",
21163
+ keywords: option.keywords || [label2 ?? ""]
21164
+ };
21165
+ }, [option, label2]);
21166
+ useEffect(() => {
21167
+ onOptionAdd(opt);
21168
+ }, [opt, onOptionAdd]);
21169
+ const selected2 = useMemo(() => {
21170
+ return Array.isArray(selectedValue) && multiSelect ? selectedValue.map((v) => String(v)).includes(value) : String(selectedValue) === String(value);
21171
+ }, [selectedValue, value, multiSelect]);
21172
+ const isHighlighted = useMemo(() => {
21173
+ return highlightedValue !== void 0 && String(highlightedValue) === String(value);
21174
+ }, [highlightedValue, value]);
21175
+ useEffect(() => {
21176
+ if (isHighlighted && optionRef.current) {
21177
+ optionRef.current.scrollIntoView({ block: "nearest", behavior: "smooth" });
21178
+ }
21179
+ }, [isHighlighted]);
21180
+ const handleClick = () => {
21181
+ if (readOnly2) {
21182
+ setOpen(false);
21183
+ return;
21184
+ }
21185
+ if (enabled2) {
21186
+ onChange(value);
21187
+ }
21188
+ };
21189
+ return /* @__PURE__ */ jsx(
21190
+ "div",
21191
+ {
21192
+ ref: optionRef,
21193
+ role: "option",
21194
+ "aria-disabled": !enabled2,
21195
+ "aria-selected": selected2,
21196
+ className: classnames(styles$J.multiSelectOption, {
21197
+ [styles$J.disabledOption]: !enabled2,
21198
+ [styles$J.highlighted]: isHighlighted
21199
+ }),
21200
+ onMouseDown: (e) => {
21201
+ e.preventDefault();
21202
+ e.stopPropagation();
21203
+ },
21204
+ onClick: handleClick,
21205
+ "data-state": selected2 ? "checked" : void 0,
21206
+ children: /* @__PURE__ */ jsx("div", { className: styles$J.multiSelectOptionContent, children: optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2 }, selectedValue, false) : /* @__PURE__ */ jsxs(Fragment, { children: [
21207
+ children || label2,
21208
+ selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
21209
+ ] }) })
21210
+ }
21211
+ );
21212
+ }
21213
+ function SelectOptionItem(option) {
21214
+ const {
21215
+ value,
21216
+ label: label2,
21217
+ enabled: enabled2 = true,
21218
+ readOnly: readOnly2,
21219
+ children,
21220
+ isHighlighted = false,
21221
+ itemIndex
21222
+ } = option;
21223
+ const {
21224
+ value: selectedValue,
21225
+ onChange,
21226
+ multiSelect,
21227
+ setOpen,
21228
+ setSelectedIndex,
21229
+ optionRenderer
21230
+ } = useSelect();
21231
+ const optionRef = useRef(null);
21232
+ const selected2 = useMemo(() => {
21233
+ return Array.isArray(selectedValue) && multiSelect ? selectedValue.map((v) => String(v)).includes(value) : String(selectedValue) === String(value);
21234
+ }, [selectedValue, value, multiSelect]);
21235
+ useEffect(() => {
21236
+ if (isHighlighted && optionRef.current) {
21237
+ optionRef.current.scrollIntoView({ block: "nearest", behavior: "smooth" });
21238
+ }
21239
+ }, [isHighlighted]);
21240
+ const handleClick = () => {
21241
+ if (readOnly2) {
21242
+ setOpen(false);
21243
+ return;
21244
+ }
21245
+ if (enabled2) {
21246
+ onChange(value);
21247
+ }
21248
+ };
21249
+ return /* @__PURE__ */ jsx(
21250
+ "div",
21251
+ {
21252
+ ref: optionRef,
21253
+ role: "option",
21254
+ "aria-disabled": !enabled2,
21255
+ "aria-selected": selected2,
21256
+ className: classnames(styles$J.multiSelectOption, {
21257
+ [styles$J.disabledOption]: !enabled2,
21258
+ [styles$J.highlighted]: isHighlighted
21259
+ }),
21260
+ onMouseDown: (e) => {
21261
+ e.preventDefault();
21262
+ e.stopPropagation();
21263
+ },
21264
+ onMouseEnter: () => {
21265
+ if (itemIndex !== void 0 && setSelectedIndex && enabled2) {
21266
+ setSelectedIndex(itemIndex);
21267
+ }
21268
+ },
21269
+ onClick: handleClick,
21270
+ "data-state": selected2 ? "checked" : void 0,
21271
+ children: /* @__PURE__ */ jsx("div", { className: styles$J.multiSelectOptionContent, children: optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2 }, selectedValue, false) : /* @__PURE__ */ jsxs(Fragment, { children: [
21272
+ children || label2,
21273
+ selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
21274
+ ] }) })
21275
+ }
21276
+ );
21277
+ }
21313
21278
  const themeVars$o = `'{"gap-RadioGroupOption": "var(--xmlui-gap-RadioGroupOption)", "borderWidth-RadioGroupOption": "var(--xmlui-borderWidth-RadioGroupOption)", "borderWidth-RadioGroupOption-validation": "var(--xmlui-borderWidth-RadioGroupOption-validation)", "Input:borderColor-RadioGroupOption-default": "var(--xmlui-borderColor-RadioGroupOption-default)", "Input:borderColor-checked-RadioGroupOption": "var(--xmlui-borderColor-checked-RadioGroupOption)", "Input:borderColor-RadioGroupOption-default--hover": "var(--xmlui-borderColor-RadioGroupOption-default--hover)", "Input:borderColor-RadioGroupOption-default--active": "var(--xmlui-borderColor-RadioGroupOption-default--active)", "Input:borderColor-RadioGroupOption--disabled": "var(--xmlui-borderColor-RadioGroupOption--disabled)", "Input:borderColor-RadioGroupOption-error": "var(--xmlui-borderColor-RadioGroupOption-error)", "Input:borderColor-RadioGroupOption-warning": "var(--xmlui-borderColor-RadioGroupOption-warning)", "Input:borderColor-RadioGroupOption-success": "var(--xmlui-borderColor-RadioGroupOption-success)", "Input:backgroundColor-RadioGroupOption-default": "var(--xmlui-backgroundColor-RadioGroupOption-default)", "Input:backgroundColor-checked-RadioGroupOption": "var(--xmlui-backgroundColor-checked-RadioGroupOption)", "Input:backgroundColor-checked-RadioGroupOption--disabled": "var(--xmlui-backgroundColor-checked-RadioGroupOption--disabled)", "Input:color-RadioGroupOption--disabled": "var(--xmlui-color-RadioGroupOption--disabled)", "Input:fontSize-RadioGroupOption": "var(--xmlui-fontSize-RadioGroupOption)", "Input:fontWeight-RadioGroupOption": "var(--xmlui-fontWeight-RadioGroupOption)", "Input:textColor-RadioGroupOption-default": "var(--xmlui-textColor-RadioGroupOption-default)", "Input:textColor-RadioGroupOption-error": "var(--xmlui-textColor-RadioGroupOption-error)", "Input:textColor-RadioGroupOption-warning": "var(--xmlui-textColor-RadioGroupOption-warning)", "Input:textColor-RadioGroupOption-success": "var(--xmlui-textColor-RadioGroupOption-success)", "Input:outlineWidth-RadioGroupOption--focus": "var(--xmlui-outlineWidth-RadioGroupOption--focus)", "Input:outlineColor-RadioGroupOption--focus": "var(--xmlui-outlineColor-RadioGroupOption--focus)", "Input:outlineStyle-RadioGroupOption--focus": "var(--xmlui-outlineStyle-RadioGroupOption--focus)", "Input:outlineOffset-RadioGroupOption--focus": "var(--xmlui-outlineOffset-RadioGroupOption--focus)"}'`;
21314
21279
  const radioGroupContainer = "_radioGroupContainer_fn2iu_14";
21315
21280
  const radioOptionContainer = "_radioOptionContainer_fn2iu_20";
@@ -22117,32 +22082,24 @@ function ValidationSummary({
22117
22082
  });
22118
22083
  return ret;
22119
22084
  }, [fieldValidationResults, generalValidationResults]);
22120
- return /* @__PURE__ */ jsxs(
22121
- "div",
22122
- {
22123
- ref: animateContainerRef,
22124
- className: styles$F.summaryContainer,
22125
- "data-validation-summary": true,
22126
- children: [
22127
- /* @__PURE__ */ jsx(
22128
- ValidationDisplay,
22129
- {
22130
- issues: groupedInvalidResults.warning,
22131
- severity: "warning",
22132
- heading: "Validation warnings"
22133
- }
22134
- ),
22135
- /* @__PURE__ */ jsx(
22136
- ValidationDisplay,
22137
- {
22138
- issues: groupedInvalidResults.error,
22139
- severity: "error",
22140
- heading: "Validation errors"
22141
- }
22142
- )
22143
- ]
22144
- }
22145
- );
22085
+ return /* @__PURE__ */ jsxs("div", { ref: animateContainerRef, className: styles$F.summaryContainer, "data-validation-summary": true, children: [
22086
+ /* @__PURE__ */ jsx(
22087
+ ValidationDisplay,
22088
+ {
22089
+ issues: groupedInvalidResults.warning,
22090
+ severity: "warning",
22091
+ heading: "Validation warnings"
22092
+ }
22093
+ ),
22094
+ /* @__PURE__ */ jsx(
22095
+ ValidationDisplay,
22096
+ {
22097
+ issues: groupedInvalidResults.error,
22098
+ severity: "error",
22099
+ heading: "Validation errors"
22100
+ }
22101
+ )
22102
+ ] });
22146
22103
  }
22147
22104
  const ValidationDisplay = ({
22148
22105
  heading: heading2,
@@ -22893,7 +22850,15 @@ const AutoComplete = forwardRef(function AutoComplete2({
22893
22850
  onDidChange(newValue);
22894
22851
  }, [multi, updateState, onDidChange]);
22895
22852
  const onOptionAdd = useCallback((option) => {
22896
- setOptions((prev) => new Set(prev).add(option));
22853
+ setOptions((prev) => {
22854
+ const newSet = new Set(prev);
22855
+ const existing = Array.from(prev).find((opt) => opt.value === option.value);
22856
+ if (existing) {
22857
+ newSet.delete(existing);
22858
+ }
22859
+ newSet.add(option);
22860
+ return newSet;
22861
+ });
22897
22862
  }, []);
22898
22863
  const onOptionRemove = useCallback((option) => {
22899
22864
  setOptions((prev) => {
@@ -23109,6 +23074,14 @@ const AutoComplete = forwardRef(function AutoComplete2({
23109
23074
  }
23110
23075
  ),
23111
23076
  "aria-expanded": open,
23077
+ onClick: (event) => {
23078
+ if (readOnly2) return;
23079
+ if (multi && open) {
23080
+ return;
23081
+ }
23082
+ event.stopPropagation();
23083
+ setOpen((prev) => !prev);
23084
+ },
23112
23085
  children: [
23113
23086
  Array.isArray(selectedValue) && selectedValue.length > 0 && /* @__PURE__ */ jsx("div", { className: styles$E.badgeList, children: selectedValue.map((v, index) => /* @__PURE__ */ jsxs("span", { className: styles$E.badge, children: [
23114
23087
  v == null ? void 0 : v.label,
@@ -23206,7 +23179,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23206
23179
  ]
23207
23180
  }
23208
23181
  ) }),
23209
- open && /* @__PURE__ */ jsx(Portal$1, { container: root2, children: /* @__PURE__ */ jsx(
23182
+ open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx(
23210
23183
  PopoverContent,
23211
23184
  {
23212
23185
  style: { width, height: dropdownHeight },
@@ -23256,7 +23229,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23256
23229
  ] }) }) });
23257
23230
  });
23258
23231
  function CreatableItem({ onNewItem, isHighlighted = false }) {
23259
- const { value, options: options2, searchTerm, onChange, setOpen, setSelectedIndex } = useAutoComplete();
23232
+ const { value, options: options2, searchTerm, onChange, setOpen, setSelectedIndex, multi } = useAutoComplete();
23260
23233
  const { onOptionAdd } = useOption();
23261
23234
  if (isOptionsExist(options2, [{ value: searchTerm, label: searchTerm }]) || Array.isArray(value) && (value == null ? void 0 : value.find((s) => s === searchTerm)) || searchTerm === value) {
23262
23235
  return /* @__PURE__ */ jsx("span", { style: { display: "none" } });
@@ -23266,7 +23239,9 @@ function CreatableItem({ onNewItem, isHighlighted = false }) {
23266
23239
  onOptionAdd(newOption);
23267
23240
  onNewItem == null ? void 0 : onNewItem(searchTerm);
23268
23241
  onChange(searchTerm);
23269
- setOpen(false);
23242
+ if (!multi) {
23243
+ setOpen(false);
23244
+ }
23270
23245
  };
23271
23246
  const Item2 = /* @__PURE__ */ jsx(
23272
23247
  "div",
@@ -23317,7 +23292,9 @@ function AutoCompleteOption(option) {
23317
23292
  const handleClick = () => {
23318
23293
  if (!readOnly2 && enabled2) {
23319
23294
  onChange(value);
23320
- setOpen(false);
23295
+ if (!multi) {
23296
+ setOpen(false);
23297
+ }
23321
23298
  }
23322
23299
  };
23323
23300
  return /* @__PURE__ */ jsx(
@@ -24711,7 +24688,7 @@ function ApiInterceptorProvider({
24711
24688
  return;
24712
24689
  }
24713
24690
  void (async () => {
24714
- const { initMock } = await import("./initMock-CSGEd746.mjs");
24691
+ const { initMock } = await import("./initMock-DFcCR7ey.mjs");
24715
24692
  const apiInstance2 = await initMock(interceptor);
24716
24693
  setApiInstance(apiInstance2);
24717
24694
  setInitialized(true);
@@ -24728,7 +24705,7 @@ function ApiInterceptorProvider({
24728
24705
  if (process.env.VITE_MOCK_ENABLED) {
24729
24706
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
24730
24707
  useWorker ? import("./apiInterceptorWorker-QiltRtq1.mjs") : Promise.resolve({ createApiInterceptorWorker: () => null }),
24731
- import("./initMock-CSGEd746.mjs")
24708
+ import("./initMock-DFcCR7ey.mjs")
24732
24709
  ]);
24733
24710
  if (interceptor || forceInitialize) {
24734
24711
  const apiInstance2 = await initMock(interceptor || {});
@@ -24765,7 +24742,7 @@ function ApiInterceptorProvider({
24765
24742
  void (async () => {
24766
24743
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
24767
24744
  import("./apiInterceptorWorker-QiltRtq1.mjs"),
24768
- import("./initMock-CSGEd746.mjs")
24745
+ import("./initMock-DFcCR7ey.mjs")
24769
24746
  ]);
24770
24747
  const apiInstance2 = await initMock(interceptor);
24771
24748
  await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
@@ -26739,7 +26716,7 @@ const Slider = forwardRef(
26739
26716
  thumbsRef.current = thumbsRef.current.slice(0, displayValue.length);
26740
26717
  }, [displayValue.length]);
26741
26718
  return /* @__PURE__ */ jsx("div", { ...rest, ref, style: style2, className: classnames(styles$D.sliderContainer, className), "data-slider-container": true, children: /* @__PURE__ */ jsxs(
26742
- Root$1,
26719
+ Root,
26743
26720
  {
26744
26721
  ref: inputRef,
26745
26722
  minStepsBetweenThumbs,
@@ -27415,7 +27392,7 @@ const FormItem = memo(function FormItem2({
27415
27392
  onBlur,
27416
27393
  style: style2,
27417
27394
  className,
27418
- validationResult: /* @__PURE__ */ jsx("div", { ref: animateContainerRef, children: isHelperTextShown && (validationResult == null ? void 0 : validationResult.validations.map((singleValidation, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
27395
+ validationResult: /* @__PURE__ */ jsx("div", { ref: animateContainerRef, className: styles$1k.helperTextContainer, children: isHelperTextShown && (validationResult == null ? void 0 : validationResult.validations.map((singleValidation, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
27419
27396
  singleValidation.isValid && !!singleValidation.validMessage && /* @__PURE__ */ jsx(
27420
27397
  HelperText,
27421
27398
  {
@@ -30226,7 +30203,7 @@ const selectComponentRenderer = createComponentRenderer(
30226
30203
  updateState: isControlled ? void 0 : updateState,
30227
30204
  searchable,
30228
30205
  initialValue: extractValue(node.props.initialValue),
30229
- value: isControlled ? extractValue(node.props.value) : state == null ? void 0 : state.value,
30206
+ value: state == null ? void 0 : state.value,
30230
30207
  autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus),
30231
30208
  enabled: extractValue.asOptionalBoolean(node.props.enabled),
30232
30209
  placeholder: extractValue.asOptionalString(node.props.placeholder),
@@ -30261,7 +30238,7 @@ const selectComponentRenderer = createComponentRenderer(
30261
30238
  $selectedValue: val,
30262
30239
  $inTrigger: inTrigger
30263
30240
  },
30264
- renderChild: (...args) => multiSelect || searchable ? renderChild2(...args) : /* @__PURE__ */ jsx(SelectItemText, { children: renderChild2(...args) })
30241
+ renderChild: renderChild2
30265
30242
  }
30266
30243
  );
30267
30244
  } : void 0,
@@ -38030,7 +38007,7 @@ const Tabs = forwardRef(function Tabs2({
38030
38007
  className: classnames(className, styles$k.tabs, styles$k.accordionView),
38031
38008
  style: style2,
38032
38009
  children: /* @__PURE__ */ jsx(
38033
- Root$2,
38010
+ Root$1,
38034
38011
  {
38035
38012
  value: `${currentTab}`,
38036
38013
  onValueChange: (tab) => {
@@ -38046,7 +38023,7 @@ const Tabs = forwardRef(function Tabs2({
38046
38023
  className: styles$k.accordionRoot,
38047
38024
  children: /* @__PURE__ */ jsxs("div", { className: styles$k.accordionInterleaved, children: [
38048
38025
  /* @__PURE__ */ jsx(List, { className: styles$k.accordionList, children: tabItems.map((tab, index) => /* @__PURE__ */ jsx(
38049
- Trigger$1,
38026
+ Trigger,
38050
38027
  {
38051
38028
  value: tab.innerId,
38052
38029
  asChild: true,
@@ -38081,7 +38058,7 @@ const Tabs = forwardRef(function Tabs2({
38081
38058
  ) });
38082
38059
  }
38083
38060
  return /* @__PURE__ */ jsx(TabContext.Provider, { value: tabContextValue, children: /* @__PURE__ */ jsxs(
38084
- Root$2,
38061
+ Root$1,
38085
38062
  {
38086
38063
  ...rest,
38087
38064
  id: tabsId,
@@ -38113,7 +38090,7 @@ const Tabs = forwardRef(function Tabs2({
38113
38090
  children: [
38114
38091
  !distributeEvenly2 && !headerRenderer && tabAlignment === "end" && /* @__PURE__ */ jsx("div", { className: styles$k.filler, "data-orientation": orientation }),
38115
38092
  !distributeEvenly2 && !headerRenderer && tabAlignment === "center" && /* @__PURE__ */ jsx("div", { className: styles$k.filler, "data-orientation": orientation }),
38116
- tabItems.map((tab, index) => /* @__PURE__ */ jsx(Trigger$1, { value: tab.innerId, asChild: true, children: /* @__PURE__ */ jsx(
38093
+ tabItems.map((tab, index) => /* @__PURE__ */ jsx(Trigger, { value: tab.innerId, asChild: true, children: /* @__PURE__ */ jsx(
38117
38094
  "div",
38118
38095
  {
38119
38096
  role: "tab",
@@ -38932,7 +38909,7 @@ const TabItemComponent = forwardRef(function TabItemComponent2({ children, label
38932
38909
  const tabIndex = (tabItems == null ? void 0 : tabItems.findIndex((item2) => item2.innerId === innerId)) ?? 0;
38933
38910
  const contentOrder = tabIndex * 2 + 1;
38934
38911
  return /* @__PURE__ */ createElement(
38935
- Content$1,
38912
+ Content,
38936
38913
  {
38937
38914
  ...rest,
38938
38915
  key: innerId,
@@ -46660,7 +46637,7 @@ function IconProvider({ children }) {
46660
46637
  /* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
46661
46638
  ] });
46662
46639
  }
46663
- const version = "0.10.24";
46640
+ const version = "0.10.25";
46664
46641
  const miscellaneousUtils = {
46665
46642
  capitalize,
46666
46643
  pluralize: pluralize$1,
@@ -46937,21 +46914,21 @@ function createContainerReducer(debugView) {
46937
46914
  case ContainerActionKind.EVENT_HANDLER_STARTED: {
46938
46915
  const { eventName } = action2.payload;
46939
46916
  const inProgressFlagName = `${eventName}InProgress`;
46940
- state[uid] = { ...state[uid], [inProgressFlagName]: true };
46917
+ state[uid] = state[uid] ? { ...state[uid], [inProgressFlagName]: true } : { [inProgressFlagName]: true };
46941
46918
  storeNextValue(state[uid]);
46942
46919
  break;
46943
46920
  }
46944
46921
  case ContainerActionKind.EVENT_HANDLER_COMPLETED: {
46945
46922
  const { eventName } = action2.payload;
46946
46923
  const inProgressFlagName = `${eventName}InProgress`;
46947
- state[uid] = { ...state[uid], [inProgressFlagName]: false };
46924
+ state[uid] = state[uid] ? { ...state[uid], [inProgressFlagName]: false } : { [inProgressFlagName]: false };
46948
46925
  storeNextValue(state[uid]);
46949
46926
  break;
46950
46927
  }
46951
46928
  case ContainerActionKind.EVENT_HANDLER_ERROR: {
46952
46929
  const { eventName } = action2.payload;
46953
46930
  const inProgressFlagName = `${eventName}InProgress`;
46954
- state[uid] = { ...state[uid], [inProgressFlagName]: false };
46931
+ state[uid] = state[uid] ? { ...state[uid], [inProgressFlagName]: false } : { [inProgressFlagName]: false };
46955
46932
  storeNextValue(state[uid]);
46956
46933
  break;
46957
46934
  }
@@ -48525,7 +48502,9 @@ const Container = memo(
48525
48502
  const runCodeAsync = useEvent(
48526
48503
  async (source, componentUid, options2, ...eventArgs) => {
48527
48504
  var _a3, _b, _c;
48528
- const canSignEventLifecycle = () => componentUid.description !== void 0 && (options2 == null ? void 0 : options2.eventName) !== void 0;
48505
+ const canSignEventLifecycle = () => {
48506
+ return componentUid.description !== void 0 && (options2 == null ? void 0 : options2.eventName) !== void 0;
48507
+ };
48529
48508
  let changes = [];
48530
48509
  const getComponentStateClone = () => {
48531
48510
  changes.length = 0;
@@ -49043,7 +49022,9 @@ const StateContainer = memo(
49043
49022
  const routingParams = useRoutingParams();
49044
49023
  const memoedVars = useRef(/* @__PURE__ */ new Map());
49045
49024
  const stateFromOutside = useShallowCompareMemoize(
49046
- useMemo(() => extractScopedState(parentState, node.uses), [node.uses, parentState])
49025
+ useMemo(() => {
49026
+ return extractScopedState(parentState, node.uses);
49027
+ }, [node.uses, parentState])
49047
49028
  );
49048
49029
  const debugView = useDebugView();
49049
49030
  const containerReducer = createContainerReducer(debugView);
@@ -49052,10 +49033,15 @@ const StateContainer = memo(
49052
49033
  const componentStateWithApis = useShallowCompareMemoize(
49053
49034
  useMemo(() => {
49054
49035
  const ret = { ...componentState };
49036
+ const registeredApiKeys = new Set(
49037
+ Object.getOwnPropertySymbols(componentApis).map((s) => s.description).filter((d2) => d2 !== void 0)
49038
+ );
49055
49039
  for (const stateKey of Object.getOwnPropertySymbols(componentState)) {
49056
49040
  const value = componentState[stateKey];
49057
49041
  if (stateKey.description) {
49058
- ret[stateKey.description] = value;
49042
+ if (registeredApiKeys.has(stateKey.description)) {
49043
+ ret[stateKey.description] = value;
49044
+ }
49059
49045
  }
49060
49046
  }
49061
49047
  if (Reflect.ownKeys(componentApis).length === 0) {
@@ -49119,8 +49105,11 @@ const StateContainer = memo(
49119
49105
  const mergedWithVars = useMergedState(resolvedLocalVars, componentStateWithApis);
49120
49106
  const combinedState = useCombinedState(
49121
49107
  stateFromOutside,
49108
+ // Parent state (lower priority) - allows local vars to shadow
49122
49109
  node.contextVars,
49110
+ // Context vars like $item
49123
49111
  mergedWithVars,
49112
+ // Local vars and component state (higher priority) - enables shadowing
49124
49113
  routingParams
49125
49114
  );
49126
49115
  const registerComponentApi = useCallback((uid, api) => {
@@ -50004,9 +49993,19 @@ const ComponentAdapter = forwardRef(function ComponentAdapter2({
50004
49993
  const stableLayoutCss = useShallowCompareMemoize(cssProps);
50005
49994
  const className = useComponentStyle(stableLayoutCss);
50006
49995
  const { inspectId, refreshInspection } = useInspector(safeNode, uid);
49996
+ const contextVars = useMemo(() => {
49997
+ const vars2 = {};
49998
+ for (const key of Object.keys(state)) {
49999
+ if (key.startsWith("$")) {
50000
+ vars2[key] = state[key];
50001
+ }
50002
+ }
50003
+ return vars2;
50004
+ }, [state]);
50007
50005
  const rendererContext = {
50008
50006
  node: safeNode,
50009
50007
  state: state[uid] || EMPTY_OBJECT,
50008
+ contextVars,
50010
50009
  updateState: memoedUpdateState,
50011
50010
  appContext,
50012
50011
  extractValue: valueExtractor,