@draftbit/core 46.4.4-d93fe1.2 → 46.4.4-e6bfdd.2

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 (319) hide show
  1. package/lib/commonjs/Provider.js +0 -9
  2. package/lib/commonjs/components/Accordion/AccordionGroup.js +0 -14
  3. package/lib/commonjs/components/Accordion/AccordionItem.js +0 -13
  4. package/lib/commonjs/components/Accordion/index.js +0 -3
  5. package/lib/commonjs/components/ActionSheet/ActionSheet.js +0 -9
  6. package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +0 -5
  7. package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +0 -7
  8. package/lib/commonjs/components/ActionSheet/index.js +0 -4
  9. package/lib/commonjs/components/AnimatedCircularProgress.js +0 -15
  10. package/lib/commonjs/components/AspectRatio.js +0 -10
  11. package/lib/commonjs/components/AvatarEdit.js +0 -12
  12. package/lib/commonjs/components/Banner.js +9 -23
  13. package/lib/commonjs/components/Button.js +2 -19
  14. package/lib/commonjs/components/Card.js +0 -14
  15. package/lib/commonjs/components/CardBlock.js +0 -15
  16. package/lib/commonjs/components/CardContainer.js +0 -18
  17. package/lib/commonjs/components/CardContainerRating.js +2 -20
  18. package/lib/commonjs/components/CardContainerShortImage.js +0 -12
  19. package/lib/commonjs/components/CardInline.js +1 -14
  20. package/lib/commonjs/components/Carousel.js +3 -21
  21. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -18
  22. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +0 -11
  23. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +0 -20
  24. package/lib/commonjs/components/Checkbox/CheckboxRow.js +3 -24
  25. package/lib/commonjs/components/Checkbox/context.js +0 -5
  26. package/lib/commonjs/components/Checkbox/index.js +0 -4
  27. package/lib/commonjs/components/CircleImage.js +0 -9
  28. package/lib/commonjs/components/CircularProgress.js +3 -13
  29. package/lib/commonjs/components/Config.js +5 -13
  30. package/lib/commonjs/components/Container.js +4 -27
  31. package/lib/commonjs/components/DatePicker/DatePicker.js +16 -48
  32. package/lib/commonjs/components/DatePicker/DatePickerComponent.js +0 -7
  33. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +0 -10
  34. package/lib/commonjs/components/DeprecatedButton.js +0 -23
  35. package/lib/commonjs/components/DeprecatedCardWrapper.js +0 -11
  36. package/lib/commonjs/components/DeprecatedFAB.js +0 -26
  37. package/lib/commonjs/components/Divider.js +0 -9
  38. package/lib/commonjs/components/Elevation.js +0 -11
  39. package/lib/commonjs/components/FAB.js +0 -10
  40. package/lib/commonjs/components/FieldSearchBarFull.js +0 -18
  41. package/lib/commonjs/components/FormRow.js +0 -10
  42. package/lib/commonjs/components/Header.js +0 -13
  43. package/lib/commonjs/components/HeaderLarge.js +0 -9
  44. package/lib/commonjs/components/HeaderMedium.js +0 -9
  45. package/lib/commonjs/components/HeaderOverline.js +0 -9
  46. package/lib/commonjs/components/IconButton.js +0 -10
  47. package/lib/commonjs/components/Image.js +0 -17
  48. package/lib/commonjs/components/Layout.js +2 -12
  49. package/lib/commonjs/components/NumberInput.js +8 -21
  50. package/lib/commonjs/components/Picker/Picker.js +6 -39
  51. package/lib/commonjs/components/Picker/PickerComponent.android.js +6 -23
  52. package/lib/commonjs/components/Picker/PickerComponent.ios.js +8 -27
  53. package/lib/commonjs/components/Picker/PickerComponent.web.js +6 -23
  54. package/lib/commonjs/components/Portal/Portal.js +4 -14
  55. package/lib/commonjs/components/Portal/PortalConsumer.js +5 -15
  56. package/lib/commonjs/components/Portal/PortalHost.js +4 -31
  57. package/lib/commonjs/components/Portal/PortalManager.js +7 -19
  58. package/lib/commonjs/components/ProgressBar.js +9 -45
  59. package/lib/commonjs/components/ProgressCircle.js +0 -10
  60. package/lib/commonjs/components/ProgressIndicator.js +0 -9
  61. package/lib/commonjs/components/RadioButton/RadioButton.js +1 -14
  62. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +0 -10
  63. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +0 -14
  64. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -21
  65. package/lib/commonjs/components/RadioButton/context.js +0 -5
  66. package/lib/commonjs/components/RadioButton/index.js +0 -5
  67. package/lib/commonjs/components/Row.js +0 -11
  68. package/lib/commonjs/components/RowBodyIcon.js +0 -10
  69. package/lib/commonjs/components/RowHeadlineImageCaption.js +2 -11
  70. package/lib/commonjs/components/RowHeadlineImageIcon.js +0 -10
  71. package/lib/commonjs/components/SVG.js +0 -9
  72. package/lib/commonjs/components/ScreenContainer.js +0 -14
  73. package/lib/commonjs/components/Slider.js +0 -21
  74. package/lib/commonjs/components/StarRating.js +0 -10
  75. package/lib/commonjs/components/StepIndicator.js +5 -39
  76. package/lib/commonjs/components/Stepper.js +4 -18
  77. package/lib/commonjs/components/Surface.js +0 -14
  78. package/lib/commonjs/components/Swiper/Swiper.js +0 -8
  79. package/lib/commonjs/components/Swiper/SwiperItem.js +0 -6
  80. package/lib/commonjs/components/Swiper/index.js +0 -3
  81. package/lib/commonjs/components/Switch.js +5 -18
  82. package/lib/commonjs/components/Text.js +8 -19
  83. package/lib/commonjs/components/TextField.js +16 -62
  84. package/lib/commonjs/components/ToggleButton.js +0 -14
  85. package/lib/commonjs/components/Touchable.js +0 -5
  86. package/lib/commonjs/components/Touchable.web.js +0 -2
  87. package/lib/commonjs/components/Typography.js +0 -5
  88. package/lib/commonjs/components/useAuthState.js +0 -9
  89. package/lib/commonjs/constants.js +0 -4
  90. package/lib/commonjs/hooks.js +4 -7
  91. package/lib/commonjs/index.js +0 -66
  92. package/lib/commonjs/interfaces/Icon.js +3 -5
  93. package/lib/commonjs/mappings/Accordion.js +0 -2
  94. package/lib/commonjs/mappings/AccordionItem.js +0 -2
  95. package/lib/commonjs/mappings/ActionSheet.js +0 -2
  96. package/lib/commonjs/mappings/ActionSheetCancel.js +0 -2
  97. package/lib/commonjs/mappings/ActionSheetItem.js +0 -2
  98. package/lib/commonjs/mappings/ActivityIndicator.js +0 -2
  99. package/lib/commonjs/mappings/AudioPlayer.js +0 -2
  100. package/lib/commonjs/mappings/AvatarEdit.js +0 -2
  101. package/lib/commonjs/mappings/Banner.js +0 -2
  102. package/lib/commonjs/mappings/BlurView.js +0 -2
  103. package/lib/commonjs/mappings/Button.js +6 -5
  104. package/lib/commonjs/mappings/Card.js +3 -4
  105. package/lib/commonjs/mappings/CardBlock.js +6 -5
  106. package/lib/commonjs/mappings/CardContainer.js +5 -7
  107. package/lib/commonjs/mappings/CardContainerRating.js +4 -4
  108. package/lib/commonjs/mappings/CardContainerShortImage.js +0 -2
  109. package/lib/commonjs/mappings/CardInline.js +0 -2
  110. package/lib/commonjs/mappings/Carousel.js +0 -2
  111. package/lib/commonjs/mappings/Checkbox.js +0 -2
  112. package/lib/commonjs/mappings/CheckboxGroup.js +0 -2
  113. package/lib/commonjs/mappings/CheckboxRow.js +0 -2
  114. package/lib/commonjs/mappings/CircleImage.js +0 -2
  115. package/lib/commonjs/mappings/Container.js +0 -2
  116. package/lib/commonjs/mappings/CustomCode.js +0 -2
  117. package/lib/commonjs/mappings/DatePicker.js +4 -4
  118. package/lib/commonjs/mappings/Divider.js +0 -2
  119. package/lib/commonjs/mappings/FAB.js +0 -2
  120. package/lib/commonjs/mappings/Fetch.js +0 -2
  121. package/lib/commonjs/mappings/FieldSearchBarFull.js +2 -3
  122. package/lib/commonjs/mappings/FlashList.js +0 -2
  123. package/lib/commonjs/mappings/FlatList.js +0 -2
  124. package/lib/commonjs/mappings/HeaderLarge.js +0 -2
  125. package/lib/commonjs/mappings/HeaderMedium.js +0 -2
  126. package/lib/commonjs/mappings/HeaderOverline.js +0 -2
  127. package/lib/commonjs/mappings/Icon.js +2 -3
  128. package/lib/commonjs/mappings/IconButton.js +0 -2
  129. package/lib/commonjs/mappings/Image.js +0 -2
  130. package/lib/commonjs/mappings/ImageBackground.js +0 -2
  131. package/lib/commonjs/mappings/KeyboardAvoidingView.js +0 -2
  132. package/lib/commonjs/mappings/KeyboardAwareScrollView.js +0 -2
  133. package/lib/commonjs/mappings/Layout.js +0 -2
  134. package/lib/commonjs/mappings/LinearGradient.js +0 -2
  135. package/lib/commonjs/mappings/MapCallout.js +0 -2
  136. package/lib/commonjs/mappings/MapMarker.js +0 -2
  137. package/lib/commonjs/mappings/MapView.js +0 -2
  138. package/lib/commonjs/mappings/Modal.js +0 -2
  139. package/lib/commonjs/mappings/NumberInput.js +4 -4
  140. package/lib/commonjs/mappings/Picker.js +4 -4
  141. package/lib/commonjs/mappings/ProgressBar.js +0 -2
  142. package/lib/commonjs/mappings/ProgressCircle.js +0 -2
  143. package/lib/commonjs/mappings/ProgressIndicator.js +0 -2
  144. package/lib/commonjs/mappings/RadioButton.js +0 -2
  145. package/lib/commonjs/mappings/RadioButtonGroup.js +0 -2
  146. package/lib/commonjs/mappings/RadioButtonRow.js +0 -2
  147. package/lib/commonjs/mappings/RowBodyIcon.js +0 -2
  148. package/lib/commonjs/mappings/RowHeadlineImageCaption.js +0 -2
  149. package/lib/commonjs/mappings/RowHeadlineImageIcon.js +12 -8
  150. package/lib/commonjs/mappings/SVG.js +0 -2
  151. package/lib/commonjs/mappings/SafeAreaView.js +0 -2
  152. package/lib/commonjs/mappings/ScrollView.js +0 -2
  153. package/lib/commonjs/mappings/Slider.js +0 -2
  154. package/lib/commonjs/mappings/StarRating.js +1 -3
  155. package/lib/commonjs/mappings/Stepper.js +0 -2
  156. package/lib/commonjs/mappings/Surface.js +0 -2
  157. package/lib/commonjs/mappings/Swiper.js +0 -2
  158. package/lib/commonjs/mappings/SwiperItem.js +0 -2
  159. package/lib/commonjs/mappings/Switch.js +0 -2
  160. package/lib/commonjs/mappings/Text.js +5 -5
  161. package/lib/commonjs/mappings/TextArea.js +2 -3
  162. package/lib/commonjs/mappings/TextField.js +8 -9
  163. package/lib/commonjs/mappings/TextInput.js +3 -4
  164. package/lib/commonjs/mappings/ToggleButton.js +0 -2
  165. package/lib/commonjs/mappings/Touchable.js +0 -2
  166. package/lib/commonjs/mappings/Video.js +0 -2
  167. package/lib/commonjs/mappings/View.js +0 -2
  168. package/lib/commonjs/mappings/WebView.js +0 -2
  169. package/lib/commonjs/styles/DarkTheme.js +5 -6
  170. package/lib/commonjs/styles/DefaultTheme.js +26 -17
  171. package/lib/commonjs/styles/fonts.js +3 -5
  172. package/lib/commonjs/styles/overlay.js +5 -14
  173. package/lib/commonjs/styles/shadow.js +0 -9
  174. package/lib/commonjs/theming.js +0 -4
  175. package/lib/commonjs/utilities.js +2 -14
  176. package/lib/module/Provider.js +0 -1
  177. package/lib/module/components/Accordion/AccordionGroup.js +0 -4
  178. package/lib/module/components/Accordion/AccordionItem.js +0 -3
  179. package/lib/module/components/ActionSheet/ActionSheet.js +0 -2
  180. package/lib/module/components/ActionSheet/ActionSheetCancel.js +0 -2
  181. package/lib/module/components/ActionSheet/ActionSheetItem.js +0 -2
  182. package/lib/module/components/AnimatedCircularProgress.js +0 -6
  183. package/lib/module/components/AspectRatio.js +0 -6
  184. package/lib/module/components/AvatarEdit.js +0 -3
  185. package/lib/module/components/Banner.js +9 -10
  186. package/lib/module/components/Button.js +2 -10
  187. package/lib/module/components/Card.js +0 -2
  188. package/lib/module/components/CardBlock.js +0 -6
  189. package/lib/module/components/CardContainer.js +0 -7
  190. package/lib/module/components/CardContainerRating.js +2 -8
  191. package/lib/module/components/CardContainerShortImage.js +0 -3
  192. package/lib/module/components/CardInline.js +0 -2
  193. package/lib/module/components/Carousel.js +3 -9
  194. package/lib/module/components/Checkbox/Checkbox.js +3 -9
  195. package/lib/module/components/Checkbox/CheckboxGroup.js +0 -5
  196. package/lib/module/components/Checkbox/CheckboxGroupRow.js +0 -8
  197. package/lib/module/components/Checkbox/CheckboxRow.js +3 -11
  198. package/lib/module/components/Checkbox/context.js +0 -2
  199. package/lib/module/components/CircleImage.js +0 -3
  200. package/lib/module/components/CircularProgress.js +3 -9
  201. package/lib/module/components/Config.js +5 -11
  202. package/lib/module/components/Container.js +0 -3
  203. package/lib/module/components/DatePicker/DatePicker.js +16 -33
  204. package/lib/module/components/DatePicker/DatePickerComponent.js +0 -2
  205. package/lib/module/components/DatePicker/DatePickerComponent.web.js +0 -2
  206. package/lib/module/components/DeprecatedButton.js +0 -9
  207. package/lib/module/components/DeprecatedCardWrapper.js +0 -6
  208. package/lib/module/components/DeprecatedFAB.js +0 -13
  209. package/lib/module/components/Divider.js +0 -3
  210. package/lib/module/components/Elevation.js +0 -3
  211. package/lib/module/components/FAB.js +0 -3
  212. package/lib/module/components/FieldSearchBarFull.js +0 -9
  213. package/lib/module/components/FormRow.js +0 -1
  214. package/lib/module/components/Header.js +0 -2
  215. package/lib/module/components/HeaderLarge.js +0 -2
  216. package/lib/module/components/HeaderMedium.js +0 -2
  217. package/lib/module/components/HeaderOverline.js +0 -2
  218. package/lib/module/components/IconButton.js +0 -3
  219. package/lib/module/components/Image.js +0 -10
  220. package/lib/module/components/Layout.js +4 -3
  221. package/lib/module/components/NumberInput.js +8 -16
  222. package/lib/module/components/Picker/Picker.js +6 -23
  223. package/lib/module/components/Picker/PickerComponent.android.js +6 -10
  224. package/lib/module/components/Picker/PickerComponent.ios.js +8 -11
  225. package/lib/module/components/Picker/PickerComponent.web.js +6 -10
  226. package/lib/module/components/Portal/Portal.js +4 -6
  227. package/lib/module/components/Portal/PortalConsumer.js +5 -10
  228. package/lib/module/components/Portal/PortalHost.js +4 -22
  229. package/lib/module/components/Portal/PortalManager.js +7 -14
  230. package/lib/module/components/ProgressBar.js +5 -17
  231. package/lib/module/components/ProgressCircle.js +0 -2
  232. package/lib/module/components/ProgressIndicator.js +0 -2
  233. package/lib/module/components/RadioButton/RadioButton.js +1 -6
  234. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +0 -3
  235. package/lib/module/components/RadioButton/RadioButtonGroup.js +0 -7
  236. package/lib/module/components/RadioButton/RadioButtonRow.js +1 -9
  237. package/lib/module/components/RadioButton/context.js +0 -2
  238. package/lib/module/components/Row.js +0 -2
  239. package/lib/module/components/RowBodyIcon.js +0 -2
  240. package/lib/module/components/RowHeadlineImageCaption.js +2 -3
  241. package/lib/module/components/RowHeadlineImageIcon.js +0 -2
  242. package/lib/module/components/SVG.js +0 -2
  243. package/lib/module/components/ScreenContainer.js +0 -6
  244. package/lib/module/components/Slider.js +0 -10
  245. package/lib/module/components/StarRating.js +0 -3
  246. package/lib/module/components/StepIndicator.js +5 -29
  247. package/lib/module/components/Stepper.js +6 -9
  248. package/lib/module/components/Surface.js +0 -5
  249. package/lib/module/components/Swiper/Swiper.js +0 -4
  250. package/lib/module/components/Swiper/SwiperItem.js +0 -2
  251. package/lib/module/components/Switch.js +5 -7
  252. package/lib/module/components/Text.js +8 -11
  253. package/lib/module/components/TextField.js +16 -50
  254. package/lib/module/components/ToggleButton.js +2 -21
  255. package/lib/module/components/Touchable.js +0 -1
  256. package/lib/module/components/useAuthState.js +0 -4
  257. package/lib/module/constants.js +2 -1
  258. package/lib/module/hooks.js +4 -2
  259. package/lib/module/index.js +4 -3
  260. package/lib/module/interfaces/Icon.js +2 -1
  261. package/lib/module/mappings/Button.js +6 -3
  262. package/lib/module/mappings/Card.js +3 -2
  263. package/lib/module/mappings/CardBlock.js +6 -3
  264. package/lib/module/mappings/CardContainer.js +5 -5
  265. package/lib/module/mappings/CardContainerRating.js +4 -2
  266. package/lib/module/mappings/DatePicker.js +4 -2
  267. package/lib/module/mappings/Fetch.js +0 -1
  268. package/lib/module/mappings/FieldSearchBarFull.js +2 -1
  269. package/lib/module/mappings/Icon.js +2 -1
  270. package/lib/module/mappings/NumberInput.js +4 -2
  271. package/lib/module/mappings/Picker.js +4 -2
  272. package/lib/module/mappings/RowHeadlineImageIcon.js +12 -6
  273. package/lib/module/mappings/StarRating.js +1 -1
  274. package/lib/module/mappings/Text.js +5 -3
  275. package/lib/module/mappings/TextArea.js +2 -1
  276. package/lib/module/mappings/TextField.js +8 -7
  277. package/lib/module/mappings/TextInput.js +3 -2
  278. package/lib/module/styles/DarkTheme.js +4 -2
  279. package/lib/module/styles/DefaultTheme.js +26 -13
  280. package/lib/module/styles/fonts.js +2 -1
  281. package/lib/module/styles/overlay.js +4 -10
  282. package/lib/module/styles/shadow.js +0 -6
  283. package/lib/module/utilities.js +2 -5
  284. package/lib/typescript/src/components/Text.d.ts +2 -1
  285. package/lib/typescript/src/components/TextField.d.ts +2 -1
  286. package/lib/typescript/src/index.d.ts +0 -1
  287. package/lib/typescript/src/mappings/TextField.d.ts +2 -2
  288. package/lib/typescript/src/mappings/TextInput.d.ts +1 -1
  289. package/package.json +4 -6
  290. package/src/components/Text.js +8 -2
  291. package/src/components/Text.tsx +6 -1
  292. package/src/components/TextField.js +6 -1
  293. package/src/components/TextField.tsx +7 -1
  294. package/src/index.js +0 -1
  295. package/src/index.tsx +0 -1
  296. package/src/mappings/TextField.js +1 -1
  297. package/src/mappings/TextField.ts +1 -1
  298. package/src/mappings/TextInput.js +1 -1
  299. package/src/mappings/TextInput.ts +1 -1
  300. package/lib/commonjs/components/TabView/TabView.js +0 -102
  301. package/lib/commonjs/components/TabView/TabViewItem.js +0 -26
  302. package/lib/commonjs/components/TabView/index.js +0 -23
  303. package/lib/commonjs/mappings/TabView.js +0 -79
  304. package/lib/module/components/TabView/TabView.js +0 -87
  305. package/lib/module/components/TabView/TabViewItem.js +0 -18
  306. package/lib/module/components/TabView/index.js +0 -2
  307. package/lib/module/mappings/TabView.js +0 -70
  308. package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
  309. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
  310. package/lib/typescript/src/components/TabView/index.d.ts +0 -2
  311. package/lib/typescript/src/mappings/TabView.d.ts +0 -111
  312. package/src/components/TabView/TabView.js +0 -34
  313. package/src/components/TabView/TabView.tsx +0 -97
  314. package/src/components/TabView/TabViewItem.js +0 -5
  315. package/src/components/TabView/TabViewItem.tsx +0 -21
  316. package/src/components/TabView/index.js +0 -2
  317. package/src/components/TabView/index.tsx +0 -2
  318. package/src/mappings/TabView.js +0 -73
  319. package/src/mappings/TabView.ts +0 -80
