@onesy/ui-react
Version:
UI for React
72 lines • 3.16 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
const _excluded = ["tonal", "color", "size", "Component", "className", "children"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import { c as _c } from "react/compiler-runtime";
import React from 'react';
import { classNames, style as styleMethod, useOnesyTheme } from '@onesy/style-react';
import SurfaceElement from '../Surface';
import { staticClassName } from '../utils';
import { jsx as _jsx } from "react/jsx-runtime";
const useStyle = styleMethod(theme => ({
root: {},
size_small: {
padding: theme.methods.space.value(2, 'px')
},
size_regular: {
padding: `${theme.methods.space.value(3, 'px')} ${theme.methods.space.value(2, 'px')}`
},
size_large: {
padding: `${theme.methods.space.value(4, 'px')} ${theme.methods.space.value(3, 'px')}`
}
}), {
name: 'onesy-TableFooter'
});
const TableFooter = props_ => {
const $ = _c(8);
const theme = useOnesyTheme();
const props = _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyTableFooter?.props?.default), props_);
const Surface = theme?.elements?.Surface || SurfaceElement;
const {
tonal: t0,
color: t1,
size: t2,
Component: t3,
className,
children
} = props,
other = _objectWithoutProperties(props, _excluded);
const tonal = t0 === undefined ? true : t0;
const color = t1 === undefined ? "themed" : t1;
const size = t2 === undefined ? "regular" : t2;
const Component = t3 === undefined ? "div" : t3;
const {
classes
} = useStyle();
const t4 = classNames([staticClassName("TableFooter", theme) && ["onesy-TableFooter-root", `onesy-TableFooter-size-${size}`], className, classes.root, classes[`size_${size}`]]);
let t5;
if ($[0] !== Component || $[1] !== Surface || $[2] !== children || $[3] !== color || $[4] !== other || $[5] !== t4 || $[6] !== tonal) {
t5 = /*#__PURE__*/_jsx(Surface, _objectSpread(_objectSpread({
tonal: tonal,
color: color,
Component: Component,
className: t4
}, other), {}, {
children: children
}));
$[0] = Component;
$[1] = Surface;
$[2] = children;
$[3] = color;
$[4] = other;
$[5] = t4;
$[6] = tonal;
$[7] = t5;
} else {
t5 = $[7];
}
return t5;
};
TableFooter.displayName = 'onesy-TableFooter';
export default TableFooter;