@tamagui/form 2.0.0-rc.4 → 2.0.0-rc.40

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/dist/cjs/Form.cjs CHANGED
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var Form_exports = {};
22
24
  __export(Form_exports, {
@@ -28,59 +30,58 @@ __export(Form_exports, {
28
30
  useFormContext: () => useFormContext
29
31
  });
30
32
  module.exports = __toCommonJS(Form_exports);
31
- var import_core = require("@tamagui/core"),
32
- import_helpers = require("@tamagui/helpers"),
33
- import_jsx_runtime = require("react/jsx-runtime");
34
- const FORM_NAME = "Form",
35
- FormFrame = (0, import_core.styled)(import_core.View, {
36
- name: FORM_NAME,
37
- render: "form"
38
- }),
39
- FormContext = (0, import_core.createStyledContext)({
40
- onSubmit: void 0
41
- }),
42
- {
43
- useStyledContext: useFormContext,
44
- Provider: FormProvider
45
- } = FormContext,
46
- FormTriggerFrame = (0, import_core.styled)(import_core.View, {
47
- name: "FormTrigger"
48
- }),
49
- FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
50
- const {
51
- scope,
52
- children,
53
- onPress,
54
- ...triggerProps
55
- } = props,
56
- context = useFormContext(scope);
57
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
58
- render: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
59
- type: "submit"
60
- }),
61
- ...triggerProps,
62
- ref: forwardedRef,
63
- onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
64
- children
65
- });
66
- }),
67
- FormComponent = FormFrame.styleable(function ({
33
+ var import_core = require("@tamagui/core");
34
+ var import_helpers = require("@tamagui/helpers");
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ const FORM_NAME = "Form";
37
+ const FormFrame = (0, import_core.styled)(import_core.View, {
38
+ name: FORM_NAME,
39
+ render: "form"
40
+ });
41
+ const FormContext = (0, import_core.createStyledContext)({
42
+ onSubmit: void 0
43
+ });
44
+ const {
45
+ useStyledContext: useFormContext,
46
+ Provider: FormProvider
47
+ } = FormContext;
48
+ const FormTriggerFrame = (0, import_core.styled)(import_core.View, {
49
+ name: "FormTrigger"
50
+ });
51
+ const FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
52
+ const {
53
+ scope,
54
+ children,
55
+ onPress,
56
+ ...triggerProps
57
+ } = props;
58
+ const context = useFormContext(scope);
59
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
60
+ role: "button",
61
+ ...triggerProps,
62
+ ref: forwardedRef,
63
+ onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
64
+ children
65
+ });
66
+ });
67
+ const FormComponent = FormFrame.styleable(function Form({
68
+ scope,
69
+ onSubmit,
70
+ ...props
71
+ }, ref) {
72
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
68
73
  scope,
69
74
  onSubmit,
70
- ...props
71
- }, ref) {
72
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
73
- scope,
74
- onSubmit,
75
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
76
- ref,
77
- ...props,
78
- onSubmit: e => {
79
- e.preventDefault(), onSubmit?.();
80
- }
81
- })
82
- });
83
- }),
84
- Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
85
- Trigger: FormTrigger
86
- });
75
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
76
+ ref,
77
+ ...props,
78
+ onSubmit: e => {
79
+ e.preventDefault();
80
+ onSubmit?.();
81
+ }
82
+ })
83
+ });
84
+ });
85
+ const Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
86
+ Trigger: FormTrigger
87
+ });
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var Form_exports = {};
24
26
  __export(Form_exports, {
@@ -30,61 +32,60 @@ __export(Form_exports, {
30
32
  useFormContext: () => useFormContext
31
33
  });
32
34
  module.exports = __toCommonJS(Form_exports);
33
- var import_jsx_runtime = require("react/jsx-runtime"),
34
- import_core = require("@tamagui/core"),
35
- import_helpers = require("@tamagui/helpers"),
36
- FORM_NAME = "Form",
37
- FormFrame = (0, import_core.styled)(import_core.View, {
38
- name: FORM_NAME,
39
- render: "form"
40
- }),
41
- FormContext = (0, import_core.createStyledContext)({
42
- onSubmit: void 0
43
- }),
44
- {
45
- useStyledContext: useFormContext,
46
- Provider: FormProvider
47
- } = FormContext,
48
- FormTriggerFrame = (0, import_core.styled)(import_core.View, {
49
- name: "FormTrigger"
50
- }),
51
- FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
52
- var {
53
- scope,
54
- children,
55
- onPress,
56
- ...triggerProps
57
- } = props,
58
- context = useFormContext(scope);
59
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
60
- render: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
61
- type: "submit"
62
- }),
63
- ...triggerProps,
64
- ref: forwardedRef,
65
- onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
66
- children
67
- });
68
- }),
69
- FormComponent = FormFrame.styleable(function (param, ref) {
70
- var {
71
- scope,
72
- onSubmit,
73
- ...props
74
- } = param;
75
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
76
- scope,
77
- onSubmit,
78
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
79
- ref,
80
- ...props,
81
- onSubmit: function (e) {
82
- e.preventDefault(), onSubmit?.();
83
- }
84
- })
85
- });
86
- }),
87
- Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
88
- Trigger: FormTrigger
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_core = require("@tamagui/core");
37
+ var import_helpers = require("@tamagui/helpers");
38
+ var FORM_NAME = "Form";
39
+ var FormFrame = (0, import_core.styled)(import_core.View, {
40
+ name: FORM_NAME,
41
+ render: "form"
42
+ });
43
+ var FormContext = (0, import_core.createStyledContext)({
44
+ onSubmit: void 0
45
+ });
46
+ var {
47
+ useStyledContext: useFormContext,
48
+ Provider: FormProvider
49
+ } = FormContext;
50
+ var FormTriggerFrame = (0, import_core.styled)(import_core.View, {
51
+ name: "FormTrigger"
52
+ });
53
+ var FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
54
+ var {
55
+ scope,
56
+ children,
57
+ onPress,
58
+ ...triggerProps
59
+ } = props;
60
+ var context = useFormContext(scope);
61
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
62
+ role: "button",
63
+ ...triggerProps,
64
+ ref: forwardedRef,
65
+ onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
66
+ children
67
+ });
68
+ });
69
+ var FormComponent = FormFrame.styleable(function Form(param, ref) {
70
+ var {
71
+ scope,
72
+ onSubmit,
73
+ ...props
74
+ } = param;
75
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
76
+ scope,
77
+ onSubmit,
78
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
79
+ ref,
80
+ ...props,
81
+ onSubmit: function (e) {
82
+ e.preventDefault();
83
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
84
+ }
85
+ })
89
86
  });
