@draftbit/core 47.0.1-cc5ccc.2 → 47.0.1-d41acb.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 +17 -29
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
- package/lib/commonjs/components/DeprecatedButton.js +127 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/Picker/Picker.js +4 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Pressable.js +12 -23
- package/lib/commonjs/components/Touchable.js +13 -24
- package/lib/commonjs/components/Touchable.web.js +9 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Button.js +31 -5
- package/lib/commonjs/mappings/{Pressable.js → Touchable.js} +18 -10
- package/lib/module/components/Button.js +11 -23
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
- package/lib/module/components/DeprecatedButton.js +117 -0
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/Picker/Picker.js +4 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Pressable.js +11 -21
- package/lib/module/components/Touchable.js +12 -22
- package/lib/module/components/Touchable.web.js +2 -0
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Button.js +32 -6
- package/lib/module/mappings/{Pressable.js → Touchable.js} +19 -11
- 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 +1 -1
- 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 +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/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts +2 -4
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +2 -4
- 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/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +1 -1
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/{Pressable.d.ts → Touchable.d.ts} +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Button.js +11 -18
- package/src/components/Button.tsx +12 -36
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- 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 +83 -0
- package/src/components/DeprecatedButton.tsx +190 -0
- package/src/components/DeprecatedCardWrapper.js +2 -2
- package/src/components/DeprecatedCardWrapper.tsx +4 -3
- 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/Pressable.js +10 -15
- package/src/components/Pressable.tsx +11 -28
- package/src/components/Touchable.js +11 -16
- package/src/components/Touchable.tsx +13 -34
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Touchable.web.tsx +3 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Button.js +32 -6
- package/src/mappings/Button.ts +34 -6
- package/src/mappings/{Pressable.js → Touchable.js} +19 -11
- package/src/mappings/{Pressable.ts → Touchable.ts} +19 -12
- package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
|
@@ -1,11 +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 { StyleSheet, View, Platform } from "react-native";
|
|
3
|
+
import { StyleSheet, View, Platform, Pressable } 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";
|
|
9
8
|
import Checkbox from "./Checkbox";
|
|
10
9
|
export let Direction;
|
|
11
10
|
(function (Direction) {
|
|
@@ -73,7 +72,7 @@ const CheckboxRow = _ref => {
|
|
|
73
72
|
textStyles,
|
|
74
73
|
viewStyles
|
|
75
74
|
} = extractStyles(style);
|
|
76
|
-
return /*#__PURE__*/React.createElement(
|
|
75
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
77
76
|
onPress: handlePress,
|
|
78
77
|
style: [viewStyles, styles.mainParent, {
|
|
79
78
|
flexDirection: direction
|
|
@@ -0,0 +1,117 @@
|
|
|
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 * as React from "react";
|
|
3
|
+
import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
|
|
4
|
+
import color from "color";
|
|
5
|
+
import Config from "./Config";
|
|
6
|
+
import Elevation from "./Elevation";
|
|
7
|
+
import { withTheme } from "../theming";
|
|
8
|
+
const Button = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
Icon,
|
|
11
|
+
icon,
|
|
12
|
+
disabled = false,
|
|
13
|
+
type = "solid",
|
|
14
|
+
loading = false,
|
|
15
|
+
labelColor,
|
|
16
|
+
color: colorOverride,
|
|
17
|
+
children,
|
|
18
|
+
onPress,
|
|
19
|
+
elevation = 0,
|
|
20
|
+
theme: {
|
|
21
|
+
colors,
|
|
22
|
+
disabledOpacity,
|
|
23
|
+
roundness,
|
|
24
|
+
typography
|
|
25
|
+
},
|
|
26
|
+
...rest
|
|
27
|
+
} = _ref;
|
|
28
|
+
let backgroundColor, borderColor, textColor, borderWidth;
|
|
29
|
+
const buttonColor = colorOverride || colors.primary;
|
|
30
|
+
if (type === "solid") {
|
|
31
|
+
backgroundColor = buttonColor;
|
|
32
|
+
if (disabled) {
|
|
33
|
+
textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
34
|
+
} else {
|
|
35
|
+
textColor = labelColor || colors.surface;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
backgroundColor = "transparent";
|
|
39
|
+
if (disabled) {
|
|
40
|
+
textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
41
|
+
} else {
|
|
42
|
+
textColor = labelColor || buttonColor;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (type === "outline") {
|
|
46
|
+
if (disabled) {
|
|
47
|
+
borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
48
|
+
} else {
|
|
49
|
+
borderColor = buttonColor;
|
|
50
|
+
}
|
|
51
|
+
borderWidth = StyleSheet.hairlineWidth;
|
|
52
|
+
} else {
|
|
53
|
+
borderColor = "transparent";
|
|
54
|
+
borderWidth = 0;
|
|
55
|
+
}
|
|
56
|
+
const buttonStyle = {
|
|
57
|
+
backgroundColor,
|
|
58
|
+
borderColor,
|
|
59
|
+
borderWidth,
|
|
60
|
+
borderRadius: roundness
|
|
61
|
+
};
|
|
62
|
+
const textStyle = {
|
|
63
|
+
textAlign: "center",
|
|
64
|
+
color: textColor,
|
|
65
|
+
marginVertical: 16,
|
|
66
|
+
marginHorizontal: 16
|
|
67
|
+
};
|
|
68
|
+
const iconStyle = [styles.icon, {
|
|
69
|
+
marginLeft: 16,
|
|
70
|
+
marginRight: -8,
|
|
71
|
+
width: Config.buttonIconSize
|
|
72
|
+
}];
|
|
73
|
+
return /*#__PURE__*/React.createElement(Elevation, {
|
|
74
|
+
style: {
|
|
75
|
+
elevation,
|
|
76
|
+
alignSelf: "stretch"
|
|
77
|
+
}
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
79
|
+
onPress: onPress,
|
|
80
|
+
accessibilityState: {
|
|
81
|
+
disabled
|
|
82
|
+
},
|
|
83
|
+
accessibilityRole: "button",
|
|
84
|
+
disabled: disabled || loading,
|
|
85
|
+
style: [styles.button, buttonStyle]
|
|
86
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
style: styles.content
|
|
88
|
+
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
89
|
+
style: iconStyle
|
|
90
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
91
|
+
name: icon,
|
|
92
|
+
size: Config.buttonIconSize,
|
|
93
|
+
color: textColor
|
|
94
|
+
})) : null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
95
|
+
size: "small",
|
|
96
|
+
color: textColor,
|
|
97
|
+
style: iconStyle
|
|
98
|
+
}) : null, /*#__PURE__*/React.createElement(Text, {
|
|
99
|
+
numberOfLines: 1,
|
|
100
|
+
style: [textStyle, typography.button]
|
|
101
|
+
}, children))));
|
|
102
|
+
};
|
|
103
|
+
const styles = StyleSheet.create({
|
|
104
|
+
button: {
|
|
105
|
+
minWidth: 64,
|
|
106
|
+
borderStyle: "solid"
|
|
107
|
+
},
|
|
108
|
+
content: {
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "center"
|
|
112
|
+
},
|
|
113
|
+
icon: {
|
|
114
|
+
width: Config.buttonIconSize
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export default withTheme(Button);
|
|
@@ -1,7 +1,7 @@
|
|
|
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 React from "react";
|
|
3
3
|
import { withTheme } from "../theming";
|
|
4
|
-
import
|
|
4
|
+
import Touchable from "./Touchable";
|
|
5
5
|
const getWidth = numColumns => {
|
|
6
6
|
switch (numColumns) {
|
|
7
7
|
case 1:
|
|
@@ -21,7 +21,7 @@ const Card = _ref => {
|
|
|
21
21
|
...rest
|
|
22
22
|
} = _ref;
|
|
23
23
|
const width = getWidth(numColumns);
|
|
24
|
-
return /*#__PURE__*/React.createElement(
|
|
24
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
25
25
|
disabled: !onPress,
|
|
26
26
|
onPress: onPress,
|
|
27
27
|
style: [style, {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet, Text, Platform, Dimensions
|
|
2
|
+
import { View, StyleSheet, Text, Platform, Dimensions } from "react-native";
|
|
3
3
|
import { omit, pickBy, identity, isObject } from "lodash";
|
|
4
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
5
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
6
6
|
import { withTheme } from "../../theming";
|
|
7
7
|
import Portal from "../Portal/Portal";
|
|
8
|
-
import
|
|
8
|
+
import Button from "../DeprecatedButton";
|
|
9
|
+
import Touchable from "../Touchable";
|
|
9
10
|
import { extractStyles, extractBorderAndMarginStyles, borderStyleNames, marginStyleNames } from "../../utilities";
|
|
10
11
|
function normalizeOptions(options) {
|
|
11
12
|
if (options.length === 0) {
|
|
@@ -197,7 +198,7 @@ const Picker = _ref => {
|
|
|
197
198
|
/* marginsContainer */
|
|
198
199
|
React.createElement(View, {
|
|
199
200
|
style: [styles.marginsContainer, marginStyles]
|
|
200
|
-
}, /*#__PURE__*/React.createElement(
|
|
201
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
201
202
|
disabled: disabled,
|
|
202
203
|
onPress: togglePickerVisible,
|
|
203
204
|
style: styles.touchableContainer
|
|
@@ -6,7 +6,7 @@ import omit from "lodash.omit";
|
|
|
6
6
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
7
7
|
import { withTheme } from "../../theming";
|
|
8
8
|
import Portal from "../Portal/Portal";
|
|
9
|
-
import
|
|
9
|
+
import Button from "../DeprecatedButton";
|
|
10
10
|
import TextField from "../TextField";
|
|
11
11
|
import Touchable from "../Touchable";
|
|
12
12
|
import { extractStyles } from "../../utilities";
|
|
@@ -1,40 +1,30 @@
|
|
|
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
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { Pressable as NativePressable } from "react-native";
|
|
4
4
|
export default function Pressable(_ref) {
|
|
5
5
|
let {
|
|
6
6
|
children,
|
|
7
7
|
disabled,
|
|
8
8
|
onPress,
|
|
9
|
-
onLongPress,
|
|
10
|
-
hitSlop,
|
|
11
|
-
delayLongPress,
|
|
12
9
|
activeOpacity,
|
|
13
10
|
disabledOpacity,
|
|
11
|
+
delayLongPress,
|
|
12
|
+
hitSlop,
|
|
14
13
|
style,
|
|
15
14
|
...props
|
|
16
15
|
} = _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
16
|
return /*#__PURE__*/React.createElement(NativePressable, _extends({
|
|
33
17
|
onPress: onPress,
|
|
34
|
-
onLongPress: onLongPress,
|
|
35
18
|
disabled: disabled,
|
|
36
19
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
37
20
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
38
|
-
style:
|
|
21
|
+
style: _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
pressed
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return [{
|
|
26
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
27
|
+
}, style];
|
|
28
|
+
}
|
|
39
29
|
}, props), children);
|
|
40
30
|
}
|
|
@@ -1,40 +1,30 @@
|
|
|
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
|
|
2
|
+
import React 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
9
|
activeOpacity,
|
|
13
10
|
disabledOpacity,
|
|
11
|
+
delayLongPress,
|
|
12
|
+
hitSlop,
|
|
14
13
|
style,
|
|
15
14
|
...props
|
|
16
15
|
} = _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
16
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
33
|
-
onPress: onPress,
|
|
34
|
-
onLongPress: onLongPress,
|
|
35
17
|
disabled: disabled,
|
|
18
|
+
onPress: onPress,
|
|
36
19
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
37
20
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
38
|
-
style:
|
|
21
|
+
style: _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
pressed
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return [{
|
|
26
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
27
|
+
}, style];
|
|
28
|
+
}
|
|
39
29
|
}, props), children);
|
|
40
30
|
}
|
package/lib/module/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export { default as Switch, SwitchRow } from "./components/Switch";
|
|
|
26
26
|
export { default as TextField } from "./components/TextField";
|
|
27
27
|
export { default as ToggleButton } from "./components/ToggleButton";
|
|
28
28
|
export { default as Touchable } from "./components/Touchable";
|
|
29
|
+
export { default as Pressable } from "./components/Pressable";
|
|
29
30
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
30
31
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
|
|
31
32
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections,
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections, createStaticNumberProp } from "@draftbit/types";
|
|
2
2
|
const SEED_DATA_TRIGGERS = [Triggers.OnPress, Triggers.OnLongPress];
|
|
3
3
|
const SEED_DATA_PROPS = {
|
|
4
4
|
onPress: createActionProp(),
|
|
@@ -14,10 +14,36 @@ const SEED_DATA_PROPS = {
|
|
|
14
14
|
}),
|
|
15
15
|
disabled: createDisabledProp(),
|
|
16
16
|
loading: createLoadingProp(),
|
|
17
|
-
activeOpacity:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
activeOpacity: createStaticNumberProp({
|
|
18
|
+
label: "Active Opacity",
|
|
19
|
+
description: "Opacity of the button when active.",
|
|
20
|
+
defaultValue: 0.8,
|
|
21
|
+
min: 0,
|
|
22
|
+
max: 1,
|
|
23
|
+
step: 0.01,
|
|
24
|
+
precision: 2,
|
|
25
|
+
required: false
|
|
26
|
+
}),
|
|
27
|
+
disabledOpacity: createStaticNumberProp({
|
|
28
|
+
label: "Disabled Opacity",
|
|
29
|
+
description: "Opacity of the button when disabled.",
|
|
30
|
+
defaultValue: 0.8,
|
|
31
|
+
min: 0,
|
|
32
|
+
max: 1,
|
|
33
|
+
step: 0.01,
|
|
34
|
+
precision: 2,
|
|
35
|
+
required: false
|
|
36
|
+
}),
|
|
37
|
+
delayLongPress: createStaticNumberProp({
|
|
38
|
+
label: "Delay Long Press",
|
|
39
|
+
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
40
|
+
required: false
|
|
41
|
+
}),
|
|
42
|
+
hitSlop: createStaticNumberProp({
|
|
43
|
+
label: "Hit Slop",
|
|
44
|
+
description: "Sets additional distance outside of element in which a press can be detected",
|
|
45
|
+
required: false
|
|
46
|
+
})
|
|
21
47
|
};
|
|
22
48
|
export const SEED_DATA = [{
|
|
23
49
|
name: "Button Outline",
|
|
@@ -25,9 +51,9 @@ export const SEED_DATA = [{
|
|
|
25
51
|
category: COMPONENT_TYPES.deprecated,
|
|
26
52
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
27
53
|
layout: {
|
|
28
|
-
backgroundColor: "transparent",
|
|
29
54
|
borderRadius: 8,
|
|
30
55
|
fontFamily: "system-700",
|
|
56
|
+
backgroundColor: "transparent",
|
|
31
57
|
borderWidth: 1,
|
|
32
58
|
textAlign: "center"
|
|
33
59
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers,
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections } from "@draftbit/types";
|
|
2
2
|
const SEED_DATA_PROPS = {
|
|
3
3
|
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Borders],
|
|
4
4
|
layout: {},
|
|
@@ -6,27 +6,35 @@ const SEED_DATA_PROPS = {
|
|
|
6
6
|
props: {
|
|
7
7
|
onPress: createActionProp(),
|
|
8
8
|
onLongPress: createActionProp(),
|
|
9
|
-
activeOpacity:
|
|
9
|
+
activeOpacity: createStaticNumberProp({
|
|
10
10
|
label: "Active Opacity",
|
|
11
11
|
description: "The opacity when the button is pressed.",
|
|
12
12
|
defaultValue: 0.8,
|
|
13
|
-
|
|
13
|
+
min: 0,
|
|
14
|
+
max: 1,
|
|
15
|
+
step: 0.01,
|
|
16
|
+
precision: 2,
|
|
17
|
+
required: false
|
|
14
18
|
}),
|
|
15
|
-
disabledOpacity:
|
|
19
|
+
disabledOpacity: createStaticNumberProp({
|
|
16
20
|
label: "Disabled Opacity",
|
|
17
21
|
description: "The opacity when the button is disabled.",
|
|
18
22
|
defaultValue: 0.8,
|
|
19
|
-
|
|
23
|
+
min: 0,
|
|
24
|
+
max: 1,
|
|
25
|
+
step: 0.01,
|
|
26
|
+
precision: 2,
|
|
27
|
+
required: false
|
|
20
28
|
}),
|
|
21
|
-
delayLongPress:
|
|
29
|
+
delayLongPress: createStaticNumberProp({
|
|
22
30
|
label: "Delay Long Press",
|
|
23
31
|
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
24
|
-
|
|
32
|
+
required: false
|
|
25
33
|
}),
|
|
26
|
-
hitSlop:
|
|
34
|
+
hitSlop: createStaticNumberProp({
|
|
27
35
|
label: "Hit Slop",
|
|
28
36
|
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
29
|
-
|
|
37
|
+
required: false
|
|
30
38
|
})
|
|
31
39
|
}
|
|
32
40
|
};
|
|
@@ -34,12 +42,12 @@ export const SEED_DATA = [{
|
|
|
34
42
|
name: "Touchable",
|
|
35
43
|
tag: "Touchable",
|
|
36
44
|
description: "An interactive view with no styles",
|
|
37
|
-
category: COMPONENT_TYPES.
|
|
45
|
+
category: COMPONENT_TYPES.deprecated,
|
|
38
46
|
...SEED_DATA_PROPS
|
|
39
47
|
}, {
|
|
40
48
|
name: "Pressable",
|
|
41
49
|
tag: "Pressable",
|
|
42
50
|
description: "An interactive view with no styles",
|
|
43
|
-
category: COMPONENT_TYPES.
|
|
51
|
+
category: COMPONENT_TYPES.button,
|
|
44
52
|
...SEED_DATA_PROPS
|
|
45
53
|
}];
|
|
@@ -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":"AAoJA,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 { StyleProp, ViewStyle
|
|
2
|
+
import { PressableProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { IconSlot } from "../../interfaces/Icon";
|
|
4
4
|
export interface CheckboxProps {
|
|
5
5
|
status?: boolean;
|
|
@@ -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,
|
|
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,EAIL,cAAc,EACd,SAAS,EACT,SAAS,EACV,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":"CheckboxGroupRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/CheckboxGroupRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,SAAS,EAET,SAAS,
|
|
1
|
+
{"version":3,"file":"CheckboxGroupRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/CheckboxGroupRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,SAAS,EAET,SAAS,EAIV,MAAM,cAAc,CAAC;AACtB,OAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,UAAU,gBAAgB;CAC3B;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IAC3E,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AA2BD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,GAAG,QAAQ,CAsEhE,CAAC;AAsBF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/CheckboxRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,SAAS,EAET,SAAS,
|
|
1
|
+
{"version":3,"file":"CheckboxRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Checkbox/CheckboxRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,SAAS,EAET,SAAS,EAIV,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,UAAU,gBAAgB;CAC3B;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAcD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,GAAG,QAAQ,CA2FtD,CAAC;AAsBF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle, PressableProps } from "react-native";
|
|
3
|
+
import type { Theme } from "../styles/DefaultTheme";
|
|
4
|
+
import type { IconSlot } from "../interfaces/Icon";
|
|
5
|
+
/**
|
|
6
|
+
* A button is component that the user can press to trigger an action.
|
|
7
|
+
*
|
|
8
|
+
* <div class="screenshots">
|
|
9
|
+
* <figure>
|
|
10
|
+
* <img src="screenshots/button-1.png" />
|
|
11
|
+
* <figcaption>Text button</figcaption>
|
|
12
|
+
* </figure>
|
|
13
|
+
* <figure>
|
|
14
|
+
* <img src="screenshots/button-2.png" />
|
|
15
|
+
* <figcaption>Outlined button</figcaption>
|
|
16
|
+
* </figure>
|
|
17
|
+
* <figure>
|
|
18
|
+
* <img src="screenshots/button-3.png" />
|
|
19
|
+
* <figcaption>Contained button</figcaption>
|
|
20
|
+
* </figure>
|
|
21
|
+
* </div>
|
|
22
|
+
*
|
|
23
|
+
* ## Usage
|
|
24
|
+
* ```js
|
|
25
|
+
* import * as React from 'react';
|
|
26
|
+
* import { Button } from '@draftbit/ui';
|
|
27
|
+
*
|
|
28
|
+
* const MyComponent = () => (
|
|
29
|
+
* <Button icon="add-a-photo" type="solid" onPress={() => console.log('Pressed')}>
|
|
30
|
+
* Press me
|
|
31
|
+
* </Button>
|
|
32
|
+
* );
|
|
33
|
+
*
|
|
34
|
+
* export default MyComponent;
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare type Props = {
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
type?: "solid" | "outline" | "text";
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
icon?: string;
|
|
42
|
+
labelColor?: string;
|
|
43
|
+
color?: string;
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
onPress: () => void;
|
|
46
|
+
elevation?: number;
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
48
|
+
theme: Theme;
|
|
49
|
+
} & PressableProps & IconSlot;
|
|
50
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
51
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
52
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
53
|
+
export default _default;
|
|
54
|
+
//# sourceMappingURL=DeprecatedButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeprecatedButton.d.ts","sourceRoot":"","sources":["../../../../src/components/DeprecatedButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAGT,cAAc,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,aAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,cAAc,GAChB,QAAQ,CAAC;;;;AA2HX,wBAAiC"}
|
|
@@ -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;AAG1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,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 +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/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{ PressableProps,
|
|
2
|
+
import { PressableProps, ViewStyle } from "react-native";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -8,11 +8,9 @@ declare type Props = {
|
|
|
8
8
|
onLongPress?: () => void;
|
|
9
9
|
delayLongPress?: number;
|
|
10
10
|
hitSlop?: number;
|
|
11
|
-
pressRetentionOffset?: number;
|
|
12
11
|
activeOpacity?: number;
|
|
13
12
|
disabledOpacity?: number;
|
|
14
13
|
} & PressableProps;
|
|
15
|
-
export
|
|
16
|
-
export default function Pressable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }: Props): JSX.Element;
|
|
14
|
+
export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }: Props): JSX.Element;
|
|
17
15
|
export {};
|
|
18
16
|
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,cAAc,EACd,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,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { PressableProps,
|
|
2
|
+
import { PressableProps, ViewStyle } from "react-native";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -8,11 +8,9 @@ declare type Props = {
|
|
|
8
8
|
onLongPress?: () => void;
|
|
9
9
|
delayLongPress?: number;
|
|
10
10
|
hitSlop?: number;
|
|
11
|
-
pressRetentionOffset?: number;
|
|
12
11
|
activeOpacity?: number;
|
|
13
12
|
disabledOpacity?: number;
|
|
14
13
|
} & PressableProps;
|
|
15
|
-
export
|
|
16
|
-
export default function Touchable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }: Props): JSX.Element;
|
|
14
|
+
export default function Touchable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }: Props): JSX.Element;
|
|
17
15
|
export {};
|
|
18
16
|
//# 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,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,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,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Touchable.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAe,gBAAgB,CAAC"}
|
|
@@ -26,6 +26,7 @@ export { default as Switch, SwitchRow } from "./components/Switch";
|
|
|
26
26
|
export { default as TextField } from "./components/TextField";
|
|
27
27
|
export { default as ToggleButton } from "./components/ToggleButton";
|
|
28
28
|
export { default as Touchable } from "./components/Touchable";
|
|
29
|
+
export { default as Pressable } from "./components/Pressable";
|
|
29
30
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
30
31
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
31
32
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAA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