@@ -1,87 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
-
3
- import * as React from "react";
4
- import { TabView, TabBar, SceneMap } from "react-native-tab-view"; // import { withTheme } from "../../theming";
5
-
6
- import TabViewItem from "./TabViewItem";
7
-
8
- const TabViewComponent = _ref => {
9
- let {
10
- Icon,
11
- tabBarPosition,
12
- keyboardDismissMode,
13
- swipeEnabled,
14
- scrollEnabled,
15
- activeColor,
16
- inactiveColor,
17
- pressColor,
18
- indicatorColor,
19
- style,
20
- children
21
- } = _ref;
22
- const [index, setIndex] = React.useState(0);
23
- const [routes, setRoutes] = React.useState([]);
24
- const [tabScenes, setTabScenes] = React.useState({});
25
- React.useEffect(() => {
26
- const newRoutes = [];
27
- const scenes = {};
28
- React.Children.toArray(children).filter(child => child.type === TabViewItem).forEach(child => {
29
- var _child$props;
30
-
31
- if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
32
- var _child$props2, _child$props3;
33
-
34
- newRoutes.push({
35
- key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
36
- ...(child === null || child === void 0 ? void 0 : child.props)
37
- });
38
-
39
- scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
40
- }
41
- });
42
- setRoutes(newRoutes);
43
- setTabScenes(scenes);
44
- }, [children]);
45
-
46
- const indexChangeHandler = i => setIndex(i);
47
-
48
- const renderTabBar = props => {
49
- console.log(props);
50
- return /*#__PURE__*/React.createElement(TabBar, _extends({}, props, {
51
- activeColor: activeColor,
52
- inactiveColor: inactiveColor,
53
- pressColor: pressColor,
54
- scrollEnabled: scrollEnabled,
55
- indicatorStyle: {
56
- backgroundColor: indicatorColor
57
- },
58
- renderIcon: _ref2 => {
59
- let {
60
- route,
61
- color
62
- } = _ref2;
63
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
64
- name: route.icon,
65
- color: color,
66
- size: 36
67
- }) : null;
68
- },
69
- style: style
70
- }));
71
- };
72
-
73
- return /*#__PURE__*/React.createElement(TabView, {
74
- navigationState: {
75
- index,
76
- routes
77
- },
78
- renderScene: SceneMap(tabScenes),
79
- renderTabBar: renderTabBar,
80
- onIndexChange: indexChangeHandler,
81
- tabBarPosition: tabBarPosition,
82
- keyboardDismissMode: keyboardDismissMode,
83
- swipeEnabled: swipeEnabled
84
- });
85
- };
86
-
87
- export default TabViewComponent;
@@ -1,18 +0,0 @@
1
- const TabViewItem = _ref => {
2
- let {
3
- title,
4
- id,
5
- icon,
6
- children,
7
- accessibilityLabel
8
- } = _ref;
9
- console.log({
10
- title,
11
- id,
12
- icon,
13
- accessibilityLabel
14
- });
15
- return children;
16
- };
17
-
18
- export default TabViewItem;
@@ -1,2 +0,0 @@
1
- export { default as TabView } from "./TabView";
2
- export { default as TabViewItem } from "./TabViewItem";
@@ -1,70 +0,0 @@
1
- import { COMPONENT_TYPES, createTextProp, createTextEnumProp, createBoolProp, createColorProp } from "@draftbit/types";
2
- export const SEED_DATA = [{
3
- name: "Tab View",
4
- tag: "TabView",
5
- category: COMPONENT_TYPES.container,
6
- layout: {},
7
- props: {
8
- tabBarPosition: createTextEnumProp({
9
- label: "Tab Bar Position",
10
- description: "Tab Bar Position",
11
- options: ["top", "bottom"],
12
- defaultValue: "top"
13
- }),
14
- keyboardDismissMode: createTextEnumProp({
15
- label: "Keyboard Dismiss Mode",
16
- description: "Keyboard Dismiss Mode",
17
- options: ["auto", "on-drag", "none"],
18
- defaultValue: "auto"
19
- }),
20
- swipeEnabled: createBoolProp({
21
- label: "Swipe Enabled",
22
- description: "Swipe Enabled",
23
- defaultValue: true
24
- }),
25
- scrollEnabled: createBoolProp({
26
- label: "Scroll Enabled",
27
- description: "Scroll Enabled",
28
- defaultValue: true
29
- }),
30
- activeColor: createColorProp({
31
- label: "Active Color",
32
- description: "Active Color",
33
- defaultValue: "primary"
34
- }),
35
- inactiveColor: createColorProp({
36
- label: "Inactive Color",
37
- description: "Inactive Color",
38
- defaultValue: null
39
- }),
40
- pressColor: createColorProp({
41
- label: "Press Color",
42
- description: "Press Color",
43
- defaultValue: null
44
- }),
45
- indicatorColor: createColorProp({
46
- label: "Indicator Color",
47
- description: "Indicator Color",
48
- defaultValue: null
49
- })
50
- }
51
- }, {
52
- name: "Tab View Item",
53
- tag: "TabViewItem",
54
- category: COMPONENT_TYPES.container,
55
- layout: {},
56
- props: {
57
- title: createTextProp({
58
- label: "Title",
59
- description: "Tab Title"
60
- }),
61
- id: createTextProp({
62
- label: "Id",
63
- description: "Tab Id"
64
- }),
65
- accessibilityLabel: createTextProp({
66
- label: "Accessibility Label",
67
- description: "Accessibility Label"
68
- })
69
- }
70
- }];
@@ -1,19 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
- import type { IconSlot } from "../../interfaces/Icon";
4
- declare type TabBarPosition = "top" | "bottom";
5
- declare type KeyboardDismissMode = "none" | "auto" | "on-drag";
6
- declare type TabViewProps = {
7
- tabBarPosition?: TabBarPosition;
8
- keyboardDismissMode?: KeyboardDismissMode;
9
- swipeEnabled?: boolean;
10
- scrollEnabled?: boolean;
11
- activeColor?: string;
12
- inactiveColor?: string;
13
- pressColor?: string;
14
- indicatorColor?: string;
15
- style?: StyleProp<TextStyle | ViewStyle>;
16
- children: React.ReactNode;
17
- } & IconSlot;
18
- declare const TabViewComponent: ({ Icon, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, style, children, }: TabViewProps) => JSX.Element;
19
- export default TabViewComponent;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- interface TabViewItemProps {
3
- title: string;
4
- id: string;
5
- icon: string;
6
- accessibilityLabel: string;
7
- children: React.ReactNode;
8
- }
9
- declare const TabViewItem: ({ title, id, icon, children, accessibilityLabel, }: TabViewItemProps) => React.ReactNode;
10
- export default TabViewItem;
@@ -1,2 +0,0 @@
1
- export { default as TabView } from "./TabView";
2
- export { default as TabViewItem } from "./TabViewItem";
@@ -1,111 +0,0 @@
1
- export declare const SEED_DATA: ({
2
- name: string;
3
- tag: string;
4
- category: string;
5
- layout: {};
6
- props: {
7
- tabBarPosition: {
8
- group: string;
9
- label: string;
10
- description: string;
11
- editable: boolean;
12
- required: boolean;
13
- formType: string;
14
- propType: string;
15
- defaultValue: null;
16
- options: never[];
17
- };
18
- keyboardDismissMode: {
19
- group: string;
20
- label: string;
21
- description: string;
22
- editable: boolean;
23
- required: boolean;
24
- formType: string;
25
- propType: string;
26
- defaultValue: null;
27
- options: never[];
28
- };
29
- swipeEnabled: {
30
- label: string;
31
- description: string;
32
- formType: string;
33
- propType: string;
34
- defaultValue: boolean;
35
- editable: boolean;
36
- required: boolean;
37
- group: string;
38
- };
39
- scrollEnabled: {
40
- label: string;
41
- description: string;
42
- formType: string;
43
- propType: string;
44
- defaultValue: boolean;
45
- editable: boolean;
46
- required: boolean;
47
- group: string;
48
- };
49
- activeColor: {
50
- group: string;
51
- label: string;
52
- description: string;
53
- editable: boolean;
54
- required: boolean;
55
- defaultValue: null;
56
- formType: string;
57
- propType: string;
58
- };
59
- inactiveColor: {
60
- group: string;
61
- label: string;
62
- description: string;
63
- editable: boolean;
64
- required: boolean;
65
- defaultValue: null;
66
- formType: string;
67
- propType: string;
68
- };
69
- pressColor: {
70
- group: string;
71
- label: string;
72
- description: string;
73
- editable: boolean;
74
- required: boolean;
75
- defaultValue: null;
76
- formType: string;
77
- propType: string;
78
- };
79
- indicatorColor: {
80
- group: string;
81
- label: string;
82
- description: string;
83
- editable: boolean;
84
- required: boolean;
85
- defaultValue: null;
86
- formType: string;
87
- propType: string;
88
- };
89
- title?: undefined;
90
- id?: undefined;
91
- accessibilityLabel?: undefined;
92
- };
93
- } | {
94
- name: string;
95
- tag: string;
96
- category: string;
97
- layout: {};
98
- props: {
99
- title: any;
100
- id: any;
101
- accessibilityLabel: any;
102
- tabBarPosition?: undefined;
103
- keyboardDismissMode?: undefined;
104
- swipeEnabled?: undefined;
105
- scrollEnabled?: undefined;
106
- activeColor?: undefined;
107
- inactiveColor?: undefined;
108
- pressColor?: undefined;
109
- indicatorColor?: undefined;
110
- };
111
- })[];
@@ -1,34 +0,0 @@
1
- import * as React from "react";
2
- import { TabView, TabBar, SceneMap } from "react-native-tab-view";
3
- // import { withTheme } from "../../theming";
4
- import TabViewItem from "./TabViewItem";
5
- const TabViewComponent = ({ Icon, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, style, children, }) => {
6
- const [index, setIndex] = React.useState(0);
7
- const [routes, setRoutes] = React.useState([]);
8
- const [tabScenes, setTabScenes] = React.useState({});
9
- React.useEffect(() => {
10
- const newRoutes = [];
11
- const scenes = {};
12
- React.Children.toArray(children)
13
- .filter((child) => child.type === TabViewItem)
14
- .forEach((child) => {
15
- var _a, _b, _c;
16
- if ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.id) {
17
- newRoutes.push({
18
- key: (_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id,
19
- ...child === null || child === void 0 ? void 0 : child.props,
20
- });
21
- scenes[(_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.id] = () => child;
22
- }
23
- });
24
- setRoutes(newRoutes);
25
- setTabScenes(scenes);
26
- }, [children]);
27
- const indexChangeHandler = (i) => setIndex(i);
28
- const renderTabBar = (props) => {
29
- console.log(props);
30
- return (React.createElement(TabBar, { ...props, activeColor: activeColor, inactiveColor: inactiveColor, pressColor: pressColor, scrollEnabled: scrollEnabled, indicatorStyle: { backgroundColor: indicatorColor }, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 36 })) : null, style: style }));
31
- };
32
- return (React.createElement(TabView, { navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
33
- };
34
- export default TabViewComponent;
@@ -1,97 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
- import { TabView, TabBar, SceneMap } from "react-native-tab-view";
4
-
5
- // import { withTheme } from "../../theming";
6
- import TabViewItem from "./TabViewItem";
7
- import type { IconSlot } from "../../interfaces/Icon";
8
-
9
- type TabBarPosition = "top" | "bottom";
10
- type KeyboardDismissMode = "none" | "auto" | "on-drag";
11
-
12
- type TabViewProps = {
13
- tabBarPosition?: TabBarPosition;
14
- keyboardDismissMode?: KeyboardDismissMode;
15
- swipeEnabled?: boolean;
16
- scrollEnabled?: boolean;
17
- activeColor?: string;
18
- inactiveColor?: string;
19
- pressColor?: string;
20
- indicatorColor?: string;
21
- style?: StyleProp<TextStyle | ViewStyle>;
22
- children: React.ReactNode;
23
- } & IconSlot;
24
-
25
- const TabViewComponent = ({
26
- Icon,
27
- tabBarPosition,
28
- keyboardDismissMode,
29
- swipeEnabled,
30
- scrollEnabled,
31
- activeColor,
32
- inactiveColor,
33
- pressColor,
34
- indicatorColor,
35
- style,
36
- children,
37
- }: TabViewProps) => {
38
- const [index, setIndex] = React.useState(0);
39
- const [routes, setRoutes] = React.useState([]);
40
- const [tabScenes, setTabScenes] = React.useState({});
41
-
42
- React.useEffect(() => {
43
- const newRoutes: any = [];
44
- const scenes: any = {};
45
-
46
- React.Children.toArray(children)
47
- .filter((child: any) => child.type === TabViewItem)
48
- .forEach((child: any) => {
49
- if (child?.props?.id) {
50
- newRoutes.push({
51
- key: child?.props?.id,
52
- ...child?.props,
53
- });
54
- scenes[child?.props?.id] = () => child;
55
- }
56
- });
57
-
58
- setRoutes(newRoutes);
59
- setTabScenes(scenes);
60
- }, [children]);
61
-
62
- const indexChangeHandler = (i: any) => setIndex(i);
63
-
64
- const renderTabBar = (props: any) => {
65
- console.log(props);
66
- return (
67
- <TabBar
68
- {...props}
69
- activeColor={activeColor}
70
- inactiveColor={inactiveColor}
71
- pressColor={pressColor}
72
- scrollEnabled={scrollEnabled}
73
- indicatorStyle={{ backgroundColor: indicatorColor }}
74
- renderIcon={({ route, color }) =>
75
- route?.icon ? (
76
- <Icon name={route.icon} color={color} size={36} />
77
- ) : null
78
- }
79
- style={style}
80
- />
81
- );
82
- };
83
-
84
- return (
85
- <TabView
86
- navigationState={{ index, routes }}
87
- renderScene={SceneMap(tabScenes)}
88
- renderTabBar={renderTabBar}
89
- onIndexChange={indexChangeHandler}
90
- tabBarPosition={tabBarPosition}
91
- keyboardDismissMode={keyboardDismissMode}
92
- swipeEnabled={swipeEnabled}
93
- />
94
- );
95
- };
96
-
97
- export default TabViewComponent;
@@ -1,5 +0,0 @@
1
- const TabViewItem = ({ title, id, icon, children, accessibilityLabel, }) => {
2
- console.log({ title, id, icon, accessibilityLabel });
3
- return children;
4
- };
5
- export default TabViewItem;
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- interface TabViewItemProps {
3
- title: string;
4
- id: string;
5
- icon: string;
6
- accessibilityLabel: string;
7
- children: React.ReactNode;
8
- }
9
-
10
- const TabViewItem = ({
11
- title,
12
- id,
13
- icon,
14
- children,
15
- accessibilityLabel,
16
- }: TabViewItemProps) => {
17
- console.log({ title, id, icon, accessibilityLabel });
18
- return children;
19
- };
20
-
21
- export default TabViewItem;
@@ -1,2 +0,0 @@
1
- export { default as TabView } from "./TabView";
2
- export { default as TabViewItem } from "./TabViewItem";
@@ -1,2 +0,0 @@
1
- export { default as TabView } from "./TabView";
2
- export { default as TabViewItem } from "./TabViewItem";
@@ -1,73 +0,0 @@
1
- import { COMPONENT_TYPES, createTextProp, createTextEnumProp, createBoolProp, createColorProp, } from "@draftbit/types";
2
- export const SEED_DATA = [
3
- {
4
- name: "Tab View",
5
- tag: "TabView",
6
- category: COMPONENT_TYPES.container,
7
- layout: {},
8
- props: {
9
- tabBarPosition: createTextEnumProp({
10
- label: "Tab Bar Position",
11
- description: "Tab Bar Position",
12
- options: ["top", "bottom"],
13
- defaultValue: "top",
14
- }),
15
- keyboardDismissMode: createTextEnumProp({
16
- label: "Keyboard Dismiss Mode",
17
- description: "Keyboard Dismiss Mode",
18
- options: ["auto", "on-drag", "none"],
19
- defaultValue: "auto",
20
- }),
21
- swipeEnabled: createBoolProp({
22
- label: "Swipe Enabled",
23
- description: "Swipe Enabled",
24
- defaultValue: true,
25
- }),
26
- scrollEnabled: createBoolProp({
27
- label: "Scroll Enabled",
28
- description: "Scroll Enabled",
29
- defaultValue: true,
30
- }),
31
- activeColor: createColorProp({
32
- label: "Active Color",
33
- description: "Active Color",
34
- defaultValue: "primary",
35
- }),
36
- inactiveColor: createColorProp({
37
- label: "Inactive Color",
38
- description: "Inactive Color",
39
- defaultValue: null,
40
- }),
41
- pressColor: createColorProp({
42
- label: "Press Color",
43
- description: "Press Color",
44
- defaultValue: null,
45
- }),
46
- indicatorColor: createColorProp({
47
- label: "Indicator Color",
48
- description: "Indicator Color",
49
- defaultValue: null,
50
- }),
51
- },
52
- },
53
- {
54
- name: "Tab View Item",
55
- tag: "TabViewItem",
56
- category: COMPONENT_TYPES.container,
57
- layout: {},
58
- props: {
59
- title: createTextProp({
60
- label: "Title",
61
- description: "Tab Title",
62
- }),
63
- id: createTextProp({
64
- label: "Id",
65
- description: "Tab Id",
66
- }),
67
- accessibilityLabel: createTextProp({
68
- label: "Accessibility Label",
69
- description: "Accessibility Label",
70
- }),
71
- },
72
- },
73
- ];
@@ -1,80 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createTextProp,
4
- createTextEnumProp,
5
- createBoolProp,
6
- createColorProp,
7
- } from "@draftbit/types";
8
-
9
- export const SEED_DATA = [
10
- {
11
- name: "Tab View",
12
- tag: "TabView",
13
- category: COMPONENT_TYPES.container,
14
- layout: {},
15
- props: {
16
- tabBarPosition: createTextEnumProp({
17
- label: "Tab Bar Position",
18
- description: "Tab Bar Position",
19
- options: ["top", "bottom"],
20
- defaultValue: "top",
21
- }),
22
- keyboardDismissMode: createTextEnumProp({
23
- label: "Keyboard Dismiss Mode",
24
- description: "Keyboard Dismiss Mode",
25
- options: ["auto", "on-drag", "none"],
26
- defaultValue: "auto",
27
- }),
28
- swipeEnabled: createBoolProp({
29
- label: "Swipe Enabled",
30
- description: "Swipe Enabled",
31
- defaultValue: true,
32
- }),
33
- scrollEnabled: createBoolProp({
34
- label: "Scroll Enabled",
35
- description: "Scroll Enabled",
36
- defaultValue: true,
37
- }),
38
- activeColor: createColorProp({
39
- label: "Active Color",
40
- description: "Active Color",
41
- defaultValue: "primary",
42
- }),
43
- inactiveColor: createColorProp({
44
- label: "Inactive Color",
45
- description: "Inactive Color",
46
- defaultValue: null,
47
- }),
48
- pressColor: createColorProp({
49
- label: "Press Color",
50
- description: "Press Color",
51
- defaultValue: null,
52
- }),
53
- indicatorColor: createColorProp({
54
- label: "Indicator Color",
55
- description: "Indicator Color",
56
- defaultValue: null,
57
- }),
58
- },
59
- },
60
- {
61
- name: "Tab View Item",
62
- tag: "TabViewItem",
63
- category: COMPONENT_TYPES.container,
64
- layout: {},
65
- props: {
66
- title: createTextProp({
67
- label: "Title",
68
- description: "Tab Title",
69
- }),
70
- id: createTextProp({
71
- label: "Id",
72
- description: "Tab Id",
73
- }),
74
- accessibilityLabel: createTextProp({
75
- label: "Accessibility Label",
76
- description: "Accessibility Label",
77
- }),
78
- },
79
- },
80
- ];