@draftbit/core 46.8.2-41c76e.2 → 46.8.2-57763.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 (51) hide show
  1. package/lib/commonjs/components/Markdown.js +30 -0
  2. package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
  3. package/lib/commonjs/components/TabView/TabView.js +116 -0
  4. package/lib/commonjs/components/TabView/TabViewItem.js +25 -0
  5. package/lib/commonjs/components/TabView/index.js +20 -0
  6. package/lib/commonjs/constants.js +1 -1
  7. package/lib/commonjs/index.js +20 -0
  8. package/lib/commonjs/mappings/Markdown.js +27 -0
  9. package/lib/commonjs/mappings/TabView.js +74 -0
  10. package/lib/commonjs/mappings/TabViewItem.js +37 -0
  11. package/lib/module/components/Markdown.js +20 -0
  12. package/lib/module/components/TabView/TabView.js +107 -0
  13. package/lib/module/components/TabView/TabViewItem.js +20 -0
  14. package/lib/module/components/TabView/index.js +2 -0
  15. package/lib/module/index.js +2 -0
  16. package/lib/module/mappings/Markdown.js +20 -0
  17. package/lib/module/mappings/TabView.js +67 -0
  18. package/lib/module/mappings/TabViewItem.js +30 -0
  19. package/lib/typescript/src/components/Markdown.d.ts +8 -0
  20. package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
  21. package/lib/typescript/src/components/TabView/TabView.d.ts +26 -0
  22. package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -0
  23. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +11 -0
  24. package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -0
  25. package/lib/typescript/src/components/TabView/index.d.ts +3 -0
  26. package/lib/typescript/src/components/TabView/index.d.ts.map +1 -0
  27. package/lib/typescript/src/index.d.ts +2 -0
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
  30. package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
  31. package/lib/typescript/src/mappings/TabView.d.ts +123 -0
  32. package/lib/typescript/src/mappings/TabView.d.ts.map +1 -0
  33. package/lib/typescript/src/mappings/TabViewItem.d.ts +25 -0
  34. package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -0
  35. package/package.json +6 -3
  36. package/src/components/Markdown.js +10 -0
  37. package/src/components/Markdown.tsx +22 -0
  38. package/src/components/TabView/TabView.js +54 -0
  39. package/src/components/TabView/TabView.tsx +147 -0
  40. package/src/components/TabView/TabViewItem.js +11 -0
  41. package/src/components/TabView/TabViewItem.tsx +25 -0
  42. package/src/components/TabView/index.js +2 -0
  43. package/src/components/TabView/index.tsx +2 -0
  44. package/src/index.js +2 -0
  45. package/src/index.tsx +3 -0
  46. package/src/mappings/Markdown.js +25 -0
  47. package/src/mappings/Markdown.ts +32 -0
  48. package/src/mappings/TabView.js +75 -0
  49. package/src/mappings/TabView.ts +85 -0
  50. package/src/mappings/TabViewItem.js +30 -0
  51. package/src/mappings/TabViewItem.ts +38 -0
@@ -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,8 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ declare type MarkdownProps = {
4
+ style?: StyleProp<ViewStyle>;
5
+ };
6
+ declare const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>>;
7
+ export default Markdown;
8
+ //# sourceMappingURL=Markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAGhE,aAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAW9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -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,8 @@ 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";
36
+ export { default as Markdown } from "./components/Markdown";
35
37
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
36
38
  export { default as Picker } from "./components/Picker/Picker";
