Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/ui/smart-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface SmartSelectProps {
debounceMs?: number
/** Additional class for the trigger button */
className?: string
/** Width class for the popover content @default "w-[250px]" */
/** Additional class for the popover content */
contentClassName?: string
/** Custom render function for each option */
renderOption?: (option: SmartSelectOption, isSelected: boolean) => React.ReactNode
Expand Down Expand Up @@ -230,6 +230,7 @@ function SmartSelect({
<CommandItem
key={option.value}
value={option.value}
keywords={[option.label, ...(option.description ? [option.description] : [])]}
disabled={option.disabled}
onSelect={(currentValue) => {
onValueChange?.(currentValue === value ? "" : currentValue)
Expand Down Expand Up @@ -323,7 +324,7 @@ function SmartSelect({
disabled={disabled}
data-slot="smart-select-trigger"
className={cn(
"w-[250px] justify-between border-input text-foreground font-normal",
"w-full justify-between border-input text-foreground font-normal",
invalid &&
"border-destructive ring-destructive/20 ring-[3px] dark:ring-destructive/40",
className
Expand Down Expand Up @@ -368,7 +369,7 @@ function SmartSelect({
className={cn("!w-(--anchor-width) gap-0 p-0", contentClassName)}
align="start"
>
<Command shouldFilter={false}>
<Command shouldFilter={!onSearch}>
{!disableSearch && (
<div className="flex w-full items-center [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:border-b-0 border-b border-border">
<CommandInput
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ export {
type SmartSelectOption,
type SmartSelectProps,
type SmartSelectCreateContext,
// SmartMultiSelect
SmartMultiSelect,
type SmartMultiSelectOption,
type SmartMultiSelectProps,
type SmartMultiSelectRef,
type SmartMultiSelectCreateContext,
// Separator
Separator,
// Slider
Expand Down
Loading