@draftbit/core 46.8.2-af4b7d.2 → 46.8.2-cd657e.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 (43) hide show
  1. package/lib/commonjs/components/TabView/TabView.js +116 -0
  2. package/lib/commonjs/components/TabView/TabViewItem.js +25 -0
  3. package/lib/commonjs/components/TabView/index.js +20 -0
  4. package/lib/commonjs/index.js +13 -0
  5. package/lib/commonjs/mappings/TabView.js +74 -0
  6. package/lib/commonjs/mappings/TabViewItem.js +37 -0
  7. package/lib/module/components/TabView/TabView.js +107 -0
  8. package/lib/module/components/TabView/TabViewItem.js +20 -0
  9. package/lib/module/components/TabView/index.js +2 -0
  10. package/lib/module/constants.js +1 -0
  11. package/lib/module/index.js +1 -0
  12. package/lib/module/mappings/TabView.js +67 -0
  13. package/lib/module/mappings/TabViewItem.js +30 -0
  14. package/lib/typescript/src/components/TabView/TabView.d.ts +26 -0
  15. package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -0
  16. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +11 -0
  17. package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -0
  18. package/lib/typescript/src/components/TabView/index.d.ts +3 -0
  19. package/lib/typescript/src/components/TabView/index.d.ts.map +1 -0
  20. package/lib/typescript/src/index.d.ts +1 -0
  21. package/lib/typescript/src/index.d.ts.map +1 -1
  22. package/lib/typescript/src/mappings/{HtmlElements.d.ts → TabView.d.ts} +63 -49
  23. package/lib/typescript/src/mappings/TabView.d.ts.map +1 -0
  24. package/lib/typescript/src/mappings/TabViewItem.d.ts +25 -0
  25. package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -0
  26. package/package.json +5 -4
  27. package/src/components/TabView/TabView.js +54 -0
  28. package/src/components/TabView/TabView.tsx +147 -0
  29. package/src/components/TabView/TabViewItem.js +11 -0
  30. package/src/components/TabView/TabViewItem.tsx +25 -0
  31. package/src/components/TabView/index.js +2 -0
  32. package/src/components/TabView/index.tsx +2 -0
  33. package/src/index.js +1 -0
  34. package/src/index.tsx +2 -0
  35. package/src/mappings/TabView.js +75 -0
  36. package/src/mappings/TabView.ts +85 -0
  37. package/src/mappings/TabViewItem.js +30 -0
  38. package/src/mappings/TabViewItem.ts +38 -0
  39. package/lib/commonjs/mappings/HtmlElements.js +0 -160
  40. package/lib/module/mappings/HtmlElements.js +0 -153
  41. package/lib/typescript/src/mappings/HtmlElements.d.ts.map +0 -1
  42. package/src/mappings/HtmlElements.js +0 -180
  43. package/src/mappings/HtmlElements.ts +0 -194
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _reactNativeTabView = require("react-native-tab-view");
9
+ var _theming = require("../../theming");
10
+ var _utilities = require("../../utilities");
11
+ 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); }
12
+ 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; }
13
+ 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); }
14
+ const TabViewComponent = _ref => {
15
+ let {
16
+ Icon,
17
+ onIndexChanged,
18
+ onEndReached,
19
+ tabBarPosition,
20
+ keyboardDismissMode,
21
+ swipeEnabled,
22
+ scrollEnabled,
23
+ activeColor,
24
+ inactiveColor,
25
+ pressColor,
26
+ indicatorColor,
27
+ tabsBackgroundColor,
28
+ style,
29
+ theme,
30
+ children
31
+ } = _ref;
32
+ const [index, setIndex] = React.useState(0);
33
+ const [routes, setRoutes] = React.useState([]);
34
+ const [tabScenes, setTabScenes] = React.useState({});
35
+ const {
36
+ textStyles,
37
+ viewStyles
38
+ } = (0, _utilities.extractStyles)(style);
39
+
40
+ //Check type of child using props
41
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
42
+ const instanceOfTabViewItemProps = object => {
43
+ return "title" in object;
44
+ };
45
+
46
+ //Populate routes and scenes based on children
47
+ React.useEffect(() => {
48
+ const newRoutes = [];
49
+ const scenes = {};
50
+ React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfTabViewItemProps(child.props)).forEach((item, idx) => {
51
+ const child = item;
52
+ newRoutes.push({
53
+ key: idx.toString(),
54
+ title: child.props.title,
55
+ icon: child.props.icon,
56
+ accessibilityLabel: child.props.accessibilityLabel
57
+ });
58
+ scenes[idx] = () => child;
59
+ });
60
+ setRoutes(newRoutes);
61
+ setTabScenes(scenes);
62
+ }, [children]);
63
+ const indexChangeHandler = i => {
64
+ setIndex(i);
65
+ onIndexChanged === null || onIndexChanged === void 0 ? void 0 : onIndexChanged(i);
66
+ if (i === routes.length) {
67
+ onEndReached === null || onEndReached === void 0 ? void 0 : onEndReached();
68
+ }
69
+ };
70
+ const renderTabBar = props => {
71
+ return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
72
+ activeColor: activeColor || theme.colors.primary,
73
+ inactiveColor: inactiveColor || theme.colors.divider,
74
+ pressColor: pressColor || theme.colors.primary,
75
+ scrollEnabled: scrollEnabled,
76
+ indicatorStyle: {
77
+ backgroundColor: indicatorColor || theme.colors.primary
78
+ },
79
+ labelStyle: textStyles,
80
+ renderIcon: _ref2 => {
81
+ let {
82
+ route,
83
+ color
84
+ } = _ref2;
85
+ return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
86
+ name: route.icon,
87
+ color: color,
88
+ size: 16
89
+ }) : null;
90
+ },
91
+ style: {
92
+ backgroundColor: tabsBackgroundColor || theme.colors.background
93
+ }
94
+ }));
95
+ };
96
+
97
+ //Cannot render TabView without at least one tab
98
+ if (!routes.length) {
99
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
100
+ }
101
+ return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
102
+ style: [viewStyles],
103
+ navigationState: {
104
+ index,
105
+ routes
106
+ },
107
+ renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
108
+ renderTabBar: renderTabBar,
109
+ onIndexChange: indexChangeHandler,
110
+ tabBarPosition: tabBarPosition,
111
+ keyboardDismissMode: keyboardDismissMode,
112
+ swipeEnabled: swipeEnabled
113
+ });
114
+ };
115
+ var _default = (0, _theming.withTheme)(TabViewComponent);
116
+ exports.default = _default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ const TabViewItem = _ref => {
11
+ let {
12
+ style,
13
+ children
14
+ } = _ref;
15
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
16
+ style: [styles.parentContainer, style]
17
+ }, children);
18
+ };
19
+ const styles = _reactNative.StyleSheet.create({
20
+ parentContainer: {
21
+ flex: 1
22
+ }
23
+ });
24
+ var _default = TabViewItem;
25
+ exports.default = _default;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "TabView", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _TabView.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "TabViewItem", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _TabViewItem.default;
16
+ }
17
+ });
18
+ var _TabView = _interopRequireDefault(require("./TabView"));
19
+ var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -339,6 +339,18 @@ Object.defineProperty(exports, "SwitchRow", {
339
339
  return _Switch.SwitchRow;
340
340
  }
341
341
  });