87
+ });
88
+ var Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
89
+ Trigger: FormTrigger
90
+ });
90
91
  //# sourceMappingURL=Form.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Form_exports","__export","Form","Form2","FormContext","FormFrame","FormProvider","FormTrigger","useFormContext","module","exports","import_jsx_runtime","require","import_core","import_helpers","FORM_NAME","styled","View","name","render","createStyledContext","onSubmit","useStyledContext","Provider","FormTriggerFrame","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","jsx","type","ref","composeEventHandlers","FormComponent","param","e","preventDefault","withStaticProperties","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,YAAA;AAAAC,QAAA,CAAAD,YAAA;EAAAE,IAAA,EAAAA,CAAA,KAAAC,KAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAf,YAAkD,CAAAK,YAAA;AAGlD,IAAAW,kBAAkB,GAAAC,OAEL,oBAAY;EAAAC,WAAO,GAAAD,OAAA,gBAAM;EAAAE,cAAA,GAAAF,OAAA;EAAAG,SAAA;EAAAV,SAAA,OAAAQ,WAAA,CAAAG,MAAA,EAAAH,WAAA,CAAAI,IAAA;IACpCC,IAAA,EAAMH,SAAA;IACNI,MAAA,EAAQ;EACV,CAAC;EAUYf,WAAA,OAAcS,WAAA,CAAAO,mBAAA,EAAsC;IAC/DC,QAAA,EAAU;EACZ,CAAqB;EAER;IAAEC,gBAAA,EAAkBd,cAAA;IAAgBe,QAAA,EAAUjB;EAAa,IAAIF,WAAA;EAYtEoB,gBAAA,OAAmBX,WAAA,CAAAG,MAAA,EAAOH,WAAA,CAAAI,IAAA,EAAM;IACpCC,IAAA,EAAM;EACR,CAAC;EAMYX,WAAA,GAAciB,gBAAA,CAAiBC,SAAA,WAAAC,KAAA,EAAAC,YAAA;IAC1C,IAAC;QAAAC,KAAO;QAAAC,QAAA;QAAAC,OAAiB;QAAA,GAAAC;MAAA,IAAAL,KAAA;MAAAM,OAAA,GAAAxB,cAAA,CAAAoB,KAAA;IACvB,sBAAe,IAAUjB,kBAAY,CAAAsB,GAAA,EAAAT,gBAC/B;MAENL,MAAA,EACE,mBAAAR,kBAAA,CAAAsB,GAAA;QAACC,IAAA;MAAA;MAAA,GAAAH,YACS;MAAsBI,GAAA,EAC7BR,YAAG;MAAAG,OACJ,EAAK,IAAAhB,cAAA,CAAAsB,oBAAA,EAAAN,OAAA,EAAAE,OAAA,CAAAX,QAAA;MAAAQ;IACkD;EAEtD;EAAAQ,aAAA,GAAAhC,SAAA,CAAAoB,SAAA,WAAAa,KAAA,EAAAH,GAAA;IAAA,IACH;MAAAP,KAAA;MAAAP,QAAA;MAAA,GAAAK;IAAA,IAAAY,KAAA;IAEJ,0BAAA3B,kBAAA,CAAAsB,GAAA,EAAA3B,YAAA;MAOIsB,KAAA;MAIJP,QACE;MACGQ,QAAA,qBAAAlB,kBAAA,CAAAsB,GAAA,EAAA5B,SAAA;QAAA8B,GAAA;QACC,GAAAT,KAAA;QACCL,QAAI,WAAAA,CAAAkB,CAAA;UACLA,CAAA,CAAAC,cAAsB,IAAAnB,QAAA;QACpB;MACW;IACb;EAAA,EACF;EAAAlB,KACF,OAAAW,cAAA,CAAA2B,oBAAA,EAAAJ,aAAA;IAEHK,OAEY,EAAAnC;EAA2C,EACtD","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Form_exports","__export","Form","Form2","FormContext","FormFrame","FormProvider","FormTrigger","useFormContext","module","exports","import_jsx_runtime","require","import_core","import_helpers","FORM_NAME","styled","View","name","render","createStyledContext","onSubmit","useStyledContext","Provider","FormTriggerFrame","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","jsx","role","ref","composeEventHandlers","FormComponent","param","e","preventDefault","withStaticProperties","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;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CR,YAAK;IAAAG,OACD,MAAAhB,cAAA,CAAAsB,oBAAA,EAAAN,OAAA,EAAAE,OAAA,CAAAX,QAAA;IAAAQ;EACC;AACkD;AAEtD,IAAAQ,aAAA,GAAAhC,SAAA,CAAAoB,SAAA,UAAAvB,KAAAoC,KAAA,EAAAH,GAAA;EAAA,IACH;IAAAP,KAAA;IAAAP,QAAA;IAAA,GAAAK;EAAA,IAAAY,KAAA;EAEJ,0BAAA3B,kBAAA,CAAAsB,GAAA,EAAA3B,YAAA;IACFsB,KAAA;IAMAP,QAAM;IAIJQ,QACE,qBAAAlB,kBAAA,CAACsB,GAAA,EAAA5B,SAAA,EAAa;MACX8B,GAAA;MAAA,GAAAT,KAAA;MACCL,QAAA,WAAAA,CAAAkB,CAAA;QACCA,CAAI,CAAAC,cAAA;QACLnB,QAAU,KAAC,IAAW,IAAAA,QAAA,uBAAAA,QAAA;MACpB;IACA;EAAW;AACb;AAAA,IACFlB,KACF,OAAAW,cAAA,CAAA2B,oBAAA,EAAAJ,aAAA;EAEHK,OAAA,EAAAnC;AAEM","ignoreList":[]}
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
7
8
  get: () => from[key],
8
9
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
10
  });
10
- return to;
11
- },
12
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
15
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
- value: !0
16
+ value: true
15
17
  }), mod);
16
18
  var index_exports = {};
17
19
  module.exports = __toCommonJS(index_exports);
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
package/dist/esm/Form.mjs CHANGED
@@ -1,58 +1,57 @@
1
1
  import { View, createStyledContext, styled } from "@tamagui/core";
2
2
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
3
3
  import { jsx } from "react/jsx-runtime";
