@nex-ui/react
Version:
🎉 A beautiful, modern, and reliable React component library.
53 lines (50 loc) • 1.32 kB
JavaScript
"use client";
import { jsx } from 'react/jsx-runtime';
import { useDefaultProps } from '../utils/useDefaultProps.mjs';
import { useSlotClasses } from '../utils/useSlotClasses.mjs';
import { useStyles } from '../utils/useStyles.mjs';
import { useSlot } from '../utils/useSlot.mjs';
import { cardRecipe } from '../../theme/recipes/card.mjs';
const slots = [
'root'
];
const Card = (inProps)=>{
const props = useDefaultProps({
name: 'Card',
props: inProps
});
const { shadow = 'md', radius = 'md', hoverable = false, blurred = false, ...remainingProps } = props;
const ownerState = {
...props,
hoverable,
blurred,
shadow,
radius
};
const slotClasses = useSlotClasses({
name: 'Card',
slots
});
const style = useStyles({
ownerState,
name: 'Card',
recipe: cardRecipe
});
const [CardRoot, getCardProps] = useSlot({
style,
classNames: slotClasses.root,
elementType: 'div',
externalForwardedProps: remainingProps,
dataAttrs: {
shadow,
radius,
hoverable,
blurred
}
});
return /*#__PURE__*/ jsx(CardRoot, {
...getCardProps()
});
};
Card.displayName = 'Card';
export { Card };