@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
62 lines (58 loc) • 2.55 kB
JavaScript
"use client";
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
const require_factory = require('../../core/system/factory.cjs');
const require_create_component = require('../../core/components/create-component.cjs');
const require_native_table_style = require('./native-table.style.cjs');
let react_jsx_runtime = require("react/jsx-runtime");
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
//#region src/components/native-table/native-table.tsx
const { PropsContext: NativeTablePropsContext, usePropsContext: useNativeTablePropsContext, withContext, withProvider } = require_create_component.createSlotComponent("native-table", require_native_table_style.nativeTableStyle);
/**
* `NativeTable` is a component for efficiently organizing and displaying data.
*
* @see https://yamada-ui.com/docs/components/native-table
*/
const NativeTableRoot = withProvider(({ withScrollArea, scrollAreaProps,...rest }) => {
if (withScrollArea) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NativeTableScrollArea, {
...scrollAreaProps,
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.table, { ...rest })
});
else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.table, { ...rest });
}, "root")(void 0, ({ layout: tableLayout,...rest }) => ({
tableLayout,
...rest
}));
const NativeTableScrollArea = withContext("div", "scrollArea")();
const Caption = withContext("caption", "caption")(void 0, ({ placement = "end",...rest }) => ({
"data-placement": placement,
captionSide: placement === "end" ? "bottom" : "top",
...rest
}));
const Thead = withContext("thead", "thead")();
const Tbody = withContext("tbody", "tbody")();
const Tfoot = withContext("tfoot", "tfoot")();
const Colgroup = withContext("colgroup", "colgroup")();
const Col = withContext("col", "col")();
const Tr = withContext("tr", "tr")();
const Th = withContext("th", "th")(void 0, ({ numeric,...rest }) => ({
"data-numeric": numeric,
...rest
}));
const Td = withContext("td", "td")(void 0, ({ numeric,...rest }) => ({
"data-numeric": numeric,
...rest
}));
//#endregion
exports.Caption = Caption;
exports.Col = Col;
exports.Colgroup = Colgroup;
exports.NativeTablePropsContext = NativeTablePropsContext;
exports.NativeTableRoot = NativeTableRoot;
exports.Tbody = Tbody;
exports.Td = Td;
exports.Tfoot = Tfoot;
exports.Th = Th;
exports.Thead = Thead;
exports.Tr = Tr;
exports.useNativeTablePropsContext = useNativeTablePropsContext;
//# sourceMappingURL=native-table.cjs.map