4
- const FORM_NAME = "Form",
5
- FormFrame = styled(View, {
6
- name: FORM_NAME,
7
- render: "form"
8
- }),
9
- FormContext = createStyledContext({
10
- onSubmit: void 0
11
- }),
12
- {
13
- useStyledContext: useFormContext,
14
- Provider: FormProvider
15
- } = FormContext,
16
- FormTriggerFrame = styled(View, {
17
- name: "FormTrigger"
18
- }),
19
- FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
20
- const {
21
- scope,
22
- children,
23
- onPress,
24
- ...triggerProps
25
- } = props,
26
- context = useFormContext(scope);
27
- return /* @__PURE__ */jsx(FormTriggerFrame, {
28
- render: /* @__PURE__ */jsx("button", {
29
- type: "submit"
30
- }),
31
- ...triggerProps,
32
- ref: forwardedRef,
33
- onPress: composeEventHandlers(onPress, context.onSubmit),
34
- children
35
- });
36
- }),
37
- FormComponent = FormFrame.styleable(function ({
4
+ const FORM_NAME = "Form";
5
+ const FormFrame = styled(View, {
6
+ name: FORM_NAME,
7
+ render: "form"
8
+ });
9
+ const FormContext = createStyledContext({
10
+ onSubmit: void 0
11
+ });
12
+ const {
13
+ useStyledContext: useFormContext,
14
+ Provider: FormProvider
15
+ } = FormContext;
16
+ const FormTriggerFrame = styled(View, {
17
+ name: "FormTrigger"
18
+ });
19
+ const FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
20
+ const {
21
+ scope,
22
+ children,
23
+ onPress,
24
+ ...triggerProps
25
+ } = props;
26
+ const context = useFormContext(scope);
27
+ return /* @__PURE__ */jsx(FormTriggerFrame, {
28
+ role: "button",
29
+ ...triggerProps,
30
+ ref: forwardedRef,
31
+ onPress: composeEventHandlers(onPress, context.onSubmit),
32
+ children
33
+ });
34
+ });
35
+ const FormComponent = FormFrame.styleable(function Form({
36
+ scope,
37
+ onSubmit,
38
+ ...props
39
+ }, ref) {
40
+ return /* @__PURE__ */jsx(FormProvider, {
38
41
  scope,
39
42
  onSubmit,
40
- ...props
41
- }, ref) {
42
- return /* @__PURE__ */jsx(FormProvider, {
43
- scope,
44
- onSubmit,
45
- children: /* @__PURE__ */jsx(FormFrame, {
46
- ref,
47
- ...props,
48
- onSubmit: e => {
49
- e.preventDefault(), onSubmit?.();
50
- }
51
- })
52
- });
53
- }),
54
- Form2 = withStaticProperties(FormComponent, {
55
- Trigger: FormTrigger
43
+ children: /* @__PURE__ */jsx(FormFrame, {
44
+ ref,
45
+ ...props,
46
+ onSubmit: e => {
47
+ e.preventDefault();
48
+ onSubmit?.();
49
+ }
50
+ })
56
51
  });
52
+ });
53
+ const Form2 = withStaticProperties(FormComponent, {
54
+ Trigger: FormTrigger
55
+ });
57
56
  export { Form2 as Form, FormContext, FormFrame, FormProvider, FormTrigger, useFormContext };
58
57
  //# sourceMappingURL=Form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","createStyledContext","styled","composeEventHandlers","withStaticProperties","jsx","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","type","ref","FormComponent","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,EAAMC,mBAAA,EAAqBC,MAAA,QAAc;AAClD,SAASC,oBA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,CACF;EAEJ,CAAC;EAEYoB,KAAA,GAAO3B,oBAAA,CAAqBwB,aAAA,EAAe;IACtDI,OAAA,EAASf;EACX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","createStyledContext","styled","composeEventHandlers","withStaticProperties","jsx","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","role","ref","FormComponent","Form","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,EAAMC,mBAAA,EAAqBC,MAAA,QAAc;AAClD,SAASC,oBAAA,EAAsBC,oBAAA,QAA4B;AA+CrD,SAAAC,GAAA;AA7CN,MAAMC,SAAA,GAAY;AAEX,MAAMC,SAAA,GAAYL,MAAA,CAAOF,IAAA,EAAM;EACpCQ,IAAA,EAAMF,SAAA;EACNG,MAAA,EAAQ;AACV,CAAC;AAUM,MAAMC,WAAA,GAAcT,mBAAA,CAAsC;EAC/DU,QAAA,EAAU;AACZ,CAAqB;AAEd,MAAM;EAAEC,gBAAA,EAAkBC,cAAA;EAAgBC,QAAA,EAAUC;AAAa,IAAIL,WAAA;AAY5E,MAAMM,gBAAA,GAAmBd,MAAA,CAAOF,IAAA,EAAM;EACpCQ,IAAA,EAAM;AACR,CAAC;AAMM,MAAMS,WAAA,GAAcD,gBAAA,CAAiBE,SAAA,CAC1C,CAACC,KAAA,EAAOC,YAAA,KAAiB;EACvB,MAAM;IAAEC,KAAA;IAAOC,QAAA;IAAUC,OAAA;IAAS,GAAGC;EAAa,IAAIL,KAAA;EACtD,MAAMM,OAAA,GAAUZ,cAAA,CAAeQ,KAAK;EAEpC,OACE,eAAAhB,GAAA,CAACW,gBAAA;IACCU,IAAA,EAAK;IACJ,GAAGF,YAAA;IACJG,GAAA,EAAKP,YAAA;IACLG,OAAA,EAASpB,oBAAA,CAAqBoB,OAAA,EAASE,OAAA,CAAQd,QAAQ;IAEtDW;EAAA,CACH;AAEJ,CACF;AAMA,MAAMM,aAAA,GAAgBrB,SAAA,CAAUW,SAAA,CAA0B,SAASW,KACjE;EAAER,KAAA;EAAOV,QAAA;EAAU,GAAGQ;AAAM,GAC5BQ,GAAA,EACA;EACA,OACE,eAAAtB,GAAA,CAACU,YAAA;IAAaM,KAAA;IAAcV,QAAA;IAC1BW,QAAA,iBAAAjB,GAAA,CAACE,SAAA;MACCoB,GAAA;MACC,GAAIR,KAAA;MACLR,QAAA,EAAWmB,CAAA,IAAW;QACpBA,CAAA,CAAEC,cAAA,CAAe;QACjBpB,QAAA,GAAW;MACb;IAAA,CACF;EAAA,CACF;AAEJ,CAAC;AAEM,MAAMqB,KAAA,GAAO5B,oBAAA,CAAqBwB,aAAA,EAAe;EACtDK,OAAA,EAAShB;AACX,CAAC","ignoreList":[]}
@@ -1,59 +1,58 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { View, createStyledContext, styled } from "@tamagui/core";
3
3
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
4
- var FORM_NAME = "Form",
5
- FormFrame = styled(View, {
6
- name: FORM_NAME,
7
- render: "form"
8
- }),
9
- FormContext = createStyledContext({
10
- onSubmit: void 0
11
- }),
12
- {
13
- useStyledContext: useFormContext,
14
- Provider: FormProvider
15
- } = FormContext,
16
- FormTriggerFrame = styled(View, {
17
- name: "FormTrigger"
18
- }),
19
- FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
20
- var {
21
- scope,
22
- children,
23
- onPress,
24
- ...triggerProps
25
- } = props,
26
- context = useFormContext(scope);
27
- return /* @__PURE__ */_jsx(FormTriggerFrame, {
28
- render: /* @__PURE__ */_jsx("button", {
29
- type: "submit"
30
- }),
31
- ...triggerProps,
32
- ref: forwardedRef,
33
- onPress: composeEventHandlers(onPress, context.onSubmit),
34
- children
35
- });
36
- }),
37
- FormComponent = FormFrame.styleable(function (param, ref) {
38
- var {
39
- scope,
40
- onSubmit,
41
- ...props
42
- } = param;
43
- return /* @__PURE__ */_jsx(FormProvider, {
44
- scope,
45
- onSubmit,
46
- children: /* @__PURE__ */_jsx(FormFrame, {
47
- ref,
48
- ...props,
49
- onSubmit: function (e) {
50
- e.preventDefault(), onSubmit?.();
51
- }
52
- })
53
- });
54
- }),
55
- Form2 = withStaticProperties(FormComponent, {
56
- Trigger: FormTrigger
4
+ var FORM_NAME = "Form";
5
+ var FormFrame = styled(View, {
6
+ name: FORM_NAME,
7
+ render: "form"
8
+ });
9
+ var FormContext = createStyledContext({
10
+ onSubmit: void 0
11
+ });
12
+ var {
13
+ useStyledContext: useFormContext,
14
+ Provider: FormProvider
15
+ } = FormContext;
16
+ var FormTriggerFrame = styled(View, {
17
+ name: "FormTrigger"
18
+ });
19
+ var FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
20
+ var {
21
+ scope,
22
+ children,
23
+ onPress,
24
+ ...triggerProps
25
+ } = props;
26
+ var context = useFormContext(scope);
27
+ return /* @__PURE__ */_jsx(FormTriggerFrame, {
28
+ role: "button",
29
+ ...triggerProps,
30
+ ref: forwardedRef,
31
+ onPress: composeEventHandlers(onPress, context.onSubmit),
32
+ children
57
33
  });
34
+ });
35
+ var FormComponent = FormFrame.styleable(function Form(param, ref) {
36
+ var {
37
+ scope,
38
+ onSubmit,
39
+ ...props
40
+ } = param;
41
+ return /* @__PURE__ */_jsx(FormProvider, {
42
+ scope,
43
+ onSubmit,
44
+ children: /* @__PURE__ */_jsx(FormFrame, {
45
+ ref,
46
+ ...props,
47
+ onSubmit: function (e) {
48
+ e.preventDefault();
49
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
50
+ }
51
+ })
52
+ });
53
+ });
54
+ var Form2 = withStaticProperties(FormComponent, {
55
+ Trigger: FormTrigger
56
+ });
58
57
  export { Form2 as Form, FormContext, FormFrame, FormProvider, FormTrigger, useFormContext };
