@tamagui/input 2.7.7 → 3.0.0-beta.643.1

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.
Files changed (168) hide show
  1. package/dist/cjs/Input.cjs +78 -162
  2. package/dist/cjs/Input.native.cjs +209 -0
  3. package/dist/cjs/Input.native.js +186 -282
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +10 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +19 -0
  7. package/dist/cjs/InputNativeProps.native.js +10 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +25 -38
  10. package/dist/cjs/TextArea.native.cjs +41 -0
  11. package/dist/cjs/TextArea.native.js +25 -37
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +16 -17
  14. package/dist/cjs/index.native.cjs +33 -0
  15. package/dist/cjs/index.native.js +16 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +115 -122
  18. package/dist/cjs/shared.native.cjs +144 -0
  19. package/dist/cjs/shared.native.js +120 -126
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +10 -11
  22. package/dist/cjs/types.native.cjs +19 -0
  23. package/dist/cjs/types.native.js +10 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +63 -137
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +172 -259
  28. package/dist/esm/Input.native.js.map +1 -1
  29. package/dist/esm/InputNativeProps.mjs +0 -2
  30. package/dist/esm/InputNativeProps.native.js +0 -2
  31. package/dist/esm/TextArea.mjs +12 -20
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -20
  34. package/dist/esm/TextArea.native.js.map +1 -1
  35. package/dist/esm/index.js +6 -4
  36. package/dist/esm/index.mjs +6 -4
  37. package/dist/esm/index.native.js +6 -4
  38. package/dist/esm/shared.mjs +99 -104
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +104 -109
  41. package/dist/esm/shared.native.js.map +1 -1
  42. package/dist/esm/types.mjs +0 -2
  43. package/dist/esm/types.native.js +0 -2
  44. package/dist/jsx/Input.mjs +63 -137
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +209 -0
  47. package/dist/jsx/Input.native.js +186 -282
  48. package/dist/jsx/Input.native.js.map +1 -1
  49. package/dist/jsx/InputNativeProps.mjs +0 -2
  50. package/dist/jsx/InputNativeProps.native.cjs +19 -0
  51. package/dist/jsx/InputNativeProps.native.js +10 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -20
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +41 -0
  56. package/dist/jsx/TextArea.native.js +25 -37
  57. package/dist/jsx/TextArea.native.js.map +1 -1
  58. package/dist/jsx/index.js +6 -4
  59. package/dist/jsx/index.mjs +6 -4
  60. package/dist/jsx/index.native.cjs +33 -0
  61. package/dist/jsx/index.native.js +16 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +99 -104
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +144 -0
  66. package/dist/jsx/shared.native.js +120 -126
  67. package/dist/jsx/shared.native.js.map +1 -1
  68. package/dist/jsx/types.mjs +0 -2
  69. package/dist/jsx/types.native.cjs +19 -0
  70. package/dist/jsx/types.native.js +10 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +13 -15
  73. package/src/Input.native.tsx +263 -240
  74. package/src/Input.tsx +162 -152
  75. package/src/TextArea.tsx +6 -14
  76. package/src/shared.tsx +65 -70
  77. package/src/types.ts +1 -1
  78. package/types/Input.d.ts +57 -41
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +57 -41
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +172 -24
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +14 -99
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +1 -1
  87. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  88. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  89. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  90. package/dist/cjs/v1/Input.cjs +0 -200
  91. package/dist/cjs/v1/Input.native.js +0 -183
  92. package/dist/cjs/v1/Input.native.js.map +0 -1
  93. package/dist/cjs/v1/TextArea.cjs +0 -52
  94. package/dist/cjs/v1/TextArea.native.js +0 -55
  95. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  96. package/dist/cjs/v1/index.cjs +0 -21
  97. package/dist/cjs/v1/index.native.js +0 -24
  98. package/dist/cjs/v1/index.native.js.map +0 -1
  99. package/dist/cjs/v1/types.cjs +0 -18
  100. package/dist/cjs/v1/types.native.js +0 -21
  101. package/dist/cjs/v1/types.native.js.map +0 -1
  102. package/dist/esm/InputNativeProps.mjs.map +0 -1
  103. package/dist/esm/InputNativeProps.native.js.map +0 -1
  104. package/dist/esm/index.js.map +0 -1
  105. package/dist/esm/index.mjs.map +0 -1
  106. package/dist/esm/index.native.js.map +0 -1
  107. package/dist/esm/inputTypes.test-d.mjs +0 -129
  108. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  109. package/dist/esm/inputTypes.test-d.native.js +0 -129
  110. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  111. package/dist/esm/types.mjs.map +0 -1
  112. package/dist/esm/types.native.js.map +0 -1
  113. package/dist/esm/v1/Input.mjs +0 -164
  114. package/dist/esm/v1/Input.mjs.map +0 -1
  115. package/dist/esm/v1/Input.native.js +0 -144
  116. package/dist/esm/v1/Input.native.js.map +0 -1
  117. package/dist/esm/v1/TextArea.mjs +0 -27
  118. package/dist/esm/v1/TextArea.mjs.map +0 -1
  119. package/dist/esm/v1/TextArea.native.js +0 -27
  120. package/dist/esm/v1/TextArea.native.js.map +0 -1
  121. package/dist/esm/v1/index.mjs +0 -3
  122. package/dist/esm/v1/index.mjs.map +0 -1
  123. package/dist/esm/v1/index.native.js +0 -3
  124. package/dist/esm/v1/index.native.js.map +0 -1
  125. package/dist/esm/v1/types.mjs +0 -2
  126. package/dist/esm/v1/types.mjs.map +0 -1
  127. package/dist/esm/v1/types.native.js +0 -2
  128. package/dist/esm/v1/types.native.js.map +0 -1
  129. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  130. package/dist/jsx/index.js.map +0 -1
  131. package/dist/jsx/index.mjs.map +0 -1
  132. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  133. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  134. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  135. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  136. package/dist/jsx/types.mjs.map +0 -1
  137. package/dist/jsx/v1/Input.mjs +0 -164
  138. package/dist/jsx/v1/Input.mjs.map +0 -1
  139. package/dist/jsx/v1/Input.native.js +0 -183
  140. package/dist/jsx/v1/Input.native.js.map +0 -1
  141. package/dist/jsx/v1/TextArea.mjs +0 -27
  142. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  143. package/dist/jsx/v1/TextArea.native.js +0 -55
  144. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  145. package/dist/jsx/v1/index.mjs +0 -3
  146. package/dist/jsx/v1/index.mjs.map +0 -1
  147. package/dist/jsx/v1/index.native.js +0 -24
  148. package/dist/jsx/v1/index.native.js.map +0 -1
  149. package/dist/jsx/v1/types.mjs +0 -2
  150. package/dist/jsx/v1/types.mjs.map +0 -1
  151. package/dist/jsx/v1/types.native.js +0 -21
  152. package/dist/jsx/v1/types.native.js.map +0 -1
  153. package/src/inputTypes.test-d.ts +0 -245
  154. package/src/v1/Input.native.tsx +0 -153
  155. package/src/v1/Input.tsx +0 -190
  156. package/src/v1/TextArea.tsx +0 -35
  157. package/src/v1/index.ts +0 -3
  158. package/src/v1/types.ts +0 -65
  159. package/types/v1/Input.d.ts +0 -64
  160. package/types/v1/Input.d.ts.map +0 -1
  161. package/types/v1/Input.native.d.ts +0 -63
  162. package/types/v1/Input.native.d.ts.map +0 -1
  163. package/types/v1/TextArea.d.ts +0 -41
  164. package/types/v1/TextArea.d.ts.map +0 -1
  165. package/types/v1/index.d.ts +0 -4
  166. package/types/v1/index.d.ts.map +0 -1
  167. package/types/v1/types.d.ts +0 -39
  168. package/types/v1/types.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["styled","Input","defaultStyles","textAreaSizeVariant","TextArea","name","render","whiteSpace","variants","unstyled","false","height","rows","size","defaultVariants","process","env","TAMAGUI_HEADLESS"],"sources":["../../src/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAwBA,MAAA,QAAc;AACtC,SAASC,KAAA,QAAa;AACtB,SAASC,aAAA,EAAeC,mBAAA,QAA2B;AAM5C,MAAMC,QAAA,GAAWJ,MAAA,CAAOC,KAAA,EAAO;EACpCI,IAAA,EAAM;EACNC,MAAA,EAAQ;EAAA;EAAA;EAIRC,UAAA,EAAY;EAEZC,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO;QACLC,MAAA,EAAQ;QACR,GAAGT,aAAA;QACHU,IAAA,EAAM;MACR;IACF;IAEAC,IAAA,EAAM;MACJ,WAAWV;IACb;EACF;EAEAW,eAAA,EAAiB;IACfL,QAAA,EAAUM,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.js","names":[],"sources":["jsx/TextArea.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nimport { Input } from \"./Input\";\nimport { defaultStyles, textAreaSizeVariant } from \"./shared\";\nconst TextArea = styled(Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...defaultStyles,\n rows: 3,\n variants: {\n size: {\n true: textAreaSizeVariant,\n Size: textAreaSizeVariant\n }\n }\n});\nexport {\n TextArea\n};\n//# sourceMappingURL=TextArea.js.map\n"],"mappings":";;;;;AAGA,MAAM,WAAW,OAAO,OAAO;CAC7B,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG;CACH,MAAM;CACN,UAAU,EACR,MAAM;EACJ,MAAM;EACN,MAAM;CACR,EACF;AACF,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var TextArea_exports = {};
25
+ __export(TextArea_exports, { TextArea: () => TextArea });
26
+ module.exports = __toCommonJS(TextArea_exports);
27
+ var import_web = require("@tamagui/web");
28
+ var import_Input = require("./Input.native.js");
29
+ var import_shared = require("./shared.native.js");
30
+ var TextArea = (0, import_web.styled)(import_Input.Input, {
31
+ displayName: "TextArea",
32
+ render: "textarea",
33
+ whiteSpace: "pre-wrap",
34
+ height: "auto",
35
+ ...import_shared.defaultStyles,
36
+ rows: 3,
37
+ variants: { size: {
38
+ true: import_shared.textAreaSizeVariant,
39
+ Size: import_shared.textAreaSizeVariant
40
+ } }
41
+ });
@@ -1,55 +1,43 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  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, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var TextArea_exports = {};
26
- __export(TextArea_exports, {
27
- TextArea: () => TextArea
28
- });
25
+ __export(TextArea_exports, { TextArea: () => TextArea });
29
26
  module.exports = __toCommonJS(TextArea_exports);
30
27
  var import_web = require("@tamagui/web");
31
28
  var import_Input = require("./Input.native.js");
32
29
  var import_shared = require("./shared.native.js");
33
30
  var TextArea = (0, import_web.styled)(import_Input.Input, {
34
- name: "TextArea",
35
- render: "textarea",
36
- // this attribute fixes firefox newline issue
37
- // @ts-ignore
38
- whiteSpace: "pre-wrap",
39
- variants: {
40
- unstyled: {
41
- false: {
42
- height: "auto",
43
- ...import_shared.defaultStyles,
44
- rows: 3
45
- }
46
- },
47
- size: {
48
- "...size": import_shared.textAreaSizeVariant
49
- }
50
- },
51
- defaultVariants: {
52
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
53
- }
31
+ displayName: "TextArea",
32
+ render: "textarea",
33
+ whiteSpace: "pre-wrap",
34
+ height: "auto",
35
+ ...import_shared.defaultStyles,
36
+ rows: 3,
37
+ variants: { size: {
38
+ true: import_shared.textAreaSizeVariant,
39
+ Size: import_shared.textAreaSizeVariant
40
+ } }
54
41
  });
42
+
55
43
  //# sourceMappingURL=TextArea.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","TextArea_exports","TextArea","module","exports","import_web","require","import_Input"],"sources":["../../src/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAwB;;AACxB,IAAAA,SAAS,GAAAC,MAAa,CAAAC,cAAA;AACtB,IAAAC,gBAAS,GAAAF,MAAe,CAAAG,wBAA2B;AAM5C,IAAAC,iBAAiB,GAAOJ,MAAA,CAAOK,mBAAA;AAAA,IACpCC,YAAM,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACNC,QAAQ,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAAA,SAAAC,IAAA,IAAAD,GAAA,EAAAZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AAII,IAEZC,WAAU,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EAAA,IACRF,IAAA,IAAU,OAAAA,IAAA,wBAAAA,IAAA;IAAA,KACR,IAAOG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,OACL,CAAAX,YAAQ,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACRnB,SAAG,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAAA;EACG,OACRE,EAAA;AAAA;AACF,IAEAM,YAAM,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IAAAE,gBACO;AAAAhB,QACb,CAAAgB,gBAAA;EACFC,QAAA,EAAAA,CAAA,KAAAA;AAAA,EAEA;AAAiBC,MACf,CAAAC,OAAU,GAAAN,YAAY,CAAAG,gBAAA,CAAqB;AAAA,IAC7CI,UAAA,GAAAC,OAAA;AACF,IAACC,YAAA,GAAAD,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.native.js","names":[],"sources":["jsx/TextArea.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar TextArea_exports = {};\n__export(TextArea_exports, {\n TextArea: () => TextArea\n});\nmodule.exports = __toCommonJS(TextArea_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_Input = require(\"./Input\");\nvar import_shared = require(\"./shared\");\nvar TextArea = (0, import_web.styled)(import_Input.Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...import_shared.defaultStyles,\n rows: 3,\n variants: {\n size: {\n true: import_shared.textAreaSizeVariant,\n Size: import_shared.textAreaSizeVariant\n }\n }\n});\n//# sourceMappingURL=TextArea.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB,EACzB,gBAAgB,SAClB,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,eAAe,QAAQ,mBAAS;AACpC,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,YAAY,GAAG,WAAW,QAAQ,aAAa,OAAO;CACxD,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG,cAAc;CACjB,MAAM;CACN,UAAU,EACR,MAAM;EACJ,MAAM,cAAc;EACpB,MAAM,cAAc;CACtB,EACF;AACF,CAAC"}
package/dist/jsx/index.js CHANGED
@@ -1,5 +1,7 @@
1
- export * from "./Input.mjs";
2
- export * from "./TextArea.mjs";
3
1
  import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
4
- export { inputSizeVariant, textAreaSizeVariant };
5
- //# sourceMappingURL=index.js.map
2
+
3
+ export * from "./Input.mjs"
4
+
5
+ export * from "./TextArea.mjs"
6
+
7
+ export { inputSizeVariant, textAreaSizeVariant };
@@ -1,5 +1,7 @@
1
- export * from "./Input.mjs";
2
- export * from "./TextArea.mjs";
3
1
  import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
4
- export { inputSizeVariant, textAreaSizeVariant };
5
- //# sourceMappingURL=index.mjs.map
2
+
3
+ export * from "./Input.mjs"
4
+
5
+ export * from "./TextArea.mjs"
6
+
7
+ export { inputSizeVariant, textAreaSizeVariant };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var index_exports = {};
26
+ __export(index_exports, {
27
+ inputSizeVariant: () => import_shared.inputSizeVariant,
28
+ textAreaSizeVariant: () => import_shared.textAreaSizeVariant
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ __reExport(index_exports, require("./Input.native.js"), module.exports);
32
+ __reExport(index_exports, require("./TextArea.native.js"), module.exports);
33
+ var import_shared = require("./shared.native.js");
@@ -1,35 +1,35 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  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, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
23
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
24
- value: true
25
- }), mod);
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
25
  var index_exports = {};
