1// This classNames preset is based entirely on Base UI's example:
2// https://base-ui.com/react/components/combobox#input-inside-popup
3// You can style the Combobox however you want.
4<PhoneField.Country
5 classNames={{
6 // Trigger button that opens the country Combobox.
7 trigger:
8 "inline-flex h-10 min-w-[7.5rem] cursor-default select-none items-center justify-between gap-2 whitespace-nowrap rounded-xl border border-gray-200 bg-white pr-2.5 pl-3 text-base text-gray-900 transition-colors hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-blue-800 data-[popup-open]:bg-gray-100",
9 // Trigger icon.
10 icon: "flex text-gray-600",
11 // Positioning layer for z-index and popup alignment.
12 positioner: "z-50",
13 // Popup panel with dimensions and enter/exit transitions.
14 popup:
15 "origin-[var(--transform-origin)] flex max-w-[var(--available-width)] max-h-[24rem] flex-col overflow-hidden rounded-lg bg-[canvas] text-gray-900 shadow-lg shadow-gray-200 outline-1 outline-gray-200 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",
16 // Wrapper around the search input.
17 searchInputContainer: "shrink-0 p-2",
18 // Search input inside the popup.
19 searchInput:
20 "h-10 w-full font-normal rounded-md border border-gray-200 px-3 text-base text-gray-900 focus:outline focus:outline-2 focus:-outline-offset-1 focus:outline-blue-800",
21 // Empty state when no country matches.
22 empty: "p-4 text-[0.925rem] leading-4 text-gray-600 empty:m-0 empty:p-0",
23 // Scrollable list of countries.
24 list: "min-h-0 flex-1 overflow-y-auto scroll-py-2 py-2 overscroll-contain empty:p-0",
25 // Country row and highlighted state.
26 item:
27 "grid min-w-[max(16rem,var(--anchor-width))] cursor-default grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-lg py-2.5 pr-4 pl-4 text-base leading-5 outline-none select-none data-[highlighted]:relative data-[highlighted]:z-0 data-[highlighted]:text-gray-50 data-[highlighted]:before:absolute data-[highlighted]:before:inset-x-2 data-[highlighted]:before:inset-y-0 data-[highlighted]:before:z-[-1] data-[highlighted]:before:rounded-lg data-[highlighted]:before:bg-gray-900",
28 }}
29 ...
30/>