59
58
  //# sourceMappingURL=Form.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["jsx","_jsx","View","createStyledContext","styled","composeEventHandlers","withStaticProperties","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","type","ref","FormComponent","param","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAMC,IAAA,2BAAqB;AACpC,SAASC,IAAA,EAAAC,mBAAsB,EAAAC,MAAA,uBAA4B;AAgD3C,SAAAC,oBAAA,EAAAC,oBAAA;AA9ChB,IAAAC,SAAM,SAAY;EAAAC,SAEL,GAAAJ,MAAY,CAAAF,IAAO;IAC9BO,IAAA,EAAMF,SAAA;IACNG,MAAA,EAAQ;EACV,CAAC;EAUYC,WAAA,GAAcR,mBAAA,CAAsC;IAC/DS,QAAA,EAAU;EACZ,CAAqB;EAER;IAAEC,gBAAA,EAAkBC,cAAA;IAAgBC,QAAA,EAAUC;EAAa,IAAIL,WAAA;EAYtEM,gBAAA,GAAmBb,MAAA,CAAOF,IAAA,EAAM;IACpCO,IAAA,EAAM;EACR,CAAC;EAMYS,WAAA,GAAcD,gBAAA,CAAiBE,SAAA,WAAAC,KAAA,EAAAC,YAAA;IAC1C,IAAC;QAAAC,KAAO;QAAAC,QAAA;QAAAC,OAAiB;QAAA,GAAAC;MAAA,IAAAL,KAAA;MAAAM,OAAA,GAAAZ,cAAA,CAAAQ,KAAA;IACvB,sBAAerB,IAAU,CAAAgB,gBAAY;MAGrCP,MAAA,EACE,eAAAT,IAAA;QAAC0B,IAAA;MAAA;MAAA,GAAAF,YACS;MAAsBG,GAAA,EAC7BP,YAAG;MAAAG,OACJ,EAAKnB,oBAAA,CAAAmB,OAAA,EAAAE,OAAA,CAAAd,QAAA;MAAAW;IACkD;EAEtD;EAAAM,aAAA,GAAArB,SAAA,CAAAW,SAAA,WAAAW,KAAA,EAAAF,GAAA;IAAA,IACH;MAAAN,KAAA;MAAAV,QAAA;MAAA,GAAAQ;IAAA,IAAAU,KAAA;IAEJ,sBAAA7B,IAAA,CAAAe,YAAA;MAOIM,KAAA;MAIJV,QACE;MACGW,QAAA,iBAAAtB,IAAA,CAAAO,SAAA;QAAAoB,GAAA;QACC,GAAAR,KAAA;QACCR,QAAI,WAAAA,CAAAmB,CAAA;UACLA,CAAA,CAAAC,cAAsB,IAAApB,QAAA;QACpB;MACW;IACb;EAAA,EACF;EAAAqB,KACF,GAAA3B,oBAAA,CAAAuB,aAAA;IAEHK,OAEY,EAAAhB;EAA2C,EACtD;AACF,S","ignoreList":[]}