27
26
  __export(index_exports, {
28
- inputSizeVariant: () => import_shared.inputSizeVariant,
29
- textAreaSizeVariant: () => import_shared.textAreaSizeVariant
27
+ inputSizeVariant: () => import_shared.inputSizeVariant,
28
+ textAreaSizeVariant: () => import_shared.textAreaSizeVariant
30
29
  });
31
30
  module.exports = __toCommonJS(index_exports);
32
31
  __reExport(index_exports, require("./Input.native.js"), module.exports);
33
32
  __reExport(index_exports, require("./TextArea.native.js"), module.exports);
34
33
  var import_shared = require("./shared.native.js");
34
+
35
35
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAS,GAAAF,MAAkB,CAAAG,wBAA2B","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["jsx/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n inputSizeVariant: () => import_shared.inputSizeVariant,\n textAreaSizeVariant: () => import_shared.textAreaSizeVariant\n});\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Input\"), module.exports);\n__reExport(index_exports, require(\"./TextArea\"), module.exports);\nvar import_shared = require(\"./shared\");\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,wBAAwB,cAAc;CACtC,2BAA2B,cAAc;AAC3C,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,mBAAS,GAAG,OAAO,OAAO;AAC5D,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,IAAI,gBAAgB,QAAQ,oBAAU"}
@@ -1,115 +1,110 @@
1
- import { Text } from "@tamagui/core";
2
- import { getVariableValue, isWeb } from "@tamagui/core";
3
- import { getButtonSized } from "@tamagui/get-button-sized";
1
+ import { Text, getVariableValue, isWeb, resolveTokenSize } from "@tamagui/core";
4
2
  import { getFontSized } from "@tamagui/get-font-sized";
