@draftbit/core 47.0.1-0e56b5.2 → 47.0.1-2935a8.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 +22 -31
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- 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/mappings/Button.js +10 -29
- package/lib/commonjs/mappings/FlashList.js +38 -2
- package/lib/commonjs/mappings/FlatList.js +9 -0
- package/lib/commonjs/mappings/Touchable.js +20 -0
- package/lib/module/components/Button.js +16 -25
- 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/mappings/Button.js +11 -30
- package/lib/module/mappings/FlashList.js +39 -3
- package/lib/module/mappings/FlatList.js +10 -1
- 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/mappings/Button.d.ts +4 -113
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +130 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +51 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- 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 +18 -22
- package/src/components/Button.tsx +18 -49
- 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/mappings/Button.js +10 -29
- package/src/mappings/Button.ts +10 -31
- package/src/mappings/FlashList.js +75 -31
- package/src/mappings/FlashList.ts +77 -30
- package/src/mappings/FlatList.js +15 -1
- package/src/mappings/FlatList.ts +16 -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 +0 -76
- 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
|
@@ -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;
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
import React, { useCallback } from "react";
|
|
3
|
-
import { Pressable as NativePressable } from "react-native";
|
|
4
|
-
export default function Pressable(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
children,
|
|
7
|
-
disabled,
|
|
8
|
-
onPress,
|
|
9
|
-
onLongPress,
|
|
10
|
-
hitSlop,
|
|
11
|
-
delayLongPress,
|
|
12
|
-
activeOpacity,
|
|
13
|
-
disabledOpacity,
|
|
14
|
-
style,
|
|
15
|
-
...props
|
|
16
|
-
} = _ref;
|
|
17
|
-
const getOpacity = useCallback(pressed => {
|
|
18
|
-
if (disabled) {
|
|
19
|
-
return disabledOpacity;
|
|
20
|
-
} else {
|
|
21
|
-
if (pressed) return activeOpacity;else return 1;
|
|
22
|
-
}
|
|
23
|
-
}, [activeOpacity, disabled, disabledOpacity]);
|
|
24
|
-
const _style = useCallback(_ref2 => {
|
|
25
|
-
let {
|
|
26
|
-
pressed
|
|
27
|
-
} = _ref2;
|
|
28
|
-
return [style, {
|
|
29
|
-
opacity: getOpacity(pressed)
|
|
30
|
-
}];
|
|
31
|
-
}, [getOpacity, style]);
|
|
32
|
-
return /*#__PURE__*/React.createElement(NativePressable, _extends({
|
|
33
|
-
onPress: onPress,
|
|
34
|
-
onLongPress: onLongPress,
|
|
35
|
-
disabled: disabled,
|
|
36
|
-
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
37
|
-
hitSlop: hitSlop ? hitSlop : 8,
|
|
38
|
-
style: _style
|
|
39
|
-
}, props), children);
|
|
40
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, createNumberProp, StylesPanelSections, GROUPS } from "@draftbit/types";
|
|
2
|
-
const SEED_DATA_PROPS = {
|
|
3
|
-
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Borders],
|
|
4
|
-
layout: {},
|
|
5
|
-
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
6
|
-
props: {
|
|
7
|
-
onPress: createActionProp(),
|
|
8
|
-
onLongPress: createActionProp(),
|
|
9
|
-
activeOpacity: createNumberProp({
|
|
10
|
-
label: "Active Opacity",
|
|
11
|
-
description: "The opacity when the button is pressed.",
|
|
12
|
-
defaultValue: 0.8,
|
|
13
|
-
group: GROUPS.basic
|
|
14
|
-
}),
|
|
15
|
-
disabledOpacity: createNumberProp({
|
|
16
|
-
label: "Disabled Opacity",
|
|
17
|
-
description: "The opacity when the button is disabled.",
|
|
18
|
-
defaultValue: 0.8,
|
|
19
|
-
group: GROUPS.basic
|
|
20
|
-
}),
|
|
21
|
-
delayLongPress: createNumberProp({
|
|
22
|
-
label: "Delay Long Press",
|
|
23
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
24
|
-
group: GROUPS.basic
|
|
25
|
-
}),
|
|
26
|
-
hitSlop: createNumberProp({
|
|
27
|
-
label: "Hit Slop",
|
|
28
|
-
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
29
|
-
group: GROUPS.basic
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export const SEED_DATA = [{
|
|
34
|
-
name: "Touchable",
|
|
35
|
-
tag: "Touchable",
|
|
36
|
-
description: "An interactive view with no styles",
|
|
37
|
-
category: COMPONENT_TYPES.button,
|
|
38
|
-
...SEED_DATA_PROPS
|
|
39
|
-
}, {
|
|
40
|
-
name: "Pressable",
|
|
41
|
-
tag: "Pressable",
|
|
42
|
-
description: "An interactive view with no styles",
|
|
43
|
-
category: COMPONENT_TYPES.deprecated,
|
|
44
|
-
...SEED_DATA_PROPS
|
|
45
|
-
}];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PressableProps, PressableStateCallbackType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
declare type Props = {
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
style?: ViewStyle;
|
|
7
|
-
onPress?: () => void;
|
|
8
|
-
onLongPress?: () => void;
|
|
9
|
-
delayLongPress?: number;
|
|
10
|
-
hitSlop?: number;
|
|
11
|
-
pressRetentionOffset?: number;
|
|
12
|
-
activeOpacity?: number;
|
|
13
|
-
disabledOpacity?: number;
|
|
14
|
-
} & PressableProps;
|
|
15
|
-
export declare type StyleType = (state: PressableStateCallbackType) => StyleProp<ViewStyle>;
|
|
16
|
-
export default function Pressable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }: Props): JSX.Element;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAEL,cAAc,EACd,0BAA0B,EAC1B,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,oBAAY,SAAS,GAAG,CACtB,KAAK,EAAE,0BAA0B,KAC9B,SAAS,CAAC,SAAS,CAAC,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,OAAO,EACP,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eA6BP"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: {
|
|
2
|
-
stylesPanelSections: string[];
|
|
3
|
-
layout: {};
|
|
4
|
-
triggers: string[];
|
|
5
|
-
props: {
|
|
6
|
-
onPress: {
|
|
7
|
-
label: string;
|
|
8
|
-
description: string;
|
|
9
|
-
editable: boolean;
|
|
10
|
-
required: boolean;
|
|
11
|
-
formType: string;
|
|
12
|
-
propType: string;
|
|
13
|
-
defaultValue: null;
|
|
14
|
-
group: string;
|
|
15
|
-
};
|
|
16
|
-
onLongPress: {
|
|
17
|
-
label: string;
|
|
18
|
-
description: string;
|
|
19
|
-
editable: boolean;
|
|
20
|
-
required: boolean;
|
|
21
|
-
formType: string;
|
|
22
|
-
propType: string;
|
|
23
|
-
defaultValue: null;
|
|
24
|
-
group: string;
|
|
25
|
-
};
|
|
26
|
-
activeOpacity: {
|
|
27
|
-
label: string;
|
|
28
|
-
description: string;
|
|
29
|
-
formType: string;
|
|
30
|
-
propType: string;
|
|
31
|
-
group: string;
|
|
32
|
-
defaultValue: null;
|
|
33
|
-
editable: boolean;
|
|
34
|
-
required: boolean;
|
|
35
|
-
step: number;
|
|
36
|
-
};
|
|
37
|
-
disabledOpacity: {
|
|
38
|
-
label: string;
|
|
39
|
-
description: string;
|
|
40
|
-
formType: string;
|
|
41
|
-
propType: string;
|
|
42
|
-
group: string;
|
|
43
|
-
defaultValue: null;
|
|
44
|
-
editable: boolean;
|
|
45
|
-
required: boolean;
|
|
46
|
-
step: number;
|
|
47
|
-
};
|
|
48
|
-
delayLongPress: {
|
|
49
|
-
label: string;
|
|
50
|
-
description: string;
|
|
51
|
-
formType: string;
|
|
52
|
-
propType: string;
|
|
53
|
-
group: string;
|
|
54
|
-
defaultValue: null;
|
|
55
|
-
editable: boolean;
|
|
56
|
-
required: boolean;
|
|
57
|
-
step: number;
|
|
58
|
-
};
|
|
59
|
-
hitSlop: {
|
|
60
|
-
label: string;
|
|
61
|
-
description: string;
|
|
62
|
-
formType: string;
|
|
63
|
-
propType: string;
|
|
64
|
-
group: string;
|
|
65
|
-
defaultValue: null;
|
|
66
|
-
editable: boolean;
|
|
67
|
-
required: boolean;
|
|
68
|
-
step: number;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
name: string;
|
|
72
|
-
tag: string;
|
|
73
|
-
description: string;
|
|
74
|
-
category: string;
|
|
75
|
-
}[];
|
|
76
|
-
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Pressable.ts"],"names":[],"mappings":"AA+CA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from "react";
|
|
2
|
-
import { Pressable as NativePressable, } from "react-native";
|
|
3
|
-
export default function Pressable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }) {
|
|
4
|
-
const getOpacity = useCallback((pressed) => {
|
|
5
|
-
if (disabled) {
|
|
6
|
-
return disabledOpacity;
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
if (pressed)
|
|
10
|
-
return activeOpacity;
|
|
11
|
-
else
|
|
12
|
-
return 1;
|
|
13
|
-
}
|
|
14
|
-
}, [activeOpacity, disabled, disabledOpacity]);
|
|
15
|
-
const _style = useCallback(({ pressed }) => [style, { opacity: getOpacity(pressed) }], [getOpacity, style]);
|
|
16
|
-
return (React.createElement(NativePressable, { onPress: onPress, onLongPress: onLongPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: _style, ...props }, children));
|
|
17
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Pressable as NativePressable,
|
|
4
|
-
PressableProps,
|
|
5
|
-
PressableStateCallbackType,
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
} from "react-native";
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
style?: ViewStyle;
|
|
14
|
-
onPress?: () => void;
|
|
15
|
-
onLongPress?: () => void;
|
|
16
|
-
delayLongPress?: number;
|
|
17
|
-
hitSlop?: number;
|
|
18
|
-
pressRetentionOffset?: number;
|
|
19
|
-
activeOpacity?: number;
|
|
20
|
-
disabledOpacity?: number;
|
|
21
|
-
} & PressableProps;
|
|
22
|
-
|
|
23
|
-
export type StyleType = (
|
|
24
|
-
state: PressableStateCallbackType
|
|
25
|
-
) => StyleProp<ViewStyle>;
|
|
26
|
-
|
|
27
|
-
export default function Pressable({
|
|
28
|
-
children,
|
|
29
|
-
disabled,
|
|
30
|
-
onPress,
|
|
31
|
-
onLongPress,
|
|
32
|
-
hitSlop,
|
|
33
|
-
delayLongPress,
|
|
34
|
-
activeOpacity,
|
|
35
|
-
disabledOpacity,
|
|
36
|
-
style,
|
|
37
|
-
...props
|
|
38
|
-
}: Props) {
|
|
39
|
-
const getOpacity = useCallback(
|
|
40
|
-
(pressed: boolean) => {
|
|
41
|
-
if (disabled) {
|
|
42
|
-
return disabledOpacity;
|
|
43
|
-
} else {
|
|
44
|
-
if (pressed) return activeOpacity;
|
|
45
|
-
else return 1;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
[activeOpacity, disabled, disabledOpacity]
|
|
49
|
-
);
|
|
50
|
-
const _style = useCallback<StyleType>(
|
|
51
|
-
({ pressed }) => [style as ViewStyle, { opacity: getOpacity(pressed) }],
|
|
52
|
-
[getOpacity, style]
|
|
53
|
-
);
|
|
54
|
-
return (
|
|
55
|
-
<NativePressable
|
|
56
|
-
onPress={onPress}
|
|
57
|
-
onLongPress={onLongPress}
|
|
58
|
-
disabled={disabled}
|
|
59
|
-
delayLongPress={delayLongPress ? delayLongPress : 500}
|
|
60
|
-
hitSlop={hitSlop ? hitSlop : 8}
|
|
61
|
-
style={_style}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
</NativePressable>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, createNumberProp, StylesPanelSections, GROUPS, } from "@draftbit/types";
|
|
2
|
-
const SEED_DATA_PROPS = {
|
|
3
|
-
stylesPanelSections: [
|
|
4
|
-
StylesPanelSections.Size,
|
|
5
|
-
StylesPanelSections.Margins,
|
|
6
|
-
StylesPanelSections.Borders,
|
|
7
|
-
],
|
|
8
|
-
layout: {},
|
|
9
|
-
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
10
|
-
props: {
|
|
11
|
-
onPress: createActionProp(),
|
|
12
|
-
onLongPress: createActionProp(),
|
|
13
|
-
activeOpacity: createNumberProp({
|
|
14
|
-
label: "Active Opacity",
|
|
15
|
-
description: "The opacity when the button is pressed.",
|
|
16
|
-
defaultValue: 0.8,
|
|
17
|
-
group: GROUPS.basic,
|
|
18
|
-
}),
|
|
19
|
-
disabledOpacity: createNumberProp({
|
|
20
|
-
label: "Disabled Opacity",
|
|
21
|
-
description: "The opacity when the button is disabled.",
|
|
22
|
-
defaultValue: 0.8,
|
|
23
|
-
group: GROUPS.basic,
|
|
24
|
-
}),
|
|
25
|
-
delayLongPress: createNumberProp({
|
|
26
|
-
label: "Delay Long Press",
|
|
27
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
28
|
-
group: GROUPS.basic,
|
|
29
|
-
}),
|
|
30
|
-
hitSlop: createNumberProp({
|
|
31
|
-
label: "Hit Slop",
|
|
32
|
-
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
33
|
-
group: GROUPS.basic,
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
export const SEED_DATA = [
|
|
38
|
-
{
|
|
39
|
-
name: "Touchable",
|
|
40
|
-
tag: "Touchable",
|
|
41
|
-
description: "An interactive view with no styles",
|
|
42
|
-
category: COMPONENT_TYPES.button,
|
|
43
|
-
...SEED_DATA_PROPS,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: "Pressable",
|
|
47
|
-
tag: "Pressable",
|
|
48
|
-
description: "An interactive view with no styles",
|
|
49
|
-
category: COMPONENT_TYPES.deprecated,
|
|
50
|
-
...SEED_DATA_PROPS,
|
|
51
|
-
},
|
|
52
|
-
];
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMPONENT_TYPES,
|
|
3
|
-
createActionProp,
|
|
4
|
-
Triggers,
|
|
5
|
-
createNumberProp,
|
|
6
|
-
StylesPanelSections,
|
|
7
|
-
GROUPS,
|
|
8
|
-
} from "@draftbit/types";
|
|
9
|
-
|
|
10
|
-
const SEED_DATA_PROPS = {
|
|
11
|
-
stylesPanelSections: [
|
|
12
|
-
StylesPanelSections.Size,
|
|
13
|
-
StylesPanelSections.Margins,
|
|
14
|
-
StylesPanelSections.Borders,
|
|
15
|
-
],
|
|
16
|
-
layout: {},
|
|
17
|
-
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
18
|
-
props: {
|
|
19
|
-
onPress: createActionProp(),
|
|
20
|
-
onLongPress: createActionProp(),
|
|
21
|
-
activeOpacity: createNumberProp({
|
|
22
|
-
label: "Active Opacity",
|
|
23
|
-
description: "The opacity when the button is pressed.",
|
|
24
|
-
defaultValue: 0.8,
|
|
25
|
-
group: GROUPS.basic,
|
|
26
|
-
}),
|
|
27
|
-
disabledOpacity: createNumberProp({
|
|
28
|
-
label: "Disabled Opacity",
|
|
29
|
-
description: "The opacity when the button is disabled.",
|
|
30
|
-
defaultValue: 0.8,
|
|
31
|
-
group: GROUPS.basic,
|
|
32
|
-
}),
|
|
33
|
-
delayLongPress: createNumberProp({
|
|
34
|
-
label: "Delay Long Press",
|
|
35
|
-
description:
|
|
36
|
-
"Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
37
|
-
group: GROUPS.basic,
|
|
38
|
-
}),
|
|
39
|
-
hitSlop: createNumberProp({
|
|
40
|
-
label: "Hit Slop",
|
|
41
|
-
description:
|
|
42
|
-
"Sets additional distance outside of element in which a press can be detected.",
|
|
43
|
-
group: GROUPS.basic,
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const SEED_DATA = [
|
|
49
|
-
{
|
|
50
|
-
name: "Touchable",
|
|
51
|
-
tag: "Touchable",
|
|
52
|
-
description: "An interactive view with no styles",
|
|
53
|
-
category: COMPONENT_TYPES.button,
|
|
54
|
-
...SEED_DATA_PROPS,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "Pressable",
|
|
58
|
-
tag: "Pressable",
|
|
59
|
-
description: "An interactive view with no styles",
|
|
60
|
-
category: COMPONENT_TYPES.deprecated,
|
|
61
|
-
...SEED_DATA_PROPS,
|
|
62
|
-
},
|
|
63
|
-
];
|