@draftbit/core 43.2.5-e5eabd.3 → 43.2.6-de1703.0

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.
Files changed (80) hide show
  1. package/lib/commonjs/components/Accordion/index.js.map +1 -1
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +13 -2
  3. package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
  4. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
  5. package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
  6. package/lib/commonjs/components/DeprecatedFAB.js +4 -20
  7. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  8. package/lib/commonjs/components/Divider.js +13 -3
  9. package/lib/commonjs/components/Divider.js.map +1 -1
  10. package/lib/commonjs/components/Elevation.js +14 -3
  11. package/lib/commonjs/components/Elevation.js.map +1 -1
  12. package/lib/commonjs/components/Text.js +1 -1
  13. package/lib/commonjs/components/Text.js.map +1 -1
  14. package/lib/commonjs/index.js +0 -16
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/mappings/AvatarEdit.js.map +1 -1
  17. package/lib/commonjs/mappings/Card.js +1 -2
  18. package/lib/commonjs/mappings/Card.js.map +1 -1
  19. package/lib/commonjs/mappings/CardInline.js.map +1 -1
  20. package/lib/commonjs/mappings/Checkbox.js +1 -1
  21. package/lib/commonjs/mappings/Checkbox.js.map +1 -1
  22. package/lib/commonjs/mappings/CustomCode.js.map +1 -1
  23. package/lib/commonjs/mappings/FlatList.js.map +1 -1
  24. package/lib/commonjs/mappings/RadioButton.js.map +1 -1
  25. package/lib/commonjs/mappings/SwiperItem.js.map +1 -1
  26. package/lib/module/components/CardInline.js.map +1 -1
  27. package/lib/module/components/Checkbox/Checkbox.js +13 -2
  28. package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
  29. package/lib/module/components/Picker/PickerComponent.web.js +17 -3
  30. package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
  31. package/lib/module/components/Text.js +1 -1
  32. package/lib/module/components/Text.js.map +1 -1
  33. package/lib/module/index.js +0 -2
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/mappings/Card.js +1 -2
  36. package/lib/module/mappings/Card.js.map +1 -1
  37. package/lib/module/mappings/Checkbox.js +1 -1
  38. package/lib/module/mappings/Checkbox.js.map +1 -1
  39. package/lib/module/mappings/Modal.js.map +1 -1
  40. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -0
  41. package/lib/typescript/src/index.d.ts +0 -2
  42. package/package.json +3 -4
  43. package/src/components/Checkbox/Checkbox.js +10 -3
  44. package/src/components/Checkbox/Checkbox.tsx +15 -2
  45. package/src/components/Text.js +1 -1
  46. package/src/components/Text.tsx +1 -1
  47. package/src/index.js +0 -2
  48. package/src/index.tsx +0 -2
  49. package/src/mappings/Card.js +1 -1
  50. package/src/mappings/Card.ts +1 -1
  51. package/src/mappings/Checkbox.js +1 -1
  52. package/src/mappings/Checkbox.ts +1 -1
  53. package/lib/commonjs/components/KeyboardAwareScrollView.js +0 -26
  54. package/lib/commonjs/components/KeyboardAwareScrollView.js.map +0 -1
  55. package/lib/commonjs/components/ToggleButton.js +0 -86
  56. package/lib/commonjs/components/ToggleButton.js.map +0 -1
  57. package/lib/commonjs/mappings/KeyboardAwareScrollView.js +0 -48
  58. package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +0 -1
  59. package/lib/commonjs/mappings/ToggleButton.js +0 -60
  60. package/lib/commonjs/mappings/ToggleButton.js.map +0 -1
  61. package/lib/module/components/KeyboardAwareScrollView.js +0 -13
  62. package/lib/module/components/KeyboardAwareScrollView.js.map +0 -1
  63. package/lib/module/components/ToggleButton.js +0 -67
  64. package/lib/module/components/ToggleButton.js.map +0 -1
  65. package/lib/module/mappings/KeyboardAwareScrollView.js +0 -39
  66. package/lib/module/mappings/KeyboardAwareScrollView.js.map +0 -1
  67. package/lib/module/mappings/ToggleButton.js +0 -51
  68. package/lib/module/mappings/ToggleButton.js.map +0 -1
  69. package/lib/typescript/src/components/KeyboardAwareScrollView.d.ts +0 -13
  70. package/lib/typescript/src/components/ToggleButton.d.ts +0 -24
  71. package/lib/typescript/src/mappings/KeyboardAwareScrollView.d.ts +0 -82
  72. package/lib/typescript/src/mappings/ToggleButton.d.ts +0 -124
  73. package/src/components/KeyboardAwareScrollView.js +0 -4
  74. package/src/components/KeyboardAwareScrollView.tsx +0 -19
  75. package/src/components/ToggleButton.js +0 -39
  76. package/src/components/ToggleButton.tsx +0 -94
  77. package/src/mappings/KeyboardAwareScrollView.js +0 -38
  78. package/src/mappings/KeyboardAwareScrollView.ts +0 -48
  79. package/src/mappings/ToggleButton.js +0 -50
  80. package/src/mappings/ToggleButton.ts +0 -62