5
- import { getSpace } from "@tamagui/get-token";
3
+
6
4
  const defaultStyles = {
7
- size: "$true",
8
- fontFamily: "$body",
9
- borderWidth: 1,
10
- outlineWidth: 0,
11
- color: "$color",
12
- ...(isWeb ? {
13
- tabIndex: 0
14
- } : {
15
- focusable: true
16
- }),
17
- borderColor: "$borderColor",
18
- backgroundColor: "$background",
19
- // this fixes a flex bug where it overflows container
20
- minWidth: 0,
21
- hoverStyle: {
22
- borderColor: "$borderColorHover"
23
- },
24
- focusStyle: {
25
- borderColor: "$borderColorFocus"
26
- },
27
- focusVisibleStyle: {
28
- outlineColor: "$outlineColor",
29
- outlineWidth: 2,
30
- outlineStyle: "solid"
31
- }
5
+ size: true,
6
+ outlineWidth: 0,
7
+ tabIndex: 0,
8
+ minWidth: 0
32
9
  };
33
- const inputSizeVariant = (val = "$true", extras) => {
34
- if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
35
- return textAreaSizeVariant(val, extras);
36
- }
37
- const buttonStyles = getButtonSized(val, extras);
38
- const paddingHorizontal = getSpace(val, {
39
- shift: -1,
40
- bounds: [2]
41
- });
42
- const fontStyle = getFontSized(val, extras);
43
- if (!isWeb && fontStyle) {
44
- delete fontStyle["lineHeight"];
45
- }
46
- return {
47
- ...fontStyle,
48
- ...buttonStyles,
49
- paddingHorizontal
50
- };
10
+ const resolveInputFrame = (val, extras) => resolveTokenSize(val, {
11
+ tokens: extras.tokens,
12
+ font: extras.font
13
+ }).frame;
14
+ const inputSizeKeys = [
15
+ "0",
16
+ "0-25",
17
+ "0-5",
18
+ "0-75",
19
+ "1",
20
+ "1-5",
21
+ "2",
22
+ "2-5",
23
+ "3",
24
+ "3-5",
25
+ "4",
26
+ "4-5",
27
+ "5",
28
+ "6",
29
+ "7",
30
+ "8",
31
+ "9",
32
+ "10",
33
+ "11",
34
+ "12",
35
+ "13",
36
+ "14",
37
+ "15",
38
+ "16",
39
+ "17",
40
+ "18",
41
+ "19",
42
+ "20"
43
+ ];
44
+ const getInputPadding = (val, extras, steps) => {
45
+ if (typeof val === "number") {
46
+ return steps === 1 ? Math.max(0, Math.round(val * .6 - 12)) : Math.max(0, Math.round(val * .52 - 11.5));
47
+ }
48
+ const key = val === true ? "4" : val;
49
+ const index = inputSizeKeys.indexOf(key);
50
+ return extras.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];
51
51
  };
