xmlui 0.11.20 → 0.11.21

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.
@@ -29,10 +29,11 @@ import { useVirtualizer } from "@tanstack/react-virtual";
29
29
  import { RenderPropSticky } from "react-sticky-el";
30
30
  import * as dropzone from "react-dropzone";
31
31
  import toast, { Toaster, ToastBar } from "react-hot-toast";
32
- import { Popover, PopoverTrigger, Portal, PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
32
+ import { Popover, PopoverTrigger, Portal as Portal$1, PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
33
+ import { Item as Item$1, ItemText, ItemIndicator, Root, Trigger, Portal, Content, ScrollUpButton, Viewport, Group, Label, ScrollDownButton } from "@radix-ui/react-select";
33
34
  import * as InnerRadioGroup from "@radix-ui/react-radio-group";
34
35
  import { DayPicker } from "react-day-picker";
35
- import { Root, Track, Range, Thumb } from "@radix-ui/react-slider";
36
+ import { Root as Root$1, Track, Range, Thumb } from "@radix-ui/react-slider";
36
37
  import * as RadixTooltip from "@radix-ui/react-tooltip";
37
38
  import ReactMarkdown from "react-markdown";
38
39
  import remarkGfm from "remark-gfm";
@@ -43,7 +44,7 @@ import * as HoverCard from "@radix-ui/react-hover-card";
43
44
  import { useSpring, useInView, animated } from "@react-spring/web";
44
45
  import Papa from "papaparse";
45
46
  import getUserLocale from "get-user-locale";
46
- import { Root as Root$1, List, Trigger, Content } from "@radix-ui/react-tabs";
47
+ import { Root as Root$2, List, Trigger as Trigger$1, Content as Content$1 } from "@radix-ui/react-tabs";
47
48
  import scrollIntoView from "scroll-into-view-if-needed";
48
49
  import * as RAccordion from "@radix-ui/react-accordion";
49
50
  import useEmblaCarousel from "embla-carousel-react";
@@ -94,20 +95,16 @@ class EngineError extends Error {
94
95
  }
95
96
  class GenericBackendError extends EngineError {
96
97
  constructor(info2, errorCode) {
97
- let message = "";
98
- if (info2?.code) {
99
- message += `[Error code: ${info2.code}]
100
- `;
101
- }
102
- if (info2?.details && typeof info2.details === "string") {
103
- message += `${info2.details}`;
104
- } else if (info2?.message) {
105
- message += `${info2.message}`;
106
- }
107
- super(message || info2?.message || "Unknown error");
98
+ const message = info2?.message || info2?.error?.message || info2?.title || // RFC 7807
99
+ (typeof info2?.error === "string" ? info2.error : null) || (typeof info2 === "string" ? info2 : null) || "Unknown error";
100
+ const extractedDetails = info2?.details || info2?.detail || // RFC 7807
101
+ info2?.error?.details || info2?.errors || // Validation errors array
102
+ (info2?.error && typeof info2.error === "object" ? info2.error : null) || null;
103
+ const details = extractedDetails ? info2?.issues ? { ...extractedDetails, issues: info2.issues } : extractedDetails : info2?.issues ? { issues: info2.issues } : null;
104
+ super(message);
108
105
  this.info = info2;
109
106
  this.errorCategory = "GenericBackendError";
110
- this.details = info2;
107
+ this.details = details;
111
108
  this.statusCode = errorCode;
112
109
  Object.setPrototypeOf(this, GenericBackendError.prototype);
113
110
  }
@@ -147,6 +144,13 @@ class ThrowStatementError extends EngineError {
147
144
  Object.setPrototypeOf(this, ThrowStatementError.prototype);
148
145
  }
149
146
  }
147
+ function createContextVariableError(err) {
148
+ return {
149
+ statusCode: err.statusCode || 500,
150
+ message: err.message || "An error occurred",
151
+ details: err.details || {}
152
+ };
153
+ }
150
154
  function reportEngineError(error2, errorToThrow) {
151
155
  if (typeof error2 === "string") {
152
156
  error2 = new Error(error2);
@@ -773,19 +777,22 @@ function getElementRef(element) {
773
777
  return element.props.ref || element.ref;
774
778
  }
775
779
  const themeVars$13 = `'{"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)"}'`;
776
- const container$3 = "_container_1bx6o_14";
777
- const top$1 = "_top_1bx6o_21";
778
- const end = "_end_1bx6o_26";
779
- const bottom$1 = "_bottom_1bx6o_32";
780
- const start = "_start_1bx6o_37";
781
- const shrinkToLabel = "_shrinkToLabel_1bx6o_43";
782
- const inputLabel = "_inputLabel_1bx6o_46";
783
- const disabled$c = "_disabled_1bx6o_59";
784
- const labelBreak = "_labelBreak_1bx6o_63";
785
- const required = "_required_1bx6o_68";
786
- const requiredMark = "_requiredMark_1bx6o_75";
787
- const itemWithLabel = "_itemWithLabel_1bx6o_79";
788
- const helperTextContainer = "_helperTextContainer_1bx6o_85";
780
+ const container$3 = "_container_ni4pj_14";
781
+ const top$1 = "_top_ni4pj_21";
782
+ const end = "_end_ni4pj_26";
783
+ const bottom$1 = "_bottom_ni4pj_31";
784
+ const start = "_start_ni4pj_36";
785
+ const shrinkToLabel = "_shrinkToLabel_ni4pj_41";
786
+ const inputLabel = "_inputLabel_ni4pj_44";
787
+ const labelBreak = "_labelBreak_ni4pj_57";
788
+ const required = "_required_ni4pj_62";
789
+ const disabled$c = "_disabled_ni4pj_69";
790
+ const requiredMark = "_requiredMark_ni4pj_73";
791
+ const itemWithLabel = "_itemWithLabel_ni4pj_77";
792
+ const wrapper$n = "_wrapper_ni4pj_82";
793
+ const validationResultWrapper = "_validationResultWrapper_ni4pj_90";
794
+ const helperTextContainer = "_helperTextContainer_ni4pj_93";
795
+ const labelWrapper$1 = "_labelWrapper_ni4pj_96";
789
796
  const styles$1l = {
790
797
  themeVars: themeVars$13,
791
798
  container: container$3,
@@ -795,12 +802,15 @@ const styles$1l = {
795
802
  start,
796
803
  shrinkToLabel,
797
804
  inputLabel,
798
- disabled: disabled$c,
799
805
  labelBreak,
800
806
  required,
807
+ disabled: disabled$c,
801
808
  requiredMark,
802
809
  itemWithLabel,
803
- helperTextContainer
810
+ wrapper: wrapper$n,
811
+ validationResultWrapper,
812
+ helperTextContainer,
813
+ labelWrapper: labelWrapper$1
804
814
  };
805
815
  const themeVars$12 = `'{"size-Spinner": "var(--xmlui-size-Spinner)", "thickness-Spinner": "var(--xmlui-thickness-Spinner)", "borderColor-Spinner": "var(--xmlui-borderColor-Spinner)"}'`;
806
816
  const fullScreenSpinnerWrapper = "_fullScreenSpinnerWrapper_b1pgc_50";
@@ -908,69 +918,72 @@ const ItemWithLabel = forwardRef(function ItemWithLabel2({
908
918
  }, ref) {
909
919
  const generatedId2 = useId();
910
920
  const inputId = id || generatedId2;
921
+ const inputRef = useRef(null);
922
+ const inputHeight = inputRef.current?.offsetHeight;
923
+ const labelWrapperHeight = labelPosition === "start" || labelPosition === "end" ? inputHeight : "auto";
911
924
  if (label2 === void 0 && !validationResult) {
912
- return /* @__PURE__ */ jsx(Part, { partId: PART_LABELED_ITEM, children: /* @__PURE__ */ jsx(
913
- Slot,
914
- {
915
- ...rest,
916
- style: style2,
917
- className,
918
- id: inputId,
919
- ref,
920
- children
921
- }
922
- ) });
925
+ return /* @__PURE__ */ jsx(Part, { partId: PART_LABELED_ITEM, children: /* @__PURE__ */ jsx(Slot, { ...rest, style: style2, className, id: inputId, ref, children }) });
923
926
  }
924
- return /* @__PURE__ */ jsxs("div", { ...rest, ref, style: style2, className: classnames(className, styles$1l.itemWithLabel), children: [
925
- /* @__PURE__ */ jsxs(
926
- "div",
927
- {
928
- className: classnames(styles$1l.container, {
929
- [styles$1l.top]: labelPosition === "top",
930
- [styles$1l.bottom]: labelPosition === "bottom",
931
- [styles$1l.start]: labelPosition === "start",
932
- [styles$1l.end]: labelPosition === "end",
933
- [styles$1l.shrinkToLabel]: shrinkToLabel2
934
- }),
935
- children: [
936
- label2 && /* @__PURE__ */ jsx(Part, { partId: PART_LABEL, children: /* @__PURE__ */ jsxs(
937
- "label",
938
- {
939
- htmlFor: inputId,
940
- onClick: onLabelClick || (() => document.getElementById(inputId)?.focus()),
941
- style: {
942
- ...labelStyle,
943
- width: labelWidth && numberRegex.test(labelWidth) ? `${labelWidth}px` : labelWidth,
944
- flexShrink: labelWidth !== void 0 ? 0 : void 0
945
- },
946
- className: classnames(styles$1l.inputLabel, {
947
- [styles$1l.required]: required2,
948
- [styles$1l.disabled]: !enabled2,
949
- [styles$1l.labelBreak]: labelBreak2
950
- }),
951
- children: [
952
- label2,
953
- " ",
954
- required2 && /* @__PURE__ */ jsx("span", { className: styles$1l.requiredMark, children: "*" }),
955
- validationInProgress && /* @__PURE__ */ jsx(
956
- Spinner,
957
- {
958
- style: { height: "1em", width: "1em", marginLeft: "1em", alignSelf: "center" }
959
- }
960
- )
961
- ]
962
- }
963
- ) }),
927
+ return /* @__PURE__ */ jsx("div", { ...rest, ref, style: style2, className: classnames(className, styles$1l.itemWithLabel), children: /* @__PURE__ */ jsxs(
928
+ "div",
929
+ {
930
+ className: classnames(styles$1l.container, {
931
+ [styles$1l.top]: labelPosition === "top",
932
+ [styles$1l.bottom]: labelPosition === "bottom",
933
+ [styles$1l.start]: labelPosition === "start",
934
+ [styles$1l.end]: labelPosition === "end",
935
+ [styles$1l.shrinkToLabel]: shrinkToLabel2
936
+ }),
937
+ children: [
938
+ /* @__PURE__ */ jsx(
939
+ "div",
940
+ {
941
+ className: styles$1l.labelWrapper,
942
+ style: {
943
+ height: labelWrapperHeight
944
+ },
945
+ children: label2 && /* @__PURE__ */ jsx(Part, { partId: PART_LABEL, children: /* @__PURE__ */ jsxs(
946
+ "label",
947
+ {
948
+ htmlFor: inputId,
949
+ onClick: onLabelClick || (() => document.getElementById(inputId)?.focus()),
950
+ style: {
951
+ ...labelStyle,
952
+ width: labelWidth && numberRegex.test(labelWidth) ? `${labelWidth}px` : labelWidth,
953
+ flexShrink: labelWidth !== void 0 ? 0 : void 0
954
+ },
955
+ className: classnames(styles$1l.inputLabel, {
956
+ [styles$1l.required]: required2,
957
+ [styles$1l.disabled]: !enabled2,
958
+ [styles$1l.labelBreak]: labelBreak2
959
+ }),
960
+ children: [
961
+ label2,
962
+ " ",
963
+ required2 && /* @__PURE__ */ jsx("span", { className: styles$1l.requiredMark, children: "*" }),
964
+ validationInProgress && /* @__PURE__ */ jsx(
965
+ Spinner,
966
+ {
967
+ style: { height: "1em", width: "1em", marginLeft: "1em", alignSelf: "center" }
968
+ }
969
+ )
970
+ ]
971
+ }
972
+ ) })
973
+ }
974
+ ),
975
+ /* @__PURE__ */ jsxs("div", { className: styles$1l.wrapper, children: [
964
976
  /* @__PURE__ */ jsx(Part, { partId: PART_LABELED_ITEM, children: cloneElement(children, {
965
977
  id: !isInputTemplateUsed ? inputId : void 0,
966
978
  style: void 0,
967
- className: void 0
968
- }) })
969
- ]
970
- }
971
- ),
972
- validationResult
973
- ] });
979
+ className: void 0,
980
+ ref: inputRef
981
+ }) }),
982
+ validationResult && /* @__PURE__ */ jsx("div", { className: styles$1l.validationResultWrapper, children: validationResult })
983
+ ] })
984
+ ]
985
+ }
986
+ ) });
974
987
  });
975
988
  function createMetadata(metadata) {
976
989
  return metadata;
@@ -13646,6 +13659,7 @@ function useRowSelection({
13646
13659
  rowsSelectable,
13647
13660
  enableMultiRowSelection,
13648
13661
  rowDisabledPredicate,
13662
+ rowUnselectablePredicate,
13649
13663
  onSelectionDidChange,
13650
13664
  initiallySelected = EMPTY_ARRAY,
13651
13665
  syncWithAppState
@@ -13901,7 +13915,7 @@ function useRowSelection({
13901
13915
  return;
13902
13916
  }
13903
13917
  setSelectedRowIds(
13904
- checked2 ? items.filter((item2) => rowDisabledPredicate ? !rowDisabledPredicate(item2) : true).map((item2) => item2[idKey]) : []
13918
+ checked2 ? items.filter((item2) => !(rowDisabledPredicate?.(item2) || rowUnselectablePredicate?.(item2))).map((item2) => item2[idKey]) : []
13905
13919
  );
13906
13920
  });
13907
13921
  const selectedRowIdMap = useMemo(() => {
@@ -14354,6 +14368,9 @@ const CheckboxToleranceValues = ["none", "compact", "comfortable", "spacious"];
14354
14368
  function defaultIsRowDisabled(_) {
14355
14369
  return false;
14356
14370
  }
14371
+ function defaultIsRowUnselectable(_) {
14372
+ return false;
14373
+ }
14357
14374
  const SELECT_COLUMN_WIDTH = 42;
14358
14375
  const DEFAULT_PAGE_SIZES = [10];
14359
14376
  const getCheckboxTolerancePixels = (tolerance) => {
@@ -14413,6 +14430,7 @@ const Table = forwardRef(
14413
14430
  pageSize = pageSizeOptions?.[0] || DEFAULT_PAGE_SIZES[0],
14414
14431
  currentPageIndex = 0,
14415
14432
  rowDisabledPredicate = defaultIsRowDisabled,
14433
+ rowUnselectablePredicate = defaultIsRowUnselectable,
14416
14434
  sortBy: sortBy2,
14417
14435
  sortingDirection = defaultProps$$.sortingDirection,
14418
14436
  iconSortAsc,
@@ -14481,6 +14499,7 @@ const Table = forwardRef(
14481
14499
  rowsSelectable,
14482
14500
  enableMultiRowSelection,
14483
14501
  rowDisabledPredicate,
14502
+ rowUnselectablePredicate,
14484
14503
  onSelectionDidChange,
14485
14504
  initiallySelected,
14486
14505
  syncWithAppState
@@ -14605,14 +14624,16 @@ const Table = forwardRef(
14605
14624
  indeterminate: table22.getIsSomeRowsSelected(),
14606
14625
  forceHover: headerCheckboxHovered,
14607
14626
  onDidChange: () => {
14608
- const allSelected2 = table22.getRowModel().rows.every((row2) => rowDisabledPredicate(row2.original) || row2.getIsSelected());
14627
+ const allSelected2 = table22.getRowModel().rows.every(
14628
+ (row2) => rowDisabledPredicate(row2.original) || rowUnselectablePredicate(row2.original) || row2.getIsSelected()
14629
+ );
14609
14630
  checkAllRows(!allSelected2);
14610
14631
  }
14611
14632
  }
14612
14633
  }
14613
14634
  ) : null,
14614
14635
  cell: ({ row: row2 }) => {
14615
- return /* @__PURE__ */ jsx(
14636
+ return /* @__PURE__ */ jsx(Fragment, { children: row2.getCanSelect() && /* @__PURE__ */ jsx(
14616
14637
  Toggle,
14617
14638
  {
14618
14639
  ...{
@@ -14631,7 +14652,7 @@ const Table = forwardRef(
14631
14652
  }
14632
14653
  }
14633
14654
  }
14634
- );
14655
+ ) });
14635
14656
  }
14636
14657
  };
14637
14658
  return rowsSelectable ? [selectColumn, ...columnsWithCustomCell] : columnsWithCustomCell;
@@ -14643,6 +14664,7 @@ const Table = forwardRef(
14643
14664
  checkAllRows,
14644
14665
  toggleRow,
14645
14666
  rowDisabledPredicate,
14667
+ rowUnselectablePredicate,
14646
14668
  hoveredRowId,
14647
14669
  headerCheckboxHovered
14648
14670
  ]);
@@ -14687,12 +14709,18 @@ const Table = forwardRef(
14687
14709
  right: right2
14688
14710
  };
14689
14711
  }, [columnsWithSelectColumn]);
14712
+ const enableRowSelectionFn = useCallback(
14713
+ (row2) => {
14714
+ return rowsSelectable && !rowUnselectablePredicate(row2.original);
14715
+ },
14716
+ [rowUnselectablePredicate, rowsSelectable]
14717
+ );
14690
14718
  const table2 = useReactTable({
14691
14719
  columns: columnsWithSelectColumn,
14692
14720
  data: sortedData,
14693
14721
  getCoreRowModel: getCoreRowModel(),
14694
14722
  getPaginationRowModel: isPaginated ? getPaginationRowModel() : void 0,
14695
- enableRowSelection: rowsSelectable,
14723
+ enableRowSelection: enableRowSelectionFn,
14696
14724
  enableMultiRowSelection,
14697
14725
  columnResizeMode: "onChange",
14698
14726
  getRowId: useCallback(
@@ -14842,7 +14870,7 @@ const Table = forwardRef(
14842
14870
  event.preventDefault();
14843
14871
  event.stopPropagation();
14844
14872
  const allSelected2 = table2.getRowModel().rows.every(
14845
- (row2) => rowDisabledPredicate(row2.original) || row2.getIsSelected()
14873
+ (row2) => rowDisabledPredicate(row2.original) || rowUnselectablePredicate(row2.original) || row2.getIsSelected()
14846
14874
  );
14847
14875
  checkAllRows(!allSelected2);
14848
14876
  }
@@ -14997,6 +15025,9 @@ const Table = forwardRef(
14997
15025
  rowVirtualizer.measureElement(el);
14998
15026
  },
14999
15027
  onClick: (event) => {
15028
+ if (!row2.getCanSelect()) {
15029
+ return;
15030
+ }
15000
15031
  if (event?.defaultPrevented) {
15001
15032
  return;
15002
15033
  }
@@ -15220,6 +15251,9 @@ const TableMd = createMetadata({
15220
15251
  rowDisabledPredicate: d(
15221
15252
  `This property defines a predicate function with a return value that determines if the row should be disabled. The function retrieves the item to display and should return a Boolean-like value.`
15222
15253
  ),
15254
+ rowUnselectablePredicate: {
15255
+ description: `This property defines a predicate function with a return value that determines if the row should be unselectable. The function retrieves the item to display and should return a Boolean-like value. This property only has an effect when the \`rowsSelectable\` property is set to \`true\`.`
15256
+ },
15223
15257
  noDataTemplate: dComponent(
15224
15258
  `A property to customize what to display if the table does not contain any data.`
15225
15259
  ),
@@ -15441,6 +15475,7 @@ const TableWithColumns = memo(
15441
15475
  isPaginated: extractValue.asOptionalBoolean(node.props?.isPaginated),
15442
15476
  headerHeight: extractValue.asSize(node.props.headerHeight),
15443
15477
  rowDisabledPredicate: lookupSyncCallback(node.props.rowDisabledPredicate),
15478
+ rowUnselectablePredicate: lookupSyncCallback(node.props.rowUnselectablePredicate),
15444
15479
  sortBy: extractValue(node.props?.sortBy),
15445
15480
  sortingDirection: extractValue(node.props?.sortDirection),
15446
15481
  iconSortAsc: extractValue.asOptionalString(node.props?.iconSortAsc),
@@ -21001,47 +21036,48 @@ function useLongPress(elementRef, action2, delay2 = 500) {
21001
21036
  }, [elementRef, action2, delay2]);
21002
21037
  }
21003
21038
  const themeVars$r = `'{"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)", "minHeight-Select": "var(--xmlui-minHeight-Select)", "minHeight-item-Select": "var(--xmlui-minHeight-item-Select)"}'`;
21004
- const selectTrigger = "_selectTrigger_tlyg2_17";
21005
- const error$9 = "_error_tlyg2_55";
21006
- const warning$a = "_warning_tlyg2_81";
21007
- const valid$9 = "_valid_tlyg2_107";
21008
- const disabled$7 = "_disabled_tlyg2_133";
21009
- const placeholder$1 = "_placeholder_tlyg2_146";
21010
- const actions$1 = "_actions_tlyg2_163";
21011
- const action$1 = "_action_tlyg2_163";
21012
- const emptyList = "_emptyList_tlyg2_174";
21013
- const badgeListContainer = "_badgeListContainer_tlyg2_186";
21014
- const badgeList$1 = "_badgeList_tlyg2_186";
21015
- const inputWrapper$1 = "_inputWrapper_tlyg2_199";
21016
- const badge$1 = "_badge_tlyg2_186";
21017
- const selectContent = "_selectContent_tlyg2_234";
21018
- const command$1 = "_command_tlyg2_252";
21019
- const commandInputContainer = "_commandInputContainer_tlyg2_257";
21020
- const commandInput$1 = "_commandInput_tlyg2_257";
21021
- const commandList$1 = "_commandList_tlyg2_276";
21022
- const multiSelectOption = "_multiSelectOption_tlyg2_283";
21023
- const multiSelectOptionContent = "_multiSelectOptionContent_tlyg2_298";
21024
- const highlighted$1 = "_highlighted_tlyg2_307";
21025
- const disabledOption$1 = "_disabledOption_tlyg2_313";
21026
- const selectValue = "_selectValue_tlyg2_328";
21027
- const selectDropdownContent = "_selectDropdownContent_tlyg2_338";
21028
- const fadeIn = "_fadeIn_tlyg2_1";
21029
- const zoomIn = "_zoomIn_tlyg2_1";
21030
- const fadeOut = "_fadeOut_tlyg2_1";
21031
- const zoomOut = "_zoomOut_tlyg2_1";
21032
- const slideInFromTop = "_slideInFromTop_tlyg2_1";
21033
- const slideInFromRight = "_slideInFromRight_tlyg2_1";
21034
- const slideInFromLeft = "_slideInFromLeft_tlyg2_1";
21035
- const slideInFromBottom = "_slideInFromBottom_tlyg2_1";
21036
- const selectViewport = "_selectViewport_tlyg2_370";
21037
- const selectScrollUpButton = "_selectScrollUpButton_tlyg2_374";
21038
- const selectScrollDownButton = "_selectScrollDownButton_tlyg2_382";
21039
- const selectEmpty = "_selectEmpty_tlyg2_390";
21040
- const selectOption = "_selectOption_tlyg2_403";
21041
- const selectOptionContent = "_selectOptionContent_tlyg2_427";
21042
- const selectOptionIndicator = "_selectOptionIndicator_tlyg2_441";
21043
- const loading = "_loading_tlyg2_451";
21044
- const srOnly = "_srOnly_tlyg2_454";
21039
+ const selectTrigger = "_selectTrigger_1c0m5_17";
21040
+ const error$9 = "_error_1c0m5_55";
21041
+ const warning$a = "_warning_1c0m5_81";
21042
+ const valid$9 = "_valid_1c0m5_107";
21043
+ const disabled$7 = "_disabled_1c0m5_133";
21044
+ const placeholder$1 = "_placeholder_1c0m5_145";
21045
+ const actions$1 = "_actions_1c0m5_162";
21046
+ const action$1 = "_action_1c0m5_162";
21047
+ const emptyList = "_emptyList_1c0m5_176";
21048
+ const badgeListContainer = "_badgeListContainer_1c0m5_188";
21049
+ const badgeList$1 = "_badgeList_1c0m5_188";
21050
+ const inputWrapper$1 = "_inputWrapper_1c0m5_201";
21051
+ const badge$1 = "_badge_1c0m5_188";
21052
+ const selectContent = "_selectContent_1c0m5_236";
21053
+ const command$1 = "_command_1c0m5_254";
21054
+ const commandInputContainer = "_commandInputContainer_1c0m5_259";
21055
+ const commandInput$1 = "_commandInput_1c0m5_259";
21056
+ const commandList$1 = "_commandList_1c0m5_277";
21057
+ const groupHeader = "_groupHeader_1c0m5_284";
21058
+ const multiSelectOption = "_multiSelectOption_1c0m5_296";
21059
+ const multiSelectOptionContent = "_multiSelectOptionContent_1c0m5_311";
21060
+ const highlighted$1 = "_highlighted_1c0m5_320";
21061
+ const disabledOption$1 = "_disabledOption_1c0m5_326";
21062
+ const selectValue = "_selectValue_1c0m5_341";
21063
+ const selectDropdownContent = "_selectDropdownContent_1c0m5_351";
21064
+ const fadeIn = "_fadeIn_1c0m5_1";
21065
+ const zoomIn = "_zoomIn_1c0m5_1";
21066
+ const fadeOut = "_fadeOut_1c0m5_1";
21067
+ const zoomOut = "_zoomOut_1c0m5_1";
21068
+ const slideInFromTop = "_slideInFromTop_1c0m5_1";
21069
+ const slideInFromRight = "_slideInFromRight_1c0m5_1";
21070
+ const slideInFromLeft = "_slideInFromLeft_1c0m5_1";
21071
+ const slideInFromBottom = "_slideInFromBottom_1c0m5_1";
21072
+ const selectViewport = "_selectViewport_1c0m5_383";
21073
+ const selectScrollUpButton = "_selectScrollUpButton_1c0m5_387";
21074
+ const selectScrollDownButton = "_selectScrollDownButton_1c0m5_395";
21075
+ const selectEmpty = "_selectEmpty_1c0m5_403";
21076
+ const selectOption = "_selectOption_1c0m5_416";
21077
+ const selectOptionContent = "_selectOptionContent_1c0m5_440";
21078
+ const selectOptionIndicator = "_selectOptionIndicator_1c0m5_454";
21079
+ const loading = "_loading_1c0m5_464";
21080
+ const srOnly = "_srOnly_1c0m5_467";
21045
21081
  const styles$K = {
21046
21082
  themeVars: themeVars$r,
21047
21083
  selectTrigger,
@@ -21062,6 +21098,7 @@ const styles$K = {
21062
21098
  commandInputContainer,
21063
21099
  commandInput: commandInput$1,
21064
21100
  commandList: commandList$1,
21101
+ groupHeader,
21065
21102
  multiSelectOption,
21066
21103
  multiSelectOptionContent,
21067
21104
  highlighted: highlighted$1,
@@ -21094,8 +21131,11 @@ const SelectContext = createContext({
21094
21131
  },
21095
21132
  setSelectedIndex: (index) => {
21096
21133
  },
21097
- options: /* @__PURE__ */ new Set(),
21098
- optionRenderer: void 0
21134
+ optionRenderer: void 0,
21135
+ onOptionAdd: () => {
21136
+ },
21137
+ onOptionRemove: () => {
21138
+ }
21099
21139
  });
21100
21140
  function useSelect() {
21101
21141
  return useContext(SelectContext);
@@ -21120,22 +21160,235 @@ function useOption() {
21120
21160
  return useContext(OptionContext);
21121
21161
  }
21122
21162
  function HiddenOption(option) {
21123
- const { label: label2 } = option;
21124
- const { onOptionAdd } = useOption();
21125
- const [node, setNode] = useState(null);
21126
- const opt = useMemo(() => {
21127
- return {
21163
+ const { onOptionAdd, onOptionRemove } = useOption();
21164
+ const nodeRef = useRef(null);
21165
+ useEffect(() => {
21166
+ let textNode;
21167
+ if (nodeRef.current) {
21168
+ textNode = nodeRef.current.textContent;
21169
+ }
21170
+ const opt = {
21128
21171
  ...option,
21129
- label: label2 ?? node?.textContent ?? "",
21130
- keywords: option.keywords || [label2 ?? node?.textContent ?? ""]
21131
- // Store the rendered ReactNode for dropdown display
21172
+ label: option.label || textNode || option.value
21132
21173
  };
21133
- }, [option, node, label2]);
21134
- useEffect(() => {
21135
21174
  onOptionAdd(opt);
21136
- }, [opt, onOptionAdd]);
21137
- return /* @__PURE__ */ jsx("div", { ref: (el) => setNode(el), style: { display: "none" }, children: option.children });
21175
+ return () => {
21176
+ onOptionRemove(opt);
21177
+ };
21178
+ }, [option, onOptionAdd, onOptionRemove]);
21179
+ return /* @__PURE__ */ jsx(
21180
+ "span",
21181
+ {
21182
+ ref: nodeRef,
21183
+ style: { display: "none", visibility: "hidden", width: 0, height: 0, position: "absolute" },
21184
+ children: option.children
21185
+ }
21186
+ );
21138
21187
  }
21188
+ const SelectOption = forwardRef(
21189
+ function SelectOption2(option, ref) {
21190
+ const visibleContentRef = useRef(null);
21191
+ const { value, label: label2, enabled: enabled2 = true, children, className } = option;
21192
+ const { value: selectedValue, optionRenderer } = useSelect();
21193
+ return /* @__PURE__ */ jsx(
21194
+ Item$1,
21195
+ {
21196
+ ref,
21197
+ className: classnames(className, styles$K.selectOption),
21198
+ value,
21199
+ textValue: label2,
21200
+ disabled: !enabled2,
21201
+ onClick: (event) => {
21202
+ event.stopPropagation();
21203
+ },
21204
+ "data-state": selectedValue === value && "checked",
21205
+ children: children ? /* @__PURE__ */ jsxs(Fragment, { children: [
21206
+ /* @__PURE__ */ jsxs("div", { className: styles$K.selectOptionContent, ref: visibleContentRef, children: [
21207
+ /* @__PURE__ */ jsx("span", { style: { visibility: "hidden", position: "absolute", width: 0, height: 0 }, children: /* @__PURE__ */ jsx(ItemText, { children: label2 }) }),
21208
+ children
21209
+ ] }),
21210
+ selectedValue === value && /* @__PURE__ */ jsx(ItemIndicator, { className: styles$K.selectOptionIndicator, children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) })
21211
+ ] }) : optionRenderer ? /* @__PURE__ */ jsxs("div", { className: styles$K.selectOptionContent, ref: visibleContentRef, children: [
21212
+ /* @__PURE__ */ jsx("span", { style: { visibility: "hidden", position: "absolute", width: 0, height: 0 }, children: /* @__PURE__ */ jsx(ItemText, { children: label2 }) }),
21213
+ optionRenderer(
21214
+ {
21215
+ label: label2,
21216
+ value,
21217
+ enabled: enabled2
21218
+ },
21219
+ selectedValue,
21220
+ false
21221
+ )
21222
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
21223
+ /* @__PURE__ */ jsx("div", { className: styles$K.selectOptionContent, ref: visibleContentRef, children: /* @__PURE__ */ jsx(ItemText, { children: label2 }) }),
21224
+ selectedValue === value && /* @__PURE__ */ jsx(ItemIndicator, { className: styles$K.selectItemIndicator, children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) })
21225
+ ] })
21226
+ }
21227
+ );
21228
+ }
21229
+ );
21230
+ const SimpleSelect = forwardRef(
21231
+ function SimpleSelect2(props, forwardedRef) {
21232
+ const { root: root2 } = useTheme();
21233
+ const {
21234
+ enabled: enabled2,
21235
+ onBlur,
21236
+ autoFocus,
21237
+ onValueChange,
21238
+ validationStatus,
21239
+ value,
21240
+ height,
21241
+ style: style2,
21242
+ placeholder: placeholder2,
21243
+ id,
21244
+ triggerRef,
21245
+ onFocus,
21246
+ width,
21247
+ readOnly: readOnly2,
21248
+ emptyListNode,
21249
+ className,
21250
+ modal,
21251
+ groupBy: groupBy2,
21252
+ groupHeaderRenderer,
21253
+ ungroupedHeaderRenderer,
21254
+ clearable,
21255
+ onClear,
21256
+ options: options2,
21257
+ children,
21258
+ ...rest
21259
+ } = props;
21260
+ const composedRef = forwardRef ? composeRefs(triggerRef, forwardedRef) : triggerRef;
21261
+ const [open, setOpen] = useState(false);
21262
+ const stringValue = useMemo(() => {
21263
+ return value != void 0 ? String(value) : void 0;
21264
+ }, [value]);
21265
+ const handleValueChange = useCallback(
21266
+ (val) => {
21267
+ if (readOnly2) return;
21268
+ onValueChange(val);
21269
+ },
21270
+ [onValueChange, readOnly2]
21271
+ );
21272
+ const selectedOption = useMemo(() => {
21273
+ return options2.find((option) => `${option.value}` === `${value}`);
21274
+ }, [options2, value]);
21275
+ const groupedOptions = useMemo(() => {
21276
+ if (!groupBy2) return null;
21277
+ const groups = {};
21278
+ options2.forEach((option) => {
21279
+ const groupKey = option[groupBy2] || "Ungrouped";
21280
+ if (!groups[groupKey]) {
21281
+ groups[groupKey] = [];
21282
+ }
21283
+ groups[groupKey].push(option);
21284
+ });
21285
+ const sortedGroups = {};
21286
+ if (groups["Ungrouped"]) {
21287
+ sortedGroups["Ungrouped"] = groups["Ungrouped"];
21288
+ }
21289
+ Object.keys(groups).filter((key) => key !== "Ungrouped").sort().forEach((key) => {
21290
+ sortedGroups[key] = groups[key];
21291
+ });
21292
+ return sortedGroups;
21293
+ }, [groupBy2, options2]);
21294
+ return /* @__PURE__ */ jsxs(
21295
+ Root,
21296
+ {
21297
+ open,
21298
+ value: stringValue,
21299
+ onValueChange: handleValueChange,
21300
+ onOpenChange: () => enabled2 && !readOnly2 && setOpen(!open),
21301
+ children: [
21302
+ /* @__PURE__ */ jsxs(
21303
+ Trigger,
21304
+ {
21305
+ ...rest,
21306
+ id,
21307
+ ref: composedRef,
21308
+ "aria-haspopup": "listbox",
21309
+ style: style2,
21310
+ onFocus,
21311
+ onBlur,
21312
+ disabled: !enabled2,
21313
+ className: classnames(className, styles$K.selectTrigger, {
21314
+ [styles$K.error]: validationStatus === "error",
21315
+ [styles$K.warning]: validationStatus === "warning",
21316
+ [styles$K.valid]: validationStatus === "valid"
21317
+ }),
21318
+ onClick: (event) => {
21319
+ event.stopPropagation();
21320
+ },
21321
+ autoFocus,
21322
+ children: [
21323
+ /* @__PURE__ */ jsx(
21324
+ "div",
21325
+ {
21326
+ className: classnames(styles$K.selectValue, {
21327
+ [styles$K.placeholder]: value === void 0
21328
+ }),
21329
+ children: selectedOption ? selectedOption.label : readOnly2 ? "" : placeholder2
21330
+ }
21331
+ ),
21332
+ clearable && value !== void 0 && value !== "" && !readOnly2 && enabled2 && /* @__PURE__ */ jsx(Part, { partId: "clearButton", children: /* @__PURE__ */ jsx(
21333
+ "button",
21334
+ {
21335
+ type: "button",
21336
+ className: styles$K.clearButton,
21337
+ onPointerDown: (e) => {
21338
+ e.preventDefault();
21339
+ e.stopPropagation();
21340
+ onClear?.();
21341
+ },
21342
+ tabIndex: -1,
21343
+ children: /* @__PURE__ */ jsx(Icon, { name: "close" })
21344
+ }
21345
+ ) }),
21346
+ /* @__PURE__ */ jsx("span", { className: styles$K.action, children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" }) })
21347
+ ]
21348
+ }
21349
+ ),
21350
+ /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsxs(
21351
+ Content,
21352
+ {
21353
+ collisionPadding: 0,
21354
+ className: styles$K.selectDropdownContent,
21355
+ position: "popper",
21356
+ align: "start",
21357
+ style: { maxHeight: height, width },
21358
+ children: [
21359
+ /* @__PURE__ */ jsx(ScrollUpButton, { className: styles$K.selectScrollUpButton, children: /* @__PURE__ */ jsx(Icon, { name: "chevronup" }) }),
21360
+ /* @__PURE__ */ jsx(Part, { partId: "listWrapper", children: /* @__PURE__ */ jsx(Viewport, { className: styles$K.selectViewport, role: "listbox", children: groupBy2 && groupedOptions ? (
21361
+ // Render grouped options directly from options array
21362
+ /* @__PURE__ */ jsx(Fragment, { children: Object.keys(groupedOptions).length === 0 ? emptyListNode : Object.entries(groupedOptions).map(([groupName, groupOptions]) => /* @__PURE__ */ jsxs(Group, { children: [
21363
+ groupName === "Ungrouped" ? ungroupedHeaderRenderer && /* @__PURE__ */ jsx(Label, { className: styles$K.groupHeader, children: ungroupedHeaderRenderer() }) : /* @__PURE__ */ jsx(Label, { className: styles$K.groupHeader, children: groupHeaderRenderer ? groupHeaderRenderer(groupName) : groupName }),
21364
+ groupOptions.map((option) => /* @__PURE__ */ jsx(
21365
+ SelectOption,
21366
+ {
21367
+ value: option.value,
21368
+ label: option.label,
21369
+ enabled: option.enabled,
21370
+ className: styles$K.selectOption,
21371
+ children: option.children
21372
+ },
21373
+ option.value
21374
+ ))
21375
+ ] }, groupName)) })
21376
+ ) : (
21377
+ // Render flat options
21378
+ /* @__PURE__ */ jsxs(Fragment, { children: [
21379
+ /* @__PURE__ */ jsx(OptionTypeProvider, { Component: SelectOption, children }),
21380
+ options2.length === 0 && emptyListNode
21381
+ ] })
21382
+ ) }) }),
21383
+ /* @__PURE__ */ jsx(ScrollDownButton, { className: styles$K.selectScrollDownButton, children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" }) })
21384
+ ]
21385
+ }
21386
+ ) })
21387
+ ]
21388
+ }
21389
+ );
21390
+ }
21391
+ );
21139
21392
  const PART_LIST_WRAPPER$1 = "listWrapper";
21140
21393
  const PART_CLEAR_BUTTON$1 = "clearButton";
21141
21394
  const defaultProps$H = {
@@ -21152,24 +21405,20 @@ const defaultProps$H = {
21152
21405
  clearable: false
21153
21406
  };
21154
21407
  const SelectTriggerValue = ({
21155
- value,
21156
21408
  placeholder: placeholder2,
21157
21409
  readOnly: readOnly2,
21158
21410
  multiSelect,
21159
- options: options2,
21411
+ selectedOptions,
21160
21412
  valueRenderer,
21161
21413
  toggleOption
21162
21414
  }) => {
21163
- if (multiSelect) {
21164
- if (Array.isArray(value) && value.length > 0) {
21165
- return /* @__PURE__ */ jsx("div", { className: styles$K.badgeListContainer, children: /* @__PURE__ */ jsx("div", { className: styles$K.badgeList, children: value.map(
21166
- (v) => valueRenderer ? valueRenderer(
21167
- Array.from(options2).find((o) => o.value === `${v}`),
21168
- () => {
21169
- toggleOption(v);
21170
- }
21171
- ) : /* @__PURE__ */ jsxs("span", { className: styles$K.badge, children: [
21172
- Array.from(options2).find((o) => o.value === `${v}`)?.label,
21415
+ if (selectedOptions.length) {
21416
+ if (multiSelect) {
21417
+ return /* @__PURE__ */ jsx("div", { className: styles$K.badgeListContainer, children: /* @__PURE__ */ jsx("div", { className: styles$K.badgeList, children: selectedOptions.map(
21418
+ (option) => valueRenderer ? valueRenderer(option, () => {
21419
+ if (!readOnly2) toggleOption(option.value);
21420
+ }) : /* @__PURE__ */ jsxs("span", { className: styles$K.badge, children: [
21421
+ option.label,
21173
21422
  /* @__PURE__ */ jsx(
21174
21423
  Icon,
21175
21424
  {
@@ -21177,20 +21426,17 @@ const SelectTriggerValue = ({
21177
21426
  size: "sm",
21178
21427
  onClick: (event) => {
21179
21428
  event.stopPropagation();
21180
- toggleOption(v);
21429
+ if (!readOnly2) toggleOption(option.value);
21181
21430
  }
21182
21431
  }
21183
21432
  )
21184
- ] }, v)
21433
+ ] }, option.value)
21185
21434
  ) }) });
21435
+ } else {
21436
+ return /* @__PURE__ */ jsx("div", { className: styles$K.selectValue, children: selectedOptions[0]?.label });
21186
21437
  }
21187
- return /* @__PURE__ */ jsx("span", { placeholder: placeholder2, className: styles$K.placeholder, children: placeholder2 });
21188
- }
21189
- if (value !== void 0 && value !== null && value !== "") {
21190
- const selectedOption = Array.from(options2).find((o) => o.value === value);
21191
- return /* @__PURE__ */ jsx("div", { className: styles$K.selectValue, children: selectedOption?.label });
21192
21438
  }
21193
- return /* @__PURE__ */ jsx("div", { "aria-placeholder": placeholder2, className: styles$K.placeholder, children: readOnly2 ? "" : placeholder2 || "" });
21439
+ return /* @__PURE__ */ jsx("span", { placeholder: placeholder2, className: styles$K.placeholder, children: placeholder2 });
21194
21440
  };
21195
21441
  const SelectTriggerActions = ({
21196
21442
  value,
@@ -21203,10 +21449,9 @@ const SelectTriggerActions = ({
21203
21449
  }) => {
21204
21450
  const hasValue = multiSelect ? Array.isArray(value) && value.length > 0 : value !== void 0 && value !== null && value !== "";
21205
21451
  return /* @__PURE__ */ jsxs("div", { className: styles$K.actions, children: [
21206
- hasValue && enabled2 && !readOnly2 && clearable && /* @__PURE__ */ jsx(
21452
+ hasValue && enabled2 && !readOnly2 && clearable && /* @__PURE__ */ jsx(Part, { partId: PART_CLEAR_BUTTON$1, children: /* @__PURE__ */ jsx(
21207
21453
  "span",
21208
21454
  {
21209
- "data-part-id": PART_CLEAR_BUTTON$1,
21210
21455
  className: styles$K.action,
21211
21456
  onClick: (event) => {
21212
21457
  event.stopPropagation();
@@ -21214,8 +21459,15 @@ const SelectTriggerActions = ({
21214
21459
  },
21215
21460
  children: /* @__PURE__ */ jsx(Icon, { name: "close" })
21216
21461
  }
21217
- ),
21218
- showChevron && /* @__PURE__ */ jsx("span", { className: styles$K.action, children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" }) })
21462
+ ) }),
21463
+ showChevron && /* @__PURE__ */ jsx(
21464
+ "span",
21465
+ {
21466
+ className: classnames(styles$K.action, { [styles$K.disabled]: !enabled2 || readOnly2 }),
21467
+ "aria-disabled": !enabled2 || readOnly2,
21468
+ children: /* @__PURE__ */ jsx(Icon, { name: "chevrondown" })
21469
+ }
21470
+ )
21219
21471
  ] });
21220
21472
  };
21221
21473
  const Select = forwardRef(function Select2({
@@ -21248,6 +21500,10 @@ const Select = forwardRef(function Select2({
21248
21500
  // Progress state
21249
21501
  inProgress = defaultProps$H.inProgress,
21250
21502
  inProgressNotificationMessage = defaultProps$H.inProgressNotificationMessage,
21503
+ // Grouping
21504
+ groupBy: groupBy2,
21505
+ groupHeaderRenderer,
21506
+ ungroupedHeaderRenderer,
21251
21507
  // Internal
21252
21508
  updateState = noop$1,
21253
21509
  registerComponentApi,
@@ -21260,9 +21516,17 @@ const Select = forwardRef(function Select2({
21260
21516
  const [width, setWidth] = useState(0);
21261
21517
  const observer = useRef();
21262
21518
  const { root: root2 } = useTheme();
21263
- const [options2, setOptions] = useState(/* @__PURE__ */ new Set());
21519
+ const [options2, setOptions] = useState([]);
21264
21520
  const [searchTerm, setSearchTerm] = useState("");
21265
21521
  const [selectedIndex, setSelectedIndex] = useState(-1);
21522
+ const selectedOptions = useMemo(() => {
21523
+ if (!multiSelect) {
21524
+ return options2.filter((option) => `${option.value}` === `${value}`);
21525
+ } else {
21526
+ return Array.isArray(value) ? options2.filter((option) => value.map((v) => String(v)).includes(String(option.value))) : [];
21527
+ }
21528
+ }, [multiSelect, options2, value]);
21529
+ const currentValue = value !== void 0 ? value : initialValue;
21266
21530
  const filteredOptions = useMemo(() => {
21267
21531
  if (!searchTerm || searchTerm.trim() === "") {
21268
21532
  return Array.from(options2);
@@ -21273,6 +21537,34 @@ const Select = forwardRef(function Select2({
21273
21537
  return extendedValue.toLowerCase().includes(searchLower);
21274
21538
  });
21275
21539
  }, [options2, searchTerm]);
21540
+ const groupedOptions = useMemo(() => {
21541
+ if (!groupBy2) return null;
21542
+ const optionsToGroup = searchTerm ? filteredOptions : Array.from(options2);
21543
+ const groups = {};
21544
+ optionsToGroup.forEach((option) => {
21545
+ const groupKey = option[groupBy2] || "Ungrouped";
21546
+ if (!groups[groupKey]) {
21547
+ groups[groupKey] = [];
21548
+ }
21549
+ groups[groupKey].push(option);
21550
+ });
21551
+ const sortedGroups = {};
21552
+ if (groups["Ungrouped"]) {
21553
+ sortedGroups["Ungrouped"] = groups["Ungrouped"];
21554
+ }
21555
+ Object.keys(groups).filter((key) => key !== "Ungrouped").sort().forEach((key) => {
21556
+ sortedGroups[key] = groups[key];
21557
+ });
21558
+ return sortedGroups;
21559
+ }, [groupBy2, options2, filteredOptions, searchTerm]);
21560
+ const flattenedGroupedOptions = useMemo(() => {
21561
+ if (!groupedOptions) return null;
21562
+ const flattened = [];
21563
+ Object.entries(groupedOptions).forEach(([_, groupOptions]) => {
21564
+ flattened.push(...groupOptions);
21565
+ });
21566
+ return flattened;
21567
+ }, [groupedOptions]);
21276
21568
  useEffect(() => {
21277
21569
  if (!open) {
21278
21570
  setSelectedIndex(-1);
@@ -21286,25 +21578,30 @@ const Select = forwardRef(function Select2({
21286
21578
  }, [initialValue, updateState]);
21287
21579
  useEffect(() => {
21288
21580
  const current = referenceElement;
21289
- observer.current?.disconnect();
21581
+ const currentObserver = observer.current;
21582
+ currentObserver?.disconnect();
21290
21583
  if (current) {
21291
- observer.current = new ResizeObserver(() => setWidth(current.clientWidth));
21292
- observer.current.observe(current);
21584
+ const newObserver = new ResizeObserver(() => setWidth(current.clientWidth));
21585
+ observer.current = newObserver;
21586
+ newObserver.observe(current);
21587
+ return () => {
21588
+ newObserver.disconnect();
21589
+ };
21293
21590
  }
21294
21591
  return () => {
21295
- observer.current?.disconnect();
21592
+ currentObserver?.disconnect();
21296
21593
  };
21297
21594
  }, [referenceElement]);
21298
21595
  const toggleOption = useCallback(
21299
21596
  (selectedValue) => {
21300
- const newSelectedValue = multiSelect ? Array.isArray(value) ? value.map((v) => String(v)).includes(String(selectedValue)) ? value.filter((v) => String(v) !== String(selectedValue)) : [...value, selectedValue] : [selectedValue] : String(selectedValue) === String(value) ? null : selectedValue;
21597
+ const newSelectedValue = multiSelect ? Array.isArray(currentValue) ? currentValue.map((v) => String(v)).includes(String(selectedValue)) ? currentValue.filter((v) => String(v) !== String(selectedValue)) : [...currentValue, selectedValue] : [selectedValue] : String(selectedValue) === String(currentValue) ? null : selectedValue;
21301
21598
  updateState({ value: newSelectedValue });
21302
21599
  onDidChange(newSelectedValue);
21303
21600
  if (!multiSelect) {
21304
21601
  setOpen(false);
21305
21602
  }
21306
21603
  },
21307
- [multiSelect, value, updateState, onDidChange]
21604
+ [multiSelect, currentValue, updateState, onDidChange]
21308
21605
  );
21309
21606
  const clearValue = useCallback(() => {
21310
21607
  const newValue = multiSelect ? [] : "";
@@ -21313,45 +21610,48 @@ const Select = forwardRef(function Select2({
21313
21610
  }, [multiSelect, updateState, onDidChange]);
21314
21611
  const findNextEnabledIndex = useCallback(
21315
21612
  (currentIndex) => {
21316
- if (filteredOptions.length === 0) return -1;
21317
- for (let i = currentIndex + 1; i < filteredOptions.length; i++) {
21318
- const item2 = filteredOptions[i];
21613
+ const optionsList = flattenedGroupedOptions ? flattenedGroupedOptions : filteredOptions;
21614
+ if (optionsList.length === 0) return -1;
21615
+ for (let i = currentIndex + 1; i < optionsList.length; i++) {
21616
+ const item2 = optionsList[i];
21319
21617
  if (item2 && item2.enabled !== false) {
21320
21618
  return i;
21321
21619
  }
21322
21620
  }
21323
21621
  for (let i = 0; i <= currentIndex; i++) {
21324
- const item2 = filteredOptions[i];
21622
+ const item2 = optionsList[i];
21325
21623
  if (item2 && item2.enabled !== false) {
21326
21624
  return i;
21327
21625
  }
21328
21626
  }
21329
21627
  return -1;
21330
21628
  },
21331
- [filteredOptions]
21629
+ [filteredOptions, flattenedGroupedOptions]
21332
21630
  );
21333
21631
  const findPreviousEnabledIndex = useCallback(
21334
21632
  (currentIndex) => {
21335
- if (filteredOptions.length === 0) return -1;
21633
+ const optionsList = flattenedGroupedOptions ? flattenedGroupedOptions : filteredOptions;
21634
+ if (optionsList.length === 0) return -1;
21336
21635
  for (let i = currentIndex - 1; i >= 0; i--) {
21337
- const item2 = filteredOptions[i];
21636
+ const item2 = optionsList[i];
21338
21637
  if (item2 && item2.enabled !== false) {
21339
21638
  return i;
21340
21639
  }
21341
21640
  }
21342
- for (let i = filteredOptions.length - 1; i >= currentIndex; i--) {
21343
- const item2 = filteredOptions[i];
21641
+ for (let i = optionsList.length - 1; i >= currentIndex; i--) {
21642
+ const item2 = optionsList[i];
21344
21643
  if (item2 && item2.enabled !== false) {
21345
21644
  return i;
21346
21645
  }
21347
21646
  }
21348
21647
  return -1;
21349
21648
  },
21350
- [filteredOptions]
21649
+ [filteredOptions, flattenedGroupedOptions]
21351
21650
  );
21352
21651
  const handleKeyDown = useCallback(
21353
21652
  (event) => {
21354
21653
  if (!open) return;
21654
+ const optionsList = flattenedGroupedOptions ? flattenedGroupedOptions : filteredOptions;
21355
21655
  switch (event.key) {
21356
21656
  case "ArrowDown":
21357
21657
  event.preventDefault();
@@ -21369,8 +21669,8 @@ const Select = forwardRef(function Select2({
21369
21669
  break;
21370
21670
  case "Enter":
21371
21671
  event.preventDefault();
21372
- if (selectedIndex >= 0 && selectedIndex < filteredOptions.length) {
21373
- const selectedItem = filteredOptions[selectedIndex];
21672
+ if (selectedIndex >= 0 && selectedIndex < optionsList.length) {
21673
+ const selectedItem = optionsList[selectedIndex];
21374
21674
  if (selectedItem && selectedItem.enabled !== false) {
21375
21675
  toggleOption(selectedItem.value);
21376
21676
  if (!multiSelect) {
@@ -21389,6 +21689,7 @@ const Select = forwardRef(function Select2({
21389
21689
  open,
21390
21690
  selectedIndex,
21391
21691
  filteredOptions,
21692
+ flattenedGroupedOptions,
21392
21693
  toggleOption,
21393
21694
  multiSelect,
21394
21695
  findNextEnabledIndex,
@@ -21424,249 +21725,225 @@ const Select = forwardRef(function Select2({
21424
21725
  [emptyListTemplate]
21425
21726
  );
21426
21727
  const onOptionAdd = useCallback((option) => {
21427
- setOptions((prev) => {
21428
- const exists = Array.from(prev).some((opt) => opt.value === option.value);
21429
- if (exists) {
21430
- return prev;
21431
- }
21432
- const newSet = new Set(prev);
21433
- newSet.add(option);
21434
- return newSet;
21435
- });
21728
+ setOptions((prev) => [...prev, option]);
21436
21729
  }, []);
21437
21730
  const onOptionRemove = useCallback((option) => {
21438
- setOptions((prev) => {
21439
- const optionsSet = new Set(prev);
21440
- optionsSet.delete(option);
21441
- return optionsSet;
21442
- });
21731
+ setOptions((prev) => prev.filter((opt) => opt.value !== option.value));
21443
21732
  }, []);
21444
- const optionContextValue = useMemo(
21445
- () => ({
21446
- onOptionAdd,
21447
- onOptionRemove
21448
- }),
21449
- [onOptionAdd, onOptionRemove]
21450
- );
21451
21733
  const selectContextValue = useMemo(
21452
21734
  () => ({
21453
21735
  multiSelect,
21454
21736
  readOnly: readOnly2,
21455
- value,
21737
+ value: currentValue,
21456
21738
  onChange: toggleOption,
21457
21739
  setOpen,
21458
21740
  setSelectedIndex,
21459
- options: options2,
21460
21741
  highlightedValue: selectedIndex >= 0 && selectedIndex < filteredOptions.length && filteredOptions[selectedIndex] ? filteredOptions[selectedIndex].value : void 0,
21461
21742
  optionRenderer
21462
21743
  }),
21463
21744
  [
21464
21745
  multiSelect,
21465
21746
  readOnly2,
21466
- value,
21747
+ currentValue,
21467
21748
  toggleOption,
21468
- options2,
21469
21749
  selectedIndex,
21470
21750
  filteredOptions,
21471
21751
  optionRenderer
21472
21752
  ]
21473
21753
  );
21754
+ const optionContextValue = useMemo(
21755
+ () => ({
21756
+ onOptionAdd,
21757
+ onOptionRemove
21758
+ }),
21759
+ [onOptionAdd, onOptionRemove]
21760
+ );
21761
+ const useSimpleSelect = !searchable && !multiSelect;
21474
21762
  return /* @__PURE__ */ jsx(SelectContext.Provider, { value: selectContextValue, children: /* @__PURE__ */ jsxs(OptionContext.Provider, { value: optionContextValue, children: [
21475
- /* @__PURE__ */ jsx(OptionTypeProvider, { Component: VisibleSelectOption, children: /* @__PURE__ */ jsxs(
21476
- Popover,
21477
- {
21478
- open,
21479
- onOpenChange: (isOpen) => {
21480
- if (!enabled2) return;
21481
- setOpen(isOpen);
21482
- setSelectedIndex(-1);
21483
- },
21484
- modal,
21485
- children: [
21486
- /* @__PURE__ */ jsxs(
21487
- PopoverTrigger,
21488
- {
21489
- ...rest,
21490
- ref: composeRefs(setReferenceElement, forwardedRef),
21491
- id,
21492
- "aria-haspopup": "listbox",
21493
- style: style2,
21494
- onFocus,
21495
- onBlur,
21496
- disabled: !enabled2,
21497
- "aria-expanded": open,
21498
- "data-part-id": PART_LIST_WRAPPER$1,
21499
- className: classnames(className, styles$K.selectTrigger, styles$K[validationStatus], {
21500
- [styles$K.disabled]: !enabled2,
21501
- [styles$K.multi]: multiSelect
21502
- }),
21503
- role: "combobox",
21504
- onClick: (event) => {
21505
- if (!enabled2) return;
21506
- event.stopPropagation();
21507
- setOpen((prev) => !prev);
21508
- },
21509
- onKeyDown: (event) => {
21510
- if (!enabled2 || readOnly2) return;
21511
- if (!open && (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === " " || event.key === "Enter")) {
21512
- event.preventDefault();
21513
- setOpen(true);
21514
- if (filteredOptions.length > 0) {
21515
- const firstEnabledIndex = findNextEnabledIndex(-1);
21516
- setSelectedIndex(firstEnabledIndex !== -1 ? firstEnabledIndex : 0);
21517
- }
21518
- return;
21519
- }
21520
- if (open) {
21521
- handleKeyDown(event);
21522
- }
21523
- },
21524
- autoFocus,
21525
- children: [
21526
- /* @__PURE__ */ jsx(
21527
- SelectTriggerValue,
21528
- {
21529
- value,
21530
- placeholder: placeholder2,
21531
- readOnly: readOnly2,
21532
- multiSelect,
21533
- options: options2,
21534
- valueRenderer,
21535
- toggleOption
21763
+ useSimpleSelect ? (
21764
+ // SimpleSelect mode (Radix UI Select)
21765
+ /* @__PURE__ */ jsx(
21766
+ SimpleSelect,
21767
+ {
21768
+ value: currentValue,
21769
+ onValueChange: (val) => toggleOption(val),
21770
+ id,
21771
+ options: options2,
21772
+ style: style2,
21773
+ className,
21774
+ onFocus,
21775
+ onBlur,
21776
+ enabled: enabled2,
21777
+ validationStatus,
21778
+ triggerRef: setReferenceElement,
21779
+ autoFocus,
21780
+ placeholder: placeholder2,
21781
+ height: dropdownHeight,
21782
+ width,
21783
+ readOnly: readOnly2,
21784
+ emptyListNode,
21785
+ modal,
21786
+ groupBy: groupBy2,
21787
+ groupHeaderRenderer,
21788
+ ungroupedHeaderRenderer,
21789
+ clearable,
21790
+ onClear: clearValue,
21791
+ ...rest,
21792
+ children
21793
+ }
21794
+ )
21795
+ ) : (
21796
+ // Popover mode (searchable or multi-select)
21797
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
21798
+ Popover,
21799
+ {
21800
+ open,
21801
+ onOpenChange: (isOpen) => {
21802
+ if (!enabled2 || readOnly2) return;
21803
+ setOpen(isOpen);
21804
+ },
21805
+ modal,
21806
+ children: [
21807
+ /* @__PURE__ */ jsx(Part, { partId: PART_LIST_WRAPPER$1, children: /* @__PURE__ */ jsxs(
21808
+ PopoverTrigger,
21809
+ {
21810
+ ...rest,
21811
+ ref: composeRefs(setReferenceElement, forwardedRef),
21812
+ id,
21813
+ "aria-haspopup": "listbox",
21814
+ style: style2,
21815
+ onFocus,
21816
+ onBlur,
21817
+ disabled: !enabled2,
21818
+ "aria-expanded": open,
21819
+ className: classnames(className, styles$K.selectTrigger, styles$K[validationStatus], {
21820
+ [styles$K.disabled]: !enabled2,
21821
+ [styles$K.multi]: multiSelect
21822
+ }),
21823
+ role: "combobox",
21824
+ onClick: (event) => {
21825
+ if (!enabled2 || readOnly2) return;
21826
+ event.stopPropagation();
21827
+ setOpen((prev) => !prev);
21828
+ },
21829
+ onKeyDown: (event) => {
21830
+ if (!enabled2 || readOnly2) return;
21831
+ if (!open && (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === " " || event.key === "Enter")) {
21832
+ event.preventDefault();
21833
+ setOpen(true);
21834
+ if (filteredOptions.length > 0) {
21835
+ const firstEnabledIndex = findNextEnabledIndex(-1);
21836
+ setSelectedIndex(firstEnabledIndex !== -1 ? firstEnabledIndex : 0);
21837
+ }
21838
+ return;
21536
21839
  }
21537
- ),
21538
- /* @__PURE__ */ jsx(
21539
- SelectTriggerActions,
21540
- {
21541
- value,
21542
- multiSelect,
21543
- enabled: enabled2,
21544
- readOnly: readOnly2,
21545
- clearable,
21546
- clearValue
21840
+ if (open) {
21841
+ handleKeyDown(event);
21547
21842
  }
21548
- )
21549
- ]
21550
- }
21551
- ),
21552
- open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx(
21553
- PopoverContent,
21554
- {
21555
- style: { minWidth: width, height: dropdownHeight },
21556
- className: classnames(styles$K.selectContent, styles$K[validationStatus]),
21557
- onKeyDown: handleKeyDown,
21558
- children: /* @__PURE__ */ jsxs("div", { className: styles$K.command, children: [
21559
- searchable ? /* @__PURE__ */ jsxs("div", { className: styles$K.commandInputContainer, children: [
21560
- /* @__PURE__ */ jsx(Icon, { name: "search" }),
21843
+ },
21844
+ autoFocus,
21845
+ children: [
21561
21846
  /* @__PURE__ */ jsx(
21562
- "input",
21847
+ SelectTriggerValue,
21563
21848
  {
21564
- role: "searchbox",
21565
- className: classnames(styles$K.commandInput),
21566
- placeholder: "Search...",
21567
- value: searchTerm,
21568
- onChange: (e) => setSearchTerm(e.target.value)
21849
+ readOnly: readOnly2,
21850
+ placeholder: placeholder2,
21851
+ multiSelect,
21852
+ selectedOptions,
21853
+ valueRenderer,
21854
+ toggleOption
21569
21855
  }
21570
- )
21571
- ] }) : /* @__PURE__ */ jsx("button", { "aria-hidden": "true", className: styles$K.srOnly }),
21572
- /* @__PURE__ */ jsx("div", { role: "listbox", className: styles$K.commandList, children: inProgress ? /* @__PURE__ */ jsx("div", { className: styles$K.loading, children: inProgressNotificationMessage }) : searchable && searchTerm ? (
21573
- // When searching, show only filtered options
21574
- filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { children: emptyListNode }) : filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => /* @__PURE__ */ jsx(
21575
- SelectOptionItem,
21856
+ ),
21857
+ /* @__PURE__ */ jsx(
21858
+ SelectTriggerActions,
21576
21859
  {
21860
+ value: currentValue,
21861
+ multiSelect,
21862
+ enabled: enabled2,
21577
21863
  readOnly: readOnly2,
21578
- value: value2,
21579
- label: label2,
21580
- enabled: enabled22,
21581
- keywords,
21582
- isHighlighted: selectedIndex === index,
21583
- itemIndex: index
21584
- },
21585
- value2
21586
- ))
21587
- ) : (
21588
- // When not searching, show all children (includes Options and other components like Button)
21589
- /* @__PURE__ */ jsxs(Fragment, { children: [
21590
- children,
21591
- options2.size === 0 && /* @__PURE__ */ jsx("div", { children: emptyListNode })
21864
+ clearable,
21865
+ clearValue
21866
+ }
21867
+ )
21868
+ ]
21869
+ }
21870
+ ) }),
21871
+ /* @__PURE__ */ jsx(Portal$1, { container: root2, children: /* @__PURE__ */ jsx(
21872
+ PopoverContent,
21873
+ {
21874
+ style: { minWidth: width, height: dropdownHeight },
21875
+ className: classnames(styles$K.selectContent, styles$K[validationStatus]),
21876
+ onKeyDown: handleKeyDown,
21877
+ children: /* @__PURE__ */ jsxs("div", { className: styles$K.command, children: [
21878
+ searchable ? /* @__PURE__ */ jsxs("div", { className: styles$K.commandInputContainer, children: [
21879
+ /* @__PURE__ */ jsx(Icon, { name: "search" }),
21880
+ /* @__PURE__ */ jsx(
21881
+ "input",
21882
+ {
21883
+ role: "searchbox",
21884
+ className: classnames(styles$K.commandInput),
21885
+ placeholder: "Search...",
21886
+ value: searchTerm,
21887
+ onChange: (e) => setSearchTerm(e.target.value)
21888
+ }
21889
+ )
21890
+ ] }) : /* @__PURE__ */ jsx("button", { "aria-hidden": "true", className: styles$K.srOnly }),
21891
+ /* @__PURE__ */ jsxs("div", { role: "listbox", className: styles$K.commandList, children: [
21892
+ inProgress ? /* @__PURE__ */ jsx("div", { className: styles$K.loading, children: inProgressNotificationMessage }) : (
21893
+ // When searching, show filtered options (with or without grouping)
21894
+ groupBy2 && groupedOptions ? (
21895
+ // Render grouped filtered options
21896
+ Object.entries(groupedOptions).map(([groupName, groupOptions]) => /* @__PURE__ */ jsxs("div", { children: [
21897
+ groupName === "Ungrouped" ? ungroupedHeaderRenderer && /* @__PURE__ */ jsx("div", { className: styles$K.groupHeader, children: ungroupedHeaderRenderer() }) : groupHeaderRenderer ? /* @__PURE__ */ jsx("div", { className: styles$K.groupHeader, children: groupHeaderRenderer(groupName) }) : /* @__PURE__ */ jsx("div", { className: styles$K.groupHeader, children: groupName }),
21898
+ groupOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, groupIndex) => {
21899
+ const optionsList = flattenedGroupedOptions || filteredOptions;
21900
+ const globalIndex = optionsList.findIndex(
21901
+ (opt) => opt.value === value2
21902
+ );
21903
+ return /* @__PURE__ */ jsx(
21904
+ SelectOptionItem,
21905
+ {
21906
+ readOnly: readOnly2,
21907
+ value: value2,
21908
+ label: label2,
21909
+ enabled: enabled22,
21910
+ keywords,
21911
+ isHighlighted: selectedIndex === globalIndex,
21912
+ itemIndex: globalIndex
21913
+ },
21914
+ value2
21915
+ );
21916
+ })
21917
+ ] }, groupName))
21918
+ ) : (
21919
+ // Render flat filtered options
21920
+ filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => /* @__PURE__ */ jsx(
21921
+ SelectOptionItem,
21922
+ {
21923
+ readOnly: readOnly2,
21924
+ value: value2,
21925
+ label: label2,
21926
+ enabled: enabled22,
21927
+ keywords,
21928
+ isHighlighted: selectedIndex === index,
21929
+ itemIndex: index
21930
+ },
21931
+ value2
21932
+ ))
21933
+ )
21934
+ ),
21935
+ filteredOptions.length === 0 && emptyListNode
21592
21936
  ] })
21593
- ) })
21594
- ] })
21595
- }
21596
- ) })
21597
- ]
21598
- }
21599
- ) }),
21600
- !open && /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx(OptionTypeProvider, { Component: HiddenOption, children }) })
21937
+ ] })
21938
+ }
21939
+ ) })
21940
+ ]
21941
+ }
21942
+ ) })
21943
+ ),
21944
+ /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx(OptionTypeProvider, { Component: HiddenOption, children }) })
21601
21945
  ] }) });
21602
21946
  });
21603
- function VisibleSelectOption(option) {
21604
- const { value, label: label2, enabled: enabled2 = true, children } = option;
21605
- const { onOptionAdd } = useOption();
21606
- const {
21607
- value: selectedValue,
21608
- onChange,
21609
- multiSelect,
21610
- readOnly: readOnly2,
21611
- setOpen,
21612
- highlightedValue,
21613
- optionRenderer
21614
- } = useSelect();
21615
- const optionRef = useRef(null);
21616
- const opt = useMemo(() => {
21617
- return {
21618
- ...option,
21619
- label: label2 ?? "",
21620
- keywords: option.keywords || [label2 ?? ""]
21621
- };
21622
- }, [option, label2]);
21623
- useEffect(() => {
21624
- onOptionAdd(opt);
21625
- }, [opt, onOptionAdd]);
21626
- const selected2 = useMemo(() => {
21627
- return Array.isArray(selectedValue) && multiSelect ? selectedValue.map((v) => String(v)).includes(value) : String(selectedValue) === String(value);
21628
- }, [selectedValue, value, multiSelect]);
21629
- const isHighlighted = useMemo(() => {
21630
- return highlightedValue !== void 0 && String(highlightedValue) === String(value);
21631
- }, [highlightedValue, value]);
21632
- useEffect(() => {
21633
- if (isHighlighted && optionRef.current) {
21634
- optionRef.current.scrollIntoView({ block: "nearest", behavior: "smooth" });
21635
- }
21636
- }, [isHighlighted]);
21637
- const handleClick = () => {
21638
- if (readOnly2) {
21639
- setOpen(false);
21640
- return;
21641
- }
21642
- if (enabled2) {
21643
- onChange(value);
21644
- }
21645
- };
21646
- return /* @__PURE__ */ jsx(
21647
- "div",
21648
- {
21649
- ref: optionRef,
21650
- role: "option",
21651
- "aria-disabled": !enabled2,
21652
- "aria-selected": selected2,
21653
- className: classnames(styles$K.multiSelectOption, {
21654
- [styles$K.disabledOption]: !enabled2,
21655
- [styles$K.highlighted]: isHighlighted
21656
- }),
21657
- onMouseDown: (e) => {
21658
- e.preventDefault();
21659
- e.stopPropagation();
21660
- },
21661
- onClick: handleClick,
21662
- "data-state": selected2 ? "checked" : void 0,
21663
- children: /* @__PURE__ */ jsx("div", { className: styles$K.multiSelectOptionContent, children: optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2 }, selectedValue, false) : /* @__PURE__ */ jsxs(Fragment, { children: [
21664
- children || label2,
21665
- selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
21666
- ] }) })
21667
- }
21668
- );
21669
- }
21670
21947
  function SelectOptionItem(option) {
21671
21948
  const {
21672
21949
  value,
@@ -21732,19 +22009,19 @@ function SelectOptionItem(option) {
21732
22009
  }
21733
22010
  );
21734
22011
  }
21735
- const themeVars$q = `'{"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)"}'`;
21736
- const radioGroupContainer = "_radioGroupContainer_drdje_14";
21737
- const radioOptionContainer = "_radioOptionContainer_drdje_20";
21738
- const radioOption = "_radioOption_drdje_20";
21739
- const checked = "_checked_drdje_54";
21740
- const error$8 = "_error_drdje_54";
21741
- const warning$9 = "_warning_drdje_54";
21742
- const valid$8 = "_valid_drdje_54";
21743
- const indicator$3 = "_indicator_drdje_69";
21744
- const disabled$6 = "_disabled_drdje_77";
21745
- const itemContainer$1 = "_itemContainer_drdje_80";
21746
- const optionLabel = "_optionLabel_drdje_87";
21747
- const label = "_label_drdje_91";
22012
+ const themeVars$q = `'{"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:textColor-RadioGroupOption--disabled": "var(--xmlui-textColor-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)"}'`;
22013
+ const radioGroupContainer = "_radioGroupContainer_1iwha_14";
22014
+ const radioOptionContainer = "_radioOptionContainer_1iwha_20";
22015
+ const radioOption = "_radioOption_1iwha_20";
22016
+ const checked = "_checked_1iwha_54";
22017
+ const error$8 = "_error_1iwha_54";
22018
+ const warning$9 = "_warning_1iwha_54";
22019
+ const valid$8 = "_valid_1iwha_54";
22020
+ const indicator$3 = "_indicator_1iwha_69";
22021
+ const disabled$6 = "_disabled_1iwha_77";
22022
+ const itemContainer$1 = "_itemContainer_1iwha_80";
22023
+ const optionLabel = "_optionLabel_1iwha_87";
22024
+ const label = "_label_1iwha_91";
21748
22025
  const styles$J = {
21749
22026
  themeVars: themeVars$q,
21750
22027
  radioGroupContainer,
@@ -21867,7 +22144,9 @@ const RadioGroup = forwardRef(function RadioGroup2({
21867
22144
  }, [autofocus]);
21868
22145
  useCallback(() => {
21869
22146
  if (radioGroupRef.current) {
21870
- const selectedRadio = radioGroupRef.current.querySelector('[role="radio"][aria-checked="true"]');
22147
+ const selectedRadio = radioGroupRef.current.querySelector(
22148
+ '[role="radio"][aria-checked="true"]'
22149
+ );
21871
22150
  if (selectedRadio) {
21872
22151
  selectedRadio.focus();
21873
22152
  return;
@@ -21963,8 +22242,20 @@ const RadioGroupOption = ({
21963
22242
  }),
21964
22243
  [enabled2, radioGroupContext, value]
21965
22244
  );
21966
- const item2 = useMemo(
21967
- () => /* @__PURE__ */ jsxs(Fragment, { children: [
22245
+ const item2 = useMemo(() => {
22246
+ if (optionRenderer) {
22247
+ return /* @__PURE__ */ jsx(
22248
+ UnwrappedRadioItem,
22249
+ {
22250
+ id,
22251
+ value,
22252
+ checked: value === radioGroupContext.value,
22253
+ disabled: !enabled2,
22254
+ statusStyles
22255
+ }
22256
+ );
22257
+ }
22258
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21968
22259
  /* @__PURE__ */ jsx(
21969
22260
  UnwrappedRadioItem,
21970
22261
  {
@@ -21976,16 +22267,15 @@ const RadioGroupOption = ({
21976
22267
  }
21977
22268
  ),
21978
22269
  /* @__PURE__ */ jsx("label", { htmlFor: id, className: classnames(styles$J.label, statusStyles), children: label2 ?? value })
21979
- ] }),
21980
- [enabled2, id, label2, statusStyles, value, radioGroupContext]
21981
- );
22270
+ ] });
22271
+ }, [enabled2, id, label2, optionRenderer, statusStyles, value, radioGroupContext]);
21982
22272
  return /* @__PURE__ */ jsx(
21983
22273
  "div",
21984
22274
  {
21985
22275
  className: classnames(styles$J.radioOptionContainer, className),
21986
22276
  style: style2,
21987
22277
  "data-radio-item": true,
21988
- children: !!optionRenderer ? /* @__PURE__ */ jsxs("label", { className: styles$J.optionLabel, children: [
22278
+ children: !!optionRenderer ? /* @__PURE__ */ jsxs("label", { htmlFor: id, className: styles$J.optionLabel, children: [
21989
22279
  /* @__PURE__ */ jsx("div", { className: styles$J.itemContainer, children: item2 }),
21990
22280
  optionRenderer({
21991
22281
  $checked: value === radioGroupContext.value,
@@ -23146,24 +23436,24 @@ const FormWithContextVar = forwardRef(function({
23146
23436
  });
23147
23437
  FormWithContextVar.displayName = "FormWithContextVar";
23148
23438
  const themeVars$n = `'{"border-AutoComplete": "var(--xmlui-border-AutoComplete)", "borderHorizontal-AutoComplete": "var(--xmlui-borderHorizontal-AutoComplete, var(--xmlui-border-AutoComplete))", "borderVertical-AutoComplete": "var(--xmlui-borderVertical-AutoComplete, var(--xmlui-border-AutoComplete))", "borderLeft-AutoComplete": "var(--xmlui-borderLeft-AutoComplete, var(--xmlui-borderHorizontal-AutoComplete, var(--xmlui-border-AutoComplete)))", "borderRight-AutoComplete": "var(--xmlui-borderRight-AutoComplete, var(--xmlui-borderHorizontal-AutoComplete, var(--xmlui-border-AutoComplete)))", "borderTop-AutoComplete": "var(--xmlui-borderTop-AutoComplete, var(--xmlui-borderVertical-AutoComplete, var(--xmlui-border-AutoComplete)))", "borderBottom-AutoComplete": "var(--xmlui-borderBottom-AutoComplete, var(--xmlui-borderVertical-AutoComplete, var(--xmlui-border-AutoComplete)))", "borderWidth-AutoComplete": "var(--xmlui-borderWidth-AutoComplete)", "borderHorizontalWidth-AutoComplete": "var(--xmlui-borderHorizontalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete))", "borderLeftWidth-AutoComplete": "var(--xmlui-borderLeftWidth-AutoComplete, var(--xmlui-borderHorizontalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete)))", "borderRightWidth-AutoComplete": "var(--xmlui-borderRightWidth-AutoComplete, var(--xmlui-borderHorizontalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete)))", "borderVerticalWidth-AutoComplete": "var(--xmlui-borderVerticalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete))", "borderTopWidth-AutoComplete": "var(--xmlui-borderTopWidth-AutoComplete, var(--xmlui-borderVerticalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete)))", "borderBottomWidth-AutoComplete": "var(--xmlui-borderBottomWidth-AutoComplete, var(--xmlui-borderVerticalWidth-AutoComplete, var(--xmlui-borderWidth-AutoComplete)))", "borderStyle-AutoComplete": "var(--xmlui-borderStyle-AutoComplete)", "borderHorizontalStyle-AutoComplete": "var(--xmlui-borderHorizontalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete))", "borderLeftStyle-AutoComplete": "var(--xmlui-borderLeftStyle-AutoComplete, var(--xmlui-borderHorizontalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete)))", "borderRightStyle-AutoComplete": "var(--xmlui-borderRightStyle-AutoComplete, var(--xmlui-borderHorizontalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete)))", "borderVerticalStyle-AutoComplete": "var(--xmlui-borderVerticalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete))", "borderTopStyle-AutoComplete": "var(--xmlui-borderTopStyle-AutoComplete, var(--xmlui-borderVerticalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete)))", "borderBottomStyle-AutoComplete": "var(--xmlui-borderBottomStyle-AutoComplete, var(--xmlui-borderVerticalStyle-AutoComplete, var(--xmlui-borderStyle-AutoComplete)))", "borderColor-AutoComplete": "var(--xmlui-borderColor-AutoComplete)", "borderHorizontalColor-AutoComplete": "var(--xmlui-borderHorizontalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete))", "borderLeftColor-AutoComplete": "var(--xmlui-borderLeftColor-AutoComplete, var(--xmlui-borderHorizontalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete)))", "borderRightColor-AutoComplete": "var(--xmlui-borderRightColor-AutoComplete, var(--xmlui-borderHorizontalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete)))", "borderVerticalColor-AutoComplete": "var(--xmlui-borderVerticalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete))", "borderTopColor-AutoComplete": "var(--xmlui-borderTopColor-AutoComplete, var(--xmlui-borderVerticalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete)))", "borderBottomColor-AutoComplete": "var(--xmlui-borderBottomColor-AutoComplete, var(--xmlui-borderVerticalColor-AutoComplete, var(--xmlui-borderColor-AutoComplete)))", "borderStartStartRadius-AutoComplete": "var(--xmlui-borderStartStartRadius-AutoComplete, var(--xmlui-borderRadius-AutoComplete))", "borderStartEndRadius-AutoComplete": "var(--xmlui-borderStartEndRadius-AutoComplete, var(--xmlui-borderRadius-AutoComplete))", "borderEndStartRadius-AutoComplete": "var(--xmlui-borderEndStartRadius-AutoComplete, var(--xmlui-borderRadius-AutoComplete))", "borderEndEndRadius-AutoComplete": "var(--xmlui-borderEndEndRadius-AutoComplete, var(--xmlui-borderRadius-AutoComplete))", "padding-AutoComplete": "var(--xmlui-padding-AutoComplete)", "paddingHorizontal-AutoComplete": "var(--xmlui-paddingHorizontal-AutoComplete, var(--xmlui-padding-AutoComplete))", "paddingVertical-AutoComplete": "var(--xmlui-paddingVertical-AutoComplete, var(--xmlui-padding-AutoComplete))", "paddingLeft-AutoComplete": "var(--xmlui-paddingLeft-AutoComplete, var(--xmlui-paddingHorizontal-AutoComplete, var(--xmlui-padding-AutoComplete)))", "paddingRight-AutoComplete": "var(--xmlui-paddingRight-AutoComplete, var(--xmlui-paddingHorizontal-AutoComplete, var(--xmlui-padding-AutoComplete)))", "paddingTop-AutoComplete": "var(--xmlui-paddingTop-AutoComplete, var(--xmlui-paddingVertical-AutoComplete, var(--xmlui-padding-AutoComplete)))", "paddingBottom-AutoComplete": "var(--xmlui-paddingBottom-AutoComplete, var(--xmlui-paddingVertical-AutoComplete, var(--xmlui-padding-AutoComplete)))", "padding-item-AutoComplete": "var(--xmlui-padding-item-AutoComplete)", "paddingHorizontal-item-AutoComplete": "var(--xmlui-paddingHorizontal-item-AutoComplete, var(--xmlui-padding-item-AutoComplete))", "paddingVertical-item-AutoComplete": "var(--xmlui-paddingVertical-item-AutoComplete, var(--xmlui-padding-item-AutoComplete))", "paddingLeft-item-AutoComplete": "var(--xmlui-paddingLeft-item-AutoComplete, var(--xmlui-paddingHorizontal-item-AutoComplete, var(--xmlui-padding-item-AutoComplete)))", "paddingRight-item-AutoComplete": "var(--xmlui-paddingRight-item-AutoComplete, var(--xmlui-paddingHorizontal-item-AutoComplete, var(--xmlui-padding-item-AutoComplete)))", "paddingTop-item-AutoComplete": "var(--xmlui-paddingTop-item-AutoComplete, var(--xmlui-paddingVertical-item-AutoComplete, var(--xmlui-padding-item-AutoComplete)))", "paddingBottom-item-AutoComplete": "var(--xmlui-paddingBottom-item-AutoComplete, var(--xmlui-paddingVertical-item-AutoComplete, var(--xmlui-padding-item-AutoComplete)))", "Input:borderRadius-AutoComplete--default": "var(--xmlui-borderRadius-AutoComplete--default)", "Input:borderColor-AutoComplete--default": "var(--xmlui-borderColor-AutoComplete--default)", "Input:borderWidth-AutoComplete--default": "var(--xmlui-borderWidth-AutoComplete--default)", "Input:borderStyle-AutoComplete--default": "var(--xmlui-borderStyle-AutoComplete--default)", "Input:fontSize-AutoComplete--default": "var(--xmlui-fontSize-AutoComplete--default)", "Input:backgroundColor-AutoComplete--default": "var(--xmlui-backgroundColor-AutoComplete--default)", "Input:boxShadow-AutoComplete--default": "var(--xmlui-boxShadow-AutoComplete--default)", "Input:textColor-AutoComplete--default": "var(--xmlui-textColor-AutoComplete--default)", "Input:borderColor-AutoComplete--default--hover": "var(--xmlui-borderColor-AutoComplete--default--hover)", "Input:backgroundColor-AutoComplete--default--hover": "var(--xmlui-backgroundColor-AutoComplete--default--hover)", "Input:boxShadow-AutoComplete--default--hover": "var(--xmlui-boxShadow-AutoComplete--default--hover)", "Input:textColor-AutoComplete--default--hover": "var(--xmlui-textColor-AutoComplete--default--hover)", "Input:textColor-placeholder-AutoComplete--default": "var(--xmlui-textColor-placeholder-AutoComplete--default)", "Input:fontSize-placeholder-AutoComplete--default": "var(--xmlui-fontSize-placeholder-AutoComplete--default)", "Input:borderRadius-AutoComplete--error": "var(--xmlui-borderRadius-AutoComplete--error)", "Input:borderColor-AutoComplete--error": "var(--xmlui-borderColor-AutoComplete--error)", "Input:borderWidth-AutoComplete--error": "var(--xmlui-borderWidth-AutoComplete--error)", "Input:borderStyle-AutoComplete--error": "var(--xmlui-borderStyle-AutoComplete--error)", "Input:fontSize-AutoComplete--error": "var(--xmlui-fontSize-AutoComplete--error)", "Input:backgroundColor-AutoComplete--error": "var(--xmlui-backgroundColor-AutoComplete--error)", "Input:boxShadow-AutoComplete--error": "var(--xmlui-boxShadow-AutoComplete--error)", "Input:textColor-AutoComplete--error": "var(--xmlui-textColor-AutoComplete--error)", "Input:borderColor-AutoComplete--error--hover": "var(--xmlui-borderColor-AutoComplete--error--hover)", "Input:backgroundColor-AutoComplete--error--hover": "var(--xmlui-backgroundColor-AutoComplete--error--hover)", "Input:boxShadow-AutoComplete--error--hover": "var(--xmlui-boxShadow-AutoComplete--error--hover)", "Input:textColor-AutoComplete--error--hover": "var(--xmlui-textColor-AutoComplete--error--hover)", "Input:textColor-placeholder-AutoComplete--error": "var(--xmlui-textColor-placeholder-AutoComplete--error)", "Input:fontSize-placeholder-AutoComplete--error": "var(--xmlui-fontSize-placeholder-AutoComplete--error)", "Input:borderRadius-AutoComplete--warning": "var(--xmlui-borderRadius-AutoComplete--warning)", "Input:borderColor-AutoComplete--warning": "var(--xmlui-borderColor-AutoComplete--warning)", "Input:borderWidth-AutoComplete--warning": "var(--xmlui-borderWidth-AutoComplete--warning)", "Input:borderStyle-AutoComplete--warning": "var(--xmlui-borderStyle-AutoComplete--warning)", "Input:fontSize-AutoComplete--warning": "var(--xmlui-fontSize-AutoComplete--warning)", "Input:backgroundColor-AutoComplete--warning": "var(--xmlui-backgroundColor-AutoComplete--warning)", "Input:boxShadow-AutoComplete--warning": "var(--xmlui-boxShadow-AutoComplete--warning)", "Input:textColor-AutoComplete--warning": "var(--xmlui-textColor-AutoComplete--warning)", "Input:borderColor-AutoComplete--warning--hover": "var(--xmlui-borderColor-AutoComplete--warning--hover)", "Input:backgroundColor-AutoComplete--warning--hover": "var(--xmlui-backgroundColor-AutoComplete--warning--hover)", "Input:boxShadow-AutoComplete--warning--hover": "var(--xmlui-boxShadow-AutoComplete--warning--hover)", "Input:textColor-AutoComplete--warning--hover": "var(--xmlui-textColor-AutoComplete--warning--hover)", "Input:textColor-placeholder-AutoComplete--warning": "var(--xmlui-textColor-placeholder-AutoComplete--warning)", "Input:fontSize-placeholder-AutoComplete--warning": "var(--xmlui-fontSize-placeholder-AutoComplete--warning)", "Input:borderRadius-AutoComplete--success": "var(--xmlui-borderRadius-AutoComplete--success)", "Input:borderColor-AutoComplete--success": "var(--xmlui-borderColor-AutoComplete--success)", "Input:borderWidth-AutoComplete--success": "var(--xmlui-borderWidth-AutoComplete--success)", "Input:borderStyle-AutoComplete--success": "var(--xmlui-borderStyle-AutoComplete--success)", "Input:fontSize-AutoComplete--success": "var(--xmlui-fontSize-AutoComplete--success)", "Input:backgroundColor-AutoComplete--success": "var(--xmlui-backgroundColor-AutoComplete--success)", "Input:boxShadow-AutoComplete--success": "var(--xmlui-boxShadow-AutoComplete--success)", "Input:textColor-AutoComplete--success": "var(--xmlui-textColor-AutoComplete--success)", "Input:borderColor-AutoComplete--success--hover": "var(--xmlui-borderColor-AutoComplete--success--hover)", "Input:backgroundColor-AutoComplete--success--hover": "var(--xmlui-backgroundColor-AutoComplete--success--hover)", "Input:boxShadow-AutoComplete--success--hover": "var(--xmlui-boxShadow-AutoComplete--success--hover)", "Input:textColor-AutoComplete--success--hover": "var(--xmlui-textColor-AutoComplete--success--hover)", "Input:textColor-placeholder-AutoComplete--success": "var(--xmlui-textColor-placeholder-AutoComplete--success)", "Input:fontSize-placeholder-AutoComplete--success": "var(--xmlui-fontSize-placeholder-AutoComplete--success)", "Input:gap-adornment-AutoComplete": "var(--xmlui-gap-adornment-AutoComplete)", "Input:backgroundColor-AutoComplete--disabled": "var(--xmlui-backgroundColor-AutoComplete--disabled)", "Input:textColor-AutoComplete--disabled": "var(--xmlui-textColor-AutoComplete--disabled)", "Input:borderColor-AutoComplete--disabled": "var(--xmlui-borderColor-AutoComplete--disabled)", "Input:outlineWidth-AutoComplete--focus": "var(--xmlui-outlineWidth-AutoComplete--focus)", "Input:outlineColor-AutoComplete--focus": "var(--xmlui-outlineColor-AutoComplete--focus)", "Input:outlineStyle-AutoComplete--focus": "var(--xmlui-outlineStyle-AutoComplete--focus)", "Input:outlineOffset-AutoComplete--focus": "var(--xmlui-outlineOffset-AutoComplete--focus)", "paddingVertical-AutoComplete-badge": "var(--xmlui-paddingVertical-AutoComplete-badge)", "paddingHorizontal-AutoComplete-badge": "var(--xmlui-paddingHorizontal-AutoComplete-badge)", "borderRadius-AutoComplete-badge": "var(--xmlui-borderRadius-AutoComplete-badge)", "Input:fontSize-AutoComplete-badge": "var(--xmlui-fontSize-AutoComplete-badge)", "Input:backgroundColor-AutoComplete-badge": "var(--xmlui-backgroundColor-AutoComplete-badge)", "Input:textColor-AutoComplete-badge": "var(--xmlui-textColor-AutoComplete-badge)", "Input:backgroundColor-AutoComplete-badge--hover": "var(--xmlui-backgroundColor-AutoComplete-badge--hover)", "Input:textColor-AutoComplete-badge--hover": "var(--xmlui-textColor-AutoComplete-badge--hover)", "Input:backgroundColor-AutoComplete-badge--active": "var(--xmlui-backgroundColor-AutoComplete-badge--active)", "Input:textColor-AutoComplete-badge--active": "var(--xmlui-textColor-AutoComplete-badge--active)", "Input:textColor-placeholder-AutoComplete": "var(--xmlui-textColor-placeholder-AutoComplete)", "Input:borderRadius-menu-AutoComplete": "var(--xmlui-borderRadius-menu-AutoComplete)", "Input:borderWidth-menu-AutoComplete": "var(--xmlui-borderWidth-menu-AutoComplete)", "Input:borderColor-menu-AutoComplete": "var(--xmlui-borderColor-menu-AutoComplete)", "Input:backgroundColor-menu-AutoComplete": "var(--xmlui-backgroundColor-menu-AutoComplete)", "Input:boxShadow-menu-AutoComplete": "var(--xmlui-boxShadow-menu-AutoComplete)", "backgroundColor-item-AutoComplete": "var(--xmlui-backgroundColor-item-AutoComplete)", "backgroundColor-item-AutoComplete--active": "var(--xmlui-backgroundColor-item-AutoComplete--active)", "backgroundColor-item-AutoComplete--hover": "var(--xmlui-backgroundColor-item-AutoComplete--hover)", "textColor-item-AutoComplete--disabled": "var(--xmlui-textColor-item-AutoComplete--disabled)"}'`;
23149
- const command = "_command_qbjl0_14";
23150
- const badgeListWrapper = "_badgeListWrapper_qbjl0_20";
23151
- const error$5 = "_error_qbjl0_51";
23152
- const warning$6 = "_warning_qbjl0_71";
23153
- const valid$5 = "_valid_qbjl0_91";
23154
- const disabled$4 = "_disabled_qbjl0_111";
23155
- const focused = "_focused_qbjl0_118";
23156
- const badgeList = "_badgeList_qbjl0_20";
23157
- const inputWrapper = "_inputWrapper_qbjl0_131";
23158
- const badge = "_badge_qbjl0_20";
23159
- const commandInput = "_commandInput_qbjl0_163";
23160
- const actions = "_actions_qbjl0_178";
23161
- const action = "_action_qbjl0_178";
23162
- const autoCompleteEmpty = "_autoCompleteEmpty_qbjl0_186";
23163
- const commandList = "_commandList_qbjl0_195";
23164
- const autoCompleteOption = "_autoCompleteOption_qbjl0_207";
23165
- const highlighted = "_highlighted_qbjl0_224";
23166
- const disabledOption = "_disabledOption_qbjl0_227";
23439
+ const command = "_command_57zg7_14";
23440
+ const badgeListWrapper = "_badgeListWrapper_57zg7_20";
23441
+ const error$5 = "_error_57zg7_51";
23442
+ const warning$6 = "_warning_57zg7_71";
23443
+ const valid$5 = "_valid_57zg7_91";
23444
+ const disabled$4 = "_disabled_57zg7_111";
23445
+ const focused = "_focused_57zg7_117";
23446
+ const badgeList = "_badgeList_57zg7_20";
23447
+ const inputWrapper = "_inputWrapper_57zg7_130";
23448
+ const badge = "_badge_57zg7_20";
23449
+ const commandInput = "_commandInput_57zg7_162";
23450
+ const actions = "_actions_57zg7_176";
23451
+ const action = "_action_57zg7_176";
23452
+ const autoCompleteEmpty = "_autoCompleteEmpty_57zg7_187";
23453
+ const commandList = "_commandList_57zg7_196";
23454
+ const autoCompleteOption = "_autoCompleteOption_57zg7_208";
23455
+ const highlighted = "_highlighted_57zg7_225";
23456
+ const disabledOption = "_disabledOption_57zg7_228";
23167
23457
  const styles$F = {
23168
23458
  themeVars: themeVars$n,
23169
23459
  command,
@@ -23181,7 +23471,7 @@ const styles$F = {
23181
23471
  action,
23182
23472
  autoCompleteEmpty,
23183
23473
  commandList,
23184
- "fade-in": "_fade-in_qbjl0_1",
23474
+ "fade-in": "_fade-in_57zg7_1",
23185
23475
  autoCompleteOption,
23186
23476
  highlighted,
23187
23477
  disabledOption
@@ -23192,7 +23482,7 @@ const AutoCompleteContext = createContext({
23192
23482
  },
23193
23483
  inputValue: "",
23194
23484
  searchTerm: "",
23195
- options: /* @__PURE__ */ new Set(),
23485
+ options: [],
23196
23486
  open: false,
23197
23487
  setOpen: (open) => {
23198
23488
  },
@@ -23207,7 +23497,7 @@ function useAutoComplete() {
23207
23497
  const PART_LIST_WRAPPER = "listWrapper";
23208
23498
  function isOptionsExist(options2, newOptions) {
23209
23499
  return newOptions.some(
23210
- (option) => Array.from(options2).some((o) => o.value === option.value || o.label === option.label)
23500
+ (option) => options2.some((o) => o.value === option.value || o.label === option.label)
23211
23501
  );
23212
23502
  }
23213
23503
  const defaultProps$A = {
@@ -23256,7 +23546,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23256
23546
  const [referenceElement, setReferenceElement] = useState(null);
23257
23547
  const inputRef = useRef(null);
23258
23548
  const [open, setOpen] = useState(initiallyOpen);
23259
- const [options2, setOptions] = useState(/* @__PURE__ */ new Set());
23549
+ const [options2, setOptions] = useState([]);
23260
23550
  const [inputValue, setInputValue] = useState("");
23261
23551
  const { root: root2 } = useTheme();
23262
23552
  const [width, setWidth] = useState(0);
@@ -23266,17 +23556,17 @@ const AutoComplete = forwardRef(function AutoComplete2({
23266
23556
  const [selectedIndex, setSelectedIndex] = useState(-1);
23267
23557
  const filteredOptions = useMemo(() => {
23268
23558
  if (!searchTerm || searchTerm.trim() === "") {
23269
- return Array.from(options2);
23559
+ return options2;
23270
23560
  }
23271
23561
  const searchLower = searchTerm.toLowerCase();
23272
- return Array.from(options2).filter((option) => {
23562
+ return options2.filter((option) => {
23273
23563
  const extendedValue = option.value + " " + option.label + " " + (option.keywords || []).join(" ");
23274
23564
  return extendedValue.toLowerCase().includes(searchLower);
23275
23565
  });
23276
23566
  }, [options2, searchTerm]);
23277
23567
  const shouldShowCreatable = useMemo(() => {
23278
23568
  if (!creatable || !searchTerm || searchTerm.trim() === "") return false;
23279
- const searchTermExists = Array.from(options2).some(
23569
+ const searchTermExists = options2.some(
23280
23570
  (option) => option.value === searchTerm || option.label === searchTerm
23281
23571
  );
23282
23572
  if (searchTermExists) return false;
@@ -23301,17 +23591,16 @@ const AutoComplete = forwardRef(function AutoComplete2({
23301
23591
  };
23302
23592
  }, [referenceElement]);
23303
23593
  const selectedValue = useMemo(() => {
23304
- const optionsArray = Array.from(options2);
23305
23594
  if (Array.isArray(value)) {
23306
23595
  if (value.length === 0) return [];
23307
- return optionsArray.filter((o) => value.includes(`${o.value}`));
23596
+ return options2.filter((o) => value.includes(`${o.value}`));
23308
23597
  }
23309
- return optionsArray.find((o) => `${o.value}` === `${value}`);
23598
+ return options2.find((o) => `${o.value}` === `${value}`);
23310
23599
  }, [value, options2]);
23311
23600
  const toggleOption = useCallback(
23312
23601
  (selectedItem) => {
23313
23602
  if (selectedItem === "") return;
23314
- const option = Array.from(options2).find((opt) => opt.value === selectedItem);
23603
+ const option = options2.find((opt) => opt.value === selectedItem);
23315
23604
  if (option && option.enabled === false) return;
23316
23605
  const newSelectedValue = multi ? Array.isArray(value) ? value.includes(selectedItem) ? value.filter((v) => v !== selectedItem) : [...value, selectedItem] : [selectedItem] : selectedItem === value ? null : selectedItem;
23317
23606
  updateState({ value: newSelectedValue });
@@ -23332,7 +23621,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23332
23621
  setInputValue(selectedValue?.label || "");
23333
23622
  setSearchTerm("");
23334
23623
  }
23335
- }, [multi, selectedValue]);
23624
+ }, [selectedValue]);
23336
23625
  const clearValue = useCallback(() => {
23337
23626
  const newValue = multi ? [] : "";
23338
23627
  setInputValue("");
@@ -23340,22 +23629,10 @@ const AutoComplete = forwardRef(function AutoComplete2({
23340
23629
  onDidChange(newValue);
23341
23630
  }, [multi, updateState, onDidChange]);
23342
23631
  const onOptionAdd = useCallback((option) => {
23343
- setOptions((prev) => {
23344
- const newSet = new Set(prev);
23345
- const existing = Array.from(prev).find((opt) => opt.value === option.value);
23346
- if (existing) {
23347
- newSet.delete(existing);
23348
- }
23349
- newSet.add(option);
23350
- return newSet;
23351
- });
23632
+ setOptions((prev) => [...prev, option]);
23352
23633
  }, []);
23353
23634
  const onOptionRemove = useCallback((option) => {
23354
- setOptions((prev) => {
23355
- const optionsSet = new Set(prev);
23356
- optionsSet.delete(option);
23357
- return optionsSet;
23358
- });
23635
+ setOptions((prev) => prev.filter((opt) => opt.value !== option.value));
23359
23636
  }, []);
23360
23637
  const allItems = useMemo(() => {
23361
23638
  const items = [];
@@ -23540,7 +23817,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23540
23817
  {
23541
23818
  open,
23542
23819
  onOpenChange: (isOpen) => {
23543
- if (readOnly2) return;
23820
+ if (readOnly2 || !enabled2) return;
23544
23821
  setOpen(isOpen);
23545
23822
  if (!isOpen) {
23546
23823
  setSelectedIndex(-1);
@@ -23564,7 +23841,7 @@ const AutoComplete = forwardRef(function AutoComplete2({
23564
23841
  ),
23565
23842
  "aria-expanded": open,
23566
23843
  onClick: (event) => {
23567
- if (readOnly2) return;
23844
+ if (readOnly2 || !enabled2) return;
23568
23845
  if (multi && open) {
23569
23846
  return;
23570
23847
  }
@@ -23652,9 +23929,10 @@ const AutoComplete = forwardRef(function AutoComplete2({
23652
23929
  /* @__PURE__ */ jsx(
23653
23930
  "span",
23654
23931
  {
23655
- className: styles$F.action,
23932
+ className: classnames(styles$F.action, { [styles$F.disabled]: !enabled2 || readOnly2 }),
23933
+ "aria-disabled": !enabled2 || readOnly2,
23656
23934
  onClick: () => {
23657
- if (readOnly2) return;
23935
+ if (readOnly2 || !enabled2) return;
23658
23936
  setOpen(!open);
23659
23937
  inputRef.current?.focus();
23660
23938
  },
@@ -23666,62 +23944,45 @@ const AutoComplete = forwardRef(function AutoComplete2({
23666
23944
  ]
23667
23945
  }
23668
23946
  ) }) }),
23669
- open && /* @__PURE__ */ jsx(Portal, { container: root2, children: /* @__PURE__ */ jsx(
23947
+ /* @__PURE__ */ jsx(Portal$1, { container: root2, children: /* @__PURE__ */ jsx(
23670
23948
  PopoverContent,
23671
23949
  {
23672
23950
  style: { width, height: dropdownHeight },
23673
23951
  className: styles$F.popoverContent,
23674
23952
  align: "start",
23675
23953
  onOpenAutoFocus: (e) => e.preventDefault(),
23676
- children: /* @__PURE__ */ jsx(
23677
- "div",
23678
- {
23679
- role: "listbox",
23680
- className: styles$F.commandList,
23681
- style: { height: dropdownHeight },
23682
- children: searchTerm ? (
23683
- // When searching, show only filtered options
23684
- /* @__PURE__ */ jsxs(Fragment, { children: [
23685
- filteredOptions.length === 0 && !shouldShowCreatable && /* @__PURE__ */ jsx("div", { children: emptyListNode }),
23686
- shouldShowCreatable && /* @__PURE__ */ jsx(
23687
- CreatableItem,
23688
- {
23689
- onNewItem: onItemCreated,
23690
- isHighlighted: selectedIndex === 0
23691
- }
23692
- ),
23693
- /* @__PURE__ */ jsx("div", { children: filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => {
23694
- const itemIndex = shouldShowCreatable ? index + 1 : index;
23695
- return /* @__PURE__ */ jsx(
23696
- AutoCompleteOption,
23697
- {
23698
- value: value2,
23699
- label: label2,
23700
- enabled: enabled22,
23701
- keywords,
23702
- readOnly: readOnly2,
23703
- isHighlighted: selectedIndex === itemIndex,
23704
- itemIndex
23705
- },
23706
- value2
23707
- );
23708
- }) })
23709
- ] })
23710
- ) : (
23711
- // When not searching, show all children directly (includes Options and other components like Button)
23712
- /* @__PURE__ */ jsx(OptionTypeProvider, { Component: VisibleAutoCompleteOption, children: /* @__PURE__ */ jsxs(Fragment, { children: [
23713
- children,
23714
- options2.size === 0 && /* @__PURE__ */ jsx("div", { children: emptyListNode })
23715
- ] }) })
23716
- )
23717
- }
23718
- )
23954
+ children: /* @__PURE__ */ jsx("div", { role: "listbox", className: styles$F.commandList, style: { height: dropdownHeight }, children: searchTerm ? /* @__PURE__ */ jsxs(Fragment, { children: [
23955
+ filteredOptions.map(({ value: value2, label: label2, enabled: enabled22, keywords }, index) => {
23956
+ const itemIndex = shouldShowCreatable ? index + 1 : index;
23957
+ return /* @__PURE__ */ jsx(
23958
+ AutoCompleteOption,
23959
+ {
23960
+ value: value2,
23961
+ label: label2,
23962
+ enabled: enabled22,
23963
+ keywords,
23964
+ readOnly: readOnly2,
23965
+ isHighlighted: selectedIndex === itemIndex,
23966
+ itemIndex
23967
+ },
23968
+ value2
23969
+ );
23970
+ }),
23971
+ shouldShowCreatable && /* @__PURE__ */ jsx(
23972
+ CreatableItem,
23973
+ {
23974
+ onNewItem: onItemCreated,
23975
+ isHighlighted: selectedIndex === 0
23976
+ }
23977
+ ),
23978
+ filteredOptions.length === 0 && !shouldShowCreatable && /* @__PURE__ */ jsx("div", { children: emptyListNode })
23979
+ ] }) : /* @__PURE__ */ jsx(OptionTypeProvider, { Component: AutoCompleteOption, children }) })
23719
23980
  }
23720
23981
  ) })
23721
23982
  ]
23722
23983
  }
23723
23984
  ),
23724
- !open && /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx(OptionTypeProvider, { Component: HiddenOption, children }) })
23985
+ /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx(OptionTypeProvider, { Component: HiddenOption, children }) })
23725
23986
  ] }) });
23726
23987
  });
23727
23988
  function CreatableItem({ onNewItem, isHighlighted = false }) {
@@ -23765,65 +24026,6 @@ function CreatableItem({ onNewItem, isHighlighted = false }) {
23765
24026
  }
23766
24027
  return /* @__PURE__ */ jsx("span", { style: { display: "none" } });
23767
24028
  }
23768
- function VisibleAutoCompleteOption(option) {
23769
- const { value, label: label2, enabled: enabled2 = true, children } = option;
23770
- const { onOptionAdd } = useOption();
23771
- const {
23772
- value: selectedValue,
23773
- onChange,
23774
- multi,
23775
- setOpen,
23776
- readOnly: readOnly2,
23777
- // Use readOnly from AutoComplete context value
23778
- optionRenderer
23779
- } = useAutoComplete();
23780
- const opt = useMemo(() => {
23781
- return {
23782
- ...option,
23783
- label: label2 ?? "",
23784
- keywords: option.keywords || [label2 ?? ""]
23785
- };
23786
- }, [option, label2]);
23787
- useEffect(() => {
23788
- onOptionAdd(opt);
23789
- }, [opt, onOptionAdd]);
23790
- const selected2 = multi ? selectedValue?.includes(value) : selectedValue === value;
23791
- const handleClick = () => {
23792
- if (readOnly2) {
23793
- setOpen(false);
23794
- return;
23795
- }
23796
- if (enabled2) {
23797
- onChange(value);
23798
- if (!multi) {
23799
- setOpen(false);
23800
- }
23801
- }
23802
- };
23803
- return /* @__PURE__ */ jsx(
23804
- "div",
23805
- {
23806
- role: "option",
23807
- "aria-disabled": !enabled2,
23808
- "aria-selected": selected2,
23809
- className: classnames(styles$F.autoCompleteOption, {
23810
- [styles$F.disabledOption]: !enabled2
23811
- }),
23812
- onMouseDown: (e) => {
23813
- e.preventDefault();
23814
- e.stopPropagation();
23815
- },
23816
- onClick: handleClick,
23817
- children: children ? /* @__PURE__ */ jsxs(Fragment, { children: [
23818
- /* @__PURE__ */ jsx("div", { className: styles$F.autoCompleteOptionContent, children }),
23819
- selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
23820
- ] }) : optionRenderer ? optionRenderer({ label: label2, value, enabled: enabled2 }, selectedValue, false) : /* @__PURE__ */ jsxs(Fragment, { children: [
23821
- /* @__PURE__ */ jsx("div", { className: styles$F.autoCompleteOptionContent, children: label2 }),
23822
- selected2 && /* @__PURE__ */ jsx(Icon, { name: "checkmark" })
23823
- ] })
23824
- }
23825
- );
23826
- }
23827
24029
  function AutoCompleteOption(option) {
23828
24030
  const {
23829
24031
  value,
@@ -24713,7 +24915,7 @@ function ApiInterceptorProvider({
24713
24915
  return;
24714
24916
  }
24715
24917
  void (async () => {
24716
- const { initMock } = await import("./initMock-DoewYSkg.js");
24918
+ const { initMock } = await import("./initMock-CP3zGYe3.js");
24717
24919
  const apiInstance2 = await initMock(interceptor);
24718
24920
  setApiInstance(apiInstance2);
24719
24921
  setInitialized(true);
@@ -24730,7 +24932,7 @@ function ApiInterceptorProvider({
24730
24932
  if (process.env.VITE_MOCK_ENABLED) {
24731
24933
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
24732
24934
  useWorker ? import("./apiInterceptorWorker-dwrAyq6l.js") : Promise.resolve({ createApiInterceptorWorker: () => null }),
24733
- import("./initMock-DoewYSkg.js")
24935
+ import("./initMock-CP3zGYe3.js")
24734
24936
  ]);
24735
24937
  if (interceptor || forceInitialize) {
24736
24938
  const apiInstance2 = await initMock(interceptor || {});
@@ -24767,7 +24969,7 @@ function ApiInterceptorProvider({
24767
24969
  void (async () => {
24768
24970
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
24769
24971
  import("./apiInterceptorWorker-dwrAyq6l.js"),
24770
- import("./initMock-DoewYSkg.js")
24972
+ import("./initMock-CP3zGYe3.js")
24771
24973
  ]);
24772
24974
  const apiInstance2 = await initMock(interceptor);
24773
24975
  await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
@@ -26765,7 +26967,7 @@ const Slider = forwardRef(
26765
26967
  thumbsRef.current = thumbsRef.current.slice(0, displayValue.length);
26766
26968
  }, [displayValue.length]);
26767
26969
  return /* @__PURE__ */ jsx("div", { ...rest, ref, style: style2, className: classnames(styles$E.sliderContainer, className), "data-slider-container": true, children: /* @__PURE__ */ jsxs(
26768
- Root,
26970
+ Root$1,
26769
26971
  {
26770
26972
  ref: inputRef,
26771
26973
  minStepsBetweenThumbs,
@@ -26843,11 +27045,11 @@ const Slider = forwardRef(
26843
27045
  }
26844
27046
  );
26845
27047
  Slider.displayName = "Slider";
26846
- const themeVars$g = `'{"Input:borderRadius-ColorPicker--default": "var(--xmlui-borderRadius-ColorPicker--default)", "Input:borderColor-ColorPicker--default": "var(--xmlui-borderColor-ColorPicker--default)", "Input:borderWidth-ColorPicker--default": "var(--xmlui-borderWidth-ColorPicker--default)", "Input:borderStyle-ColorPicker--default": "var(--xmlui-borderStyle-ColorPicker--default)", "Input:boxShadow-ColorPicker--default": "var(--xmlui-boxShadow-ColorPicker--default)", "Input:borderColor-ColorPicker--default--hover": "var(--xmlui-borderColor-ColorPicker--default--hover)", "Input:boxShadow-ColorPicker--default--hover": "var(--xmlui-boxShadow-ColorPicker--default--hover)", "Input:borderColor-ColorPicker--default--focus": "var(--xmlui-borderColor-ColorPicker--default--focus)", "Input:boxShadow-ColorPicker--default--focus": "var(--xmlui-boxShadow-ColorPicker--default--focus)", "Input:borderRadius-ColorPicker--error": "var(--xmlui-borderRadius-ColorPicker--error)", "Input:borderColor-ColorPicker--error": "var(--xmlui-borderColor-ColorPicker--error)", "Input:borderWidth-ColorPicker--error": "var(--xmlui-borderWidth-ColorPicker--error)", "Input:borderStyle-ColorPicker--error": "var(--xmlui-borderStyle-ColorPicker--error)", "Input:boxShadow-ColorPicker--error": "var(--xmlui-boxShadow-ColorPicker--error)", "Input:borderColor-ColorPicker--error--hover": "var(--xmlui-borderColor-ColorPicker--error--hover)", "Input:boxShadow-ColorPicker--error--hover": "var(--xmlui-boxShadow-ColorPicker--error--hover)", "Input:borderColor-ColorPicker--error--focus": "var(--xmlui-borderColor-ColorPicker--error--focus)", "Input:boxShadow-ColorPicker--error--focus": "var(--xmlui-boxShadow-ColorPicker--error--focus)", "Input:borderRadius-ColorPicker--warning": "var(--xmlui-borderRadius-ColorPicker--warning)", "Input:borderColor-ColorPicker--warning": "var(--xmlui-borderColor-ColorPicker--warning)", "Input:borderWidth-ColorPicker--warning": "var(--xmlui-borderWidth-ColorPicker--warning)", "Input:borderStyle-ColorPicker--warning": "var(--xmlui-borderStyle-ColorPicker--warning)", "Input:boxShadow-ColorPicker--warning": "var(--xmlui-boxShadow-ColorPicker--warning)", "Input:borderColor-ColorPicker--warning--hover": "var(--xmlui-borderColor-ColorPicker--warning--hover)", "Input:boxShadow-ColorPicker--warning--hover": "var(--xmlui-boxShadow-ColorPicker--warning--hover)", "Input:borderColor-ColorPicker--warning--focus": "var(--xmlui-borderColor-ColorPicker--warning--focus)", "Input:boxShadow-ColorPicker--warning--focus": "var(--xmlui-boxShadow-ColorPicker--warning--focus)", "Input:borderRadius-ColorPicker--success": "var(--xmlui-borderRadius-ColorPicker--success)", "Input:borderColor-ColorPicker--success": "var(--xmlui-borderColor-ColorPicker--success)", "Input:borderWidth-ColorPicker--success": "var(--xmlui-borderWidth-ColorPicker--success)", "Input:borderStyle-ColorPicker--success": "var(--xmlui-borderStyle-ColorPicker--success)", "Input:boxShadow-ColorPicker--success": "var(--xmlui-boxShadow-ColorPicker--success)", "Input:borderColor-ColorPicker--success--hover": "var(--xmlui-borderColor-ColorPicker--success--hover)", "Input:boxShadow-ColorPicker--success--hover": "var(--xmlui-boxShadow-ColorPicker--success--hover)", "Input:borderColor-ColorPicker--success--focus": "var(--xmlui-borderColor-ColorPicker--success--focus)", "Input:boxShadow-ColorPicker--success--focus": "var(--xmlui-boxShadow-ColorPicker--success--focus)", "Input:backgroundColor-ColorPicker": "var(--xmlui-backgroundColor-ColorPicker)"}'`;
26847
- const colorInput = "_colorInput_1apm8_14";
26848
- const error$3 = "_error_1apm8_48";
26849
- const warning$3 = "_warning_1apm8_63";
26850
- const valid$3 = "_valid_1apm8_78";
27048
+ const themeVars$g = `'{"Input:borderRadius-ColorPicker--default": "var(--xmlui-borderRadius-ColorPicker--default)", "Input:borderColor-ColorPicker--default": "var(--xmlui-borderColor-ColorPicker--default)", "Input:borderWidth-ColorPicker--default": "var(--xmlui-borderWidth-ColorPicker--default)", "Input:borderStyle-ColorPicker--default": "var(--xmlui-borderStyle-ColorPicker--default)", "Input:boxShadow-ColorPicker--default": "var(--xmlui-boxShadow-ColorPicker--default)", "Input:borderColor-ColorPicker--default--hover": "var(--xmlui-borderColor-ColorPicker--default--hover)", "Input:boxShadow-ColorPicker--default--hover": "var(--xmlui-boxShadow-ColorPicker--default--hover)", "Input:borderColor-ColorPicker--default--focus": "var(--xmlui-borderColor-ColorPicker--default--focus)", "Input:boxShadow-ColorPicker--default--focus": "var(--xmlui-boxShadow-ColorPicker--default--focus)", "Input:borderRadius-ColorPicker--error": "var(--xmlui-borderRadius-ColorPicker--error)", "Input:borderColor-ColorPicker--error": "var(--xmlui-borderColor-ColorPicker--error)", "Input:borderWidth-ColorPicker--error": "var(--xmlui-borderWidth-ColorPicker--error)", "Input:borderStyle-ColorPicker--error": "var(--xmlui-borderStyle-ColorPicker--error)", "Input:boxShadow-ColorPicker--error": "var(--xmlui-boxShadow-ColorPicker--error)", "Input:borderColor-ColorPicker--error--hover": "var(--xmlui-borderColor-ColorPicker--error--hover)", "Input:boxShadow-ColorPicker--error--hover": "var(--xmlui-boxShadow-ColorPicker--error--hover)", "Input:borderColor-ColorPicker--error--focus": "var(--xmlui-borderColor-ColorPicker--error--focus)", "Input:boxShadow-ColorPicker--error--focus": "var(--xmlui-boxShadow-ColorPicker--error--focus)", "Input:borderRadius-ColorPicker--warning": "var(--xmlui-borderRadius-ColorPicker--warning)", "Input:borderColor-ColorPicker--warning": "var(--xmlui-borderColor-ColorPicker--warning)", "Input:borderWidth-ColorPicker--warning": "var(--xmlui-borderWidth-ColorPicker--warning)", "Input:borderStyle-ColorPicker--warning": "var(--xmlui-borderStyle-ColorPicker--warning)", "Input:boxShadow-ColorPicker--warning": "var(--xmlui-boxShadow-ColorPicker--warning)", "Input:borderColor-ColorPicker--warning--hover": "var(--xmlui-borderColor-ColorPicker--warning--hover)", "Input:boxShadow-ColorPicker--warning--hover": "var(--xmlui-boxShadow-ColorPicker--warning--hover)", "Input:borderColor-ColorPicker--warning--focus": "var(--xmlui-borderColor-ColorPicker--warning--focus)", "Input:boxShadow-ColorPicker--warning--focus": "var(--xmlui-boxShadow-ColorPicker--warning--focus)", "Input:borderRadius-ColorPicker--success": "var(--xmlui-borderRadius-ColorPicker--success)", "Input:borderColor-ColorPicker--success": "var(--xmlui-borderColor-ColorPicker--success)", "Input:borderWidth-ColorPicker--success": "var(--xmlui-borderWidth-ColorPicker--success)", "Input:borderStyle-ColorPicker--success": "var(--xmlui-borderStyle-ColorPicker--success)", "Input:boxShadow-ColorPicker--success": "var(--xmlui-boxShadow-ColorPicker--success)", "Input:borderColor-ColorPicker--success--hover": "var(--xmlui-borderColor-ColorPicker--success--hover)", "Input:boxShadow-ColorPicker--success--hover": "var(--xmlui-boxShadow-ColorPicker--success--hover)", "Input:borderColor-ColorPicker--success--focus": "var(--xmlui-borderColor-ColorPicker--success--focus)", "Input:boxShadow-ColorPicker--success--focus": "var(--xmlui-boxShadow-ColorPicker--success--focus)", "Input:backgroundColor-ColorPicker": "var(--xmlui-backgroundColor-ColorPicker)", "Input:width-ColorPicker": "var(--xmlui-width-ColorPicker)"}'`;
27049
+ const colorInput = "_colorInput_724av_14";
27050
+ const error$3 = "_error_724av_48";
27051
+ const warning$3 = "_warning_724av_63";
27052
+ const valid$3 = "_valid_724av_78";
26851
27053
  const styles$v = {
26852
27054
  themeVars: themeVars$g,
26853
27055
  colorInput,
@@ -26936,7 +27138,6 @@ const ColorPicker = forwardRef(
26936
27138
  ...rest,
26937
27139
  id,
26938
27140
  className: classnames(className, styles$v.colorInput, {
26939
- [styles$v.disabled]: !enabled2,
26940
27141
  [styles$v.error]: validationStatus === "error",
26941
27142
  [styles$v.warning]: validationStatus === "warning",
26942
27143
  [styles$v.valid]: validationStatus === "valid"
@@ -28297,7 +28498,6 @@ class RestApiProxy {
28297
28498
  body: requestBody
28298
28499
  };
28299
28500
  if (onUploadProgress) {
28300
- console.log("Falling back to axios. Reason: onUploadProgress specified");
28301
28501
  const axios = (await import("axios")).default;
28302
28502
  try {
28303
28503
  const response = await axios.request({
@@ -30950,7 +31150,8 @@ const RadioGroupMd = createMetadata({
30950
31150
  [`backgroundColor-checked-${RGOption}`]: "$color-primary-500",
30951
31151
  [`backgroundColor-checked-${RGOption}--disabled`]: `$textColor--disabled`,
30952
31152
  [`fontSize-${RGOption}`]: "$fontSize-sm",
30953
- [`fontWeight-${RGOption}`]: "$fontWeight-bold"
31153
+ [`fontWeight-${RGOption}`]: "$fontWeight-bold",
31154
+ [`textColor-${RGOption}--disabled`]: "$textColor--disabled"
30954
31155
  }
30955
31156
  });
30956
31157
  const radioGroupRenderer = createComponentRenderer(
@@ -31281,6 +31482,18 @@ const SelectMd = createMetadata({
31281
31482
  isInternal: true,
31282
31483
  description: "internal radix modal prop",
31283
31484
  valueType: "boolean"
31485
+ },
31486
+ groupBy: {
31487
+ description: "This property sets which attribute should be used to group the available options. No grouping is done if omitted. Use it with the `category` attribute on `Options` to define groups. If no options belong to a group, that group will not be shown.",
31488
+ valueType: "string"
31489
+ },
31490
+ groupHeaderTemplate: {
31491
+ description: `Enables the customization of how option groups are displayed in the dropdown. You can use the \`$group\` context variable to access the group name.`,
31492
+ valueType: "ComponentDef"
31493
+ },
31494
+ ungroupedHeaderTemplate: {
31495
+ description: `Enables the customization of how the ungrouped options header is displayed in the dropdown. If not provided, ungrouped options will not have a header.`,
31496
+ valueType: "ComponentDef"
31284
31497
  }
31285
31498
  },
31286
31499
  events: {
@@ -31311,7 +31524,8 @@ const SelectMd = createMetadata({
31311
31524
  },
31312
31525
  contextVars: {
31313
31526
  $item: d("Represents the current option's data (label and value properties)"),
31314
- $itemContext: d("Provides utility methods like `removeItem()` for multi-select scenarios")
31527
+ $itemContext: d("Provides utility methods like `removeItem()` for multi-select scenarios"),
31528
+ $group: d("Group name when using `groupBy` (available in group header templates)")
31315
31529
  },
31316
31530
  themeVars: parseScssVar(styles$K.themeVars),
31317
31531
  defaultThemeVars: {
@@ -31329,17 +31543,15 @@ const SelectMd = createMetadata({
31329
31543
  [`paddingVertical-item-${COMP$J}`]: "$space-2",
31330
31544
  [`paddingHorizontal-${COMP$J}`]: "$space-2",
31331
31545
  [`paddingVertical-${COMP$J}`]: "$space-2",
31332
- [`opacity-text-item-${COMP$J}--disabled`]: "0.5",
31333
- [`opacity-${COMP$J}--disabled`]: "0.5",
31334
31546
  [`backgroundColor-${COMP$J}-badge--hover`]: "$color-primary-400",
31335
31547
  [`backgroundColor-${COMP$J}-badge--active`]: "$color-primary-500",
31336
- [`textColor-item-${COMP$J}--disabled`]: "$color-surface-200",
31548
+ [`textColor-item-${COMP$J}--disabled`]: "$color-surface-300",
31337
31549
  [`textColor-${COMP$J}-badge`]: "$const-color-surface-50",
31338
31550
  [`backgroundColor-item-${COMP$J}`]: "$backgroundColor-dropdown-item",
31339
31551
  [`backgroundColor-item-${COMP$J}--hover`]: "$backgroundColor-dropdown-item--hover",
31340
31552
  [`backgroundColor-item-${COMP$J}--active`]: "$backgroundColor-dropdown-item--active",
31341
- // Default borderColor-Input--disabled is too light so the disabled component is barely visible
31342
- [`borderColor-${COMP$J}--disabled`]: "initial",
31553
+ [`borderColor-${COMP$J}--disabled`]: "$borderColor--disabled",
31554
+ [`textColor-${COMP$J}--disabled`]: "$textColor--disabled",
31343
31555
  [`minHeight-${COMP$J}`]: "$space-7",
31344
31556
  [`minHeight-item-${COMP$J}`]: "$space-7"
31345
31557
  }
@@ -31355,7 +31567,8 @@ const selectComponentRenderer = createComponentRenderer(
31355
31567
  renderChild: renderChild2,
31356
31568
  lookupEventHandler,
31357
31569
  className,
31358
- registerComponentApi
31570
+ registerComponentApi,
31571
+ ...rest
31359
31572
  }) => {
31360
31573
  const multiSelect = extractValue.asOptionalBoolean(node.props.multiSelect);
31361
31574
  const searchable = extractValue.asOptionalBoolean(node.props.searchable);
@@ -31388,6 +31601,29 @@ const selectComponentRenderer = createComponentRenderer(
31388
31601
  dropdownHeight: extractValue(node.props.dropdownHeight),
31389
31602
  required: extractValue.asOptionalBoolean(node.props.required),
31390
31603
  modal: extractValue.asOptionalBoolean(node.props.modal),
31604
+ groupBy: extractValue(node.props.groupBy),
31605
+ groupHeaderRenderer: node.props.groupHeaderTemplate ? (groupName) => {
31606
+ return /* @__PURE__ */ jsx(
31607
+ MemoizedItem,
31608
+ {
31609
+ contextVars: {
31610
+ $group: groupName
31611
+ },
31612
+ node: node.props.groupHeaderTemplate,
31613
+ renderChild: renderChild2
31614
+ }
31615
+ );
31616
+ } : void 0,
31617
+ ungroupedHeaderRenderer: node.props.ungroupedHeaderTemplate ? () => {
31618
+ return /* @__PURE__ */ jsx(
31619
+ MemoizedItem,
31620
+ {
31621
+ contextVars: {},
31622
+ node: node.props.ungroupedHeaderTemplate,
31623
+ renderChild: renderChild2
31624
+ }
31625
+ );
31626
+ } : void 0,
31391
31627
  valueRenderer: node.props.valueTemplate ? (item2, removeItem) => {
31392
31628
  return /* @__PURE__ */ jsx(
31393
31629
  MemoizedItem,
@@ -32440,7 +32676,7 @@ const RootThemeDefinition = {
32440
32676
  "backgroundColor-tree-row--selected--before": $colorPrimary50,
32441
32677
  // --- Border colors
32442
32678
  borderColor: "rgb(from $color-surface-900 r g b / 0.1)",
32443
- "borderColor--disabled": $colorSurface100,
32679
+ "borderColor--disabled": $colorSurface200,
32444
32680
  // --- Text colors
32445
32681
  "textColor-secondary": $colorSurface600,
32446
32682
  // --- Input is an abstract component, so we define its default theme variables here
@@ -34500,7 +34736,7 @@ async function callApi({ state, appContext, lookupAction, getCurrentState, apiIn
34500
34736
  });
34501
34737
  const result = await onErrorFn?.(e, stateContext["$param"]);
34502
34738
  const errorMessage = extractParam(
34503
- { ...stateContext, $error: e },
34739
+ { ...stateContext, $error: createContextVariableError(e) },
34504
34740
  errorNotificationMessage,
34505
34741
  appContext
34506
34742
  );
@@ -35947,7 +36183,7 @@ function DataLoader({
35947
36183
  async (error22) => {
35948
36184
  loaderError2(error22);
35949
36185
  if (onError) {
35950
- const result = await onError(error22);
36186
+ const result = await onError(createContextVariableError(error22));
35951
36187
  if (result === false) {
35952
36188
  if (loadingToastIdRef.current) {
35953
36189
  toast.dismiss(loadingToastIdRef.current);
@@ -35958,7 +36194,7 @@ function DataLoader({
35958
36194
  const errorMessage = extractParam(
35959
36195
  {
35960
36196
  ...stateRef.current.state,
35961
- $error: error22?.toString()
36197
+ $error: createContextVariableError(error22)
35962
36198
  },
35963
36199
  loader.props.errorNotificationMessage,
35964
36200
  stateRef.current.appContext
@@ -39081,7 +39317,7 @@ const Tabs = forwardRef(function Tabs2({
39081
39317
  className: classnames(className, styles$l.tabs, styles$l.accordionView),
39082
39318
  style: style2,
39083
39319
  children: /* @__PURE__ */ jsx(
39084
- Root$1,
39320
+ Root$2,
39085
39321
  {
39086
39322
  value: `${currentTab}`,
39087
39323
  onValueChange: (tab) => {
@@ -39097,7 +39333,7 @@ const Tabs = forwardRef(function Tabs2({
39097
39333
  className: styles$l.accordionRoot,
39098
39334
  children: /* @__PURE__ */ jsxs("div", { className: styles$l.accordionInterleaved, children: [
39099
39335
  /* @__PURE__ */ jsx(List, { className: styles$l.accordionList, children: tabItems.map((tab, index) => /* @__PURE__ */ jsx(
39100
- Trigger,
39336
+ Trigger$1,
39101
39337
  {
39102
39338
  value: tab.innerId,
39103
39339
  asChild: true,
@@ -39132,7 +39368,7 @@ const Tabs = forwardRef(function Tabs2({
39132
39368
  ) });
39133
39369
  }
39134
39370
  return /* @__PURE__ */ jsx(TabContext.Provider, { value: tabContextValue, children: /* @__PURE__ */ jsxs(
39135
- Root$1,
39371
+ Root$2,
39136
39372
  {
39137
39373
  ...rest,
39138
39374
  id: tabsId,
@@ -39164,7 +39400,7 @@ const Tabs = forwardRef(function Tabs2({
39164
39400
  children: [
39165
39401
  !distributeEvenly2 && !headerRenderer && tabAlignment === "end" && /* @__PURE__ */ jsx("div", { className: styles$l.filler, "data-orientation": orientation }),
39166
39402
  !distributeEvenly2 && !headerRenderer && tabAlignment === "center" && /* @__PURE__ */ jsx("div", { className: styles$l.filler, "data-orientation": orientation }),
39167
- tabItems.map((tab, index) => /* @__PURE__ */ jsx(Trigger, { value: tab.innerId, asChild: true, children: /* @__PURE__ */ jsx(
39403
+ tabItems.map((tab, index) => /* @__PURE__ */ jsx(Trigger$1, { value: tab.innerId, asChild: true, children: /* @__PURE__ */ jsx(
39168
39404
  "div",
39169
39405
  {
39170
39406
  role: "tab",
@@ -39977,7 +40213,7 @@ const TabItemComponent = forwardRef(function TabItemComponent2({ children, label
39977
40213
  const tabIndex = tabItems?.findIndex((item2) => item2.innerId === innerId) ?? 0;
39978
40214
  const contentOrder = tabIndex * 2 + 1;
39979
40215
  return /* @__PURE__ */ createElement(
39980
- Content,
40216
+ Content$1,
39981
40217
  {
39982
40218
  ...rest,
39983
40219
  key: innerId,
@@ -41120,7 +41356,7 @@ const APICallMd = createMetadata({
41120
41356
  valueType: "string"
41121
41357
  },
41122
41358
  errorNotificationMessage: {
41123
- description: "This property defines the message to display automatically when the operation results in an error. You can use the `$error` context value in an expression to refer to the original error message.",
41359
+ description: "",
41124
41360
  valueType: "string"
41125
41361
  },
41126
41362
  completedNotificationMessage: {
@@ -41209,6 +41445,13 @@ const optionComponentRenderer = createComponentRenderer(
41209
41445
  }
41210
41446
  const hasTextNodeChild = node.children?.length === 1 && (node.children[0].type === "TextNode" || node.children[0].type === "TextNodeCData");
41211
41447
  const textNodeChild = hasTextNodeChild ? renderChild2(node.children) : void 0;
41448
+ const extraProps = {};
41449
+ const knownProps = /* @__PURE__ */ new Set(["label", "value", "enabled", "keywords"]);
41450
+ Object.keys(node.props).forEach((key) => {
41451
+ if (!knownProps.has(key)) {
41452
+ extraProps[key] = extractValue(node.props[key]);
41453
+ }
41454
+ });
41212
41455
  return /* @__PURE__ */ jsx(
41213
41456
  OptionNative,
41214
41457
  {
@@ -41226,6 +41469,7 @@ const optionComponentRenderer = createComponentRenderer(
41226
41469
  layoutContext
41227
41470
  }
41228
41471
  ) : void 0 : void 0,
41472
+ ...extraProps,
41229
41473
  children: !hasTextNodeChild && renderChild2(node.children)
41230
41474
  }
41231
41475
  );
@@ -41334,17 +41578,15 @@ const AutoCompleteMd = createMetadata({
41334
41578
  [`paddingVertical-item-${COMP$i}`]: "$space-2",
41335
41579
  [`paddingHorizontal-${COMP$i}`]: "$space-2",
41336
41580
  [`paddingVertical-${COMP$i}`]: "$space-2",
41337
- [`opacity-text-item-${COMP$i}--disabled`]: "0.5",
41338
- [`opacity-${COMP$i}--disabled`]: "0.5",
41339
41581
  [`backgroundColor-${COMP$i}-badge--hover`]: "$color-primary-400",
41340
41582
  [`backgroundColor-${COMP$i}-badge--active`]: "$color-primary-500",
41341
- [`textColor-item-${COMP$i}--disabled`]: "$color-surface-200",
41583
+ [`textColor-item-${COMP$i}--disabled`]: "$color-surface-300",
41342
41584
  [`textColor-${COMP$i}-badge`]: "$const-color-surface-50",
41343
41585
  [`backgroundColor-item-${COMP$i}`]: "$backgroundColor-dropdown-item",
41344
41586
  [`backgroundColor-item-${COMP$i}--hover`]: "$backgroundColor-dropdown-item--hover",
41345
41587
  [`backgroundColor-item-${COMP$i}--active`]: "$backgroundColor-dropdown-item--active",
41346
- // Default borderColor-Input--disabled is too light so the disabled component is barely visible
41347
- [`borderColor-${COMP$i}--disabled`]: "initial"
41588
+ [`borderColor-${COMP$i}--disabled`]: "$borderColor--disabled",
41589
+ [`textColor-${COMP$i}--disabled`]: "$textColor--disabled"
41348
41590
  }
41349
41591
  });
41350
41592
  const autoCompleteComponentRenderer = createComponentRenderer(
@@ -43478,7 +43720,10 @@ const ColorPickerMd = createMetadata({
43478
43720
  }
43479
43721
  }
43480
43722
  },
43481
- themeVars: parseScssVar(styles$v.themeVars)
43723
+ themeVars: parseScssVar(styles$v.themeVars),
43724
+ defaultThemeVars: {
43725
+ [`width-${COMP$g}`]: "48px"
43726
+ }
43482
43727
  });
43483
43728
  const colorPickerComponentRenderer = createComponentRenderer(
43484
43729
  "ColorPicker",
@@ -47886,7 +48131,7 @@ function IconProvider({ children }) {
47886
48131
  /* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
47887
48132
  ] });
47888
48133
  }
47889
- const version = "0.11.20";
48134
+ const version = "0.11.21";
47890
48135
  const miscellaneousUtils = {
47891
48136
  capitalize,
47892
48137
  pluralize: pluralize$1,
@@ -52810,7 +53055,7 @@ const DataSourceMd = createMetadata({
52810
53055
  valueType: "string"
52811
53056
  },
52812
53057
  errorNotificationMessage: {
52813
- description: "Set the message to display when the there is an error. You can use the `$error` context value in an expression to refer to the original error message.",
53058
+ description: "",
52814
53059
  valueType: "string"
52815
53060
  },
52816
53061
  resultSelector: {