@latte-macchiat-io/latte-vanilla-components 0.0.262 → 0.0.263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -3,9 +3,11 @@ import { forwardRef } from 'react';
|
|
3
3
|
import { formRecipe } from './styles.css';
|
4
4
|
|
5
5
|
export type FormProps = React.HTMLAttributes<HTMLDivElement> & {
|
6
|
+
as?: 'form' | 'div';
|
6
7
|
children: React.ReactNode;
|
7
8
|
};
|
8
9
|
|
9
|
-
export const Form = forwardRef<HTMLFormElement, FormProps>(({ children, className }) => {
|
10
|
-
|
10
|
+
export const Form = forwardRef<HTMLFormElement, FormProps>(({ as = 'form', children, className }) => {
|
11
|
+
const Component = as;
|
12
|
+
return <Component className={clsx(formRecipe(), className)}>{children}</Component>;
|
11
13
|
});
|
@@ -6,6 +6,8 @@ import { generateResponsiveMedia } from '../../utils/generateResponsiveMedia';
|
|
6
6
|
|
7
7
|
const formBase = style({
|
8
8
|
maxWidth: '100%',
|
9
|
+
margin: '0 auto',
|
10
|
+
borderRadius: themeContract.form.borderRadius,
|
9
11
|
backgroundColor: themeContract.form.backgroundColor,
|
10
12
|
|
11
13
|
'@media': {
|