1
+ {"version":3,"names":["jsx","_jsx","View","createStyledContext","styled","composeEventHandlers","withStaticProperties","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","role","ref","FormComponent","Form","param","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAMC,IAAA,2BAAqB;AACpC,SAASC,IAAA,EAAAC,mBAAsB,EAAAC,MAAA,uBAA4B;AA+CrD,SAAAC,oBAAA,EAAAC,oBAAA;AA7CN,IAAAC,SAAM,SAAY;AAEX,IAAAC,SAAM,GAAAJ,MAAY,CAAAF,IAAO;EAC9BO,IAAA,EAAMF,SAAA;EACNG,MAAA,EAAQ;AACV,CAAC;AAUM,IAAAC,WAAM,GAAAR,mBAAc;EACzBS,QAAA,EAAU;AACZ,CAAqB;AAEd;EAAMC,gBAAE,EAAAC,cAAkB;EAAAC,QAAgB,EAAAC;AAAU,IAAaL,WAAI;AAY5E,IAAAM,gBAAM,GAAAb,MAAmB,CAAAF,IAAO;EAC9BO,IAAA,EAAM;AACR,CAAC;AAMM,IAAAS,WAAM,GAAAD,gBAAc,CAAAE,SAAiB,WAAAC,KAAA,EAAAC,YAAA;EAC1C,IAAC;IAAAC,KAAO;IAAAC,QAAA;IAAAC,OAAiB;IAAA,GAAAC;EAAA,IAAAL,KAAA;EACvB,IAAAM,OAAQ,GAAAZ,cAAiB,CAAAQ,KAAA;EACzB,sBAAgBrB,IAAA,CAAAgB,gBAAoB;IAEpCU,IAAA,UACE;IAAA,GAACF,YAAA;IAAAG,GAAA,EAAAP,YAAA;IAAAG,OACC,EAAAnB,oBAAK,CAAAmB,OAAA,EAAAE,OAAA,CAAAd,QAAA;IAAAW;EACD;AACC;AACkD,IAAAM,aAEtD,GAAArB,SAAA,CAAAW,SAAA,UAAAW,KAAAC,KAAA,EAAAH,GAAA;EAAA;IAAAN,KAAA;IAAAV,QAAA;IAAA,GAAAQ;EAAA,IAAAW,KAAA;EAAA,OACH,eAAA9B,IAAA,CAAAe,YAAA;IAEJM,KAAA;IACFV,QAAA;IAMAW,QAAM,iBAAgBtB,IAAU,CAAAO,SAA0B;MAIxDoB,GACE;MACG,GAAAR,KAAA;MAAAR,QAAA,WAAAA,CAAAoB,CAAA;QACCA,CAAA,CAAAC,cAAA;QACCrB,QAAI,aAAAA,QAAA,uBAAAA,QAAA;MACL;IACE;EACA;AAAW;AACb,IAAAsB,KAAA,GAAA5B,oBAAA,CAAAuB,aAAA;EACFM,OACF,EAAAjB;AAEJ,CAAC;AAEM,SACLgB,KAAA,IAASJ,IAAA,EACVnB,WAAA,E","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Form";
1
+ export * from "./Form.mjs";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
package/dist/jsx/Form.mjs CHANGED
@@ -1,58 +1,57 @@
1
1
  import { View, createStyledContext, styled } from "@tamagui/core";
2
2
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
3
3
  import { jsx } from "react/jsx-runtime";
4
- const FORM_NAME = "Form",
5
- FormFrame = styled(View, {
6
- name: FORM_NAME,
7
- render: "form"
8
- }),
9
- FormContext = createStyledContext({
10
- onSubmit: void 0
11
- }),
12
- {
13
- useStyledContext: useFormContext,
14
- Provider: FormProvider
15
- } = FormContext,
16
- FormTriggerFrame = styled(View, {
17
- name: "FormTrigger"
18
- }),
19
- FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
20
- const {
21
- scope,
22
- children,
23
- onPress,
24
- ...triggerProps
25
- } = props,
26
- context = useFormContext(scope);
27
- return /* @__PURE__ */jsx(FormTriggerFrame, {
28
- render: /* @__PURE__ */jsx("button", {
29
- type: "submit"
30
- }),
31
- ...triggerProps,
32
- ref: forwardedRef,
33
- onPress: composeEventHandlers(onPress, context.onSubmit),
34
- children
35
- });
36
- }),
37
- FormComponent = FormFrame.styleable(function ({
4
+ const FORM_NAME = "Form";
5
+ const FormFrame = styled(View, {
6
+ name: FORM_NAME,
7
+ render: "form"
8
+ });
9
+ const FormContext = createStyledContext({
10
+ onSubmit: void 0
11
+ });
12
+ const {
13
+ useStyledContext: useFormContext,
14
+ Provider: FormProvider
15
+ } = FormContext;
16
+ const FormTriggerFrame = styled(View, {
17
+ name: "FormTrigger"
18
+ });
19
+ const FormTrigger = FormTriggerFrame.styleable((props, forwardedRef) => {
20
+ const {
21
+ scope,
22
+ children,
23
+ onPress,
24
+ ...triggerProps
25
+ } = props;
26
+ const context = useFormContext(scope);
27
+ return /* @__PURE__ */jsx(FormTriggerFrame, {
28
+ role: "button",
29
+ ...triggerProps,
30
+ ref: forwardedRef,
31
+ onPress: composeEventHandlers(onPress, context.onSubmit),
32
+ children
33
+ });
34
+ });
35
+ const FormComponent = FormFrame.styleable(function Form({
36
+ scope,
37
+ onSubmit,
38
+ ...props
39
+ }, ref) {
40
+ return /* @__PURE__ */jsx(FormProvider, {
38
41
  scope,
39
42
  onSubmit,
40
- ...props
41
- }, ref) {
42
- return /* @__PURE__ */jsx(FormProvider, {
43
- scope,
44
- onSubmit,
45
- children: /* @__PURE__ */jsx(FormFrame, {
46
- ref,
47
- ...props,
48
- onSubmit: e => {
49
- e.preventDefault(), onSubmit?.();
50
- }
51
- })
52
- });
53
- }),
54
- Form2 = withStaticProperties(FormComponent, {
55
- Trigger: FormTrigger
43
+ children: /* @__PURE__ */jsx(FormFrame, {
44
+ ref,
45
+ ...props,
46
+ onSubmit: e => {
47
+ e.preventDefault();
48
+ onSubmit?.();
49
+ }
50
+ })
56
51
  });
52
+ });
53
+ const Form2 = withStaticProperties(FormComponent, {
54
+ Trigger: FormTrigger
55
+ });
57
56
  export { Form2 as Form, FormContext, FormFrame, FormProvider, FormTrigger, useFormContext };
58
57
  //# sourceMappingURL=Form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","createStyledContext","styled","composeEventHandlers","withStaticProperties","jsx","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","type","ref","FormComponent","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,EAAMC,mBAAA,EAAqBC,MAAA,QAAc;AAClD,SAASC,oBAAA,EAAsBC,oBAAA,QAA4B;AAgD3C,SAAAC,GAAA;AA9ChB,MAAMC,SAAA,GAAY;EAELC,SAAA,GAAYL,MAAA,CAAOF,IAAA,EAAM;IACpCQ,IAAA,EAAMF,SAAA;IACNG,MAAA,EAAQ;EACV,CAAC;EAUYC,WAAA,GAAcT,mBAAA,CAAsC;IAC/DU,QAAA,EAAU;EACZ,CAAqB;EAER;IAAEC,gBAAA,EAAkBC,cAAA;IAAgBC,QAAA,EAAUC;EAAa,IAAIL,WAAA;EAYtEM,gBAAA,GAAmBd,MAAA,CAAOF,IAAA,EAAM;IACpCQ,IAAA,EAAM;EACR,CAAC;EAMYS,WAAA,GAAcD,gBAAA,CAAiBE,SAAA,CAC1C,CAACC,KAAA,EAAOC,YAAA,KAAiB;IACvB,MAAM;QAAEC,KAAA;QAAOC,QAAA;QAAUC,OAAA;QAAS,GAAGC;MAAa,IAAIL,KAAA;MAChDM,OAAA,GAAUZ,cAAA,CAAeQ,KAAK;IAEpC,OACE,eAAAhB,GAAA,CAACW,gBAAA;MACCP,MAAA,EAAQ,eAAAJ,GAAA,CAAC;QAAOqB,IAAA,EAAK;MAAA,CAAS;MAC7B,GAAGF,YAAA;MACJG,GAAA,EAAKP,YAAA;MACLG,OAAA,EAASpB,oBAAA,CAAqBoB,OAAA,EAASE,OAAA,CAAQd,QAAQ;MAEtDW;IAAA,CACH;EAEJ,CACF;EAMMM,aAAA,GAAgBrB,SAAA,CAAUW,SAAA,CAA0B,UACxD;IAAEG,KAAA;IAAOV,QAAA;IAAU,GAAGQ;EAAM,GAC5BQ,GAAA,EACA;IACA,OACE,eAAAtB,GAAA,CAACU,YAAA;MAAaM,KAAA;MAAcV,QAAA;MAC1BW,QAAA,iBAAAjB,GAAA,CAACE,SAAA;QACCoB,GAAA;QACC,GAAIR,KAAA;QACLR,QAAA,EAAWkB,CAAA,IAAW;UACpBA,CAAA,CAAEC,cAAA,CAAe,GACjBnB,QAAA,GAAW;QACb;MAAA,CACF;IAAA,CACF;EAEJ,CAAC;EAEYoB,KAAA,GAAO3B,oBAAA,CAAqBwB,aAAA,EAAe;IACtDI,OAAA,EAASf;EACX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","createStyledContext","styled","composeEventHandlers","withStaticProperties","jsx","FORM_NAME","FormFrame","name","render","FormContext","onSubmit","useStyledContext","useFormContext","Provider","FormProvider","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","role","ref","FormComponent","Form","e","preventDefault","Form2","Trigger"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings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A,CAAEC,cAAA,CAAe;QACjBpB,QAAA,GAAW;MACb;IAAA,CACF;EAAA,CACF;AAEJ,CAAC;AAEM,MAAMqB,KAAA,GAAO5B,oBAAA,CAAqBwB,aAAA,EAAe;EACtDK,OAAA,EAAShB;AACX,CAAC","ignoreList":[]}
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var Form_exports = {};
24
26
  __export(Form_exports, {
@@ -30,61 +32,60 @@ __export(Form_exports, {
30
32
  useFormContext: () => useFormContext
31
33
  });
32
34
  module.exports = __toCommonJS(Form_exports);
33
- var import_jsx_runtime = require("react/jsx-runtime"),
34
- import_core = require("@tamagui/core"),
35
- import_helpers = require("@tamagui/helpers"),
36
- FORM_NAME = "Form",
37
- FormFrame = (0, import_core.styled)(import_core.View, {
38
- name: FORM_NAME,
39
- render: "form"
40
- }),
41
- FormContext = (0, import_core.createStyledContext)({
42
- onSubmit: void 0
43
- }),
44
- {
45
- useStyledContext: useFormContext,
46
- Provider: FormProvider
47
- } = FormContext,
48
- FormTriggerFrame = (0, import_core.styled)(import_core.View, {
49
- name: "FormTrigger"
50
- }),
51
- FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
52
- var {
53
- scope,
54
- children,
55
- onPress,
56
- ...triggerProps
57
- } = props,
58
- context = useFormContext(scope);
59
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
60
- render: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
61
- type: "submit"
62
- }),
63
- ...triggerProps,
64
- ref: forwardedRef,
65
- onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
66
- children
67
- });
68
- }),
69
- FormComponent = FormFrame.styleable(function (param, ref) {
70
- var {
71
- scope,
72
- onSubmit,
73
- ...props
74
- } = param;
75
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
76
- scope,
77
- onSubmit,
78
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
79
- ref,
80
- ...props,
81
- onSubmit: function (e) {
82
- e.preventDefault(), onSubmit?.();
83
- }
84
- })
85
- });
86
- }),
87
- Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
88
- Trigger: FormTrigger
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_core = require("@tamagui/core");
37
+ var import_helpers = require("@tamagui/helpers");
38
+ var FORM_NAME = "Form";
39
+ var FormFrame = (0, import_core.styled)(import_core.View, {
40
+ name: FORM_NAME,
41
+ render: "form"
42
+ });
43
+ var FormContext = (0, import_core.createStyledContext)({
44
+ onSubmit: void 0
45
+ });
46
+ var {
47
+ useStyledContext: useFormContext,
48
+ Provider: FormProvider
49
+ } = FormContext;
50
+ var FormTriggerFrame = (0, import_core.styled)(import_core.View, {
51
+ name: "FormTrigger"
52
+ });
53
+ var FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
54
+ var {
55
+ scope,
56
+ children,
57
+ onPress,
58
+ ...triggerProps
59
+ } = props;
60
+ var context = useFormContext(scope);
61
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormTriggerFrame, {
62
+ role: "button",
63
+ ...triggerProps,
64
+ ref: forwardedRef,
65
+ onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
66
+ children
67
+ });
68
+ });
69
+ var FormComponent = FormFrame.styleable(function Form(param, ref) {
70
+ var {
71
+ scope,
72
+ onSubmit,
73
+ ...props
74
+ } = param;
75
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormProvider, {
76
+ scope,
77
+ onSubmit,
78
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FormFrame, {
79
+ ref,
80
+ ...props,
81
+ onSubmit: function (e) {
82
+ e.preventDefault();
83
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
84
+ }
85
+ })
89
86
  });
