UNPKG

1.22 kBPlain TextView Raw
1import { createComponent } from "reakit-system/createComponent";
2import { createHook } from "reakit-system/createHook";
3import {
4 unstable_GridCellOptions as GridCellOptions,
5 unstable_GridCellHTMLProps as GridCellHTMLProps,
6 unstable_useGridCell as useGridCell,
7} from "../Grid/GridCell";
8import { COMBOBOX_GRID_CELL_KEYS } from "./__keys";
9import {
10 unstable_ComboboxItemOptions as ComboboxItemOptions,
11 unstable_ComboboxItemHTMLProps as ComboboxItemHTMLProps,
12 unstable_useComboboxItem as useComboboxItem,
13} from "./ComboboxItem";
14
15export const unstable_useComboboxGridCell = createHook<
16 unstable_ComboboxGridCellOptions,
17 unstable_ComboboxGridCellHTMLProps
18>({
19 name: "ComboboxGridCell",
20 compose: [useComboboxItem, useGridCell],
21 keys: COMBOBOX_GRID_CELL_KEYS,
22});
23
24export const unstable_ComboboxGridCell = createComponent({
25 as: "span",
26 memo: true,
27 useHook: unstable_useComboboxGridCell,
28});
29
30export type unstable_ComboboxGridCellOptions = GridCellOptions &
31 ComboboxItemOptions;
32
33export type unstable_ComboboxGridCellHTMLProps = GridCellHTMLProps &
34 ComboboxItemHTMLProps;
35
36export type unstable_ComboboxGridCellProps = unstable_ComboboxGridCellOptions &
37 unstable_ComboboxGridCellHTMLProps;