@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.
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/TabView/TabView.js +116 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +25 -0
- package/lib/commonjs/components/TabView/index.js +20 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/commonjs/mappings/TabView.js +74 -0
- package/lib/commonjs/mappings/TabViewItem.js +37 -0
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/components/TabView/TabView.js +107 -0
- package/lib/module/components/TabView/TabViewItem.js +20 -0
- package/lib/module/components/TabView/index.js +2 -0
- package/lib/module/index.js +2 -0
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/module/mappings/TabView.js +67 -0
- package/lib/module/mappings/TabViewItem.js +30 -0
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +26 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +11 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/index.d.ts +3 -0
- package/lib/typescript/src/components/TabView/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts +123 -0
- package/lib/typescript/src/mappings/TabView.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabViewItem.d.ts +25 -0
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -0
- package/package.json +6 -3
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/components/TabView/TabView.js +54 -0
- package/src/components/TabView/TabView.tsx +147 -0
- package/src/components/TabView/TabViewItem.js +11 -0
- package/src/components/TabView/TabViewItem.tsx +25 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.tsx +2 -0
- package/src/index.js +2 -0
- package/src/index.tsx +3 -0
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/src/mappings/TabView.js +75 -0
- package/src/mappings/TabView.ts +85 -0
- package/src/mappings/TabViewItem.js +30 -0
- package/src/mappings/TabViewItem.ts +38 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
//Props used by parent (TabView) to create tabs
|
|
5
|
+
export interface TabViewItemProps {
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TabViewItem: React.FC<React.PropsWithChildren<TabViewItemProps>> = ({
|
|
13
|
+
style,
|
|
14
|
+
children,
|
|
15
|
+
}) => {
|
|
16
|
+
return <View style={[styles.parentContainer, style]}>{children}</View>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
parentContainer: {
|
|
21
|
+
flex: 1,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default TabViewItem;
|
package/src/index.js
CHANGED
|
@@ -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
|
/* Deprecated: Fix or Delete! */
|
|
36
38
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
39
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -53,6 +53,9 @@ export {
|
|
|
53
53
|
|
|
54
54
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
55
55
|
|
|
56
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
57
|
+
export { default as Markdown } from "./components/Markdown";
|
|
58
|
+
|
|
56
59
|
/* Deprecated: Fix or Delete! */
|
|
57
60
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
58
61
|
export { default as Picker } from "./components/Picker/Picker";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Typography,
|
|
9
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
10
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
],
|
|
13
|
+
props: {
|
|
14
|
+
children: {
|
|
15
|
+
group: GROUPS.data,
|
|
16
|
+
label: "Markdown Text",
|
|
17
|
+
description: "Markdown text to be rendered ",
|
|
18
|
+
editable: true,
|
|
19
|
+
required: true,
|
|
20
|
+
formType: FORM_TYPES.string,
|
|
21
|
+
propType: PROP_TYPES.STRING,
|
|
22
|
+
defaultValue: "### Markdown",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
FORM_TYPES,
|
|
4
|
+
GROUPS,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Markdown",
|
|
11
|
+
tag: "Markdown",
|
|
12
|
+
description: "A component that renders markdown",
|
|
13
|
+
category: COMPONENT_TYPES.text,
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.Typography,
|
|
16
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
20
|
+
props: {
|
|
21
|
+
children: {
|
|
22
|
+
group: GROUPS.data,
|
|
23
|
+
label: "Markdown Text",
|
|
24
|
+
description: "Markdown text to be rendered ",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: true,
|
|
27
|
+
formType: FORM_TYPES.string,
|
|
28
|
+
propType: PROP_TYPES.STRING,
|
|
29
|
+
defaultValue: "### Markdown",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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: [
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
10
|
+
StylesPanelSections.Position,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
13
|
+
StylesPanelSections.Background,
|
|
14
|
+
StylesPanelSections.Typography,
|
|
15
|
+
],
|
|
16
|
+
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
17
|
+
props: {
|
|
18
|
+
onIndexChanged: createActionProp({
|
|
19
|
+
label: "On index changed",
|
|
20
|
+
description: "Action to execute when swipe to new index",
|
|
21
|
+
}),
|
|
22
|
+
onEndReached: createActionProp({
|
|
23
|
+
label: "On end reached",
|
|
24
|
+
description: "Action to execute when end of swiping reached",
|
|
25
|
+
}),
|
|
26
|
+
tabBarPosition: createTextEnumProp({
|
|
27
|
+
label: "Tab Bar Position",
|
|
28
|
+
description: "Position of tab bar",
|
|
29
|
+
options: ["top", "bottom"],
|
|
30
|
+
defaultValue: "top",
|
|
31
|
+
}),
|
|
32
|
+
keyboardDismissMode: createTextEnumProp({
|
|
33
|
+
label: "Keyboard Dismiss Mode",
|
|
34
|
+
description: "Keyboard Dismiss Mode",
|
|
35
|
+
options: ["auto", "on-drag", "none"],
|
|
36
|
+
defaultValue: "auto",
|
|
37
|
+
}),
|
|
38
|
+
swipeEnabled: createStaticBoolProp({
|
|
39
|
+
label: "Swipe Enabled",
|
|
40
|
+
description: "Whether swiping is enabled or not",
|
|
41
|
+
defaultValue: true,
|
|
42
|
+
}),
|
|
43
|
+
scrollEnabled: createStaticBoolProp({
|
|
44
|
+
label: "Tab Scroll Enabled",
|
|
45
|
+
description: "Whether scrolling of tabs is enabled or not",
|
|
46
|
+
defaultValue: false,
|
|
47
|
+
}),
|
|
48
|
+
activeColor: createColorProp({
|
|
49
|
+
label: "Active Color",
|
|
50
|
+
description: "Color of icon and text of active tab",
|
|
51
|
+
defaultValue: "primary",
|
|
52
|
+
}),
|
|
53
|
+
inactiveColor: createColorProp({
|
|
54
|
+
label: "Inactive Color",
|
|
55
|
+
description: "Color of icon and text of inactive tab(s)",
|
|
56
|
+
defaultValue: null,
|
|
57
|
+
}),
|
|
58
|
+
pressColor: createColorProp({
|
|
59
|
+
label: "Press Color",
|
|
60
|
+
description: "Color of ripple when pressed",
|
|
61
|
+
defaultValue: "primary",
|
|
62
|
+
group: GROUPS.android,
|
|
63
|
+
}),
|
|
64
|
+
indicatorColor: createColorProp({
|
|
65
|
+
label: "Indicator Color",
|
|
66
|
+
description: "Color of indicator",
|
|
67
|
+
defaultValue: "primary",
|
|
68
|
+
}),
|
|
69
|
+
tabsBackgroundColor: createColorProp({
|
|
70
|
+
label: "Tabs Background Color",
|
|
71
|
+
description: "Background color of tabs container",
|
|
72
|
+
defaultValue: "background",
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextEnumProp,
|
|
4
|
+
createColorProp,
|
|
5
|
+
StylesPanelSections,
|
|
6
|
+
Triggers,
|
|
7
|
+
createActionProp,
|
|
8
|
+
createStaticBoolProp,
|
|
9
|
+
GROUPS,
|
|
10
|
+
} from "@draftbit/types";
|
|
11
|
+
|
|
12
|
+
export const SEED_DATA = {
|
|
13
|
+
name: "Tab View",
|
|
14
|
+
tag: "TabView",
|
|
15
|
+
description: "Tab view container",
|
|
16
|
+
category: COMPONENT_TYPES.swiper,
|
|
17
|
+
stylesPanelSections: [
|
|
18
|
+
StylesPanelSections.Size,
|
|
19
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
20
|
+
StylesPanelSections.Position,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
23
|
+
StylesPanelSections.Background,
|
|
24
|
+
StylesPanelSections.Typography,
|
|
25
|
+
],
|
|
26
|
+
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
27
|
+
props: {
|
|
28
|
+
onIndexChanged: createActionProp({
|
|
29
|
+
label: "On index changed",
|
|
30
|
+
description: "Action to execute when swipe to new index",
|
|
31
|
+
}),
|
|
32
|
+
onEndReached: createActionProp({
|
|
33
|
+
label: "On end reached",
|
|
34
|
+
description: "Action to execute when end of swiping reached",
|
|
35
|
+
}),
|
|
36
|
+
tabBarPosition: createTextEnumProp({
|
|
37
|
+
label: "Tab Bar Position",
|
|
38
|
+
description: "Position of tab bar",
|
|
39
|
+
options: ["top", "bottom"],
|
|
40
|
+
defaultValue: "top",
|
|
41
|
+
}),
|
|
42
|
+
keyboardDismissMode: createTextEnumProp({
|
|
43
|
+
label: "Keyboard Dismiss Mode",
|
|
44
|
+
description: "Keyboard Dismiss Mode",
|
|
45
|
+
options: ["auto", "on-drag", "none"],
|
|
46
|
+
defaultValue: "auto",
|
|
47
|
+
}),
|
|
48
|
+
swipeEnabled: createStaticBoolProp({
|
|
49
|
+
label: "Swipe Enabled",
|
|
50
|
+
description: "Whether swiping is enabled or not",
|
|
51
|
+
defaultValue: true,
|
|
52
|
+
}),
|
|
53
|
+
scrollEnabled: createStaticBoolProp({
|
|
54
|
+
label: "Tab Scroll Enabled",
|
|
55
|
+
description: "Whether scrolling of tabs is enabled or not",
|
|
56
|
+
defaultValue: false,
|
|
57
|
+
}),
|
|
58
|
+
activeColor: createColorProp({
|
|
59
|
+
label: "Active Color",
|
|
60
|
+
description: "Color of icon and text of active tab",
|
|
61
|
+
defaultValue: "primary",
|
|
62
|
+
}),
|
|
63
|
+
inactiveColor: createColorProp({
|
|
64
|
+
label: "Inactive Color",
|
|
65
|
+
description: "Color of icon and text of inactive tab(s)",
|
|
66
|
+
defaultValue: null,
|
|
67
|
+
}),
|
|
68
|
+
pressColor: createColorProp({
|
|
69
|
+
label: "Press Color",
|
|
70
|
+
description: "Color of ripple when pressed",
|
|
71
|
+
defaultValue: "primary",
|
|
72
|
+
group: GROUPS.android,
|
|
73
|
+
}),
|
|
74
|
+
indicatorColor: createColorProp({
|
|
75
|
+
label: "Indicator Color",
|
|
76
|
+
description: "Color of indicator",
|
|
77
|
+
defaultValue: "primary",
|
|
78
|
+
}),
|
|
79
|
+
tabsBackgroundColor: createColorProp({
|
|
80
|
+
label: "Tabs Background Color",
|
|
81
|
+
description: "Background color of tabs container",
|
|
82
|
+
defaultValue: "background",
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -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,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextProp,
|
|
4
|
+
createIconProp,
|
|
5
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
GROUPS,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Tab View Item",
|
|
11
|
+
tag: "TabViewItem",
|
|
12
|
+
description:
|
|
13
|
+
"Single Tab View item to be used in TabView. Each item represents a single tab and its content",
|
|
14
|
+
category: COMPONENT_TYPES.swiper,
|
|
15
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
16
|
+
layout: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
title: createTextProp({
|
|
21
|
+
label: "Title",
|
|
22
|
+
description: "Title of tab item",
|
|
23
|
+
defaultValue: "Title",
|
|
24
|
+
required: true,
|
|
25
|
+
group: GROUPS.basic,
|
|
26
|
+
}),
|
|
27
|
+
icon: createIconProp({
|
|
28
|
+
defaultValue: null,
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
accessibilityLabel: createTextProp({
|
|
32
|
+
label: "Accessibility Label",
|
|
33
|
+
description: "Accessibility Label",
|
|
34
|
+
defaultValue: null,
|
|
35
|
+
group: GROUPS.accessibility,
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
};
|