52
- const textAreaSizeVariant = (val = "$true", extras) => {
53
- const {
54
- props
55
- } = extras;
56
- const buttonStyles = getButtonSized(val, extras);
57
- const fontStyle = getFontSized(val, extras);
58
- const lines = props.rows ?? props.numberOfLines;
59
- const height = typeof lines === "number" ? lines * getVariableValue(fontStyle.lineHeight) : "auto";
60
- if (!isWeb && fontStyle) {
61
- delete fontStyle["lineHeight"];
62
- }
63
- const paddingVertical = getSpace(val, {
64
- shift: -2,
65
- bounds: [2]
66
- });
67
- const paddingHorizontal = getSpace(val, {
68
- shift: -1,
69
- bounds: [2]
70
- });
71
- return {
72
- ...buttonStyles,
73
- ...fontStyle,
74
- paddingVertical,
75
- paddingHorizontal,
76
- height
77
- };
52
+ const inputSizeVariant = (val = true, extras) => {
53
+ if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
54
+ return textAreaSizeVariant(val, extras);
55
+ }
56
+ const frame = resolveInputFrame(val, extras);
57
+ const fontStyle = getFontSized(val, extras);
58
+ if (!isWeb && fontStyle) {
59
+ delete fontStyle["lineHeight"];
60
+ }
61
+ return {
62
+ ...fontStyle,
63
+ height: frame.size,
64
+ borderRadius: frame.radius,
65
+ paddingHorizontal: getInputPadding(val, extras, 1)
66
+ };
67
+ };
68
+ const textAreaSizeVariant = (val = true, extras) => {
69
+ const { props } = extras;
70
+ const frame = resolveInputFrame(val, extras);
71
+ const fontStyle = getFontSized(val, extras);
72
+ const lines = props.rows ?? props.numberOfLines;
73
+ const height = typeof lines === "number" ? lines * getVariableValue(fontStyle.lineHeight) : "auto";
74
+ if (!isWeb && fontStyle) {
75
+ delete fontStyle["lineHeight"];
76
+ }
77
+ return {
78
+ borderRadius: frame.radius,
79
+ ...fontStyle,
80
+ paddingVertical: getInputPadding(val, extras, 2),
81
+ paddingHorizontal: getInputPadding(val, extras, 1),
82
+ height
83
+ };
78
84
  };
