@draftbit/core 43.2.3-ab8de6.0 → 43.2.3-bd5c77.0

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 (115) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +5 -21
  2. package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
  3. package/lib/commonjs/components/ActionSheet/ActionSheet.js.map +1 -1
  4. package/lib/commonjs/components/DeprecatedButton.js +4 -19
  5. package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
  6. package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
  7. package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
  8. package/lib/commonjs/components/DeprecatedFAB.js +4 -20
  9. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  10. package/lib/commonjs/components/Picker/PickerComponent.android.js +6 -20
  11. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
  12. package/lib/commonjs/components/ProgressCircle.js.map +1 -1
  13. package/lib/commonjs/components/TabView/TabView.js +103 -0
  14. package/lib/commonjs/components/TabView/TabView.js.map +1 -0
  15. package/lib/commonjs/components/TabView/TabViewItem.js +27 -0
  16. package/lib/commonjs/components/TabView/TabViewItem.js.map +1 -0
  17. package/lib/commonjs/components/TabView/index.js +24 -0
  18. package/lib/commonjs/components/TabView/index.js.map +1 -0
  19. package/lib/commonjs/index.js +6 -30
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/commonjs/mappings/Card.js +1 -3
  22. package/lib/commonjs/mappings/Card.js.map +1 -1
  23. package/lib/commonjs/mappings/ImageBackground.js.map +1 -1
  24. package/lib/commonjs/mappings/Layout.js.map +1 -1
  25. package/lib/commonjs/mappings/TabView.js +80 -0
  26. package/lib/commonjs/mappings/TabView.js.map +1 -0
  27. package/lib/commonjs/utilities.js +2 -8
  28. package/lib/commonjs/utilities.js.map +1 -1
  29. package/lib/module/components/ProgressIndicator.js.map +1 -1
  30. package/lib/module/components/TabView/TabView.js +88 -0
  31. package/lib/module/components/TabView/TabView.js.map +1 -0
  32. package/lib/module/components/TabView/TabViewItem.js +19 -0
  33. package/lib/module/components/TabView/TabViewItem.js.map +1 -0
  34. package/lib/module/components/TabView/index.js +3 -0
  35. package/lib/module/components/TabView/index.js.map +1 -0
  36. package/lib/module/index.js +1 -1
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/mappings/ActionSheetCancel.js.map +1 -1
  39. package/lib/module/mappings/TabView.js +71 -0
  40. package/lib/module/mappings/TabView.js.map +1 -0
  41. package/lib/module/utilities.js +2 -4
  42. package/lib/module/utilities.js.map +1 -1
  43. package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
  44. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
  45. package/lib/typescript/src/components/TabView/index.d.ts +2 -0
  46. package/lib/typescript/src/index.d.ts +1 -1
  47. package/lib/typescript/src/mappings/TabView.d.ts +111 -0
  48. package/lib/typescript/src/utilities.d.ts +3 -4
  49. package/package.json +4 -2
  50. package/src/components/TabView/TabView.js +33 -0
  51. package/src/components/TabView/TabView.tsx +97 -0
  52. package/src/components/TabView/TabViewItem.js +5 -0
  53. package/src/components/TabView/TabViewItem.tsx +21 -0
  54. package/src/components/TabView/index.js +2 -0
  55. package/src/components/TabView/index.ts +2 -0
  56. package/src/index.js +1 -1
  57. package/src/index.tsx +1 -9
  58. package/src/mappings/TabView.js +73 -0
  59. package/src/mappings/TabView.ts +80 -0
  60. package/src/utilities.js +1 -6
  61. package/src/utilities.ts +1 -6
  62. package/lib/commonjs/components/Table/index.js +0 -56
  63. package/lib/commonjs/components/Table/index.js.map +0 -1
  64. package/lib/commonjs/components/Table/table.js +0 -36
  65. package/lib/commonjs/components/Table/table.js.map +0 -1
  66. package/lib/commonjs/components/Table/tableCell.js +0 -44
  67. package/lib/commonjs/components/Table/tableCell.js.map +0 -1
  68. package/lib/commonjs/components/Table/tableHeader.js +0 -56
  69. package/lib/commonjs/components/Table/tableHeader.js.map +0 -1
  70. package/lib/commonjs/components/Table/tablePaginator.js +0 -18
  71. package/lib/commonjs/components/Table/tablePaginator.js.map +0 -1
  72. package/lib/commonjs/components/Table/tableRow.js +0 -48
  73. package/lib/commonjs/components/Table/tableRow.js.map +0 -1
  74. package/lib/commonjs/components/Table/tableTitle.js +0 -61
  75. package/lib/commonjs/components/Table/tableTitle.js.map +0 -1
  76. package/lib/commonjs/mappings/Table.js +0 -99
  77. package/lib/commonjs/mappings/Table.js.map +0 -1
  78. package/lib/module/components/Table/index.js +0 -7
  79. package/lib/module/components/Table/index.js.map +0 -1
  80. package/lib/module/components/Table/table.js +0 -24
  81. package/lib/module/components/Table/table.js.map +0 -1
  82. package/lib/module/components/Table/tableCell.js +0 -32
  83. package/lib/module/components/Table/tableCell.js.map +0 -1
  84. package/lib/module/components/Table/tableHeader.js +0 -28
  85. package/lib/module/components/Table/tableHeader.js.map +0 -1
  86. package/lib/module/components/Table/tablePaginator.js +0 -7
  87. package/lib/module/components/Table/tablePaginator.js.map +0 -1
  88. package/lib/module/components/Table/tableRow.js +0 -34
  89. package/lib/module/components/Table/tableRow.js.map +0 -1
  90. package/lib/module/components/Table/tableTitle.js +0 -48
  91. package/lib/module/components/Table/tableTitle.js.map +0 -1
  92. package/lib/module/mappings/Table.js +0 -90
  93. package/lib/module/mappings/Table.js.map +0 -1
  94. package/lib/typescript/src/components/Table/index.d.ts +0 -6
  95. package/lib/typescript/src/components/Table/table.d.ts +0 -8
  96. package/lib/typescript/src/components/Table/tableCell.d.ts +0 -10
  97. package/lib/typescript/src/components/Table/tableHeader.d.ts +0 -12
  98. package/lib/typescript/src/components/Table/tablePaginator.d.ts +0 -3
  99. package/lib/typescript/src/components/Table/tableRow.d.ts +0 -12
  100. package/lib/typescript/src/components/Table/tableTitle.d.ts +0 -12
  101. package/src/components/Table/index.js +0 -6
  102. package/src/components/Table/index.tsx +0 -6
  103. package/src/components/Table/table.js +0 -10
  104. package/src/components/Table/table.tsx +0 -22
  105. package/src/components/Table/tableCell.js +0 -17
  106. package/src/components/Table/tableCell.tsx +0 -37
  107. package/src/components/Table/tableHeader.js +0 -11
  108. package/src/components/Table/tableHeader.tsx +0 -28
  109. package/src/components/Table/tablePaginator.js +0 -5
  110. package/src/components/Table/tablePaginator.tsx +0 -10
  111. package/src/components/Table/tableRow.js +0 -16
  112. package/src/components/Table/tableRow.tsx +0 -31
  113. package/src/components/Table/tableTitle.js +0 -28
  114. package/src/components/Table/tableTitle.tsx +0 -59
  115. package/src/mappings/Table.js +0 -102
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
23
 
