@postenbring/hedwig-react
Version:
React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).
45 lines (43 loc) • 1.41 kB
JavaScript
import {
__objRest,
__spreadProps,
__spreadValues
} from "./chunk-YOSPWY5K.mjs";
// src/table/table.tsx
import { clsx } from "@postenbring/hedwig-css/typed-classname";
import { forwardRef, useId } from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var Table = forwardRef(
(_a, ref) => {
var _b = _a, { children, className, size, caption, description } = _b, rest = __objRest(_b, ["children", "className", "size", "caption", "description"]);
const descriptionId = useId();
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsxs(
"table",
__spreadProps(__spreadValues({
"aria-describedby": description ? descriptionId : void 0,
ref,
className: clsx(
"hds-table",
{
"hds-table--compressed": size === "compressed",
"hds-table--mobile-compressed": size === "mobile-compressed"
},
className
)
}, rest), {
children: [
caption ? /* @__PURE__ */ jsx("caption", { children: caption }) : null,
children
]
})
),
description ? /* @__PURE__ */ jsx("p", { className: clsx("hds-table-description"), id: descriptionId, children: description }) : null
] });
}
);
Table.displayName = "Table";
export {
Table
};
//# sourceMappingURL=chunk-ZOZPWP3N.mjs.map