@sproutsocial/seeds-react-menu 1.11.1 → 1.11.3

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 +1 @@
1
- {"version":3,"sources":["../../../src/v3/SingleSelect.tsx","../../../src/v3/SeedsPortal.tsx","../../../src/v3/Common/SelectItem.tsx","../../../src/v3/Common/SelectStyles.tsx","../../../src/v3/Common/SelectIcons.tsx","../../../src/v3/MultiSelect.tsx","../../../src/v3/SingleCombobox.tsx","../../../src/v3/Common/ComboboxItem.tsx","../../../src/v3/Common/ComboboxStyles.tsx","../../../src/v3/Common/VirtualizedComboboxList.tsx","../../../src/v3/MultiCombobox.tsx","../../../src/v3/SingleSearchableSelect.tsx","../../../src/v3/MultiSearchableSelect.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport SelectItem from \"./Common/SelectItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport {\n Field,\n SelectTrigger,\n SelectIcon,\n SelectGroup,\n SelectGroupLabel,\n SelectSeparator,\n SelectPositioner,\n SelectPopup,\n} from \"./Common/SelectStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// <Listbox(?!\\.|B)\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst StyledValue = styled(Select.Value)`\n flex: 1;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &[data-placeholder] {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleSelectBaseProps {\n id?: string;\n placeholder?: string;\n includePlaceholderItem?: boolean;\n}\n\ninterface SingleSelectDataProps<T extends DataWithId>\n extends SingleSelectBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n renderSelection?: (item: T) => React.ReactNode;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n children?: never;\n}\n\ninterface SingleSelectChildrenProps extends SingleSelectBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n inputType?: never;\n renderSelection?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\nexport type SingleSelectProps<T extends DataWithId> =\n | SingleSelectDataProps<T>\n | SingleSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function SingleSelect<T extends DataWithId>(\n props: SingleSelectProps<T>\n) {\n const { id, placeholder, includePlaceholderItem } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const data = isChildrenMode ? [] : (props as SingleSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? () => \"\"\n : (props as SingleSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderItem;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as SingleSelectDataProps<T>).inputType ?? \"icon\";\n const renderSelection = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderSelection;\n const groupBy = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleSelectChildrenProps).children\n : undefined;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const items = React.useMemo(() => {\n const dataItems = data.map((item) => ({\n value: String(item.id),\n label: itemToString(item),\n }));\n if (includePlaceholderItem) {\n return [{ value: null, label: placeholder ?? \"\" }, ...dataItems];\n }\n return dataItems;\n }, [data, itemToString, includePlaceholderItem, placeholder]);\n\n const dataWithPlaceholder = includePlaceholderItem\n ? [{ id: null, value: null, label: placeholder ?? \"\" }, ...data]\n : data;\n\n const isControlled = selectedItemId !== undefined;\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultSelectedItemId != null ? String(defaultSelectedItemId) : null\n );\n const value = isControlled\n ? selectedItemId != null\n ? String(selectedItemId)\n : null\n : internalValue;\n\n const selectedItem = React.useMemo(\n () =>\n value != null ? data.find((d) => String(d.id) === value) ?? null : null,\n [data, value]\n );\n\n function handleValueChange(newValue: string | null) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n if (onSelectedItemIdChange) {\n if (newValue == null) {\n onSelectedItemIdChange(null);\n } else {\n const item = data.find((d) => String(d.id) === newValue);\n onSelectedItemIdChange(item ? item.id : null);\n }\n }\n }\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Select.Root\n items={items}\n value={value}\n onValueChange={handleValueChange}\n id={id}\n >\n <SelectTrigger>\n <StyledValue placeholder={placeholder}>\n {renderSelection && selectedItem\n ? renderSelection(selectedItem)\n : undefined}\n </StyledValue>\n <SelectIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SelectIcon>\n </SelectTrigger>\n <Select.Portal container={portalContainer}>\n <SelectPositioner sideOffset={8} alignItemWithTrigger={false}>\n <SelectPopup>\n <Select.ScrollUpArrow />\n <Select.List>\n {children ? (\n children\n ) : groupBy ? (\n groupItems(data, groupBy).map((group, index, arr) => (\n <React.Fragment key={group.value}>\n <SelectGroup>\n <SelectGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </SelectGroupLabel>\n {group.items.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </SelectGroup>\n {index < arr.length - 1 && <SelectSeparator />}\n </React.Fragment>\n ))\n ) : (\n // TODO: need to add a placeholder item when includePlaceholderItem is true\n <>\n {includePlaceholderItem && (\n <SelectItem\n key={\"placeholder\"}\n value={null}\n label={placeholder ?? \"\"}\n />\n )}\n {data.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </>\n )}\n </Select.List>\n <Select.ScrollDownArrow />\n </SelectPopup>\n </SelectPositioner>\n </Select.Portal>\n </Select.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { DisablePortalToBodyContext } from \"@sproutsocial/seeds-react-portal\";\n\n/**\n * Returns the portal container to use for Base UI's Select.Portal /\n * Combobox.Portal. When inside a Modal V2 or Drawer (which set\n * DisablePortalToBodyContext=true), returns a ref'd div rendered inline so\n * the popup stays inside the Radix Dialog's focus/pointer boundary.\n * Otherwise returns undefined, letting Base UI portal to document.body.\n *\n * Usage:\n * const { containerRef, portalContainer } = useSeedsPortalContainer();\n * <div ref={containerRef} style={{ position: \"relative\" }} />\n * <Select.Portal container={portalContainer}>...</Select.Portal>\n */\nexport function useSeedsPortalContainer() {\n const disablePortalToBody = React.useContext(DisablePortalToBodyContext);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [portalContainer, setPortalContainer] = React.useState<\n HTMLElement | undefined\n >(undefined);\n\n React.useEffect(() => {\n if (disablePortalToBody && containerRef.current) {\n // Portal to the Radix Dialog content element so the popup escapes the\n // ModalBody scroll container while staying inside the Dialog boundary\n // (required for Radix focus/pointer-events containment).\n const dialogContent =\n containerRef.current.closest<HTMLElement>(\"[role='dialog']\");\n setPortalContainer(dialogContent ?? containerRef.current);\n }\n }, [disablePortalToBody]);\n\n return { containerRef, portalContainer, disablePortalToBody };\n}\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport Radio from \"@sproutsocial/seeds-react-radio\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nexport const StyledItem = styled(Select.Item)`\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: 14px;\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n\n &[data-selected] {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport const StyledItemIndicator = styled(Select.ItemIndicator)`\n display: flex;\n align-items: center;\n width: 16px;\n color: ${({ theme }) => theme.colors.text.body};\n visibility: hidden;\n\n &[data-selected] {\n visibility: visible;\n }\n`;\n\nexport const StyledItemText = styled(Select.ItemText)``;\n\n// ─── Icons ────────────────────────────────────────────────────────────────────\n\nfunction CheckIcon() {\n return <Icon name=\"check-outline\" fixedWidth aria-hidden />;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\ninterface SelectItemProps {\n value: string | null;\n label: string;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: () => React.ReactNode;\n hidden?: boolean;\n}\n\nexport default function SelectItem({\n value,\n label,\n inputType = \"icon\",\n renderItem,\n hidden,\n}: SelectItemProps) {\n return (\n <StyledItem value={value} style={hidden ? { display: \"none\" } : undefined}>\n {inputType === \"radio\" ? (\n <StyledItemIndicator\n keepMounted\n render={(_props, state) => (\n <Radio\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`radio-${value}`}\n name=\"select-item\"\n />\n )}\n />\n ) : inputType === \"checkbox\" ? (\n <StyledItemIndicator\n keepMounted\n render={(_props, state) => (\n <Checkbox\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`checkbox-${value}`}\n name=\"select-item\"\n />\n )}\n />\n ) : inputType === \"icon\" ? (\n <StyledItemIndicator keepMounted>\n <CheckIcon />\n </StyledItemIndicator>\n ) : null}\n <StyledItemText>{renderItem ? renderItem() : label}</StyledItemText>\n </StyledItem>\n );\n}\n","import { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { focusRing } from \"@sproutsocial/seeds-react-mixins\";\n\nexport const Field = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.space[200]};\n`;\n\nexport const SelectLabel = styled(Select.Label)`\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n`;\n\nexport const SelectTrigger = styled(Select.Trigger)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]}`};\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] {\n ${focusRing}\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n`;\n\nexport const SelectValue = styled(Select.Value)`\n min-width: 0;\n overflow: hidden;\n`;\n\nexport const SelectIcon = styled(Select.Icon)`\n display: flex;\n align-items: center;\n color: ${({ theme }) => theme.colors.icon.base};\n flex-shrink: 0;\n`;\n\nexport const SelectGroup = styled(Select.Group)`\n display: block;\n`;\n\nexport const SelectGroupLabel = styled(Select.GroupLabel)`\n padding: ${({ theme }) =>\n `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n`;\n\nexport const SelectSeparator = styled(Select.Separator)`\n height: 1px;\n margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n background: ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport const SelectPositioner = styled(Select.Positioner)`\n width: var(--anchor-width);\n z-index: 7;\n`;\n\nexport const SelectPopup = styled(Select.Popup)`\n font-family: ${({ theme }) => theme.fontFamily};\n background: ${({ theme }) => theme.colors.container.background.base};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii[500]};\n box-shadow: ${({ theme }) => theme.shadows.low};\n outline: none;\n max-height: min(var(--base-ui-available-height, 400px), 400px);\n overflow-y: auto;\n padding: ${({ theme }) => theme.space[200]};\n\n &[data-open] {\n animation: select-popup-in 120ms ease-out;\n }\n\n &[data-closed] {\n animation: select-popup-out 100ms ease-in;\n }\n\n @keyframes select-popup-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes select-popup-out {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n`;\n","import * as React from \"react\";\nimport styled from \"styled-components\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\n\nexport interface StyledChevronProps {\n $isOpen?: boolean;\n}\n\nexport const StyledChevron = styled.div<StyledChevronProps>`\n display: flex;\n align-items: center;\n transition: transform 0.15s;\n ${({ $isOpen }) => $isOpen && \"transform: rotate(-180deg);\"}\n`;\n\nexport function ChevronIcon() {\n return <Icon name=\"chevron-down-outline\" fixedWidth aria-hidden />;\n}\n\nexport function ClearIcon() {\n return <Icon name=\"circle-x-outline\" fixedWidth aria-hidden size=\"mini\" />;\n}\n\nexport function CheckIcon() {\n return <Icon name=\"check-outline\" fixedWidth aria-hidden />;\n}\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport SelectItem from \"./Common/SelectItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport {\n Field,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectGroup,\n SelectGroupLabel,\n SelectSeparator,\n SelectPositioner,\n SelectPopup,\n} from \"./Common/SelectStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst SelectionText = styled.span`\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\n// The styles in here need cleaned up, but in MultiSearchableSelect are correct\nconst Placeholder = styled.div`\n color: ${({ theme }) => theme.colors.text.subtext};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: 16px;\n padding-top: 2px;\n padding-bottom: 2px;\n margin: 2px 8px 0px 0px;\n`;\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiSelectBaseProps {\n id?: string;\n placeholder?: string;\n}\n\ninterface MultiSelectDataProps<T extends DataWithId>\n extends MultiSelectBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n customRenderSelections?: (item: T) => string;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n maxSelections?: number;\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n removeSelectedItems?: boolean;\n children?: never;\n}\n\ninterface MultiSelectChildrenProps extends MultiSelectBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n customRenderSelections?: never;\n renderSelection?: never;\n inputType?: never;\n maxSelections?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n removeSelectedItems?: never;\n}\n\n/*\n'use client';\nimport * as React from 'react';\nimport { Combobox } from '@base-ui/react/combobox';\n\nexport default function ExampleAsyncMultipleCombobox() {\n const id = React.useId();\n\n const [searchResults, setSearchResults] = React.useState<DirectoryUser[]>([]);\n const [selectedValues, setSelectedValues] = React.useState<DirectoryUser[]>([]);\n const [searchValue, setSearchValue] = React.useState('');\n const [error, setError] = React.useState<string | null>(null);\n const [blockStartStatus, setBlockStartStatus] = React.useState(false);\n\n const [isPending, startTransition] = React.useTransition();\n\n const { contains } = Combobox.useFilter();\n\n const abortControllerRef = React.useRef<AbortController | null>(null);\n const selectedValuesRef = React.useRef<DirectoryUser[]>([]);\n\n const trimmedSearchValue = searchValue.trim();\n\n const items = React.useMemo(() => {\n if (selectedValues.length === 0) {\n return searchResults;\n }\n\n const merged = [...searchResults];\n\n selectedValues.forEach((user) => {\n if (!searchResults.some((result) => result.id === user.id)) {\n merged.push(user);\n }\n });\n\n return merged;\n }, [searchResults, selectedValues]);\n\n function getStatus() {\n if (isPending) {\n return (\n <React.Fragment>\n <span\n aria-hidden\n className=\"inline-block size-3 animate-[spin_0.75s_linear_infinite] rounded-full border border-current border-r-transparent rtl:border-r-current rtl:border-l-transparent\"\n />\n Searching…\n </React.Fragment>\n );\n }\n\n if (error) {\n return error;\n }\n\n if (trimmedSearchValue === '' && !blockStartStatus) {\n return selectedValues.length > 0 ? null : 'Start typing to search people…';\n }\n\n if (searchResults.length === 0 && !blockStartStatus) {\n return `No matches for \"${trimmedSearchValue}\".`;\n }\n\n return null;\n }\n\n function getEmptyMessage() {\n if (trimmedSearchValue === '' || isPending || searchResults.length > 0 || error) {\n return null;\n }\n\n return 'Try a different search term.';\n }\n\n const status = getStatus();\n const emptyMessage = getEmptyMessage();\n\n return (\n <Combobox.Root\n items={items}\n itemToStringLabel={(user: DirectoryUser) => user.name}\n multiple\n filter={null}\n onOpenChangeComplete={(open) => {\n if (!open) {\n setSearchResults(selectedValuesRef.current);\n setBlockStartStatus(false);\n }\n }}\n onValueChange={(nextSelectedValues) => {\n selectedValuesRef.current = nextSelectedValues;\n setSelectedValues(nextSelectedValues);\n setSearchValue('');\n setError(null);\n\n if (nextSelectedValues.length === 0) {\n setSearchResults([]);\n setBlockStartStatus(false);\n } else {\n setBlockStartStatus(true);\n }\n }}\n onInputValueChange={(nextSearchValue, { reason }) => {\n setSearchValue(nextSearchValue);\n\n const controller = new AbortController();\n abortControllerRef.current?.abort();\n abortControllerRef.current = controller;\n\n if (nextSearchValue === '') {\n setSearchResults(selectedValuesRef.current);\n setError(null);\n setBlockStartStatus(false);\n return;\n }\n\n if (reason === 'item-press') {\n return;\n }\n startTransition(async () => {\n setError(null);\n\n const result = await searchUsers(nextSearchValue, contains);\n\n if (controller.signal.aborted) {\n return;\n }\n\n startTransition(() => {\n setSearchResults(result.users);\n setError(result.error);\n });\n });\n }}\n >\n <div className=\"flex flex-col gap-1 text-sm text-gray-900\">\n <label className=\"inline-flex text-inherit font-bold\" htmlFor={id}>\n Assign reviewers\n </label>\n <Combobox.InputGroup className=\"relative flex min-h-10 w-[16rem] cursor-text rounded-md border border-gray-200 bg-[canvas] px-1.5 py-1 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-blue-800 md:w-[20rem]\">\n <Combobox.Chips className=\"flex w-full flex-wrap items-center gap-1\">\n <Combobox.Value>\n {(value: DirectoryUser[]) => (\n <React.Fragment>\n {value.map((user) => (\n <Combobox.Chip\n key={user.id}\n className=\"flex cursor-default items-center gap-1 rounded-md bg-gray-100 py-1 pl-2 pr-1 text-sm text-gray-900 outline-none focus-within:bg-blue-800 focus-within:text-gray-50 [@media(hover:hover)]:[&[data-highlighted]]:bg-blue-800 [@media(hover:hover)]:[&[data-highlighted]]:text-gray-50\"\n aria-label={user.name}\n >\n {user.name}\n <Combobox.ChipRemove\n className=\"inline-flex items-center justify-center rounded-md border-none bg-transparent p-[0.2rem] text-inherit hover:bg-gray-200\"\n aria-label={`Remove ${user.name}`}\n >\n <XIcon />\n </Combobox.ChipRemove>\n </Combobox.Chip>\n ))}\n <Combobox.Input\n id={id}\n placeholder={value.length > 0 ? '' : 'e.g. Michael'}\n className=\"h-8 min-w-24 flex-1 rounded-md border-0 bg-transparent pl-2 text-base font-normal text-gray-900 outline-none placeholder:font-normal\"\n />\n </React.Fragment>\n )}\n </Combobox.Value>\n </Combobox.Chips>\n </Combobox.InputGroup>\n </div>\n\n <Combobox.Portal>\n <Combobox.Positioner className=\"outline-none\" sideOffset={4}>\n <Combobox.Popup\n className=\"box-border w-[var(--anchor-width)] max-h-[min(var(--available-height),23rem)] max-w-[var(--available-width)] origin-[var(--transform-origin)] overflow-y-auto scroll-pb-2 scroll-pt-2 overscroll-contain rounded-md bg-[canvas] py-2 text-gray-900 shadow-[0_10px_15px_-3px_var(--color-gray-200),0_4px_6px_-4px_var(--color-gray-200)] outline outline-1 outline-gray-200 transition-[opacity,transform,scale] duration-100 data-[ending-style]:transition-none data-[starting-style]:scale-95 data-[starting-style]:opacity-0 dark:-outline-offset-1 dark:shadow-none dark:outline-gray-300\"\n aria-busy={isPending || undefined}\n >\n <Combobox.Status>\n {status ? (\n <div className=\"flex items-center gap-2 py-1 pl-4 pr-5 text-sm text-gray-600\">\n {status}\n </div>\n ) : null}\n </Combobox.Status>\n <Combobox.Empty>\n {emptyMessage ? (\n <div className=\"box-border px-4 py-2 text-sm leading-4 text-gray-600\">\n {emptyMessage}\n </div>\n ) : null}\n </Combobox.Empty>\n <Combobox.List>\n {(user: DirectoryUser) => (\n <Combobox.Item\n key={user.id}\n value={user}\n className=\"grid cursor-default select-none grid-cols-[0.75rem_1fr] items-start gap-2 py-2 pl-4 pr-5 text-base leading-[1.2rem] outline-none [@media(hover:hover)]:[&[data-highlighted]]:relative [@media(hover:hover)]:[&[data-highlighted]]:z-0 [@media(hover:hover)]:[&[data-highlighted]]:text-gray-900 [@media(hover:hover)]:[&[data-highlighted]]:before:absolute [@media(hover:hover)]:[&[data-highlighted]]:before:inset-y-0 [@media(hover:hover)]:[&[data-highlighted]]:before:inset-x-2 [@media(hover:hover)]:[&[data-highlighted]]:before:z-[-1] [@media(hover:hover)]:[&[data-highlighted]]:before:rounded [@media(hover:hover)]:[&[data-highlighted]]:before:bg-gray-100 [@media(hover:hover)]:[&[data-highlighted]]:before:content-['']\"\n >\n <Combobox.ItemIndicator className=\"col-start-1 mt-1\">\n <CheckIcon className=\"size-3\" />\n </Combobox.ItemIndicator>\n <span className=\"col-start-2 flex flex-col gap-1\">\n <span className=\"text-[0.95rem] font-bold\">{user.name}</span>\n <span className=\"flex flex-wrap gap-2 text-[0.8125rem] text-gray-600\">\n <span className=\"opacity-80\">@{user.username}</span>\n <span>{user.title}</span>\n </span>\n <span className=\"text-xs text-gray-500\">{user.email}</span>\n </span>\n </Combobox.Item>\n )}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n*/\n\nexport type MultiSelectProps<T extends DataWithId> =\n | MultiSelectDataProps<T>\n | MultiSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function MultiSelect<T extends DataWithId>(\n props: MultiSelectProps<T>\n) {\n const { id, placeholder = \"Select...\" } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode ? [] : (props as MultiSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? () => \"\"\n : (props as MultiSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderItem;\n const customRenderSelections = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).customRenderSelections;\n const maxSelections = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).maxSelections;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderSelection;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiSelectDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiSelectDataProps<T>).inputType ?? \"checkbox\";\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as MultiSelectChildrenProps).children\n : undefined;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n\n const isControlled = selectedItemIds !== undefined;\n\n const [internalValue, setInternalValue] = React.useState<string[]>(\n () => defaultSelectedItemIds?.map(String) ?? []\n );\n\n const value = isControlled ? selectedItemIds!.map(String) : internalValue;\n\n const items = React.useMemo(\n () =>\n data.map((item) => ({\n value: String(item.id),\n label: itemToString(item),\n })),\n [data, itemToString]\n );\n\n const selectedItems = React.useMemo(\n () =>\n value\n .map((v) => data.find((d) => String(d.id) === v))\n .filter((d): d is T => d != null),\n [data, value]\n );\n\n function handleValueChange(newValues: string[]) {\n if (!isControlled) {\n setInternalValue(newValues);\n }\n if (onSelectedItemIdsChange) {\n const ids = newValues.map((v) => {\n const item = data.find((d) => String(d.id) === v);\n return item ? item.id : v;\n });\n onSelectedItemIdsChange(ids as Array<T[\"id\"]>);\n }\n }\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Select.Root\n multiple\n items={items}\n value={value}\n onValueChange={handleValueChange}\n id={id}\n >\n <SelectTrigger>\n <SelectValue>\n {() => {\n if (renderSelection) return renderSelection(selectedItems);\n if (selectedItems.length === 0)\n return <Placeholder>{placeholder}</Placeholder>;\n\n const visibleItems =\n maxSelections != null\n ? selectedItems.slice(0, maxSelections)\n : selectedItems;\n const overflowCount =\n maxSelections != null && selectedItems.length > maxSelections\n ? selectedItems.length - maxSelections\n : 0;\n\n const text = visibleItems\n .map((item) =>\n customRenderSelections\n ? customRenderSelections(item)\n : itemToString(item)\n )\n .join(\", \");\n\n return (\n <SelectionText>\n {text}\n {overflowCount > 0 ? `, +${overflowCount}` : \"\"}\n </SelectionText>\n );\n }}\n </SelectValue>\n <SelectIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SelectIcon>\n </SelectTrigger>\n <Select.Portal container={portalContainer}>\n <SelectPositioner sideOffset={8} alignItemWithTrigger={false}>\n <SelectPopup>\n <Select.ScrollUpArrow />\n <Select.List>\n {children\n ? children\n : groupBy\n ? groupItems(data, groupBy).map((group, index, arr) => (\n <React.Fragment key={group.value}>\n <SelectGroup>\n <SelectGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </SelectGroupLabel>\n {group.items.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n hidden={\n removeSelectedItems &&\n value.includes(String(item.id))\n }\n renderItem={\n renderItem ? () => renderItem(item) : undefined\n }\n />\n ))}\n </SelectGroup>\n {index < arr.length - 1 && <SelectSeparator />}\n </React.Fragment>\n ))\n : data.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n hidden={\n removeSelectedItems && value.includes(String(item.id))\n }\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </Select.List>\n <Select.ScrollDownArrow />\n </SelectPopup>\n </SelectPositioner>\n </Select.Portal>\n </Select.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxInputGroup,\n ComboboxInput,\n ComboboxActionButtons,\n ComboboxClear,\n ComboboxTrigger,\n ComboboxPositioner,\n ComboboxPopup,\n ComboboxList,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleComboboxBaseProps {\n id?: string;\n placeholder?: string;\n emptyText?: string;\n}\n\ninterface SingleComboboxDataBaseProps<T extends DataWithId>\n extends SingleComboboxBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n children?: never;\n}\n\ninterface SingleComboboxDataProps<T extends DataWithId>\n extends SingleComboboxDataBaseProps<T> {\n isVirtualized?: false;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\ninterface SingleComboboxVirtualizedProps<T extends DataWithId>\n extends SingleComboboxDataBaseProps<T> {\n isVirtualized: true;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\ninterface SingleComboboxChildrenProps extends SingleComboboxBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n isVirtualized?: never;\n}\n\nexport type SingleComboboxProps<T extends DataWithId> =\n | SingleComboboxDataProps<T>\n | SingleComboboxVirtualizedProps<T>\n | SingleComboboxChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function SingleCombobox<T extends DataWithId>(\n props: SingleComboboxProps<T>\n) {\n const {\n id,\n placeholder = \"Search...\",\n emptyText = \"No results found.\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n type DataProps =\n | SingleComboboxDataProps<T>\n | SingleComboboxVirtualizedProps<T>;\n\n const data = isChildrenMode ? ([] as T[]) : (props as DataProps).data;\n const itemToString = isChildrenMode\n ? (_item: T | null) => \"\"\n : (props as DataProps).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as DataProps).renderItem;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as DataProps).inputType ?? \"icon\";\n const isVirtualized = isChildrenMode\n ? false\n : (props as DataProps).isVirtualized ?? false;\n const groupBy = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleComboboxDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleComboboxDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleComboboxChildrenProps).children\n : undefined;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemId !== undefined;\n\n const idToItem = React.useCallback(\n (id: T[\"id\"] | null | undefined): T | null => {\n if (id == null) return null;\n return data.find((d) => String(d.id) === String(id)) ?? null;\n },\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T | null>(() =>\n idToItem(defaultSelectedItemId as T[\"id\"] | null)\n );\n\n const value = isControlled\n ? idToItem(selectedItemId as T[\"id\"] | null)\n : internalValue;\n\n function handleValueChange(newItem: T | null) {\n if (!isControlled) {\n setInternalValue(newItem);\n }\n if (onSelectedItemIdChange) {\n onSelectedItemIdChange(newItem ? newItem.id : null);\n }\n }\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(data, groupBy) : null),\n [data, groupBy]\n );\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n id={id}\n value={value}\n onValueChange={handleValueChange}\n itemToStringLabel={itemToString}\n isItemEqualToValue={(a, b) => a != null && b != null && a.id === b.id}\n items={\n isVirtualized ? data : groups ?? (isChildrenMode ? undefined : data)\n }\n virtualized={isVirtualized}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n >\n <ComboboxInputGroup>\n <ComboboxInput placeholder={placeholder} id={id} />\n <ComboboxActionButtons>\n <ComboboxClear aria-label=\"Clear selection\">\n <ClearIcon />\n </ComboboxClear>\n <ComboboxTrigger aria-label=\"Open popup\">\n <StyledChevron $isOpen={open}>\n <ChevronIcon />\n </StyledChevron>\n </ComboboxTrigger>\n </ComboboxActionButtons>\n </ComboboxInputGroup>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <ComboboxPopup\n style={\n isVirtualized\n ? { display: \"flex\", flexDirection: \"column\" }\n : undefined\n }\n >\n <ComboboxEmpty>{emptyText}</ComboboxEmpty>\n <ComboboxList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={data}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </ComboboxList>\n </ComboboxPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport Radio from \"@sproutsocial/seeds-react-radio\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\nimport {\n ComboboxItem as StyledItem,\n ComboboxItemIndicator,\n} from \"./ComboboxStyles\";\nimport { CheckIcon } from \"./SelectIcons\";\n\ninterface ComboboxItemProps<T> {\n value: T;\n itemId: string;\n label: string;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: () => React.ReactNode;\n index?: number;\n \"data-index\"?: number;\n style?: React.CSSProperties;\n}\n\nfunction ComboboxItemInner<T>(\n {\n value,\n itemId,\n label,\n inputType = \"icon\",\n renderItem,\n index,\n \"data-index\": dataIndex,\n style,\n }: ComboboxItemProps<T>,\n ref: React.Ref<HTMLDivElement>\n) {\n return (\n <StyledItem\n value={value}\n index={index}\n data-index={dataIndex}\n style={style}\n ref={ref}\n >\n {inputType === \"radio\" ? (\n <ComboboxItemIndicator\n keepMounted\n render={(_props, state) => (\n <Radio\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`radio-${itemId}`}\n name=\"combobox-item\"\n />\n )}\n />\n ) : inputType === \"checkbox\" ? (\n <ComboboxItemIndicator\n keepMounted\n render={(_props, state) => (\n <Checkbox\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`checkbox-${itemId}`}\n name=\"combobox-item\"\n />\n )}\n />\n ) : inputType === \"icon\" ? (\n <ComboboxItemIndicator keepMounted>\n <CheckIcon />\n </ComboboxItemIndicator>\n ) : null}\n <span>{renderItem ? renderItem() : label}</span>\n </StyledItem>\n );\n}\n\nconst ComboboxItem = React.forwardRef(ComboboxItemInner) as <T>(\n props: ComboboxItemProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => React.ReactElement;\n\nexport default ComboboxItem;\n","import { Combobox } from \"@base-ui/react/combobox\";\nimport styled from \"styled-components\";\nimport { focusRing } from \"@sproutsocial/seeds-react-mixins\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\n\nexport const ComboboxLabel = styled.label`\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n`;\n\nexport const ComboboxInputGroup = styled(Combobox.InputGroup)`\n display: flex;\n align-items: center;\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-within {\n ${focusRing}\n }\n`;\n\nexport const ComboboxInput = styled(Combobox.Input)`\n flex: 1;\n min-width: 30px;\n padding: ${({ theme }) => theme.space[300]};\n border: none;\n background: transparent;\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: ${({ theme }) => theme.typography[200].lineHeight};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\nexport const ComboboxTokenInput = styled(Combobox.Input)`\n flex: 1;\n min-width: 60px;\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]}\n ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};\n border: none;\n background: transparent;\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: ${({ theme }) => theme.typography[200].lineHeight};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\nexport const ComboboxActionButtons = styled.div`\n display: flex;\n align-items: center;\n flex-shrink: 0;\n margin-left: auto;\n gap: ${({ theme }) => theme.space[100]};\n`;\n\nexport const ComboboxClear = styled(Combobox.Clear)`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border: none;\n background: transparent;\n color: ${({ theme }) => theme.colors.icon.base};\n cursor: pointer;\n border-radius: ${({ theme }) => theme.radii[300]};\n padding: 0;\n\n &:hover {\n color: ${({ theme }) => theme.colors.text.body};\n }\n\n &[data-empty] {\n display: none;\n }\n`;\n\nexport const ComboboxTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border: none;\n background: transparent;\n color: ${({ theme }) => theme.colors.icon.base};\n cursor: default;\n padding: 0;\n\n &:hover {\n color: ${({ theme }) => theme.colors.text.body};\n }\n`;\n\nexport const ComboboxPositioner = styled(Combobox.Positioner)`\n width: var(--anchor-width);\n z-index: 7;\n`;\n\nexport const ComboboxPopup = styled(Combobox.Popup)`\n font-family: ${({ theme }) => theme.fontFamily};\n background: ${({ theme }) => theme.colors.container.background.base};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii[500]};\n box-shadow: ${({ theme }) => theme.shadows.medium};\n outline: none;\n width: 100%;\n max-height: min(var(--base-ui-available-height, 400px), 400px);\n overflow-y: auto;\n padding: 0;\n\n &[data-open] {\n animation: combobox-popup-in 120ms ease-out;\n }\n\n &[data-closed] {\n animation: combobox-popup-out 100ms ease-in;\n }\n\n @keyframes combobox-popup-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes combobox-popup-out {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n`;\n\nexport const ComboboxList = styled(Combobox.List)`\n padding: ${({ theme }) => theme.space[200]};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxStatus = styled(Combobox.Status)`\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.subtext};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxEmpty = styled(Combobox.Empty)`\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.subtext};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n\n &[data-selected] {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport const ComboboxItemIndicator = styled(Combobox.ItemIndicator)`\n display: flex;\n align-items: center;\n width: ${({ theme }) => theme.space[400]};\n color: ${({ theme }) => theme.colors.text.body};\n visibility: hidden;\n\n &[data-selected] {\n visibility: visible;\n }\n`;\n\nexport const ComboboxGroup = styled(Combobox.Group)`\n display: block;\n`;\n\nexport const ComboboxGroupLabel = styled(Combobox.GroupLabel)`\n padding: ${({ theme }) =>\n `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n`;\n\nexport const ComboboxSeparator = styled.div`\n height: 1px;\n margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n background: ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport const ComboboxGroupHeaderItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n color: ${({ theme }) => theme.colors.text.body};\n }\n`;\n\nexport const ComboboxSelectAllItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};\n margin-bottom: ${({ theme }) => theme.space[200]};\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n`;\n\nexport function ComboboxGroupHeaderCheckbox({\n $state,\n id,\n}: {\n $state: \"none\" | \"partial\" | \"all\";\n id: string;\n}) {\n return (\n <Checkbox\n id={id}\n checked={$state === \"all\"}\n indeterminate={$state === \"partial\"}\n onChange={() => {}}\n tabIndex={-1}\n />\n );\n}\n\n// Multi-select Token components\nexport const ComboboxToken = styled(Combobox.Chips)`\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n`;\n\nexport const ComboboxTokenInputGroup = styled(Combobox.InputGroup)`\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n padding: ${({ theme }) =>\n `${theme.space[200]} ${theme.space[300]} ${theme.space[200]} ${theme.space[200]}`};\n gap: ${({ theme }) => theme.space[200]};\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-within {\n ${focusRing}\n }\n`;\n\nexport const Token = styled.span`\n display: inline-flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[200]};\n padding: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n background: ${({ theme }) => theme.colors.container.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n line-height: 1;\n white-space: nowrap;\n transition: all ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_inout};\n\n &:hover {\n box-shadow: ${({ theme }) => theme.shadows.low};\n border-color: ${({ theme }) => theme.colors.container.border.base};\n }\n`;\n\nexport const TokenRemove = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n`;\n\n// Searchable select components\n\nexport const SearchableSelectTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n user-select: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n`;\n\nexport const SearchableSelectTriggerIcon = styled(Combobox.Icon)`\n display: flex;\n align-items: center;\n color: ${({ theme }) => theme.colors.icon.base};\n flex-shrink: 0;\n`;\n\nexport const SearchableSelectPlaceholder = styled.span`\n color: ${({ theme }) => theme.colors.text.subtext};\n padding: ${({ theme }) => theme.space[200]} 0;\n`;\n\nexport const SearchableSelectPopup = ComboboxPopup;\n\nexport const SearchableSelectSearchContainer = styled.div`\n padding: ${({ theme }) => theme.space[300]};\n border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};\n flex-shrink: 0;\n`;\n\nexport const SearchableSelectInput = styled(Combobox.Input)`\n width: 100%;\n height: ${({ theme }) => theme.space[500]};\n padding: 0 ${({ theme }) => theme.space[300]};\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n background: ${({ theme }) => theme.colors.container.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n box-sizing: border-box;\n\n &:focus {\n ${focusRing}\n }\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\nexport const SearchableSelectList = styled(Combobox.List)`\n overflow-y: auto;\n padding: ${({ theme }) => theme.space[200]};\n flex: 1;\n min-height: 0;\n &:empty {\n padding: 0;\n }\n`;\n\nexport const SearchableSelectTokenTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]};\n gap: ${({ theme }) => theme.space[200]};\n cursor: default;\n text-align: left;\n outline: none;\n user-select: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] {\n border-color: ${({ theme }) => theme.colors.blue[600]};\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n`;\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport ComboboxItem from \"./ComboboxItem\";\nimport {\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n} from \"./ComboboxStyles\";\nimport type { DataWithId } from \"./types\";\n\nexport const ITEM_HEIGHT = 32;\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nexport function isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\nexport function isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\nexport type FlatSentinelRow<T> = T | GroupHeaderSentinel | SelectAllSentinel;\n\ninterface VirtualizedComboboxListProps<T extends DataWithId> {\n open: boolean;\n virtualizerRef: React.RefObject<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>;\n value: T | T[] | null;\n groups: Array<{ value: string; items: T[] }> | null;\n data: T[];\n itemToString: (item: T) => string;\n inputType: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: (item: T) => React.ReactNode;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\nexport default function VirtualizedComboboxList<T extends DataWithId>({\n open,\n virtualizerRef,\n value,\n groups,\n data,\n itemToString,\n inputType,\n renderItem,\n renderGroupHeading,\n}: VirtualizedComboboxListProps<T>) {\n type Row = FlatSentinelRow<T>;\n\n const filteredItems = Combobox.useFilteredItems<Row>();\n const scrollElementRef = React.useRef<HTMLDivElement | null>(null);\n\n const virtualizer = useVirtualizer({\n enabled: open,\n count: filteredItems.length,\n getScrollElement: () => scrollElementRef.current,\n estimateSize: () => ITEM_HEIGHT,\n overscan: 20,\n paddingStart: 4,\n paddingEnd: 4,\n scrollPaddingStart: 4,\n scrollPaddingEnd: 4,\n });\n\n React.useImperativeHandle(virtualizerRef, () => virtualizer);\n\n const handleScrollRef = React.useCallback(\n (el: HTMLDivElement | null) => {\n scrollElementRef.current = el;\n if (el) virtualizer.measure();\n },\n [virtualizer]\n );\n\n if (!filteredItems.length) return null;\n\n const selectedArray = Array.isArray(value)\n ? value\n : value != null\n ? [value]\n : [];\n\n const totalSize = virtualizer.getTotalSize();\n\n return (\n <div\n role=\"presentation\"\n ref={handleScrollRef}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n overscrollBehavior: \"contain\",\n }}\n >\n <div\n role=\"presentation\"\n style={{ position: \"relative\", width: \"100%\", height: totalSize }}\n >\n {virtualizer.getVirtualItems().map((virtualItem) => {\n const row = filteredItems[virtualItem.index];\n if (!row) return null;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n transform: `translateY(${virtualItem.start}px)`,\n boxSizing: \"border-box\",\n };\n\n if (isSelectAllSentinel(row)) {\n const selectedCount = selectedArray.length;\n const totalCount = data.length;\n const state =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={row}\n style={baseStyle}\n ref={virtualizer.measureElement}\n >\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItems = group?.items ?? [];\n const selectedCount = groupItems.filter((item) =>\n selectedArray.some((s) => s.id === item.id)\n ).length;\n const state =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItems.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={row}\n style={baseStyle}\n ref={virtualizer.measureElement}\n >\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n style={baseStyle}\n ref={virtualizer.measureElement}\n />\n );\n })}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxTokenInputGroup,\n ComboboxTokenInput,\n ComboboxToken,\n ComboboxActionButtons,\n ComboboxClear,\n ComboboxTrigger,\n ComboboxPositioner,\n ComboboxPopup,\n ComboboxList,\n ComboboxEmpty,\n ComboboxStatus,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n Token,\n TokenRemove,\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\n\n// ─── Sentinels ────────────────────────────────────────────────────────────────\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\nfunction makeGroupHeaderSentinel(groupName: string): GroupHeaderSentinel {\n return { __groupHeader: true, groupName };\n}\n\nfunction isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nconst SELECT_ALL_SENTINEL: SelectAllSentinel = { __selectAll: true };\n\nfunction isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiComboboxBaseProps {\n id?: string;\n placeholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n}\n\ninterface MultiComboboxDataProps<T extends DataWithId>\n extends MultiComboboxBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n renderToken?: (item: T) => React.ReactNode;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"checkbox\" | \"none\";\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n selectHeadings?: boolean;\n selectAll?: boolean;\n isVirtualized?: boolean;\n removeSelectedItems?: boolean;\n maxTokens?: number;\n children?: never;\n}\n\ninterface MultiComboboxChildrenProps extends MultiComboboxBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n renderToken?: never;\n renderSelection?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n selectHeadings?: never;\n selectAll?: never;\n removeSelectedItems?: never;\n}\n\nexport type MultiComboboxProps<T extends DataWithId> =\n | MultiComboboxDataProps<T>\n | MultiComboboxChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n// ─── Virtualized list ─────────────────────────────────────────────────────────\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function MultiCombobox<T extends DataWithId>(\n props: MultiComboboxProps<T>\n) {\n const {\n id,\n placeholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode\n ? ([] as T[])\n : (props as MultiComboboxDataProps<T>).data;\n const itemToString = isChildrenMode\n ? (_item: T) => \"\"\n : (props as MultiComboboxDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderItem;\n const renderToken = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderToken;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderSelection;\n const maxTokens = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).maxTokens;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiComboboxDataProps<T>).inputType ?? \"checkbox\";\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderGroupHeading;\n const selectHeadings = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).selectHeadings ?? false;\n const selectAll = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).selectAll ?? false;\n const isVirtualized = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).isVirtualized ?? false;\n const children = isChildrenMode\n ? (props as MultiComboboxChildrenProps).children\n : undefined;\n\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemIds !== undefined;\n\n const idsToItems = React.useCallback(\n (ids: Array<T[\"id\"]>): T[] =>\n ids\n .map((id) => data.find((d) => d.id === id))\n .filter((d): d is T => d != null),\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T[]>(() =>\n defaultSelectedItemIds\n ? idsToItems(defaultSelectedItemIds as Array<T[\"id\"]>)\n : []\n );\n\n const value = isControlled\n ? idsToItems(selectedItemIds as Array<T[\"id\"]>)\n : internalValue;\n\n const visibleData = React.useMemo(\n () =>\n removeSelectedItems\n ? data.filter((item) => !value.some((v) => v.id === item.id))\n : data,\n [data, value, removeSelectedItems]\n );\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(visibleData, groupBy) : null),\n [visibleData, groupBy]\n );\n\n // ─── Sentinel flat list ───────────────────────────────────────────────────\n // Used when selectHeadings or selectAll. selectAll implies selectHeadings —\n // group headers are always selectable when the list is flattened.\n\n type FlatRow = T | GroupHeaderSentinel | SelectAllSentinel;\n\n const flatItems = React.useMemo<FlatRow[] | null>(() => {\n if (!groups || (!selectHeadings && !selectAll)) return null;\n const rows: FlatRow[] = [];\n if (selectAll) rows.push(SELECT_ALL_SENTINEL);\n for (const group of groups) {\n rows.push(makeGroupHeaderSentinel(group.value));\n rows.push(...group.items);\n }\n return rows;\n }, [groups, selectHeadings, selectAll]);\n\n function setSelectedItems(items: T[]) {\n if (!isControlled) setInternalValue(items);\n if (onSelectedItemIdsChange)\n onSelectedItemIdsChange(items.map((item) => item.id));\n }\n\n function handleValueChange(next: FlatRow[]) {\n const selectAllClicked = next.filter(isSelectAllSentinel);\n const groupSentinels = next.filter(isGroupHeaderSentinel);\n const realItems = next.filter(\n (v): v is T => !isGroupHeaderSentinel(v) && !isSelectAllSentinel(v)\n );\n\n if (selectAllClicked.length > 0) {\n const allSelected = data.every((d) =>\n realItems.some((s) => s.id === d.id)\n );\n setSelectedItems(allSelected ? [] : [...data]);\n return;\n }\n\n if (groupSentinels.length === 0) {\n setSelectedItems(realItems);\n return;\n }\n\n let updated = [...realItems];\n for (const sentinel of groupSentinels) {\n const group = groups?.find((g) => g.value === sentinel.groupName);\n if (!group) continue;\n const allSelected = group.items.every((item) =>\n updated.some((s) => s.id === item.id)\n );\n if (allSelected) {\n updated = updated.filter(\n (s) => !group.items.some((item) => item.id === s.id)\n );\n } else {\n const missing = group.items.filter(\n (item) => !updated.some((s) => s.id === item.id)\n );\n updated = [...updated, ...missing];\n }\n }\n setSelectedItems(updated);\n }\n\n function handleSimpleValueChange(newItems: T[]) {\n setSelectedItems(newItems);\n }\n\n function removeItem(item: T, e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n setSelectedItems(value.filter((v) => v.id !== item.id));\n }\n\n // ─── Render sentinel item ─────────────────────────────────────────────────\n\n function renderSentinelRow(row: FlatRow) {\n if (isSelectAllSentinel(row)) {\n const totalCount = data.length;\n const selectedCount = value.length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem key=\"__selectAll\" value={row}>\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItemsList = group?.items ?? [];\n const selectedCount = groupItemsList.filter((item) =>\n value.some((s) => s.id === item.id)\n ).length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItemsList.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem key={`__header-${row.groupName}`} value={row}>\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n />\n );\n }\n\n // ─── Items passed to Combobox.Root ────────────────────────────────────────\n // When selectHeadings: flatItems (flat array of group header sentinels + items).\n // When selectAll only: prepend SELECT_ALL_SENTINEL to data so Base UI tracks\n // it, while Combobox.List still uses the normal grouped render.\n // The sentinel is never in flatItems — it is always rendered manually above\n // Combobox.List, so we must not prepend it when flatItems is used.\n\n const rootItems =\n flatItems ?? groups ?? (isChildrenMode ? undefined : visibleData);\n\n const hasSentinels = selectAll || selectHeadings;\n\n const rootValue = hasSentinels\n ? ([...value] as FlatRow[])\n : (value as unknown as T[]);\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n multiple\n id={id}\n virtualized={isVirtualized}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n value={rootValue}\n onValueChange={\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (hasSentinels ? handleValueChange : handleSimpleValueChange) as any\n }\n itemToStringLabel={(item: FlatRow | null) => {\n if (!item || isGroupHeaderSentinel(item) || isSelectAllSentinel(item))\n return \"\";\n return itemToString(item as T);\n }}\n isItemEqualToValue={(a: FlatRow, b: FlatRow) => {\n if (isGroupHeaderSentinel(a) && isGroupHeaderSentinel(b))\n return a.groupName === b.groupName;\n if (isSelectAllSentinel(a) && isSelectAllSentinel(b)) return true;\n if (\n !isGroupHeaderSentinel(a) &&\n !isSelectAllSentinel(a) &&\n !isGroupHeaderSentinel(b) &&\n !isSelectAllSentinel(b)\n )\n return (a as T).id === (b as T).id;\n return false;\n }}\n items={rootItems}\n >\n <ComboboxTokenInputGroup>\n <ComboboxToken>\n {renderSelection\n ? renderSelection(value)\n : (() => {\n const visibleTokens =\n maxTokens != null ? value.slice(0, maxTokens) : value;\n const overflow =\n maxTokens != null ? value.length - maxTokens : 0;\n return (\n <>\n {visibleTokens.map((item) => (\n <Token key={item.id}>\n {renderToken ? renderToken(item) : itemToString(item)}\n <TokenRemove\n aria-label={`Remove ${itemToString(item)}`}\n onPointerDown={(e) => e.preventDefault()}\n onClick={(e) => removeItem(item, e)}\n >\n <Icon name=\"x-outline\" size=\"mini\" />\n </TokenRemove>\n </Token>\n ))}\n {overflow > 0 && (\n <Token key=\"__overflow\">+{overflow}</Token>\n )}\n </>\n );\n })()}\n <ComboboxTokenInput\n id={id}\n placeholder={value.length > 0 ? \"\" : placeholder}\n />\n <ComboboxActionButtons>\n <ComboboxClear aria-label=\"Clear all\">\n <ClearIcon />\n </ComboboxClear>\n <ComboboxTrigger aria-label=\"Open popup\">\n <StyledChevron $isOpen={open}>\n <ChevronIcon />\n </StyledChevron>\n </ComboboxTrigger>\n </ComboboxActionButtons>\n </ComboboxToken>\n </ComboboxTokenInputGroup>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <ComboboxPopup\n aria-busy={isLoading || undefined}\n style={\n isVirtualized\n ? { display: \"flex\", flexDirection: \"column\" }\n : undefined\n }\n >\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <ComboboxList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={visibleData}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : flatItems ? (\n (row: FlatRow) => renderSentinelRow(row)\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </ComboboxList>\n </ComboboxPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n ComboboxPositioner,\n ComboboxEmpty,\n ComboboxStatus,\n SearchableSelectTrigger,\n SearchableSelectTriggerIcon,\n SearchableSelectPlaceholder,\n SearchableSelectPopup,\n SearchableSelectSearchContainer,\n SearchableSelectInput,\n SearchableSelectList,\n} from \"./Common/ComboboxStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleSearchableSelectBaseProps {\n id?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n}\n\ninterface SingleSearchableSelectDataBaseProps<T extends DataWithId>\n extends SingleSearchableSelectBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n renderSelection?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n children?: never;\n}\n\ninterface SingleSearchableSelectDataProps<T extends DataWithId>\n extends SingleSearchableSelectDataBaseProps<T> {\n isVirtualized?: false;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\ninterface SingleSearchableSelectVirtualizedProps<T extends DataWithId>\n extends SingleSearchableSelectDataBaseProps<T> {\n isVirtualized: true;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\ninterface SingleSearchableSelectChildrenProps\n extends SingleSearchableSelectBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n renderSelection?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n isVirtualized?: never;\n}\n\nexport type SingleSearchableSelectProps<T extends DataWithId> =\n | SingleSearchableSelectDataProps<T>\n | SingleSearchableSelectVirtualizedProps<T>\n | SingleSearchableSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function SingleSearchableSelect<T extends DataWithId>(\n props: SingleSearchableSelectProps<T>\n) {\n const {\n id,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n type DataProps =\n | SingleSearchableSelectDataProps<T>\n | SingleSearchableSelectVirtualizedProps<T>;\n\n const data = isChildrenMode ? ([] as T[]) : (props as DataProps).data;\n const itemToString = isChildrenMode\n ? (_item: T | null) => \"\"\n : (props as DataProps).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as DataProps).renderItem;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as DataProps).renderSelection;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as DataProps).inputType ?? \"icon\";\n const isVirtualized = isChildrenMode\n ? false\n : (props as DataProps).isVirtualized ?? false;\n const groupBy = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleSearchableSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleSearchableSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleSearchableSelectChildrenProps).children\n : undefined;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemId !== undefined;\n\n const idToItem = React.useCallback(\n (id: T[\"id\"] | null | undefined): T | null => {\n if (id == null) return null;\n return data.find((d) => String(d.id) === String(id)) ?? null;\n },\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T | null>(() =>\n idToItem(defaultSelectedItemId as T[\"id\"] | null)\n );\n\n const value = isControlled\n ? idToItem(selectedItemId as T[\"id\"] | null)\n : internalValue;\n\n function handleValueChange(newItem: T | null) {\n if (!isControlled) setInternalValue(newItem);\n if (onSelectedItemIdChange) {\n onSelectedItemIdChange(newItem ? newItem.id : null);\n }\n }\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(data, groupBy) : null),\n [data, groupBy]\n );\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n id={id}\n value={value}\n onValueChange={handleValueChange}\n itemToStringLabel={itemToString}\n isItemEqualToValue={(a, b) => a != null && b != null && a.id === b.id}\n items={\n isVirtualized ? data : groups ?? (isChildrenMode ? undefined : data)\n }\n virtualized={isVirtualized}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n >\n <SearchableSelectTrigger id={id}>\n <SearchableSelectPlaceholder>\n <Combobox.Value placeholder={placeholder}>\n {value\n ? renderSelection\n ? renderSelection(value)\n : itemToString(value)\n : null}\n </Combobox.Value>\n </SearchableSelectPlaceholder>\n <SearchableSelectTriggerIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SearchableSelectTriggerIcon>\n </SearchableSelectTrigger>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <SearchableSelectPopup\n aria-busy={isLoading || undefined}\n style={{ display: \"flex\", flexDirection: \"column\" }}\n >\n <SearchableSelectSearchContainer>\n <SearchableSelectInput\n placeholder={searchPlaceholder}\n autoFocus\n />\n </SearchableSelectSearchContainer>\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <SearchableSelectList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={null}\n data={data}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n />\n ) : children ? (\n children\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : undefined\n }\n />\n )\n )}\n </SearchableSelectList>\n </SearchableSelectPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n ComboboxPositioner,\n ComboboxEmpty,\n ComboboxStatus,\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n SearchableSelectTokenTrigger,\n SearchableSelectPlaceholder,\n SearchableSelectTriggerIcon,\n SearchableSelectPopup,\n SearchableSelectSearchContainer,\n SearchableSelectInput,\n SearchableSelectList,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\nimport styled from \"styled-components\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst SelectionText = styled.span`\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\n// ─── Sentinels ────────────────────────────────────────────────────────────────\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\nfunction makeGroupHeaderSentinel(groupName: string): GroupHeaderSentinel {\n return { __groupHeader: true, groupName };\n}\n\nfunction isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nconst SELECT_ALL_SENTINEL: SelectAllSentinel = { __selectAll: true };\n\nfunction isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiSearchableSelectBaseProps {\n id?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n}\n\ninterface MultiSearchableSelectDataProps<T extends DataWithId>\n extends MultiSearchableSelectBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n customRenderSelections?: (item: T) => string;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"checkbox\" | \"none\";\n maxSelections?: number;\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n selectHeadings?: boolean;\n selectAll?: boolean;\n isVirtualized?: boolean;\n removeSelectedItems?: boolean;\n children?: never;\n}\n\ninterface MultiSearchableSelectChildrenProps\n extends MultiSearchableSelectBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n customRenderSelections?: never;\n renderSelection?: never;\n inputType?: never;\n maxSelections?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n selectHeadings?: never;\n selectAll?: never;\n isVirtualized?: never;\n removeSelectedItems?: never;\n}\n\nexport type MultiSearchableSelectProps<T extends DataWithId> =\n | MultiSearchableSelectDataProps<T>\n | MultiSearchableSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport default function MultiSearchableSelect<T extends DataWithId>(\n props: MultiSearchableSelectProps<T>\n) {\n const {\n id,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode\n ? ([] as T[])\n : (props as MultiSearchableSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? (_item: T) => \"\"\n : (props as MultiSearchableSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderItem;\n const customRenderSelections = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).customRenderSelections;\n const maxSelections = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).maxSelections;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderSelection;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiSearchableSelectDataProps<T>).inputType ?? \"checkbox\";\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderGroupHeading;\n const selectHeadings = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).selectHeadings ?? false;\n const selectAll = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).selectAll ?? false;\n const isVirtualized = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).isVirtualized ?? false;\n const children = isChildrenMode\n ? (props as MultiSearchableSelectChildrenProps).children\n : undefined;\n\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemIds !== undefined;\n\n const idsToItems = React.useCallback(\n (ids: Array<T[\"id\"]>): T[] =>\n ids\n .map((id) => data.find((d) => d.id === id))\n .filter((d): d is T => d != null),\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T[]>(() =>\n defaultSelectedItemIds\n ? idsToItems(defaultSelectedItemIds as Array<T[\"id\"]>)\n : []\n );\n\n const value = isControlled\n ? idsToItems(selectedItemIds as Array<T[\"id\"]>)\n : internalValue;\n\n const visibleData = React.useMemo(\n () =>\n removeSelectedItems\n ? data.filter((item) => !value.some((v) => v.id === item.id))\n : data,\n [data, value, removeSelectedItems]\n );\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(visibleData, groupBy) : null),\n [visibleData, groupBy]\n );\n\n // ─── Sentinel flat list ───────────────────────────────────────────────────\n\n type FlatRow = T | GroupHeaderSentinel | SelectAllSentinel;\n\n const flatItems = React.useMemo<FlatRow[] | null>(() => {\n if (!groups || (!selectHeadings && !selectAll)) return null;\n const rows: FlatRow[] = [];\n if (selectAll) rows.push(SELECT_ALL_SENTINEL);\n for (const group of groups) {\n rows.push(makeGroupHeaderSentinel(group.value));\n rows.push(...group.items);\n }\n return rows;\n }, [groups, selectHeadings, selectAll]);\n\n function setSelectedItems(items: T[]) {\n if (!isControlled) setInternalValue(items);\n if (onSelectedItemIdsChange)\n onSelectedItemIdsChange(items.map((item) => item.id));\n }\n\n function handleValueChange(next: FlatRow[]) {\n const selectAllClicked = next.filter(isSelectAllSentinel);\n const groupSentinels = next.filter(isGroupHeaderSentinel);\n const realItems = next.filter(\n (v): v is T => !isGroupHeaderSentinel(v) && !isSelectAllSentinel(v)\n );\n\n if (selectAllClicked.length > 0) {\n const allSelected = data.every((d) =>\n realItems.some((s) => s.id === d.id)\n );\n setSelectedItems(allSelected ? [] : [...data]);\n return;\n }\n\n if (groupSentinels.length === 0) {\n setSelectedItems(realItems);\n return;\n }\n\n let updated = [...realItems];\n for (const sentinel of groupSentinels) {\n const group = groups?.find((g) => g.value === sentinel.groupName);\n if (!group) continue;\n const allSelected = group.items.every((item) =>\n updated.some((s) => s.id === item.id)\n );\n if (allSelected) {\n updated = updated.filter(\n (s) => !group.items.some((item) => item.id === s.id)\n );\n } else {\n const missing = group.items.filter(\n (item) => !updated.some((s) => s.id === item.id)\n );\n updated = [...updated, ...missing];\n }\n }\n setSelectedItems(updated);\n }\n\n function handleSimpleValueChange(newItems: T[]) {\n setSelectedItems(newItems);\n }\n\n // ─── Render sentinel row ──────────────────────────────────────────────────\n\n function renderSentinelRow(row: FlatRow) {\n if (isSelectAllSentinel(row)) {\n const totalCount = data.length;\n const selectedCount = value.length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem key=\"__selectAll\" value={row}>\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItemsList = group?.items ?? [];\n const selectedCount = groupItemsList.filter((item) =>\n value.some((s) => s.id === item.id)\n ).length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItemsList.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem key={`__header-${row.groupName}`} value={row}>\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n />\n );\n }\n\n const rootItems =\n flatItems ?? groups ?? (isChildrenMode ? undefined : visibleData);\n const hasSentinels = selectAll || selectHeadings;\n const rootValue = hasSentinels\n ? ([...value] as FlatRow[])\n : (value as unknown as T[]);\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n multiple\n id={id}\n virtualized={isVirtualized}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n value={rootValue}\n onValueChange={\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (hasSentinels ? handleValueChange : handleSimpleValueChange) as any\n }\n itemToStringLabel={(item: FlatRow | null) => {\n if (!item || isGroupHeaderSentinel(item) || isSelectAllSentinel(item))\n return \"\";\n return itemToString(item as T);\n }}\n isItemEqualToValue={(a: FlatRow, b: FlatRow) => {\n if (isGroupHeaderSentinel(a) && isGroupHeaderSentinel(b))\n return a.groupName === b.groupName;\n if (isSelectAllSentinel(a) && isSelectAllSentinel(b)) return true;\n if (\n !isGroupHeaderSentinel(a) &&\n !isSelectAllSentinel(a) &&\n !isGroupHeaderSentinel(b) &&\n !isSelectAllSentinel(b)\n )\n return (a as T).id === (b as T).id;\n return false;\n }}\n items={rootItems}\n >\n <SearchableSelectTokenTrigger id={id}>\n {renderSelection ? (\n renderSelection(value)\n ) : value.length > 0 ? (\n (() => {\n const visibleItems =\n maxSelections != null ? value.slice(0, maxSelections) : value;\n const overflowCount =\n maxSelections != null && value.length > maxSelections\n ? value.length - maxSelections\n : 0;\n const text = visibleItems\n .map((item) =>\n customRenderSelections\n ? customRenderSelections(item)\n : itemToString(item)\n )\n .join(\", \");\n return (\n <SelectionText>\n {text}\n {overflowCount > 0 ? `, +${overflowCount}` : \"\"}\n </SelectionText>\n );\n })()\n ) : (\n <SearchableSelectPlaceholder>\n {placeholder}\n </SearchableSelectPlaceholder>\n )}\n <SearchableSelectTriggerIcon style={{ marginLeft: \"auto\" }}>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SearchableSelectTriggerIcon>\n </SearchableSelectTokenTrigger>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <SearchableSelectPopup\n aria-busy={isLoading || undefined}\n style={{ display: \"flex\", flexDirection: \"column\" }}\n >\n <SearchableSelectSearchContainer>\n <SearchableSelectInput\n placeholder={searchPlaceholder}\n autoFocus\n />\n </SearchableSelectSearchContainer>\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <SearchableSelectList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={visibleData}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : flatItems ? (\n (row: FlatRow) => renderSentinelRow(row)\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </SearchableSelectList>\n </SearchableSelectPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,SAAS,UAAAC,eAAc;AACvB,OAAOC,aAAY;;;ACFnB,YAAY,WAAW;AACvB,SAAS,kCAAkC;;;ACD3C,OAAuB;AACvB,SAAS,cAAc;AACvB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,SAAS,YAAY;AA8CZ,c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,EAC3C;AAEJ;AAEA,IAAMI,gBAAqB,kBAAW,iBAAiB;;;AE7EvD,YAAYC,YAAW;AACvB,SAAS,YAAAC,iBAAgB;AACzB,SAAS,sBAAsB;AAkIjB,SAQE,OAAAC,MARF,QAAAC,aAAA;;;AHkCR,gBAAAC,MAoCI,QAAAC,aApCJ;;;AItKN,YAAYC,YAAW;AACvB,SAAS,YAAAC,iBAAgB;AACzB,OAA+B;AA6B/B,OAAOC,WAAU;AAkRT,SA+HY,YAAAC,WA9HV,OAAAC,MADF,QAAAC,aAAA;;;ACjTR,YAAYC,aAAW;AACvB,SAAS,YAAAC,iBAAgB;AACzB,OAA+B;AA+KzB,gBAAAC,OAkCE,QAAAC,aAlCF;;;ACjLN,YAAYC,aAAW;AACvB,SAAS,YAAAC,iBAAgB;AACzB,OAA+B;AA0B/B,OAAOC,aAAY;AAoRX,SACE,OAAAC,OADF,QAAAC,aAAA;AAhRR,IAAMC,iBAAgBH,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;","names":["React","Select","styled","Select","styled","styled","Icon","jsx","jsx","Icon","Fragment","jsx","jsxs","styled","Select","React","Select","styled","jsx","jsxs","styled","React","Combobox","React","Radio","Checkbox","styled","focusRing","Checkbox","jsx","jsx","jsxs","Radio","Checkbox","ComboboxItem","React","Combobox","jsx","jsxs","jsx","jsxs","React","Combobox","Icon","Fragment","jsx","jsxs","React","Combobox","jsx","jsxs","React","Combobox","styled","jsx","jsxs","SelectionText"]}
1
+ {"version":3,"sources":["../../../src/v3/SingleSelect.tsx","../../../src/v3/SeedsPortal.tsx","../../../src/v3/Common/SelectItem.tsx","../../../src/v3/Common/groupItems.ts","../../../src/v3/Common/SelectStyles.tsx","../../../src/v3/Common/SelectIcons.tsx","../../../src/v3/MultiSelect.tsx","../../../src/v3/SingleCombobox.tsx","../../../src/v3/Common/ComboboxItem.tsx","../../../src/v3/Common/ComboboxStyles.tsx","../../../src/v3/Common/VirtualizedComboboxList.tsx","../../../src/v3/MultiCombobox.tsx","../../../src/v3/SingleSearchableSelect.tsx","../../../src/v3/MultiSearchableSelect.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport SelectItem from \"./Common/SelectItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport {\n Field,\n SelectTrigger,\n SelectIcon,\n SelectGroup,\n SelectGroupLabel,\n SelectSeparator,\n SelectPositioner,\n SelectPopup,\n} from \"./Common/SelectStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// <Listbox(?!\\.|B)\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst StyledValue = styled(Select.Value)`\n flex: 1;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &[data-placeholder] {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleSelectBaseProps {\n id?: string;\n placeholder?: string;\n includePlaceholderItem?: boolean;\n disabled?: boolean;\n}\n\ninterface SingleSelectDataProps<T extends DataWithId>\n extends SingleSelectBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n renderSelection?: (item: T) => React.ReactNode;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n children?: never;\n}\n\ninterface SingleSelectChildrenProps extends SingleSelectBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n inputType?: never;\n renderSelection?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\nexport type SingleSelectProps<T extends DataWithId> =\n | SingleSelectDataProps<T>\n | SingleSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function SingleSelect<T extends DataWithId>(\n props: SingleSelectProps<T>\n) {\n const { id, placeholder, includePlaceholderItem } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const data = isChildrenMode ? [] : (props as SingleSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? () => \"\"\n : (props as SingleSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderItem;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as SingleSelectDataProps<T>).inputType ?? \"icon\";\n const renderSelection = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderSelection;\n const groupBy = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as SingleSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleSelectChildrenProps).children\n : undefined;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const items = React.useMemo(() => {\n const dataItems = data.map((item) => ({\n value: String(item.id),\n label: itemToString(item),\n }));\n if (includePlaceholderItem) {\n return [{ value: null, label: placeholder ?? \"\" }, ...dataItems];\n }\n return dataItems;\n }, [data, itemToString, includePlaceholderItem, placeholder]);\n\n const dataWithPlaceholder = includePlaceholderItem\n ? [{ id: null, value: null, label: placeholder ?? \"\" }, ...data]\n : data;\n\n const isControlled = selectedItemId !== undefined;\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultSelectedItemId != null ? String(defaultSelectedItemId) : null\n );\n const value = isControlled\n ? selectedItemId != null\n ? String(selectedItemId)\n : null\n : internalValue;\n\n const selectedItem = React.useMemo(\n () =>\n value != null ? data.find((d) => String(d.id) === value) ?? null : null,\n [data, value]\n );\n\n function handleValueChange(newValue: string | null) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n if (onSelectedItemIdChange) {\n if (newValue == null) {\n onSelectedItemIdChange(null);\n } else {\n const item = data.find((d) => String(d.id) === newValue);\n onSelectedItemIdChange(item ? item.id : null);\n }\n }\n }\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Select.Root\n items={items}\n value={value}\n disabled={props.disabled}\n onValueChange={handleValueChange}\n id={id}\n >\n <SelectTrigger>\n <StyledValue placeholder={placeholder}>\n {renderSelection && selectedItem\n ? renderSelection(selectedItem)\n : undefined}\n </StyledValue>\n <SelectIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SelectIcon>\n </SelectTrigger>\n <Select.Portal container={portalContainer}>\n <SelectPositioner sideOffset={8} alignItemWithTrigger={false}>\n <SelectPopup>\n <Select.ScrollUpArrow />\n <Select.List>\n {children ? (\n children\n ) : groupBy ? (\n groupItems(data, groupBy).map((group, index, arr) => (\n <React.Fragment key={group.value}>\n <SelectGroup>\n <SelectGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </SelectGroupLabel>\n {group.items.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </SelectGroup>\n {index < arr.length - 1 && <SelectSeparator />}\n </React.Fragment>\n ))\n ) : (\n <>\n {includePlaceholderItem && (\n <SelectItem\n key={\"placeholder\"}\n value={null}\n label={placeholder ?? \"\"}\n />\n )}\n {data.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </>\n )}\n </Select.List>\n <Select.ScrollDownArrow />\n </SelectPopup>\n </SelectPositioner>\n </Select.Portal>\n </Select.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { DisablePortalToBodyContext } from \"@sproutsocial/seeds-react-portal\";\n\n/**\n * Returns the portal container to use for Base UI's Select.Portal /\n * Combobox.Portal. When inside a Modal V2 or Drawer (which set\n * DisablePortalToBodyContext=true), returns a ref'd div rendered inline so\n * the popup stays inside the Radix Dialog's focus/pointer boundary.\n * Otherwise returns undefined, letting Base UI portal to document.body.\n *\n * Usage:\n * const { containerRef, portalContainer } = useSeedsPortalContainer();\n * <div ref={containerRef} style={{ position: \"relative\" }} />\n * <Select.Portal container={portalContainer}>...</Select.Portal>\n */\nexport function useSeedsPortalContainer() {\n const disablePortalToBody = React.useContext(DisablePortalToBodyContext);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [portalContainer, setPortalContainer] = React.useState<\n HTMLElement | undefined\n >(undefined);\n\n React.useEffect(() => {\n if (disablePortalToBody && containerRef.current) {\n // Portal to the Radix Dialog content element so the popup escapes the\n // ModalBody scroll container while staying inside the Dialog boundary\n // (required for Radix focus/pointer-events containment).\n const dialogContent =\n containerRef.current.closest<HTMLElement>(\"[role='dialog']\");\n setPortalContainer(dialogContent ?? containerRef.current);\n }\n }, [disablePortalToBody]);\n\n return { containerRef, portalContainer, disablePortalToBody };\n}\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport Radio from \"@sproutsocial/seeds-react-radio\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nexport const StyledItem = styled(Select.Item)`\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: 14px;\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n\n &[data-selected] {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport const StyledItemIndicator = styled(Select.ItemIndicator)`\n display: flex;\n align-items: center;\n width: 16px;\n color: ${({ theme }) => theme.colors.text.body};\n visibility: hidden;\n\n &[data-selected] {\n visibility: visible;\n }\n`;\n\nexport const StyledItemText = styled(Select.ItemText)``;\n\n// ─── Icons ────────────────────────────────────────────────────────────────────\n\nfunction CheckIcon() {\n return <Icon name=\"check-outline\" fixedWidth aria-hidden />;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\ninterface SelectItemProps {\n value: string | null;\n label: string;\n disabled?: boolean;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: () => React.ReactNode;\n hidden?: boolean;\n}\n\nexport default function SelectItem({\n value,\n label,\n disabled,\n inputType = \"icon\",\n renderItem,\n hidden,\n}: SelectItemProps) {\n return (\n <StyledItem\n value={value}\n disabled={disabled}\n style={hidden ? { display: \"none\" } : undefined}\n data-qa-menu-item={label}\n >\n {inputType === \"radio\" ? (\n <StyledItemIndicator\n keepMounted\n render={(_props, state) => (\n <Radio\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`radio-${value}`}\n name=\"select-item\"\n />\n )}\n />\n ) : inputType === \"checkbox\" ? (\n <StyledItemIndicator\n keepMounted\n render={(_props, state) => (\n <Checkbox\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`checkbox-${value}`}\n name=\"select-item\"\n />\n )}\n />\n ) : inputType === \"icon\" ? (\n <StyledItemIndicator keepMounted>\n <CheckIcon />\n </StyledItemIndicator>\n ) : null}\n <StyledItemText>{renderItem ? renderItem() : label}</StyledItemText>\n </StyledItem>\n );\n}\n","export function groupItems<T>(\n data: T[],\n groupBy: (item: T) => string\n): Array<{ value: string; items: T[] }> {\n const map = new Map<string, T[]>();\n for (const item of data) {\n const key = groupBy(item);\n if (!map.has(key)) map.set(key, []);\n map.get(key)!.push(item);\n }\n return Array.from(map.entries()).map(([value, items]) => ({ value, items }));\n}\n","import { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { focusRing } from \"@sproutsocial/seeds-react-mixins\";\n\nexport const Field = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.space[200]};\n`;\n\nexport const SelectLabel = styled(Select.Label)`\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n`;\n\nexport const SelectTrigger = styled(Select.Trigger)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]}`};\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] {\n ${focusRing}\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n\n &[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n }\n`;\n\nexport const SelectValue = styled(Select.Value)`\n min-width: 0;\n overflow: hidden;\n`;\n\nexport const SelectIcon = styled(Select.Icon)`\n display: flex;\n align-items: center;\n color: ${({ theme }) => theme.colors.icon.base};\n flex-shrink: 0;\n`;\n\nexport const SelectGroup = styled(Select.Group)`\n display: block;\n`;\n\nexport const SelectGroupLabel = styled(Select.GroupLabel)`\n padding: ${({ theme }) =>\n `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n`;\n\nexport const SelectSeparator = styled(Select.Separator)`\n height: 1px;\n margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n background: ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport const SelectPositioner = styled(Select.Positioner)`\n width: var(--anchor-width);\n z-index: 7;\n`;\n\nexport const SelectPopup = styled(Select.Popup)`\n font-family: ${({ theme }) => theme.fontFamily};\n background: ${({ theme }) => theme.colors.container.background.base};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii[500]};\n box-shadow: ${({ theme }) => theme.shadows.low};\n outline: none;\n max-height: min(var(--base-ui-available-height, 400px), 400px);\n overflow-y: auto;\n padding: ${({ theme }) => theme.space[200]};\n\n &[data-open] {\n animation: select-popup-in 120ms ease-out;\n }\n\n &[data-closed] {\n animation: select-popup-out 100ms ease-in;\n }\n\n @keyframes select-popup-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes select-popup-out {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n`;\n","import * as React from \"react\";\nimport styled from \"styled-components\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\n\nexport interface StyledChevronProps {\n $isOpen?: boolean;\n}\n\nexport const StyledChevron = styled.div<StyledChevronProps>`\n display: flex;\n align-items: center;\n transition: transform 0.15s;\n ${({ $isOpen }) => $isOpen && \"transform: rotate(-180deg);\"}\n`;\n\nexport function ChevronIcon() {\n return <Icon name=\"chevron-down-outline\" fixedWidth aria-hidden />;\n}\n\nexport function ClearIcon() {\n return <Icon name=\"circle-x-outline\" fixedWidth aria-hidden size=\"mini\" />;\n}\n\nexport function CheckIcon() {\n return <Icon name=\"check-outline\" fixedWidth aria-hidden />;\n}\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport styled from \"styled-components\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport SelectItem from \"./Common/SelectItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport {\n Field,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectGroup,\n SelectGroupLabel,\n SelectSeparator,\n SelectPositioner,\n SelectPopup,\n} from \"./Common/SelectStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst SelectionText = styled.span`\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\n// The styles in here need cleaned up, but in MultiSearchableSelect are correct\nconst Placeholder = styled.div`\n color: ${({ theme }) => theme.colors.text.subtext};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: 16px;\n padding-top: 2px;\n padding-bottom: 2px;\n margin: 2px 8px 0px 0px;\n`;\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiSelectBaseProps {\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\ninterface MultiSelectDataProps<T extends DataWithId>\n extends MultiSelectBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n customRenderSelections?: (item: T) => string;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n maxSelections?: number;\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n removeSelectedItems?: boolean;\n children?: never;\n}\n\ninterface MultiSelectChildrenProps extends MultiSelectBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n customRenderSelections?: never;\n renderSelection?: never;\n inputType?: never;\n maxSelections?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n removeSelectedItems?: never;\n}\n\nexport type MultiSelectProps<T extends DataWithId> =\n | MultiSelectDataProps<T>\n | MultiSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function MultiSelect<T extends DataWithId>(props: MultiSelectProps<T>) {\n const { id, placeholder = \"Select...\" } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode ? [] : (props as MultiSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? () => \"\"\n : (props as MultiSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderItem;\n const customRenderSelections = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).customRenderSelections;\n const maxSelections = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).maxSelections;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderSelection;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiSelectDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiSelectDataProps<T>).inputType ?? \"checkbox\";\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as MultiSelectChildrenProps).children\n : undefined;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n\n const isControlled = selectedItemIds !== undefined;\n\n const [internalValue, setInternalValue] = React.useState<string[]>(\n () => defaultSelectedItemIds?.map(String) ?? []\n );\n\n const value = isControlled ? selectedItemIds!.map(String) : internalValue;\n\n const items = React.useMemo(\n () =>\n data.map((item) => ({\n value: String(item.id),\n label: itemToString(item),\n })),\n [data, itemToString]\n );\n\n const selectedItems = React.useMemo(\n () =>\n value\n .map((v) => data.find((d) => String(d.id) === v))\n .filter((d): d is T => d != null),\n [data, value]\n );\n\n function handleValueChange(newValues: string[]) {\n if (!isControlled) {\n setInternalValue(newValues);\n }\n if (onSelectedItemIdsChange) {\n const ids = newValues.map((v) => {\n const item = data.find((d) => String(d.id) === v);\n return item ? item.id : v;\n });\n onSelectedItemIdsChange(ids as Array<T[\"id\"]>);\n }\n }\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Select.Root\n multiple\n items={items}\n value={value}\n onValueChange={handleValueChange}\n disabled={props.disabled}\n id={id}\n >\n <SelectTrigger>\n <SelectValue>\n {() => {\n if (renderSelection) return renderSelection(selectedItems);\n if (selectedItems.length === 0)\n return <Placeholder>{placeholder}</Placeholder>;\n\n const visibleItems =\n maxSelections != null\n ? selectedItems.slice(0, maxSelections)\n : selectedItems;\n const overflowCount =\n maxSelections != null && selectedItems.length > maxSelections\n ? selectedItems.length - maxSelections\n : 0;\n\n const text = visibleItems\n .map((item) =>\n customRenderSelections\n ? customRenderSelections(item)\n : itemToString(item)\n )\n .join(\", \");\n\n return (\n <SelectionText>\n {text}\n {overflowCount > 0 ? `, +${overflowCount}` : \"\"}\n </SelectionText>\n );\n }}\n </SelectValue>\n <SelectIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SelectIcon>\n </SelectTrigger>\n <Select.Portal container={portalContainer}>\n <SelectPositioner sideOffset={8} alignItemWithTrigger={false}>\n <SelectPopup>\n <Select.ScrollUpArrow />\n <Select.List>\n {children\n ? children\n : groupBy\n ? groupItems(data, groupBy).map((group, index, arr) => (\n <React.Fragment key={group.value}>\n <SelectGroup>\n <SelectGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </SelectGroupLabel>\n {group.items.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n hidden={\n removeSelectedItems &&\n value.includes(String(item.id))\n }\n renderItem={\n renderItem ? () => renderItem(item) : undefined\n }\n />\n ))}\n </SelectGroup>\n {index < arr.length - 1 && <SelectSeparator />}\n </React.Fragment>\n ))\n : data.map((item) => (\n <SelectItem\n key={item.id}\n value={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n hidden={\n removeSelectedItems && value.includes(String(item.id))\n }\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n ))}\n </Select.List>\n <Select.ScrollDownArrow />\n </SelectPopup>\n </SelectPositioner>\n </Select.Portal>\n </Select.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxInputGroup,\n ComboboxInput,\n ComboboxActionButtons,\n ComboboxClear,\n ComboboxTrigger,\n ComboboxPositioner,\n ComboboxPopup,\n ComboboxList,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleComboboxBaseProps {\n id?: string;\n placeholder?: string;\n emptyText?: string;\n disabled?: boolean;\n}\n\ninterface SingleComboboxDataBaseProps<T extends DataWithId>\n extends SingleComboboxBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n children?: never;\n}\n\ninterface SingleComboboxDataProps<T extends DataWithId>\n extends SingleComboboxDataBaseProps<T> {\n isVirtualized?: false;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\ninterface SingleComboboxVirtualizedProps<T extends DataWithId>\n extends SingleComboboxDataBaseProps<T> {\n isVirtualized: true;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\ninterface SingleComboboxChildrenProps extends SingleComboboxBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n isVirtualized?: never;\n}\n\nexport type SingleComboboxProps<T extends DataWithId> =\n | SingleComboboxDataProps<T>\n | SingleComboboxVirtualizedProps<T>\n | SingleComboboxChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function SingleCombobox<T extends DataWithId>(\n props: SingleComboboxProps<T>\n) {\n const {\n id,\n placeholder = \"Search...\",\n emptyText = \"No results found.\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n type DataProps =\n | SingleComboboxDataProps<T>\n | SingleComboboxVirtualizedProps<T>;\n\n const data = isChildrenMode ? ([] as T[]) : (props as DataProps).data;\n const itemToString = isChildrenMode\n ? (_item: T | null) => \"\"\n : (props as DataProps).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as DataProps).renderItem;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as DataProps).inputType ?? \"icon\";\n const isVirtualized = isChildrenMode\n ? false\n : (props as DataProps).isVirtualized ?? false;\n const groupBy = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleComboboxDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleComboboxDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleComboboxChildrenProps).children\n : undefined;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemId !== undefined;\n\n const idToItem = React.useCallback(\n (id: T[\"id\"] | null | undefined): T | null => {\n if (id == null) return null;\n return data.find((d) => String(d.id) === String(id)) ?? null;\n },\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T | null>(() =>\n idToItem(defaultSelectedItemId as T[\"id\"] | null)\n );\n\n const value = isControlled\n ? idToItem(selectedItemId as T[\"id\"] | null)\n : internalValue;\n\n function handleValueChange(newItem: T | null) {\n if (!isControlled) {\n setInternalValue(newItem);\n }\n if (onSelectedItemIdChange) {\n onSelectedItemIdChange(newItem ? newItem.id : null);\n }\n }\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(data, groupBy) : null),\n [data, groupBy]\n );\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n id={id}\n value={value}\n onValueChange={handleValueChange}\n itemToStringLabel={itemToString}\n isItemEqualToValue={(a, b) => a != null && b != null && a.id === b.id}\n items={\n isVirtualized ? data : groups ?? (isChildrenMode ? undefined : data)\n }\n virtualized={isVirtualized}\n disabled={props.disabled}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n >\n <ComboboxInputGroup>\n <ComboboxInput placeholder={placeholder} id={id} />\n <ComboboxActionButtons>\n <ComboboxClear aria-label=\"Clear selection\">\n <ClearIcon />\n </ComboboxClear>\n <ComboboxTrigger aria-label=\"Open popup\">\n <StyledChevron $isOpen={open}>\n <ChevronIcon />\n </StyledChevron>\n </ComboboxTrigger>\n </ComboboxActionButtons>\n </ComboboxInputGroup>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <ComboboxPopup\n style={\n isVirtualized\n ? { display: \"flex\", flexDirection: \"column\" }\n : undefined\n }\n >\n <ComboboxEmpty>{emptyText}</ComboboxEmpty>\n <ComboboxList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={data}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </ComboboxList>\n </ComboboxPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport Radio from \"@sproutsocial/seeds-react-radio\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\nimport {\n ComboboxItem as StyledItem,\n ComboboxItemIndicator,\n} from \"./ComboboxStyles\";\nimport { CheckIcon } from \"./SelectIcons\";\n\ninterface ComboboxItemProps<T> {\n value: T;\n itemId: string;\n label: string;\n disabled?: boolean;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: () => React.ReactNode;\n index?: number;\n \"data-index\"?: number;\n style?: React.CSSProperties;\n}\n\nfunction ComboboxItemInner<T>(\n {\n value,\n itemId,\n label,\n disabled,\n inputType = \"icon\",\n renderItem,\n index,\n \"data-index\": dataIndex,\n style,\n }: ComboboxItemProps<T>,\n ref: React.Ref<HTMLDivElement>\n) {\n return (\n <StyledItem\n value={value}\n index={index}\n data-index={dataIndex}\n style={style}\n ref={ref}\n disabled={disabled}\n data-qa-menu-item={label}\n >\n {inputType === \"radio\" ? (\n <ComboboxItemIndicator\n keepMounted\n render={(_props, state) => (\n <Radio\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`radio-${itemId}`}\n name=\"combobox-item\"\n />\n )}\n />\n ) : inputType === \"checkbox\" ? (\n <ComboboxItemIndicator\n keepMounted\n render={(_props, state) => (\n <Checkbox\n checked={state.selected}\n onChange={() => {}}\n tabIndex={-1}\n id={`checkbox-${itemId}`}\n name=\"combobox-item\"\n />\n )}\n />\n ) : inputType === \"icon\" ? (\n <ComboboxItemIndicator keepMounted>\n <CheckIcon />\n </ComboboxItemIndicator>\n ) : null}\n <span>{renderItem ? renderItem() : label}</span>\n </StyledItem>\n );\n}\n\nconst ComboboxItem = React.forwardRef(ComboboxItemInner) as <T>(\n props: ComboboxItemProps<T> & { ref?: React.Ref<HTMLDivElement> }\n) => React.ReactElement;\n\nexport default ComboboxItem;\n","import { Combobox } from \"@base-ui/react/combobox\";\nimport styled from \"styled-components\";\nimport { focusRing } from \"@sproutsocial/seeds-react-mixins\";\nimport Checkbox from \"@sproutsocial/seeds-react-checkbox\";\n\nexport const ComboboxLabel = styled.label`\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n`;\n\nexport const ComboboxInputGroup = styled(Combobox.InputGroup)`\n display: flex;\n align-items: center;\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-within {\n ${focusRing}\n }\n\n &[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n }\n`;\n\nexport const ComboboxInput = styled(Combobox.Input)`\n flex: 1;\n min-width: 30px;\n padding: ${({ theme }) => theme.space[300]};\n border: none;\n background: transparent;\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: ${({ theme }) => theme.typography[200].lineHeight};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const ComboboxTokenInput = styled(Combobox.Input)`\n flex: 1;\n min-width: 60px;\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]}\n ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};\n border: none;\n background: transparent;\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n line-height: ${({ theme }) => theme.typography[200].lineHeight};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const ComboboxActionButtons = styled.div`\n display: flex;\n align-items: center;\n flex-shrink: 0;\n margin-left: auto;\n gap: ${({ theme }) => theme.space[100]};\n`;\n\nexport const ComboboxClear = styled(Combobox.Clear)`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border: none;\n background: transparent;\n color: ${({ theme }) => theme.colors.icon.base};\n cursor: pointer;\n border-radius: ${({ theme }) => theme.radii[300]};\n padding: 0;\n\n &:hover {\n color: ${({ theme }) => theme.colors.text.body};\n }\n\n &[data-empty] {\n display: none;\n }\n`;\n\nexport const ComboboxTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border: none;\n background: transparent;\n color: ${({ theme }) => theme.colors.icon.base};\n cursor: default;\n padding: 0;\n\n &:hover {\n color: ${({ theme }) => theme.colors.text.body};\n }\n`;\n\nexport const ComboboxPositioner = styled(Combobox.Positioner)`\n width: var(--anchor-width);\n z-index: 7;\n`;\n\nexport const ComboboxPopup = styled(Combobox.Popup)`\n font-family: ${({ theme }) => theme.fontFamily};\n background: ${({ theme }) => theme.colors.container.background.base};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii[500]};\n box-shadow: ${({ theme }) => theme.shadows.medium};\n outline: none;\n width: 100%;\n max-height: min(var(--base-ui-available-height, 400px), 400px);\n overflow-y: auto;\n padding: 0;\n\n &[data-open] {\n animation: combobox-popup-in 120ms ease-out;\n }\n\n &[data-closed] {\n animation: combobox-popup-out 100ms ease-in;\n }\n\n @keyframes combobox-popup-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes combobox-popup-out {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n`;\n\nexport const ComboboxList = styled(Combobox.List)`\n padding: ${({ theme }) => theme.space[200]};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxStatus = styled(Combobox.Status)`\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.subtext};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxEmpty = styled(Combobox.Empty)`\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.subtext};\n\n &:empty {\n padding: 0;\n }\n`;\n\nexport const ComboboxItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n\n &[data-selected] {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport const ComboboxItemIndicator = styled(Combobox.ItemIndicator)`\n display: flex;\n align-items: center;\n width: ${({ theme }) => theme.space[400]};\n color: ${({ theme }) => theme.colors.text.body};\n visibility: hidden;\n\n &[data-selected] {\n visibility: visible;\n }\n`;\n\nexport const ComboboxGroup = styled(Combobox.Group)`\n display: block;\n`;\n\nexport const ComboboxGroupLabel = styled(Combobox.GroupLabel)`\n padding: ${({ theme }) =>\n `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n`;\n\nexport const ComboboxSeparator = styled.div`\n height: 1px;\n margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n background: ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport const ComboboxGroupHeaderItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[100].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: ${({ theme }) => theme.colors.text.subtext};\n cursor: default;\n outline: none;\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n color: ${({ theme }) => theme.colors.text.body};\n }\n`;\n\nexport const ComboboxSelectAllItem = styled(Combobox.Item)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};\n margin-bottom: ${({ theme }) => theme.space[200]};\n\n &[data-highlighted] {\n background: ${({ theme }) => theme.colors.listItem.background.hover};\n }\n`;\n\nexport function ComboboxGroupHeaderCheckbox({\n $state,\n id,\n}: {\n $state: \"none\" | \"partial\" | \"all\";\n id: string;\n}) {\n return (\n <Checkbox\n id={id}\n checked={$state === \"all\"}\n indeterminate={$state === \"partial\"}\n onChange={() => {}}\n tabIndex={-1}\n />\n );\n}\n\n// Multi-select Token components\nexport const ComboboxToken = styled(Combobox.Chips)`\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n`;\n\nexport const ComboboxTokenInputGroup = styled(Combobox.InputGroup)`\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n padding: ${({ theme }) =>\n `${theme.space[200]} ${theme.space[300]} ${theme.space[200]} ${theme.space[200]}`};\n gap: ${({ theme }) => theme.space[200]};\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-within {\n ${focusRing}\n }\n\n &[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n }\n`;\n\nexport const Token = styled.span`\n display: inline-flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[200]};\n padding: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n background: ${({ theme }) => theme.colors.container.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n line-height: 1;\n white-space: nowrap;\n transition: all ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_inout};\n\n &:hover {\n box-shadow: ${({ theme }) => theme.shadows.low};\n border-color: ${({ theme }) => theme.colors.container.border.base};\n }\n`;\n\nexport const TokenRemove = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n`;\n\n// Searchable select components\n\nexport const SearchableSelectTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${({ theme }) => theme.space[300]};\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n cursor: default;\n outline: none;\n user-select: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n\n &[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n }\n`;\n\nexport const SearchableSelectTriggerIcon = styled(Combobox.Icon)`\n display: flex;\n align-items: center;\n color: ${({ theme }) => theme.colors.icon.base};\n flex-shrink: 0;\n`;\n\nexport const SearchableSelectPlaceholder = styled.span`\n color: ${({ theme }) => theme.colors.text.subtext};\n padding: ${({ theme }) => theme.space[200]} 0;\n`;\n\nexport const SearchableSelectPopup = ComboboxPopup;\n\nexport const SearchableSelectSearchContainer = styled.div`\n padding: ${({ theme }) => theme.space[300]};\n border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};\n flex-shrink: 0;\n`;\n\nexport const SearchableSelectInput = styled(Combobox.Input)`\n width: 100%;\n height: ${({ theme }) => theme.space[500]};\n padding: 0 ${({ theme }) => theme.space[300]};\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.container.border.base};\n background: ${({ theme }) => theme.colors.container.background.base};\n font-size: ${({ theme }) => theme.typography[200].fontSize};\n color: ${({ theme }) => theme.colors.text.body};\n outline: none;\n box-sizing: border-box;\n\n &:focus {\n ${focusRing}\n }\n\n &::placeholder {\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n`;\n\nexport const SearchableSelectList = styled(Combobox.List)`\n overflow-y: auto;\n padding: ${({ theme }) => theme.space[200]};\n flex: 1;\n min-height: 0;\n &:empty {\n padding: 0;\n }\n`;\n\nexport const SearchableSelectTokenTrigger = styled(Combobox.Trigger)`\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n min-width: 160px;\n border-radius: ${({ theme }) => theme.radii[500]};\n border: 1px solid ${({ theme }) => theme.colors.form.border.base};\n background: ${({ theme }) => theme.colors.form.background.base};\n color: ${({ theme }) => theme.colors.text.body};\n padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]};\n gap: ${({ theme }) => theme.space[200]};\n cursor: default;\n text-align: left;\n outline: none;\n user-select: none;\n transition: border-color ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in},\n box-shadow ${({ theme }) => theme.duration.fast}\n ${({ theme }) => theme.easing.ease_in};\n\n &:focus-visible {\n ${focusRing}\n }\n\n &[data-popup-open] {\n border-color: ${({ theme }) => theme.colors.blue[600]};\n }\n\n &[data-popup-open] [data-chevron] {\n transform: rotate(-180deg);\n }\n\n &[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n }\n`;\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport ComboboxItem from \"./ComboboxItem\";\nimport {\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n} from \"./ComboboxStyles\";\nimport type { DataWithId } from \"./types\";\n\nexport const ITEM_HEIGHT = 32;\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nexport function isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\nexport function isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\nexport type FlatSentinelRow<T> = T | GroupHeaderSentinel | SelectAllSentinel;\n\ninterface VirtualizedComboboxListProps<T extends DataWithId> {\n open: boolean;\n virtualizerRef: React.RefObject<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>;\n value: T | T[] | null;\n groups: Array<{ value: string; items: T[] }> | null;\n data: T[];\n itemToString: (item: T) => string;\n inputType: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n renderItem?: (item: T) => React.ReactNode;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\nexport default function VirtualizedComboboxList<T extends DataWithId>({\n open,\n virtualizerRef,\n value,\n groups,\n data,\n itemToString,\n inputType,\n renderItem,\n renderGroupHeading,\n}: VirtualizedComboboxListProps<T>) {\n type Row = FlatSentinelRow<T>;\n\n const filteredItems = Combobox.useFilteredItems<Row>();\n const scrollElementRef = React.useRef<HTMLDivElement | null>(null);\n\n const virtualizer = useVirtualizer({\n enabled: open,\n count: filteredItems.length,\n getScrollElement: () => scrollElementRef.current,\n estimateSize: () => ITEM_HEIGHT,\n overscan: 20,\n paddingStart: 4,\n paddingEnd: 4,\n scrollPaddingStart: 4,\n scrollPaddingEnd: 4,\n });\n\n React.useImperativeHandle(virtualizerRef, () => virtualizer);\n\n const handleScrollRef = React.useCallback(\n (el: HTMLDivElement | null) => {\n scrollElementRef.current = el;\n if (el) virtualizer.measure();\n },\n [virtualizer]\n );\n\n if (!filteredItems.length) return null;\n\n const selectedArray = Array.isArray(value)\n ? value\n : value != null\n ? [value]\n : [];\n\n const totalSize = virtualizer.getTotalSize();\n\n return (\n <div\n role=\"presentation\"\n ref={handleScrollRef}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n overscrollBehavior: \"contain\",\n }}\n >\n <div\n role=\"presentation\"\n style={{ position: \"relative\", width: \"100%\", height: totalSize }}\n >\n {virtualizer.getVirtualItems().map((virtualItem) => {\n const row = filteredItems[virtualItem.index];\n if (!row) return null;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n transform: `translateY(${virtualItem.start}px)`,\n boxSizing: \"border-box\",\n };\n\n if (isSelectAllSentinel(row)) {\n const selectedCount = selectedArray.length;\n const totalCount = data.length;\n const state =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={row}\n style={baseStyle}\n ref={virtualizer.measureElement}\n >\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItems = group?.items ?? [];\n const selectedCount = groupItems.filter((item) =>\n selectedArray.some((s) => s.id === item.id)\n ).length;\n const state =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItems.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={row}\n style={baseStyle}\n ref={virtualizer.measureElement}\n >\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={virtualItem.key}\n index={virtualItem.index}\n data-index={virtualItem.index}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n style={baseStyle}\n ref={virtualizer.measureElement}\n />\n );\n })}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxTokenInputGroup,\n ComboboxTokenInput,\n ComboboxToken,\n ComboboxActionButtons,\n ComboboxClear,\n ComboboxTrigger,\n ComboboxPositioner,\n ComboboxPopup,\n ComboboxList,\n ComboboxEmpty,\n ComboboxStatus,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n Token,\n TokenRemove,\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\n\n// ─── Sentinels ────────────────────────────────────────────────────────────────\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\nfunction makeGroupHeaderSentinel(groupName: string): GroupHeaderSentinel {\n return { __groupHeader: true, groupName };\n}\n\nfunction isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nconst SELECT_ALL_SENTINEL: SelectAllSentinel = { __selectAll: true };\n\nfunction isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiComboboxBaseProps {\n id?: string;\n placeholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n disabled?: boolean;\n}\n\ninterface MultiComboboxDataProps<T extends DataWithId>\n extends MultiComboboxBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n renderToken?: (item: T) => React.ReactNode;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"checkbox\" | \"none\";\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n selectHeadings?: boolean;\n selectAll?: boolean;\n isVirtualized?: boolean;\n removeSelectedItems?: boolean;\n maxTokens?: number;\n children?: never;\n}\n\ninterface MultiComboboxChildrenProps extends MultiComboboxBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n renderToken?: never;\n renderSelection?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n selectHeadings?: never;\n selectAll?: never;\n removeSelectedItems?: never;\n}\n\nexport type MultiComboboxProps<T extends DataWithId> =\n | MultiComboboxDataProps<T>\n | MultiComboboxChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n// ─── Virtualized list ─────────────────────────────────────────────────────────\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function MultiCombobox<T extends DataWithId>(\n props: MultiComboboxProps<T>\n) {\n const {\n id,\n placeholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode\n ? ([] as T[])\n : (props as MultiComboboxDataProps<T>).data;\n const itemToString = isChildrenMode\n ? (_item: T) => \"\"\n : (props as MultiComboboxDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderItem;\n const renderToken = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderToken;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderSelection;\n const maxTokens = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).maxTokens;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiComboboxDataProps<T>).inputType ?? \"checkbox\";\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiComboboxDataProps<T>).renderGroupHeading;\n const selectHeadings = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).selectHeadings ?? false;\n const selectAll = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).selectAll ?? false;\n const isVirtualized = isChildrenMode\n ? false\n : (props as MultiComboboxDataProps<T>).isVirtualized ?? false;\n const children = isChildrenMode\n ? (props as MultiComboboxChildrenProps).children\n : undefined;\n\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemIds !== undefined;\n\n const idsToItems = React.useCallback(\n (ids: Array<T[\"id\"]>): T[] =>\n ids\n .map((id) => data.find((d) => d.id === id))\n .filter((d): d is T => d != null),\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T[]>(() =>\n defaultSelectedItemIds\n ? idsToItems(defaultSelectedItemIds as Array<T[\"id\"]>)\n : []\n );\n\n const value = isControlled\n ? idsToItems(selectedItemIds as Array<T[\"id\"]>)\n : internalValue;\n\n const visibleData = React.useMemo(\n () =>\n removeSelectedItems\n ? data.filter((item) => !value.some((v) => v.id === item.id))\n : data,\n [data, value, removeSelectedItems]\n );\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(visibleData, groupBy) : null),\n [visibleData, groupBy]\n );\n\n // ─── Sentinel flat list ───────────────────────────────────────────────────\n // Used when selectHeadings or selectAll. selectAll implies selectHeadings —\n // group headers are always selectable when the list is flattened.\n\n type FlatRow = T | GroupHeaderSentinel | SelectAllSentinel;\n\n const flatItems = React.useMemo<FlatRow[] | null>(() => {\n if (!groups || (!selectHeadings && !selectAll)) return null;\n const rows: FlatRow[] = [];\n if (selectAll) rows.push(SELECT_ALL_SENTINEL);\n for (const group of groups) {\n rows.push(makeGroupHeaderSentinel(group.value));\n rows.push(...group.items);\n }\n return rows;\n }, [groups, selectHeadings, selectAll]);\n\n function setSelectedItems(items: T[]) {\n if (!isControlled) setInternalValue(items);\n if (onSelectedItemIdsChange)\n onSelectedItemIdsChange(items.map((item) => item.id));\n }\n\n function handleValueChange(next: FlatRow[]) {\n const selectAllClicked = next.filter(isSelectAllSentinel);\n const groupSentinels = next.filter(isGroupHeaderSentinel);\n const realItems = next.filter(\n (v): v is T => !isGroupHeaderSentinel(v) && !isSelectAllSentinel(v)\n );\n\n if (selectAllClicked.length > 0) {\n const allSelected = data.every((d) =>\n realItems.some((s) => s.id === d.id)\n );\n setSelectedItems(allSelected ? [] : [...data]);\n return;\n }\n\n if (groupSentinels.length === 0) {\n setSelectedItems(realItems);\n return;\n }\n\n let updated = [...realItems];\n for (const sentinel of groupSentinels) {\n const group = groups?.find((g) => g.value === sentinel.groupName);\n if (!group) continue;\n const allSelected = group.items.every((item) =>\n updated.some((s) => s.id === item.id)\n );\n if (allSelected) {\n updated = updated.filter(\n (s) => !group.items.some((item) => item.id === s.id)\n );\n } else {\n const missing = group.items.filter(\n (item) => !updated.some((s) => s.id === item.id)\n );\n updated = [...updated, ...missing];\n }\n }\n setSelectedItems(updated);\n }\n\n function handleSimpleValueChange(newItems: T[]) {\n setSelectedItems(newItems);\n }\n\n function removeItem(item: T, e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n setSelectedItems(value.filter((v) => v.id !== item.id));\n }\n\n // ─── Render sentinel item ─────────────────────────────────────────────────\n\n function renderSentinelRow(row: FlatRow) {\n if (isSelectAllSentinel(row)) {\n const totalCount = data.length;\n const selectedCount = value.length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem key=\"__selectAll\" value={row}>\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItemsList = group?.items ?? [];\n const selectedCount = groupItemsList.filter((item) =>\n value.some((s) => s.id === item.id)\n ).length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItemsList.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem key={`__header-${row.groupName}`} value={row}>\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n />\n );\n }\n\n // ─── Items passed to Combobox.Root ────────────────────────────────────────\n // When selectHeadings: flatItems (flat array of group header sentinels + items).\n // When selectAll only: prepend SELECT_ALL_SENTINEL to data so Base UI tracks\n // it, while Combobox.List still uses the normal grouped render.\n // The sentinel is never in flatItems — it is always rendered manually above\n // Combobox.List, so we must not prepend it when flatItems is used.\n\n const rootItems =\n flatItems ?? groups ?? (isChildrenMode ? undefined : visibleData);\n\n const hasSentinels = selectAll || selectHeadings;\n\n const rootValue = hasSentinels\n ? ([...value] as FlatRow[])\n : (value as unknown as T[]);\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n multiple\n id={id}\n virtualized={isVirtualized}\n open={open}\n disabled={props.disabled}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n value={rootValue}\n onValueChange={\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (hasSentinels ? handleValueChange : handleSimpleValueChange) as any\n }\n itemToStringLabel={(item: FlatRow | null) => {\n if (!item || isGroupHeaderSentinel(item) || isSelectAllSentinel(item))\n return \"\";\n return itemToString(item as T);\n }}\n isItemEqualToValue={(a: FlatRow, b: FlatRow) => {\n if (isGroupHeaderSentinel(a) && isGroupHeaderSentinel(b))\n return a.groupName === b.groupName;\n if (isSelectAllSentinel(a) && isSelectAllSentinel(b)) return true;\n if (\n !isGroupHeaderSentinel(a) &&\n !isSelectAllSentinel(a) &&\n !isGroupHeaderSentinel(b) &&\n !isSelectAllSentinel(b)\n )\n return (a as T).id === (b as T).id;\n return false;\n }}\n items={rootItems}\n >\n <ComboboxTokenInputGroup>\n <ComboboxToken>\n {renderSelection\n ? renderSelection(value)\n : (() => {\n const visibleTokens =\n maxTokens != null ? value.slice(0, maxTokens) : value;\n const overflow =\n maxTokens != null ? value.length - maxTokens : 0;\n return (\n <>\n {visibleTokens.map((item) => (\n <Token key={item.id}>\n {renderToken ? renderToken(item) : itemToString(item)}\n <TokenRemove\n aria-label={`Remove ${itemToString(item)}`}\n onPointerDown={(e) => e.preventDefault()}\n onClick={(e) => removeItem(item, e)}\n >\n <Icon name=\"x-outline\" size=\"mini\" />\n </TokenRemove>\n </Token>\n ))}\n {overflow > 0 && (\n <Token key=\"__overflow\">+{overflow}</Token>\n )}\n </>\n );\n })()}\n <ComboboxTokenInput\n id={id}\n placeholder={value.length > 0 ? \"\" : placeholder}\n />\n <ComboboxActionButtons>\n <ComboboxClear aria-label=\"Clear all\">\n <ClearIcon />\n </ComboboxClear>\n <ComboboxTrigger aria-label=\"Open popup\">\n <StyledChevron $isOpen={open}>\n <ChevronIcon />\n </StyledChevron>\n </ComboboxTrigger>\n </ComboboxActionButtons>\n </ComboboxToken>\n </ComboboxTokenInputGroup>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <ComboboxPopup\n aria-busy={isLoading || undefined}\n style={\n isVirtualized\n ? { display: \"flex\", flexDirection: \"column\" }\n : undefined\n }\n >\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <ComboboxList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={visibleData}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : flatItems ? (\n (row: FlatRow) => renderSentinelRow(row)\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </ComboboxList>\n </ComboboxPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n ComboboxPositioner,\n ComboboxEmpty,\n ComboboxStatus,\n SearchableSelectTrigger,\n SearchableSelectTriggerIcon,\n SearchableSelectPlaceholder,\n SearchableSelectPopup,\n SearchableSelectSearchContainer,\n SearchableSelectInput,\n SearchableSelectList,\n} from \"./Common/ComboboxStyles\";\nimport { StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface SingleSearchableSelectBaseProps {\n id?: string;\n placeholder?: string;\n includePlaceholderItem?: boolean;\n searchPlaceholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n disabled?: boolean;\n}\n\ninterface SingleSearchableSelectDataBaseProps<T extends DataWithId>\n extends SingleSearchableSelectBaseProps {\n data: T[];\n itemToString: (item: T | null) => string;\n renderItem?: (item: T) => React.ReactNode;\n renderSelection?: (item: T) => React.ReactNode;\n inputType?: \"icon\" | \"radio\" | \"checkbox\" | \"none\";\n selectedItemId?: T[\"id\"] | null;\n defaultSelectedItemId?: T[\"id\"] | null;\n onSelectedItemIdChange?: (id: T[\"id\"] | null) => void;\n children?: never;\n}\n\ninterface SingleSearchableSelectDataProps<T extends DataWithId>\n extends SingleSearchableSelectDataBaseProps<T> {\n isVirtualized?: false;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n}\n\ninterface SingleSearchableSelectVirtualizedProps<T extends DataWithId>\n extends SingleSearchableSelectDataBaseProps<T> {\n isVirtualized: true;\n groupBy?: never;\n renderGroupHeading?: never;\n}\n\ninterface SingleSearchableSelectChildrenProps\n extends SingleSearchableSelectBaseProps {\n children: React.ReactNode;\n selectedItemId?: string | number | null;\n defaultSelectedItemId?: string | number | null;\n onSelectedItemIdChange?: (id: string | number | null) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n renderSelection?: never;\n inputType?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n isVirtualized?: never;\n}\n\nexport type SingleSearchableSelectProps<T extends DataWithId> =\n | SingleSearchableSelectDataProps<T>\n | SingleSearchableSelectVirtualizedProps<T>\n | SingleSearchableSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function SingleSearchableSelect<T extends DataWithId>(\n props: SingleSearchableSelectProps<T>\n) {\n const {\n id,\n placeholder = \"Select...\",\n includePlaceholderItem,\n searchPlaceholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n type DataProps =\n | SingleSearchableSelectDataProps<T>\n | SingleSearchableSelectVirtualizedProps<T>;\n\n const data = isChildrenMode ? ([] as T[]) : (props as DataProps).data;\n const itemToString = isChildrenMode\n ? (_item: T | null) => \"\"\n : (props as DataProps).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as DataProps).renderItem;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as DataProps).renderSelection;\n const inputType = isChildrenMode\n ? \"icon\"\n : (props as DataProps).inputType ?? \"icon\";\n const isVirtualized = isChildrenMode\n ? false\n : (props as DataProps).isVirtualized ?? false;\n const groupBy = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleSearchableSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : isVirtualized\n ? undefined\n : (props as SingleSearchableSelectDataProps<T>).renderGroupHeading;\n const children = isChildrenMode\n ? (props as SingleSearchableSelectChildrenProps).children\n : undefined;\n\n const selectedItemId = props.selectedItemId;\n const defaultSelectedItemId = props.defaultSelectedItemId;\n const onSelectedItemIdChange = props.onSelectedItemIdChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemId !== undefined;\n\n const idToItem = React.useCallback(\n (id: T[\"id\"] | null | undefined): T | null => {\n if (id == null) return null;\n return data.find((d) => String(d.id) === String(id)) ?? null;\n },\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T | null>(() =>\n idToItem(defaultSelectedItemId as T[\"id\"] | null)\n );\n\n const value = isControlled\n ? idToItem(selectedItemId as T[\"id\"] | null)\n : internalValue;\n\n function handleValueChange(newItem: T | null) {\n if (!isControlled) setInternalValue(newItem);\n if (onSelectedItemIdChange) {\n onSelectedItemIdChange(newItem ? newItem.id : null);\n }\n }\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(data, groupBy) : null),\n [data, groupBy]\n );\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n id={id}\n value={value}\n disabled={props.disabled}\n onValueChange={handleValueChange}\n itemToStringLabel={itemToString}\n isItemEqualToValue={(a, b) => a != null && b != null && a.id === b.id}\n items={\n isVirtualized ? data : groups ?? (isChildrenMode ? undefined : data)\n }\n virtualized={isVirtualized}\n open={open}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n >\n <SearchableSelectTrigger id={id}>\n <SearchableSelectPlaceholder>\n <Combobox.Value placeholder={placeholder}>\n {value\n ? renderSelection\n ? renderSelection(value)\n : itemToString(value)\n : null}\n </Combobox.Value>\n </SearchableSelectPlaceholder>\n <SearchableSelectTriggerIcon>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SearchableSelectTriggerIcon>\n </SearchableSelectTrigger>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <SearchableSelectPopup\n aria-busy={isLoading || undefined}\n style={{ display: \"flex\", flexDirection: \"column\" }}\n >\n <SearchableSelectSearchContainer>\n <SearchableSelectInput\n placeholder={searchPlaceholder}\n autoFocus\n />\n </SearchableSelectSearchContainer>\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <SearchableSelectList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={null}\n data={data}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n />\n ) : children ? (\n children\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n <>\n {includePlaceholderItem && (\n <ComboboxItem\n key=\"placeholder\"\n value={null as unknown as T}\n itemId=\"placeholder\"\n label={placeholder}\n />\n )}\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : undefined\n }\n />\n )}\n </Combobox.Collection>\n </>\n )}\n </SearchableSelectList>\n </SearchableSelectPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport VirtualizedComboboxList from \"./Common/VirtualizedComboboxList\";\nimport { useSeedsPortalContainer } from \"./SeedsPortal\";\nimport ComboboxItem from \"./Common/ComboboxItem\";\nimport type { DataWithId } from \"./Common/types\";\nimport { groupItems } from \"./Common/groupItems\";\nimport { Field } from \"./Common/SelectStyles\";\nimport {\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxSeparator,\n ComboboxPositioner,\n ComboboxEmpty,\n ComboboxStatus,\n ComboboxGroupHeaderItem,\n ComboboxGroupHeaderCheckbox,\n ComboboxSelectAllItem,\n SearchableSelectTokenTrigger,\n SearchableSelectPlaceholder,\n SearchableSelectTriggerIcon,\n SearchableSelectPopup,\n SearchableSelectSearchContainer,\n SearchableSelectInput,\n SearchableSelectList,\n} from \"./Common/ComboboxStyles\";\nimport { ClearIcon, StyledChevron, ChevronIcon } from \"./Common/SelectIcons\";\nimport styled from \"styled-components\";\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst SelectionText = styled.span`\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\n// ─── Sentinels ────────────────────────────────────────────────────────────────\n\ninterface GroupHeaderSentinel {\n __groupHeader: true;\n groupName: string;\n}\n\nfunction makeGroupHeaderSentinel(groupName: string): GroupHeaderSentinel {\n return { __groupHeader: true, groupName };\n}\n\nfunction isGroupHeaderSentinel(v: unknown): v is GroupHeaderSentinel {\n return typeof v === \"object\" && v !== null && \"__groupHeader\" in v;\n}\n\ninterface SelectAllSentinel {\n __selectAll: true;\n}\n\nconst SELECT_ALL_SENTINEL: SelectAllSentinel = { __selectAll: true };\n\nfunction isSelectAllSentinel(v: unknown): v is SelectAllSentinel {\n return typeof v === \"object\" && v !== null && \"__selectAll\" in v;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\ninterface MultiSearchableSelectBaseProps {\n id?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n isLoading?: boolean;\n loadingText?: string;\n disabled?: boolean;\n}\n\ninterface MultiSearchableSelectDataProps<T extends DataWithId>\n extends MultiSearchableSelectBaseProps {\n data: T[];\n itemToString: (item: T) => string;\n renderItem?: (item: T) => React.ReactNode;\n customRenderSelections?: (item: T) => string;\n renderSelection?: (items: T[]) => React.ReactNode;\n inputType?: \"icon\" | \"checkbox\" | \"none\";\n maxSelections?: number;\n selectedItemIds?: Array<T[\"id\"]>;\n defaultSelectedItemIds?: Array<T[\"id\"]>;\n onSelectedItemIdsChange?: (ids: Array<T[\"id\"]>) => void;\n groupBy?: (item: T) => string;\n renderGroupHeading?: (label: string) => React.ReactNode;\n selectHeadings?: boolean;\n selectAll?: boolean;\n isVirtualized?: boolean;\n removeSelectedItems?: boolean;\n children?: never;\n}\n\ninterface MultiSearchableSelectChildrenProps\n extends MultiSearchableSelectBaseProps {\n children: React.ReactNode;\n selectedItemIds?: Array<string | number>;\n defaultSelectedItemIds?: Array<string | number>;\n onSelectedItemIdsChange?: (ids: Array<string | number>) => void;\n data?: never;\n itemToString?: never;\n renderItem?: never;\n customRenderSelections?: never;\n renderSelection?: never;\n inputType?: never;\n maxSelections?: never;\n groupBy?: never;\n renderGroupHeading?: never;\n selectHeadings?: never;\n selectAll?: never;\n isVirtualized?: never;\n removeSelectedItems?: never;\n}\n\nexport type MultiSearchableSelectProps<T extends DataWithId> =\n | MultiSearchableSelectDataProps<T>\n | MultiSearchableSelectChildrenProps;\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function MultiSearchableSelect<T extends DataWithId>(\n props: MultiSearchableSelectProps<T>\n) {\n const {\n id,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyText = \"No results found.\",\n isLoading = false,\n loadingText = \"Loading...\",\n } = props;\n\n const isChildrenMode = \"children\" in props && props.children != null;\n\n const data = isChildrenMode\n ? ([] as T[])\n : (props as MultiSearchableSelectDataProps<T>).data;\n const itemToString = isChildrenMode\n ? (_item: T) => \"\"\n : (props as MultiSearchableSelectDataProps<T>).itemToString;\n const renderItem = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderItem;\n const customRenderSelections = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).customRenderSelections;\n const maxSelections = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).maxSelections;\n const renderSelection = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderSelection;\n const removeSelectedItems = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).removeSelectedItems ?? false;\n const inputType = isChildrenMode\n ? \"checkbox\"\n : removeSelectedItems\n ? \"none\"\n : (props as MultiSearchableSelectDataProps<T>).inputType ?? \"checkbox\";\n const groupBy = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).groupBy;\n const renderGroupHeading = isChildrenMode\n ? undefined\n : (props as MultiSearchableSelectDataProps<T>).renderGroupHeading;\n const selectHeadings = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).selectHeadings ?? false;\n const selectAll = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).selectAll ?? false;\n const isVirtualized = isChildrenMode\n ? false\n : (props as MultiSearchableSelectDataProps<T>).isVirtualized ?? false;\n const children = isChildrenMode\n ? (props as MultiSearchableSelectChildrenProps).children\n : undefined;\n\n const selectedItemIds = props.selectedItemIds;\n const defaultSelectedItemIds = props.defaultSelectedItemIds;\n const onSelectedItemIdsChange = props.onSelectedItemIdsChange;\n\n const { containerRef, portalContainer } = useSeedsPortalContainer();\n const [open, setOpen] = React.useState(false);\n const virtualizerRef = React.useRef<ReturnType<\n typeof useVirtualizer<HTMLDivElement, Element>\n > | null>(null);\n\n const isControlled = selectedItemIds !== undefined;\n\n const idsToItems = React.useCallback(\n (ids: Array<T[\"id\"]>): T[] =>\n ids\n .map((id) => data.find((d) => d.id === id))\n .filter((d): d is T => d != null),\n [data]\n );\n\n const [internalValue, setInternalValue] = React.useState<T[]>(() =>\n defaultSelectedItemIds\n ? idsToItems(defaultSelectedItemIds as Array<T[\"id\"]>)\n : []\n );\n\n const value = isControlled\n ? idsToItems(selectedItemIds as Array<T[\"id\"]>)\n : internalValue;\n\n const visibleData = React.useMemo(\n () =>\n removeSelectedItems\n ? data.filter((item) => !value.some((v) => v.id === item.id))\n : data,\n [data, value, removeSelectedItems]\n );\n\n const groups = React.useMemo(\n () => (groupBy ? groupItems(visibleData, groupBy) : null),\n [visibleData, groupBy]\n );\n\n // ─── Sentinel flat list ───────────────────────────────────────────────────\n\n type FlatRow = T | GroupHeaderSentinel | SelectAllSentinel;\n\n const flatItems = React.useMemo<FlatRow[] | null>(() => {\n if (!groups || (!selectHeadings && !selectAll)) return null;\n const rows: FlatRow[] = [];\n if (selectAll) rows.push(SELECT_ALL_SENTINEL);\n for (const group of groups) {\n rows.push(makeGroupHeaderSentinel(group.value));\n rows.push(...group.items);\n }\n return rows;\n }, [groups, selectHeadings, selectAll]);\n\n function setSelectedItems(items: T[]) {\n if (!isControlled) setInternalValue(items);\n if (onSelectedItemIdsChange)\n onSelectedItemIdsChange(items.map((item) => item.id));\n }\n\n function handleValueChange(next: FlatRow[]) {\n const selectAllClicked = next.filter(isSelectAllSentinel);\n const groupSentinels = next.filter(isGroupHeaderSentinel);\n const realItems = next.filter(\n (v): v is T => !isGroupHeaderSentinel(v) && !isSelectAllSentinel(v)\n );\n\n if (selectAllClicked.length > 0) {\n const allSelected = data.every((d) =>\n realItems.some((s) => s.id === d.id)\n );\n setSelectedItems(allSelected ? [] : [...data]);\n return;\n }\n\n if (groupSentinels.length === 0) {\n setSelectedItems(realItems);\n return;\n }\n\n let updated = [...realItems];\n for (const sentinel of groupSentinels) {\n const group = groups?.find((g) => g.value === sentinel.groupName);\n if (!group) continue;\n const allSelected = group.items.every((item) =>\n updated.some((s) => s.id === item.id)\n );\n if (allSelected) {\n updated = updated.filter(\n (s) => !group.items.some((item) => item.id === s.id)\n );\n } else {\n const missing = group.items.filter(\n (item) => !updated.some((s) => s.id === item.id)\n );\n updated = [...updated, ...missing];\n }\n }\n setSelectedItems(updated);\n }\n\n function handleSimpleValueChange(newItems: T[]) {\n setSelectedItems(newItems);\n }\n\n // ─── Render sentinel row ──────────────────────────────────────────────────\n\n function renderSentinelRow(row: FlatRow) {\n if (isSelectAllSentinel(row)) {\n const totalCount = data.length;\n const selectedCount = value.length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === totalCount\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxSelectAllItem key=\"__selectAll\" value={row}>\n <ComboboxGroupHeaderCheckbox $state={state} id=\"__selectAll\" />\n Select all\n </ComboboxSelectAllItem>\n );\n }\n\n if (isGroupHeaderSentinel(row)) {\n const group = groups?.find((g) => g.value === row.groupName);\n const groupItemsList = group?.items ?? [];\n const selectedCount = groupItemsList.filter((item) =>\n value.some((s) => s.id === item.id)\n ).length;\n const state: \"none\" | \"partial\" | \"all\" =\n selectedCount === 0\n ? \"none\"\n : selectedCount === groupItemsList.length\n ? \"all\"\n : \"partial\";\n return (\n <ComboboxGroupHeaderItem key={`__header-${row.groupName}`} value={row}>\n <ComboboxGroupHeaderCheckbox\n $state={state}\n id={`__header-${row.groupName}`}\n />\n {renderGroupHeading\n ? renderGroupHeading(row.groupName)\n : row.groupName}\n </ComboboxGroupHeaderItem>\n );\n }\n\n const item = row as T;\n return (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem ? () => renderItem(item) : () => itemToString(item)\n }\n />\n );\n }\n\n const rootItems =\n flatItems ?? groups ?? (isChildrenMode ? undefined : visibleData);\n const hasSentinels = selectAll || selectHeadings;\n const rootValue = hasSentinels\n ? ([...value] as FlatRow[])\n : (value as unknown as T[]);\n\n return (\n <Field>\n <div ref={containerRef} style={{ position: \"relative\" }} />\n <Combobox.Root\n multiple\n id={id}\n virtualized={isVirtualized}\n open={open}\n disabled={props.disabled}\n onOpenChange={setOpen}\n onItemHighlighted={\n isVirtualized\n ? (item, { reason, index }) => {\n const virt = virtualizerRef.current;\n if (!item || !virt) return;\n const isStart = index === 0;\n const isEnd = index === virt.options.count - 1;\n if (\n reason === \"none\" ||\n (reason === \"keyboard\" && (isStart || isEnd))\n ) {\n queueMicrotask(() => {\n virt.scrollToIndex(index, {\n align: isEnd ? \"start\" : \"end\",\n });\n });\n }\n }\n : undefined\n }\n value={rootValue}\n onValueChange={\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (hasSentinels ? handleValueChange : handleSimpleValueChange) as any\n }\n itemToStringLabel={(item: FlatRow | null) => {\n if (!item || isGroupHeaderSentinel(item) || isSelectAllSentinel(item))\n return \"\";\n return itemToString(item as T);\n }}\n isItemEqualToValue={(a: FlatRow, b: FlatRow) => {\n if (isGroupHeaderSentinel(a) && isGroupHeaderSentinel(b))\n return a.groupName === b.groupName;\n if (isSelectAllSentinel(a) && isSelectAllSentinel(b)) return true;\n if (\n !isGroupHeaderSentinel(a) &&\n !isSelectAllSentinel(a) &&\n !isGroupHeaderSentinel(b) &&\n !isSelectAllSentinel(b)\n )\n return (a as T).id === (b as T).id;\n return false;\n }}\n items={rootItems}\n >\n <SearchableSelectTokenTrigger id={id}>\n {renderSelection ? (\n renderSelection(value)\n ) : value.length > 0 ? (\n (() => {\n const visibleItems =\n maxSelections != null ? value.slice(0, maxSelections) : value;\n const overflowCount =\n maxSelections != null && value.length > maxSelections\n ? value.length - maxSelections\n : 0;\n const text = visibleItems\n .map((item) =>\n customRenderSelections\n ? customRenderSelections(item)\n : itemToString(item)\n )\n .join(\", \");\n return (\n <SelectionText>\n {text}\n {overflowCount > 0 ? `, +${overflowCount}` : \"\"}\n </SelectionText>\n );\n })()\n ) : (\n <SearchableSelectPlaceholder>\n {placeholder}\n </SearchableSelectPlaceholder>\n )}\n <SearchableSelectTriggerIcon style={{ marginLeft: \"auto\" }}>\n <StyledChevron data-chevron>\n <ChevronIcon />\n </StyledChevron>\n </SearchableSelectTriggerIcon>\n </SearchableSelectTokenTrigger>\n\n <Combobox.Portal container={portalContainer}>\n <ComboboxPositioner sideOffset={4}>\n <SearchableSelectPopup\n aria-busy={isLoading || undefined}\n style={{ display: \"flex\", flexDirection: \"column\" }}\n >\n <SearchableSelectSearchContainer>\n <SearchableSelectInput\n placeholder={searchPlaceholder}\n autoFocus\n />\n </SearchableSelectSearchContainer>\n <ComboboxStatus>{isLoading ? loadingText : null}</ComboboxStatus>\n <ComboboxEmpty>{isLoading ? null : emptyText}</ComboboxEmpty>\n <SearchableSelectList\n style={\n isVirtualized\n ? {\n padding: 0,\n flex: 1,\n minHeight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n }\n : undefined\n }\n >\n {isVirtualized ? (\n <VirtualizedComboboxList\n open={open}\n virtualizerRef={virtualizerRef}\n value={value}\n groups={groups}\n data={visibleData}\n itemToString={itemToString}\n inputType={inputType}\n renderItem={renderItem}\n renderGroupHeading={renderGroupHeading}\n />\n ) : children ? (\n children\n ) : flatItems ? (\n (row: FlatRow) => renderSentinelRow(row)\n ) : groups ? (\n (group: { value: string; items: T[] }, index: number) => (\n <React.Fragment key={group.value}>\n <ComboboxGroup items={group.items}>\n <ComboboxGroupLabel>\n {renderGroupHeading\n ? renderGroupHeading(group.value)\n : group.value}\n </ComboboxGroupLabel>\n <Combobox.Collection>\n {(item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )}\n </Combobox.Collection>\n </ComboboxGroup>\n {index < groups.length - 1 && <ComboboxSeparator />}\n </React.Fragment>\n )\n ) : (\n (item: T) => (\n <ComboboxItem\n key={item.id}\n value={item}\n itemId={String(item.id)}\n label={itemToString(item)}\n disabled={item.disabled}\n inputType={inputType}\n renderItem={\n renderItem\n ? () => renderItem(item)\n : () => itemToString(item)\n }\n />\n )\n )}\n </SearchableSelectList>\n </SearchableSelectPopup>\n </ComboboxPositioner>\n </Combobox.Portal>\n </Combobox.Root>\n </Field>\n );\n}\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,SAAS,UAAAC,eAAc;AACvB,OAAOC,aAAY;;;ACFnB,YAAY,WAAW;AACvB,SAAS,kCAAkC;AAcpC,SAAS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F;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["React","Select","styled","Select","styled","styled","Icon","jsx","CheckIcon","Fragment","jsx","jsxs","styled","Select","React","Select","styled","jsx","jsxs","styled","Select","React","Combobox","React","Radio","Checkbox","styled","focusRing","Checkbox","jsx","jsx","jsxs","Radio","Checkbox","CheckIcon","ComboboxItem","React","Combobox","jsx","jsxs","Combobox","groupItems","item","jsx","jsxs","id","Combobox","React","Combobox","Icon","Fragment","jsx","jsxs","isGroupHeaderSentinel","isSelectAllSentinel","id","item","Combobox","React","Combobox","Fragment","jsx","jsxs","id","Combobox","React","Combobox","styled","jsx","jsxs","SelectionText","makeGroupHeaderSentinel","isGroupHeaderSentinel","SELECT_ALL_SENTINEL","isSelectAllSentinel","id","item","Combobox"]}