@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
35 lines (34 loc) • 908 B
JavaScript
;
import { StyledView } from "../StyledComponents/index.js";
import { useTheme } from "../../hooks/index.js";
import { verticalScale } from "../../helpers/index.js";
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
const Surface = ({
variant = 'default',
padding = 10,
br = 5,
children,
...rest
}) => {
const {
colors
} = useTheme();
const styles = variant === 'elevated' ? {
boxShadow: colors.elevation.level1
} : variant === 'outlined' ? {
borderColor: colors.border.default,
borderWidth: 0.5
} : {};
return /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsx(StyledView, {
padding: verticalScale(padding),
borderRadius: verticalScale(br),
bg: colors.background.surface,
...styles,
...rest,
children: children
})
});
};
export default Surface;
//# sourceMappingURL=Surface.js.map