@draftbit/core 47.0.1-17098e.2 → 47.0.1-2aab54.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/Button.js +15 -27
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/DeprecatedButton.js +151 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/DeprecatedFAB.js +2 -1
- package/lib/commonjs/components/Picker/Picker.js +4 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Touchable.js +11 -27
- package/lib/commonjs/components/Touchable.web.js +9 -0
- package/lib/commonjs/index.js +25 -82
- package/lib/commonjs/mappings/Button.js +10 -14
- package/lib/commonjs/mappings/NativeBase/AlertDialog.js +93 -0
- package/lib/commonjs/mappings/NativeBase/Button.js +84 -0
- package/lib/commonjs/mappings/NativeBase/DataDisplay.js +48 -0
- package/lib/commonjs/mappings/NativeBase/Feedback.js +74 -0
- package/lib/commonjs/mappings/NativeBase/Layout.js +114 -0
- package/lib/commonjs/mappings/NativeBase/Media.js +49 -0
- package/lib/commonjs/mappings/NativeBase/Menu.js +111 -0
- package/lib/commonjs/mappings/NativeBase/Modal.js +93 -0
- package/lib/commonjs/mappings/NativeBase/Other.js +94 -0
- package/lib/commonjs/mappings/NativeBase/Popover.js +99 -0
- package/lib/commonjs/mappings/Touchable.js +20 -0
- package/lib/module/components/Button.js +9 -21
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/DeprecatedButton.js +141 -0
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/DeprecatedFAB.js +3 -2
- package/lib/module/components/Picker/Picker.js +4 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Touchable.js +10 -25
- package/lib/module/components/Touchable.web.js +2 -0
- package/lib/module/index.js +121 -31
- package/lib/module/mappings/Button.js +11 -15
- package/lib/module/mappings/NativeBase/AlertDialog.js +86 -0
- package/lib/module/mappings/NativeBase/Button.js +86 -0
- package/lib/module/mappings/NativeBase/DataDisplay.js +41 -0
- package/lib/module/mappings/NativeBase/Feedback.js +67 -0
- package/lib/module/mappings/NativeBase/Layout.js +107 -0
- package/lib/module/mappings/NativeBase/Media.js +42 -0
- package/lib/module/mappings/NativeBase/Menu.js +104 -0
- package/lib/module/mappings/NativeBase/Modal.js +86 -0
- package/lib/module/mappings/NativeBase/Other.js +87 -0
- package/lib/module/mappings/NativeBase/Popover.js +92 -0
- package/lib/module/mappings/Touchable.js +13 -0
- package/lib/typescript/src/components/Button.d.ts +0 -2
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +2 -9
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
- package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +102 -29
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +2 -224
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts +134 -0
- package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Button.d.ts +1 -0
- package/lib/typescript/src/mappings/NativeBase/Button.d.ts.map +1 -0
- package/lib/typescript/src/mappings/{Pressable.d.ts → NativeBase/DataDisplay.d.ts} +34 -40
- package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts +2 -0
- package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +146 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Media.d.ts +48 -0
- package/lib/typescript/src/mappings/NativeBase/Media.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Menu.d.ts +227 -0
- package/lib/typescript/src/mappings/NativeBase/Menu.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Modal.d.ts +133 -0
- package/lib/typescript/src/mappings/NativeBase/Modal.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Other.d.ts +179 -0
- package/lib/typescript/src/mappings/NativeBase/Other.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Popover.d.ts +136 -0
- package/lib/typescript/src/mappings/NativeBase/Popover.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Button.js +11 -18
- package/src/components/Button.tsx +11 -45
- package/src/components/Checkbox/Checkbox.js +3 -2
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/DeprecatedButton.js +95 -0
- package/src/components/DeprecatedButton.tsx +214 -0
- package/src/components/DeprecatedCardWrapper.js +2 -2
- package/src/components/DeprecatedCardWrapper.tsx +4 -3
- package/src/components/DeprecatedFAB.js +3 -2
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Picker/Picker.js +4 -3
- package/src/components/Picker/Picker.tsx +4 -4
- package/src/components/Picker/PickerComponent.ios.js +1 -1
- package/src/components/Picker/PickerComponent.ios.tsx +1 -1
- package/src/components/Touchable.js +11 -16
- package/src/components/Touchable.tsx +11 -42
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Touchable.web.tsx +3 -0
- package/src/index.js +112 -31
- package/src/index.tsx +123 -43
- package/src/mappings/Button.js +10 -14
- package/src/mappings/Button.ts +10 -14
- package/src/mappings/NativeBase/AlertDialog.js +103 -0
- package/src/mappings/NativeBase/AlertDialog.ts +118 -0
- package/src/mappings/NativeBase/Button.js +84 -0
- package/src/mappings/NativeBase/Button.ts +83 -0
- package/src/mappings/NativeBase/DataDisplay.js +54 -0
- package/src/mappings/NativeBase/DataDisplay.ts +64 -0
- package/src/mappings/NativeBase/Feedback.js +89 -0
- package/src/mappings/NativeBase/Feedback.ts +100 -0
- package/src/mappings/NativeBase/Layout.js +140 -0
- package/src/mappings/NativeBase/Layout.ts +152 -0
- package/src/mappings/NativeBase/Media.js +56 -0
- package/src/mappings/NativeBase/Media.ts +65 -0
- package/src/mappings/NativeBase/Menu.js +134 -0
- package/src/mappings/NativeBase/Menu.ts +150 -0
- package/src/mappings/NativeBase/Modal.js +103 -0
- package/src/mappings/NativeBase/Modal.ts +118 -0
- package/src/mappings/NativeBase/Other.js +123 -0
- package/src/mappings/NativeBase/Other.ts +139 -0
- package/src/mappings/NativeBase/Popover.js +123 -0
- package/src/mappings/NativeBase/Popover.ts +136 -0
- package/src/mappings/Touchable.js +17 -0
- package/src/mappings/Touchable.ts +23 -0
- package/lib/commonjs/components/Pressable.js +0 -48
- package/lib/commonjs/mappings/Pressable.js +0 -52
- package/lib/module/components/Pressable.js +0 -40
- package/lib/module/mappings/Pressable.js +0 -45
- package/lib/typescript/src/components/Pressable.d.ts +0 -18
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
- package/src/components/Pressable.js +0 -17
- package/src/components/Pressable.tsx +0 -67
- package/src/mappings/Pressable.js +0 -52
- package/src/mappings/Pressable.ts +0 -63
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, StylesPanelSections, createTextEnumProp, createTextProp, createIconProp, createBoolProp, createDisabledProp, createStaticNumberProp, createStaticBoolProp, Triggers, createActionProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [
|
|
3
|
+
{
|
|
4
|
+
name: "FAB",
|
|
5
|
+
tag: "Fab",
|
|
6
|
+
description: "A floating action button (FAB) is a circular icon button that hovers over content to execute a primary action in the application.",
|
|
7
|
+
category: COMPONENT_TYPES.NBForms,
|
|
8
|
+
packageName: "native-base",
|
|
9
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
10
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
11
|
+
stylesPanelSections: [
|
|
12
|
+
StylesPanelSections.LayoutFlexItems,
|
|
13
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
14
|
+
StylesPanelSections.LayoutContent,
|
|
15
|
+
StylesPanelSections.Background,
|
|
16
|
+
StylesPanelSections.Size,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Position,
|
|
19
|
+
StylesPanelSections.Borders,
|
|
20
|
+
StylesPanelSections.Effects,
|
|
21
|
+
],
|
|
22
|
+
layout: {},
|
|
23
|
+
triggers: {},
|
|
24
|
+
props: {
|
|
25
|
+
placement: createTextEnumProp({
|
|
26
|
+
label: "Placement",
|
|
27
|
+
description: "The placement of the Fab relative to the device.",
|
|
28
|
+
options: ["bottom-right", "top-right", "top-left", "bottom-left"],
|
|
29
|
+
defaultValue: "bottom-right",
|
|
30
|
+
}),
|
|
31
|
+
label: createTextProp({
|
|
32
|
+
label: "Label",
|
|
33
|
+
description: "The Text to be displayed in Fab.",
|
|
34
|
+
}),
|
|
35
|
+
icon: createIconProp({
|
|
36
|
+
label: "Icon",
|
|
37
|
+
description: "Icon to be displayed in Fab. ",
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "Tooltip",
|
|
43
|
+
tag: "Tooltip",
|
|
44
|
+
description: "A tooltip provides a brief, informative message when a user interacts with an element. Methods of tooltip initiation include: through a mouse-hover gesture or a keyboard-hover gesture.",
|
|
45
|
+
category: COMPONENT_TYPES.NBOther,
|
|
46
|
+
packageName: "native-base",
|
|
47
|
+
allowChildren: true,
|
|
48
|
+
stylesPanelSections: [
|
|
49
|
+
StylesPanelSections.LayoutFlexItems,
|
|
50
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
51
|
+
StylesPanelSections.LayoutContent,
|
|
52
|
+
StylesPanelSections.Background,
|
|
53
|
+
StylesPanelSections.Size,
|
|
54
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
55
|
+
StylesPanelSections.Position,
|
|
56
|
+
StylesPanelSections.Borders,
|
|
57
|
+
StylesPanelSections.Effects,
|
|
58
|
+
],
|
|
59
|
+
layout: {},
|
|
60
|
+
triggers: [Triggers.OnOpen, Triggers.OnClose],
|
|
61
|
+
props: {
|
|
62
|
+
label: createTextProp({
|
|
63
|
+
label: "Label",
|
|
64
|
+
description: "The Text to be displayed in Tooltip.",
|
|
65
|
+
}),
|
|
66
|
+
isOpen: createBoolProp({
|
|
67
|
+
label: "Is Open",
|
|
68
|
+
description: "Whether the tooltip is open or not.",
|
|
69
|
+
}),
|
|
70
|
+
isDisabled: createDisabledProp(),
|
|
71
|
+
defaultIsOpen: createStaticBoolProp({
|
|
72
|
+
label: "Default Is Open",
|
|
73
|
+
description: "Whether the tooltip is open by default",
|
|
74
|
+
defaultValue: false,
|
|
75
|
+
}),
|
|
76
|
+
onOpen: createActionProp(),
|
|
77
|
+
onClose: createActionProp(),
|
|
78
|
+
openDelay: createStaticNumberProp({
|
|
79
|
+
label: "Open Delay",
|
|
80
|
+
description: "Delay in ms before tooltip opens",
|
|
81
|
+
defaultValue: 0,
|
|
82
|
+
}),
|
|
83
|
+
closeDelay: createStaticNumberProp({
|
|
84
|
+
label: "Close Delay",
|
|
85
|
+
description: "Delay in ms before tooltip closes",
|
|
86
|
+
defaultValue: 0,
|
|
87
|
+
}),
|
|
88
|
+
placement: createTextEnumProp({
|
|
89
|
+
label: "Placement",
|
|
90
|
+
description: "The placement of the menu",
|
|
91
|
+
options: [
|
|
92
|
+
"bottom",
|
|
93
|
+
"top",
|
|
94
|
+
"left",
|
|
95
|
+
"right",
|
|
96
|
+
"top left",
|
|
97
|
+
"top right",
|
|
98
|
+
"bottom left",
|
|
99
|
+
"bottom right",
|
|
100
|
+
"right bottom",
|
|
101
|
+
"right top",
|
|
102
|
+
"left bottom",
|
|
103
|
+
"left top",
|
|
104
|
+
],
|
|
105
|
+
defaultValue: "bottom",
|
|
106
|
+
}),
|
|
107
|
+
arrowSize: createStaticNumberProp({
|
|
108
|
+
label: "Arrow Size",
|
|
109
|
+
description: "The size of the arrow",
|
|
110
|
+
defaultValue: 12,
|
|
111
|
+
}),
|
|
112
|
+
hasArrow: createStaticBoolProp({
|
|
113
|
+
label: "Has Arrow",
|
|
114
|
+
description: "Whether the tooltip has an arrow",
|
|
115
|
+
defaultValue: false,
|
|
116
|
+
}),
|
|
117
|
+
offset: createStaticNumberProp({
|
|
118
|
+
label: "Offset",
|
|
119
|
+
description: "The distance between the triggere and the tooltip.",
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
];
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
StylesPanelSections,
|
|
4
|
+
createTextEnumProp,
|
|
5
|
+
createTextProp,
|
|
6
|
+
createIconProp,
|
|
7
|
+
createBoolProp,
|
|
8
|
+
createDisabledProp,
|
|
9
|
+
createStaticNumberProp,
|
|
10
|
+
createStaticBoolProp,
|
|
11
|
+
Triggers,
|
|
12
|
+
createActionProp,
|
|
13
|
+
} from "@draftbit/types";
|
|
14
|
+
|
|
15
|
+
export const SEED_DATA = [
|
|
16
|
+
{
|
|
17
|
+
name: "FAB",
|
|
18
|
+
tag: "Fab",
|
|
19
|
+
description:
|
|
20
|
+
"A floating action button (FAB) is a circular icon button that hovers over content to execute a primary action in the application.",
|
|
21
|
+
category: COMPONENT_TYPES.NBForms,
|
|
22
|
+
packageName: "native-base",
|
|
23
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
24
|
+
code_link:
|
|
25
|
+
"https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
26
|
+
stylesPanelSections: [
|
|
27
|
+
StylesPanelSections.LayoutFlexItems,
|
|
28
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
29
|
+
StylesPanelSections.LayoutContent,
|
|
30
|
+
StylesPanelSections.Background,
|
|
31
|
+
StylesPanelSections.Size,
|
|
32
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
33
|
+
StylesPanelSections.Position,
|
|
34
|
+
StylesPanelSections.Borders,
|
|
35
|
+
StylesPanelSections.Effects,
|
|
36
|
+
],
|
|
37
|
+
layout: {},
|
|
38
|
+
triggers: {},
|
|
39
|
+
props: {
|
|
40
|
+
placement: createTextEnumProp({
|
|
41
|
+
label: "Placement",
|
|
42
|
+
description: "The placement of the Fab relative to the device.",
|
|
43
|
+
options: ["bottom-right", "top-right", "top-left", "bottom-left"],
|
|
44
|
+
defaultValue: "bottom-right",
|
|
45
|
+
}),
|
|
46
|
+
label: createTextProp({
|
|
47
|
+
label: "Label",
|
|
48
|
+
description: "The Text to be displayed in Fab.",
|
|
49
|
+
}),
|
|
50
|
+
icon: createIconProp({
|
|
51
|
+
label: "Icon",
|
|
52
|
+
description: "Icon to be displayed in Fab. ",
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "Tooltip",
|
|
58
|
+
tag: "Tooltip",
|
|
59
|
+
description:
|
|
60
|
+
"A tooltip provides a brief, informative message when a user interacts with an element. Methods of tooltip initiation include: through a mouse-hover gesture or a keyboard-hover gesture.",
|
|
61
|
+
category: COMPONENT_TYPES.NBOther,
|
|
62
|
+
packageName: "native-base",
|
|
63
|
+
allowChildren: true,
|
|
64
|
+
stylesPanelSections: [
|
|
65
|
+
StylesPanelSections.LayoutFlexItems,
|
|
66
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
67
|
+
StylesPanelSections.LayoutContent,
|
|
68
|
+
StylesPanelSections.Background,
|
|
69
|
+
StylesPanelSections.Size,
|
|
70
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
71
|
+
StylesPanelSections.Position,
|
|
72
|
+
StylesPanelSections.Borders,
|
|
73
|
+
StylesPanelSections.Effects,
|
|
74
|
+
],
|
|
75
|
+
layout: {},
|
|
76
|
+
triggers: [Triggers.OnOpen, Triggers.OnClose],
|
|
77
|
+
props: {
|
|
78
|
+
label: createTextProp({
|
|
79
|
+
label: "Label",
|
|
80
|
+
description: "The Text to be displayed in Tooltip.",
|
|
81
|
+
}),
|
|
82
|
+
isOpen: createBoolProp({
|
|
83
|
+
label: "Is Open",
|
|
84
|
+
description: "Whether the tooltip is open or not.",
|
|
85
|
+
}),
|
|
86
|
+
isDisabled: createDisabledProp(),
|
|
87
|
+
defaultIsOpen: createStaticBoolProp({
|
|
88
|
+
label: "Default Is Open",
|
|
89
|
+
description: "Whether the tooltip is open by default",
|
|
90
|
+
defaultValue: false,
|
|
91
|
+
}),
|
|
92
|
+
onOpen: createActionProp(),
|
|
93
|
+
onClose: createActionProp(),
|
|
94
|
+
openDelay: createStaticNumberProp({
|
|
95
|
+
label: "Open Delay",
|
|
96
|
+
description: "Delay in ms before tooltip opens",
|
|
97
|
+
defaultValue: 0,
|
|
98
|
+
}),
|
|
99
|
+
closeDelay: createStaticNumberProp({
|
|
100
|
+
label: "Close Delay",
|
|
101
|
+
description: "Delay in ms before tooltip closes",
|
|
102
|
+
defaultValue: 0,
|
|
103
|
+
}),
|
|
104
|
+
placement: createTextEnumProp({
|
|
105
|
+
label: "Placement",
|
|
106
|
+
description: "The placement of the menu",
|
|
107
|
+
options: [
|
|
108
|
+
"bottom",
|
|
109
|
+
"top",
|
|
110
|
+
"left",
|
|
111
|
+
"right",
|
|
112
|
+
"top left",
|
|
113
|
+
"top right",
|
|
114
|
+
"bottom left",
|
|
115
|
+
"bottom right",
|
|
116
|
+
"right bottom",
|
|
117
|
+
"right top",
|
|
118
|
+
"left bottom",
|
|
119
|
+
"left top",
|
|
120
|
+
],
|
|
121
|
+
defaultValue: "bottom",
|
|
122
|
+
}),
|
|
123
|
+
arrowSize: createStaticNumberProp({
|
|
124
|
+
label: "Arrow Size",
|
|
125
|
+
description: "The size of the arrow",
|
|
126
|
+
defaultValue: 12,
|
|
127
|
+
}),
|
|
128
|
+
hasArrow: createStaticBoolProp({
|
|
129
|
+
label: "Has Arrow",
|
|
130
|
+
description: "Whether the tooltip has an arrow",
|
|
131
|
+
defaultValue: false,
|
|
132
|
+
}),
|
|
133
|
+
offset: createStaticNumberProp({
|
|
134
|
+
label: "Offset",
|
|
135
|
+
description: "The distance between the triggere and the tooltip.",
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, createBoolProp, createStaticBoolProp, createTextEnumProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
const SHARED_SEED_DATA = {
|
|
3
|
+
category: COMPONENT_TYPES.NBPopover,
|
|
4
|
+
packageName: "native-base",
|
|
5
|
+
stylesPanelSections: [
|
|
6
|
+
StylesPanelSections.LayoutFlexItems,
|
|
7
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
8
|
+
StylesPanelSections.LayoutContent,
|
|
9
|
+
StylesPanelSections.Background,
|
|
10
|
+
StylesPanelSections.Size,
|
|
11
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
12
|
+
StylesPanelSections.Position,
|
|
13
|
+
StylesPanelSections.Borders,
|
|
14
|
+
StylesPanelSections.Effects,
|
|
15
|
+
],
|
|
16
|
+
layout: {},
|
|
17
|
+
triggers: {},
|
|
18
|
+
};
|
|
19
|
+
export const SEED_DATA = [
|
|
20
|
+
{
|
|
21
|
+
name: "Popover",
|
|
22
|
+
tag: "Popover",
|
|
23
|
+
description: "Popover floats around a trigger. It is a non-modal dialog used to provide contextual information to the user. It should be paired with a pressable trigger element.",
|
|
24
|
+
...SHARED_SEED_DATA,
|
|
25
|
+
allowChildren: true,
|
|
26
|
+
props: {
|
|
27
|
+
isOpen: createBoolProp({
|
|
28
|
+
label: "Is Open",
|
|
29
|
+
description: "If true, the popover is open. Useful for controlling the open state.",
|
|
30
|
+
}),
|
|
31
|
+
defaultIsOpen: createStaticBoolProp({
|
|
32
|
+
label: "Default Is Open",
|
|
33
|
+
description: "If true, the popover will be opened by default.",
|
|
34
|
+
}),
|
|
35
|
+
trapFocus: createStaticBoolProp({
|
|
36
|
+
label: "Trap Focus",
|
|
37
|
+
description: "Whether popover should trap focus.",
|
|
38
|
+
}),
|
|
39
|
+
shouldFlip: createStaticBoolProp({
|
|
40
|
+
label: "Should Flip",
|
|
41
|
+
description: "Whether popover should flip when it reaches the edge of the screen.",
|
|
42
|
+
defaultValue: true,
|
|
43
|
+
}),
|
|
44
|
+
shouldOverlapWithTrigger: createStaticBoolProp({
|
|
45
|
+
label: "Should Overlap With Trigger",
|
|
46
|
+
description: "Whether popover should overlap with trigger.",
|
|
47
|
+
defaultValue: false,
|
|
48
|
+
}),
|
|
49
|
+
isKeyboardDismissable: createStaticBoolProp({
|
|
50
|
+
label: "Is Keyboard Dismissable",
|
|
51
|
+
description: "If true, the popover will close when the keyboard is dismissed.",
|
|
52
|
+
defaultValue: true,
|
|
53
|
+
}),
|
|
54
|
+
placement: createTextEnumProp({
|
|
55
|
+
label: "Placement",
|
|
56
|
+
description: "The placement of the popover",
|
|
57
|
+
options: [
|
|
58
|
+
"bottom",
|
|
59
|
+
"top",
|
|
60
|
+
"left",
|
|
61
|
+
"right",
|
|
62
|
+
"top left",
|
|
63
|
+
"top right",
|
|
64
|
+
"bottom left",
|
|
65
|
+
"bottom right",
|
|
66
|
+
"right bottom",
|
|
67
|
+
"right top",
|
|
68
|
+
"left bottom",
|
|
69
|
+
"left top",
|
|
70
|
+
],
|
|
71
|
+
defaultValue: "bottom left",
|
|
72
|
+
}),
|
|
73
|
+
useRNModal: createStaticBoolProp({
|
|
74
|
+
label: "Use RN Modal",
|
|
75
|
+
description: "If true, the popover will use the RN Modal component.",
|
|
76
|
+
}),
|
|
77
|
+
onOpen: createActionProp(),
|
|
78
|
+
onClose: createActionProp(),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "Popover Arrow",
|
|
83
|
+
tag: "Popover.Arrow",
|
|
84
|
+
description: "The popover arrow.",
|
|
85
|
+
...SHARED_SEED_DATA,
|
|
86
|
+
props: {},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "Popover Body",
|
|
90
|
+
tag: "Popover.Body",
|
|
91
|
+
description: "The body of the popover.",
|
|
92
|
+
...SHARED_SEED_DATA,
|
|
93
|
+
props: {},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "Popover Content",
|
|
97
|
+
tag: "Popover.Content",
|
|
98
|
+
description: "The popover itself.",
|
|
99
|
+
...SHARED_SEED_DATA,
|
|
100
|
+
props: {},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Popover Close Button",
|
|
104
|
+
tag: "Popover.CloseButton",
|
|
105
|
+
description: "The button that closes the popover.",
|
|
106
|
+
...SHARED_SEED_DATA,
|
|
107
|
+
props: {},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "Popover Header",
|
|
111
|
+
tag: "Popover.Header",
|
|
112
|
+
description: "The header of the popover.",
|
|
113
|
+
...SHARED_SEED_DATA,
|
|
114
|
+
props: {},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "Popover Trigger",
|
|
118
|
+
tag: "Popover.Trigger",
|
|
119
|
+
description: "Used to wrap the reference (or trigger) element.",
|
|
120
|
+
...SHARED_SEED_DATA,
|
|
121
|
+
props: {},
|
|
122
|
+
},
|
|
123
|
+
];
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createActionProp,
|
|
4
|
+
createBoolProp,
|
|
5
|
+
createStaticBoolProp,
|
|
6
|
+
createTextEnumProp,
|
|
7
|
+
StylesPanelSections,
|
|
8
|
+
} from "@draftbit/types";
|
|
9
|
+
|
|
10
|
+
const SHARED_SEED_DATA = {
|
|
11
|
+
category: COMPONENT_TYPES.NBPopover,
|
|
12
|
+
packageName: "native-base",
|
|
13
|
+
stylesPanelSections: [
|
|
14
|
+
StylesPanelSections.LayoutFlexItems,
|
|
15
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
16
|
+
StylesPanelSections.LayoutContent,
|
|
17
|
+
StylesPanelSections.Background,
|
|
18
|
+
StylesPanelSections.Size,
|
|
19
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
20
|
+
StylesPanelSections.Position,
|
|
21
|
+
StylesPanelSections.Borders,
|
|
22
|
+
StylesPanelSections.Effects,
|
|
23
|
+
],
|
|
24
|
+
layout: {},
|
|
25
|
+
triggers: {},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const SEED_DATA = [
|
|
29
|
+
{
|
|
30
|
+
name: "Popover",
|
|
31
|
+
tag: "Popover",
|
|
32
|
+
description:
|
|
33
|
+
"Popover floats around a trigger. It is a non-modal dialog used to provide contextual information to the user. It should be paired with a pressable trigger element.",
|
|
34
|
+
...SHARED_SEED_DATA,
|
|
35
|
+
allowChildren: true,
|
|
36
|
+
props: {
|
|
37
|
+
isOpen: createBoolProp({
|
|
38
|
+
label: "Is Open",
|
|
39
|
+
description:
|
|
40
|
+
"If true, the popover is open. Useful for controlling the open state.",
|
|
41
|
+
}),
|
|
42
|
+
defaultIsOpen: createStaticBoolProp({
|
|
43
|
+
label: "Default Is Open",
|
|
44
|
+
description: "If true, the popover will be opened by default.",
|
|
45
|
+
}),
|
|
46
|
+
trapFocus: createStaticBoolProp({
|
|
47
|
+
label: "Trap Focus",
|
|
48
|
+
description: "Whether popover should trap focus.",
|
|
49
|
+
}),
|
|
50
|
+
shouldFlip: createStaticBoolProp({
|
|
51
|
+
label: "Should Flip",
|
|
52
|
+
description:
|
|
53
|
+
"Whether popover should flip when it reaches the edge of the screen.",
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
}),
|
|
56
|
+
shouldOverlapWithTrigger: createStaticBoolProp({
|
|
57
|
+
label: "Should Overlap With Trigger",
|
|
58
|
+
description: "Whether popover should overlap with trigger.",
|
|
59
|
+
defaultValue: false,
|
|
60
|
+
}),
|
|
61
|
+
isKeyboardDismissable: createStaticBoolProp({
|
|
62
|
+
label: "Is Keyboard Dismissable",
|
|
63
|
+
description:
|
|
64
|
+
"If true, the popover will close when the keyboard is dismissed.",
|
|
65
|
+
defaultValue: true,
|
|
66
|
+
}),
|
|
67
|
+
placement: createTextEnumProp({
|
|
68
|
+
label: "Placement",
|
|
69
|
+
description: "The placement of the popover",
|
|
70
|
+
options: [
|
|
71
|
+
"bottom",
|
|
72
|
+
"top",
|
|
73
|
+
"left",
|
|
74
|
+
"right",
|
|
75
|
+
"top left",
|
|
76
|
+
"top right",
|
|
77
|
+
"bottom left",
|
|
78
|
+
"bottom right",
|
|
79
|
+
"right bottom",
|
|
80
|
+
"right top",
|
|
81
|
+
"left bottom",
|
|
82
|
+
"left top",
|
|
83
|
+
],
|
|
84
|
+
defaultValue: "bottom left",
|
|
85
|
+
}),
|
|
86
|
+
useRNModal: createStaticBoolProp({
|
|
87
|
+
label: "Use RN Modal",
|
|
88
|
+
description: "If true, the popover will use the RN Modal component.",
|
|
89
|
+
}),
|
|
90
|
+
onOpen: createActionProp(),
|
|
91
|
+
onClose: createActionProp(),
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "Popover Arrow",
|
|
96
|
+
tag: "Popover.Arrow",
|
|
97
|
+
description: "The popover arrow.",
|
|
98
|
+
...SHARED_SEED_DATA,
|
|
99
|
+
props: {},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "Popover Body",
|
|
103
|
+
tag: "Popover.Body",
|
|
104
|
+
description: "The body of the popover.",
|
|
105
|
+
...SHARED_SEED_DATA,
|
|
106
|
+
props: {},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "Popover Content",
|
|
110
|
+
tag: "Popover.Content",
|
|
111
|
+
description: "The popover itself.",
|
|
112
|
+
...SHARED_SEED_DATA,
|
|
113
|
+
props: {},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "Popover Close Button",
|
|
117
|
+
tag: "Popover.CloseButton",
|
|
118
|
+
description: "The button that closes the popover.",
|
|
119
|
+
...SHARED_SEED_DATA,
|
|
120
|
+
props: {},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Popover Header",
|
|
124
|
+
tag: "Popover.Header",
|
|
125
|
+
description: "The header of the popover.",
|
|
126
|
+
...SHARED_SEED_DATA,
|
|
127
|
+
props: {},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "Popover Trigger",
|
|
131
|
+
tag: "Popover.Trigger",
|
|
132
|
+
description: "Used to wrap the reference (or trigger) element.",
|
|
133
|
+
...SHARED_SEED_DATA,
|
|
134
|
+
props: {},
|
|
135
|
+
},
|
|
136
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Touchable",
|
|
4
|
+
tag: "Touchable",
|
|
5
|
+
description: "Simple button with no styles",
|
|
6
|
+
category: COMPONENT_TYPES.button,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.Margins,
|
|
10
|
+
StylesPanelSections.Borders,
|
|
11
|
+
],
|
|
12
|
+
layout: {},
|
|
13
|
+
triggers: [Triggers.OnPress],
|
|
14
|
+
props: {
|
|
15
|
+
onPress: createActionProp(),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createActionProp,
|
|
4
|
+
Triggers,
|
|
5
|
+
StylesPanelSections,
|
|
6
|
+
} from "@draftbit/types";
|
|
7
|
+
|
|
8
|
+
export const SEED_DATA = {
|
|
9
|
+
name: "Touchable",
|
|
10
|
+
tag: "Touchable",
|
|
11
|
+
description: "Simple button with no styles",
|
|
12
|
+
category: COMPONENT_TYPES.button,
|
|
13
|
+
stylesPanelSections: [
|
|
14
|
+
StylesPanelSections.Size,
|
|
15
|
+
StylesPanelSections.Margins,
|
|
16
|
+
StylesPanelSections.Borders,
|
|
17
|
+
],
|
|
18
|
+
layout: {},
|
|
19
|
+
triggers: [Triggers.OnPress],
|
|
20
|
+
props: {
|
|
21
|
+
onPress: createActionProp(),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = Pressable;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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); }
|
|
12
|
-
function Pressable(_ref) {
|
|
13
|
-
let {
|
|
14
|
-
children,
|
|
15
|
-
disabled,
|
|
16
|
-
onPress,
|
|
17
|
-
onLongPress,
|
|
18
|
-
hitSlop,
|
|
19
|
-
delayLongPress,
|
|
20
|
-
activeOpacity,
|
|
21
|
-
disabledOpacity,
|
|
22
|
-
style,
|
|
23
|
-
...props
|
|
24
|
-
} = _ref;
|
|
25
|
-
const getOpacity = (0, _react.useCallback)(pressed => {
|
|
26
|
-
if (disabled) {
|
|
27
|
-
return disabledOpacity;
|
|
28
|
-
} else {
|
|
29
|
-
if (pressed) return activeOpacity;else return 1;
|
|
30
|
-
}
|
|
31
|
-
}, [activeOpacity, disabled, disabledOpacity]);
|
|
32
|
-
const _style = (0, _react.useCallback)(_ref2 => {
|
|
33
|
-
let {
|
|
34
|
-
pressed
|
|
35
|
-
} = _ref2;
|
|
36
|
-
return [style, {
|
|
37
|
-
opacity: getOpacity(pressed)
|
|
38
|
-
}];
|
|
39
|
-
}, [getOpacity, style]);
|
|
40
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
41
|
-
onPress: onPress,
|
|
42
|
-
onLongPress: onLongPress,
|
|
43
|
-
disabled: disabled,
|
|
44
|
-
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
45
|
-
hitSlop: hitSlop ? hitSlop : 8,
|
|
46
|
-
style: _style
|
|
47
|
-
}, props), children);
|
|
48
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
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_PROPS = {
|
|
9
|
-
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
|
|
10
|
-
layout: {},
|
|
11
|
-
triggers: [_types.Triggers.OnPress, _types.Triggers.OnLongPress],
|
|
12
|
-
props: {
|
|
13
|
-
onPress: (0, _types.createActionProp)(),
|
|
14
|
-
onLongPress: (0, _types.createActionProp)(),
|
|
15
|
-
activeOpacity: (0, _types.createNumberProp)({
|
|
16
|
-
label: "Active Opacity",
|
|
17
|
-
description: "The opacity when the button is pressed.",
|
|
18
|
-
defaultValue: 0.8,
|
|
19
|
-
group: _types.GROUPS.basic
|
|
20
|
-
}),
|
|
21
|
-
disabledOpacity: (0, _types.createNumberProp)({
|
|
22
|
-
label: "Disabled Opacity",
|
|
23
|
-
description: "The opacity when the button is disabled.",
|
|
24
|
-
defaultValue: 0.8,
|
|
25
|
-
group: _types.GROUPS.basic
|
|
26
|
-
}),
|
|
27
|
-
delayLongPress: (0, _types.createNumberProp)({
|
|
28
|
-
label: "Delay Long Press",
|
|
29
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
30
|
-
group: _types.GROUPS.basic
|
|
31
|
-
}),
|
|
32
|
-
hitSlop: (0, _types.createNumberProp)({
|
|
33
|
-
label: "Hit Slop",
|
|
34
|
-
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
35
|
-
group: _types.GROUPS.basic
|
|
36
|
-
})
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const SEED_DATA = [{
|
|
40
|
-
name: "Touchable",
|
|
41
|
-
tag: "Touchable",
|
|
42
|
-
description: "An interactive view with no styles",
|
|
43
|
-
category: _types.COMPONENT_TYPES.button,
|
|
44
|
-
...SEED_DATA_PROPS
|
|
45
|
-
}, {
|
|
46
|
-
name: "Pressable",
|
|
47
|
-
tag: "Pressable",
|
|
48
|
-
description: "An interactive view with no styles",
|
|
49
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
50
|
-
...SEED_DATA_PROPS
|
|
51
|
-
}];
|
|
52
|
-
exports.SEED_DATA = SEED_DATA;
|