@cdx-ui/components 0.0.1-alpha.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 (146) hide show
  1. package/README.md +34 -0
  2. package/lib/commonjs/components/Box/Box.js +30 -0
  3. package/lib/commonjs/components/Box/Box.js.map +1 -0
  4. package/lib/commonjs/components/Box/index.js +17 -0
  5. package/lib/commonjs/components/Box/index.js.map +1 -0
  6. package/lib/commonjs/components/Button/index.js +155 -0
  7. package/lib/commonjs/components/Button/index.js.map +1 -0
  8. package/lib/commonjs/components/Button/styles.js +312 -0
  9. package/lib/commonjs/components/Button/styles.js.map +1 -0
  10. package/lib/commonjs/components/Input/BaseInput.js +13 -0
  11. package/lib/commonjs/components/Input/BaseInput.js.map +1 -0
  12. package/lib/commonjs/components/Input/BaseInput.web.js +50 -0
  13. package/lib/commonjs/components/Input/BaseInput.web.js.map +1 -0
  14. package/lib/commonjs/components/Input/index.js +142 -0
  15. package/lib/commonjs/components/Input/index.js.map +1 -0
  16. package/lib/commonjs/components/Input/styles.js +62 -0
  17. package/lib/commonjs/components/Input/styles.js.map +1 -0
  18. package/lib/commonjs/components/Select/index.js +213 -0
  19. package/lib/commonjs/components/Select/index.js.map +1 -0
  20. package/lib/commonjs/components/Select/styles.js +120 -0
  21. package/lib/commonjs/components/Select/styles.js.map +1 -0
  22. package/lib/commonjs/components/Spinner/Spinner.js +15 -0
  23. package/lib/commonjs/components/Spinner/Spinner.js.map +1 -0
  24. package/lib/commonjs/components/Spinner/index.js +17 -0
  25. package/lib/commonjs/components/Spinner/index.js.map +1 -0
  26. package/lib/commonjs/components/Stack/HStack.js +45 -0
  27. package/lib/commonjs/components/Stack/HStack.js.map +1 -0
  28. package/lib/commonjs/components/Stack/VStack.js +45 -0
  29. package/lib/commonjs/components/Stack/VStack.js.map +1 -0
  30. package/lib/commonjs/components/Stack/index.js +20 -0
  31. package/lib/commonjs/components/Stack/index.js.map +1 -0
  32. package/lib/commonjs/components/Text/Text.js +30 -0
  33. package/lib/commonjs/components/Text/Text.js.map +1 -0
  34. package/lib/commonjs/components/Text/index.js +17 -0
  35. package/lib/commonjs/components/Text/index.js.map +1 -0
  36. package/lib/commonjs/components/index.js +83 -0
  37. package/lib/commonjs/components/index.js.map +1 -0
  38. package/lib/commonjs/index.js +17 -0
  39. package/lib/commonjs/index.js.map +1 -0
  40. package/lib/commonjs/package.json +1 -0
  41. package/lib/commonjs/styles.css +6 -0
  42. package/lib/commonjs/utils/WrapStringChild.js +22 -0
  43. package/lib/commonjs/utils/WrapStringChild.js.map +1 -0
  44. package/lib/module/components/Box/Box.js +26 -0
  45. package/lib/module/components/Box/Box.js.map +1 -0
  46. package/lib/module/components/Box/index.js +4 -0
  47. package/lib/module/components/Box/index.js.map +1 -0
  48. package/lib/module/components/Button/index.js +151 -0
  49. package/lib/module/components/Button/index.js.map +1 -0
  50. package/lib/module/components/Button/styles.js +309 -0
  51. package/lib/module/components/Button/styles.js.map +1 -0
  52. package/lib/module/components/Input/BaseInput.js +4 -0
  53. package/lib/module/components/Input/BaseInput.js.map +1 -0
  54. package/lib/module/components/Input/BaseInput.web.js +45 -0
  55. package/lib/module/components/Input/BaseInput.web.js.map +1 -0
  56. package/lib/module/components/Input/index.js +138 -0
  57. package/lib/module/components/Input/index.js.map +1 -0
  58. package/lib/module/components/Input/styles.js +58 -0
  59. package/lib/module/components/Input/styles.js.map +1 -0
  60. package/lib/module/components/Select/index.js +209 -0
  61. package/lib/module/components/Select/index.js.map +1 -0
  62. package/lib/module/components/Select/styles.js +117 -0
  63. package/lib/module/components/Select/styles.js.map +1 -0
  64. package/lib/module/components/Spinner/Spinner.js +11 -0
  65. package/lib/module/components/Spinner/Spinner.js.map +1 -0
  66. package/lib/module/components/Spinner/index.js +4 -0
  67. package/lib/module/components/Spinner/index.js.map +1 -0
  68. package/lib/module/components/Stack/HStack.js +41 -0
  69. package/lib/module/components/Stack/HStack.js.map +1 -0
  70. package/lib/module/components/Stack/VStack.js +41 -0
  71. package/lib/module/components/Stack/VStack.js.map +1 -0
  72. package/lib/module/components/Stack/index.js +5 -0
  73. package/lib/module/components/Stack/index.js.map +1 -0
  74. package/lib/module/components/Text/Text.js +26 -0
  75. package/lib/module/components/Text/Text.js.map +1 -0
  76. package/lib/module/components/Text/index.js +4 -0
  77. package/lib/module/components/Text/index.js.map +1 -0
  78. package/lib/module/components/index.js +9 -0
  79. package/lib/module/components/index.js.map +1 -0
  80. package/lib/module/index.js +4 -0
  81. package/lib/module/index.js.map +1 -0
  82. package/lib/module/styles.css +6 -0
  83. package/lib/module/utils/WrapStringChild.js +18 -0
  84. package/lib/module/utils/WrapStringChild.js.map +1 -0
  85. package/lib/typescript/components/Box/Box.d.ts +8 -0
  86. package/lib/typescript/components/Box/Box.d.ts.map +1 -0
  87. package/lib/typescript/components/Box/index.d.ts +2 -0
  88. package/lib/typescript/components/Box/index.d.ts.map +1 -0
  89. package/lib/typescript/components/Button/index.d.ts +41 -0
  90. package/lib/typescript/components/Button/index.d.ts.map +1 -0
  91. package/lib/typescript/components/Button/styles.d.ts +23 -0
  92. package/lib/typescript/components/Button/styles.d.ts.map +1 -0
  93. package/lib/typescript/components/Input/BaseInput.d.ts +2 -0
  94. package/lib/typescript/components/Input/BaseInput.d.ts.map +1 -0
  95. package/lib/typescript/components/Input/BaseInput.web.d.ts +3 -0
  96. package/lib/typescript/components/Input/BaseInput.web.d.ts.map +1 -0
  97. package/lib/typescript/components/Input/index.d.ts +32 -0
  98. package/lib/typescript/components/Input/index.d.ts.map +1 -0
  99. package/lib/typescript/components/Input/styles.d.ts +17 -0
  100. package/lib/typescript/components/Input/styles.d.ts.map +1 -0
  101. package/lib/typescript/components/Select/index.d.ts +45 -0
  102. package/lib/typescript/components/Select/index.d.ts.map +1 -0
  103. package/lib/typescript/components/Select/styles.d.ts +22 -0
  104. package/lib/typescript/components/Select/styles.d.ts.map +1 -0
  105. package/lib/typescript/components/Spinner/Spinner.d.ts +5 -0
  106. package/lib/typescript/components/Spinner/Spinner.d.ts.map +1 -0
  107. package/lib/typescript/components/Spinner/index.d.ts +2 -0
  108. package/lib/typescript/components/Spinner/index.d.ts.map +1 -0
  109. package/lib/typescript/components/Stack/HStack.d.ts +20 -0
  110. package/lib/typescript/components/Stack/HStack.d.ts.map +1 -0
  111. package/lib/typescript/components/Stack/VStack.d.ts +20 -0
  112. package/lib/typescript/components/Stack/VStack.d.ts.map +1 -0
  113. package/lib/typescript/components/Stack/index.d.ts +3 -0
  114. package/lib/typescript/components/Stack/index.d.ts.map +1 -0
  115. package/lib/typescript/components/Text/Text.d.ts +11 -0
  116. package/lib/typescript/components/Text/Text.d.ts.map +1 -0
  117. package/lib/typescript/components/Text/index.d.ts +2 -0
  118. package/lib/typescript/components/Text/index.d.ts.map +1 -0
  119. package/lib/typescript/components/index.d.ts +7 -0
  120. package/lib/typescript/components/index.d.ts.map +1 -0
  121. package/lib/typescript/index.d.ts +2 -0
  122. package/lib/typescript/index.d.ts.map +1 -0
  123. package/lib/typescript/utils/WrapStringChild.d.ts +10 -0
  124. package/lib/typescript/utils/WrapStringChild.d.ts.map +1 -0
  125. package/package.json +90 -0
  126. package/src/components/Box/Box.tsx +21 -0
  127. package/src/components/Box/index.ts +1 -0
  128. package/src/components/Button/index.tsx +186 -0
  129. package/src/components/Button/styles.ts +410 -0
  130. package/src/components/Input/BaseInput.tsx +1 -0
  131. package/src/components/Input/BaseInput.web.tsx +41 -0
  132. package/src/components/Input/index.tsx +161 -0
  133. package/src/components/Input/styles.ts +83 -0
  134. package/src/components/Select/index.tsx +215 -0
  135. package/src/components/Select/styles.ts +168 -0
  136. package/src/components/Spinner/Spinner.tsx +10 -0
  137. package/src/components/Spinner/index.ts +1 -0
  138. package/src/components/Stack/HStack.tsx +42 -0
  139. package/src/components/Stack/VStack.tsx +46 -0
  140. package/src/components/Stack/index.ts +2 -0
  141. package/src/components/Text/Text.tsx +58 -0
  142. package/src/components/Text/index.ts +1 -0
  143. package/src/components/index.ts +6 -0
  144. package/src/index.ts +1 -0
  145. package/src/styles.css +6 -0
  146. package/src/utils/WrapStringChild.tsx +25 -0
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VStack = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ // import { spacing } from '@cdx-ui/tokens';
11
+
12
+ // TODO: Integrate with tokens (multiply by spacing)
13
+ const spaceScale = {
14
+ xs: 1,
15
+ sm: 2,
16
+ md: 3,
17
+ lg: 4,
18
+ xl: 5,
19
+ '2xl': 6,
20
+ '3xl': 7,
21
+ '4xl': 8
22
+ };
23
+ const VStack = exports.VStack = /*#__PURE__*/(0, _react.forwardRef)(({
24
+ space,
25
+ reversed,
26
+ style,
27
+ className,
28
+ children,
29
+ ...restProps
30
+ }, ref) => {
31
+ const gap = space ? spaceScale[space] : undefined;
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
33
+ ref: ref,
34
+ className: className,
35
+ style: [{
36
+ flexDirection: reversed ? 'column-reverse' : 'column'
37
+ }, gap ? {
38
+ gap
39
+ } : null, style],
40
+ ...restProps,
41
+ children: children
42
+ });
43
+ });
44
+ VStack.displayName = 'VStack';
45
+ //# sourceMappingURL=VStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_jsxRuntime","spaceScale","xs","sm","md","lg","xl","VStack","exports","forwardRef","space","reversed","style","className","children","restProps","ref","gap","undefined","jsx","View","flexDirection","displayName"],"sourceRoot":"../../../../src","sources":["components/Stack/VStack.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoD,IAAAE,WAAA,GAAAF,OAAA;AACpD;;AAEA;AACA,MAAMG,UAAU,GAAG;EACjBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACL,KAAK,EAAE,CAAC;EACR,KAAK,EAAE,CAAC;EACR,KAAK,EAAE;AACT,CAAU;AAUH,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,gBAAG,IAAAE,iBAAU,EAC9B,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAuB,KAAK;EAC1F,MAAMC,GAAG,GAAGP,KAAK,GAAGT,UAAU,CAACS,KAAK,CAAC,GAAGQ,SAAS;EACjD,oBACE,IAAAlB,WAAA,CAAAmB,GAAA,EAACpB,YAAA,CAAAqB,IAAI;IACHJ,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAEA,SAAU;IACrBD,KAAK,EAAE,CACL;MAAES,aAAa,EAAEV,QAAQ,GAAG,gBAAgB,GAAG;IAAS,CAAC,EACzDM,GAAG,GAAG;MAAEA;IAAI,CAAC,GAAG,IAAI,EACpBL,KAAK,CACL;IAAA,GACEG,SAAS;IAAAD,QAAA,EAEZA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDP,MAAM,CAACe,WAAW,GAAG,QAAQ","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "HStack", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _HStack.HStack;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "VStack", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _VStack.VStack;
16
+ }
17
+ });
18
+ var _HStack = require("./HStack");
19
+ var _VStack = require("./VStack");
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_HStack","require","_VStack"],"sourceRoot":"../../../../src","sources":["components/Stack/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Text = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ const joinClassNames = (...parts) => parts.filter(Boolean).join(' ');
11
+ const buildTypographyClassName = variant => joinClassNames(`[font-family:var(--type-${variant}-family)]`, `[font-weight:var(--type-${variant}-weight)]`, `text-[var(--type-${variant}-size)]`, `leading-[var(--type-${variant}-lineHeight)]`, `tracking-[var(--type-${variant}-letterSpacing)]`, variant === 'overline' ? 'uppercase' : 'normal-case');
12
+ const Text = exports.Text = /*#__PURE__*/(0, _react.forwardRef)(({
13
+ variant,
14
+ children,
15
+ style,
16
+ className,
17
+ ...restProps
18
+ }, ref) => {
19
+ const variantKey = variant ?? 'body1';
20
+ const variantClassName = buildTypographyClassName(variantKey);
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
22
+ ref: ref,
23
+ className: joinClassNames(variantClassName, className),
24
+ style: style,
25
+ ...restProps,
26
+ children: children
27
+ });
28
+ });
29
+ Text.displayName = 'Text';
30
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_jsxRuntime","joinClassNames","parts","filter","Boolean","join","buildTypographyClassName","variant","Text","exports","forwardRef","children","style","className","restProps","ref","variantKey","variantClassName","jsx","displayName"],"sourceRoot":"../../../../src","sources":["components/Text/Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA6E,IAAAE,WAAA,GAAAF,OAAA;AA0B7E,MAAMG,cAAc,GAAGA,CAAC,GAAGC,KAAqC,KAC9DA,KAAK,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AAEjC,MAAMC,wBAAwB,GAAIC,OAA0B,IAC1DN,cAAc,CACZ,2BAA2BM,OAAO,WAAW,EAC7C,2BAA2BA,OAAO,WAAW,EAC7C,oBAAoBA,OAAO,SAAS,EACpC,uBAAuBA,OAAO,eAAe,EAC7C,wBAAwBA,OAAO,kBAAkB,EACjDA,OAAO,KAAK,UAAU,GAAG,WAAW,GAAG,aACzC,CAAC;AAEI,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,gBAAG,IAAAE,iBAAU,EAC5B,CAAC;EAAEH,OAAO;EAAEI,QAAQ;EAAEC,KAAK;EAAEC,SAAS;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAG,KAAK;EAC9D,MAAMC,UAAU,GAAGT,OAAO,IAAI,OAAO;EACrC,MAAMU,gBAAgB,GAAGX,wBAAwB,CAACU,UAAU,CAAC;EAC7D,oBACE,IAAAhB,WAAA,CAAAkB,GAAA,EAACnB,YAAA,CAAAS,IAAM;IACLO,GAAG,EAAEA,GAAI;IACTF,SAAS,EAAEZ,cAAc,CAACgB,gBAAgB,EAAEJ,SAAS,CAAE;IACvDD,KAAK,EAAEA,KAAM;IAAA,GACTE,SAAS;IAAAH,QAAA,EAEZA;EAAQ,CACH,CAAC;AAEb,CACF,CAAC;AAEDH,IAAI,CAACW,WAAW,GAAG,MAAM","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Text = require("./Text");
7
+ Object.keys(_Text).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Text[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Text[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Text","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../src","sources":["components/Text/index.ts"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ HStack: true,
8
+ VStack: true
9
+ };
10
+ Object.defineProperty(exports, "HStack", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Stack.HStack;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "VStack", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _Stack.VStack;
20
+ }
21
+ });
22
+ var _Box = require("./Box");
23
+ Object.keys(_Box).forEach(function (key) {
24
+ if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
+ if (key in exports && exports[key] === _Box[key]) return;
27
+ Object.defineProperty(exports, key, {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _Box[key];
31
+ }
32
+ });
33
+ });
34
+ var _Button = require("./Button");
35
+ Object.keys(_Button).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
38
+ if (key in exports && exports[key] === _Button[key]) return;
39
+ Object.defineProperty(exports, key, {
40
+ enumerable: true,
41
+ get: function () {
42
+ return _Button[key];
43
+ }
44
+ });
45
+ });
46
+ var _Input = require("./Input");
47
+ Object.keys(_Input).forEach(function (key) {
48
+ if (key === "default" || key === "__esModule") return;
49
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
50
+ if (key in exports && exports[key] === _Input[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _Input[key];
55
+ }
56
+ });
57
+ });
58
+ var _Select = require("./Select");
59
+ Object.keys(_Select).forEach(function (key) {
60
+ if (key === "default" || key === "__esModule") return;
61
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
62
+ if (key in exports && exports[key] === _Select[key]) return;
63
+ Object.defineProperty(exports, key, {
64
+ enumerable: true,
65
+ get: function () {
66
+ return _Select[key];
67
+ }
68
+ });
69
+ });
70
+ var _Stack = require("./Stack");
71
+ var _Text = require("./Text");
72
+ Object.keys(_Text).forEach(function (key) {
73
+ if (key === "default" || key === "__esModule") return;
74
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
75
+ if (key in exports && exports[key] === _Text[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _Text[key];
80
+ }
81
+ });
82
+ });
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Box","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Button","_Input","_Select","_Stack","_Text"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAA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AA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,OAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,OAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,MAAA,GAAAhB,OAAA;AACA,IAAAiB,KAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,KAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAa,KAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,KAAA,CAAAb,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _components = require("./components");
7
+ Object.keys(_components).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _components[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _components[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,6 @@
1
+ @source './**/*.{ts,tsx}';
2
+
3
+ /* TODO: Can we keep this? Check with Michael/Jack */
4
+ *:focus {
5
+ outline: none;
6
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WrapStringChild = WrapStringChild;
7
+ var _react = require("react");
8
+ var _Text = require("../components/Text");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /** @deprecated Users should wrap their own children in a Text component themselves */
11
+ function WrapStringChild({
12
+ children,
13
+ textProps
14
+ }) {
15
+ return _react.Children.map(children, child => {
16
+ return typeof child === 'string' || typeof child === 'number' || /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _react.Fragment && child.props && typeof child.props === 'object' && 'children' in child.props && (typeof child.props.children === 'string' || typeof child.props.children === 'number') ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
17
+ ...textProps,
18
+ children: child
19
+ }) : child;
20
+ });
21
+ }
22
+ //# sourceMappingURL=WrapStringChild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_Text","_jsxRuntime","WrapStringChild","children","textProps","Children","map","child","isValidElement","type","Fragment","props","jsx","Text"],"sourceRoot":"../../../src","sources":["utils/WrapStringChild.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAA0D,IAAAE,WAAA,GAAAF,OAAA;AAO1D;AACO,SAASG,eAAeA,CAAC;EAAEC,QAAQ;EAAEC;AAAgC,CAAC,EAAa;EACxF,OAAOC,eAAQ,CAACC,GAAG,CAACH,QAAQ,EAAGI,KAAK,IAAK;IACvC,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IACxB,iBAAAC,qBAAc,EAACD,KAAK,CAAC,IACpBA,KAAK,CAACE,IAAI,KAAKC,eAAQ,IACvBH,KAAK,CAACI,KAAK,IACX,OAAOJ,KAAK,CAACI,KAAK,KAAK,QAAQ,IAC/B,UAAU,IAAIJ,KAAK,CAACI,KAAK,KACxB,OAAOJ,KAAK,CAACI,KAAK,CAACR,QAAQ,KAAK,QAAQ,IAAI,OAAOI,KAAK,CAACI,KAAK,CAACR,QAAQ,KAAK,QAAQ,CAAE,gBACzF,IAAAF,WAAA,CAAAW,GAAA,EAACZ,KAAA,CAAAa,IAAI;MAAA,GAAKT,SAAS;MAAAD,QAAA,EAAGI;IAAK,CAAO,CAAC,GAEnCA,KACD;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ import { forwardRef } from 'react';
4
+ import { View } from 'react-native';
5
+ import { WrapStringChild } from '../../utils/WrapStringChild';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const Box = /*#__PURE__*/forwardRef(({
8
+ style,
9
+ className,
10
+ children,
11
+ textProps,
12
+ ...restProps
13
+ }, ref) => {
14
+ return /*#__PURE__*/_jsx(View, {
15
+ ref: ref,
16
+ style: style,
17
+ className: className,
18
+ ...restProps,
19
+ children: /*#__PURE__*/_jsx(WrapStringChild, {
20
+ textProps: textProps,
21
+ children: children
22
+ })
23
+ });
24
+ });
25
+ Box.displayName = 'Box';
26
+ //# sourceMappingURL=Box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","View","WrapStringChild","jsx","_jsx","Box","style","className","children","textProps","restProps","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Box/Box.tsx"],"mappings":";;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AACrD,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,eAAe,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ9D,OAAO,MAAMC,GAAG,gBAAGL,UAAU,CAC3B,CAAC;EAAEM,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAuB,KAAK;EACpF,oBACEP,IAAA,CAACH,IAAI;IAACU,GAAG,EAAEA,GAAI;IAACL,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAEA,SAAU;IAAA,GAAKG,SAAS;IAAAF,QAAA,eAC/DJ,IAAA,CAACF,eAAe;MAACO,SAAS,EAAEA,SAAU;MAAAD,QAAA,EAAEA;IAAQ,CAAkB;EAAC,CAC/D,CAAC;AAEX,CACF,CAAC;AAEDH,GAAG,CAACO,WAAW,GAAG,KAAK","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from './Box';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Box/index.ts"],"mappings":";;AAAA,cAAc,OAAO","ignoreList":[]}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+
3
+ import { forwardRef } from 'react';
4
+ import { ActivityIndicator, Pressable, Text, View } from 'react-native';
5
+ import { createButton } from '@cdx-ui/primitives';
6
+ import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
7
+ import { buttonGroupVariants, buttonRootVariants, buttonSpinnerVariants, buttonTextVariants } from './styles';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ const SCOPE = 'BUTTON';
10
+ const Root = withStyleContext(Pressable, SCOPE);
11
+ const useButtonStyleContext = () => useStyleContext(SCOPE);
12
+ const ButtonPrimitive = createButton({
13
+ Root,
14
+ Text,
15
+ Group: View,
16
+ Spinner: ActivityIndicator,
17
+ Icon: View
18
+ });
19
+
20
+ // =============================================================================
21
+ // STYLED ROOT COMPONENT
22
+ // =============================================================================
23
+
24
+ const ButtonRoot = /*#__PURE__*/forwardRef(({
25
+ variant = 'solid',
26
+ color = 'primary',
27
+ size = 'md',
28
+ fullWidth = false,
29
+ className,
30
+ children,
31
+ style,
32
+ ...props
33
+ }, ref) => {
34
+ const computedClassName = cn(buttonRootVariants({
35
+ variant,
36
+ color,
37
+ size,
38
+ fullWidth
39
+ }), className);
40
+ return /*#__PURE__*/_jsx(ButtonPrimitive, {
41
+ ref: ref,
42
+ className: computedClassName,
43
+ style: style,
44
+ context: {
45
+ variant,
46
+ color,
47
+ size,
48
+ fullWidth
49
+ },
50
+ ...props,
51
+ children: children
52
+ });
53
+ });
54
+ ButtonRoot.displayName = 'Button';
55
+
56
+ // =============================================================================
57
+ // STYLED TEXT COMPONENT
58
+ // =============================================================================
59
+
60
+ const ButtonLabel = /*#__PURE__*/forwardRef(({
61
+ className,
62
+ children,
63
+ style,
64
+ ...props
65
+ }, ref) => {
66
+ const {
67
+ variant,
68
+ color,
69
+ size
70
+ } = useButtonStyleContext();
71
+ const computedClassName = cn(buttonTextVariants({
72
+ variant,
73
+ color,
74
+ size
75
+ }), className);
76
+ return /*#__PURE__*/_jsx(ButtonPrimitive.Text, {
77
+ ref: ref,
78
+ className: computedClassName,
79
+ style: style,
80
+ ...props,
81
+ children: children
82
+ });
83
+ });
84
+ ButtonLabel.displayName = 'Button.Label';
85
+ const ButtonGroup = /*#__PURE__*/forwardRef(({
86
+ className,
87
+ children,
88
+ style,
89
+ flexDirection = 'row',
90
+ isAttached,
91
+ ...props
92
+ }, ref) => {
93
+ const groupClassName = cn(buttonGroupVariants({
94
+ flexDirection,
95
+ isAttached: !!isAttached
96
+ }), className);
97
+ return /*#__PURE__*/_jsx(ButtonPrimitive.Group, {
98
+ ref: ref,
99
+ className: groupClassName,
100
+ style: [{
101
+ flexDirection
102
+ }, style],
103
+ isAttached: isAttached,
104
+ ...props,
105
+ children: children
106
+ });
107
+ });
108
+ ButtonGroup.displayName = 'Button.Group';
109
+ const ButtonIcon = /*#__PURE__*/forwardRef(({
110
+ className,
111
+ style,
112
+ ...props
113
+ }, ref) => {
114
+ return /*#__PURE__*/_jsx(ButtonPrimitive.Icon, {
115
+ ref: ref,
116
+ className: className,
117
+ style: style,
118
+ ...props
119
+ });
120
+ });
121
+ ButtonIcon.displayName = 'Button.Icon';
122
+ const ButtonSpinner = /*#__PURE__*/forwardRef(({
123
+ className,
124
+ colorClassName,
125
+ style,
126
+ ...props
127
+ }, ref) => {
128
+ const {
129
+ variant,
130
+ color
131
+ } = useButtonStyleContext();
132
+ const computedColorClassName = cn(buttonSpinnerVariants({
133
+ variant,
134
+ color
135
+ }), colorClassName);
136
+ return /*#__PURE__*/_jsx(ButtonPrimitive.Spinner, {
137
+ ref: ref,
138
+ className: className,
139
+ colorClassName: computedColorClassName,
140
+ style: style,
141
+ ...props
142
+ });
143
+ });
144
+ ButtonSpinner.displayName = 'Button.Spinner';
145
+ export const Button = Object.assign(ButtonRoot, {
146
+ Label: ButtonLabel,
147
+ Group: ButtonGroup,
148
+ Icon: ButtonIcon,
149
+ Spinner: ButtonSpinner
150
+ });
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","ActivityIndicator","Pressable","Text","View","createButton","cn","useStyleContext","withStyleContext","buttonGroupVariants","buttonRootVariants","buttonSpinnerVariants","buttonTextVariants","jsx","_jsx","SCOPE","Root","useButtonStyleContext","ButtonPrimitive","Group","Spinner","Icon","ButtonRoot","variant","color","size","fullWidth","className","children","style","props","ref","computedClassName","context","displayName","ButtonLabel","ButtonGroup","flexDirection","isAttached","groupClassName","ButtonIcon","ButtonSpinner","colorClassName","computedColorClassName","Button","Object","assign","Label"],"sourceRoot":"../../../../src","sources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