@draftbit/core 46.2.4-dedb7a.0 → 46.2.4-f941fc.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 (46) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +25 -5
  2. package/lib/commonjs/components/DeprecatedButton.js +4 -22
  3. package/lib/commonjs/components/TabView/TabView.js +102 -0
  4. package/lib/commonjs/components/TabView/TabViewItem.js +26 -0
  5. package/lib/commonjs/components/TabView/index.js +23 -0
  6. package/lib/commonjs/index.js +14 -0
  7. package/lib/commonjs/mappings/NumberInput.js +149 -146
  8. package/lib/commonjs/mappings/TabView.js +79 -0
  9. package/lib/commonjs/mappings/TextArea.js +193 -188
  10. package/lib/commonjs/mappings/TextField.js +8 -3
  11. package/lib/commonjs/mappings/TextInput.js +180 -178
  12. package/lib/module/components/TabView/TabView.js +87 -0
  13. package/lib/module/components/TabView/TabViewItem.js +18 -0
  14. package/lib/module/components/TabView/index.js +2 -0
  15. package/lib/module/index.js +1 -0
  16. package/lib/module/mappings/NumberInput.js +149 -146
  17. package/lib/module/mappings/TabView.js +70 -0
  18. package/lib/module/mappings/TextArea.js +193 -188
  19. package/lib/module/mappings/TextField.js +8 -3
  20. package/lib/module/mappings/TextInput.js +180 -178
  21. package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
  22. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
  23. package/lib/typescript/src/components/TabView/index.d.ts +2 -0
  24. package/lib/typescript/src/index.d.ts +1 -0
  25. package/lib/typescript/src/mappings/TabView.d.ts +111 -0
  26. package/lib/typescript/src/mappings/TextArea.d.ts +42 -42
  27. package/lib/typescript/src/mappings/TextField.d.ts +118 -118
  28. package/package.json +4 -2
  29. package/src/components/TabView/TabView.js +34 -0
  30. package/src/components/TabView/TabView.tsx +97 -0
  31. package/src/components/TabView/TabViewItem.js +5 -0
  32. package/src/components/TabView/TabViewItem.tsx +21 -0
  33. package/src/components/TabView/index.js +2 -0
  34. package/src/components/TabView/index.ts +2 -0
  35. package/src/index.js +1 -0
  36. package/src/index.tsx +1 -0
  37. package/src/mappings/NumberInput.js +163 -160
  38. package/src/mappings/NumberInput.ts +168 -165
  39. package/src/mappings/TabView.js +73 -0
  40. package/src/mappings/TabView.ts +80 -0
  41. package/src/mappings/TextArea.js +220 -213
  42. package/src/mappings/TextArea.ts +227 -219
  43. package/src/mappings/TextField.js +9 -2
  44. package/src/mappings/TextField.ts +11 -3
  45. package/src/mappings/TextInput.js +208 -205
  46. package/src/mappings/TextInput.ts +215 -212
@@ -1,4 +1,152 @@
1
1
  import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers, StylesPanelSections } from "@draftbit/types";