342
+ Object.defineProperty(exports, "TabView", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _TabView.TabView;
346
+ }
347
+ });
348
+ Object.defineProperty(exports, "TabViewItem", {
349
+ enumerable: true,
350
+ get: function () {
351
+ return _TabView.TabViewItem;
352
+ }
353
+ });
342
354
  Object.defineProperty(exports, "TextField", {
343
355
  enumerable: true,
344
356
  get: function () {
@@ -414,6 +426,7 @@ var _Swiper = require("./components/Swiper");
414
426
  var _Layout = require("./components/Layout");
415
427
  var _index = require("./components/RadioButton/index");
416
428
  var _DeckSwiper = require("./components/DeckSwiper");
429
+ var _TabView = require("./components/TabView");
417
430
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
418
431
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
419
432
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+ var _types = require("@draftbit/types");
8
+ const SEED_DATA = {
9
+ name: "Tab View",
10
+ tag: "TabView",
11
+ description: "Tab view container",
12
+ category: _types.COMPONENT_TYPES.swiper,
13
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Typography],
14
+ triggers: [_types.Triggers.OnIndexChanged, _types.Triggers.OnEndReached],
15
+ props: {
16
+ onIndexChanged: (0, _types.createActionProp)({
17
+ label: "On index changed",
18
+ description: "Action to execute when swipe to new index"
19
+ }),
20
+ onEndReached: (0, _types.createActionProp)({
21
+ label: "On end reached",
22
+ description: "Action to execute when end of swiping reached"
23
+ }),
24
+ tabBarPosition: (0, _types.createTextEnumProp)({
25
+ label: "Tab Bar Position",
26
+ description: "Position of tab bar",
27
+ options: ["top", "bottom"],
28
+ defaultValue: "top"
29
+ }),
30
+ keyboardDismissMode: (0, _types.createTextEnumProp)({
31
+ label: "Keyboard Dismiss Mode",
32
+ description: "Keyboard Dismiss Mode",
33
+ options: ["auto", "on-drag", "none"],
34
+ defaultValue: "auto"
35
+ }),
36
+ swipeEnabled: (0, _types.createStaticBoolProp)({
37
+ label: "Swipe Enabled",
38
+ description: "Whether swiping is enabled or not",
39
+ defaultValue: true
40
+ }),
41
+ scrollEnabled: (0, _types.createStaticBoolProp)({
42
+ label: "Tab Scroll Enabled",
43
+ description: "Whether scrolling of tabs is enabled or not",
44
+ defaultValue: false
45
+ }),
46
+ activeColor: (0, _types.createColorProp)({
47
+ label: "Active Color",
48
+ description: "Color of icon and text of active tab",
49
+ defaultValue: "primary"
50
+ }),
51
+ inactiveColor: (0, _types.createColorProp)({
52
+ label: "Inactive Color",
53
+ description: "Color of icon and text of inactive tab(s)",
54
+ defaultValue: null
55
+ }),
56
+ pressColor: (0, _types.createColorProp)({
57
+ label: "Press Color",
58
+ description: "Color of ripple when pressed",
59
+ defaultValue: "primary",
60
+ group: _types.GROUPS.android
61
+ }),
62
+ indicatorColor: (0, _types.createColorProp)({
63
+ label: "Indicator Color",
64
+ description: "Color of indicator",
65
+ defaultValue: "primary"
66
+ }),
67
+ tabsBackgroundColor: (0, _types.createColorProp)({
68
+ label: "Tabs Background Color",
69
+ description: "Background color of tabs container",
70
+ defaultValue: "background"
71
+ })
72
+ }
73
+ };
74
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+ var _types = require("@draftbit/types");
8
+ const SEED_DATA = {
9
+ name: "Tab View Item",
10
+ tag: "TabViewItem",
11
+ description: "Single Tab View item to be used in TabView. Each item represents a single tab and its content",
12
+ category: _types.COMPONENT_TYPES.swiper,
13
+ stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
+ layout: {
15
+ flex: 1
16
+ },
17
+ props: {
18
+ title: (0, _types.createTextProp)({
19
+ label: "Title",
20
+ description: "Title of tab item",
21
+ defaultValue: "Title",
22
+ required: true,
23
+ group: _types.GROUPS.basic
24
+ }),
25
+ icon: (0, _types.createIconProp)({
26
+ defaultValue: null,
27
+ required: false
28
+ }),
29
+ accessibilityLabel: (0, _types.createTextProp)({
30
+ label: "Accessibility Label",
31
+ description: "Accessibility Label",
32
+ defaultValue: null,
33
+ group: _types.GROUPS.accessibility
34
+ })
35
+ }
36
+ };
37
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,107 @@
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
+ import * as React from "react";
3
+ import { TabView, TabBar, SceneMap } from "react-native-tab-view";
4
+ import { withTheme } from "../../theming";
5
+ import { extractStyles } from "../../utilities";
6
+ const TabViewComponent = _ref => {
7
+ let {
8
+ Icon,
9
+ onIndexChanged,
10
+ onEndReached,
11
+ tabBarPosition,
12
+ keyboardDismissMode,
13
+ swipeEnabled,
14
+ scrollEnabled,
15
+ activeColor,
16
+ inactiveColor,
17
+ pressColor,
18
+ indicatorColor,
19
+ tabsBackgroundColor,
20
+ style,
21
+ theme,
22
+ children
23
+ } = _ref;
24
+ const [index, setIndex] = React.useState(0);
25
+ const [routes, setRoutes] = React.useState([]);
26
+ const [tabScenes, setTabScenes] = React.useState({});
27
+ const {
28
+ textStyles,
29
+ viewStyles
30
+ } = extractStyles(style);
31
+
32
+ //Check type of child using props
33
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
34
+ const instanceOfTabViewItemProps = object => {
35
+ return "title" in object;
36
+ };
37
+
38
+ //Populate routes and scenes based on children
39
+ React.useEffect(() => {
40
+ const newRoutes = [];
41
+ const scenes = {};
42
+ React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfTabViewItemProps(child.props)).forEach((item, idx) => {
43
+ const child = item;
44
+ newRoutes.push({
45
+ key: idx.toString(),
46
+ title: child.props.title,
47
+ icon: child.props.icon,
48
+ accessibilityLabel: child.props.accessibilityLabel
49
+ });
50
+ scenes[idx] = () => child;
51
+ });
52
+ setRoutes(newRoutes);
53
+ setTabScenes(scenes);
54
+ }, [children]);
55
+ const indexChangeHandler = i => {
56
+ setIndex(i);
57
+ onIndexChanged === null || onIndexChanged === void 0 ? void 0 : onIndexChanged(i);
58
+ if (i === routes.length) {
59
+ onEndReached === null || onEndReached === void 0 ? void 0 : onEndReached();
60
+ }
61
+ };
62
+ const renderTabBar = props => {
63
+ return /*#__PURE__*/React.createElement(TabBar, _extends({}, props, {
64
+ activeColor: activeColor || theme.colors.primary,
65
+ inactiveColor: inactiveColor || theme.colors.divider,
66
+ pressColor: pressColor || theme.colors.primary,
67
+ scrollEnabled: scrollEnabled,
68
+ indicatorStyle: {
69
+ backgroundColor: indicatorColor || theme.colors.primary
70
+ },
71
+ labelStyle: textStyles,
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: 16
81
+ }) : null;
82
+ },
83
+ style: {
84
+ backgroundColor: tabsBackgroundColor || theme.colors.background
85
+ }
86
+ }));
87
+ };
88
+
89
+ //Cannot render TabView without at least one tab
90
+ if (!routes.length) {
91
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
92
+ }
93
+ return /*#__PURE__*/React.createElement(TabView, {
94
+ style: [viewStyles],
95
+ navigationState: {
96
+ index,
97
+ routes
98
+ },
99
+ renderScene: SceneMap(tabScenes),
100
+ renderTabBar: renderTabBar,
101
+ onIndexChange: indexChangeHandler,
102
+ tabBarPosition: tabBarPosition,
103
+ keyboardDismissMode: keyboardDismissMode,
104
+ swipeEnabled: swipeEnabled
105
+ });
106
+ };
107
+ export default withTheme(TabViewComponent);
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+
4
+ //Props used by parent (TabView) to create tabs
5
+
6
+ const TabViewItem = _ref => {
7
+ let {
8
+ style,
9
+ children
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement(View, {
12
+ style: [styles.parentContainer, style]
13
+ }, children);
14
+ };
15
+ const styles = StyleSheet.create({
16
+ parentContainer: {
17
+ flex: 1
18
+ }
19
+ });
20
+ export default TabViewItem;
@@ -0,0 +1,2 @@
1
+ export { default as TabView } from "./TabView";
2
+ export { default as TabViewItem } from "./TabViewItem";
@@ -6,4 +6,5 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
6
6
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
7
7
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
8
8
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
9
+ });O : 0
9
10
  });