87
+ });
88
+ var Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
89
+ Trigger: FormTrigger
90
+ });
90
91
  //# sourceMappingURL=Form.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","Form_exports","Form","Form2","FormContext","FormFrame","FormProvider","FormTrigger","useFormContext","module","exports","import_jsx_runtime","require","import_core","import_helpers","FORM_NAME","styled","View","render","createStyledContext","onSubmit","useStyledContext","Provider","FormTriggerFrame","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","jsx","type"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,YAAS;;AACT,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAAsB;AAgDf,IAAAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AA9ChB,IAAAC,iBA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E,GAAAC,OAAC,oBAA2B;EAAAC,WAC1B,GAAAD,OAAA;EAAAE,cAAA,GAAAF,OAAA;EAAAG,SAAA;EAAAV,SAAA,OAAAQ,WAAA,CAAAG,MAAA,EAAAH,WAAA,CAAAI,IAAA;IAAA7B,IAAC,EAAA2B,SAAA;IAAAG,MAAA;EAAA;EAAAd,WACC,OAAAS,WAAA,CAAAM,mBAAA;IAAAC,QACK;EAAA;EAAA;IACLC,gBAAW,EAAWb,cAAA;IAAAc,QAAA,EAAAhB;EAAA,IAAAF,WAAA;EAAAmB,gBAAA,OAAAV,WAAA,CAAAG,MAAA,EAAAH,WAAA,CAAAI,IAAA;IACpB7B,IAAA;EACW;EAAAmB,WACb,GAAAgB,gBAAA,CAAAC,SAAA,WAAAC,KAAA,EAAAC,YAAA;IAAA;QAAAC,KAAA;QAAAC,QAAA;QAAAC,OAAA;QAAA,GAAAC;MAAA,IAAAL,KAAA;MAAAM,OAAA,GAAAvB,cAAA,CAAAmB,KAAA;IACF,OACF,mBAAAhB,kBAAA,CAAAqB,GAAA,EAAAT,gBAAA;MAISL,MAAA,EAAO,mBAAAP,kBAAoC,CAAAqB,GAAA;QACtDC,IAAA,EAAS;MACV","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","Form_exports","Form","Form2","FormContext","FormFrame","FormProvider","FormTrigger","useFormContext","module","exports","import_jsx_runtime","require","import_core","import_helpers","FORM_NAME","styled","View","render","createStyledContext","onSubmit","useStyledContext","Provider","FormTriggerFrame","styleable","props","forwardedRef","scope","children","onPress","triggerProps","context","jsx"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,YAAS;;AACT,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAAsB;AA+CzB,IAAAC,gBA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AA,CAAAC,OAAA,GAAAZ,YAAA,CAAAG,YAAA;AAAA,IACHU,kBAAA,GAAAC,OAAA;AAAA,IAEJC,WAAA,GAAAD,OAAA;AACF,IAAAE,cAAA,GAAAF,OAAA;AAMA,IAAAG,SAAM,SAAgB;AAIpB,IAAAV,SACE,OAAAQ,WAAC,CAAAG,MAAA,EAAAH,WAAa,CAAcI,IAAA;EAC1B7B,IAAC,EAAA2B,SAAA;EAAAG,MAAA;AAAA;AACC,IAAAd,WACK,OAAAS,WAAA,CAAAM,mBAAA;EAAAC,QACL,OAAW;AACT;AACA;EAAAC,gBAAW,EAAAb,cAAA;EAAAc,QAAA,EAAAhB;AAAA,IAAAF,WAAA;AAAA,IAAAmB,gBACb,OAAAV,WAAA,CAAAG,MAAA,EAAAH,WAAA,CAAAI,IAAA;EAAA7B,IAAA;AAAA,EACF;AAGN,IAACmB,WAAA,GAAAgB,gBAAA,CAAAC,SAAA,WAAAC,KAAA,EAAAC,YAAA;EAEM,IAAM;IAAAC,KAAA;IAAOC,QAAA;IAAAC,OAAA;IAAA,GAAqBC;EAAe,IAAAL,KAAA;EACtD,IAAAM,OAAS,GAAAvB,cAAA,CAAAmB,KAAA;EACV,0BAAAhB,kBAAA,CAAAqB,GAAA,EAAAT,gBAAA","ignoreList":[]}
