Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: popover component

Brad Barbinfcd5f3f207b1
diff --git a/apps/carbon/app/components/Combobox.tsx b/apps/carbon/app/components/Combobox.tsx
index 8f10995eda..fb318915c2 100644
--- a/apps/carbon/app/components/Combobox.tsx
+++ b/apps/carbon/app/components/Combobox.tsx
@@ -13,7 +13,7 @@ import {
cn,
} from "@carbon/react";
import type { ComponentPropsWithoutRef } from "react";
-import { forwardRef } from "react";
+import { forwardRef, useState } from "react";
import { MdClose } from "react-icons/md";
import { RxCheck } from "react-icons/rx";
@@ -47,15 +47,17 @@ const Combobox = forwardRef<HTMLButtonElement, ComboboxProps>(
},
ref
) => {
+ const [open, setOpen] = useState(false);
return (
<HStack spacing={1}>
- <Popover>
+ <Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<CommandTrigger
size={size}
role="combobox"
className={cn("min-w-[160px]", !value && "text-muted-foreground")}
ref={ref}
+ onClick={() => setOpen(true)}
{...props}
>
{value ? (
@@ -78,6 +80,7 @@ const Combobox = forwardRef<HTMLButtonElement, ComboboxProps>(
key={option.value}
onSelect={() => {
onChange?.(option.value);
+ setOpen(false);
}}
>
{option.label}
diff --git a/apps/carbon/app/components/Editable/EditableList.tsx b/apps/carbon/app/components/Editable/EditableList.tsx
index 4094275755..c7cd50868c 100644
--- a/apps/carbon/app/components/Editable/EditableList.tsx
+++ b/apps/carbon/app/components/Editable/EditableList.tsx
@@ -1,6 +1,6 @@
/* eslint-disable react/display-name */
-import { Select } from "@carbon/react";
import type { PostgrestSingleResponse } from "@supabase/supabase-js";
+import { Combobox } from "~/components";
import type { EditableTableCellComponentProps } from "~/components/Editable";
const EditableList =
@@ -19,7 +19,7 @@ const EditableList =
onError,
onUpdate,
}: EditableTableCellComponentProps<T>) => {
- const onChange = async ({ value }: { value: string; label: string }) => {
+ const onChange = async (value: string) => {
// this is the optimistic update on the FE
onUpdate(accessorKey, value);
@@ -38,12 +38,11 @@ const EditableList =
};
return (
- <Select
+ <Combobox
autoFocus
- borderRadius="none"
- defaultValue={options.find((option) => option.value === value)}
+ className="rounded-none"
+ value={options.find((option) => option.value === value)?.value}
options={options}
- // @ts-ignore
onChange={onChange}
size="sm"
/>
diff --git a/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx b/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx
index 8c3f0c4f30..2a9c2bd2a3 100644
--- a/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx
+++ b/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx
@@ -33,7 +33,7 @@ const UserSelect = (props: UserSelectProps) => {
const state = useUserSelect(props);
const {
dropdown,
- innerProps: { hideSelections, isMulti, label, readOnly, testID, width },
+ innerProps: { hideSelections, isMulti, label, readOnly, width },
refs: { containerRef },
selectionItemsById,
} = state;
@@ -41,7 +41,7 @@ const UserSelect = (props: UserSelectProps) => {
return (
<UserSelectContext.Provider value={state}>
{label && <FormLabel>{label}</FormLabel>}
- <Container ref={containerRef} width={width} testID={testID}>
+ <Container ref={containerRef} width={width}>
{!(readOnly && isMulti) && (
<Combobox>
<Input />
diff --git a/apps/carbon/app/components/Selectors/UserSelect/components/Input.tsx b/apps/carbon/app/components/Selectors/UserSelect/components/Input.tsx
index aa91ce0f74..23c9dd8024 100644
--- a/apps/carbon/app/components/Selectors/UserSelect/components/Input.tsx
+++ b/apps/carbon/app/components/Selectors/UserSelect/components/Input.tsx
@@ -13,9 +13,8 @@ import useUserSelectContext from "../provider";
const Input = () => {
const {
aria: { inputProps },
- innerProps: { disabled, isMulti, placeholder, readOnly, testID },
+ innerProps: { disabled, isMulti, placeholder, readOnly },
inputValue,
- instanceId,
loading,
refs: { inputRef },
onClearInput,
@@ -41,8 +40,6 @@ const Input = () => {
<InputBase
{...inputProps}
- id={`${instanceId}:UserSelectionInput:searchInput:${testID}`}
- data-testid={`UserSelectionInput:searchInput:${testID}`}
readOnly={disabled || readOnly}
isDisabled={disabled || readOnly}
onBlur={onInputBlur}
diff --git a/apps/carbon/app/components/Selectors/UserSelect/components/Popover.tsx b/apps/carbon/app/components/Selectors/UserSelect/components/Popover.tsx
index e31fbb8d41..b60f44fe48 100644
--- a/apps/carbon/app/components/Selectors/UserSelect/components/Popover.tsx
+++ b/apps/carbon/app/components/Selectors/UserSelect/components/Popover.tsx
@@ -1,4 +1,3 @@
-import { Box, useMultiStyleConfig } from "@chakra-ui/react";
import type { PropsWithChildren } from "react";
import { useEffect } from "react";
import useUserSelectContext from "../provider";
@@ -9,8 +8,6 @@ const Popover = ({ children }: PropsWithChildren) => {
refs: { listBoxRef, popoverRef, focusableNodes },
} = useUserSelectContext();
- const menuStyles = useMultiStyleConfig("Menu");
-
useEffect(() => {
/* Build a triple linked-list (TreeNode[]) of focusable DOM Elements that are children
@@ -80,19 +77,13 @@ const Popover = ({ children }: PropsWithChildren) => {
}, [children, focusableNodes, listBoxRef]);
return (
- <Box
+ <div
{...popoverProps}
ref={popoverRef}
- sx={{
- ...menuStyles.list,
- position: "absolute",
- width: "100%",
- marginTop: 1,
- px: 2,
- }}
+ className="absolute w-full mt-1 px-2 bg-popover text-popover-foreground shadow-sm border border-border rounded-md min-w-[240px]"
>
{children}
- </Box>
+ </div>
);
};
diff --git a/apps/carbon/app/components/Selectors/UserSelect/types.ts b/apps/carbon/app/components/Selectors/UserSelect/types.ts
index 0a685c822d..6ff8505840 100644
--- a/apps/carbon/app/components/Selectors/UserSelect/types.ts
+++ b/apps/carbon/app/components/Selectors/UserSelect/types.ts
@@ -8,7 +8,7 @@ import type {
RefObject,
} from "react";
-import type { User, Group } from "~/modules/users";
+import type { Group, User } from "~/modules/users";
export type ComboBoxRefs = {
containerRef: RefObject<HTMLDivElement>;
@@ -40,7 +40,6 @@ export interface UserSelectProps {
resetAfterSelection?: boolean;
selections?: IndividualOrGroup[];
selectionsMaxHeight?: string | number;
- testID?: string;
type?: "employee" | "supplier" | "customer";
usersOnly?: boolean;
value?: string[] | string; // Will be set when used as a controlled input
diff --git a/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts b/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts
index 0b06bbb98e..98e2127111 100644
--- a/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts
+++ b/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts
@@ -40,7 +40,6 @@ const defaultProps = {
selections: [] as IndividualOrGroup[],
selectionsMaxHeight: 400,
showAvatars: false,
- testID: "UserSelect",
usersOnly: false,
onCancel: () => {},
};
diff --git a/apps/carbon/app/components/Table/components/Columns.tsx b/apps/carbon/app/components/Table/components/Columns.tsx
index 9252644fe2..4ec8728807 100644
--- a/apps/carbon/app/components/Table/components/Columns.tsx
+++ b/apps/carbon/app/components/Table/components/Columns.tsx
@@ -1,12 +1,12 @@
-import { Button, HStack, IconButton } from "@carbon/react";
import {
+ Button,
+ HStack,
+ IconButton,
Popover,
- PopoverArrow,
- PopoverBody,
PopoverContent,
PopoverHeader,
PopoverTrigger,
-} from "@chakra-ui/react";
+} from "@carbon/react";
import type { Column, ColumnOrderState } from "@tanstack/react-table";
import { Reorder } from "framer-motion";
import {
@@ -32,21 +32,21 @@ const Columns = <T extends object>({
setColumnOrder,
}: ColumnsProps<T>) => {
return (
- <Popover placement="bottom" closeOnBlur>
- <PopoverTrigger>
+ <Popover>
+ <PopoverTrigger asChild>
<Button variant="ghost" leftIcon={<BsLayoutThreeColumns />}>
Columns
</Button>
</PopoverTrigger>
- <PopoverContent w={360} boxShadow="xl">
+ <PopoverContent className="w-96">
<PopoverHeader>
<p className="text-sm">Edit column view</p>
<p className="text-xs text-muted-foreground">
Manage and reorder columns
</p>
</PopoverHeader>
- <PopoverArrow />
- <PopoverBody maxH="50vh" overflow="auto">
+
+ <div className="max-h-48 overflow-y-auto">
<Reorder.Group
axis="y"
values={columnOrder}
@@ -103,7 +103,7 @@ const Columns = <T extends object>({
return acc;
}, [])}
</Reorder.Group>
- </PopoverBody>
+ </div>
</PopoverContent>
</Popover>
);
diff --git a/apps/carbon/app/components/Table/components/Filter/Filter.tsx b/apps/carbon/app/components/Table/components/Filter/Filter.tsx
index 31b856ccac..d28494f8df 100644
--- a/apps/carbon/app/components/Table/components/Filter/Filter.tsx
+++ b/apps/carbon/app/components/Table/components/Filter/Filter.tsx
@@ -1,13 +1,12 @@
-import { Button, VStack } from "@carbon/react";
import {
+ Button,
Popover,
- PopoverArrow,
- PopoverBody,
PopoverContent,
PopoverFooter,
PopoverHeader,
PopoverTrigger,
-} from "@chakra-ui/react";
+ VStack,
+} from "@carbon/react";
import { BsFilter, BsPlus } from "react-icons/bs";
import { useUrlParams } from "~/hooks";
import FilterRow from "./FilterRow";
@@ -40,8 +39,8 @@ const Filter = ({ columnAccessors }: FilterProps) => {
};
return (
- <Popover placement="bottom" closeOnBlur>
- <PopoverTrigger>
+ <Popover>
+ <PopoverTrigger asChild>
<Button
variant={filters.length === 0 ? "ghost" : "primary"}
leftIcon={<BsFilter />}
@@ -49,7 +48,7 @@ const Filter = ({ columnAccessors }: FilterProps) => {
{filters.length === 0 ? "Filter" : "Filtered"}
</Button>
</PopoverTrigger>
- <PopoverContent w={480} boxShadow="xl">
+ <PopoverContent className="w-[480px]">
{filters.length === 0 && (
<PopoverHeader>
<p className="text-sm">No filters applied to this view</p>
@@ -58,29 +57,26 @@ const Filter = ({ columnAccessors }: FilterProps) => {
</p>
</PopoverHeader>
)}
- <PopoverArrow />
{filters.length > 0 && (
- <PopoverBody>
- <VStack>
- {filters.reduce<JSX.Element[]>((acc, filter, index) => {
- const [column, operator, searchValue] = filter.split(":");
- if (!column || !operator) return acc;
- acc.push(
- <FilterRow
- key={`filter-${column}-${[index]}`}
- column={column}
- columnAccessors={columnAccessors}
- operator={operator}
- searchValue={searchValue}
- onRemove={() => removeFilter(index)}
- onUpdate={(newFilter) => updateFilter(index, newFilter)}
- />
- );
- return acc;
- }, [])}
- </VStack>
- </PopoverBody>
+ <VStack>
+ {filters.reduce<JSX.Element[]>((acc, filter, index) => {
+ const [column, operator, searchValue] = filter.split(":");
+ if (!column || !operator) return acc;
+ acc.push(
+ <FilterRow
+ key={`filter-${column}-${[index]}`}
+ column={column}
+ columnAccessors={columnAccessors}
+ operator={operator}
+ searchValue={searchValue}
+ onRemove={() => removeFilter(index)}
+ onUpdate={(newFilter) => updateFilter(index, newFilter)}
+ />
+ );
+ return acc;
+ }, [])}
+ </VStack>
)}
<PopoverFooter>
<Button variant="secondary" leftIcon={<BsPlus />} onClick={addFilter}>
diff --git a/apps/carbon/app/components/Table/components/Sort/Sort.tsx b/apps/carbon/app/components/Table/components/Sort/Sort.tsx
index 8c882b7cf5..0909c71786 100644
--- a/apps/carbon/app/components/Table/components/Sort/Sort.tsx
+++ b/apps/carbon/app/components/Table/components/Sort/Sort.tsx
@@ -1,17 +1,15 @@
-import { Button, HStack, IconButton, Switch } from "@carbon/react";
import {
- Menu,
- MenuButton,
- MenuItem,
- MenuList,
+ Button,
+ HStack,
+ IconButton,
Popover,
- PopoverArrow,
- PopoverBody,
PopoverContent,
PopoverFooter,
PopoverHeader,
PopoverTrigger,
-} from "@chakra-ui/react";
+ Switch,
+} from "@carbon/react";
+import { Menu, MenuButton, MenuItem, MenuList } from "@chakra-ui/react";
import { Reorder } from "framer-motion";
import { BsChevronDown, BsListUl } from "react-icons/bs";
import { IoMdClose } from "react-icons/io";
@@ -33,8 +31,8 @@ const Sort = ({ columnAccessors }: SortProps) => {
const hasNoSorts = sorts.length === 0;
return (
- <Popover placement="bottom" closeOnBlur>
- <PopoverTrigger>
+ <Popover>
+ <PopoverTrigger asChild>
<Button
variant={hasNoSorts ? "ghost" : "primary"}
leftIcon={<BsListUl />}
@@ -42,7 +40,7 @@ const Sort = ({ columnAccessors }: SortProps) => {
{hasNoSorts ? "Sort" : "Sorted"}
</Button>
</PopoverTrigger>
- <PopoverContent w={420} boxShadow="xl">
+ <PopoverContent className="w-[420px]">
{hasNoSorts && (
<PopoverHeader>
<p className="text-sm">No sorts applied to this view</p>
@@ -51,47 +49,45 @@ const Sort = ({ columnAccessors }: SortProps) => {
</p>
</PopoverHeader>
)}
- <PopoverArrow />
+
{!hasNoSorts && (
- <PopoverBody>
- <Reorder.Group
- axis="y"
- values={sorts}
- onReorder={reorderSorts}
- className="space-y-2"
- >
- {sorts.map((sort) => {
- const [column, direction] = sort.split(":");
- return (
- <Reorder.Item key={sort} value={sort} className="rounded-lg">
- <HStack>
- <IconButton
- aria-label="Drag handle"
- icon={<MdOutlineDragIndicator />}
- variant="ghost"
- />
- <span className="text-sm flex-grow">
- <>{columnAccessors[column] ?? ""}</>
- </span>
- <Switch
- checked={direction === "asc"}
- onCheckedChange={() => toggleSortByDirection(column)}
- />
- <span className="text-sm text-muted-foreground">
- Ascending
- </span>
- <IconButton
- aria-label="Remove sort by column"
- icon={<IoMdClose />}
- onClick={() => removeSortBy(sort)}
- variant="ghost"
- />
- </HStack>
- </Reorder.Item>
- );
- })}
- </Reorder.Group>
- </PopoverBody>
+ <Reorder.Group
+ axis="y"
+ values={sorts}
+ onReorder={reorderSorts}
+ className="space-y-2"
+ >
+ {sorts.map((sort) => {
+ const [column, direction] = sort.split(":");
+ return (
+ <Reorder.Item key={sort} value={sort} className="rounded-lg">
+ <HStack>
+ <IconButton
+ aria-label="Drag handle"
+ icon={<MdOutlineDragIndicator />}
+ variant="ghost"
+ />
+ <span className="text-sm flex-grow">
+ <>{columnAccessors[column] ?? ""}</>
+ </span>
+ <Switch
+ checked={direction === "asc"}
+ onCheckedChange={() => toggleSortByDirection(column)}
+ />
+ <span className="text-sm text-muted-foreground">
+ Ascending
+ </span>
+ <IconButton
+ aria-label="Remove sort by column"
+ icon={<IoMdClose />}
+ onClick={() => removeSortBy(sort)}
+ variant="ghost"
+ />
+ </HStack>
+ </Reorder.Item>
+ );
+ })}
+ </Reorder.Group>
)}
<PopoverFooter>
diff --git a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters/ChartOfAccountsTableFilters.tsx b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters/ChartOfAccountsTableFilters.tsx
index 2c363eeb02..68f5428be2 100644
--- a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters/ChartOfAccountsTableFilters.tsx
+++ b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters/ChartOfAccountsTableFilters.tsx
@@ -1,12 +1,12 @@
-import { Button, DatePicker, HStack } from "@carbon/react";
import {
+ Button,
+ DatePicker,
+ HStack,
Popover,
- PopoverArrow,
- PopoverBody,
PopoverContent,
PopoverHeader,
PopoverTrigger,
-} from "@chakra-ui/react";
+} from "@carbon/react";
import { parseDate } from "@internationalized/date";
import { Link } from "@remix-run/react";
import { IoMdAdd } from "react-icons/io";
@@ -39,36 +39,32 @@ const ChartOfAccountsTableFilters = () => {
isClearable
onChange={(newValue) => setParams({ incomeBalance: newValue })}
/>
- <Popover placement="bottom" closeOnBlur>
- <PopoverTrigger>
+ <Popover>
+ <PopoverTrigger asChild>
<Button variant="solid" leftIcon={<MdCalendarMonth />}>
Date Range
</Button>
</PopoverTrigger>
- <PopoverContent w={360} boxShadow="xl">
+ <PopoverContent className="w-[390px]">
<PopoverHeader>
<p className="text-sm">Edit date range</p>
<p className="text-xs text-muted-foreground">
Select date range to filter net change and balance at date
</p>
</PopoverHeader>
- <PopoverArrow />
- <PopoverBody maxH="50vh">
- <div className="grid grid-cols-[1fr_3fr] gap-y-2 items-center">
- <p className="text-sm text-muted-foreground">Start Date</p>
- <DatePicker
- value={startDate ? parseDate(startDate) : null}
- onChange={(value) =>
- setParams({ startDate: value.toString() })
- }
- />
- <p className="text-sm text-muted-foreground">End Date</p>
- <DatePicker
- value={endDate ? parseDate(endDate) : null}
- onChange={(value) => setParams({ endDate: value.toString() })}
- />
- </div>
- </PopoverBody>
+
+ <div className="grid grid-cols-[1fr_3fr] gap-y-2 items-center">
+ <p className="text-sm text-muted-foreground">Start Date</p>
+ <DatePicker
+ value={startDate ? parseDate(startDate) : null}
+ onChange={(value) => setParams({ startDate: value.toString() })}
+ />
+ <p className="text-sm text-muted-foreground">End Date</p>
+ <DatePicker
+ value={endDate ? parseDate(endDate) : null}
+ onChange={(value) => setParams({ endDate: value.toString() })}
+ />
+ </div>
</PopoverContent>
</Popover>
{[...params.entries()].length > 0 && (
diff --git a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
index fc1c595257..95282dda7e 100644
--- a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
+++ b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
@@ -209,7 +209,7 @@ const DocumentsTable = memo(({ data, count, labels }: DocumentsTableProps) => {
</Tag>
))}
<Popover>
- <PopoverTrigger>
+ <PopoverTrigger asChild>
<Tag cursor="pointer">
<TagLabel>
<IoMdAdd />
@@ -217,6 +217,7 @@ const DocumentsTable = memo(({ data, count, labels }: DocumentsTableProps) => {
</Tag>
</PopoverTrigger>
<PopoverContent className="w-[300px] p-0">
+ {/* TODO: we should have a CreateableMultiSelect component for this */}
<CreatableCombobox
options={labelOptions}
selected={row.original.labels}
diff --git a/packages/react/src/Date/components/Popover.tsx b/packages/react/src/Date/components/Popover.tsx
index 81867e31b8..a4f31aab99 100644
--- a/packages/react/src/Date/components/Popover.tsx
+++ b/packages/react/src/Date/components/Popover.tsx
@@ -1,4 +1,4 @@
-import { Box, useColorModeValue, useOutsideClick } from "@chakra-ui/react";
+import { useOutsideClick } from "@chakra-ui/react";
import { useRef } from "react";
import { useEscape } from "../../hooks";
@@ -13,20 +13,11 @@ export function Popover(props: any) {
});
return (
- <Box
- ref={popoverRef}
- background={useColorModeValue("white", "gray.900")}
- borderRadius="md"
- position="absolute"
- zIndex="10"
- top="100%"
- boxShadow="lg"
- marginTop="1"
- padding="6"
- outline="none"
+ <div
{...rest}
+ className="absolute rounded-md z-[10] top-[100%] shadow-lg mt-1 p-6 outline-none bg-popover"
>
{children}
- </Box>
+ </div>
);
}
diff --git a/packages/react/src/Popover.tsx b/packages/react/src/Popover.tsx
index c97b71be1a..572f67af06 100644
--- a/packages/react/src/Popover.tsx
+++ b/packages/react/src/Popover.tsx
@@ -29,4 +29,40 @@ const PopoverContent = forwardRef<
));
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
-export { Popover, PopoverContent, PopoverTrigger };
+const PopoverHeader = forwardRef<
+ ElementRef<"div">,
+ ComponentPropsWithoutRef<"div">
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "-mx-4 -mt-4 mb-4 px-4 py-2 border-b border-border text-sm font-medium text-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+PopoverHeader.displayName = "PopoverHeader";
+
+const PopoverFooter = forwardRef<
+ ElementRef<"div">,
+ ComponentPropsWithoutRef<"div">
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "-mx-4 -mb-4 mt-4 px-4 py-2 border-t border-border text-sm font-medium text-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+PopoverFooter.displayName = "PopoverFooter";
+
+export {
+ Popover,
+ PopoverContent,
+ PopoverFooter,
+ PopoverHeader,
+ PopoverTrigger,
+};
diff --git a/packages/react/src/index.tsx b/packages/react/src/index.tsx
index 4244afecc3..e303fd1ce6 100644
--- a/packages/react/src/index.tsx
+++ b/packages/react/src/index.tsx
@@ -84,7 +84,13 @@ import {
ModalTitle,
ModalTrigger,
} from "./Modal";
-import { Popover, PopoverContent, PopoverTrigger } from "./Popover";
+import {
+ Popover,
+ PopoverContent,
+ PopoverFooter,
+ PopoverHeader,
+ PopoverTrigger,
+} from "./Popover";
import {
Select,
SelectContent,
@@ -200,6 +206,8 @@ export {
ModalTrigger,
Popover,
PopoverContent,
+ PopoverFooter,
+ PopoverHeader,
PopoverTrigger,
Select,
SelectContent,