import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display"; import { Form, FormField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, } from "@godxjp/ui/data-entry"; import { Flex, PageContainer } from "@godxjp/ui/layout"; const REGIONS = [ { value: "tokyo", label: "東京都千代田区丸の内第一営業本部" }, { value: "hcm", label: "Thành phố Hồ Chí Minh – Văn phòng điều hành khu vực phía Nam" }, { value: "danang", label: "Đà Nẵng", disabled: true }, ]; /** Exhaustive supported Select states. Async loading/empty/error live in the main Select frame. */ export default function Demo() { const [controlled, setControlled] = useState("tokyo"); const [searchable, setSearchable] = useState("hcm"); return ( Compound primitive · complete anatomy Group, label, separator, disabled item, controlled value, sm/md trigger and portalled content. Radix owns keyboard focus and collision handling. {/* data-axe-open on the region: the gate presses the first `[role="combobox"]` inside it, which is the compound SelectTrigger. */} Non-search / search API boundary Without showSearch/loadOptions the data API delegates to Radix Select: grouping, disabled options, renderOption, name and controlled/uncontrolled values are supported. clearable, search/loading/empty/error messages and selected-value renderers belong to the searchable engine; this frame does not imply parity where the implementation has none. SearchSelect itself is internal and is not a package-barrel component export. Data-driven · long JA/VI and disabled option Long labels truncate without widening the page. The disabled option remains visible but cannot be selected; name creates a native hidden form value.
Searchable · FormField validation contract The searchable trigger receives FormField label, helper, required, invalid and error references. The internal search textbox has its own visible-purpose accessible name. Supported async boundary The main Select frame demonstrates loading, resolved-empty and rejected loaders. Re-querying or reopening retries the loader; there is currently no explicit retry-button prop, so this matrix does not invent one.
); }