@draftbit/core 47.0.1-cc5ccc.2 → 47.0.1-ed6e56.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/DatePicker/DatePicker.js +1 -0
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +3 -9
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePickerInput.js +133 -0
- 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 -13
- 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/DatePicker/DatePicker.js +1 -0
- package/lib/module/components/DatePicker/DatePickerComponent.js +3 -9
- package/lib/module/components/DatePicker/DatePickerComponent.web.js +0 -1
- package/lib/module/components/DatePicker/DatePickerInput.js +123 -0
- 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 -14
- 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/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -0
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts +18 -0
- package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts.map +1 -0
- 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/Touchable.d.ts +22 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
- package/package.json +6 -6
- 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/DatePicker/DatePicker.js +1 -1
- package/src/components/DatePicker/DatePicker.tsx +1 -0
- package/src/components/DatePicker/DatePickerComponent.js +3 -5
- package/src/components/DatePicker/DatePickerComponent.tsx +3 -11
- package/src/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +0 -1
- package/src/components/DatePicker/DatePickerComponentType.ts +9 -0
- package/src/components/DatePicker/DatePickerInput.js +97 -0
- package/src/components/DatePicker/DatePickerInput.tsx +195 -0
- 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 -13
- package/src/mappings/Button.ts +10 -13
- 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,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
|
-
];
|