2
+ const NUMBER_INPUT_PROPS = {
3
+ allowFontScaling: {
4
+ group: GROUPS.advanced,
5
+ label: "Allow Font Scaling",
6
+ description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
7
+ editable: true,
8
+ required: false,
9
+ defaultValue: null,
10
+ formType: FORM_TYPES.boolean,
11
+ propType: PROP_TYPES.BOOLEAN
12
+ },
13
+ autoFocus: {
14
+ group: GROUPS.basic,
15
+ label: "Auto Focus",
16
+ description: "Focuses the input on load in and brings up the keyboard",
17
+ editable: true,
18
+ required: false,
19
+ defaultValue: null,
20
+ formType: FORM_TYPES.boolean,
21
+ propType: PROP_TYPES.BOOLEAN
22
+ },
23
+ caretHidden: {
24
+ group: GROUPS.advanced,
25
+ label: "Hide Caret",
26
+ description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
27
+ editable: true,
28
+ required: false,
29
+ defaultValue: null,
30
+ formType: FORM_TYPES.boolean,
31
+ propType: PROP_TYPES.BOOLEAN
32
+ },
33
+ contextMenuHidden: {
34
+ group: GROUPS.advanced,
35
+ label: "Hide Context Menu",
36
+ description: "Hides the system context menu (Default: false)",
37
+ editable: true,
38
+ required: false,
39
+ defaultValue: null,
40
+ formType: FORM_TYPES.boolean,
41
+ propType: PROP_TYPES.BOOLEAN
42
+ },
43
+ editable: {
44
+ group: GROUPS.advanced,
45
+ label: "Editable",
46
+ description: "If false, the text is not editable",
47
+ editable: true,
48
+ required: false,
49
+ defaultValue: true,
50
+ formType: FORM_TYPES.boolean,
51
+ propType: PROP_TYPES.BOOLEAN
52
+ },
53
+ keyboardAppearance: {
54
+ group: GROUPS.advanced,
55
+ label: "Keyboard Appearance",
56
+ description: "Determines the color of the keyboard.(iOS Only)",
57
+ editable: true,
58
+ required: false,
59
+ defaultValue: null,
60
+ options: ["default", "light", "dark"],
61
+ formType: FORM_TYPES.flatArray,
62
+ propType: PROP_TYPES.STRING
63
+ },
64
+ keyboardType: {
65
+ group: GROUPS.advanced,
66
+ label: "Keyboard Type",
67
+ description: "Determines what keyboard is given to the user.",
68
+ editable: true,
69
+ required: false,
70
+ defaultValue: null,
71
+ options: ["numeric", "numbers-and-punctuation", "number-pad"],
72
+ formType: FORM_TYPES.flatArray,
73
+ propType: PROP_TYPES.STRING
74
+ },
75
+ maxLength: {
76
+ group: GROUPS.basic,
77
+ label: "Max Length",
78
+ description: "Limits the input to a set number of characters.",
79
+ editable: true,
80
+ required: false,
81
+ defaultValue: null,
82
+ min: 0,
83
+ step: 1,
84
+ precision: 0,
85
+ formType: FORM_TYPES.number,
86
+ propType: PROP_TYPES.NUMBER
87
+ },
88
+ placeholder: {
89
+ group: GROUPS.basic,
90
+ label: "Placeholder Text",
91
+ description: "The text that is shown on load when no value is available.",
92
+ editable: true,
93
+ required: false,
94
+ defaultValue: "Enter a number...",
95
+ formType: FORM_TYPES.string,
96
+ propType: PROP_TYPES.STRING
97
+ },
98
+ placeholderTextColor: {
99
+ group: GROUPS.basic,
100
+ label: "Placeholder Text Color",
101
+ description: "The color of the placeholder text.",
102
+ editable: true,
103
+ required: false,
104
+ defaultValue: null,
105
+ formType: FORM_TYPES.color,
106
+ propType: PROP_TYPES.STRING
107
+ },
108
+ returnKeyLabel: {
109
+ group: GROUPS.advanced,
110
+ label: "Return Key Label",
111
+ description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
112
+ editable: true,
113
+ required: false,
114
+ defaultValue: null,
115
+ formType: FORM_TYPES.string,
116
+ propType: PROP_TYPES.STRING
117
+ },
118
+ returnKeyType: {
119
+ group: GROUPS.advanced,
120
+ label: "Return Key Type",
121
+ description: "Determines how the return key should look like",
122
+ editable: true,
123
+ required: false,
124
+ defaultValue: null,
125
+ options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
126
+ formType: FORM_TYPES.flatArray,
127
+ propType: PROP_TYPES.STRING
128
+ },
129
+ selectionColor: {
130
+ group: GROUPS.advanced,
131
+ label: "Selection Color",
132
+ description: "Color of the highlighted portion when selecting.",
133
+ editable: true,
134
+ required: false,
135
+ defaultValue: null,
136
+ formType: FORM_TYPES.color,
137
+ propType: PROP_TYPES.STRING
138
+ },
139
+ selectTextOnFocus: {
140
+ group: GROUPS.advanced,
141
+ label: "Select Text on Focus",
142
+ description: "If true, all the text will automatically be selected on focus",
143
+ editable: true,
144
+ required: false,
145
+ defaultValue: null,
146
+ formType: FORM_TYPES.boolean,
147
+ propType: PROP_TYPES.BOOLEAN
148
+ }
149
+ };
2
150
  export const SEED_DATA_PROPS = {
3
151
  style: {
4
152
  group: GROUPS.basic,
@@ -78,151 +226,6 @@ export const SEED_DATA = [{
78
226
  },
79
227
  triggers: [Triggers.OnChangeText],
80
228
  props: { ...SEED_DATA_PROPS,
81
- allowFontScaling: {
82
- group: GROUPS.advanced,
83
- label: "Allow Font Scaling",
84
- description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
85
- editable: true,
86
- required: false,
87
- defaultValue: null,
88
- formType: FORM_TYPES.boolean,
89
- propType: PROP_TYPES.BOOLEAN
90
- },
91
- autoFocus: {
92
- group: GROUPS.basic,
93
- label: "Auto Focus",
94
- description: "Focuses the input on load in and brings up the keyboard",
95
- editable: true,
96
- required: false,
97
- defaultValue: null,
98
- formType: FORM_TYPES.boolean,
99
- propType: PROP_TYPES.BOOLEAN
100
- },
101
- caretHidden: {
102
- group: GROUPS.advanced,
103
- label: "Hide Caret",
104
- description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
105
- editable: true,
106
- required: false,
107
- defaultValue: null,
108
- formType: FORM_TYPES.boolean,
109
- propType: PROP_TYPES.BOOLEAN
110
- },
111
- contextMenuHidden: {
112
- group: GROUPS.advanced,
113
- label: "Hide Context Menu",
114
- description: "Hides the system context menu (Default: false)",
115
- editable: true,
116
- required: false,
117
- defaultValue: null,
118
- formType: FORM_TYPES.boolean,
119
- propType: PROP_TYPES.BOOLEAN
120
- },
121
- editable: {
122
- group: GROUPS.advanced,
123
- label: "Editable",
124
- description: "If false, the text is not editable",
125
- editable: true,
126
- required: false,
127
- defaultValue: true,
128
- formType: FORM_TYPES.boolean,
129
- propType: PROP_TYPES.BOOLEAN
130
- },
131
- keyboardAppearance: {
132
- group: GROUPS.advanced,
133
- label: "Keyboard Appearance",
134
- description: "Determines the color of the keyboard.(iOS Only)",
135
- editable: true,
136
- required: false,
137
- defaultValue: null,
138
- options: ["default", "light", "dark"],
139
- formType: FORM_TYPES.flatArray,
140
- propType: PROP_TYPES.STRING
141
- },
142
- keyboardType: {
143
- group: GROUPS.advanced,
144
- label: "Keyboard Type",
145
- description: "Determines what keyboard is given to the user.",
146
- editable: true,
147
- required: false,
148
- defaultValue: null,
149
- options: ["numeric", "numbers-and-punctuation", "number-pad"],
150
- formType: FORM_TYPES.flatArray,
151
- propType: PROP_TYPES.STRING
152
- },
153
- maxLength: {
154
- group: GROUPS.basic,
155
- label: "Max Length",
156
- description: "Limits the input to a set number of characters.",
157
- editable: true,
158
- required: false,
159
- defaultValue: null,
160
- min: 0,
161
- step: 1,
162
- precision: 0,
163
- formType: FORM_TYPES.number,
164
- propType: PROP_TYPES.NUMBER
165
- },
166
- placeholder: {
167
- group: GROUPS.basic,
168
- label: "Placeholder Text",
169
- description: "The text that is shown on load when no value is available.",
170
- editable: true,
171
- required: false,
172
- defaultValue: "Enter a number...",
173
- formType: FORM_TYPES.string,
174
- propType: PROP_TYPES.STRING
175
- },
176
- placeholderTextColor: {
177
- group: GROUPS.basic,
178
- label: "Placeholder Text Color",
179
- description: "The color of the placeholder text.",
180
- editable: true,
181
- required: false,
182
- defaultValue: null,
183
- formType: FORM_TYPES.color,
184
- propType: PROP_TYPES.STRING
185
- },
186
- returnKeyLabel: {
187
- group: GROUPS.advanced,
188
- label: "Return Key Label",
189
- description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
190
- editable: true,
191
- required: false,
192
- defaultValue: null,
193
- formType: FORM_TYPES.string,
194
- propType: PROP_TYPES.STRING
195
- },
196
- returnKeyType: {
197
- group: GROUPS.advanced,
198
- label: "Return Key Type",
199
- description: "Determines how the return key should look like",
200
- editable: true,
201
- required: false,
202
- defaultValue: null,
203
- options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
204
- formType: FORM_TYPES.flatArray,
205
- propType: PROP_TYPES.STRING
206
- },
207
- selectionColor: {
208
- group: GROUPS.advanced,
209
- label: "Selection Color",
210
- description: "Color of the highlighted portion when selecting.",
211
- editable: true,
212
- required: false,
213
- defaultValue: null,
214
- formType: FORM_TYPES.color,
215
- propType: PROP_TYPES.STRING
216
- },
217
- selectTextOnFocus: {
218
- group: GROUPS.advanced,
219
- label: "Select Text on Focus",
220
- description: "If true, all the text will automatically be selected on focus",
221
- editable: true,
222
- required: false,
223
- defaultValue: null,
224
- formType: FORM_TYPES.boolean,
225
- propType: PROP_TYPES.BOOLEAN
226
- }
229
+ ...NUMBER_INPUT_PROPS
227
230
  }
228
231
  }];
@@ -0,0 +1,70 @@
1
+ import { COMPONENT_TYPES, createTextProp, createTextEnumProp, createBoolProp, createColorProp } from "@draftbit/types";
2
+ export const SEED_DATA = [{
3
+ name: "TabView",
4
+ tag: "TabView",
5
+ category: COMPONENT_TYPES.container,
6
+ layout: {},
7
+ props: {
8
+ tabBarPosition: createTextEnumProp({
9
+ label: "Tab Bar Position",
10
+ description: "Tab Bar Position",
11
+ options: ["top", "bottom"],
12
+ defaultValue: "top"
13
+ }),
14
+ keyboardDismissMode: createTextEnumProp({
15
+ label: "Keyboard Dismiss Mode",
16
+ description: "Keyboard Dismiss Mode",
17
+ options: ["auto", "on-drag", "none"],
18
+ defaultValue: "auto"
19
+ }),
20
+ swipeEnabled: createBoolProp({
21
+ label: "Swipe Enabled",
22
+ description: "Swipe Enabled",
23
+ defaultValue: true
24
+ }),
25
+ scrollEnabled: createBoolProp({
26
+ label: "Scroll Enabled",
27
+ description: "Scroll Enabled",
28
+ defaultValue: true
29
+ }),
30
+ activeColor: createColorProp({
31
+ label: "Active Color",
32
+ description: "Active Color",
33
+ defaultValue: "primary"
34
+ }),
35
+ inactiveColor: createColorProp({
36
+ label: "Inactive Color",
37
+ description: "Inactive Color",
38
+ defaultValue: null
39
+ }),
40
+ pressColor: createColorProp({
41
+ label: "Press Color",
42
+ description: "Press Color",
43
+ defaultValue: null
44
+ }),
45
+ indicatorColor: createColorProp({
46
+ label: "Indicator Color",
47
+ description: "Indicator Color",
48
+ defaultValue: null
49
+ })
50
+ }
51
+ }, {
52
+ name: "TabViewItem",
53
+ tag: "TabViewItem",
54
+ category: COMPONENT_TYPES.container,
55
+ layout: {},
56
+ props: {
57
+ title: createTextProp({
58
+ label: "Title",
59
+ description: "Tab Title"
60
+ }),
61
+ id: createTextProp({
62
+ label: "Id",
63
+ description: "Tab Id"
64
+ }),
65
+ accessibilityLabel: createTextProp({
66
+ label: "Accessibility Label",
67
+ description: "Accessibility Label"
68
+ })
69
+ }
70
+ }];