@sustaina/shared-ui 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -59,6 +59,8 @@ var modifiers = require('@dnd-kit/modifiers');
59
59
  var zod = require('zod');
60
60
  var Cropper = require('react-easy-crop');
61
61
  var reactNumberFormat = require('react-number-format');
62
+ var cmdk = require('cmdk');
63
+ var reactVirtual = require('@tanstack/react-virtual');
62
64
 
63
65
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
64
66
 
@@ -4251,6 +4253,25 @@ var useTruncated = ({
4251
4253
  return isTruncated;
4252
4254
  };
4253
4255
  var useTruncated_default = useTruncated;
4256
+ var useControllableState = ({
4257
+ defaultValue,
4258
+ value
4259
+ }) => {
4260
+ const [internalValue, setInternalValue] = React4__namespace.useState(value ?? defaultValue);
4261
+ React4__namespace.useEffect(() => {
4262
+ if (value !== internalValue) {
4263
+ setInternalValue(value);
4264
+ }
4265
+ }, [value]);
4266
+ const updateState = React4__namespace.useCallback((nextValue) => {
4267
+ setInternalValue(nextValue);
4268
+ }, []);
4269
+ return {
4270
+ value: internalValue,
4271
+ updateState
4272
+ };
4273
+ };
4274
+ var useControllableState_default = useControllableState;
4254
4275
  var HeaderCell = ({
4255
4276
  rootClassName,
4256
4277
  labelClassName,
@@ -9774,8 +9795,9 @@ var Navbar = ({
9774
9795
  mainButtonText && /* @__PURE__ */ jsxRuntime.jsx(
9775
9796
  Button,
9776
9797
  {
9798
+ variant: "cottonYellowDark",
9777
9799
  disabled: mainButtonDisable,
9778
- className: cn("bg-sus-secondary-1 hover:bg-sus-secondary-hover", mainButtonClassName),
9800
+ className: mainButtonClassName,
9779
9801
  size: "lg",
9780
9802
  onClick: onMainButtonClick,
9781
9803
  children: mainButtonText
@@ -10151,7 +10173,7 @@ var Truncated = ({
10151
10173
  Tooltip,
10152
10174
  {
10153
10175
  ...tooltipProps,
10154
- open,
10176
+ open: tooltipProps?.disabled ? false : open,
10155
10177
  onOpenChange: (open2) => {
10156
10178
  setOpen(isTruncated && open2);
10157
10179
  },
@@ -10435,6 +10457,519 @@ var ActionMenu = ({
10435
10457
  )
10436
10458
  ] });
10437
10459
  };
10460
+ function Dialog3({ ...props }) {
10461
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
10462
+ }
10463
+ function DialogPortal3({ ...props }) {
10464
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
10465
+ }
10466
+ function DialogOverlay3({ className, ...props }) {
10467
+ return /* @__PURE__ */ jsxRuntime.jsx(
10468
+ SheetPrimitive__namespace.Overlay,
10469
+ {
10470
+ "data-slot": "dialog-overlay",
10471
+ className: cn(
10472
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
10473
+ className
10474
+ ),
10475
+ ...props
10476
+ }
10477
+ );
10478
+ }
10479
+ function DialogContent3({
10480
+ className,
10481
+ children,
10482
+ showCloseButton = true,
10483
+ ...props
10484
+ }) {
10485
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal3, { "data-slot": "dialog-portal", children: [
10486
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay3, {}),
10487
+ /* @__PURE__ */ jsxRuntime.jsxs(
10488
+ SheetPrimitive__namespace.Content,
10489
+ {
10490
+ "data-slot": "dialog-content",
10491
+ className: cn(
10492
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
10493
+ className
10494
+ ),
10495
+ ...props,
10496
+ children: [
10497
+ children,
10498
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
10499
+ SheetPrimitive__namespace.Close,
10500
+ {
10501
+ "data-slot": "dialog-close",
10502
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
10503
+ children: [
10504
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
10505
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
10506
+ ]
10507
+ }
10508
+ )
10509
+ ]
10510
+ }
10511
+ )
10512
+ ] });
10513
+ }
10514
+ function DialogHeader3({ className, ...props }) {
10515
+ return /* @__PURE__ */ jsxRuntime.jsx(
10516
+ "div",
10517
+ {
10518
+ "data-slot": "dialog-header",
10519
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
10520
+ ...props
10521
+ }
10522
+ );
10523
+ }
10524
+ function DialogTitle3({ className, ...props }) {
10525
+ return /* @__PURE__ */ jsxRuntime.jsx(
10526
+ SheetPrimitive__namespace.Title,
10527
+ {
10528
+ "data-slot": "dialog-title",
10529
+ className: cn("text-lg leading-none font-semibold", className),
10530
+ ...props
10531
+ }
10532
+ );
10533
+ }
10534
+ function DialogDescription3({
10535
+ className,
10536
+ ...props
10537
+ }) {
10538
+ return /* @__PURE__ */ jsxRuntime.jsx(
10539
+ SheetPrimitive__namespace.Description,
10540
+ {
10541
+ "data-slot": "dialog-description",
10542
+ className: cn("text-muted-foreground text-sm", className),
10543
+ ...props
10544
+ }
10545
+ );
10546
+ }
10547
+ function Command({ className, ...props }) {
10548
+ return /* @__PURE__ */ jsxRuntime.jsx(
10549
+ cmdk.Command,
10550
+ {
10551
+ "data-slot": "command",
10552
+ className: cn(
10553
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
10554
+ className
10555
+ ),
10556
+ ...props
10557
+ }
10558
+ );
10559
+ }
10560
+ function CommandDialog({
10561
+ title = "Command Palette",
10562
+ description = "Search for a command to run...",
10563
+ children,
10564
+ className,
10565
+ showCloseButton = true,
10566
+ ...props
10567
+ }) {
10568
+ return /* @__PURE__ */ jsxRuntime.jsxs(Dialog3, { ...props, children: [
10569
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader3, { className: "sr-only", children: [
10570
+ /* @__PURE__ */ jsxRuntime.jsx(DialogTitle3, { children: title }),
10571
+ /* @__PURE__ */ jsxRuntime.jsx(DialogDescription3, { children: description })
10572
+ ] }),
10573
+ /* @__PURE__ */ jsxRuntime.jsx(DialogContent3, { className: cn("overflow-hidden p-0", className), showCloseButton, children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) })
10574
+ ] });
10575
+ }
10576
+ function CommandInput({ className, ...props }) {
10577
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [
10578
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
10579
+ /* @__PURE__ */ jsxRuntime.jsx(
10580
+ cmdk.Command.Input,
10581
+ {
10582
+ "data-slot": "command-input",
10583
+ className: cn(
10584
+ "placeholder:text-sus-gray-1 flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
10585
+ className
10586
+ ),
10587
+ ...props
10588
+ }
10589
+ )
10590
+ ] });
10591
+ }
10592
+ function CommandList({ className, ...props }) {
10593
+ return /* @__PURE__ */ jsxRuntime.jsx(
10594
+ cmdk.Command.List,
10595
+ {
10596
+ "data-slot": "command-list",
10597
+ className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
10598
+ ...props
10599
+ }
10600
+ );
10601
+ }
10602
+ function CommandEmpty({ className, ...props }) {
10603
+ return /* @__PURE__ */ jsxRuntime.jsx(
10604
+ cmdk.Command.Empty,
10605
+ {
10606
+ "data-slot": "command-empty",
10607
+ className: cn("py-6 text-center text-sm", className),
10608
+ ...props
10609
+ }
10610
+ );
10611
+ }
10612
+ function CommandGroup({ className, ...props }) {
10613
+ return /* @__PURE__ */ jsxRuntime.jsx(
10614
+ cmdk.Command.Group,
10615
+ {
10616
+ "data-slot": "command-group",
10617
+ className: cn(
10618
+ "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
10619
+ className
10620
+ ),
10621
+ ...props
10622
+ }
10623
+ );
10624
+ }
10625
+ function CommandSeparator({
10626
+ className,
10627
+ ...props
10628
+ }) {
10629
+ return /* @__PURE__ */ jsxRuntime.jsx(
10630
+ cmdk.Command.Separator,
10631
+ {
10632
+ "data-slot": "command-separator",
10633
+ className: cn("bg-border -mx-1 h-px", className),
10634
+ ...props
10635
+ }
10636
+ );
10637
+ }
10638
+ function CommandItem({ className, ...props }) {
10639
+ return /* @__PURE__ */ jsxRuntime.jsx(
10640
+ cmdk.Command.Item,
10641
+ {
10642
+ "data-slot": "command-item",
10643
+ className: cn(
10644
+ "hover:bg-[#EAF5EE] hover:text-sus-green-2 bg-white text-black relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
10645
+ "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
10646
+ className
10647
+ ),
10648
+ ...props
10649
+ }
10650
+ );
10651
+ }
10652
+ function CommandShortcut({ className, ...props }) {
10653
+ return /* @__PURE__ */ jsxRuntime.jsx(
10654
+ "span",
10655
+ {
10656
+ "data-slot": "command-shortcut",
10657
+ className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
10658
+ ...props
10659
+ }
10660
+ );
10661
+ }
10662
+ var useFieldNames = ({
10663
+ fieldNames
10664
+ }) => {
10665
+ const { label: labelFieldKey = "label", value: valueFieldKey = "value" } = fieldNames || {};
10666
+ const getLabelField = React4__namespace.default.useCallback(
10667
+ (option) => {
10668
+ return option?.[labelFieldKey];
10669
+ },
10670
+ [labelFieldKey]
10671
+ );
10672
+ const getValueField = React4__namespace.default.useCallback(
10673
+ (option) => {
10674
+ return option?.[valueFieldKey];
10675
+ },
10676
+ [valueFieldKey]
10677
+ );
10678
+ return {
10679
+ getLabelField,
10680
+ getValueField
10681
+ };
10682
+ };
10683
+ var useFieldNames_default = useFieldNames;
10684
+ var ROW_HEIGHT = 32;
10685
+ var MIN_HEIGHT_EMPTY = 76;
10686
+ var VirtualizedCommand = ({
10687
+ height = 292,
10688
+ options,
10689
+ emptyContent = "No data.",
10690
+ searchPlaceholder,
10691
+ value,
10692
+ notFoundContent = "Not item found.",
10693
+ showSearch = true,
10694
+ fieldNames,
10695
+ disabledOption,
10696
+ filterOption,
10697
+ onSelect,
10698
+ labelRender,
10699
+ onBlur,
10700
+ onFocus
10701
+ }) => {
10702
+ const { getLabelField, getValueField } = useFieldNames_default({ fieldNames });
10703
+ const internalOptions = React4__namespace.useMemo(() => options ?? [], [options]);
10704
+ const [filteredOptions, setFilteredOptions] = React4__namespace.useState(internalOptions);
10705
+ const [focusedIndex, setFocusedIndex] = React4__namespace.useState(0);
10706
+ const [isKeyboardNavActive, setIsKeyboardNavActive] = React4__namespace.useState(false);
10707
+ const parentRef = React4__namespace.useRef(null);
10708
+ const virtualizer = reactVirtual.useVirtualizer({
10709
+ count: filteredOptions.length,
10710
+ getScrollElement: () => parentRef.current,
10711
+ estimateSize: () => ROW_HEIGHT,
10712
+ overscan: 2
10713
+ });
10714
+ const virtualOptions = virtualizer.getVirtualItems();
10715
+ const dynamicHeight = React4__namespace.useMemo(() => {
10716
+ const contentHeight = filteredOptions.length * ROW_HEIGHT;
10717
+ if (contentHeight <= 0) {
10718
+ return MIN_HEIGHT_EMPTY;
10719
+ }
10720
+ return Math.max(ROW_HEIGHT, Math.min(height, contentHeight));
10721
+ }, [filteredOptions.length, height]);
10722
+ const scrollToIndex = React4__namespace.useCallback(
10723
+ (index) => {
10724
+ virtualizer.scrollToIndex(index, {
10725
+ align: "center"
10726
+ });
10727
+ },
10728
+ [virtualizer]
10729
+ );
10730
+ const handleSearch = React4__namespace.useCallback(
10731
+ (search) => {
10732
+ setIsKeyboardNavActive(false);
10733
+ setFilteredOptions(
10734
+ internalOptions.filter((option) => {
10735
+ if (typeof filterOption === "function") {
10736
+ return filterOption(search, option);
10737
+ }
10738
+ const labelValue = getLabelField(option);
10739
+ return labelValue?.toString()?.toLowerCase()?.includes?.(search.toLowerCase());
10740
+ })
10741
+ );
10742
+ },
10743
+ [filterOption, getLabelField, internalOptions]
10744
+ );
10745
+ const handleKeyDown = React4__namespace.useCallback(
10746
+ (event) => {
10747
+ switch (event.key) {
10748
+ case "ArrowDown": {
10749
+ event.preventDefault();
10750
+ setIsKeyboardNavActive(true);
10751
+ setFocusedIndex((prev) => {
10752
+ const newIndex = prev === -1 ? 0 : Math.min(prev + 1, filteredOptions.length - 1);
10753
+ scrollToIndex(newIndex);
10754
+ return newIndex;
10755
+ });
10756
+ break;
10757
+ }
10758
+ case "ArrowUp": {
10759
+ event.preventDefault();
10760
+ setIsKeyboardNavActive(true);
10761
+ setFocusedIndex((prev) => {
10762
+ const newIndex = prev === -1 ? filteredOptions.length - 1 : Math.max(prev - 1, 0);
10763
+ scrollToIndex(newIndex);
10764
+ return newIndex;
10765
+ });
10766
+ break;
10767
+ }
10768
+ case "Enter": {
10769
+ event.preventDefault();
10770
+ const option = filteredOptions?.[focusedIndex];
10771
+ if (option) {
10772
+ onSelect?.(getValueField(option), option);
10773
+ }
10774
+ break;
10775
+ }
10776
+ }
10777
+ },
10778
+ [filteredOptions, focusedIndex, getValueField, onSelect, scrollToIndex]
10779
+ );
10780
+ React4__namespace.useEffect(() => {
10781
+ if (value) {
10782
+ const option = filteredOptions.find((option2) => {
10783
+ const optionValue = getValueField(option2);
10784
+ return optionValue === value;
10785
+ });
10786
+ if (option) {
10787
+ const index = filteredOptions.indexOf(option);
10788
+ setFocusedIndex(index);
10789
+ virtualizer.scrollToIndex(index, { align: "center" });
10790
+ }
10791
+ }
10792
+ }, [value, filteredOptions, virtualizer, getValueField]);
10793
+ return /* @__PURE__ */ jsxRuntime.jsxs(Command, { shouldFilter: false, onKeyDown: handleKeyDown, onFocus, onBlur, children: [
10794
+ showSearch && /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { onValueChange: handleSearch, placeholder: searchPlaceholder }),
10795
+ /* @__PURE__ */ jsxRuntime.jsxs(
10796
+ CommandList,
10797
+ {
10798
+ ref: parentRef,
10799
+ className: "max-h-none",
10800
+ style: {
10801
+ height: dynamicHeight,
10802
+ width: "100%",
10803
+ overflow: "auto"
10804
+ },
10805
+ onMouseDown: () => setIsKeyboardNavActive(false),
10806
+ onMouseMove: () => setIsKeyboardNavActive(false),
10807
+ children: [
10808
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: internalOptions.length === 0 ? emptyContent : notFoundContent }),
10809
+ /* @__PURE__ */ jsxRuntime.jsx(
10810
+ CommandGroup,
10811
+ {
10812
+ style: {
10813
+ height: `${virtualizer.getTotalSize()}px`,
10814
+ width: "100%",
10815
+ position: "relative"
10816
+ },
10817
+ children: virtualOptions.map((virtualOption) => {
10818
+ const option = filteredOptions[virtualOption.index];
10819
+ const optionLabel = getLabelField(option);
10820
+ const optionValue = getValueField(option);
10821
+ const labelRendered = labelRender ? labelRender(filteredOptions[virtualOption.index]) : optionLabel;
10822
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10823
+ CommandItem,
10824
+ {
10825
+ className: cn("absolute left-0 top-0 w-full flex items-center justify-between", {
10826
+ "bg-sus-secondary-green-3 text-sus-green-2": focusedIndex === virtualOption.index,
10827
+ "aria-selected:bg-white aria-selected:text-black pointer-events-none": isKeyboardNavActive && focusedIndex !== virtualOption.index
10828
+ }),
10829
+ style: {
10830
+ height: `${virtualOption.size}px`,
10831
+ transform: `translateY(${virtualOption.start}px)`
10832
+ },
10833
+ value: optionValue,
10834
+ onMouseEnter: () => !isKeyboardNavActive && setFocusedIndex(virtualOption.index),
10835
+ onMouseLeave: () => !isKeyboardNavActive && setFocusedIndex(-1),
10836
+ onSelect: (selectedValue) => onSelect?.(selectedValue, option),
10837
+ disabled: disabledOption?.(option),
10838
+ children: [
10839
+ typeof labelRendered === "string" ? /* @__PURE__ */ jsxRuntime.jsx(truncated_default, { tooltipProps: { disabled: true }, children: labelRendered }) : labelRendered,
10840
+ /* @__PURE__ */ jsxRuntime.jsx(
10841
+ lucideReact.Check,
10842
+ {
10843
+ className: cn(
10844
+ "mr-2 size-2 hover:text-sus-green-2",
10845
+ value === optionValue ? "opacity-100" : "opacity-0"
10846
+ )
10847
+ }
10848
+ )
10849
+ ]
10850
+ },
10851
+ optionValue
10852
+ );
10853
+ })
10854
+ }
10855
+ )
10856
+ ]
10857
+ }
10858
+ )
10859
+ ] });
10860
+ };
10861
+ var VirtualizedCommand_default = VirtualizedCommand;
10862
+ var ComboboxInner = ({
10863
+ defaultValue,
10864
+ className,
10865
+ options,
10866
+ value,
10867
+ disabled,
10868
+ placeholder: placeholder2 = "placeholder",
10869
+ fieldNames,
10870
+ showClear = false,
10871
+ onSelect,
10872
+ onFocus,
10873
+ onBlur,
10874
+ ...virtualizedCommandProps
10875
+ }, ref) => {
10876
+ const { getValueField } = useFieldNames_default({ fieldNames });
10877
+ const [open, setOpen] = React4__namespace.useState(false);
10878
+ const { value: selectedValue, updateState: setSelectedValue } = useControllableState_default({
10879
+ defaultValue,
10880
+ value
10881
+ });
10882
+ const renderValue = React4__namespace.useMemo(() => {
10883
+ if (!selectedValue) return placeholder2;
10884
+ const selectedOptionFound = options?.find((option) => {
10885
+ const optionValue = getValueField(option);
10886
+ return optionValue === selectedValue;
10887
+ });
10888
+ return selectedOptionFound ? getValueField(selectedOptionFound) : null;
10889
+ }, [getValueField, options, placeholder2, selectedValue]);
10890
+ const handleSelect = React4__namespace.useCallback(
10891
+ (selected, option) => {
10892
+ setSelectedValue(selected);
10893
+ setOpen(false);
10894
+ if (typeof onSelect === "function") {
10895
+ onSelect(selected, option);
10896
+ }
10897
+ },
10898
+ [onSelect, setSelectedValue]
10899
+ );
10900
+ const handleClear = React4__namespace.useCallback(
10901
+ (event) => {
10902
+ event.stopPropagation();
10903
+ setSelectedValue(void 0);
10904
+ },
10905
+ [setSelectedValue]
10906
+ );
10907
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: (next) => !disabled && setOpen(next), children: [
10908
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
10909
+ "button",
10910
+ {
10911
+ ref,
10912
+ type: "button",
10913
+ role: "combobox",
10914
+ "aria-expanded": open,
10915
+ className: cn(
10916
+ "flex w-full items-center justify-between gap-2 rounded-md border bg-white px-3 h-9 text-sm whitespace-nowrap shadow-xs outline-none border-input",
10917
+ "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50",
10918
+ "transition-all",
10919
+ className
10920
+ ),
10921
+ "data-state": open ? "open" : "closed",
10922
+ disabled,
10923
+ onFocus,
10924
+ onBlur,
10925
+ children: [
10926
+ /* @__PURE__ */ jsxRuntime.jsx(
10927
+ truncated_default,
10928
+ {
10929
+ className: cn(!selectedValue && "text-sus-gray-1"),
10930
+ tooltipProps: { disabled: true },
10931
+ children: renderValue
10932
+ }
10933
+ ),
10934
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
10935
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4 opacity-50" }),
10936
+ showClear && selectedValue && /* @__PURE__ */ jsxRuntime.jsx(
10937
+ "span",
10938
+ {
10939
+ role: "button",
10940
+ className: cn(
10941
+ "inline-flex items-center justify-center p-0 cursor-pointer transition-all size-[15px]"
10942
+ ),
10943
+ onClick: handleClear,
10944
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-[15px] bg-black text-white border border-black hover:bg-[#333] rounded-full" })
10945
+ }
10946
+ )
10947
+ ] })
10948
+ ]
10949
+ }
10950
+ ) }),
10951
+ /* @__PURE__ */ jsxRuntime.jsx(
10952
+ PopoverContent,
10953
+ {
10954
+ className: "p-0 w-(--radix-popper-anchor-width) min-w-(--radix-popper-anchor-width) max-w-(--radix-popper-available-width)",
10955
+ align: "start",
10956
+ sideOffset: 4,
10957
+ children: /* @__PURE__ */ jsxRuntime.jsx(
10958
+ VirtualizedCommand_default,
10959
+ {
10960
+ ...virtualizedCommandProps,
10961
+ fieldNames,
10962
+ options,
10963
+ value: selectedValue,
10964
+ onSelect: handleSelect
10965
+ }
10966
+ )
10967
+ }
10968
+ )
10969
+ ] });
10970
+ };
10971
+ var Combobox = React4__namespace.forwardRef(ComboboxInner);
10972
+ var Combobox_default = Combobox;
10438
10973
 