24
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
+
24
26
  const AccordionItem = _ref => {
25
27
  let {
26
28
  Icon,
@@ -35,10 +37,9 @@ const AccordionItem = _ref => {
35
37
  textStyles,
36
38
  viewStyles
37
39
  } = (0, _utilities.extractStyles)(style);
38
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
39
- style: [styles.container, viewStyles],
40
- ...rest
41
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
40
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
41
+ style: [styles.container, viewStyles]
42
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
42
43
  style: styles.row
43
44
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
44
45
  name: icon,
@@ -73,22 +74,5 @@ const styles = _reactNative.StyleSheet.create({
73
74
 
74
75
  var _default = (0, _theming.withTheme)(AccordionItem);
75
76
 
76
- exports.default = _default;
77
- //# sourceMappingURL=AccordionItem.js.map flexDirection: "row",
78
- alignItems: "center",
79
- paddingLeft: 8
80
- },
81
- item: {
82
- marginVertical: 6,
83
- paddingLeft: 8
84
- },
85
- content: {
86
- flex: 1,
87
- justifyContent: "center"
88
- }
89
- });
90
-
91
- var _default = (0, _theming.withTheme)(AccordionItem);
92
-
93
77
  exports.default = _default;
94
78
  //# sourceMappingURL=AccordionItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AccordionItem.js"],"names":["AccordionItem","Icon","icon","label","style","iconColor","theme","rest","textStyles","viewStyles","React","createElement","Pressable","styles","container","View","row","name","size","color","colors","primary","item","content","Text","selectable","StyleSheet","create","padding","flexDirection","alignItems","paddingLeft","marginVertical","flex","justifyContent"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,aAAa,GAAG,QAA6D;AAAA,MAA5D;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA,KAArB;AAA4BC,IAAAA,SAA5B;AAAuCC,IAAAA,KAAvC;AAA8C,OAAGC;AAAjD,GAA4D;AAC/E,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,8BAAcL,KAAd,CAAnC;AACA,sBAAQM,KAAK,CAACC,aAAN,CAAoBC,sBAApB,EAA+B;AAAER,IAAAA,KAAK,EAAE,CAACS,MAAM,CAACC,SAAR,EAAmBL,UAAnB,CAAT;AAAyC,OAAGF;AAA5C,GAA/B,eACJG,KAAK,CAACC,aAAN,CAAoBI,iBAApB,EAA0B;AAAEX,IAAAA,KAAK,EAAES,MAAM,CAACG;AAAhB,GAA1B,EACId,IAAI,gBAAIQ,KAAK,CAACC,aAAN,CAAoBV,IAApB,EAA0B;AAAEgB,IAAAA,IAAI,EAAEf,IAAR;AAAcgB,IAAAA,IAAI,EAAE,EAApB;AAAwBC,IAAAA,KAAK,EAAEd,SAAS,IAAIC,KAAK,CAACc,MAAN,CAAaC;AAAzD,GAA1B,CAAJ,GAAqG,IAD7G,eAEIX,KAAK,CAACC,aAAN,CAAoBI,iBAApB,EAA0B;AAAEX,IAAAA,KAAK,EAAE,CAACS,MAAM,CAACS,IAAR,EAAcT,MAAM,CAACU,OAArB;AAAT,GAA1B,eACIb,KAAK,CAACC,aAAN,CAAoBa,aAApB,EAA0B;AAAEC,IAAAA,UAAU,EAAE,KAAd;AAAqBrB,IAAAA,KAAK,EAAEI;AAA5B,GAA1B,EAAoEL,KAApE,CADJ,CAFJ,CADI,CAAR;AAKH,CAPD;;AAQA,MAAMU,MAAM,GAAGa,wBAAWC,MAAX,CAAkB;AAC7Bb,EAAAA,SAAS,EAAE;AACPc,IAAAA,OAAO,EAAE;AADF,GADkB;AAI7BZ,EAAAA,GAAG,EAAE;AACDa,IAAAA,aAAa,EAAE,KADd;AAEDC,IAAAA,UAAU,EAAE,QAFX;AAGDC,IAAAA,WAAW,EAAE;AAHZ,GAJwB;AAS7BT,EAAAA,IAAI,EAAE;AACFU,IAAAA,cAAc,EAAE,CADd;AAEFD,IAAAA,WAAW,EAAE;AAFX,GATuB;AAa7BR,EAAAA,OAAO,EAAE;AACLU,IAAAA,IAAI,EAAE,CADD;AAELC,IAAAA,cAAc,EAAE;AAFX;AAboB,CAAlB,CAAf;;eAkBe,wBAAUlC,aAAV,C","sourcesContent":["import * as React from \"react\";\nimport { Pressable, StyleSheet, View, } from \"react-native\";\nimport Text from \"../Text\";\nimport { extractStyles } from \"../../utilities\";\nimport { withTheme } from \"../../theming\";\nconst AccordionItem = ({ Icon, icon, label, style, iconColor, theme, ...rest }) => {\n const { textStyles, viewStyles } = extractStyles(style);\n return (React.createElement(Pressable, { style: [styles.container, viewStyles], ...rest },\n React.createElement(View, { style: styles.row },\n icon ? (React.createElement(Icon, { name: icon, size: 24, color: iconColor || theme.colors.primary })) : null,\n React.createElement(View, { style: [styles.item, styles.content] },\n React.createElement(Text, { selectable: false, style: textStyles }, label)))));\n};\nconst styles = StyleSheet.create({\n container: {\n padding: 8,\n },\n row: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingLeft: 8,\n },\n item: {\n marginVertical: 6,\n paddingLeft: 8,\n },\n content: {\n flex: 1,\n justifyContent: \"center\",\n },\n});\nexport default withTheme(AccordionItem);\n"]}
1
+ {"version":3,"sources":["AccordionItem.tsx"],"names":["AccordionItem","Icon","icon","label","style","iconColor","theme","rest","textStyles","viewStyles","styles","container","row","colors","primary","item","content","StyleSheet","create","padding","flexDirection","alignItems","paddingLeft","marginVertical","flex","justifyContent"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;AAEA;;AACA;;;;;;;;;;AAWA,MAAMA,aAAa,GAAG,QAQT;AAAA,MARU;AACrBC,IAAAA,IADqB;AAErBC,IAAAA,IAFqB;AAGrBC,IAAAA,KAHqB;AAIrBC,IAAAA,KAJqB;AAKrBC,IAAAA,SALqB;AAMrBC,IAAAA,KANqB;AAOrB,OAAGC;AAPkB,GAQV;AACX,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,8BAAcL,KAAd,CAAnC;AACA,sBACE,oBAAC,sBAAD;AAAW,IAAA,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmBF,UAAnB;AAAlB,KAAsDF,IAAtD,gBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEG,MAAM,CAACE;AAApB,KACGV,IAAI,gBACH,oBAAC,IAAD;AACE,IAAA,IAAI,EAAEA,IADR;AAEE,IAAA,IAAI,EAAE,EAFR;AAGE,IAAA,KAAK,EAAEG,SAAS,IAAIC,KAAK,CAACO,MAAN,CAAaC;AAHnC,IADG,GAMD,IAPN,eAQE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACJ,MAAM,CAACK,IAAR,EAAcL,MAAM,CAACM,OAArB;AAAb,kBACE,oBAAC,aAAD;AAAM,IAAA,UAAU,EAAE,KAAlB;AAAyB,IAAA,KAAK,EAAER;AAAhC,KACGL,KADH,CADF,CARF,CADF,CADF;AAkBD,CA5BD;;AA8BA,MAAMO,MAAM,GAAGO,wBAAWC,MAAX,CAAkB;AAC/BP,EAAAA,SAAS,EAAE;AACTQ,IAAAA,OAAO,EAAE;AADA,GADoB;AAI/BP,EAAAA,GAAG,EAAE;AACHQ,IAAAA,aAAa,EAAE,KADZ;AAEHC,IAAAA,UAAU,EAAE,QAFT;AAGHC,IAAAA,WAAW,EAAE;AAHV,GAJ0B;AAS/BP,EAAAA,IAAI,EAAE;AACJQ,IAAAA,cAAc,EAAE,CADZ;AAEJD,IAAAA,WAAW,EAAE;AAFT,GATyB;AAa/BN,EAAAA,OAAO,EAAE;AACPQ,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,cAAc,EAAE;AAFT;AAbsB,CAAlB,CAAf;;eAmBe,wBAAUzB,aAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n Pressable,\n StyleSheet,\n View,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\n\nimport Text from \"../Text\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { extractStyles } from \"../../utilities\";\nimport { withTheme } from \"../../theming\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\n\ntype Props = {\n icon?: string;\n label: string;\n iconColor?: string;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst AccordionItem = ({\n Icon,\n icon,\n label,\n style,\n iconColor,\n theme,\n ...rest\n}: Props) => {\n const { textStyles, viewStyles } = extractStyles(style);\n return (\n <Pressable style={[styles.container, viewStyles]} {...rest}>\n <View style={styles.row}>\n {icon ? (\n <Icon\n name={icon}\n size={24}\n color={iconColor || theme.colors.primary}\n />\n ) : null}\n <View style={[styles.item, styles.content]}>\n <Text selectable={false} style={textStyles}>\n {label}\n </Text>\n </View>\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n padding: 8,\n },\n row: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingLeft: 8,\n },\n item: {\n marginVertical: 6,\n paddingLeft: 8,\n },\n content: {\n flex: 1,\n justifyContent: \"center\",\n },\n});\n\nexport default withTheme(AccordionItem);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["ActionSheet.js"],"names":["ActionSheet","visible","onClose","children","React","createElement","Portal","Touchable","style","styles","wrapper","onPress","View","overlay","groupWrapper","group","Children","toArray","filter","child","type","ActionSheetCancel","Fragment","StyleSheet","create","flex","display","flexDirection","position","top","left","right","bottom","backgroundColor","opacity","justifyContent","marginBottom","borderRadius","marginHorizontal","marginVertical","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AACA,MAAMA,WAAW,GAAG,QAA4C;AAAA,MAA3C;AAAEC,IAAAA,OAAO,GAAG,KAAZ;AAAmBC,IAAAA,OAAnB;AAA4BC,IAAAA;AAA5B,GAA2C;AAC5D,SAAOF,OAAO,gBAAIG,eAAMC,aAAN,CAAoBC,eAApB,EAA4B,IAA5B,eACdF,eAAMC,aAAN,CAAoBE,kBAApB,EAA+B;AAAEC,IAAAA,KAAK,EAAEC,MAAM,CAACC,OAAhB;AAAyBC,IAAAA,OAAO,EAAET;AAAlC,GAA/B,eACIE,eAAMC,aAAN,CAAoBO,iBAApB,EAA0B;AAAEJ,IAAAA,KAAK,EAAEC,MAAM,CAACI;AAAhB,GAA1B,CADJ,eAEIT,eAAMC,aAAN,CAAoBO,iBAApB,EAA0B;AAAEJ,IAAAA,KAAK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,EAAE,MAJC;AAKVU,IAAAA,YAAY,EAAE;AALJ,GAfe;AAsB7BrB,EAAAA,KAAK,EAAE;AACHW,IAAAA,OAAO,EAAE,MADN;AAEHC,IAAAA,aAAa,EAAE,QAFZ;AAGHU,IAAAA,YAAY,EAAE,EAHX;AAIHC,IAAAA,gBAAgB,EAAE,CAJf;AAKHC,IAAAA,cAAc,EAAE,GALb;AAMHC,IAAAA,QAAQ,EAAE;AANP;AAtBsB,CAAlB,CAAf;;eA+BexC,W","sourcesContent":["import React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport Portal from \"../Portal/Portal\";\nimport Touchable from \"../Touchable\";\nimport ActionSheetCancel from \"./ActionSheetCancel\";\nconst ActionSheet = ({ visible = false, onClose, children }) => {\n return visible ? (React.createElement(Portal, null,\n React.createElement(Touchable, { style: styles.wrapper, onPress: onClose },\n React.createElement(View, { style: styles.overlay }),\n React.createElement(View, { style: styles.groupWrapper },\n React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child?.type !== ActionSheetCancel)),\n React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child.type === ActionSheetCancel)))))) : (React.createElement(React.Fragment, null));\n};\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n },\n overlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"#000000\",\n opacity: 0.3,\n },\n groupWrapper: {\n flex: 1,\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n display: \"flex\",\n marginBottom: 25,\n },\n group: {\n display: \"flex\",\n flexDirection: \"column\",\n borderRadius: 10,\n marginHorizontal: 7,\n marginVertical: 2.5,\n overflow: \"hidden\",\n },\n});\nexport default ActionSheet;\n"]}
1
+ {"version":3,"sources":["ActionSheet.tsx"],"names":["ActionSheet","visible","onClose","children","styles","wrapper","overlay","groupWrapper","group","React","Children","toArray","filter","child","type","ActionSheetCancel","StyleSheet","create","flex","display","flexDirection","position","top","left","right","bottom","backgroundColor","opacity","justifyContent","marginBottom","borderRadius","marginHorizontal","marginVertical","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAQA,MAAMA,WAAW,GAAG,QAAmD;AAAA,MAAlD;AAAEC,IAAAA,OAAO,GAAG,KAAZ;AAAmBC,IAAAA,OAAnB;AAA4BC,IAAAA;AAA5B,GAAkD;AACrE,SAAOF,OAAO,gBACZ,6BAAC,eAAD,qBACE,6BAAC,kBAAD;AAAW,IAAA,KAAK,EAAEG,MAAM,CAACC,OAAzB;AAAkC,IAAA,OAAO,EAAEH;AAA3C,kBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEE,MAAM,CAACE;AAApB,IADF,eAEE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEF,MAAM,CAACG;AAApB,kBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEH,MAAM,CAACI;AAApB,KACGC,eAAMC,QAAN,CAAeC,OAAf,CAAuBR,QAAvB,EAAiCS,MAAjC,CACEC,KAAD,IAAgB,CAAAA,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,IAAP,MAAgBC,0BADjC,CADH,CADF,eAME,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEX,MAAM,CAACI;AAApB,KACGC,eAAMC,QAAN,CAAeC,OAAf,CAAuBR,QAAvB,EAAiCS,MAAjC,CACEC,KAAD,IAAgBA,KAAK,CAACC,IAAN,KAAeC,0BADhC,CADH,CANF,CAFF,CADF,CADY,gBAmBZ,2DAnBF;AAqBD,CAtBD;;AAwBA,MAAMX,MAAM,GAAGY,wBAAWC,MAAX,CAAkB;AAC/BZ,EAAAA,OAAO,EAAE;AACPa,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,OAAO,EAAE,MAFF;AAGPC,IAAAA,aAAa,EAAE;AAHR,GADsB;AAM/Bd,EAAAA,OAAO,EAAE;AACPe,IAAAA,QAAQ,EAAE,UADH;AAEPC,IAAAA,GAAG,EAAE,CAFE;AAGPC,IAAAA,IAAI,EAAE,CAHC;AAIPC,IAAAA,KAAK,EAAE,CAJA;AAKPC,IAAAA,MAAM,EAAE,CALD;AAMPC,IAAAA,eAAe,EAAE,SANV;AAOPC,IAAAA,OAAO,EAAE;AAPF,GANsB;AAe/BpB,EAAAA,YAAY,EAAE;AACZW,IAAAA,IAAI,EAAE,CADM;AAEZE,IAAAA,aAAa,EAAE,QAFH;AAGZQ,IAAAA,cAAc,EAAE,UAHJ;AAIZT,IAAAA,OAAO,EAAE,MAJG;AAKZU,IAAAA,YAAY,EAAE;AALF,GAfiB;AAsB/BrB,EAAAA,KAAK,EAAE;AACLW,IAAAA,OAAO,EAAE,MADJ;AAELC,IAAAA,aAAa,EAAE,QAFV;AAGLU,IAAAA,YAAY,EAAE,EAHT;AAILC,IAAAA,gBAAgB,EAAE,CAJb;AAKLC,IAAAA,cAAc,EAAE,GALX;AAMLC,IAAAA,QAAQ,EAAE;AANL;AAtBwB,CAAlB,CAAf;;eAgCejC,W","sourcesContent":["import React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport Portal from \"../Portal/Portal\";\nimport Touchable from \"../Touchable\";\nimport ActionSheetCancel from \"./ActionSheetCancel\";\n\ninterface Props {\n visible: boolean;\n onClose: () => void;\n children: React.ReactNode;\n}\n\nconst ActionSheet = ({ visible = false, onClose, children }: Props) => {\n return visible ? (\n <Portal>\n <Touchable style={styles.wrapper} onPress={onClose}>\n <View style={styles.overlay} />\n <View style={styles.groupWrapper}>\n <View style={styles.group}>\n {React.Children.toArray(children).filter(\n (child: any) => child?.type !== ActionSheetCancel\n )}\n </View>\n <View style={styles.group}>\n {React.Children.toArray(children).filter(\n (child: any) => child.type === ActionSheetCancel\n )}\n </View>\n </View>\n </Touchable>\n </Portal>\n ) : (\n <></>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n },\n overlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"#000000\",\n opacity: 0.3,\n },\n groupWrapper: {\n flex: 1,\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n display: \"flex\",\n marginBottom: 25,\n },\n group: {\n display: \"flex\",\n flexDirection: \"column\",\n borderRadius: 10,\n marginHorizontal: 7,\n marginVertical: 2.5,\n overflow: \"hidden\",\n },\n});\n\nexport default ActionSheet;\n"]}
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
+
28
30
  const Button = _ref => {
29
31
  let {
30
32
  Icon,
@@ -126,7 +128,7 @@ const Button = _ref => {
126
128
  alignSelf: "stretch",
127
129
  ...margins
128
130
  }
129
- }, /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
131
+ }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
130
132
  onPress: onPress,
131
133
  accessibilityState: {
132
134
  disabled
@@ -134,7 +136,7 @@ const Button = _ref => {
134
136
  accessibilityRole: "button",
135
137
  disabled: disabled || loading,
136
138
  style: [styles.button, buttonStyle, innerStyles]
137
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
139
+ }), /*#__PURE__*/React.createElement(_reactNative.View, {
138
140
  style: styles.content
139
141
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
140
142
  style: iconStyle
@@ -169,22 +171,5 @@ const styles = _reactNative.StyleSheet.create({
169
171
 
170
172
  var _default = (0, _theming.withTheme)(Button);
171
173
 
172
- exports.default = _default;
173
- //# sourceMappingURL=DeprecatedButton.js.map
174
- minWidth: 64,
175
- borderStyle: "solid"
176
- },
177
- content: {
178
- flexDirection: "row",
179
- alignItems: "center",
180
- justifyContent: "center"
181
- },
182
- icon: {
183
- width: _Config.default.buttonIconSize
184
- }
185
- });
186
-
187
- var _default = (0, _theming.withTheme)(Button);
188
-
189
174
  exports.default = _default;
190
175
  //# sourceMappingURL=DeprecatedButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DeprecatedButton.js"],"names":["Button","Icon","icon","disabled","type","loading","labelColor","color","colorOverride","children","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","textStyle","textAlign","marginVertical","marginHorizontal","iconStyle","styles","marginLeft","marginRight","width","Config","buttonIconSize","margin","marginEnd","marginTop","marginBottom","innerStyles","flatten","margins","React","createElement","Elevation","alignSelf","Touchable","accessibilityState","accessibilityRole","button","View","content","name","size","ActivityIndicator","Text","numberOfLines","create","minWidth","borderStyle","flexDirection","alignItems","justifyContent"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,MAAM,GAAG,QAAsN;AAAA,MAArN;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,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B,UAAU,CAACyC,MAAvB;AAA3B,GAA1B,EAAuFjD,QAAvF,CAJJ,CADJ,CADI,CAAR;AAOH,CAxED;;AAyEA,MAAM6B,MAAM,GAAGT,wBAAWqC,MAAX,CAAkB;AAC7BR,EAAAA,MAAM,EAAE;AACJS,IAAAA,QAAQ,EAAE,EADN;AAEJC,IAAAA,WAAW,EAAE;AAFT,GADqB;AAK7BR,EAAAA,OAAO,EAAE;AACLS,IAAAA,aAAa,EAAE,KADV;AAELC,IAAAA,UAAU,EAAE,QAFP;AAGLC,IAAAA,cAAc,EAAE;AAHX,GALoB;AAU7BrE,EAAAA,IAAI,EAAE;AACFuC,IAAAA,KAAK,EAAEC,gBAAOC;AADZ;AAVuB,CAAlB,CAAf;;eAce,wBAAU3C,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport { ActivityIndicator, View, Text, StyleSheet, } from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nconst Button = ({ Icon, icon, disabled = false, type = \"solid\", loading = false, labelColor, color: colorOverride, children, onPress, elevation = 0, style, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n if (type === \"solid\") {\n backgroundColor = buttonColor;\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = labelColor || colors.surface;\n }\n }\n else {\n backgroundColor = \"transparent\";\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = labelColor || buttonColor;\n }\n }\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n }\n else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n const buttonStyle = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n };\n const textStyle = {\n textAlign: \"center\",\n color: textColor,\n marginVertical: 16,\n marginHorizontal: 16,\n };\n const iconStyle = [\n styles.icon,\n {\n marginLeft: 16,\n marginRight: -8,\n width: Config.buttonIconSize,\n },\n ];\n const { margin, marginEnd, marginTop, marginLeft, marginRight, marginBottom, marginHorizontal, marginVertical, ...innerStyles } = StyleSheet.flatten(style || {});\n const margins = {\n margin,\n marginEnd,\n marginTop,\n marginLeft,\n marginRight,\n marginBottom,\n marginHorizontal,\n marginVertical,\n };\n return (React.createElement(Elevation, { style: { elevation, alignSelf: \"stretch\", ...margins } },\n React.createElement(Touchable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: \"button\", disabled: disabled || loading, style: [styles.button, buttonStyle, innerStyles] },\n React.createElement(View, { style: styles.content },\n icon && loading !== true ? (React.createElement(View, { style: iconStyle },\n React.createElement(Icon, { name: icon, size: Config.buttonIconSize, color: textColor }))) : null,\n loading ? (React.createElement(ActivityIndicator, { size: \"small\", color: textColor, style: iconStyle })) : null,\n React.createElement(Text, { numberOfLines: 1, style: [textStyle, typography.button] }, children)))));\n};\nconst styles = StyleSheet.create({\n button: {\n minWidth: 64,\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n width: Config.buttonIconSize,\n },\n});\nexport default withTheme(Button);\n"]}
1
+ {"version":3,"sources":["DeprecatedButton.tsx"],"names":["Button","Icon","icon","disabled","type","loading","labelColor","color","colorOverride","children","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","textStyle","textAlign","marginVertical","marginHorizontal","iconStyle","styles","marginLeft","marginRight","width","Config","buttonIconSize","margin","marginEnd","marginTop","marginBottom","innerStyles","flatten","margins","alignSelf","button","content","create","minWidth","borderSt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AAA,MAAM,EAAE;AACNG,IAAAA,QAAQ,EAAE,EADJ;AAENC,IAAAA,WAAW,EAAE;AAFP,GADuB;AAK/BH,EAAAA,OAAO,EAAE;AACPI,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,UAAU,EAAE,QAFL;AAGPC,IAAAA,cAAc,EAAE;AAHT,GALsB;AAU/BzD,EAAAA,IAAI,EAAE;AACJuC,IAAAA,KAAK,EAAEC,gBAAOC;AADV;AAVyB,CAAlB,CAAf;;eAee,wBAAU3C,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n ActivityIndicator,\n View,\n Text,\n StyleSheet,\n TouchableHighlightProps,\n StyleProp,\n ViewStyle,\n TextStyle,\n} from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\n\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\n/**\n * A button is component that the user can press to trigger an action.\n *\n * <div class=\"screenshots\">\n * <figure>\n * <img src=\"screenshots/button-1.png\" />\n * <figcaption>Text button</figcaption>\n * </figure>\n * <figure>\n * <img src=\"screenshots/button-2.png\" />\n * <figcaption>Outlined button</figcaption>\n * </figure>\n * <figure>\n * <img src=\"screenshots/button-3.png\" />\n * <figcaption>Contained button</figcaption>\n * </figure>\n * </div>\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Button } from '@draftbit/ui';\n *\n * const MyComponent = () => (\n * <Button icon=\"add-a-photo\" type=\"solid\" onPress={() => console.log('Pressed')}>\n * Press me\n * </Button>\n * );\n *\n * export default MyComponent;\n * ```\n */\n\ntype Props = {\n disabled?: boolean;\n type?: \"solid\" | \"outline\" | \"text\";\n loading?: boolean;\n icon?: string;\n labelColor?: string;\n color?: string;\n children?: React.ReactNode;\n onPress: () => void;\n elevation?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & TouchableHighlightProps &\n IconSlot;\n\nconst Button: React.FC<Props> = ({\n Icon,\n icon,\n disabled = false,\n type = \"solid\",\n loading = false,\n labelColor,\n color: colorOverride,\n children,\n onPress,\n elevation = 0,\n style,\n theme: { colors, disabledOpacity, roundness, typography },\n ...rest\n}) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n\n if (type === \"solid\") {\n backgroundColor = buttonColor;\n\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = labelColor || colors.surface;\n }\n } else {\n backgroundColor = \"transparent\";\n\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = labelColor || buttonColor;\n }\n }\n\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n } else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n\n const buttonStyle = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n };\n\n const textStyle: StyleProp<TextStyle> = {\n textAlign: \"center\",\n color: textColor,\n marginVertical: 16,\n marginHorizontal: 16,\n };\n\n const iconStyle = [\n styles.icon,\n {\n marginLeft: 16,\n marginRight: -8,\n width: Config.buttonIconSize,\n },\n ];\n\n const {\n margin,\n marginEnd,\n marginTop,\n marginLeft,\n marginRight,\n marginBottom,\n marginHorizontal,\n marginVertical,\n ...innerStyles\n } = StyleSheet.flatten(style || {});\n\n const margins = {\n margin,\n marginEnd,\n marginTop,\n marginLeft,\n marginRight,\n marginBottom,\n marginHorizontal,\n marginVertical,\n };\n\n return (\n <Elevation style={{ elevation, alignSelf: \"stretch\", ...margins }}>\n <Touchable\n {...rest}\n onPress={onPress}\n accessibilityState={{ disabled }}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n style={[styles.button, buttonStyle, innerStyles]}\n >\n <View style={styles.content}>\n {icon && loading !== true ? (\n <View style={iconStyle}>\n <Icon\n name={icon}\n size={Config.buttonIconSize}\n color={textColor}\n />\n </View>\n ) : null}\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={textColor}\n style={iconStyle}\n />\n ) : null}\n <Text numberOfLines={1} style={[textStyle, typography.button]}>\n {children}\n </Text>\n </View>\n </Touchable>\n </Elevation>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n minWidth: 64,\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n width: Config.buttonIconSize,\n },\n});\n\nexport default withTheme(Button);\n"]}
@@ -13,8 +13,6 @@ var _Touchable = _interopRequireDefault(require("./Touchable"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
16
  const getWidth = numColumns => {
19
17
  switch (numColumns) {
20
18
  case 1:
@@ -37,6 +35,20 @@ const Card = _ref => {
37
35
  ...rest
38
36
  } = _ref;
39
37
  const width = getWidth(numColumns);
38
+ return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
39
+ disabled: !onPress,
40
+ onPress: onPress,
41
+ style: [style, {
42
+ width
43
+ }],
44
+ ...rest
45
+ }, children);
46
+ };
47
+
48
+ var _default = (0, _theming.withTheme)(Card);
49
+
50
+ exports.default = _default;
51
+ //# sourceMappingURL=DeprecatedCardWrapper.js.map);
40
52
  return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
41
53
  disabled: !onPress,
42
54
  onPress: onPress,
@@ -1 +1 @@
1
- {"version":3,"sources":["DeprecatedCardWrapper.tsx"],"names":["getWidth","numColumns","Card","children","onPress","style","rest","width"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAYA,MAAMA,QAAQ,GAAIC,UAAD,IAAwB;AACvC,UAAQA,UAAR;AACE,SAAK,CAAL;AACE,aAAO,KAAP;;AACF,SAAK,CAAL;AACE,aAAO,KAAP;;AACF;AACE,aAAO,MAAP;AANJ;AAQD,CATD;;AAWA,MAAMC,IAAqB,GAAG,QAMxB;AAAA,MANyB;AAC7BD,IAAAA,UAAU,GAAG,CADgB;AAE7BE,IAAAA,QAF6B;AAG7BC,IAAAA,OAH6B;AAI7BC,IAAAA,KAJ6B;AAK7B,OAAGC;AAL0B,GAMzB;AACJ,QAAMC,KAAK,GAAGP,QAAQ,CAACC,UAAD,CAAtB;AACA,sBACE,6BAAC,kBAAD;AACE,IAAA,QAAQ,EAAE,CAACG,OADb;AAEE,IAAA,OAAO,EAAEA,OAFX;AAGE,IAAA,KAAK,EAAE,CAACC,KAAD,EAAQ;AAAEE,MAAAA;AAAF,KAAR;AAHT,KAIMD,IAJN,GAMGH,QANH,CADF;AAUD,CAlBD;;eAoBe,wBAAUD,IAAV,C","sourcesContent":["import React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Touchable from \"./Touchable\";\nimport { StyleProp, ViewStyle } from \"react-native\";\nimport theme from \"../styles/DefaultTheme\";\n\ntype Props = {\n numColumns?: number;\n children?: React.ReactNode;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n theme: typeof theme;\n};\n\nconst getWidth = (numColumns: number) => {\n switch (numColumns) {\n case 1:\n return \"33%\";\n case 2:\n return \"50%\";\n default:\n return \"100%\";\n }\n};\n\nconst Card: React.FC<Props> = ({\n numColumns = 3,\n children,\n onPress,\n style,\n ...rest\n}) => {\n const width = getWidth(numColumns);\n return (\n <Touchable\n disabled={!onPress}\n onPress={onPress}\n style={[style, { width }]}\n {...rest}\n >\n {children}\n </Touchable>\n );\n};\n\nexport default withTheme(Card);\n"]}
1
+ {"version":3,"sources":["DeprecatedCardWrapper.js"],"names":["getWidth","numColumns","Card","children","onPress","style","rest","width","React","createElement","Touchable","disabled"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AACA,MAAMA,QAAQ,GAAIC,UAAD,IAAgB;AAC7B,UAAQA,UAAR;AACI,SAAK,CAAL;AACI,aAAO,KAAP;;AACJ,SAAK,CAAL;AACI,aAAO,KAAP;;AACJ;AACI,aAAO,MAAP;AANR;AAQH,CATD;;AAUA,MAAMC,IAAI,GAAG,QAA2D;AAAA,MAA1D;AAAED,IAAAA,UAAU,GAAG,CAAf;AAAkBE,IAAAA,QAAlB;AAA4BC,IAAAA,OAA5B;AAAqCC,IAAAA,KAArC;AAA4C,OAAGC;AAA/C,GAA0D;AACpE,QAAMC,KAAK,GAAGP,QAAQ,CAACC,UAAD,CAAtB;AACA,sBAAQO,eAAMC,aAAN,CAAoBC,kBAApB,EAA+B;AAAEC,IAAAA,QAAQ,EAAE,CAACP,OAAb;AAAsBA,IAAAA,OAAO,EAAEA,OAA/B;AAAwCC,IAAAA,KAAK,EAAE,CAACA,KAAD,EAAQ;AAAEE,MAAAA;AAAF,KAAR,CAA/C;AAAmE,OAAGD;AAAtE,GAA/B,EAA6GH,QAA7G,CAAR;AACH,CAHD;;eAIe,wBAAUD,IAAV,C","sourcesContent":["import React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Touchable from \"./Touchable\";\nconst getWidth = (numColumns) => {\n switch (numColumns) {\n case 1:\n return \"33%\";\n case 2:\n return \"50%\";\n default:\n return \"100%\";\n }\n};\nconst Card = ({ numColumns = 3, children, onPress, style, ...rest }) => {\n const width = getWidth(numColumns);\n return (React.createElement(Touchable, { disabled: !onPress, onPress: onPress, style: [style, { width }], ...rest }, children));\n};\nexport default withTheme(Card);\n"]}
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
29
 
30
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
+
30
32
  const FAB = _ref => {
31
33
  let {
32
34
  Icon,
@@ -128,7 +130,7 @@ const FAB = _ref => {
128
130
  style: [{
129
131
  elevation
130
132
  }, style]
131
- }, /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
133
+ }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
132
134
  onPress: onPress,
133
135
  accessibilityState: {
134
136
  disabled
@@ -136,7 +138,7 @@ const FAB = _ref => {
136
138
  accessibilityRole: "button",
137
139
  disabled: disabled || loading,
138
140
  style: buttonStyles
139
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
141
+ }), /*#__PURE__*/React.createElement(_reactNative.View, {
140
142
  style: styles.content
141
143
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
142
144
  style: iconStyle
@@ -179,23 +181,5 @@ const styles = _reactNative.StyleSheet.create({
179
181
 
180
182
  var _default = (0, _theming.withTheme)(FAB);
181
183
 
182
- exports.default = _default;
183
- //# sourceMappingURL=DeprecatedFAB.js.map },
184
- icon: {
185
- alignItems: "center",
186
- justifyContent: "center",
187
- width: _Config.default.buttonIconSize
188
- },
189
- fixed: {
190
- left: 0,
191
- right: 0,
192
- bottom: 0,
193
- height: 64,
194
- borderRadius: 0
195
- }
196
- });
197
-
198
- var _default = (0, _theming.withTheme)(FAB);
199
-
200
184
  exports.default = _default;
201
185
  //# sourceMappingURL=DeprecatedFAB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DeprecatedFAB.js"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","React","createElement","Elevation","Touchable","accessibilityState","accessibilityRole","View","name","size","ActivityIndicator","Text","numberOfLines","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,GAAG,GAAG,QAAuM;AAAA,MAAtM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,QAAQ,GAAG,KAAzB;AAAgCC,IAAAA,IAAI,GAAG,OAAvC;AAAgDC,IAAAA,OAAO,GAAG,KAA1D;AAAiEC,IAAAA,KAAK,EAAEC,aAAxE;AAAuFC,IAAAA,KAAvF;AAA8FC,IAAAA,OAA9F;AAAuGC,IAAAA,SAAS,GAAG,CAAnH;AAAsHC,IAAAA,KAAtH;AAA6HC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,eAAV;AAA2BC,MAAAA,SAA3B;AAAsCC,MAAAA;AAAtC,KAApI;AAAwL,OAAGC;AAA3L,GAAsM;AAC/M,MAAIC,eAAJ,EAAqBC,WAArB,EAAkCC,SAAlC,EAA6CC,WAA7C;AACA,QAAMC,WAAW,GAAGf,aAAa,IAAIM,MAAM,CA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AW,EAAE;AADT,GADqB;AAI7B7B,EAAAA,OAAO,EAAE;AACL8B,IAAAA,aAAa,EAAE,KADV;AAELpC,IAAAA,UAAU,EAAE,QAFP;AAGLC,IAAAA,cAAc,EAAE;AAHX,GAJoB;AAS7B/B,EAAAA,IAAI,EAAE;AACF8B,IAAAA,UAAU,EAAE,QADV;AAEFC,IAAAA,cAAc,EAAE,QAFd;AAGFS,IAAAA,KAAK,EAAEC,gBAAOC;AAHZ,GATuB;AAc7ByB,EAAAA,KAAK,EAAE;AACHC,IAAAA,IAAI,EAAE,CADH;AAEHC,IAAAA,KAAK,EAAE,CAFJ;AAGHC,IAAAA,MAAM,EAAE,CAHL;AAIH1B,IAAAA,MAAM,EAAE,EAJL;AAKHf,IAAAA,YAAY,EAAE;AALX;AAdsB,CAAlB,CAAf;;eAsBe,wBAAU/B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport { ActivityIndicator, View, StyleSheet, } from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nconst FAB = ({ Icon, icon, disabled = false, type = \"solid\", loading = false, color: colorOverride, label, onPress, elevation = 0, style, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = colors.surface;\n }\n }\n else {\n backgroundColor = \"transparent\";\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = buttonColor;\n }\n }\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n }\n else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n const buttonStyle = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n const buttonStyles = [styles.button, buttonStyle];\n const contentStyle = [styles.content];\n const textStyle = {\n textAlign: \"center\",\n color: textColor,\n };\n const iconStyle = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n textStyle.margin = 16;\n }\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n return (React.createElement(Elevation, { style: [{ elevation }, style] },\n React.createElement(Touchable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: \"button\", disabled: disabled || loading, style: buttonStyles },\n React.createElement(View, { style: styles.content },\n icon && loading !== true ? (React.createElement(View, { style: iconStyle },\n React.createElement(Icon, { name: icon, size: Config.buttonIconSize, color: textColor }))) : null,\n loading ? (React.createElement(ActivityIndicator, { size: \"small\", color: textColor, style: iconStyle })) : null,\n label ? (React.createElement(Text, { numberOfLines: 1, style: [textStyle, typography.button] }, label)) : null))));\n};\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\nexport default withTheme(FAB);\n"]}
1
+ {"version":3,"sources":["DeprecatedFAB.tsx"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAuDA,MAAMA,GAAoB,GAAG,QAavB;AAAA,MAbwB;AAC5BC,IAAAA,IAD4B;AAE5BC,IAAAA,IAF4B;AAG5BC,IAAAA,QAAQ,GAAG,KAHiB;AAI5BC,IAAAA,IAAI,GAAG,OAJqB;AAK5BC,IAAAA,OAAO,GAAG,KALkB;AAM5BC,IAAAA,KAAK,EAAEC,aANqB;AAO5BC,IAAAA,KAP4B;AAQ5BC,IAAAA,OAR4B;AAS5BC,IAAAA,SAAS,GAAG,CATgB;AAU5BC,IAAAA,KAV4B;AAW5BC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,eAAV;AAA2BC,MAAAA,SAA3B;AAAsCC,MAAAA;AAAtC,KAXqB;AAY5B,OAAGC;AAZyB,GAaxB;AACJ,MAAIC,eAAJ,EAAqBC,WAArB,EAAkCC,SAAlC,EAA6CC,WAA7C;AACA,QAAMC,WAAW,GAAGf,aAAa,IAAIM,MAAM,CAACU,OAA5C;;AAEA,MAAInB,IAAI,KAAK,UAAT,IAAuBA,IAAI,KAAK,UAAhC,IAA8CA,IAAI,KAAK,OAA3D,EAAoE;AAClEc,IAAAA,eAAe,GAAGI,WAAlB;;AAEA,QAAInB,QAAJ,EAAc;AACZiB,MAAAA,SAAS,GAAG,oBAAMP,MAAM,CAACW,OAAb,EAAsBC,KAAtB,CAA4BX,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n View,\n StyleSheet,\n TouchableHighlightProps,\n StyleProp,\n ViewStyle,\n TextStyle,\n} from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\n\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\n/**\n * A floating action button represents the primary action in an application.\n *\n * <div class=\"screenshots\">\n * <img src=\"screenshots/fab-1.png\" />\n * <img src=\"screenshots/fab-2.png\" />\n * </div>\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { StyleSheet } from 'react-native';\n * import { FAB } from '@draftbit/ui';\n *\n * const MyComponent = () => (\n * <FAB\n * style={styles.fab}\n * type=\"outline\"\n * icon=\"add\"\n * onPress={() => console.log('Pressed')}\n * />\n * );\n *\n * const styles = StyleSheet.create({\n * fab: {\n * position: 'absolute',\n * margin: 16,\n * right: 0,\n * bottom: 0,\n * },\n * })\n *\n * export default MyComponent;\n * ```\n */\n\ntype Props = {\n disabled?: boolean;\n type?: \"solid\" | \"extended\" | \"outline\" | \"fixed\" | \"standard\";\n loading?: boolean;\n icon?: string;\n color?: string;\n label?: string;\n onPress: () => void;\n elevation?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n} & TouchableHighlightProps &\n IconSlot;\n\nconst FAB: React.FC<Props> = ({\n Icon,\n icon,\n disabled = false,\n type = \"solid\",\n loading = false,\n color: colorOverride,\n label,\n onPress,\n elevation = 0,\n style,\n theme: { colors, disabledOpacity, roundness, typography },\n ...rest\n}) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = colors.surface;\n }\n } else {\n backgroundColor = \"transparent\";\n\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = buttonColor;\n }\n }\n\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n } else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n\n const buttonStyle: StyleProp<ViewStyle> = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n const buttonStyles: StyleProp<ViewStyle>[] = [styles.button, buttonStyle];\n\n const contentStyle: StyleProp<ViewStyle>[] = [styles.content];\n\n const textStyle: StyleProp<TextStyle> = {\n textAlign: \"center\",\n color: textColor,\n };\n\n const iconStyle: StyleProp<ViewStyle>[] = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n\n textStyle.margin = 16;\n }\n\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n\n return (\n <Elevation style={[{ elevation }, style]}>\n <Touchable\n {...rest}\n onPress={onPress}\n accessibilityState={{ disabled }}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n style={buttonStyles}\n >\n <View style={styles.content}>\n {icon && loading !== true ? (\n <View style={iconStyle}>\n <Icon\n name={icon}\n size={Config.buttonIconSize}\n color={textColor}\n />\n </View>\n ) : null}\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={textColor}\n style={iconStyle}\n />\n ) : null}\n {label ? (\n <Text numberOfLines={1} style={[textStyle, typography.button]}>\n {label}\n </Text>\n ) : null}\n </View>\n </Touchable>\n </Elevation>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\n\nexport default withTheme(FAB);\n"]}
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
29
 
30
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
+
30
32
  const Picker = _ref => {
31
33
  var _options$find$label, _options$find;
32
34
 
@@ -109,27 +111,11 @@ const Picker = _ref => {
109
111
  key: o.value
110
112
  }))), /*#__PURE__*/React.createElement(_reactNative.View, {
111
113
  pointerEvents: "none"
112
- }, /*#__PURE__*/React.createElement(_TextField.default, { ...props,
114
+ }, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
113
115
  value: selectedLabel,
114
- placeholder: placeholder,
115
- // @ts-ignore
116
- ref: textField,
117
- disabled: disabled,
118
- // @ts-expect-error
119
- style: stylesWithoutMargin
120
- }))));
121
- };
122
-
123
- const styles = _reactNative.StyleSheet.create({
124
- container: {
125
- alignSelf: "stretch"
126
- }
127
- });
128
-
129
- var _default = (0, _theming.withTheme)(Picker);
130
-
131
- exports.default = _default;
132
- //# sourceMappingURL=PickerComponent.android.js.map: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
116
+ placeholder: placeholder // @ts-ignore
117
+ ,
118
+ ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
133
119
  ,
134
120
  disabled: disabled // @ts-expect-error
135
121
  ,
@@ -1 +1 @@
1
- {"version":3,"sources":["PickerComponent.android.js"],"names":["Picker","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","viewStyles","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","backgroundColor","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","textField","React","useRef","undefined","itemValue","itemIndex","toggleFocus","current","stylesWithoutMargin","StyleSheet","flatten","selectedLabel","find","o","value","label","createElement","Touchable","onPress","styles","container","View","NativePicker","enabled","opacity","position","top","left","right","bottom","width","map","Item","key","pointerEvents","TextField","ref","create","alignSelf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,MAAM,GAAG,QAAkI;AAAA;;AAAA,MAAjI;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA,aAA/B;AAA8CC,IAAAA,QAAQ,GAAG,KAAzD;AAAgEC,IAAAA,aAAa,EAAEC,qBAAqB,GAAG,MAAM,CAAG,CAAhH;AAAkH,OAAGC;AAArH,GAAiI;AAC7I,QAAM;AAAEC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,YAAF;AAAgB;A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iBH,CArDD;;AAsDA,MAAMW,MAAM,GAAGV,wBAAW4B,MAAX,CAAkB;AAC7BjB,EAAAA,SAAS,EAAE;AACPkB,IAAAA,SAAS,EAAE;AADJ;AADkB,CAAlB,CAAf;;eAKe,wBAAU7D,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport omit from \"lodash.omit\";\nimport { withTheme } from \"../../theming\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\nimport { extractStyles } from \"../../utilities\";\nimport TextField from \"../TextField\";\nimport Touchable from \"../Touchable\";\nconst Picker = ({ style, options, placeholder, selectedValue, disabled = false, onValueChange: onValueChangeOverride = () => { }, ...props }) => {\n const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n padding, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...viewStyles }, } = extractStyles(style);\n const textField = React.useRef(undefined);\n const onValueChange = (itemValue, itemIndex) => {\n toggleFocus();\n onValueChangeOverride(itemValue, itemIndex);\n };\n const toggleFocus = () => {\n if (!disabled) {\n // @ts-ignore\n textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()\n }\n };\n const stylesWithoutMargin = style &&\n omit(StyleSheet.flatten(style), [\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n ]);\n const selectedLabel = selectedValue &&\n (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);\n return (React.createElement(Touchable, { disabled: disabled, onPress: toggleFocus, style: [styles.container, viewStyles] },\n React.createElement(View, null,\n React.createElement(NativePicker, { enabled: !disabled, selectedValue: selectedValue, onValueChange: onValueChange, style: {\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n } }, options.map((o) => (React.createElement(NativePicker.Item, { label: o.label, value: o.value, key: o.value })))),\n React.createElement(View, { pointerEvents: \"none\" },\n React.createElement(TextField, { ...props, value: selectedLabel, placeholder: placeholder, \n // @ts-ignore\n ref: textField, disabled: disabled, \n // @ts-expect-error\n style: stylesWithoutMargin })))));\n};\nconst styles = StyleSheet.create({\n container: {\n alignSelf: \"stretch\",\n },\n});\nexport default withTheme(Picker);\n"]}
1
+ {"version":3,"sources":["PickerComponent.android.tsx"],"names":["Picker","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","viewStyles","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","backgroundColor","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","textField","React","useRef","undefined","itemValue","itemIndex","toggleFocus","current","stylesWithoutMargin","StyleSheet","flatten","selectedLabel","find","o","value","label","styles","container","opacity","position","top","left","right","bottom","width","map","create","alignSelf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAGA,MAAMA,MAAsC,GAAG,QAQzC;AAAA;;AAAA,MAR0C;AAC9CC,IAAAA,KAD8C;AAE9CC,IAAAA,OAF8C;AAG9CC,IAAAA,WAH8C;AAI9CC,IAAAA,aAJ8C;AAK9CC,IAAAA,QAAQ,GAAG,KALmC;AAM9CC,IAAAA,aAAa,EAAEC,qBAAqB,GAAG,MAAM,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et } from \"react-native\";\nimport omit from \"lodash.omit\";\nimport { withTheme } from \"../../theming\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\nimport { extractStyles } from \"../../utilities\";\n\nimport TextField from \"../TextField\";\nimport Touchable from \"../Touchable\";\nimport { PickerComponentProps } from \"./PickerTypes\";\n\nconst Picker: React.FC<PickerComponentProps> = ({\n style,\n options,\n placeholder,\n selectedValue,\n disabled = false,\n onValueChange: onValueChangeOverride = () => {},\n ...props\n}) => {\n const {\n viewStyles: {\n borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n padding, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...viewStyles\n },\n } = extractStyles(style);\n\n const textField = React.useRef<typeof TextField | undefined>(undefined);\n\n const onValueChange = (itemValue: string, itemIndex: number) => {\n toggleFocus();\n onValueChangeOverride(itemValue, itemIndex);\n };\n\n const toggleFocus = () => {\n if (!disabled) {\n // @ts-ignore\n textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()\n }\n };\n\n const stylesWithoutMargin =\n style &&\n omit(StyleSheet.flatten(style), [\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n ]);\n\n const selectedLabel =\n selectedValue &&\n (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);\n\n return (\n <Touchable\n disabled={disabled}\n onPress={toggleFocus}\n style={[styles.container, viewStyles]}\n >\n <View>\n <NativePicker\n enabled={!disabled}\n selectedValue={selectedValue}\n onValueChange={onValueChange}\n style={{\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n }}\n >\n {options.map((o) => (\n <NativePicker.Item label={o.label} value={o.value} key={o.value} />\n ))}\n </NativePicker>\n <View pointerEvents=\"none\">\n <TextField\n {...props}\n value={selectedLabel}\n placeholder={placeholder}\n // @ts-ignore\n ref={textField} // cannot determine if ref is of correct type due to component being wrapped in a withTheme()\n disabled={disabled}\n // @ts-expect-error\n style={stylesWithoutMargin}\n />\n </View>\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: \"stretch\",\n },\n});\n\nexport default withTheme(Picker);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["ProgressCircle.js"],"names":["ProgressCircle","progress","style","color","size","showsText","unfilledColor","strokeCap","textStyle","thickness","theme","progressNum","Math","round","tintColor","colors","primary","backgroundColor","secondary","React","createElement","AnimatedCircularProgress","width","backgroundWidth","fill","rotation","lineCap","Text","fontSize"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,cAAc,GAAG,QAAqJ;AAAA,MAApJ;AAAEC,IAAAA,QAAQ,GAAG,GAAb;AAAkBC,IAAAA,KAAlB;AAAyBC,IAAAA,KAAK,GAAG,SAAjC;AAA4CC,IAAAA,IAAI,GAAG,GAAnD;AAAwDC,IAAAA,SAAS,GAAG,IAApE;AAA0EC,IAAAA,aAA1E;AAAyFC,IAAAA,SAAS,GAAG,MAArG;AAA6GC,IAAAA,SAA7G;AAAwHC,IAAAA,SAAS,GAAG,CAApI;AAAuIC,IAAAA;AAAvI,GAAoJ;AACxK,QAAMC,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWZ,QAAQ,GAAG,GAAtB,CAApB;AACA,QAAMa,SAAS,GAAGX,KAAK,IAAIO,KAAK,CAACK,MAAN,CAAaC,OAAxC;AACA,QAAMC,eAAe,GAAGX,aAAa,IAAII,KAAK,CAACK,MAAN,CAAaG,SAAtD;AACA,sBAAQC,KAAK,CAACC,aAAN,CAAoBC,iCAApB,EAA8C;AAAEjB,IAAAA,IAAI,EAAEA,IAAR;AAAckB,IAAAA,KAAK,EAAEb,SAArB;AAAgCc,IAAAA,eAAe,EAAEd,SAAjD;AAA4De,IAAAA,IAAI,EAAEb,WAAlE;AAA+EG,IAAAA,SAAS,EAAEA,SAA1F;AAAqGG,IAAAA,eAAe,EAAEA,eAAtH;AAAuIQ,IAAAA,QAAQ,EAAE,CAAjJ;AAAoJC,IAAAA,OAAO,EAAEnB,SAA7J;AAAwKL,IAAAA,KAAK,EAAEA;AAA/K,GAA9C,EAAuOsB,IAAD,IAAUnB,SAAS,gBAAIc,KAAK,CAACC,aAAN,CAAoBO,iBAApB,EAA0B;AAAEzB,IAAAA,KAAK,EAAE,CAAC;AAAE0B,MAAAA,QAAQ,EAAExB,IAAI,GAAG,KAAnB;AAA0BD,MAAAA,KAAK,EAAEW;AAAjC,KAAD,EAA+CN,SAA/C;AAAT,GAA1B,EACjQI,IAAI,CAACC,KAAL,CAAWW,IAAX,CADiQ,EAEjQ,GAFiQ,CAAJ,GAErP,IAFJ,CAAR;AAGH,CAPD;;eAQe,wBAAUxB,cAAV,C","sourcesContent":["import * as React from \"react\";\nimport { Text } from \"react-native\";\nimport AnimatedCircularProgress from \"./AnimatedCircularProgress\";\nimport { withTheme } from \"../theming\";\nconst ProgressCircle = ({ progress = 0.5, style, color = \"primary\", size = 100, showsText = true, unfilledColor, strokeCap = \"butt\", textStyle, thickness = 1, theme, }) => {\n const progressNum = Math.round(progress * 100);\n const tintColor = color || theme.colors.primary;\n const backgroundColor = unfilledColor || theme.colors.secondary;\n return (React.createElement(AnimatedCircularProgress, { size: size, width: thickness, backgroundWidth: thickness, fill: progressNum, tintColor: tintColor, backgroundColor: backgroundColor, rotation: 0, lineCap: strokeCap, style: style }, (fill) => showsText ? (React.createElement(Text, { style: [{ fontSize: size * 0.275, color: tintColor }, textStyle] },\n Math.round(fill),\n \"%\")) : null));\n};\nexport default withTheme(ProgressCircle);\n"]}
1
+ {"version":3,"sources":["ProgressCircle.tsx"],"names":["ProgressCircle","progress","style","color","size","showsText","unfilledColor","strokeCap","textStyle","thickness","theme","progressNum","Math","round","tintColor","colors","primary","backgroundColor","secondary","fill","fontSize"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAiBA,MAAMA,cAA+B,GAAG,QAWlC;AAAA,MAXmC;AACvCC,IAAAA,QAAQ,GAAG,GAD4B;AAEvCC,IAAAA,KAFuC;AAGvCC,IAAAA,KAAK,GAAG,SAH+B;AAIvCC,IAAAA,IAAI,GAAG,GAJgC;AAKvCC,IAAAA,SAAS,GAAG,IAL2B;AAMvCC,IAAAA,aANuC;AAOvCC,IAAAA,SAAS,GAAG,MAP2B;AAQvCC,IAAAA,SARuC;AASvCC,IAAAA,SAAS,GAAG,CAT2B;AAUvCC,IAAAA;AAVuC,GAWnC;AACJ,QAAMC,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWZ,QAAQ,GAAG,GAAtB,CAApB;AAEA,QAAMa,SAAS,GAAGX,KAAK,IAAIO,KAAK,CAACK,MAAN,CAAaC,OAAxC;AACA,QAAMC,eAAe,GAAGX,aAAa,IAAII,KAAK,CAACK,MAAN,CAAaG,SAAtD;AAEA,sBACE,oBAAC,iCAAD;AACE,IAAA,IAAI,EAAEd,IADR;AAEE,IAAA,KAAK,EAAEK,SAFT;AAGE,IAAA,eAAe,EAAEA,SAHnB;AAIE,IAAA,IAAI,EAAEE,WAJR;AAKE,IAAA,SAAS,EAAEG,SALb;AAME,IAAA,eAAe,EAAEG,eANnB;AAOE,IAAA,QAAQ,EAAE,CAPZ;AAQE,IAAA,OAAO,EAAEV,SARX;AASE,IAAA,KAAK,EAAEL;AATT,KAWIiB,IAAD,IACCd,SAAS,gBACP,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CAAC;AAAEe,MAAAA,QAAQ,EAAEhB,IAAI,GAAG,KAAnB;AAA0BD,MAAAA,KAAK,EAAEW;AAAjC,KAAD,EAA+CN,SAA/C;AADT,KAGGI,IAAI,CAACC,KAAL,CAAWM,IAAX,CAHH,MADO,GAML,IAlBR,CADF;AAuBD,CAxCD;;eA0Ce,wBAAUnB,cAAV,C","sourcesContent":["import * as React from \"react\";\nimport { Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport AnimatedCircularProgress from \"./AnimatedCircularProgress\";\nimport { withTheme } from \"../theming\";\nimport themeT from \"../styles/DefaultTheme\";\nimport { colorTypes } from \"@draftbit/types\";\n\ntype Props = {\n progress?: number;\n style?: StyleProp<ViewStyle>;\n color?: colorTypes;\n size?: number;\n showsText?: boolean;\n unfilledColor?: colorTypes;\n strokeCap?: \"butt\" | \"square\" | \"round\" | undefined;\n textStyle?: StyleProp<TextStyle>;\n thickness?: number;\n theme: typeof themeT;\n};\n\nconst ProgressCircle: React.FC<Props> = ({\n progress = 0.5,\n style,\n color = \"primary\",\n size = 100,\n showsText = true,\n unfilledColor,\n strokeCap = \"butt\",\n textStyle,\n thickness = 1,\n theme,\n}) => {\n const progressNum = Math.round(progress * 100);\n\n const tintColor = color || theme.colors.primary;\n const backgroundColor = unfilledColor || theme.colors.secondary;\n\n return (\n <AnimatedCircularProgress\n size={size}\n width={thickness}\n backgroundWidth={thickness}\n fill={progressNum}\n tintColor={tintColor}\n backgroundColor={backgroundColor}\n rotation={0}\n lineCap={strokeCap}\n style={style}\n >\n {(fill) =>\n showsText ? (\n <Text\n style={[{ fontSize: size * 0.275, color: tintColor }, textStyle]}\n >\n {Math.round(fill)}%\n </Text>\n ) : null\n }\n </AnimatedCircularProgress>\n );\n};\n\nexport default withTheme(ProgressCircle);\n"]}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNativeTabView = require("react-native-tab-view");
11
+
12
+ var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
+
22
+ const TabViewComponent = _ref => {
23
+ let {
24
+ Icon,
25
+ tabBarPosition,
26
+ keyboardDismissMode,
27
+ swipeEnabled,
28
+ scrollEnabled,
29
+ activeColor,
30
+ inactiveColor,
31
+ pressColor,
32
+ indicatorColor,
33
+ style,
34
+ children
35
+ } = _ref;
36
+ const [index, setIndex] = React.useState(0);
37
+ const [routes, setRoutes] = React.useState([]);
38
+ const [tabScenes, setTabScenes] = React.useState({});
39
+ React.useEffect(() => {
40
+ const newRoutes = [];
41
+ const scenes = {};
42
+ React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
43
+ var _child$props;
44
+
45
+ if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
46
+ var _child$props2, _child$props3;
47
+
48
+ newRoutes.push({
49
+ key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
50
+ ...(child === null || child === void 0 ? void 0 : child.props)
51
+ });
52
+
53
+ scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
54
+ }
55
+ });
56
+ setRoutes(newRoutes);
57
+ setTabScenes(scenes);
58
+ }, [children]);
59
+
60
+ const indexChangeHandler = i => setIndex(i);
61
+
62
+ const renderTabBar = props => {
63
+ console.log(props);
64
+ return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
65
+ activeColor: activeColor,
66
+ inactiveColor: inactiveColor,
67
+ pressColor: pressColor,
68
+ scrollEnabled: scrollEnabled,
69
+ indicatorStyle: {
70
+ backgroundColor: indicatorColor
71
+ },
72
+ renderIcon: _ref2 => {
73
+ let {
74
+ route,
75
+ color
76
+ } = _ref2;
77
+ return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
78
+ name: route.icon,
79
+ color: color,
80
+ size: 36
81
+ }) : null;
82
+ },
83
+ style: style
84
+ }));
85
+ };
86
+
87
+ return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
88
+ navigationState: {
89
+ index,
90
+ routes
91
+ },
92
+ renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
93
+ renderTabBar: renderTabBar,
94
+ onIndexChange: indexChangeHandler,
95
+ tabBarPosition: tabBarPosition,
96
+ keyboardDismissMode: keyboardDismissMode,
97
+ swipeEnabled: swipeEnabled
98
+ });
99
+ };
100
+
101
+ var _default = TabViewComponent;
102
+ exports.default = _default;
103
+ //# sourceMappingURL=TabView.js.map