@@ -32,6 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
34
34
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
+ export { TabView, TabViewItem } from "./components/TabView";
35
36
 
36
37
  /* Deprecated: Fix or Delete! */
37
38
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -0,0 +1,67 @@
1
+ import { COMPONENT_TYPES, createTextEnumProp, createColorProp, StylesPanelSections, Triggers, createActionProp, createStaticBoolProp, GROUPS } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Tab View",
4
+ tag: "TabView",
5
+ description: "Tab view container",
6
+ category: COMPONENT_TYPES.swiper,
7
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.Background, StylesPanelSections.Typography],
8
+ triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
9
+ props: {
10
+ onIndexChanged: createActionProp({
11
+ label: "On index changed",
12
+ description: "Action to execute when swipe to new index"
13
+ }),
14
+ onEndReached: createActionProp({
15
+ label: "On end reached",
16
+ description: "Action to execute when end of swiping reached"
17
+ }),
18
+ tabBarPosition: createTextEnumProp({
19
+ label: "Tab Bar Position",
20
+ description: "Position of tab bar",
21
+ options: ["top", "bottom"],
22
+ defaultValue: "top"
23
+ }),
24
+ keyboardDismissMode: createTextEnumProp({
25
+ label: "Keyboard Dismiss Mode",
26
+ description: "Keyboard Dismiss Mode",
27
+ options: ["auto", "on-drag", "none"],
28
+ defaultValue: "auto"
29
+ }),
30
+ swipeEnabled: createStaticBoolProp({
31
+ label: "Swipe Enabled",
32
+ description: "Whether swiping is enabled or not",
33
+ defaultValue: true
34
+ }),
35
+ scrollEnabled: createStaticBoolProp({
36
+ label: "Tab Scroll Enabled",
37
+ description: "Whether scrolling of tabs is enabled or not",
38
+ defaultValue: false
39
+ }),
40
+ activeColor: createColorProp({
41
+ label: "Active Color",
42
+ description: "Color of icon and text of active tab",
43
+ defaultValue: "primary"
44
+ }),
45
+ inactiveColor: createColorProp({
46
+ label: "Inactive Color",
47
+ description: "Color of icon and text of inactive tab(s)",
48
+ defaultValue: null
49
+ }),
50
+ pressColor: createColorProp({
51
+ label: "Press Color",
52
+ description: "Color of ripple when pressed",
53
+ defaultValue: "primary",
54
+ group: GROUPS.android
55
+ }),
56
+ indicatorColor: createColorProp({
57
+ label: "Indicator Color",
58
+ description: "Color of indicator",
59
+ defaultValue: "primary"
60
+ }),
61
+ tabsBackgroundColor: createColorProp({
62
+ label: "Tabs Background Color",
63
+ description: "Background color of tabs container",
64
+ defaultValue: "background"
65
+ })
66
+ }
67
+ };
@@ -0,0 +1,30 @@
1
+ import { COMPONENT_TYPES, createTextProp, createIconProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Tab View Item",
4
+ tag: "TabViewItem",
5
+ description: "Single Tab View item to be used in TabView. Each item represents a single tab and its content",
6
+ category: COMPONENT_TYPES.swiper,
7
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ layout: {
9
+ flex: 1
10
+ },
11
+ props: {
12
+ title: createTextProp({
13
+ label: "Title",
14
+ description: "Title of tab item",
15
+ defaultValue: "Title",
16
+ required: true,
17
+ group: GROUPS.basic
18
+ }),
19
+ icon: createIconProp({
20
+ defaultValue: null,
21
+ required: false
22
+ }),
23
+ accessibilityLabel: createTextProp({
24
+ label: "Accessibility Label",
25
+ description: "Accessibility Label",
26
+ defaultValue: null,
27
+ group: GROUPS.accessibility
28
+ })
29
+ }
30
+ };
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ import type { IconSlot } from "../../interfaces/Icon";
4
+ import type { Theme } from "../../styles/DefaultTheme";
5
+ declare type TabBarPosition = "top" | "bottom";
6
+ declare type KeyboardDismissMode = "none" | "auto" | "on-drag";
7
+ declare type TabViewProps = {
8
+ onIndexChanged?: (index: number) => void;
9
+ onEndReached?: () => void;
10
+ tabBarPosition?: TabBarPosition;
11
+ keyboardDismissMode?: KeyboardDismissMode;
12
+ swipeEnabled?: boolean;
13
+ scrollEnabled?: boolean;
14
+ activeColor?: string;
15
+ inactiveColor?: string;
16
+ pressColor?: string;
17
+ indicatorColor?: string;
18
+ tabsBackgroundColor?: string;
19
+ style?: StyleProp<ViewStyle>;
20
+ theme: Theme;
21
+ } & IconSlot;
22
+ declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<TabViewProps>, "theme"> & {
23
+ theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
24
+ }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<TabViewProps>> & React.FC<React.PropsWithChildren<TabViewProps>>, {}>;
25
+ export default _default;
26
+ //# sourceMappingURL=TabView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAMvD,aAAK,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AACvC,aAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,aAAK,YAAY,GAAG;IAClB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,QAAQ,CAAC;;;;AA6Gb,wBAA2C"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ export interface TabViewItemProps {
4
+ title: string;
5
+ icon?: string;
6
+ accessibilityLabel?: string;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+ declare const TabViewItem: React.FC<React.PropsWithChildren<TabViewItemProps>>;
10
+ export default TabViewItem;
11
+ //# sourceMappingURL=TabViewItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabViewItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/TabViewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAGtE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAKpE,CAAC;AAQF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as TabView } from "./TabView";
2
+ export { default as TabViewItem } from "./TabViewItem";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TabView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -32,6 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
34
  export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
+ export { TabView, TabViewItem } from "./components/TabView";
35
36
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
36
37
  export { default as Picker } from "./components/Picker/Picker";
37
38
  export { default as ProgressBar } from "./components/ProgressBar";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,E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