@draftbit/core 47.0.1-54c307.2 → 47.0.1-cc5ccc.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 +27 -15
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/DeprecatedFAB.js +1 -2
- package/lib/commonjs/components/Picker/Picker.js +3 -4
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Pressable.js +48 -0
- package/lib/commonjs/components/Touchable.js +27 -11
- package/lib/commonjs/mappings/Button.js +13 -10
- package/lib/commonjs/mappings/Pressable.js +52 -0
- package/lib/module/components/Button.js +21 -9
- package/lib/module/components/Checkbox/Checkbox.js +2 -3
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/DeprecatedFAB.js +2 -3
- package/lib/module/components/Picker/Picker.js +3 -4
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Pressable.js +40 -0
- package/lib/module/components/Touchable.js +25 -10
- package/lib/module/mappings/Button.js +14 -11
- package/lib/module/mappings/Pressable.js +45 -0
- package/lib/typescript/src/components/Button.d.ts +2 -0
- 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/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/Pressable.d.ts +18 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable.d.ts +9 -2
- package/lib/typescript/src/components/Touchable.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/Pressable.d.ts +76 -0
- package/lib/typescript/src/mappings/Pressable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Button.js +18 -11
- package/src/components/Button.tsx +45 -11
- package/src/components/Checkbox/Checkbox.js +2 -3
- package/src/components/Checkbox/Checkbox.tsx +5 -7
- package/src/components/DatePicker/DatePicker.js +1 -1
- package/src/components/DatePicker/DatePicker.tsx +1 -1
- package/src/components/DeprecatedCardWrapper.js +2 -2
- package/src/components/DeprecatedCardWrapper.tsx +3 -4
- package/src/components/DeprecatedFAB.js +2 -3
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Picker/Picker.js +3 -4
- 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/Pressable.js +17 -0
- package/src/components/Pressable.tsx +67 -0
- package/src/components/Touchable.js +16 -11
- package/src/components/Touchable.tsx +42 -11
- package/src/mappings/Button.js +13 -10
- package/src/mappings/Button.ts +13 -10
- package/src/mappings/Pressable.js +52 -0
- package/src/mappings/Pressable.ts +63 -0
- package/lib/commonjs/components/DeprecatedButton.js +0 -151
- package/lib/commonjs/components/Touchable.web.js +0 -9
- package/lib/commonjs/mappings/Touchable.js +0 -20
- package/lib/module/components/DeprecatedButton.js +0 -141
- package/lib/module/components/Touchable.web.js +0 -2
- package/lib/module/mappings/Touchable.js +0 -13
- package/lib/typescript/src/components/DeprecatedButton.d.ts +0 -54
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +0 -1
- package/lib/typescript/src/components/Touchable.web.d.ts +0 -3
- package/lib/typescript/src/components/Touchable.web.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +0 -22
- package/lib/typescript/src/mappings/Touchable.d.ts.map +0 -1
- package/src/components/DeprecatedButton.js +0 -95
- package/src/components/DeprecatedButton.tsx +0 -214
- package/src/components/Touchable.web.js +0 -2
- package/src/components/Touchable.web.tsx +0 -3
- package/src/mappings/Touchable.js +0 -17
- package/src/mappings/Touchable.ts +0 -23
|
@@ -1,25 +1,40 @@
|
|
|
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
|
-
import React from "react";
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
3
|
import { Pressable } from "react-native";
|
|
4
4
|
export default function Touchable(_ref) {
|
|
5
5
|
let {
|
|
6
6
|
children,
|
|
7
7
|
disabled,
|
|
8
8
|
onPress,
|
|
9
|
+
onLongPress,
|
|
10
|
+
hitSlop,
|
|
11
|
+
delayLongPress,
|
|
12
|
+
activeOpacity,
|
|
13
|
+
disabledOpacity,
|
|
9
14
|
style,
|
|
10
15
|
...props
|
|
11
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]);
|
|
12
32
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
13
33
|
onPress: onPress,
|
|
34
|
+
onLongPress: onLongPress,
|
|
14
35
|
disabled: disabled,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
pressed
|
|
19
|
-
} = _ref2;
|
|
20
|
-
return [{
|
|
21
|
-
opacity: pressed || disabled ? 0.75 : 1
|
|
22
|
-
}, style];
|
|
23
|
-
}
|
|
36
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
37
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
38
|
+
style: _style
|
|
24
39
|
}, props), children);
|
|
25
40
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
|
|
2
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnPress];
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections, createNumberProp } from "@draftbit/types";
|
|
2
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnPress, Triggers.OnLongPress];
|
|
3
3
|
const SEED_DATA_PROPS = {
|
|
4
4
|
onPress: createActionProp(),
|
|
5
|
+
onLongPress: createActionProp(),
|
|
5
6
|
icon: createIconProp({
|
|
6
7
|
defaultValue: null,
|
|
7
8
|
required: false
|
|
@@ -12,12 +13,11 @@ const SEED_DATA_PROPS = {
|
|
|
12
13
|
defaultValue: "Get Started"
|
|
13
14
|
}),
|
|
14
15
|
disabled: createDisabledProp(),
|
|
15
|
-
loading: createLoadingProp()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fontFamily: "system-700"
|
|
16
|
+
loading: createLoadingProp(),
|
|
17
|
+
activeOpacity: createNumberProp(),
|
|
18
|
+
disabledOpacity: createNumberProp(),
|
|
19
|
+
delayLongPress: createNumberProp(),
|
|
20
|
+
hitSlop: createNumberProp()
|
|
21
21
|
};
|
|
22
22
|
export const SEED_DATA = [{
|
|
23
23
|
name: "Button Outline",
|
|
@@ -25,8 +25,9 @@ export const SEED_DATA = [{
|
|
|
25
25
|
category: COMPONENT_TYPES.deprecated,
|
|
26
26
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
27
27
|
layout: {
|
|
28
|
-
...LAYOUT,
|
|
29
28
|
backgroundColor: "transparent",
|
|
29
|
+
borderRadius: 8,
|
|
30
|
+
fontFamily: "system-700",
|
|
30
31
|
borderWidth: 1,
|
|
31
32
|
textAlign: "center"
|
|
32
33
|
},
|
|
@@ -38,7 +39,8 @@ export const SEED_DATA = [{
|
|
|
38
39
|
category: COMPONENT_TYPES.deprecated,
|
|
39
40
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
40
41
|
layout: {
|
|
41
|
-
|
|
42
|
+
borderRadius: 8,
|
|
43
|
+
fontFamily: "system-700",
|
|
42
44
|
backgroundColor: "primary",
|
|
43
45
|
textAlign: "center"
|
|
44
46
|
},
|
|
@@ -50,7 +52,8 @@ export const SEED_DATA = [{
|
|
|
50
52
|
category: COMPONENT_TYPES.button,
|
|
51
53
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
52
54
|
layout: {
|
|
53
|
-
|
|
55
|
+
borderRadius: 8,
|
|
56
|
+
fontFamily: "system-700",
|
|
54
57
|
backgroundColor: "primary",
|
|
55
58
|
textAlign: "center"
|
|
56
59
|
},
|
|
@@ -0,0 +1,45 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,0BAA0B,EAG1B,SAAS,EAET,SAAS,EAEV,MAAM,cAAc,CAAC;AA+CtB,oBAAY,SAAS,GAAG,CACtB,KAAK,EAAE,0BAA0B,KAC9B,SAAS,CAAC,SAAS,CAAC,CAAC;AA+G1B,QAAA,MAAM,WAAW,EAAE,GAAsB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,QAAA,MAAM,MAAM,EAAE,GAAsB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,CAAC;AAmBlB,QAAA,MAAM,aAAa,EAAE,GAAwB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle, PressableProps } from "react-native";
|
|
3
3
|
import type { IconSlot } from "../../interfaces/Icon";
|
|
4
4
|
export interface CheckboxProps {
|
|
5
5
|
status?: boolean;
|
|
@@ -15,6 +15,6 @@ export interface CheckboxProps {
|
|
|
15
15
|
size?: number;
|
|
16
16
|
style?: StyleProp<ViewStyle>;
|
|
17
17
|
}
|
|
18
|
-
declare const Checkbox: React.FC<CheckboxProps &
|
|
18
|
+
declare const Checkbox: React.FC<CheckboxProps & PressableProps & IconSlot>;
|
|
19
19
|
export default Checkbox;
|
|
20
20
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EACT,SAAS,EAET,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,GAAG,cAAc,GAAG,QAAQ,CAoFjE,CAAC;AAqBF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeprecatedCardWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DeprecatedCardWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DeprecatedCardWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/DeprecatedCardWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,MAAM,wBAAwB,CAAC;AAE3C,aAAK,KAAK,GAAG;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB,CAAC;;;;AAiCF,wBAA+B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle, PressableProps } from "react-native";
|
|
3
3
|
import type { Theme } from "../styles/DefaultTheme";
|
|
4
4
|
import type { IconSlot } from "../interfaces/Icon";
|
|
5
5
|
/**
|
|
@@ -48,7 +48,7 @@ declare type Props = {
|
|
|
48
48
|
elevation?: number;
|
|
49
49
|
theme: Theme;
|
|
50
50
|
style?: StyleProp<ViewStyle>;
|
|
51
|
-
} &
|
|
51
|
+
} & PressableProps & IconSlot;
|
|
52
52
|
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
53
53
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
54
54
|
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeprecatedFAB.d.ts","sourceRoot":"","sources":["../../../../src/components/DeprecatedFAB.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,
|
|
1
|
+
{"version":3,"file":"DeprecatedFAB.d.ts","sourceRoot":"","sources":["../../../../src/components/DeprecatedFAB.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EAGT,cAAc,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,aAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,cAAc,GAChB,QAAQ,CAAC;;;;AAkKX,wBAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,
|
|
1
|
+
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAGV,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AA2aF,wBAAiC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,11 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { PressableProps, PressableStateCallbackType, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
style?: ViewStyle;
|
|
7
7
|
onPress?: () => void;
|
|
8
|
+
onLongPress?: () => void;
|
|
9
|
+
delayLongPress?: number;
|
|
10
|
+
hitSlop?: number;
|
|
11
|
+
pressRetentionOffset?: number;
|
|
12
|
+
activeOpacity?: number;
|
|
13
|
+
disabledOpacity?: number;
|
|
8
14
|
} & PressableProps;
|
|
9
|
-
export
|
|
15
|
+
export declare type StyleType = (state: PressableStateCallbackType) => StyleProp<ViewStyle>;
|
|
16
|
+
export default function Touchable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }: Props): JSX.Element;
|
|
10
17
|
export {};
|
|
11
18
|
//# sourceMappingURL=Touchable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.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"}
|
|
@@ -5,10 +5,10 @@ export declare const SEED_DATA: ({
|
|
|
5
5
|
stylesPanelSections: string[];
|
|
6
6
|
layout: {
|
|
7
7
|
backgroundColor: string;
|
|
8
|
-
borderWidth: number;
|
|
9
|
-
textAlign: string;
|
|
10
8
|
borderRadius: number;
|
|
11
9
|
fontFamily: string;
|
|
10
|
+
borderWidth: number;
|
|
11
|
+
textAlign: string;
|
|
12
12
|
};
|
|
13
13
|
triggers: string[];
|
|
14
14
|
props: {
|
|
@@ -22,6 +22,16 @@ export declare const SEED_DATA: ({
|
|
|
22
22
|
defaultValue: null;
|
|
23
23
|
group: string;
|
|
24
24
|
};
|
|
25
|
+
onLongPress: {
|
|
26
|
+
label: string;
|
|
27
|
+
description: string;
|
|
28
|
+
editable: boolean;
|
|
29
|
+
required: boolean;
|
|
30
|
+
formType: string;
|
|
31
|
+
propType: string;
|
|
32
|
+
defaultValue: null;
|
|
33
|
+
group: string;
|
|
34
|
+
};
|
|
25
35
|
icon: {
|
|
26
36
|
label: string;
|
|
27
37
|
description: string;
|
|
@@ -53,6 +63,50 @@ export declare const SEED_DATA: ({
|
|
|
53
63
|
propType: string;
|
|
54
64
|
defaultValue: null;
|
|
55
65
|
};
|
|
66
|
+
activeOpacity: {
|
|
67
|
+
label: string;
|
|
68
|
+
description: string;
|
|
69
|
+
formType: string;
|
|
70
|
+
propType: string;
|
|
71
|
+
group: string;
|
|
72
|
+
defaultValue: null;
|
|
73
|
+
editable: boolean;
|
|
74
|
+
required: boolean;
|
|
75
|
+
step: number;
|
|
76
|
+
};
|
|
77
|
+
disabledOpacity: {
|
|
78
|
+
label: string;
|
|
79
|
+
description: string;
|
|
80
|
+
formType: string;
|
|
81
|
+
propType: string;
|
|
82
|
+
group: string;
|
|
83
|
+
defaultValue: null;
|
|
84
|
+
editable: boolean;
|
|
85
|
+
required: boolean;
|
|
86
|
+
step: number;
|
|
87
|
+
};
|
|
88
|
+
delayLongPress: {
|
|
89
|
+
label: string;
|
|
90
|
+
description: string;
|
|
91
|
+
formType: string;
|
|
92
|
+
propType: string;
|
|
93
|
+
group: string;
|
|
94
|
+
defaultValue: null;
|
|
95
|
+
editable: boolean;
|
|
96
|
+
required: boolean;
|
|
97
|
+
step: number;
|
|
98
|
+
};
|
|
99
|
+
hitSlop: {
|
|
100
|
+
label: string;
|
|
101
|
+
description: string;
|
|
102
|
+
formType: string;
|
|
103
|
+
propType: string;
|
|
104
|
+
group: string;
|
|
105
|
+
defaultValue: null;
|
|
106
|
+
editable: boolean;
|
|
107
|
+
required: boolean;
|
|
108
|
+
step: number;
|
|
109
|
+
};
|
|
56
110
|
};
|
|
57
111
|
} | {
|
|
58
112
|
name: string;
|
|
@@ -60,10 +114,11 @@ export declare const SEED_DATA: ({
|
|
|
60
114
|
category: string;
|
|
61
115
|
stylesPanelSections: string[];
|
|
62
116
|
layout: {
|
|
63
|
-
backgroundColor: string;
|
|
64
|
-
textAlign: string;
|
|
65
117
|
borderRadius: number;
|
|
66
118
|
fontFamily: string;
|
|
119
|
+
backgroundColor: string;
|
|
120
|
+
textAlign: string;
|
|
121
|
+
borderWidth?: undefined;
|
|
67
122
|
};
|
|
68
123
|
triggers: string[];
|
|
69
124
|
props: {
|
|
@@ -77,6 +132,16 @@ export declare const SEED_DATA: ({
|
|
|
77
132
|
defaultValue: null;
|
|
78
133
|
group: string;
|
|
79
134
|
};
|
|
135
|
+
onLongPress: {
|
|
136
|
+
label: string;
|
|
137
|
+
description: string;
|
|
138
|
+
editable: boolean;
|
|
139
|
+
required: boolean;
|
|
140
|
+
formType: string;
|
|
141
|
+
propType: string;
|
|
142
|
+
defaultValue: null;
|
|
143
|
+
group: string;
|
|
144
|
+
};
|
|
80
145
|
icon: {
|
|
81
146
|
label: string;
|
|
82
147
|
description: string;
|
|
@@ -108,6 +173,50 @@ export declare const SEED_DATA: ({
|
|
|
108
173
|
propType: string;
|
|
109
174
|
defaultValue: null;
|
|
110
175
|
};
|
|
176
|
+
activeOpacity: {
|
|
177
|
+
label: string;
|
|
178
|
+
description: string;
|
|
179
|
+
formType: string;
|
|
180
|
+
propType: string;
|
|
181
|
+
group: string;
|
|
182
|
+
defaultValue: null;
|
|
183
|
+
editable: boolean;
|
|
184
|
+
required: boolean;
|
|
185
|
+
step: number;
|
|
186
|
+
};
|
|
187
|
+
disabledOpacity: {
|
|
188
|
+
label: string;
|
|
189
|
+
description: string;
|
|
190
|
+
formType: string;
|
|
191
|
+
propType: string;
|
|
192
|
+
group: string;
|
|
193
|
+
defaultValue: null;
|
|
194
|
+
editable: boolean;
|
|
195
|
+
required: boolean;
|
|
196
|
+
step: number;
|
|
197
|
+
};
|
|
198
|
+
delayLongPress: {
|
|
199
|
+
label: string;
|
|
200
|
+
description: string;
|
|
201
|
+
formType: string;
|
|
202
|
+
propType: string;
|
|
203
|
+
group: string;
|
|
204
|
+
defaultValue: null;
|
|
205
|
+
editable: boolean;
|
|
206
|
+
required: boolean;
|
|
207
|
+
step: number;
|
|
208
|
+
};
|
|
209
|
+
hitSlop: {
|
|
210
|
+
label: string;
|
|
211
|
+
description: string;
|
|
212
|
+
formType: string;
|
|
213
|
+
propType: string;
|
|
214
|
+
group: string;
|
|
215
|
+
defaultValue: null;
|
|
216
|
+
editable: boolean;
|
|
217
|
+
required: boolean;
|
|
218
|
+
step: number;
|
|
219
|
+
};
|
|
111
220
|
};
|
|
112
221
|
})[];
|
|
113
222
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Button.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Button.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoErB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Pressable.ts"],"names":[],"mappings":"AA+CA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "47.0.1-
|
|
3
|
+
"version": "47.0.1-cc5ccc.2+cc5ccc0",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^47.0.1-
|
|
44
|
+
"@draftbit/types": "^47.0.1-cc5ccc.2+cc5ccc0",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "cc5ccc0cb02f87cb9672ab134b665d254375c75f"
|
|
95
95
|
}
|
package/src/components/Button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
2
|
import { Text, Pressable, Platform, StyleSheet, ActivityIndicator, } from "react-native";
|
|
3
3
|
import { withTheme } from "../theming";
|
|
4
4
|
const CONSTANTS = {
|
|
@@ -7,7 +7,7 @@ const CONSTANTS = {
|
|
|
7
7
|
padding: 8,
|
|
8
8
|
icon: 24,
|
|
9
9
|
};
|
|
10
|
-
function Base({ Icon, icon, title, onPress, loading, disabled, style, ...props }) {
|
|
10
|
+
function Base({ Icon, icon, title, onPress, onLongPress, activeOpacity, disabledOpacity, loading, disabled, style, ...props }) {
|
|
11
11
|
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...buttonStyles } = StyleSheet.flatten(style || {});
|
|
12
12
|
const titleStyles = {
|
|
13
13
|
color,
|
|
@@ -28,15 +28,22 @@ function Base({ Icon, icon, title, onPress, loading, disabled, style, ...props }
|
|
|
28
28
|
if (textAlign === "right") {
|
|
29
29
|
buttonStyles.justifyContent = "flex-end";
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
const getOpacity = useCallback((pressed) => {
|
|
32
|
+
if (disabled) {
|
|
33
|
+
return disabledOpacity;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (pressed)
|
|
37
|
+
return activeOpacity;
|
|
38
|
+
else
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
}, [activeOpacity, disabled, disabledOpacity]);
|
|
42
|
+
const _style = useCallback(({ pressed }) => [
|
|
43
|
+
buttonStyles,
|
|
44
|
+
{ opacity: getOpacity(pressed) },
|
|
45
|
+
], [getOpacity, buttonStyles]);
|
|
46
|
+
return (React.createElement(Pressable, { onPress: onPress, onLongPress: onLongPress, disabled: disabled || loading, style: (styles.base, _style), ...props },
|
|
40
47
|
loading ? (React.createElement(ActivityIndicator, { size: "small", color: color, style: styles.loading })) : null,
|
|
41
48
|
icon && !loading ? (React.createElement(Icon, { name: icon, color: color, style: styles.icon, size: CONSTANTS.icon })) : null,
|
|
42
49
|
React.createElement(Text, { style: titleStyles }, title)));
|