package/dist/jsx/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Form";
1
+ export * from "./Form.mjs";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/form",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.0.0-rc.40",
4
4
  "source": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -18,15 +18,12 @@
18
18
  "./package.json": "./package.json",
19
19
  ".": {
20
20
  "types": "./types/index.d.ts",
21
- "react-native": {
22
- "module": "./dist/esm/index.native.js",
23
- "import": "./dist/esm/index.native.js",
24
- "require": "./dist/cjs/index.native.js"
25
- },
21
+ "react-native": "./dist/esm/index.native.js",
22
+ "browser": "./dist/esm/index.mjs",
26
23
  "module": "./dist/esm/index.mjs",
27
24
  "import": "./dist/esm/index.mjs",
28
25
  "require": "./dist/cjs/index.cjs",
29
- "default": "./dist/cjs/index.native.js"
26
+ "default": "./dist/esm/index.mjs"
30
27
  }
31
28
  },
32
29
  "publishConfig": {
@@ -39,11 +36,11 @@
39
36
  "clean:build": "tamagui-build clean:build"
40
37
  },
41
38
  "dependencies": {
42
- "@tamagui/core": "2.0.0-rc.4",
43
- "@tamagui/helpers": "2.0.0-rc.4"
39
+ "@tamagui/core": "2.0.0-rc.40",
40
+ "@tamagui/helpers": "2.0.0-rc.40"
44
41
  },
45
42
  "devDependencies": {
46
- "@tamagui/build": "2.0.0-rc.4",
43
+ "@tamagui/build": "2.0.0-rc.40",
47
44
  "react": ">=19"
48
45
  },
