@getgreenline/blaze-ui 1.0.4-5.01-beta → 1.0.4-5.03-beta

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.
@@ -1,5 +1,8 @@
1
1
  import * as React from "react";
2
2
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
3
- declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ type CheckboxShape = "square" | "circle";
4
+ declare function Checkbox({ className, shape, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root> & {
5
+ shape?: CheckboxShape;
6
+ }): import("react/jsx-runtime").JSX.Element;
4
7
  export { Checkbox };
5
8
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAK7D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,2CAkBrD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAK7D,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAExC,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG;IACvD,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,2CAmBA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -3,8 +3,8 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
3
  import { CheckIcon } from 'lucide-react';
4
4
  import { cn } from '../lib/utils.js';
5
5
 
6
- function Checkbox({ className, ...props }) {
7
- return (jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("tw:peer tw:!border-border tw:dark:!bg-input/30 tw:data-[state=checked]:!bg-primary tw:data-[state=checked]:!text-primary-foreground tw:dark:data-[state=checked]:!bg-primary tw:data-[state=checked]:!border-primary tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive tw:!size-4 tw:!shrink-0 tw:!rounded-[4px] tw:!border tw:!shadow-xs tw:!transition-shadow tw:!outline-none tw:focus-visible:!ring-[3px] tw:disabled:!cursor-not-allowed tw:disabled:!opacity-50 tw:data-[disabled]:!cursor-not-allowed tw:data-[disabled]:!opacity-50 tw:aria-disabled:!cursor-not-allowed tw:aria-disabled:!opacity-50 tw:!align-middle", className), ...props, children: jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "tw:flex tw:items-center tw:justify-center tw:text-current tw:transition-none", children: jsx(CheckIcon, { className: "tw:size-[80%]" }) }) }));
6
+ function Checkbox({ className, shape = "square", ...props }) {
7
+ return (jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("tw:peer tw:!border-border tw:dark:!bg-input/30 tw:data-[state=checked]:!bg-primary tw:data-[state=checked]:!text-primary-foreground tw:dark:data-[state=checked]:!bg-primary tw:data-[state=checked]:!border-primary tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive tw:!size-4 tw:!shrink-0 tw:!border tw:!shadow-xs tw:!transition-shadow tw:!outline-none tw:focus-visible:!ring-[3px] tw:disabled:!cursor-not-allowed tw:disabled:!opacity-50 tw:data-[disabled]:!cursor-not-allowed tw:data-[disabled]:!opacity-50 tw:aria-disabled:!cursor-not-allowed tw:aria-disabled:!opacity-50 tw:!align-middle", shape === "circle" ? "tw:!rounded-full" : "tw:!rounded-[4px]", className), ...props, children: jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "tw:flex tw:items-center tw:justify-center tw:text-current tw:transition-none", children: jsx(CheckIcon, { className: "tw:size-[80%]" }) }) }));
8
8
  }
9
9
 
10
10
  export { Checkbox };
@@ -11,7 +11,15 @@ export interface MultiSearchSelectProps extends Omit<React.ComponentProps<"butto
11
11
  placeholder?: string;
12
12
  searchPlaceholder?: string;
13
13
  emptyMessage?: string;
14
+ maxOptions?: number;
15
+ onSearchFunction?: (searchTerm: string) => Promise<MultiSearchSelectOption[]> | MultiSearchSelectOption[];
16
+ minSearchChars?: number;
17
+ searchDebounceMs?: number;
18
+ minSearchMessage?: string;
19
+ maxVisibleChips?: number;
20
+ selectedCountLabel?: string;
21
+ selectedCountFormatter?: (count: number) => string;
14
22
  }
15
- declare function MultiSearchSelect({ className, options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, ...props }: MultiSearchSelectProps): import("react/jsx-runtime").JSX.Element;
23
+ declare function MultiSearchSelect({ className, options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, maxOptions, onSearchFunction, minSearchChars, searchDebounceMs, minSearchMessage, maxVisibleChips, selectedCountLabel, selectedCountFormatter, disabled, ...props }: MultiSearchSelectProps): import("react/jsx-runtime").JSX.Element;
16
24
  export { MultiSearchSelect };
17
25
  //# sourceMappingURL=multi-search-select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"multi-search-select.d.ts","sourceRoot":"","sources":["../../src/components/multi-search-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAC9B,OAAO,GAAG,UAAU,CACrB;IACC,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAiC,EACjC,iBAA+B,EAC/B,YAAiC,EACjC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAqJxB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"multi-search-select.d.ts","sourceRoot":"","sources":["../../src/components/multi-search-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAC9B,OAAO,GAAG,UAAU,CACrB;IACC,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAA;IACnE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CACnD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAiC,EACjC,iBAA+B,EAC/B,YAAiC,EACjC,UAAe,EACf,gBAAgB,EAChB,cAAkB,EAClB,gBAAsB,EACtB,gBAAgB,EAChB,eAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAsTxB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,20 +1,110 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as PopoverPrimitive from '@radix-ui/react-popover';