79
85
  const INPUT_NAME = "Input";
80
86
  const styledBody = [{
81
- name: INPUT_NAME,
82
- render: "input",
83
- variants: {
84
- unstyled: {
85
- true: {
86
- // reset browser <input>/<textarea> defaults
87
- outlineWidth: 0,
88
- borderWidth: 0,
89
- backgroundColor: "transparent"
90
- },
91
- false: defaultStyles
92
- },
93
- size: {
94
- "...size": inputSizeVariant
95
- },
96
- disabled: {
97
- true: {}
98
- }
99
- },
100
- defaultVariants: {
101
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
102
- }
87
+ name: INPUT_NAME,
88
+ render: "input",
89
+ ...defaultStyles,
90
+ variants: {
91
+ size: {
92
+ true: inputSizeVariant,
93
+ Size: inputSizeVariant
94
+ },
95
+ disabled: { true: {} }
96
+ }
103
97
  }, {
104
- isInput: true,
105
- accept: {
106
- placeholderTextColor: "color",
107
- selectionColor: "color",
108
- cursorColor: "color",
109
- selectionHandleColor: "color",
110
- underlineColorAndroid: "color"
111
- },
112
- validStyles: Text.staticConfig.validStyles
98
+ isInput: true,
99
+ accept: {
100
+ placeholderTextColor: "color",
101
+ selectionColor: "color",
102
+ cursorColor: "color",
103
+ selectionHandleColor: "color",
104
+ underlineColorAndroid: "color"
105
+ },
106
+ validStyles: Text.staticConfig.validStyles
113
107
  }];