49
46
  "peerDependencies": {
package/src/Form.tsx CHANGED
@@ -48,7 +48,7 @@ export const FormTrigger = FormTriggerFrame.styleable<FormTriggerProps>(
48
48
 
49
49
  return (
50
50
  <FormTriggerFrame
51
- render={<button type="submit" />}
51
+ role="button"
52
52
  {...triggerProps}
53
53
  ref={forwardedRef}
54
54
  onPress={composeEventHandlers(onPress, context.onSubmit)}
package/dist/cjs/Form.js DELETED
@@ -1,61 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var Form_exports = {};
16
- __export(Form_exports, {
17
- Form: () => Form2,
18
- FormContext: () => FormContext,
19
- FormFrame: () => FormFrame,
20
- FormProvider: () => FormProvider,
21
- FormTrigger: () => FormTrigger,
22
- useFormContext: () => useFormContext
23
- });
24
- module.exports = __toCommonJS(Form_exports);
25
- var import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_jsx_runtime = require("react/jsx-runtime");
26
- const FORM_NAME = "Form", FormFrame = (0, import_core.styled)(import_core.View, {
27
- name: FORM_NAME,
28
- render: "form"
29
- }), FormContext = (0, import_core.createStyledContext)({
30
- onSubmit: void 0
31
- }), { useStyledContext: useFormContext, Provider: FormProvider } = FormContext, FormTriggerFrame = (0, import_core.styled)(import_core.View, {
32
- name: "FormTrigger"
33
- }), FormTrigger = FormTriggerFrame.styleable(
34
- (props, forwardedRef) => {
35
- const { scope, children, onPress, ...triggerProps } = props, context = useFormContext(scope);
36
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
- FormTriggerFrame,
38
- {
39
- render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit" }),
40
- ...triggerProps,
41
- ref: forwardedRef,
42
- onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
43
- children
44
- }
45
- );
46
- }
47
- ), FormComponent = FormFrame.styleable(function({ scope, onSubmit, ...props }, ref) {
48
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormProvider, { scope, onSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
- FormFrame,
50
- {
51
- ref,
52
- ...props,
53
- onSubmit: (e) => {
54
- e.preventDefault(), onSubmit?.();
55
- }
56
- }
57
- ) });
58
- }), Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
59
- Trigger: FormTrigger
60
- });
61
- //# sourceMappingURL=Form.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Form.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,cAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAkD,0BAClD,iBAA2D,6BAgD3C;AA9ChB,MAAM,YAAY,QAEL,gBAAY,oBAAO,kBAAM;AAAA,EACpC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC,GAUY,kBAAc,iCAAsC;AAAA,EAC/D,UAAU;AACZ,CAAqB,GAER,EAAE,kBAAkB,gBAAgB,UAAU,aAAa,IAAI,aAYtE,uBAAmB,oBAAO,kBAAM;AAAA,EACpC,MAAM;AACR,CAAC,GAMY,cAAc,iBAAiB;AAAA,EAC1C,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,OAAO,UAAU,SAAS,GAAG,aAAa,IAAI,OAChD,UAAU,eAAe,KAAK;AAEpC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,4CAAC,YAAO,MAAK,UAAS;AAAA,QAC7B,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,qCAAqB,SAAS,QAAQ,QAAQ;AAAA,QAEtD;AAAA;AAAA,IACH;AAAA,EAEJ;AACF,GAMM,gBAAgB,UAAU,UAA0B,SACxD,EAAE,OAAO,UAAU,GAAG,MAAM,GAC5B,KACA;AACA,SACE,4CAAC,gBAAa,OAAc,UAC1B;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI;AAAA,MACL,UAAU,CAAC,MAAW;AACpB,UAAE,eAAe,GACjB,WAAW;AAAA,MACb;AAAA;AAAA,EACF,GACF;AAEJ,CAAC,GAEYA,YAAO,qCAAqB,eAAe;AAAA,EACtD,SAAS;AACX,CAAC;",
5
- "names": ["Form"]
6
- }
package/dist/cjs/index.js DELETED
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./Form"), module.exports);
15
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,mBAAd;",
5
- "names": []
6
- }
package/dist/esm/Form.js DELETED
@@ -1,47 +0,0 @@
1
- import { View, createStyledContext, styled } from "@tamagui/core";
2
- import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
3
- import { jsx } from "react/jsx-runtime";
4
- const FORM_NAME = "Form", FormFrame = styled(View, {
5
- name: FORM_NAME,
6
- render: "form"
7
- }), FormContext = createStyledContext({
8
- onSubmit: void 0
9
- }), { useStyledContext: useFormContext, Provider: FormProvider } = FormContext, FormTriggerFrame = styled(View, {
10
- name: "FormTrigger"
11
- }), FormTrigger = FormTriggerFrame.styleable(
12
- (props, forwardedRef) => {
13
- const { scope, children, onPress, ...triggerProps } = props, context = useFormContext(scope);
14
- return /* @__PURE__ */ jsx(
15
- FormTriggerFrame,
16
- {
17
- render: /* @__PURE__ */ jsx("button", { type: "submit" }),
18
- ...triggerProps,
19
- ref: forwardedRef,
20
- onPress: composeEventHandlers(onPress, context.onSubmit),
21
- children
22
- }
23
- );
24
- }
25
- ), FormComponent = FormFrame.styleable(function({ scope, onSubmit, ...props }, ref) {
26
- return /* @__PURE__ */ jsx(FormProvider, { scope, onSubmit, children: /* @__PURE__ */ jsx(
27
- FormFrame,
28
- {
29
- ref,
30
- ...props,
31
- onSubmit: (e) => {
32
- e.preventDefault(), onSubmit?.();
33
- }
34
- }
35
- ) });
36
- }), Form2 = withStaticProperties(FormComponent, {
37
- Trigger: FormTrigger
38
- });
39
- export {
40
- Form2 as Form,
41
- FormContext,
42
- FormFrame,
43
- FormProvider,
44
- FormTrigger,
45
- useFormContext
46
- };
47
- //# sourceMappingURL=Form.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Form.tsx"],
4
- "mappings": "AACA,SAAS,MAAM,qBAAqB,cAAc;AAClD,SAAS,sBAAsB,4BAA4B;AAgD3C;AA9ChB,MAAM,YAAY,QAEL,YAAY,OAAO,MAAM;AAAA,EACpC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC,GAUY,cAAc,oBAAsC;AAAA,EAC/D,UAAU;AACZ,CAAqB,GAER,EAAE,kBAAkB,gBAAgB,UAAU,aAAa,IAAI,aAYtE,mBAAmB,OAAO,MAAM;AAAA,EACpC,MAAM;AACR,CAAC,GAMY,cAAc,iBAAiB;AAAA,EAC1C,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,OAAO,UAAU,SAAS,GAAG,aAAa,IAAI,OAChD,UAAU,eAAe,KAAK;AAEpC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,oBAAC,YAAO,MAAK,UAAS;AAAA,QAC7B,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,SAAS,QAAQ,QAAQ;AAAA,QAEtD;AAAA;AAAA,IACH;AAAA,EAEJ;AACF,GAMM,gBAAgB,UAAU,UAA0B,SACxD,EAAE,OAAO,UAAU,GAAG,MAAM,GAC5B,KACA;AACA,SACE,oBAAC,gBAAa,OAAc,UAC1B;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI;AAAA,MACL,UAAU,CAAC,MAAW;AACpB,UAAE,eAAe,GACjB,WAAW;AAAA,MACb;AAAA;AAAA,EACF,GACF;AAEJ,CAAC,GAEYA,QAAO,qBAAqB,eAAe;AAAA,EACtD,SAAS;AACX,CAAC;",
5
- "names": ["Form"]
6
- }
package/dist/jsx/Form.js DELETED
@@ -1,47 +0,0 @@
1
- import { View, createStyledContext, styled } from "@tamagui/core";
2
- import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
3
- import { jsx } from "react/jsx-runtime";
4
- const FORM_NAME = "Form", FormFrame = styled(View, {
5
- name: FORM_NAME,
6
- render: "form"
7
- }), FormContext = createStyledContext({
8
- onSubmit: void 0
9
- }), { useStyledContext: useFormContext, Provider: FormProvider } = FormContext, FormTriggerFrame = styled(View, {
10
- name: "FormTrigger"
11
- }), FormTrigger = FormTriggerFrame.styleable(
12
- (props, forwardedRef) => {
13
- const { scope, children, onPress, ...triggerProps } = props, context = useFormContext(scope);
14
- return /* @__PURE__ */ jsx(
15
- FormTriggerFrame,
16
- {
17
- render: /* @__PURE__ */ jsx("button", { type: "submit" }),
18
- ...triggerProps,
19
- ref: forwardedRef,
20
- onPress: composeEventHandlers(onPress, context.onSubmit),
21
- children
22
- }
23
- );
24
- }
25
- ), FormComponent = FormFrame.styleable(function({ scope, onSubmit, ...props }, ref) {
26
- return /* @__PURE__ */ jsx(FormProvider, { scope, onSubmit, children: /* @__PURE__ */ jsx(
27
- FormFrame,
28
- {
29
- ref,
30
- ...props,
31
- onSubmit: (e) => {
32
- e.preventDefault(), onSubmit?.();
33
- }
34
- }
35
- ) });
36
- }), Form2 = withStaticProperties(FormComponent, {
37
- Trigger: FormTrigger
38
- });
39
- export {
40
- Form2 as Form,
41
- FormContext,
42
- FormFrame,
43
- FormProvider,
44
- FormTrigger,
45
- useFormContext
46
- };
47
- //# sourceMappingURL=Form.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Form.tsx"],
4
- "mappings": "AACA,SAAS,MAAM,qBAAqB,cAAc;AAClD,SAAS,sBAAsB,4BAA4B;AAgD3C;AA9ChB,MAAM,YAAY,QAEL,YAAY,OAAO,MAAM;AAAA,EACpC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC,GAUY,cAAc,oBAAsC;AAAA,EAC/D,UAAU;AACZ,CAAqB,GAER,EAAE,kBAAkB,gBAAgB,UAAU,aAAa,IAAI,aAYtE,mBAAmB,OAAO,MAAM;AAAA,EACpC,MAAM;AACR,CAAC,GAMY,cAAc,iBAAiB;AAAA,EAC1C,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,OAAO,UAAU,SAAS,GAAG,aAAa,IAAI,OAChD,UAAU,eAAe,KAAK;AAEpC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,oBAAC,YAAO,MAAK,UAAS;AAAA,QAC7B,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,SAAS,QAAQ,QAAQ;AAAA,QAEtD;AAAA;AAAA,IACH;AAAA,EAEJ;AACF,GAMM,gBAAgB,UAAU,UAA0B,SACxD,EAAE,OAAO,UAAU,GAAG,MAAM,GAC5B,KACA;AACA,SACE,oBAAC,gBAAa,OAAc,UAC1B;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAI;AAAA,MACL,UAAU,CAAC,MAAW;AACpB,UAAE,eAAe,GACjB,WAAW;AAAA,MACb;AAAA;AAAA,EACF,GACF;AAEJ,CAAC,GAEYA,QAAO,qBAAqB,eAAe;AAAA,EACtD,SAAS;AACX,CAAC;",
5
- "names": ["Form"]
6
- }