4
4
  import { XIcon, ChevronDownIcon, SearchIcon, CheckIcon } from 'lucide-react';
5
5
  import { Badge } from './badge.js';
6
6
  import { cn } from '../lib/utils.js';
7
7
 
8
- function MultiSearchSelect({ className, options, value, onValueChange, placeholder = "Select options...", searchPlaceholder = "Search...", emptyMessage = "No options found", disabled, ...props }) {
8
+ function MultiSearchSelect({ className, options, value, onValueChange, placeholder = "Select options...", searchPlaceholder = "Search...", emptyMessage = "No options found", maxOptions = 50, onSearchFunction, minSearchChars = 3, searchDebounceMs = 800, minSearchMessage, maxVisibleChips = 3, selectedCountLabel, selectedCountFormatter, disabled, ...props }) {
9
+ const triggerId = React.useId();
10
+ const listboxId = React.useId();
11
+ const searchInputId = React.useId();
9
12
  const [open, setOpen] = React.useState(false);
10
13
  const [search, setSearch] = React.useState("");
11
- const selectedOptions = React.useMemo(() => options.filter((option) => value.includes(option.value)), [options, value]);
14
+ const [remoteOptions, setRemoteOptions] = React.useState([]);
15
+ const [isSearching, setIsSearching] = React.useState(false);
16
+ const normalizedSearch = search.trim();
17
+ React.useEffect(() => {
18
+ if (!onSearchFunction)
19
+ return;
20
+ if (normalizedSearch.length < minSearchChars) {
21
+ setRemoteOptions([]);
22
+ setIsSearching(false);
23
+ return;
24
+ }
25
+ let isCancelled = false;
26
+ setIsSearching(true);
27
+ const timerId = window.setTimeout(async () => {
28
+ try {
29
+ const response = await onSearchFunction(normalizedSearch);
30
+ if (!isCancelled) {
31
+ setRemoteOptions(response ?? []);
32
+ }
33
+ }
34
+ catch {
35
+ if (!isCancelled) {
36
+ setRemoteOptions([]);
37
+ }
38
+ }
39
+ finally {
40
+ if (!isCancelled) {
41
+ setIsSearching(false);
42
+ }
43
+ }
44
+ }, searchDebounceMs);
45
+ return () => {
46
+ isCancelled = true;
47
+ window.clearTimeout(timerId);
48
+ };
49
+ }, [minSearchChars, normalizedSearch, onSearchFunction, searchDebounceMs]);
50
+ const allKnownOptions = React.useMemo(() => {
51
+ const seen = new Map();
52
+ for (const option of options) {
53
+ seen.set(option.value, option);
54
+ }
55
+ for (const option of remoteOptions) {
56
+ seen.set(option.value, option);
57
+ }
58
+ return Array.from(seen.values());
59
+ }, [options, remoteOptions]);
60
+ const selectedOptions = React.useMemo(() => {
61
+ const optionByValue = new Map(allKnownOptions.map((option) => [option.value, option]));
62
+ return value.map((selectedValue) => {
63
+ const knownOption = optionByValue.get(selectedValue);
64
+ if (knownOption)
65
+ return knownOption;
66
+ return {
67
+ value: selectedValue,
68
+ label: selectedValue,
69
+ };
70
+ });
71
+ }, [allKnownOptions, value]);
72
+ const visibleSelectedOptions = React.useMemo(() => selectedOptions.slice(0, maxVisibleChips), [selectedOptions, maxVisibleChips]);
73
+ const hiddenSelectedCount = Math.max(selectedOptions.length - maxVisibleChips, 0);
74
+ const selectedCountText = React.useMemo(() => {
75
+ if (selectedCountFormatter) {
76
+ return selectedCountFormatter(selectedOptions.length);
77
+ }
78
+ if (selectedCountLabel?.trim()) {
79
+ return `${selectedOptions.length} ${selectedCountLabel.trim()}`;
80
+ }
81
+ return `${selectedOptions.length} items selected`;
82
+ }, [selectedCountFormatter, selectedCountLabel, selectedOptions.length]);
12
83
  const filteredOptions = React.useMemo(() => {
13
- const query = search.trim().toLowerCase();
84
+ if (onSearchFunction) {
85
+ if (normalizedSearch.length < minSearchChars) {
86
+ return options.slice(0, maxOptions);
87
+ }
88
+ return remoteOptions.slice(0, maxOptions);
89
+ }
90
+ const query = normalizedSearch.toLowerCase();
14
91
  if (!query)
15
- return options;
16
- return options.filter((option) => option.label.toLowerCase().includes(query));
17
- }, [options, search]);
92
+ return options.slice(0, maxOptions);
93
+ return options
94
+ .filter((option) => option.label.toLowerCase().includes(query))
95
+ .slice(0, maxOptions);
96
+ }, [
97
+ maxOptions,
98
+ minSearchChars,
99
+ normalizedSearch,
100
+ onSearchFunction,
101
+ options,
102
+ remoteOptions,
103
+ ]);
104
+ const shouldShowMinSearchHint = Boolean(onSearchFunction) &&
105
+ normalizedSearch.length > 0 &&
106
+ normalizedSearch.length < minSearchChars;
107
+ const resolvedMinSearchMessage = minSearchMessage ?? `Type at least ${minSearchChars} characters to search`;
18
108
  const toggleValue = React.useCallback((optionValue) => {
19
109
  const nextValue = value.includes(optionValue)
20
110
  ? value.filter((currentValue) => currentValue !== optionValue)
@@ -29,12 +119,14 @@ function MultiSearchSelect({ className, options, value, onValueChange, placehold
29
119
  setOpen(nextOpen);
30
120
  if (!nextOpen)
31
121
  setSearch("");
32
- }, children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", "data-slot": "multi-search-select-trigger", disabled: disabled, className: cn("tw:!flex tw:!w-full tw:!min-h-9 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!shadow-xs tw:!outline-none", "focus-visible:tw:!border-ring focus-visible:tw:!ring-ring/50 focus-visible:tw:!ring-[3px]", "disabled:tw:!cursor-not-allowed disabled:tw:!opacity-50", className), ...props, children: [jsx("div", { className: "tw:!flex tw:!min-w-0 tw:!flex-1 tw:!flex-wrap tw:!items-center tw:!gap-1.5", children: selectedOptions.length === 0 ? (jsx("span", { className: "tw:!text-muted-foreground", children: placeholder })) : (selectedOptions.map((option) => (jsxs(Badge, { variant: "secondary", className: "tw:!max-w-full tw:!pr-1", children: [jsx("span", { className: "tw:!max-w-[140px] tw:!truncate", children: option.label }), jsx("span", { role: "button", tabIndex: -1, "aria-label": `Remove ${option.label}`, onClick: (event) => removeValue(option.value, event), className: "tw:!ml-1 tw:!inline-flex tw:!items-center tw:!justify-center", children: jsx(XIcon, { className: "tw:!size-3" }) })] }, option.value)))) }), jsx(ChevronDownIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!opacity-50" })] }) }), jsx(PopoverPrimitive.Portal, { children: jsxs(PopoverPrimitive.Content, { "data-slot": "multi-search-select-content", align: "start", sideOffset: 4, className: "tw:!z-50 tw:!w-[var(--radix-popover-trigger-width)] tw:!rounded-md tw:!border tw:!bg-popover tw:!text-popover-foreground tw:!shadow-md tw:!outline-none", children: [jsxs("div", { className: "tw:!flex tw:!items-center tw:!gap-2 tw:!border-b tw:!px-3", children: [jsx(SearchIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("input", { type: "text", value: search, onChange: (event) => setSearch(event.target.value), placeholder: searchPlaceholder, className: "tw:!h-9 tw:!w-full tw:!bg-transparent tw:!text-[14px] tw:!outline-none placeholder:tw:!text-muted-foreground" })] }), jsx("div", { className: "tw:!max-h-72 tw:!overflow-y-auto tw:!p-1", children: filteredOptions.length === 0 ? (jsx("div", { className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: emptyMessage })) : (filteredOptions.map((option) => {
33
- const isSelected = value.includes(option.value);
34
- return (jsxs("button", { type: "button", disabled: option.disabled, onClick: () => toggleValue(option.value), className: cn("tw:!flex tw:!w-full tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-left tw:!text-[14px]", "hover:tw:!bg-accent hover:tw:!text-accent-foreground", option.disabled &&
35
- "tw:!cursor-not-allowed tw:!opacity-50 hover:tw:!bg-transparent hover:tw:!text-foreground"), children: [jsx("span", { className: cn("tw:!inline-flex tw:!size-4 tw:!items-center tw:!justify-center tw:!rounded-[4px] tw:!border tw:!border-border", isSelected &&
36
- "tw:!border-primary tw:!bg-primary tw:!text-primary-foreground"), children: isSelected ? jsx(CheckIcon, { className: "tw:!size-3" }) : null }), jsx("span", { className: "tw:!min-w-0 tw:!flex-1 tw:!truncate", children: option.label })] }, option.value));
37
- })) })] }) })] }));
122
+ }, children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", id: triggerId, "data-slot": "multi-search-select-trigger", disabled: disabled, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": listboxId, className: cn("tw:!flex tw:!w-full tw:!min-h-9 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!shadow-xs tw:!outline-none", "focus-visible:tw:!border-ring focus-visible:tw:!ring-ring/50 focus-visible:tw:!ring-[3px]", "disabled:tw:!cursor-not-allowed disabled:tw:!opacity-50", className), ...props, children: [jsx("div", { className: "tw:!flex tw:!min-w-0 tw:!flex-1 tw:!flex-wrap tw:!items-center tw:!gap-1.5", children: selectedOptions.length === 0 ? (jsx("span", { className: "tw:!text-muted-foreground", children: placeholder })) : (jsxs(Fragment, { children: [visibleSelectedOptions.map((option) => (jsxs(Badge, { variant: "secondary", className: "tw:!max-w-full tw:!pr-1", children: [jsx("span", { className: "tw:!max-w-[140px] tw:!truncate", children: option.label }), jsx("button", { type: "button", "aria-label": `Remove ${option.label}`, onClick: (event) => removeValue(option.value, event), className: "tw:!ml-1 tw:!inline-flex tw:!items-center tw:!justify-center", children: jsx(XIcon, { className: "tw:!size-3" }) })] }, option.value))), hiddenSelectedCount > 0 && (jsx("span", { className: "tw:!text-sm tw:!text-muted-foreground tw:!truncate", children: selectedCountText }))] })) }), jsx(ChevronDownIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!opacity-50" })] }) }), jsx(PopoverPrimitive.Portal, { children: jsxs(PopoverPrimitive.Content, { "data-slot": "multi-search-select-content", align: "start", sideOffset: 4, className: "tw:!z-50 tw:!w-[var(--radix-popover-trigger-width)] tw:!rounded-md tw:!border tw:!bg-popover tw:!text-popover-foreground tw:!shadow-md tw:!outline-none", children: [jsxs("div", { className: "tw:!flex tw:!items-center tw:!gap-2 tw:!border-b tw:!px-3", children: [jsx(SearchIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("input", { id: searchInputId, type: "text", value: search, onChange: (event) => setSearch(event.target.value), placeholder: searchPlaceholder, "aria-label": searchPlaceholder, className: "tw:!h-9 tw:!w-full tw:!bg-transparent tw:!text-[14px] tw:!outline-none placeholder:tw:!text-muted-foreground" })] }), jsxs("div", { id: listboxId, role: "listbox", "aria-labelledby": triggerId, "aria-describedby": searchInputId, "aria-multiselectable": "true", className: "tw:!max-h-72 tw:!overflow-y-auto tw:!p-1", children: [shouldShowMinSearchHint ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: resolvedMinSearchMessage })) : null, isSearching ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: "Searching..." })) : null, !isSearching &&
123
+ !shouldShowMinSearchHint &&
124
+ filteredOptions.length === 0 ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: emptyMessage })) : !isSearching ? (filteredOptions.map((option) => {
125
+ const isSelected = value.includes(option.value);
126
+ return (jsxs("button", { type: "button", disabled: option.disabled, role: "option", "aria-selected": isSelected, onClick: () => toggleValue(option.value), className: cn("tw:!flex tw:!w-full tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-left tw:!text-[14px]", "hover:tw:!bg-accent hover:tw:!text-accent-foreground", option.disabled &&
127
+ "tw:!cursor-not-allowed tw:!opacity-50 hover:tw:!bg-transparent hover:tw:!text-foreground"), children: [jsx("span", { className: cn("tw:!inline-flex tw:!size-4 tw:!items-center tw:!justify-center tw:!rounded-[4px] tw:!border tw:!border-border", isSelected &&
128
+ "tw:!border-primary tw:!bg-primary tw:!text-primary-foreground"), children: isSelected ? jsx(CheckIcon, { className: "tw:!size-3" }) : null }), jsx("span", { className: "tw:!min-w-0 tw:!flex-1 tw:!truncate", children: option.label })] }, option.value));
129
+ })) : null] })] }) })] }));
38
130
  }
39
131
 
40
132
  export { MultiSearchSelect };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getgreenline/blaze-ui",
3
- "version": "1.0.45.01-beta",
3
+ "version": "1.0.45.03-beta",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@base-ui/react": "^1.4.1",
@@ -65,8 +65,8 @@
65
65
  "rollup": "^4.60.3",
66
66
  "tailwindcss": "^4.2.4",
67
67
  "typescript": "^6.0.3",
68
- "@workspace/eslint-config": "0.0.0",
69
- "@workspace/typescript-config": "0.0.0"
68
+ "@workspace/typescript-config": "0.0.0",
69
+ "@workspace/eslint-config": "0.0.0"
70
70
  },
71
71
  "main": "./dist/index.js",
72
72
  "module": "./dist/index.js",