triafly-ui-kit 1.0.17 → 1.0.19
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.
@@ -0,0 +1 @@
|
|
1
|
+
form .form-controls{margin:28px 0 0;display:flex;gap:12px}
|
package/dist/assets/FormRoot.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
form .form-group{padding:12px;border-radius:8px;background-color:var(--color-bg-neutral-lightest-default)}form .form-group:not(:last-of-type){margin:0 0 12px}form .
|
1
|
+
form .form-group{padding:12px;border-radius:8px;background-color:var(--color-bg-neutral-lightest-default)}form .form-group:not(:last-of-type){margin:0 0 12px}form .columns-2{display:grid;grid-template-columns:1fr 1fr;grid-gap:12px}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
2
|
-
import { useMemo as
|
3
|
-
import { FormContext as
|
4
|
-
import { FormItem as
|
5
|
-
import { useForm as
|
6
|
-
import
|
7
|
-
|
2
|
+
import { useMemo as f } from "react";
|
3
|
+
import { FormContext as i } from "../FormContext/FormContext.js";
|
4
|
+
import { FormItem as p } from "../FormItem/FormItem.js";
|
5
|
+
import { useForm as v } from "../useForm/useForm.js";
|
6
|
+
import { FormControls as F } from "../FormGroup/FormControls/FormControls.js";
|
7
|
+
import '../../../../assets/FormRoot.css';const c = ({ form: m, children: l, onFinish: o, disabled: t = !1 }) => {
|
8
|
+
const n = v()[0], s = f(() => {
|
8
9
|
const r = m || n;
|
9
10
|
return r.disabled = t, r;
|
10
11
|
}, [m, n, t]), u = async (r) => {
|
@@ -17,9 +18,10 @@ import '../../../../assets/FormRoot.css';const v = ({ form: m, children: c, onFi
|
|
17
18
|
console.error("Form submission error:", e);
|
18
19
|
}
|
19
20
|
};
|
20
|
-
return /* @__PURE__ */ a(
|
21
|
+
return /* @__PURE__ */ a(i.Provider, { value: s || null, children: /* @__PURE__ */ a("form", { onSubmit: u, children: l }) });
|
21
22
|
};
|
22
|
-
|
23
|
+
c.Item = p;
|
24
|
+
c.FormControls = F;
|
23
25
|
export {
|
24
|
-
|
26
|
+
c as Form
|
25
27
|
};
|
package/dist/main.d.ts
CHANGED
@@ -190,8 +190,15 @@ export declare const Form: FormComponent;
|
|
190
190
|
|
191
191
|
declare interface FormComponent extends React.FC<FormProps> {
|
192
192
|
Item: typeof FormItem;
|
193
|
+
FormControls: typeof FormControls;
|
193
194
|
}
|
194
195
|
|
196
|
+
declare const FormControls: default_2.FC<FormControlsProps>;
|
197
|
+
|
198
|
+
declare type FormControlsProps = {
|
199
|
+
children: default_2.ReactNode;
|
200
|
+
};
|
201
|
+
|
195
202
|
declare interface FormInstance {
|
196
203
|
/**
|
197
204
|
* Сбрасывает все значения формы и ошибки
|