108
+
114
109
  export { INPUT_NAME, defaultStyles, inputSizeVariant, styledBody, textAreaSizeVariant };
115
110
  //# sourceMappingURL=shared.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["Text","getVariableValue","isWeb","getButtonSized","getFontSized","getSpace","defaultStyles","size","fontFamily","borderWidth","outlineWidth","color","tabIndex","focusable","borderColor","backgroundColor","minWidth","hoverStyle","focusStyle","focusVisibleStyle","outlineColor","outlineStyle","inputSizeVariant","val","extras","props","tag","rows","multiline","numberOfLines","textAreaSizeVariant","buttonStyles","paddingHorizontal","shift","bounds","fontStyle","lines","height","lineHeight","paddingVertical","INPUT_NAME","styledBody","name","render","variants","unstyled","true","false","disabled","defaultVariants","process","env","TAMAGUI_HEADLESS","isInput","accept","placeholderTextColor","selectionColor","cursorColor","selectionHandleColor","underlineColorAndroid","validStyles","staticConfig"],"sources":["../../src/shared.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["jsx/shared.js"],"sourcesContent":["import { Text } from \"@tamagui/core\";\nimport { getVariableValue, isWeb, resolveTokenSize } from \"@tamagui/core\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nconst defaultStyles = {\n size: true,\n outlineWidth: 0,\n tabIndex: 0,\n // this fixes a flex bug where it overflows container\n minWidth: 0\n};\nconst resolveInputFrame = (val, extras) => resolveTokenSize(val, { tokens: extras.tokens, font: extras.font }).frame;\nconst inputSizeKeys = [\n \"0\",\n \"0-25\",\n \"0-5\",\n \"0-75\",\n \"1\",\n \"1-5\",\n \"2\",\n \"2-5\",\n \"3\",\n \"3-5\",\n \"4\",\n \"4-5\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"11\",\n \"12\",\n \"13\",\n \"14\",\n \"15\",\n \"16\",\n \"17\",\n \"18\",\n \"19\",\n \"20\"\n];\nconst getInputPadding = (val, extras, steps) => {\n if (typeof val === \"number\") {\n return steps === 1 ? Math.max(0, Math.round(val * 0.6 - 12)) : Math.max(0, Math.round(val * 0.52 - 11.5));\n }\n const key = val === true ? \"4\" : val;\n const index = inputSizeKeys.indexOf(key);\n return extras.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];\n};\nconst inputSizeVariant = (val = true, extras) => {\n if (extras.props.tag === \"textarea\" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {\n return textAreaSizeVariant(val, extras);\n }\n const frame = resolveInputFrame(val, extras);\n const fontStyle = getFontSized(val, extras);\n if (!isWeb && fontStyle) {\n delete fontStyle[\"lineHeight\"];\n }\n return {\n ...fontStyle,\n height: frame.size,\n borderRadius: frame.radius,\n paddingHorizontal: getInputPadding(val, extras, 1)\n };\n};\nconst textAreaSizeVariant = (val = true, extras) => {\n const { props } = extras;\n const frame = resolveInputFrame(val, extras);\n const fontStyle = getFontSized(val, extras);\n const lines = props.rows ?? props.numberOfLines;\n const height = typeof lines === \"number\" ? lines * getVariableValue(fontStyle.lineHeight) : \"auto\";\n if (!isWeb && fontStyle) {\n delete fontStyle[\"lineHeight\"];\n }\n return {\n borderRadius: frame.radius,\n ...fontStyle,\n paddingVertical: getInputPadding(val, extras, 2),\n paddingHorizontal: getInputPadding(val, extras, 1),\n height\n };\n};\nconst INPUT_NAME = \"Input\";\nconst styledBody = [\n {\n name: INPUT_NAME,\n render: \"input\",\n ...defaultStyles,\n variants: {\n size: {\n true: inputSizeVariant,\n Size: inputSizeVariant\n },\n disabled: {\n true: {}\n }\n }\n },\n {\n isInput: true,\n accept: {\n placeholderTextColor: \"color\",\n selectionColor: \"color\",\n cursorColor: \"color\",\n selectionHandleColor: \"color\",\n underlineColorAndroid: \"color\"\n },\n validStyles: Text.staticConfig.validStyles\n }\n];\nexport {\n INPUT_NAME,\n defaultStyles,\n inputSizeVariant,\n styledBody,\n textAreaSizeVariant\n};\n//# sourceMappingURL=shared.js.map\n"],"mappings":";;;;AAGA,MAAM,gBAAgB;CACpB,MAAM;CACN,cAAc;CACd,UAAU;CAEV,UAAU;AACZ;AACA,MAAM,qBAAqB,KAAK,WAAW,iBAAiB,KAAK;CAAE,QAAQ,OAAO;CAAQ,MAAM,OAAO;AAAK,CAAC,EAAE;AAC/G,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,mBAAmB,KAAK,QAAQ,UAAU;CAC9C,IAAI,OAAO,QAAQ,UAAU;EAC3B,OAAO,UAAU,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,KAAM,EAAE,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,MAAO,IAAI,CAAC;CAC1G;CACA,MAAM,MAAM,QAAQ,OAAO,MAAM;CACjC,MAAM,QAAQ,cAAc,QAAQ,GAAG;CACvC,OAAO,OAAO,OAAO,MAAM,cAAc,KAAK,IAAI,GAAG,QAAQ,KAAK;AACpE;AACA,MAAM,oBAAoB,MAAM,MAAM,WAAW;CAC/C,IAAI,OAAO,MAAM,QAAQ,cAAc,OAAO,MAAM,OAAO,KAAK,OAAO,MAAM,aAAa,OAAO,MAAM,gBAAgB,GAAG;EACxH,OAAO,oBAAoB,KAAK,MAAM;CACxC;CACA,MAAM,QAAQ,kBAAkB,KAAK,MAAM;CAC3C,MAAM,YAAY,aAAa,KAAK,MAAM;CAC1C,IAAI,CAAC,SAAS,WAAW;EACvB,OAAO,UAAU;CACnB;CACA,OAAO;EACL,GAAG;EACH,QAAQ,MAAM;EACd,cAAc,MAAM;EACpB,mBAAmB,gBAAgB,KAAK,QAAQ,CAAC;CACnD;AACF;AACA,MAAM,uBAAuB,MAAM,MAAM,WAAW;CAClD,MAAM,EAAE,UAAU;CAClB,MAAM,QAAQ,kBAAkB,KAAK,MAAM;CAC3C,MAAM,YAAY,aAAa,KAAK,MAAM;CAC1C,MAAM,QAAQ,MAAM,QAAQ,MAAM;CAClC,MAAM,SAAS,OAAO,UAAU,WAAW,QAAQ,iBAAiB,UAAU,UAAU,IAAI;CAC5F,IAAI,CAAC,SAAS,WAAW;EACvB,OAAO,UAAU;CACnB;CACA,OAAO;EACL,cAAc,MAAM;EACpB,GAAG;EACH,iBAAiB,gBAAgB,KAAK,QAAQ,CAAC;EAC/C,mBAAmB,gBAAgB,KAAK,QAAQ,CAAC;EACjD;CACF;AACF;AACA,MAAM,aAAa;AACnB,MAAM,aAAa,CACjB;CACE,MAAM;CACN,QAAQ;CACR,GAAG;CACH,UAAU;EACR,MAAM;GACJ,MAAM;GACN,MAAM;EACR;EACA,UAAU,EACR,MAAM,CAAC,EACT;CACF;AACF,GACA;CACE,SAAS;CACT,QAAQ;EACN,sBAAsB;EACtB,gBAAgB;EAChB,aAAa;EACb,sBAAsB;EACtB,uBAAuB;CACzB;CACA,aAAa,KAAK,aAAa;AACjC,CACF"}