37
39
  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,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EA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AAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ props: {
8
+ children: {
9
+ group: string;
10
+ label: string;
11
+ description: string;
12
+ editable: boolean;
13
+ required: boolean;
14
+ formType: string;
15
+ propType: string;
16
+ defaultValue: string;
17
+ };
18
+ };
19
+ };
20
+ //# sourceMappingURL=Markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Markdown.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAuBrB,CAAC"}
@@ -0,0 +1,123 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ triggers: string[];
8
+ props: {
9
+ onIndexChanged: {
10
+ label: string;
11
+ description: string;
12
+ editable: boolean;
13
+ required: boolean;
14
+ formType: string;
15
+ propType: string;
16
+ defaultValue: null;
17
+ group: string;
18
+ };
19
+ onEndReached: {
20
+ label: string;
21
+ description: string;
22
+ editable: boolean;
23
+ required: boolean;
24
+ formType: string;
25
+ propType: string;
26
+ defaultValue: null;
27
+ group: string;
28
+ };
29
+ tabBarPosition: {
30
+ group: string;
31
+ label: string;
32
+ description: string;
33
+ editable: boolean;
34
+ required: boolean;
35
+ formType: string;
36
+ propType: string;
37
+ defaultValue: null;
38
+ options: never[];
39
+ };
40
+ keyboardDismissMode: {
41
+ group: string;
42
+ label: string;
43
+ description: string;
44
+ editable: boolean;
45
+ required: boolean;
46
+ formType: string;
47
+ propType: string;
48
+ defaultValue: null;
49
+ options: never[];
50
+ };
51
+ swipeEnabled: {
52
+ label: string;
53
+ description: string;
54
+ formType: string;
55
+ propType: string;
56
+ defaultValue: boolean;
57
+ editable: boolean;
58
+ required: boolean;
59
+ group: string;
60
+ };
61
+ scrollEnabled: {
62
+ label: string;
63
+ description: string;
64
+ formType: string;
65
+ propType: string;
66
+ defaultValue: boolean;
67
+ editable: boolean;
68
+ required: boolean;
69
+ group: string;
70
+ };
71
+ activeColor: {
72
+ group: string;
73
+ label: string;
74
+ description: string;
75
+ editable: boolean;
76
+ required: boolean;
77
+ defaultValue: null;
78
+ formType: string;
79
+ propType: string;
80
+ };
81
+ inactiveColor: {
82
+ group: string;
83
+ label: string;
84
+ description: string;
85
+ editable: boolean;
86
+ required: boolean;
87
+ defaultValue: null;
88
+ formType: string;
89
+ propType: string;
90
+ };
91
+ pressColor: {
92
+ group: string;
93
+ label: string;
94
+ description: string;
95
+ editable: boolean;
96
+ required: boolean;
97
+ defaultValue: null;
98
+ formType: string;
99
+ propType: string;
100
+ };
101
+ indicatorColor: {
102
+ group: string;
103
+ label: string;
104
+ description: string;
105
+ editable: boolean;
106
+ required: boolean;
107
+ defaultValue: null;
108
+ formType: string;
109
+ propType: string;
110
+ };
111
+ tabsBackgroundColor: {
112
+ group: string;
113
+ label: string;
114
+ description: string;
115
+ editable: boolean;
116
+ required: boolean;
117
+ defaultValue: null;
118
+ formType: string;
119
+ propType: string;
120
+ };
121
+ };
122
+ };
123
+ //# sourceMappingURL=TabView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TabView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyErB,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ layout: {
8
+ flex: number;
9
+ };
10
+ props: {
11
+ title: any;
12
+ icon: {
13
+ label: string;
14
+ description: string;
15
+ formType: string;
16
+ propType: string;
17
+ defaultValue: string;
18
+ required: boolean;
19
+ editable: boolean;
20
+ group: string;
21
+ };
22
+ accessibilityLabel: any;
23
+ };
24
+ };
25
+ //# sourceMappingURL=TabViewItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabViewItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TabViewItem.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.8.2-41c76e.2+41c76ef",
3
+ "version": "46.8.2-057763.2+0577637",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.8.2-41c76e.2+41c76ef",
44
+ "@draftbit/types": "^46.8.2-057763.2+0577637",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -54,8 +54,11 @@
54
54
  "lodash.omit": "^4.5.0",
55
55
  "lodash.tonumber": "^4.0.3",
56
56
  "react-native-deck-swiper": "^2.0.12",
57
+ "react-native-markdown-display": "^7.0.0-alpha.2",
57
58
  "react-native-modal-datetime-picker": "^13.0.0",
59
+ "react-native-pager-view": "5.4.24",
58
60
  "react-native-svg": "12.3.0",
61
+ "react-native-tab-view": "^3.4.0",
59
62
  "react-native-typography": "^1.4.1",
60
63
  "react-native-web-swiper": "^2.2.3"
61
64
  },
@@ -92,5 +95,5 @@
92
95
  ]
93
96
  ]
94
97
  },
95
- "gitHead": "41c76efe66d0d1d4a67333340e289517c242ef45"
98
+ "gitHead": "05776378124b8cdb9a417de14e23e4c3e85cd9bc"
96
99
  }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import MarkdownComponent from "react-native-markdown-display";
