@chakra-ui/table
Version:
Table component for React and Chakra UI
1 lines • 2.15 kB
Source Map (JSON)
{"version":3,"sources":["../src/table.tsx"],"sourcesContent":["import {\n chakra,\n forwardRef,\n HTMLChakraProps,\n omitThemingProps,\n ThemingProps,\n useMultiStyleConfig,\n SystemStyleObject,\n} from \"@chakra-ui/system\"\nimport { cx } from \"@chakra-ui/shared-utils\"\nimport { createContext } from \"@chakra-ui/react-context\"\n\nconst [TableStylesProvider, useTableStyles] = createContext<\n Record<string, SystemStyleObject>\n>({\n name: `TableStylesContext`,\n errorMessage: `useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Table />\" `,\n})\n\nexport { useTableStyles }\n\nexport interface TableOptions {\n layout?: SystemStyleObject[\"tableLayout\"]\n}\n\nexport interface TableProps\n extends HTMLChakraProps<\"table\">,\n TableOptions,\n ThemingProps<\"Table\"> {}\n\n/**\n * The `Table` component is used to organize and display data efficiently. It renders a `<table>` element by default.\n *\n * @see Docs https://chakra-ui.com/docs/components/table\n * @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/table/\n */\nexport const Table = forwardRef<TableProps, \"table\">((props, ref) => {\n const styles = useMultiStyleConfig(\"Table\", props)\n const { className, layout, ...tableProps } = omitThemingProps(props)\n\n return (\n <TableStylesProvider value={styles}>\n <chakra.table\n ref={ref}\n __css={{ tableLayout: layout, ...styles.table }}\n className={cx(\"chakra-table\", className)}\n {...tableProps}\n />\n </TableStylesProvider>\n )\n})\n\nTable.displayName = \"Table\"\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAgCxB;AA9BN,IAAM,CAAC,qBAAqB,cAAc,IAAI,cAE5C;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAmBM,IAAM,QAAQ,WAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,SAAS,oBAAoB,SAAS,KAAK;AACjD,QAAM,EAAE,WAAW,QAAQ,GAAG,WAAW,IAAI,iBAAiB,KAAK;AAEnE,SACE,oBAAC,uBAAoB,OAAO,QAC1B;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACC;AAAA,MACA,OAAO,EAAE,aAAa,QAAQ,GAAG,OAAO,MAAM;AAAA,MAC9C,WAAW,GAAG,gBAAgB,SAAS;AAAA,MACtC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ,CAAC;AAED,MAAM,cAAc;","names":[]}