10439
10974
  exports.Accordion = Accordion;
10440
10975
  exports.AccordionContent = AccordionContent;
@@ -10448,6 +10983,16 @@ exports.Checkbox = Checkbox;
10448
10983
  exports.Collapsible = Collapsible;
10449
10984
  exports.CollapsibleContent = CollapsibleContent2;
10450
10985
  exports.CollapsibleTrigger = CollapsibleTrigger2;
10986
+ exports.Combobox = Combobox_default;
10987
+ exports.Command = Command;
10988
+ exports.CommandDialog = CommandDialog;
10989
+ exports.CommandEmpty = CommandEmpty;
10990
+ exports.CommandGroup = CommandGroup;
10991
+ exports.CommandInput = CommandInput;
10992
+ exports.CommandItem = CommandItem;
10993
+ exports.CommandList = CommandList;
10994
+ exports.CommandSeparator = CommandSeparator;
10995
+ exports.CommandShortcut = CommandShortcut;
10451
10996
  exports.CropperModal = CropperModal;
10452
10997
  exports.CropperModalError = CropperModalError;
10453
10998
  exports.DIALOG_ALERT_I18N_SUBNAMESPACE = DIALOG_ALERT_I18N_SUBNAMESPACE;
@@ -10564,6 +11109,7 @@ exports.TooltipProvider = TooltipProvider2;
10564
11109
  exports.TooltipTrigger = TooltipTrigger2;
10565
11110
  exports.Truncated = truncated_default;
10566
11111
  exports.UI = ui_exports;
11112
+ exports.VirtualizedCommand = VirtualizedCommand_default;
10567
11113
  exports.booleanToSelectValue = booleanToSelectValue;
10568
11114
  exports.buildPrefixMap = buildPrefixMap;
10569
11115
  exports.buttonVariants = buttonVariants;
@@ -10588,6 +11134,7 @@ exports.splitOperators = splitOperators;
10588
11134
  exports.stripNullishObject = stripNullishObject;
10589
11135
  exports.throttle = throttle;
10590
11136
  exports.tokenizeFormulaString = tokenizeFormulaString;
11137
+ exports.useControllableState = useControllableState_default;
10591
11138
  exports.useFormField = useFormField;
10592
11139
  exports.useGridSettingsStore = useGridSettingsStore_default;
10593
11140
  exports.useHover = useHover_default;