4
+ const Markdown = ({ children, style, }) => {
5
+ return (
6
+ //'body' style applies to all markdown components
7
+ //@ts-ignore TS does not like the type of this named style for some reason
8
+ React.createElement(MarkdownComponent, { style: { body: StyleSheet.flatten(style) } }, children));
9
+ };
10
+ export default Markdown;
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle, StyleSheet } from "react-native";
3
+ import MarkdownComponent from "react-native-markdown-display";
4
+
5
+ type MarkdownProps = {
6
+ style?: StyleProp<ViewStyle>;
7
+ };
8
+
9
+ const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>> = ({
10
+ children,
11
+ style,
12
+ }) => {
13
+ return (
14
+ //'body' style applies to all markdown components
15
+ //@ts-ignore TS does not like the type of this named style for some reason
16
+ <MarkdownComponent style={{ body: StyleSheet.flatten(style) }}>
17
+ {children}
18
+ </MarkdownComponent>
19
+ );
20
+ };
21
+
22
+ export default Markdown;
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+ import { TabView, TabBar, SceneMap, } from "react-native-tab-view";
3
+ import { withTheme } from "../../theming";
4
+ import { extractStyles } from "../../utilities";
5
+ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, style, theme, children, }) => {
6
+ const [index, setIndex] = React.useState(0);
7
+ const [routes, setRoutes] = React.useState([]);
8
+ const [tabScenes, setTabScenes] = React.useState({});
9
+ const { textStyles, viewStyles } = extractStyles(style);
10
+ //Check type of child using props
11
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
12
+ const instanceOfTabViewItemProps = (object) => {
13
+ return "title" in object;
14
+ };
15
+ //Populate routes and scenes based on children
16
+ React.useEffect(() => {
17
+ const newRoutes = [];
18
+ const scenes = {};
19
+ React.Children.toArray(children)
20
+ .filter((child) => React.isValidElement(child) && instanceOfTabViewItemProps(child.props))
21
+ .forEach((item, idx) => {
22
+ const child = item;
23
+ newRoutes.push({
24
+ key: idx.toString(),
25
+ title: child.props.title,
26
+ icon: child.props.icon,
27
+ accessibilityLabel: child.props.accessibilityLabel,
28
+ });
29
+ scenes[idx] = () => child;
30
+ });
31
+ setRoutes(newRoutes);
32
+ setTabScenes(scenes);
33
+ }, [children]);
34
+ const indexChangeHandler = (i) => {
35
+ setIndex(i);
36
+ onIndexChanged === null || onIndexChanged === void 0 ? void 0 : onIndexChanged(i);
37
+ if (i === routes.length) {
38
+ onEndReached === null || onEndReached === void 0 ? void 0 : onEndReached();
39
+ }
40
+ };
41
+ const renderTabBar = (props) => {
42
+ return (React.createElement(TabBar, { ...props, activeColor: activeColor || theme.colors.primary, inactiveColor: inactiveColor || theme.colors.divider, pressColor: pressColor || theme.colors.primary, scrollEnabled: scrollEnabled, indicatorStyle: {
43
+ backgroundColor: indicatorColor || theme.colors.primary,
44
+ }, labelStyle: textStyles, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 16 })) : null, style: {
45
+ backgroundColor: tabsBackgroundColor || theme.colors.background,
46
+ } }));
47
+ };
48
+ //Cannot render TabView without at least one tab
49
+ if (!routes.length) {
50
+ return React.createElement(React.Fragment, null);
51
+ }
52
+ return (React.createElement(TabView, { style: [viewStyles], navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
53
+ };
54
+ export default withTheme(TabViewComponent);
@@ -0,0 +1,147 @@
1
+ import * as React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ import {
4
+ TabView,
5
+ TabBar,
6
+ SceneMap,
7
+ SceneRendererProps,
8
+ NavigationState,
9
+ Route,
10
+ } from "react-native-tab-view";
11
+
12
+ import { TabViewItemProps } from "./TabViewItem";
13
+ import type { IconSlot } from "../../interfaces/Icon";
14
+ import { withTheme } from "../../theming";
15
+ import type { Theme } from "../../styles/DefaultTheme";
16
+ import { extractStyles } from "../../utilities";
17
+
18
+ type TabBarProps = SceneRendererProps & {
19
+ navigationState: NavigationState<any>;
20
+ };
21
+ type TabBarPosition = "top" | "bottom";
22
+ type KeyboardDismissMode = "none" | "auto" | "on-drag";
23
+
24
+ type TabViewProps = {
25
+ onIndexChanged?: (index: number) => void;
26
+ onEndReached?: () => void;
27
+ tabBarPosition?: TabBarPosition;
28
+ keyboardDismissMode?: KeyboardDismissMode;
29
+ swipeEnabled?: boolean;
30
+ scrollEnabled?: boolean;
31
+ activeColor?: string;
32
+ inactiveColor?: string;
33
+ pressColor?: string;
34
+ indicatorColor?: string;
35
+ tabsBackgroundColor?: string;
36
+ style?: StyleProp<ViewStyle>;
37
+ theme: Theme;
38
+ } & IconSlot;
39
+
40
+ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
41
+ Icon,
42
+ onIndexChanged,
43
+ onEndReached,
44
+ tabBarPosition,
45
+ keyboardDismissMode,
46
+ swipeEnabled,
47
+ scrollEnabled,
48
+ activeColor,
49
+ inactiveColor,
50
+ pressColor,
51
+ indicatorColor,
52
+ tabsBackgroundColor,
53
+ style,
54
+ theme,
55
+ children,
56
+ }) => {
57
+ const [index, setIndex] = React.useState(0);
58
+ const [routes, setRoutes] = React.useState<Route[]>([]);
59
+ const [tabScenes, setTabScenes] = React.useState({});
60
+
61
+ const { textStyles, viewStyles } = extractStyles(style);
62
+
63
+ //Check type of child using props
64
+ //Regular '.type' cannot work because Draftbit strips the type in Draft view
65
+ const instanceOfTabViewItemProps = (
66
+ object: any
67
+ ): object is TabViewItemProps => {
68
+ return "title" in object;
69
+ };
70
+
71
+ //Populate routes and scenes based on children
72
+ React.useEffect(() => {
73
+ const newRoutes: Route[] = [];
74
+ const scenes: any = {};
75
+
76
+ React.Children.toArray(children)
77
+ .filter(
78
+ (child) =>
79
+ React.isValidElement(child) && instanceOfTabViewItemProps(child.props)
80
+ )
81
+ .forEach((item: any, idx) => {
82
+ const child = item as React.ReactElement;
83
+ newRoutes.push({
84
+ key: idx.toString(),
85
+ title: child.props.title,
86
+ icon: child.props.icon,
87
+ accessibilityLabel: child.props.accessibilityLabel,
88
+ });
89
+ scenes[idx] = () => child;
90
+ });
91
+
92
+ setRoutes(newRoutes);
93
+ setTabScenes(scenes);
94
+ }, [children]);
95
+
96
+ const indexChangeHandler = (i: number) => {
97
+ setIndex(i);
98
+ onIndexChanged?.(i);
99
+ if (i === routes.length) {
100
+ onEndReached?.();
101
+ }
102
+ };
103
+
104
+ const renderTabBar: React.FC<TabBarProps> = (props) => {
105
+ return (
106
+ <TabBar
107
+ {...props}
108
+ activeColor={activeColor || theme.colors.primary}
109
+ inactiveColor={inactiveColor || theme.colors.divider}
110
+ pressColor={pressColor || theme.colors.primary}
111
+ scrollEnabled={scrollEnabled}
112
+ indicatorStyle={{
113
+ backgroundColor: indicatorColor || theme.colors.primary,
114
+ }}
115
+ labelStyle={textStyles}
116
+ renderIcon={({ route, color }) =>
117
+ route?.icon ? (
118
+ <Icon name={route.icon} color={color} size={16} />
119
+ ) : null
120
+ }
121
+ style={{
122
+ backgroundColor: tabsBackgroundColor || theme.colors.background,
123
+ }}
124
+ />
125
+ );
126
+ };
127
+
128
+ //Cannot render TabView without at least one tab
129
+ if (!routes.length) {
130
+ return <></>;
131
+ }
132
+
133
+ return (
134
+ <TabView
135
+ style={[viewStyles]}
136
+ navigationState={{ index, routes }}
137
+ renderScene={SceneMap(tabScenes)}
138
+ renderTabBar={renderTabBar}
139
+ onIndexChange={indexChangeHandler}
140
+ tabBarPosition={tabBarPosition}
141
+ keyboardDismissMode={keyboardDismissMode}
142
+ swipeEnabled={swipeEnabled}
143
+ />
144
+ );
145
+ };
146
+
147
+ export default withTheme(TabViewComponent);
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ const TabViewItem = ({ style, children, }) => {
4
+ return React.createElement(View, { style: [styles.parentContainer, style] }, children);
5
+ };
6
+ const styles = StyleSheet.create({
7
+ parentContainer: {
8
+ flex: 1,
9
+ },
10
+ });
11
+ export default TabViewItem;