{"version":3,"file":"responsive-select.Bj3lpArU.js","sources":["../../../src/components/ui/icons/filter-icon.tsx","../../../src/components/ui/mobile-select.tsx","../../../src/components/ui/desktop-select.tsx","../../../src/components/ui/responsive-select.tsx"],"sourcesContent":["export default function FilterIcon({ className }: { className?: string }) {\n return (\n \n \n \n \n \n \n \n )\n}\n","import { ChevronDown } from 'lucide-react'\nimport { BottomSheet } from './bottom-sheet'\nimport FilterIcon from './icons/filter-icon'\nimport { cn } from '@lib/utils'\n\ninterface Props {\n open: boolean\n onOpenChange: (open: boolean) => void\n title: string\n options: { value: string; label: string }[]\n selectedValue: string | undefined\n onSelect: (value: string) => void\n scroll?: boolean /** Boolean flag to enable scrolling within the bottom sheet if content exceeds viewport height. */\n filterIcon?: boolean\n triggerClassName?: string\n compact?: boolean\n}\n\n/**\n * MobileSelect component provides a mobile-friendly select interface using a bottom sheet.\n * Ensure `scroll` is set to `true` if the list of options exceeds the viewport height.\n * @param {Props} props - Component props containing open state, callbacks, options, and styling.\n */\nexport const MobileSelect = ({\n open,\n onOpenChange,\n title,\n options,\n selectedValue,\n onSelect,\n scroll,\n triggerClassName,\n compact,\n filterIcon\n}: Props) => {\n const selectedLabel = options.find((option) => option.value === selectedValue)?.label || title\n const rootClassName = compact ? 'select-component-compact' : 'select-component'\n\n return (\n \n \n \n ) : (\n \n {selectedLabel}\n \n \n )\n }\n scroll={scroll}\n >\n \n {options.map((option) => (\n \n {\n onSelect(option.value)\n onOpenChange(false)\n }}\n >\n {option.label}\n \n \n ))}\n \n \n )\n}\n","import {\n SelectValue,\n Select,\n SelectTrigger,\n SelectContent,\n SelectItem\n} from '@components/ui/select'\nimport type { SelectOption } from './responsive-select'\n\ninterface Props {\n options: SelectOption[]\n selectedValue: string | undefined\n onSelect: (value: string) => void\n placeholder?: string\n autoFocus?: boolean\n triggerClassName?: string\n compact?: boolean\n}\nexport const DesktopSelect = ({\n options,\n selectedValue,\n onSelect,\n placeholder = 'Select an option',\n autoFocus = false,\n triggerClassName = '',\n compact = false\n}: Props) => {\n\n return (\n onSelect(value)}>\n \n \n \n \n {options.map((option) => (\n \n {option.label}\n \n ))}\n \n \n )\n}\n","import { MobileSelect } from './mobile-select'\nimport { useState } from 'react'\nimport { DesktopSelect } from './desktop-select'\nimport { useMediaQuery } from './use-media-query'\n\nexport interface SelectOption {\n value: string\n label: string\n}\n\ninterface Props {\n options: SelectOption[]\n selectedValue: string | undefined\n onSelect: (value: string) => void\n placeholder?: string\n scroll?: boolean\n filterIcon?: boolean\n autoFocus?: boolean\n triggerClassName?: string\n isPortalPage?: boolean\n compact?: boolean\n}\n\nexport const ResponsiveSelect = ({\n options,\n selectedValue,\n onSelect,\n placeholder = 'Select an option',\n scroll,\n filterIcon,\n autoFocus,\n triggerClassName,\n isPortalPage,\n compact\n}: Props) => {\n const isDesktop = !!isPortalPage || useMediaQuery('(min-width: 991px)')\n const [openSelect, setOpenSelect] = useState(false)\n\n return isDesktop ? (\n {\n onSelect(value)\n setOpenSelect(false)\n }}\n placeholder={placeholder}\n autoFocus={autoFocus}\n triggerClassName={triggerClassName}\n compact={compact}\n />\n ) : (\n {\n onSelect(value)\n setOpenSelect(false)\n }}\n scroll={scroll}\n filterIcon={filterIcon}\n triggerClassName={triggerClassName}\n compact={compact}\n />\n )\n}\n"],"names":["FilterIcon","className","jsx","jsxs","MobileSelect","open","onOpenChange","title","options","selectedValue","onSelect","scroll","triggerClassName","compact","filterIcon","selectedLabel","option","rootClassName","BottomSheet","ChevronDown","cn","DesktopSelect","placeholder","autoFocus","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","ResponsiveSelect","isPortalPage","isDesktop","useMediaQuery","openSelect","setOpenSelect","useState"],"mappings":"urBAAwB,SAAAA,EAAW,CAAE,UAAAC,GAAsC,CAEvE,OAAAC,EAAA,IAAC,MAAA,CAAI,MAAM,KACT,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAAD,EACA,SAAAE,EAAA,KAAC,IAAE,CAAA,GAA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