style: common component style

This commit is contained in:
jialin
2024-05-27 19:29:03 +08:00
parent 7ff9b44644
commit 3120f5ee3a
26 changed files with 736 additions and 166 deletions
@@ -0,0 +1,57 @@
import classNames from 'classnames';
import LabelInfo from './components/label-info';
import wrapperStyle from './components/wrapper.less';
interface WrapperProps {
children: React.ReactNode;
label: string;
status?: string;
className?: string;
disabled?: boolean;
required?: boolean;
description?: string;
onClick?: () => void;
}
const Wrapper: React.FC<WrapperProps> = ({
children,
label,
status,
className,
disabled,
required,
description
}) => {
return (
<div
className={classNames(
wrapperStyle.wrapper,
wrapperStyle[`validate-status-${status}`],
disabled ? wrapperStyle['seal-input-wrapper-disabled'] : '',
className ? wrapperStyle[className] : ''
)}
>
<label
className={classNames(
wrapperStyle['label'],
wrapperStyle['isfoucs-has-value']
)}
>
<LabelInfo
label={label}
required={required}
description={description}
></LabelInfo>
</label>
<div
style={{
padding: '0 calc(var(--ant-padding-sm) - 5px)',
width: '100%'
}}
>
{children}
</div>
</div>
);
};
export default Wrapper;