@draftbit/core 47.0.1-cc5ccc.2 → 47.0.1-df014a.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/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/DatePickerModal.js +74 -0
- package/lib/commonjs/mappings/Touchable.js +20 -0
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/Button.js +9 -21
- package/lib/module/components/CardBlock.js +14 -4
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/components/DeprecatedButton.js +141 -0
- package/lib/module/components/DeprecatedCardWrapper.js +20 -3
- package/lib/module/components/DeprecatedFAB.js +3 -2
- package/lib/module/components/FAB.js +22 -4
- package/lib/module/components/Picker/Picker.js +4 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +37 -12
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Switch.js +21 -10
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/Touchable.js +28 -26
- package/lib/module/components/Touchable.web.js +2 -0
- package/lib/module/mappings/Button.js +11 -14
- package/lib/module/mappings/DatePickerModal.js +65 -0
- 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/DatePickerModal.d.ts +153 -0
- package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +1 -0
- 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 +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/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/DatePickerModal.js +73 -0
- package/src/mappings/DatePickerModal.ts +91 -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,7 +1,3 @@
|
|
|
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
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
1
|
import * as React from "react";
|
|
6
2
|
import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
|
|
7
3
|
import { withTheme } from "../theming";
|
|
@@ -13,7 +9,7 @@ const ICON_SIZE = 24;
|
|
|
13
9
|
class TextField extends React.Component {
|
|
14
10
|
constructor() {
|
|
15
11
|
super(...arguments);
|
|
16
|
-
|
|
12
|
+
this.state = {
|
|
17
13
|
nativeProps: {},
|
|
18
14
|
labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
19
15
|
focused: false,
|
|
@@ -22,47 +18,46 @@ class TextField extends React.Component {
|
|
|
22
18
|
measured: false,
|
|
23
19
|
width: 0
|
|
24
20
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
};
|
|
22
|
+
this._timer = setTimeout(() => {}, 0);
|
|
23
|
+
this._showPlaceholder = () => {
|
|
28
24
|
clearTimeout(this._timer);
|
|
29
|
-
|
|
30
25
|
// Set the placeholder in a delay to offset the label animation
|
|
31
26
|
// If we show it immediately, they'll overlap and look ugly
|
|
32
27
|
this._timer = setTimeout(() => this.setState({
|
|
33
28
|
placeholder: this.props.placeholder
|
|
34
29
|
}), 50);
|
|
35
|
-
}
|
|
36
|
-
|
|
30
|
+
};
|
|
31
|
+
this._hidePlaceholder = () => this.setState({
|
|
37
32
|
placeholder: ""
|
|
38
|
-
})
|
|
39
|
-
|
|
33
|
+
});
|
|
34
|
+
this._restoreLabel = () => Animated.timing(this.state.labeled, {
|
|
40
35
|
toValue: 1,
|
|
41
36
|
duration: FOCUS_ANIMATION_DURATION,
|
|
42
37
|
useNativeDriver: true
|
|
43
|
-
}).start()
|
|
44
|
-
|
|
38
|
+
}).start();
|
|
39
|
+
this._minmizeLabel = () => Animated.timing(this.state.labeled, {
|
|
45
40
|
toValue: 0,
|
|
46
41
|
duration: BLUR_ANIMATION_DURATION,
|
|
47
42
|
useNativeDriver: true
|
|
48
|
-
}).start()
|
|
49
|
-
|
|
43
|
+
}).start();
|
|
44
|
+
this._handleFocus = () => {
|
|
50
45
|
if (this.props.disabled) {
|
|
51
46
|
return;
|
|
52
47
|
}
|
|
53
48
|
this.setState({
|
|
54
49
|
focused: true
|
|
55
50
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
51
|
+
};
|
|
52
|
+
this._handleBlur = () => {
|
|
58
53
|
if (this.props.disabled) {
|
|
59
54
|
return;
|
|
60
55
|
}
|
|
61
56
|
this.setState({
|
|
62
57
|
focused: false
|
|
63
58
|
});
|
|
64
|
-
}
|
|
65
|
-
|
|
59
|
+
};
|
|
60
|
+
this._handleChangeText = value => {
|
|
66
61
|
if (this.props.disabled) {
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
@@ -77,8 +72,8 @@ class TextField extends React.Component {
|
|
|
77
72
|
});
|
|
78
73
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
79
74
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
75
|
+
};
|
|
76
|
+
this._root = undefined;
|
|
82
77
|
}
|
|
83
78
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
84
79
|
return {
|
|
@@ -165,7 +160,9 @@ class TextField extends React.Component {
|
|
|
165
160
|
roundness,
|
|
166
161
|
disabledOpacity
|
|
167
162
|
},
|
|
168
|
-
render = props => /*#__PURE__*/React.createElement(NativeTextInput,
|
|
163
|
+
render = props => /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
164
|
+
...props
|
|
165
|
+
}),
|
|
169
166
|
...rest
|
|
170
167
|
} = this.props;
|
|
171
168
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -305,9 +302,10 @@ class TextField extends React.Component {
|
|
|
305
302
|
} = StyleSheet.flatten(style || {});
|
|
306
303
|
return /*#__PURE__*/React.createElement(View, {
|
|
307
304
|
style: [styles.container, styleProp]
|
|
308
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
305
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
306
|
+
...leftIconProps,
|
|
309
307
|
style: leftIconStyle
|
|
310
|
-
})
|
|
308
|
+
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
311
309
|
style: applyStyles([containerStyle], {
|
|
312
310
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
313
311
|
backgroundColor: bgColor,
|
|
@@ -375,9 +373,10 @@ class TextField extends React.Component {
|
|
|
375
373
|
style: {
|
|
376
374
|
justifyContent: type === "solid" ? "center" : undefined
|
|
377
375
|
}
|
|
378
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
376
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
377
|
+
...leftIconProps,
|
|
379
378
|
style: leftIconStyle
|
|
380
|
-
}))
|
|
379
|
+
})) : null, render({
|
|
381
380
|
ref: c => {
|
|
382
381
|
this._root = c;
|
|
383
382
|
},
|
|
@@ -414,6 +413,57 @@ class TextField extends React.Component {
|
|
|
414
413
|
}
|
|
415
414
|
}
|
|
416
415
|
export default withTheme(TextField);
|
|
416
|
+
const styles = StyleSheet.create({
|
|
417
|
+
container: {
|
|
418
|
+
alignSelf: "stretch"
|
|
419
|
+
},
|
|
420
|
+
placeholder: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
left: 0
|
|
423
|
+
},
|
|
424
|
+
underline: {
|
|
425
|
+
position: "absolute",
|
|
426
|
+
left: 0,
|
|
427
|
+
right: 0,
|
|
428
|
+
bottom: 0,
|
|
429
|
+
height: 2
|
|
430
|
+
},
|
|
431
|
+
input: {
|
|
432
|
+
flexGrow: 1,
|
|
433
|
+
justifyContent: "center",
|
|
434
|
+
textAlignVertical: "center",
|
|
435
|
+
margin: 0,
|
|
436
|
+
textAlign: I18nManager.isRTL ? "right" : "left"
|
|
437
|
+
}
|
|
438
|
+
});ionColor: activeColor,
|
|
439
|
+
multiline,
|
|
440
|
+
numberOfLines,
|
|
441
|
+
onFocus: this._handleFocus,
|
|
442
|
+
onBlur: this._handleBlur,
|
|
443
|
+
underlineColorAndroid: "transparent",
|
|
444
|
+
style: inputStyles,
|
|
445
|
+
...rest,
|
|
446
|
+
...this.state.nativeProps,
|
|
447
|
+
value: this.state.value
|
|
448
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
449
|
+
name: rightIconName,
|
|
450
|
+
size: ICON_SIZE,
|
|
451
|
+
color: colors.light,
|
|
452
|
+
style: {
|
|
453
|
+
position: "absolute",
|
|
454
|
+
right: 16,
|
|
455
|
+
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
456
|
+
}
|
|
457
|
+
}) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
|
|
458
|
+
style: [{
|
|
459
|
+
color: error ? colors.error : colors.light,
|
|
460
|
+
marginTop: 8,
|
|
461
|
+
marginLeft: assistiveTextLeftMargin
|
|
462
|
+
}]
|
|
463
|
+
}, assistiveText) : null);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
export default withTheme(TextField);
|
|
417
467
|
const styles = StyleSheet.create({
|
|
418
468
|
container: {
|
|
419
469
|
alignSelf: "stretch"
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useCallback } from "react";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import { Pressable } from "react-native";
|
|
4
3
|
export default function Touchable(_ref) {
|
|
5
4
|
let {
|
|
6
5
|
children,
|
|
7
6
|
disabled,
|
|
8
7
|
onPress,
|
|
9
|
-
onLongPress,
|
|
10
|
-
hitSlop,
|
|
11
|
-
delayLongPress,
|
|
12
|
-
activeOpacity,
|
|
13
|
-
disabledOpacity,
|
|
14
8
|
style,
|
|
15
9
|
...props
|
|
16
10
|
} = _ref;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
12
|
+
onPress: onPress,
|
|
13
|
+
disabled: disabled,
|
|
14
|
+
hitSlop: 8,
|
|
15
|
+
style: _ref2 => {
|
|
16
|
+
let {
|
|
17
|
+
pressed
|
|
18
|
+
} = _ref2;
|
|
19
|
+
return [{
|
|
20
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
21
|
+
}, style];
|
|
22
|
+
},
|
|
23
|
+
...props
|
|
24
|
+
}, children);
|
|
25
|
+
},
|
|
26
|
+
style,
|
|
27
|
+
...props
|
|
28
|
+
} = _ref;
|
|
32
29
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
33
30
|
onPress: onPress,
|
|
34
|
-
onLongPress: onLongPress,
|
|
35
31
|
disabled: disabled,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
hitSlop: 8,
|
|
33
|
+
style: _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
pressed
|
|
36
|
+
} = _ref2;
|
|
37
|
+
return [{
|
|
38
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
39
|
+
}, style];
|
|
40
|
+
}
|
|
39
41
|
}, props), children);
|
|
40
42
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections
|
|
2
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnPress
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnPress];
|
|
3
3
|
const SEED_DATA_PROPS = {
|
|
4
4
|
onPress: createActionProp(),
|
|
5
|
-
onLongPress: createActionProp(),
|
|
6
5
|
icon: createIconProp({
|
|
7
6
|
defaultValue: null,
|
|
8
7
|
required: false
|
|
@@ -13,11 +12,12 @@ const SEED_DATA_PROPS = {
|
|
|
13
12
|
defaultValue: "Get Started"
|
|
14
13
|
}),
|
|
15
14
|
disabled: createDisabledProp(),
|
|
16
|
-
loading: createLoadingProp()
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
loading: createLoadingProp()
|
|
16
|
+
};
|
|
17
|
+
const LAYOUT = {
|
|
18
|
+
backgroundColor: "transparent",
|
|
19
|
+
borderRadius: 8,
|
|
20
|
+
fontFamily: "system-700"
|
|
21
21
|
};
|
|
22
22
|
export const SEED_DATA = [{
|
|
23
23
|
name: "Button Outline",
|
|
@@ -25,9 +25,8 @@ 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,
|
|
28
29
|
backgroundColor: "transparent",
|
|
29
|
-
borderRadius: 8,
|
|
30
|
-
fontFamily: "system-700",
|
|
31
30
|
borderWidth: 1,
|
|
32
31
|
textAlign: "center"
|
|
33
32
|
},
|
|
@@ -39,8 +38,7 @@ export const SEED_DATA = [{
|
|
|
39
38
|
category: COMPONENT_TYPES.deprecated,
|
|
40
39
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
41
40
|
layout: {
|
|
42
|
-
|
|
43
|
-
fontFamily: "system-700",
|
|
41
|
+
...LAYOUT,
|
|
44
42
|
backgroundColor: "primary",
|
|
45
43
|
textAlign: "center"
|
|
46
44
|
},
|
|
@@ -52,8 +50,7 @@ export const SEED_DATA = [{
|
|
|
52
50
|
category: COMPONENT_TYPES.button,
|
|
53
51
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
54
52
|
layout: {
|
|
55
|
-
|
|
56
|
-
fontFamily: "system-700",
|
|
53
|
+
...LAYOUT,
|
|
57
54
|
backgroundColor: "primary",
|
|
58
55
|
textAlign: "center"
|
|
59
56
|
},
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, FIELD_NAME, Triggers, StylesPanelSections, createBoolProp, createTextProp, createTextEnumProp, createStaticBoolProp, createStaticNumberProp } from "@draftbit/types";
|
|
2
|
+
export const SHARED_SEED_DATA = {
|
|
3
|
+
triggers: [Triggers.OnDismiss, Triggers.OnConfirm, Triggers.OnChange],
|
|
4
|
+
category: COMPONENT_TYPES.input,
|
|
5
|
+
StylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position],
|
|
6
|
+
layout: null
|
|
7
|
+
};
|
|
8
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
9
|
+
locale: {},
|
|
10
|
+
visible: createBoolProp({
|
|
11
|
+
label: "Visible",
|
|
12
|
+
description: "If true, show the modal. If false, hide the modal.",
|
|
13
|
+
required: true
|
|
14
|
+
}),
|
|
15
|
+
label: createTextProp({
|
|
16
|
+
label: "Label",
|
|
17
|
+
description: "Label used as the header in the component, defaults to `Select Date`"
|
|
18
|
+
}),
|
|
19
|
+
saveLabel: createTextProp({
|
|
20
|
+
label: "Save Label",
|
|
21
|
+
description: "Label used to confirm a date selection. Defaults to `Save`."
|
|
22
|
+
}),
|
|
23
|
+
saveLabelDisabled: createStaticBoolProp({
|
|
24
|
+
label: "Disable Save Label",
|
|
25
|
+
description: "Flag indicating if the save label should be disabled and unable to receive events"
|
|
26
|
+
}),
|
|
27
|
+
uppercase: createStaticBoolProp({
|
|
28
|
+
label: "Uppercase",
|
|
29
|
+
description: "Flag indicating if the text in the component should be uppercase. Defaults to true."
|
|
30
|
+
}),
|
|
31
|
+
startYear: createStaticNumberProp({
|
|
32
|
+
label: "Start Year",
|
|
33
|
+
description: "The start year when the component is rendered. Defaults to 1800.",
|
|
34
|
+
required: false
|
|
35
|
+
}),
|
|
36
|
+
endYear: createStaticNumberProp({
|
|
37
|
+
label: "End Year",
|
|
38
|
+
description: "The end year when the component is rendered. Defaults to 2200.",
|
|
39
|
+
required: false
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
export const SEED_DATA = [{
|
|
43
|
+
name: "Single Date Picker Modal",
|
|
44
|
+
tag: "SingleDatePickerModal",
|
|
45
|
+
description: "A modal allowing date selection.",
|
|
46
|
+
...SHARED_SEED_DATA,
|
|
47
|
+
props: {
|
|
48
|
+
mode: createTextEnumProp({
|
|
49
|
+
label: "Mode",
|
|
50
|
+
description: "The selection mode of the date picker",
|
|
51
|
+
required: true,
|
|
52
|
+
options: ["single", "multiple", "range"],
|
|
53
|
+
editable: false,
|
|
54
|
+
defaultValue: "single",
|
|
55
|
+
formType: FORM_TYPES.flatArray
|
|
56
|
+
}),
|
|
57
|
+
fieldName: {
|
|
58
|
+
...FIELD_NAME,
|
|
59
|
+
handlerPropName: "onConfirm",
|
|
60
|
+
valuePropName: "date",
|
|
61
|
+
defaultValue: "date"
|
|
62
|
+
},
|
|
63
|
+
...SHARED_SEED_DATA_PROPS
|
|
64
|
+
}
|
|
65
|
+
}];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Touchable",
|
|
4
|
+
tag: "Touchable",
|
|
5
|
+
description: "Simple button with no styles",
|
|
6
|
+
category: COMPONENT_TYPES.button,
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Borders],
|
|
8
|
+
layout: {},
|
|
9
|
+
triggers: [Triggers.OnPress],
|
|
10
|
+
props: {
|
|
11
|
+
onPress: createActionProp()
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -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":"AA0IA,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 { TouchableHighlightProps, StyleProp, ViewStyle } 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 & TouchableHighlightProps & 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,SAAS,EACT,SAAS,
|
|
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,uBAAuB,EACvB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,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,CACtB,aAAa,GAAG,uBAAuB,GAAG,QAAQ,CAqFnD,CAAC;AAqBF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TouchableHighlightProps, StyleProp, ViewStyle } 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
|
+
} & TouchableHighlightProps & 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,uBAAuB,EACvB,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAOtB,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,uBAAuB,GACzB,QAAQ,CAAC;;;;AAmJX,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,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle
|
|
2
|
+
import { TouchableHighlightProps, StyleProp, ViewStyle } 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
|
+
} & TouchableHighlightProps & 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,SAAS,EACT,SAAS,
|
|
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,uBAAuB,EACvB,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAQtB,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,uBAAuB,GACzB,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,EAEV,MAAM,cAAc,CAAC;AAStB,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"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ViewStyle, PressableProps } 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;
|
|
14
8
|
} & PressableProps;
|
|
15
|
-
export
|
|
16
|
-
export default function Touchable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }: Props): JSX.Element;
|
|
9
|
+
export default function Touchable({ children, disabled, onPress, style, ...props }: Props): JSX.Element;
|
|
17
10
|
export {};
|
|
18
11
|
//# 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,SAAS,EAAE,cAAc,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;CACtB,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAmBP"}
|
|
@@ -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"}
|