@@ -1,124 +0,0 @@
1
- export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- category: string;
5
- layout: {};
6
- triggers: string[];
7
- props: {
8
- onPress: {
9
- label: string;
10
- description: string;
11
- editable: boolean;
12
- required: boolean;
13
- formType: string;
14
- propType: string;
15
- defaultValue: null;
16
- group: string;
17
- };
18
- icon: {
19
- label: string;
20
- description: string;
21
- formType: string;
22
- propType: string;
23
- defaultValue: string;
24
- required: boolean;
25
- editable: boolean;
26
- group: string;
27
- };
28
- iconSize: {
29
- group: string;
30
- label: string;
31
- description: string;
32
- editable: boolean;
33
- required: boolean;
34
- formType: string;
35
- propType: string;
36
- defaultValue: number;
37
- options: number[];
38
- };
39
- fieldName: {
40
- handlerPropName: string;
41
- group: string;
42
- label: string;
43
- description: string;
44
- formType: string;
45
- propType: string;
46
- defaultValue: string;
47
- valuePropName: string;
48
- editable: boolean;
49
- required: boolean;
50
- };
51
- disabled: {
52
- label: string;
53
- description: string;
54
- formType: string;
55
- propType: string;
56
- defaultValue: boolean;
57
- editable: boolean;
58
- required: boolean;
59
- group: string;
60
- };
61
- color: {
62
- group: string;
63
- label: string;
64
- description: string;
65
- editable: boolean;
66
- required: boolean;
67
- defaultValue: null;
68
- formType: string;
69
- propType: string;
70
- };
71
- colorSecondary: {
72
- group: string;
73
- label: string;
74
- description: string;
75
- editable: boolean;
76
- required: boolean;
77
- defaultValue: null;
78
- formType: string;
79
- propType: string;
80
- };
81
- borderColor: {
82
- group: string;
83
- label: string;
84
- description: string;
85
- editable: boolean;
86
- required: boolean;
87
- defaultValue: null;
88
- formType: string;
89
- propType: string;
90
- };
91
- width: {
92
- label: string;
93
- description: string;
94
- formType: string;
95
- propType: string;
96
- group: string;
97
- defaultValue: null;
98
- editable: boolean;
99
- required: boolean;
100
- step: number;
101
- };
102
- height: {
103
- label: string;
104
- description: string;
105
- formType: string;
106
- propType: string;
107
- group: string;
108
- defaultValue: null;
109
- editable: boolean;
110
- required: boolean;
111
- step: number;
112
- };
113
- toggled: {
114
- label: string;
115
- description: string;
116
- formType: string;
117
- propType: string;
118
- defaultValue: boolean;
119
- editable: boolean;
120
- required: boolean;
121
- group: string;
122
- };
123
- };
124
- };
@@ -1,4 +0,0 @@
1
- import * as React from "react";
2
- import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
3
- const KeyboardAware = ({ children, ...props }) => (React.createElement(KeyboardAwareScrollView, { ...props }, children));
4
- export default KeyboardAware;
@@ -1,19 +0,0 @@
1
- import * as React from "react";
2
- import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
3
-
4
- type Props = {
5
- children: React.ReactNode;
6
- viewIsInsideTabBar: boolean;
7
- enableAutomaticScroll?: boolean;
8
- extraHeight?: number;
9
- extraScrollHeight?: number;
10
- enableResetScrollToCoords?: boolean;
11
- keyboardOpeningTime?: number;
12
- enableOnAndroid?: boolean;
13
- };
14
-
15
- const KeyboardAware = ({ children, ...props }: Props) => (
16
- <KeyboardAwareScrollView {...props}>{children}</KeyboardAwareScrollView>
17
- );
18
-
19
- export default KeyboardAware;
@@ -1,39 +0,0 @@
1
- import * as React from "react";
2
- import { withTheme } from "../theming";
3
- import { StyleSheet } from "react-native";
4
- import IconButton from "./IconButton";
5
- const ToggleButton = ({ Icon, icon, toggled = false, onPress = () => { }, defaultValue, disabled = false, color = "primary", colorSecondary = "surface", borderColor = "divider", iconSize = 25, width = 50, height = 50, theme: { colors }, style, ...rest }) => {
6
- const [internalValue, setInternalValue] = React.useState(toggled || defaultValue || false);
7
- React.useEffect(() => {
8
- if (toggled != null) {
9
- setInternalValue(toggled);
10
- }
11
- }, [toggled]);
12
- React.useEffect(() => {
13
- if (defaultValue != null) {
14
- setInternalValue(defaultValue);
15
- }
16
- }, [defaultValue]);
17
- const handlePress = () => {
18
- setInternalValue(!internalValue);
19
- onPress(!internalValue);
20
- };
21
- return (React.createElement(IconButton, { Icon: Icon, icon: icon, size: iconSize, color: internalValue ? colors[color] : colors[colorSecondary], onPress: handlePress, disabled: disabled, style: [
22
- styles.mainContainer,
23
- {
24
- width,
25
- height,
26
- backgroundColor: internalValue
27
- ? colors[colorSecondary]
28
- : colors[color],
29
- borderColor: colors[borderColor],
30
- },
31
- style,
32
- ], ...rest }));
33
- };
34
- const styles = StyleSheet.create({
35
- mainContainer: {
36
- borderWidth: 1,
37
- },
38
- });
39
- export default withTheme(ToggleButton);
@@ -1,94 +0,0 @@
1
- import * as React from "react";
2
- import { withTheme } from "../theming";
3
- import { colorTypes } from "@draftbit/types";
4
- import { StyleProp, StyleSheet, ViewStyle } from "react-native";
5
- import IconButton from "./IconButton";
6
- import type { Theme } from "../styles/DefaultTheme";
7
- import type { IconSlot } from "../interfaces/Icon";
8
-
9
- type Props = {
10
- icon: string;
11
- toggled?: boolean;
12
- onPress?: (value: boolean) => void;
13
- defaultValue?: boolean;
14
- disabled?: boolean;
15
- color?: colorTypes;
16
- colorSecondary?: colorTypes;
17
- borderColor?: colorTypes;
18
- iconSize?: number;
19
- width?: number;
20
- height?: number;
21
- style?: StyleProp<ViewStyle>;
22
- theme: Theme;
23
- } & IconSlot;
24
-
25
- const ToggleButton: React.FC<Props> = ({
26
- Icon,
27
- icon,
28
- toggled = false,
29
- onPress = () => {},
30
- defaultValue,
31
- disabled = false,
32
- color = "primary",
33
- colorSecondary = "surface",
34
- borderColor = "divider",
35
- iconSize = 25,
36
- width = 50,
37
- height = 50,
38
- theme: { colors },
39
- style,
40
- ...rest
41
- }) => {
42
- const [internalValue, setInternalValue] = React.useState<boolean>(
43
- toggled || defaultValue || false
44
- );
45
-
46
- React.useEffect(() => {
47
- if (toggled != null) {
48
- setInternalValue(toggled);
49
- }
50
- }, [toggled]);
51
-
52
- React.useEffect(() => {
53
- if (defaultValue != null) {
54
- setInternalValue(defaultValue);
55
- }
56
- }, [defaultValue]);
57
-
58
- const handlePress = () => {
59
- setInternalValue(!internalValue);
60
- onPress(!internalValue);
61
- };
62
-
63
- return (
64
- <IconButton
65
- Icon={Icon}
66
- icon={icon}
67
- size={iconSize}
68
- color={internalValue ? colors[color] : colors[colorSecondary]}
69
- onPress={handlePress}
70
- disabled={disabled}
71
- style={[
72
- styles.mainContainer,
73
- {
74
- width,
75
- height,
76
- backgroundColor: internalValue
77
- ? colors[colorSecondary]
78
- : colors[color],
79
- borderColor: colors[borderColor],
80
- },
81
- style,
82
- ]}
83
- {...rest}
84
- />
85
- );
86
- };
87
-
88
- const styles = StyleSheet.create({
89
- mainContainer: {
90
- borderWidth: 1,
91
- },
92
- });
93
-
94
- export default withTheme(ToggleButton);
@@ -1,38 +0,0 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Keyboard Aware Scroll View",
4
- tag: "KeyboardAwareScrollView",
5
- description: "View that moves pushes the content when virtual keyboard is open.",
6
- category: COMPONENT_TYPES.layout,
7
- layout: {},
8
- props: {
9
- viewIsInsideTabBar: createStaticBoolProp({
10
- label: "View Is Inside TabBar",
11
- description: "Adds an extra offset that represents the TabBarIOS height.",
12
- }),
13
- enableAutomaticScroll: createStaticBoolProp({
14
- label: "Enable Automatic Scroll",
15
- description: "When focus in TextInput will scroll the position, default is enabled",
16
- }),
17
- extraHeight: createStaticNumberProp({
18
- label: "Extra Height",
19
- description: "Adds an extra offset when focusing the TextInputs",
20
- }),
21
- extraScrollHeight: createStaticNumberProp({
22
- label: "Extra Scroll Height",
23
- description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
24
- }),
25
- enableResetScrollToCoords: createStaticBoolProp({
26
- label: "Enable Reset Scroll To Coordinates",
27
- description: "Lets the user enable or disable automatic resetScrollToCoords",
28
- }),
29
- keyboardOpeningTime: createStaticNumberProp({
30
- label: "Keyboard Opening Time",
31
- description: "Sets the delay time before scrolling to new position, default is 250",
32
- }),
33
- enableOnAndroid: createStaticBoolProp({
34
- label: "Enable On Android",
35
- description: "Enable Android Support",
36
- }),
37
- },
38
- };
@@ -1,48 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createStaticBoolProp,
4
- createStaticNumberProp,
5
- } from "@draftbit/types";
6
-
7
- export const SEED_DATA = {
8
- name: "Keyboard Aware Scroll View",
9
- tag: "KeyboardAwareScrollView",
10
- description:
11
- "View that moves pushes the content when virtual keyboard is open.",
12
- category: COMPONENT_TYPES.layout,
13
- layout: {},
14
- props: {
15
- viewIsInsideTabBar: createStaticBoolProp({
16
- label: "View Is Inside TabBar",
17
- description: "Adds an extra offset that represents the TabBarIOS height.",
18
- }),
19
- enableAutomaticScroll: createStaticBoolProp({
20
- label: "Enable Automatic Scroll",
21
- description:
22
- "When focus in TextInput will scroll the position, default is enabled",
23
- }),
24
- extraHeight: createStaticNumberProp({
25
- label: "Extra Height",
26
- description: "Adds an extra offset when focusing the TextInputs",
27
- }),
28
- extraScrollHeight: createStaticNumberProp({
29
- label: "Extra Scroll Height",
30
- description:
31
- "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
32
- }),
33
- enableResetScrollToCoords: createStaticBoolProp({
34
- label: "Enable Reset Scroll To Coordinates",
35
- description:
36
- "Lets the user enable or disable automatic resetScrollToCoords",
37
- }),
38
- keyboardOpeningTime: createStaticNumberProp({
39
- label: "Keyboard Opening Time",
40
- description:
41
- "Sets the delay time before scrolling to new position, default is 250",
42
- }),
43
- enableOnAndroid: createStaticBoolProp({
44
- label: "Enable On Android",
45
- description: "Enable Android Support",
46
- }),
47
- },
48
- };
@@ -1,50 +0,0 @@
1
- import { GROUPS, COMPONENT_TYPES, createIconProp, createBoolProp, createColorProp, createStaticNumberProp, createFieldNameProp, createIconSizeProp, createActionProp, Triggers, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Toggle Button",
4
- tag: "ToggleButton",
5
- category: COMPONENT_TYPES.button,
6
- layout: {},
7
- triggers: [Triggers.OnPress],
8
- props: {
9
- onPress: createActionProp(),
10
- icon: createIconProp({
11
- required: true,
12
- }),
13
- iconSize: createIconSizeProp(),
14
- fieldName: createFieldNameProp({
15
- defaultValue: false,
16
- valuePropName: "toggled",
17
- }),
18
- disabled: createBoolProp({
19
- label: "Disabled",
20
- description: "Whether the button should be disabled",
21
- group: GROUPS.basic,
22
- }),
23
- color: createColorProp({
24
- group: GROUPS.basic,
25
- }),
26
- colorSecondary: createColorProp({
27
- label: "Secondary Color",
28
- group: GROUPS.basic,
29
- }),
30
- borderColor: createColorProp({
31
- label: "Border Color",
32
- group: GROUPS.basic,
33
- }),
34
- width: createStaticNumberProp({
35
- label: "Width",
36
- description: "Width",
37
- defaultValue: 50,
38
- }),
39
- height: createStaticNumberProp({
40
- label: "Height",
41
- description: "Height",
42
- defaultValue: 50,
43
- }),
44
- toggled: createBoolProp({
45
- label: "Toggled",
46
- description: "Whether the button should show the toggled state",
47
- defaultValue: false,
48
- }),
49
- },
50
- };
@@ -1,62 +0,0 @@
1
- import {
2
- GROUPS,
3
- COMPONENT_TYPES,
4
- createIconProp,
5
- createBoolProp,
6
- createColorProp,
7
- createStaticNumberProp,
8
- createFieldNameProp,
9
- createIconSizeProp,
10
- createActionProp,
11
- Triggers,
12
- } from "@draftbit/types";
13
-
14
- export const SEED_DATA = {
15
- name: "Toggle Button",
16
- tag: "ToggleButton",
17
- category: COMPONENT_TYPES.button,
18
- layout: {},
19
- triggers: [Triggers.OnPress],
20
- props: {
21
- onPress: createActionProp(),
22
- icon: createIconProp({
23
- required: true,
24
- }),
25
- iconSize: createIconSizeProp(),
26
- fieldName: createFieldNameProp({
27
- defaultValue: false,
28
- valuePropName: "toggled",
29
- }),
30
- disabled: createBoolProp({
31
- label: "Disabled",
32
- description: "Whether the button should be disabled",
33
- group: GROUPS.basic,
34
- }),
35
- color: createColorProp({
36
- group: GROUPS.basic,
37
- }),
38
- colorSecondary: createColorProp({
39
- label: "Secondary Color",
40
- group: GROUPS.basic,
41
- }),
42
- borderColor: createColorProp({
43
- label: "Border Color",
44
- group: GROUPS.basic,
45
- }),
46
- width: createStaticNumberProp({
47
- label: "Width",
48
- description: "Width",
49
- defaultValue: 50,
50
- }),
51
- height: createStaticNumberProp({
52
- label: "Height",
53
- description: "Height",
54
- defaultValue: 50,
55
- }),
56
- toggled: createBoolProp({
57
- label: "Toggled",
58
- description: "Whether the button should show the toggled state",
59
- defaultValue: false,
60
- }),
61
- },
62
- };