1 | import * as React from "react";
|
2 | import { createComponent } from "reakit-system/createComponent";
|
3 | import { createHook } from "reakit-system/createHook";
|
4 | import {
|
5 | CompositeItemOptions,
|
6 | CompositeItemHTMLProps,
|
7 | useCompositeItem,
|
8 | } from "../Composite/CompositeItem";
|
9 | import { GRID_CELL_KEYS } from "./__keys";
|
10 |
|
11 | export type unstable_GridCellOptions = CompositeItemOptions;
|
12 |
|
13 | export type unstable_GridCellHTMLProps = CompositeItemHTMLProps &
|
14 | React.TdHTMLAttributes<any>;
|
15 |
|
16 | export type unstable_GridCellProps = unstable_GridCellOptions &
|
17 | unstable_GridCellHTMLProps;
|
18 |
|
19 | export const unstable_useGridCell = createHook<
|
20 | unstable_GridCellOptions,
|
21 | unstable_GridCellHTMLProps
|
22 | >({
|
23 | name: "GridCell",
|
24 | compose: useCompositeItem,
|
25 | keys: GRID_CELL_KEYS,
|
26 |
|
27 | useProps(_, htmlProps) {
|
28 | return { role: "gridcell", ...htmlProps };
|
29 | },
|
30 | });
|
31 |
|
32 | export const unstable_GridCell = createComponent({
|
33 | as: "span",
|
34 | memo: true,
|
35 | useHook: unstable_useGridCell,
|
36 | });
|