@draftbit/core 47.0.1-d41acb.2 → 47.0.1-e04fa3.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 +3 -3
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +2 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +2 -1
- package/lib/commonjs/components/DeprecatedButton.js +27 -3
- package/lib/commonjs/components/DeprecatedFAB.js +2 -1
- package/lib/commonjs/components/Touchable.js +3 -8
- package/lib/commonjs/index.js +25 -89
- package/lib/commonjs/mappings/Button.js +10 -39
- package/lib/commonjs/mappings/NativeBase/AlertDialog.js +102 -0
- package/lib/commonjs/mappings/NativeBase/Button.js +84 -0
- package/lib/commonjs/mappings/NativeBase/DataDisplay.js +61 -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/NativeBase/Select.js +65 -0
- package/lib/commonjs/mappings/NativeBase/Slider.js +81 -0
- package/lib/commonjs/mappings/Touchable.js +7 -47
- package/lib/module/components/Button.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +3 -2
- package/lib/module/components/Checkbox/CheckboxRow.js +3 -2
- package/lib/module/components/DeprecatedButton.js +28 -4
- package/lib/module/components/DeprecatedFAB.js +3 -2
- package/lib/module/components/Touchable.js +3 -8
- package/lib/module/index.js +121 -32
- package/lib/module/mappings/Button.js +11 -40
- package/lib/module/mappings/NativeBase/AlertDialog.js +95 -0
- package/lib/module/mappings/NativeBase/Button.js +86 -0
- package/lib/module/mappings/NativeBase/DataDisplay.js +54 -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/NativeBase/Select.js +58 -0
- package/lib/module/mappings/NativeBase/Slider.js +74 -0
- package/lib/module/mappings/Touchable.js +9 -49
- 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/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedButton.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/Touchable.d.ts +2 -7
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +102 -30
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +4 -113
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts +146 -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/NativeBase/DataDisplay.d.ts +96 -0
- 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/NativeBase/Select.d.ts +156 -0
- package/lib/typescript/src/mappings/NativeBase/Select.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Slider.d.ts +200 -0
- package/lib/typescript/src/mappings/NativeBase/Slider.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Touchable.d.ts +5 -59
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +3 -3
- package/src/components/Button.tsx +4 -14
- package/src/components/Checkbox/Checkbox.js +3 -2
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Checkbox/CheckboxGroupRow.js +3 -2
- package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +3 -2
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/DeprecatedButton.js +16 -4
- package/src/components/DeprecatedButton.tsx +31 -7
- package/src/components/DeprecatedFAB.js +3 -2
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Touchable.js +3 -3
- package/src/components/Touchable.tsx +4 -14
- package/src/index.js +112 -32
- package/src/index.tsx +123 -44
- package/src/mappings/Button.js +10 -39
- package/src/mappings/Button.ts +10 -41
- package/src/mappings/NativeBase/AlertDialog.js +112 -0
- package/src/mappings/NativeBase/AlertDialog.ts +128 -0
- package/src/mappings/NativeBase/Button.js +84 -0
- package/src/mappings/NativeBase/Button.ts +83 -0
- package/src/mappings/NativeBase/DataDisplay.js +67 -0
- package/src/mappings/NativeBase/DataDisplay.ts +79 -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/NativeBase/Select.js +71 -0
- package/src/mappings/NativeBase/Select.ts +85 -0
- package/src/mappings/NativeBase/Slider.js +89 -0
- package/src/mappings/NativeBase/Slider.ts +105 -0
- package/src/mappings/Touchable.js +7 -50
- package/src/mappings/Touchable.ts +6 -53
- package/lib/commonjs/components/Pressable.js +0 -37
- package/lib/module/components/Pressable.js +0 -30
- package/lib/typescript/src/components/Pressable.d.ts +0 -16
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/src/components/Pressable.js +0 -12
- package/src/components/Pressable.tsx +0 -50
|
@@ -0,0 +1,99 @@
|
|
|
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 SHARED_SEED_DATA = {
|
|
9
|
+
category: _types.COMPONENT_TYPES.NBPopover,
|
|
10
|
+
packageName: "native-base",
|
|
11
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
|
|
12
|
+
layout: {},
|
|
13
|
+
triggers: {}
|
|
14
|
+
};
|
|
15
|
+
const SEED_DATA = [{
|
|
16
|
+
name: "Popover",
|
|
17
|
+
tag: "Popover",
|
|
18
|
+
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.",
|
|
19
|
+
...SHARED_SEED_DATA,
|
|
20
|
+
allowChildren: true,
|
|
21
|
+
props: {
|
|
22
|
+
isOpen: (0, _types.createBoolProp)({
|
|
23
|
+
label: "Is Open",
|
|
24
|
+
description: "If true, the popover is open. Useful for controlling the open state."
|
|
25
|
+
}),
|
|
26
|
+
defaultIsOpen: (0, _types.createStaticBoolProp)({
|
|
27
|
+
label: "Default Is Open",
|
|
28
|
+
description: "If true, the popover will be opened by default."
|
|
29
|
+
}),
|
|
30
|
+
trapFocus: (0, _types.createStaticBoolProp)({
|
|
31
|
+
label: "Trap Focus",
|
|
32
|
+
description: "Whether popover should trap focus."
|
|
33
|
+
}),
|
|
34
|
+
shouldFlip: (0, _types.createStaticBoolProp)({
|
|
35
|
+
label: "Should Flip",
|
|
36
|
+
description: "Whether popover should flip when it reaches the edge of the screen.",
|
|
37
|
+
defaultValue: true
|
|
38
|
+
}),
|
|
39
|
+
shouldOverlapWithTrigger: (0, _types.createStaticBoolProp)({
|
|
40
|
+
label: "Should Overlap With Trigger",
|
|
41
|
+
description: "Whether popover should overlap with trigger.",
|
|
42
|
+
defaultValue: false
|
|
43
|
+
}),
|
|
44
|
+
isKeyboardDismissable: (0, _types.createStaticBoolProp)({
|
|
45
|
+
label: "Is Keyboard Dismissable",
|
|
46
|
+
description: "If true, the popover will close when the keyboard is dismissed.",
|
|
47
|
+
defaultValue: true
|
|
48
|
+
}),
|
|
49
|
+
placement: (0, _types.createTextEnumProp)({
|
|
50
|
+
label: "Placement",
|
|
51
|
+
description: "The placement of the popover",
|
|
52
|
+
options: ["bottom", "top", "left", "right", "top left", "top right", "bottom left", "bottom right", "right bottom", "right top", "left bottom", "left top"],
|
|
53
|
+
defaultValue: "bottom left"
|
|
54
|
+
}),
|
|
55
|
+
useRNModal: (0, _types.createStaticBoolProp)({
|
|
56
|
+
label: "Use RN Modal",
|
|
57
|
+
description: "If true, the popover will use the RN Modal component."
|
|
58
|
+
}),
|
|
59
|
+
onOpen: (0, _types.createActionProp)(),
|
|
60
|
+
onClose: (0, _types.createActionProp)()
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
name: "Popover Arrow",
|
|
64
|
+
tag: "Popover.Arrow",
|
|
65
|
+
description: "The popover arrow.",
|
|
66
|
+
...SHARED_SEED_DATA,
|
|
67
|
+
props: {}
|
|
68
|
+
}, {
|
|
69
|
+
name: "Popover Body",
|
|
70
|
+
tag: "Popover.Body",
|
|
71
|
+
description: "The body of the popover.",
|
|
72
|
+
...SHARED_SEED_DATA,
|
|
73
|
+
props: {}
|
|
74
|
+
}, {
|
|
75
|
+
name: "Popover Content",
|
|
76
|
+
tag: "Popover.Content",
|
|
77
|
+
description: "The popover itself.",
|
|
78
|
+
...SHARED_SEED_DATA,
|
|
79
|
+
props: {}
|
|
80
|
+
}, {
|
|
81
|
+
name: "Popover Close Button",
|
|
82
|
+
tag: "Popover.CloseButton",
|
|
83
|
+
description: "The button that closes the popover.",
|
|
84
|
+
...SHARED_SEED_DATA,
|
|
85
|
+
props: {}
|
|
86
|
+
}, {
|
|
87
|
+
name: "Popover Header",
|
|
88
|
+
tag: "Popover.Header",
|
|
89
|
+
description: "The header of the popover.",
|
|
90
|
+
...SHARED_SEED_DATA,
|
|
91
|
+
props: {}
|
|
92
|
+
}, {
|
|
93
|
+
name: "Popover Trigger",
|
|
94
|
+
tag: "Popover.Trigger",
|
|
95
|
+
description: "Used to wrap the reference (or trigger) element.",
|
|
96
|
+
...SHARED_SEED_DATA,
|
|
97
|
+
props: {}
|
|
98
|
+
}];
|
|
99
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 SHARED_SEED_DATA = {
|
|
9
|
+
category: _types.COMPONENT_TYPES.NBForms,
|
|
10
|
+
packageName: "native-base",
|
|
11
|
+
doc_link: "https://docs.nativebase.io/select",
|
|
12
|
+
code_link: "https://github.com/GeekyAnts/NativeBase/tree/master/src/components/primitives/Select",
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
|
|
14
|
+
layout: {},
|
|
15
|
+
allowChildren: true
|
|
16
|
+
};
|
|
17
|
+
const SEED_DATA = [{
|
|
18
|
+
name: "Select",
|
|
19
|
+
tag: "Select",
|
|
20
|
+
description: "Select creates a dropdown list of items with the selected item in closed view.",
|
|
21
|
+
...SHARED_SEED_DATA,
|
|
22
|
+
triggers: [_types.Triggers.OnOpen, _types.Triggers.OnClose],
|
|
23
|
+
props: {
|
|
24
|
+
onOpen: (0, _types.createActionProp)(),
|
|
25
|
+
onClose: (0, _types.createActionProp)(),
|
|
26
|
+
placeholder: (0, _types.createTextProp)({
|
|
27
|
+
label: "Placeholder",
|
|
28
|
+
defaultValue: "Select an option"
|
|
29
|
+
}),
|
|
30
|
+
color: (0, _types.createColorProp)(),
|
|
31
|
+
placeholderTextColor: (0, _types.createColorProp)(),
|
|
32
|
+
isDisabled: (0, _types.createDisabledProp)(),
|
|
33
|
+
isHovered: (0, _types.createBoolProp)({
|
|
34
|
+
label: "Hovered?",
|
|
35
|
+
description: "Whether the select is hovered"
|
|
36
|
+
}),
|
|
37
|
+
isFocused: (0, _types.createBoolProp)({
|
|
38
|
+
label: "Focused?",
|
|
39
|
+
description: "Whether the select is hovered"
|
|
40
|
+
}),
|
|
41
|
+
isFocusVisible: (0, _types.createBoolProp)({
|
|
42
|
+
label: "Focus Visible?",
|
|
43
|
+
description: "WIf true, the focus ring of select will be visible."
|
|
44
|
+
}),
|
|
45
|
+
dropdownIcon: (0, _types.createIconProp)(),
|
|
46
|
+
dropdownOpenIcon: (0, _types.createIconProp)(),
|
|
47
|
+
dropdownCloseIcon: (0, _types.createIconProp)()
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
name: "Select Item",
|
|
51
|
+
tag: "Select.Item",
|
|
52
|
+
description: "An individual item in the menu.",
|
|
53
|
+
...SHARED_SEED_DATA,
|
|
54
|
+
props: {
|
|
55
|
+
label: (0, _types.createTextProp)({
|
|
56
|
+
label: "Label",
|
|
57
|
+
description: "The label of the item"
|
|
58
|
+
}),
|
|
59
|
+
value: (0, _types.createTextProp)({
|
|
60
|
+
label: "Value",
|
|
61
|
+
description: "The value of the item"
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}];
|
|
65
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,81 @@
|
|
|
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 SHARED_SEED_DATA = {
|
|
9
|
+
category: _types.COMPONENT_TYPES.NBForms,
|
|
10
|
+
packageName: "native-base",
|
|
11
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
|
|
12
|
+
layout: {},
|
|
13
|
+
allowChildren: true
|
|
14
|
+
};
|
|
15
|
+
const SEED_DATA = [{
|
|
16
|
+
name: "Slider",
|
|
17
|
+
tag: "Slider",
|
|
18
|
+
description: "The Slider allows users to select options from a given range of values.",
|
|
19
|
+
...SHARED_SEED_DATA,
|
|
20
|
+
triggers: [_types.Triggers.OnChange, _types.Triggers.OnChangeEnd],
|
|
21
|
+
props: {
|
|
22
|
+
onChange: (0, _types.createActionProp)(),
|
|
23
|
+
onChangeEnd: (0, _types.createActionProp)(),
|
|
24
|
+
defaultValue: (0, _types.createNumberProp)(),
|
|
25
|
+
thumbSize: (0, _types.createStaticNumberProp)({
|
|
26
|
+
label: "Thumb Size",
|
|
27
|
+
description: "The size of the slider thumb"
|
|
28
|
+
}),
|
|
29
|
+
sliderTrackHeight: (0, _types.createStaticNumberProp)({
|
|
30
|
+
label: "Slider Track Height",
|
|
31
|
+
description: "The height of the slider track"
|
|
32
|
+
}),
|
|
33
|
+
minValue: (0, _types.createStaticNumberProp)({
|
|
34
|
+
label: "Min Value"
|
|
35
|
+
}),
|
|
36
|
+
maxValue: (0, _types.createStaticNumberProp)({
|
|
37
|
+
label: "Max Value"
|
|
38
|
+
}),
|
|
39
|
+
step: (0, _types.createStaticNumberProp)({
|
|
40
|
+
label: "Step"
|
|
41
|
+
}),
|
|
42
|
+
isReadOnly: (0, _types.createBoolProp)({
|
|
43
|
+
label: "Read Only",
|
|
44
|
+
description: "Whether the slider is read only",
|
|
45
|
+
defaultValue: false
|
|
46
|
+
}),
|
|
47
|
+
isReversed: (0, _types.createStaticBoolProp)({
|
|
48
|
+
label: "Reversed",
|
|
49
|
+
description: "If true, the value will be incremented or decremented in reverse.",
|
|
50
|
+
defaultValue: false
|
|
51
|
+
}),
|
|
52
|
+
orientation: (0, _types.createTextEnumProp)({
|
|
53
|
+
label: "Orientation",
|
|
54
|
+
description: "The orientation of the Slider.",
|
|
55
|
+
options: ["horizontal", "vertical"],
|
|
56
|
+
defaultValue: "horizontal"
|
|
57
|
+
}),
|
|
58
|
+
isDisabled: (0, _types.createDisabledProp)(),
|
|
59
|
+
accessibilityLabel: (0, _types.createAccessibilityLabelProp)()
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
name: "Slider Track",
|
|
63
|
+
tag: "Menu.Item",
|
|
64
|
+
description: "An individual item in the menu.",
|
|
65
|
+
...SHARED_SEED_DATA,
|
|
66
|
+
props: {}
|
|
67
|
+
}, {
|
|
68
|
+
name: "Slider Filled Track",
|
|
69
|
+
tag: "Menu.Group",
|
|
70
|
+
description: "A wrapper to group related menu items.",
|
|
71
|
+
...SHARED_SEED_DATA,
|
|
72
|
+
props: {}
|
|
73
|
+
}, {
|
|
74
|
+
name: "Slider Thumb",
|
|
75
|
+
tag: "Menu.OptionGroup",
|
|
76
|
+
description: "A wrapper for checkable menu items (radio and checkbox).",
|
|
77
|
+
...SHARED_SEED_DATA,
|
|
78
|
+
triggers: [_types.Triggers.OnChange],
|
|
79
|
+
props: {}
|
|
80
|
+
}];
|
|
81
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -5,56 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Touchable",
|
|
10
|
+
tag: "Touchable",
|
|
11
|
+
description: "Simple button with no styles",
|
|
12
|
+
category: _types.COMPONENT_TYPES.button,
|
|
9
13
|
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
|
|
10
14
|
layout: {},
|
|
11
|
-
triggers: [_types.Triggers.OnPress
|
|
15
|
+
triggers: [_types.Triggers.OnPress],
|
|
12
16
|
props: {
|
|
13
|
-
onPress: (0, _types.createActionProp)()
|
|
14
|
-
onLongPress: (0, _types.createActionProp)(),
|
|
15
|
-
activeOpacity: (0, _types.createStaticNumberProp)({
|
|
16
|
-
label: "Active Opacity",
|
|
17
|
-
description: "The opacity when the button is pressed.",
|
|
18
|
-
defaultValue: 0.8,
|
|
19
|
-
min: 0,
|
|
20
|
-
max: 1,
|
|
21
|
-
step: 0.01,
|
|
22
|
-
precision: 2,
|
|
23
|
-
required: false
|
|
24
|
-
}),
|
|
25
|
-
disabledOpacity: (0, _types.createStaticNumberProp)({
|
|
26
|
-
label: "Disabled Opacity",
|
|
27
|
-
description: "The opacity when the button is disabled.",
|
|
28
|
-
defaultValue: 0.8,
|
|
29
|
-
min: 0,
|
|
30
|
-
max: 1,
|
|
31
|
-
step: 0.01,
|
|
32
|
-
precision: 2,
|
|
33
|
-
required: false
|
|
34
|
-
}),
|
|
35
|
-
delayLongPress: (0, _types.createStaticNumberProp)({
|
|
36
|
-
label: "Delay Long Press",
|
|
37
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
38
|
-
required: false
|
|
39
|
-
}),
|
|
40
|
-
hitSlop: (0, _types.createStaticNumberProp)({
|
|
41
|
-
label: "Hit Slop",
|
|
42
|
-
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
43
|
-
required: false
|
|
44
|
-
})
|
|
17
|
+
onPress: (0, _types.createActionProp)()
|
|
45
18
|
}
|
|
46
19
|
};
|
|
47
|
-
const SEED_DATA = [{
|
|
48
|
-
name: "Touchable",
|
|
49
|
-
tag: "Touchable",
|
|
50
|
-
description: "An interactive view with no styles",
|
|
51
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
52
|
-
...SEED_DATA_PROPS
|
|
53
|
-
}, {
|
|
54
|
-
name: "Pressable",
|
|
55
|
-
tag: "Pressable",
|
|
56
|
-
description: "An interactive view with no styles",
|
|
57
|
-
category: _types.COMPONENT_TYPES.button,
|
|
58
|
-
...SEED_DATA_PROPS
|
|
59
|
-
}];
|
|
60
20
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -13,11 +13,10 @@ function Base(_ref) {
|
|
|
13
13
|
Icon,
|
|
14
14
|
icon,
|
|
15
15
|
title,
|
|
16
|
+
onPress,
|
|
16
17
|
loading,
|
|
17
18
|
disabled,
|
|
18
19
|
style,
|
|
19
|
-
activeOpacity,
|
|
20
|
-
disabledOpacity,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
22
|
const {
|
|
@@ -54,13 +53,14 @@ function Base(_ref) {
|
|
|
54
53
|
buttonStyles.justifyContent = "flex-end";
|
|
55
54
|
}
|
|
56
55
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
56
|
+
onPress: onPress,
|
|
57
57
|
disabled: disabled || loading,
|
|
58
58
|
style: _ref2 => {
|
|
59
59
|
let {
|
|
60
60
|
pressed
|
|
61
61
|
} = _ref2;
|
|
62
62
|
return [styles.base, {
|
|
63
|
-
opacity: pressed
|
|
63
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
64
64
|
}, buttonStyles];
|
|
65
65
|
}
|
|
66
66
|
}, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
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
2
|
import * as React from "react";
|
|
3
|
-
import { View, StyleSheet
|
|
3
|
+
import { View, StyleSheet } from "react-native";
|
|
4
4
|
import { useTheme } from "../../theming";
|
|
5
|
+
import Touchable from "../Touchable";
|
|
5
6
|
import { usePrevious } from "../../hooks";
|
|
6
7
|
const Checkbox = _ref => {
|
|
7
8
|
let {
|
|
@@ -50,7 +51,7 @@ const Checkbox = _ref => {
|
|
|
50
51
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
return /*#__PURE__*/React.createElement(
|
|
54
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
54
55
|
onPress: handlePress,
|
|
55
56
|
disabled: disabled,
|
|
56
57
|
accessibilityState: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
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
2
|
import * as React from "react";
|
|
3
|
-
import { StyleSheet, View, Platform
|
|
3
|
+
import { StyleSheet, View, Platform } from "react-native";
|
|
4
4
|
import Checkbox from "./Checkbox";
|
|
5
5
|
import Text from "../Text";
|
|
6
6
|
import { useCheckboxGroupContext } from "./context";
|
|
7
7
|
import { Direction as GroupDirection } from "./context";
|
|
8
|
+
import Touchable from "../Touchable";
|
|
8
9
|
import { extractStyles } from "../../utilities";
|
|
9
10
|
export let Direction;
|
|
10
11
|
(function (Direction) {
|
|
@@ -63,7 +64,7 @@ const CheckboxGroupRow = _ref => {
|
|
|
63
64
|
textStyles,
|
|
64
65
|
viewStyles
|
|
65
66
|
} = extractStyles(style);
|
|
66
|
-
return /*#__PURE__*/React.createElement(
|
|
67
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
67
68
|
onPress: handlePress,
|
|
68
69
|
style: [styles.mainParent, {
|
|
69
70
|
flexDirection: direction
|
|
@@ -1,10 +1,11 @@
|
|
|
1
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
2
|
import * as React from "react";
|
|
3
|
-
import { StyleSheet, View, Platform
|
|
3
|
+
import { StyleSheet, View, Platform } from "react-native";
|
|
4
4
|
import { isString } from "lodash";
|
|
5
5
|
import { extractStyles } from "../../utilities";
|
|
6
6
|
import { usePrevious } from "../../hooks";
|
|
7
7
|
import Text from "../Text";
|
|
8
|
+
import Touchable from "../Touchable";
|
|
8
9
|
import Checkbox from "./Checkbox";
|
|
9
10
|
export let Direction;
|
|
10
11
|
(function (Direction) {
|
|
@@ -72,7 +73,7 @@ const CheckboxRow = _ref => {
|
|
|
72
73
|
textStyles,
|
|
73
74
|
viewStyles
|
|
74
75
|
} = extractStyles(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
76
77
|
onPress: handlePress,
|
|
77
78
|
style: [viewStyles, styles.mainParent, {
|
|
78
79
|
flexDirection: direction
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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
2
|
import * as React from "react";
|
|
3
|
-
import { ActivityIndicator, View, Text, StyleSheet
|
|
3
|
+
import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
|
|
4
4
|
import color from "color";
|
|
5
5
|
import Config from "./Config";
|
|
6
|
+
import Touchable from "./Touchable";
|
|
6
7
|
import Elevation from "./Elevation";
|
|
7
8
|
import { withTheme } from "../theming";
|
|
8
9
|
const Button = _ref => {
|
|
@@ -17,6 +18,7 @@ const Button = _ref => {
|
|
|
17
18
|
children,
|
|
18
19
|
onPress,
|
|
19
20
|
elevation = 0,
|
|
21
|
+
style,
|
|
20
22
|
theme: {
|
|
21
23
|
colors,
|
|
22
24
|
disabledOpacity,
|
|
@@ -70,19 +72,41 @@ const Button = _ref => {
|
|
|
70
72
|
marginRight: -8,
|
|
71
73
|
width: Config.buttonIconSize
|
|
72
74
|
}];
|
|
75
|
+
const {
|
|
76
|
+
margin,
|
|
77
|
+
marginEnd,
|
|
78
|
+
marginTop,
|
|
79
|
+
marginLeft,
|
|
80
|
+
marginRight,
|
|
81
|
+
marginBottom,
|
|
82
|
+
marginHorizontal,
|
|
83
|
+
marginVertical,
|
|
84
|
+
...innerStyles
|
|
85
|
+
} = StyleSheet.flatten(style || {});
|
|
86
|
+
const margins = {
|
|
87
|
+
margin,
|
|
88
|
+
marginEnd,
|
|
89
|
+
marginTop,
|
|
90
|
+
marginLeft,
|
|
91
|
+
marginRight,
|
|
92
|
+
marginBottom,
|
|
93
|
+
marginHorizontal,
|
|
94
|
+
marginVertical
|
|
95
|
+
};
|
|
73
96
|
return /*#__PURE__*/React.createElement(Elevation, {
|
|
74
97
|
style: {
|
|
75
98
|
elevation,
|
|
76
|
-
alignSelf: "stretch"
|
|
99
|
+
alignSelf: "stretch",
|
|
100
|
+
...margins
|
|
77
101
|
}
|
|
78
|
-
}, /*#__PURE__*/React.createElement(
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
79
103
|
onPress: onPress,
|
|
80
104
|
accessibilityState: {
|
|
81
105
|
disabled
|
|
82
106
|
},
|
|
83
107
|
accessibilityRole: "button",
|
|
84
108
|
disabled: disabled || loading,
|
|
85
|
-
style: [styles.button, buttonStyle]
|
|
109
|
+
style: [styles.button, buttonStyle, innerStyles]
|
|
86
110
|
}), /*#__PURE__*/React.createElement(View, {
|
|
87
111
|
style: styles.content
|
|
88
112
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
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
2
|
import * as React from "react";
|
|
3
|
-
import { ActivityIndicator, View, StyleSheet
|
|
3
|
+
import { ActivityIndicator, View, StyleSheet } from "react-native";
|
|
4
4
|
import color from "color";
|
|
5
5
|
import Config from "./Config";
|
|
6
6
|
import Text from "./Text";
|
|
7
|
+
import Touchable from "./Touchable";
|
|
7
8
|
import Elevation from "./Elevation";
|
|
8
9
|
import { withTheme } from "../theming";
|
|
9
10
|
const FAB = _ref => {
|
|
@@ -97,7 +98,7 @@ const FAB = _ref => {
|
|
|
97
98
|
style: [{
|
|
98
99
|
elevation
|
|
99
100
|
}, style]
|
|
100
|
-
}, /*#__PURE__*/React.createElement(
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
101
102
|
onPress: onPress,
|
|
102
103
|
accessibilityState: {
|
|
103
104
|
disabled
|
|
@@ -6,24 +6,19 @@ export default function Touchable(_ref) {
|
|
|
6
6
|
children,
|
|
7
7
|
disabled,
|
|
8
8
|
onPress,
|
|
9
|
-
activeOpacity,
|
|
10
|
-
disabledOpacity,
|
|
11
|
-
delayLongPress,
|
|
12
|
-
hitSlop,
|
|
13
9
|
style,
|
|
14
10
|
...props
|
|
15
11
|
} = _ref;
|
|
16
12
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
17
|
-
disabled: disabled,
|
|
18
13
|
onPress: onPress,
|
|
19
|
-
|
|
20
|
-
hitSlop:
|
|
14
|
+
disabled: disabled,
|
|
15
|
+
hitSlop: 8,
|
|
21
16
|
style: _ref2 => {
|
|
22
17
|
let {
|
|
23
18
|
pressed
|
|
24
19
|
} = _ref2;
|
|
25
20
|
return [{
|
|
26
|
-
opacity: pressed
|
|
21
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
27
22
|
}, style];
|
|
28
23
|
}
|
|
29
24
|
}, props), children);
|