@draftbit/core 47.0.1-9fd6f2.2 → 47.0.1-c14479.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 +1 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
- package/lib/commonjs/components/DeprecatedButton.js +3 -27
- package/lib/commonjs/components/DeprecatedFAB.js +1 -2
- package/lib/commonjs/components/Pressable.js +37 -0
- package/lib/commonjs/components/Touchable.js +8 -3
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Button.js +39 -10
- package/lib/commonjs/mappings/Touchable.js +47 -7
- package/lib/module/components/Button.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +2 -3
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
- package/lib/module/components/DeprecatedButton.js +4 -28
- package/lib/module/components/DeprecatedFAB.js +2 -3
- package/lib/module/components/Pressable.js +30 -0
- package/lib/module/components/Touchable.js +8 -3
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Button.js +40 -11
- package/lib/module/mappings/Touchable.js +49 -9
- 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/Pressable.d.ts +16 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable.d.ts +7 -2
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +113 -4
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
- 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 +14 -4
- package/src/components/Checkbox/Checkbox.js +2 -3
- package/src/components/Checkbox/Checkbox.tsx +5 -7
- package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +2 -3
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/DeprecatedButton.js +4 -16
- package/src/components/DeprecatedButton.tsx +7 -31
- package/src/components/DeprecatedFAB.js +2 -3
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Pressable.js +12 -0
- package/src/components/Pressable.tsx +50 -0
- package/src/components/Touchable.js +3 -3
- package/src/components/Touchable.tsx +14 -4
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Button.js +39 -10
- package/src/mappings/Button.ts +41 -10
- package/src/mappings/Touchable.js +50 -7
- package/src/mappings/Touchable.ts +53 -6
package/src/mappings/Button.ts
CHANGED
|
@@ -7,11 +7,13 @@ import {
|
|
|
7
7
|
createActionProp,
|
|
8
8
|
Triggers,
|
|
9
9
|
StylesPanelSections,
|
|
10
|
+
createStaticNumberProp,
|
|
10
11
|
} from "@draftbit/types";
|
|
11
12
|
|
|
12
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnPress];
|
|
13
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnPress, Triggers.OnLongPress];
|
|
13
14
|
const SEED_DATA_PROPS = {
|
|
14
15
|
onPress: createActionProp(),
|
|
16
|
+
onLongPress: createActionProp(),
|
|
15
17
|
icon: createIconProp({
|
|
16
18
|
defaultValue: null,
|
|
17
19
|
required: false,
|
|
@@ -23,12 +25,38 @@ const SEED_DATA_PROPS = {
|
|
|
23
25
|
}),
|
|
24
26
|
disabled: createDisabledProp(),
|
|
25
27
|
loading: createLoadingProp(),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
activeOpacity: createStaticNumberProp({
|
|
29
|
+
label: "Active Opacity",
|
|
30
|
+
description: "Opacity of the button when active.",
|
|
31
|
+
defaultValue: 0.8,
|
|
32
|
+
min: 0,
|
|
33
|
+
max: 1,
|
|
34
|
+
step: 0.01,
|
|
35
|
+
precision: 2,
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
disabledOpacity: createStaticNumberProp({
|
|
39
|
+
label: "Disabled Opacity",
|
|
40
|
+
description: "Opacity of the button when disabled.",
|
|
41
|
+
defaultValue: 0.8,
|
|
42
|
+
min: 0,
|
|
43
|
+
max: 1,
|
|
44
|
+
step: 0.01,
|
|
45
|
+
precision: 2,
|
|
46
|
+
required: false,
|
|
47
|
+
}),
|
|
48
|
+
delayLongPress: createStaticNumberProp({
|
|
49
|
+
label: "Delay Long Press",
|
|
50
|
+
description:
|
|
51
|
+
"Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
hitSlop: createStaticNumberProp({
|
|
55
|
+
label: "Hit Slop",
|
|
56
|
+
description:
|
|
57
|
+
"Sets additional distance outside of element in which a press can be detected",
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
32
60
|
};
|
|
33
61
|
|
|
34
62
|
export const SEED_DATA = [
|
|
@@ -46,7 +74,8 @@ export const SEED_DATA = [
|
|
|
46
74
|
StylesPanelSections.Effects,
|
|
47
75
|
],
|
|
48
76
|
layout: {
|
|
49
|
-
|
|
77
|
+
borderRadius: 8,
|
|
78
|
+
fontFamily: "system-700",
|
|
50
79
|
backgroundColor: "transparent",
|
|
51
80
|
borderWidth: 1,
|
|
52
81
|
textAlign: "center",
|
|
@@ -68,7 +97,8 @@ export const SEED_DATA = [
|
|
|
68
97
|
StylesPanelSections.Effects,
|
|
69
98
|
],
|
|
70
99
|
layout: {
|
|
71
|
-
|
|
100
|
+
borderRadius: 8,
|
|
101
|
+
fontFamily: "system-700",
|
|
72
102
|
backgroundColor: "primary",
|
|
73
103
|
textAlign: "center",
|
|
74
104
|
},
|
|
@@ -89,7 +119,8 @@ export const SEED_DATA = [
|
|
|
89
119
|
StylesPanelSections.Effects,
|
|
90
120
|
],
|
|
91
121
|
layout: {
|
|
92
|
-
|
|
122
|
+
borderRadius: 8,
|
|
123
|
+
fontFamily: "system-700",
|
|
93
124
|
backgroundColor: "primary",
|
|
94
125
|
textAlign: "center",
|
|
95
126
|
},
|
|
@@ -1,17 +1,60 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
-
|
|
3
|
-
name: "Touchable",
|
|
4
|
-
tag: "Touchable",
|
|
5
|
-
description: "Simple button with no styles",
|
|
6
|
-
category: COMPONENT_TYPES.button,
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
const SEED_DATA_PROPS = {
|
|
7
3
|
stylesPanelSections: [
|
|
8
4
|
StylesPanelSections.Size,
|
|
9
5
|
StylesPanelSections.Margins,
|
|
10
6
|
StylesPanelSections.Borders,
|
|
11
7
|
],
|
|
12
8
|
layout: {},
|
|
13
|
-
triggers: [Triggers.OnPress],
|
|
9
|
+
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
14
10
|
props: {
|
|
15
11
|
onPress: createActionProp(),
|
|
12
|
+
onLongPress: createActionProp(),
|
|
13
|
+
activeOpacity: createStaticNumberProp({
|
|
14
|
+
label: "Active Opacity",
|
|
15
|
+
description: "The opacity when the button is pressed.",
|
|
16
|
+
defaultValue: 0.8,
|
|
17
|
+
min: 0,
|
|
18
|
+
max: 1,
|
|
19
|
+
step: 0.01,
|
|
20
|
+
precision: 2,
|
|
21
|
+
required: false,
|
|
22
|
+
}),
|
|
23
|
+
disabledOpacity: createStaticNumberProp({
|
|
24
|
+
label: "Disabled Opacity",
|
|
25
|
+
description: "The opacity when the button is disabled.",
|
|
26
|
+
defaultValue: 0.8,
|
|
27
|
+
min: 0,
|
|
28
|
+
max: 1,
|
|
29
|
+
step: 0.01,
|
|
30
|
+
precision: 2,
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
delayLongPress: createStaticNumberProp({
|
|
34
|
+
label: "Delay Long Press",
|
|
35
|
+
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
hitSlop: createStaticNumberProp({
|
|
39
|
+
label: "Hit Slop",
|
|
40
|
+
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
41
|
+
required: false,
|
|
42
|
+
}),
|
|
16
43
|
},
|
|
17
44
|
};
|
|
45
|
+
export const SEED_DATA = [
|
|
46
|
+
{
|
|
47
|
+
name: "Touchable",
|
|
48
|
+
tag: "Touchable",
|
|
49
|
+
description: "An interactive view with no styles",
|
|
50
|
+
category: COMPONENT_TYPES.deprecated,
|
|
51
|
+
...SEED_DATA_PROPS,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "Pressable",
|
|
55
|
+
tag: "Pressable",
|
|
56
|
+
description: "An interactive view with no styles",
|
|
57
|
+
category: COMPONENT_TYPES.button,
|
|
58
|
+
...SEED_DATA_PROPS,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
@@ -2,22 +2,69 @@ import {
|
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
3
|
createActionProp,
|
|
4
4
|
Triggers,
|
|
5
|
+
createStaticNumberProp,
|
|
5
6
|
StylesPanelSections,
|
|
6
7
|
} from "@draftbit/types";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
name: "Touchable",
|
|
10
|
-
tag: "Touchable",
|
|
11
|
-
description: "Simple button with no styles",
|
|
12
|
-
category: COMPONENT_TYPES.button,
|
|
9
|
+
const SEED_DATA_PROPS = {
|
|
13
10
|
stylesPanelSections: [
|
|
14
11
|
StylesPanelSections.Size,
|
|
15
12
|
StylesPanelSections.Margins,
|
|
16
13
|
StylesPanelSections.Borders,
|
|
17
14
|
],
|
|
18
15
|
layout: {},
|
|
19
|
-
triggers: [Triggers.OnPress],
|
|
16
|
+
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
20
17
|
props: {
|
|
21
18
|
onPress: createActionProp(),
|
|
19
|
+
onLongPress: createActionProp(),
|
|
20
|
+
activeOpacity: createStaticNumberProp({
|
|
21
|
+
label: "Active Opacity",
|
|
22
|
+
description: "The opacity when the button is pressed.",
|
|
23
|
+
defaultValue: 0.8,
|
|
24
|
+
min: 0,
|
|
25
|
+
max: 1,
|
|
26
|
+
step: 0.01,
|
|
27
|
+
precision: 2,
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
disabledOpacity: createStaticNumberProp({
|
|
31
|
+
label: "Disabled Opacity",
|
|
32
|
+
description: "The opacity when the button is disabled.",
|
|
33
|
+
defaultValue: 0.8,
|
|
34
|
+
min: 0,
|
|
35
|
+
max: 1,
|
|
36
|
+
step: 0.01,
|
|
37
|
+
precision: 2,
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
delayLongPress: createStaticNumberProp({
|
|
41
|
+
label: "Delay Long Press",
|
|
42
|
+
description:
|
|
43
|
+
"Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
hitSlop: createStaticNumberProp({
|
|
47
|
+
label: "Hit Slop",
|
|
48
|
+
description:
|
|
49
|
+
"Sets additional distance outside of element in which a press can be detected.",
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
22
52
|
},
|
|
23
53
|
};
|
|
54
|
+
|
|
55
|
+
export const SEED_DATA = [
|
|
56
|
+
{
|
|
57
|
+
name: "Touchable",
|
|
58
|
+
tag: "Touchable",
|
|
59
|
+
description: "An interactive view with no styles",
|
|
60
|
+
category: COMPONENT_TYPES.deprecated,
|
|
61
|
+
...SEED_DATA_PROPS,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Pressable",
|
|
65
|
+
tag: "Pressable",
|
|
66
|
+
description: "An interactive view with no styles",
|
|
67
|
+
category: COMPONENT_TYPES.button,
|
|
68
|
+
...SEED_DATA_PROPS,
|
|
69
|
+
},
|
|
70
|
+
];
|