@draftbit/core 46.1.4 → 46.2.1-d40959.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.
Files changed (279) hide show
  1. package/lib/commonjs/components/CardContainerShortImage.js +18 -5
  2. package/lib/commonjs/components/CardContainerShortImage.js.map +1 -1
  3. package/lib/commonjs/components/Carousel.js +3 -1
  4. package/lib/commonjs/components/Carousel.js.map +1 -1
  5. package/lib/commonjs/components/Config.js +3 -3
  6. package/lib/commonjs/components/Config.js.map +1 -1
  7. package/lib/commonjs/components/DatePicker/DatePicker.js +3 -3
  8. package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
  9. package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
  10. package/lib/commonjs/components/DeprecatedButton.js +20 -4
  11. package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
  12. package/lib/commonjs/components/Justification.js +3 -0
  13. package/lib/commonjs/components/Picker/Picker.js +4 -5
  14. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  15. package/lib/commonjs/components/Picker/PickerComponent.android.js +2 -2
  16. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
  17. package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
  18. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
  19. package/lib/commonjs/components/Picker/PickerComponent.web.js +2 -2
  20. package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
  21. package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
  22. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  23. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
  24. package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
  25. package/lib/commonjs/components/ResizeMode.js +3 -0
  26. package/lib/commonjs/components/StepIndicator.js +1 -1
  27. package/lib/commonjs/components/StepIndicator.js.map +1 -1
  28. package/lib/commonjs/components/Stepper.js +1 -1
  29. package/lib/commonjs/components/Stepper.js.map +1 -1
  30. package/lib/commonjs/constants.js +1 -1
  31. package/lib/commonjs/mappings/CustomCode.js.map +1 -1
  32. package/lib/commonjs/mappings/DatePicker.js +10 -0
  33. package/lib/commonjs/mappings/DatePicker.js.map +1 -1
  34. package/lib/commonjs/mappings/ImageBackground.js.map +1 -1
  35. package/lib/commonjs/mappings/MapMarker.js.map +1 -1
  36. package/lib/commonjs/mappings/NumberInput.js +241 -0
  37. package/lib/commonjs/mappings/NumberInput.js.map +1 -0
  38. package/lib/commonjs/mappings/RadioButton.js.map +1 -1
  39. package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
  40. package/lib/commonjs/mappings/SafeAreaView.js.map +1 -1
  41. package/lib/commonjs/mappings/Text.js +33 -26
  42. package/lib/commonjs/mappings/Text.js.map +1 -1
  43. package/lib/commonjs/mappings/TextArea.js +181 -2
  44. package/lib/commonjs/mappings/TextArea.js.map +1 -1
  45. package/lib/commonjs/mappings/TextField.js +191 -2
  46. package/lib/commonjs/mappings/TextField.js.map +1 -1
  47. package/lib/commonjs/mappings/TextInput.js +180 -29
  48. package/lib/commonjs/mappings/TextInput.js.map +1 -1
  49. package/lib/commonjs/styles/overlay.js.map +1 -1
  50. package/lib/commonjs/utilities.js +1 -1
  51. package/lib/commonjs/utilities.js.map +1 -1
  52. package/lib/module/components/Carousel.js +3 -1
  53. package/lib/module/components/Carousel.js.map +1 -1
  54. package/lib/module/components/Config.js +3 -3
  55. package/lib/module/components/Config.js.map +1 -1
  56. package/lib/module/components/DatePicker/DatePicker.js +3 -3
  57. package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
  58. package/lib/module/components/Justification.js +1 -1
  59. package/lib/module/components/Picker/Picker.js +4 -5
  60. package/lib/module/components/Picker/Picker.js.map +1 -1
  61. package/lib/module/components/Picker/PickerComponent.android.js +2 -2
  62. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  63. package/lib/module/components/Picker/PickerComponent.ios.js +2 -2
  64. package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
  65. package/lib/module/components/Picker/PickerComponent.web.js +2 -2
  66. package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
  67. package/lib/module/components/RadioButton/RadioButton.js +1 -1
  68. package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
  69. package/lib/module/components/RadioButton/RadioButtonRow.js +1 -1
  70. package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
  71. package/lib/module/components/ResizeMode.js +1 -1
  72. package/lib/module/components/StepIndicator.js +1 -1
  73. package/lib/module/components/StepIndicator.js.map +1 -1
  74. package/lib/module/components/Stepper.js +1 -1
  75. package/lib/module/components/Stepper.js.map +1 -1
  76. package/lib/module/mappings/DatePicker.js +10 -0
  77. package/lib/module/mappings/DatePicker.js.map +1 -1
  78. package/lib/module/mappings/NumberInput.js +231 -0
  79. package/lib/module/mappings/NumberInput.js.map +1 -0
  80. package/lib/module/mappings/Text.js +33 -26
  81. package/lib/module/mappings/Text.js.map +1 -1
  82. package/lib/module/mappings/TextArea.js +182 -3
  83. package/lib/module/mappings/TextArea.js.map +1 -1
  84. package/lib/module/mappings/TextField.js +192 -3
  85. package/lib/module/mappings/TextField.js.map +1 -1
  86. package/lib/module/mappings/TextInput.js +180 -29
  87. package/lib/module/mappings/TextInput.js.map +1 -1
  88. package/lib/module/utilities.js +1 -1
  89. package/lib/module/utilities.js.map +1 -1
  90. package/lib/typescript/src/mappings/DatePicker.d.ts +10 -0
  91. package/lib/typescript/src/mappings/NumberInput.d.ts +297 -0
  92. package/lib/typescript/src/mappings/Text.d.ts +24 -10
  93. package/lib/typescript/src/mappings/TextArea.d.ts +1 -11
  94. package/lib/typescript/src/mappings/TextField.d.ts +4 -4
  95. package/lib/typescript/src/mappings/TextInput.d.ts +3 -254
  96. package/package.json +2 -2
  97. package/src/Provider.js +9 -0
  98. package/src/components/Accordion/AccordionGroup.js +44 -0
  99. package/src/components/Accordion/AccordionItem.js +32 -0
  100. package/src/components/Accordion/index.js +2 -0
  101. package/src/components/ActionSheet/ActionSheet.js +45 -0
  102. package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
  103. package/src/components/ActionSheet/ActionSheetItem.js +30 -0
  104. package/src/components/ActionSheet/index.js +3 -0
  105. package/src/components/AnimatedCircularProgress.js +43 -0
  106. package/src/components/AspectRatio.js +18 -0
  107. package/src/components/AvatarEdit.js +30 -0
  108. package/src/components/Banner.js +109 -0
  109. package/src/components/Button.js +112 -0
  110. package/src/components/Card.js +57 -0
  111. package/src/components/CardBlock.js +54 -0
  112. package/src/components/CardContainer.js +69 -0
  113. package/src/components/CardContainerRating.js +79 -0
  114. package/src/components/CardContainerShortImage.js +33 -0
  115. package/src/components/CardInline.js +36 -0
  116. package/src/components/Carousel.js +68 -0
  117. package/src/components/Checkbox/Checkbox.js +63 -0
  118. package/src/components/Checkbox/CheckboxGroup.js +21 -0
  119. package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
  120. package/src/components/Checkbox/CheckboxRow.js +78 -0
  121. package/src/components/Checkbox/context.js +14 -0
  122. package/src/components/Checkbox/index.js +3 -0
  123. package/src/components/CircleImage.js +8 -0
  124. package/src/components/CircularProgress.js +81 -0
  125. package/src/components/Config.js +63 -0
  126. package/src/components/Container.js +43 -0
  127. package/src/components/DatePicker/DatePicker.js +368 -0
  128. package/src/components/DatePicker/DatePickerComponent.js +13 -0
  129. package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
  130. package/src/components/DatePicker/DatePickerComponentType.js +1 -0
  131. package/src/components/DeprecatedButton.js +95 -0
  132. package/src/components/DeprecatedCardWrapper.js +18 -0
  133. package/src/components/DeprecatedFAB.js +115 -0
  134. package/src/components/Divider.js +13 -0
  135. package/src/components/Elevation.js +20 -0
  136. package/src/components/FAB.js +46 -0
  137. package/src/components/FieldSearchBarFull.js +53 -0
  138. package/src/components/FormRow.js +19 -0
  139. package/src/components/Header.js +44 -0
  140. package/src/components/HeaderLarge.js +7 -0
  141. package/src/components/HeaderMedium.js +7 -0
  142. package/src/components/HeaderOverline.js +7 -0
  143. package/src/components/IconButton.js +35 -0
  144. package/src/components/Image.js +47 -0
  145. package/src/components/Justification.js +1 -0
  146. package/src/components/Layout.js +50 -0
  147. package/src/components/NumberInput.js +49 -0
  148. package/src/components/Picker/Picker.js +267 -0
  149. package/src/components/Picker/Picker.tsx +8 -6
  150. package/src/components/Picker/PickerComponent.android.js +69 -0
  151. package/src/components/Picker/PickerComponent.ios.js +79 -0
  152. package/src/components/Picker/PickerComponent.web.js +70 -0
  153. package/src/components/Picker/PickerTypes.js +1 -0
  154. package/src/components/Portal/Portal.js +35 -0
  155. package/src/components/Portal/PortalConsumer.js +27 -0
  156. package/src/components/Portal/PortalHost.js +107 -0
  157. package/src/components/Portal/PortalManager.js +32 -0
  158. package/src/components/ProgressBar.js +118 -0
  159. package/src/components/ProgressCircle.js +13 -0
  160. package/src/components/ProgressIndicator.js +27 -0
  161. package/src/components/RadioButton/RadioButton.js +17 -0
  162. package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
  163. package/src/components/RadioButton/RadioButtonGroup.js +43 -0
  164. package/src/components/RadioButton/RadioButtonRow.js +76 -0
  165. package/src/components/RadioButton/context.js +14 -0
  166. package/src/components/RadioButton/index.js +4 -0
  167. package/src/components/ResizeMode.js +1 -0
  168. package/src/components/Row.js +48 -0
  169. package/src/components/RowBodyIcon.js +8 -0
  170. package/src/components/RowHeadlineImageCaption.js +12 -0
  171. package/src/components/RowHeadlineImageIcon.js +14 -0
  172. package/src/components/ScreenContainer.js +34 -0
  173. package/src/components/Slider.js +63 -0
  174. package/src/components/StarRating.js +50 -0
  175. package/src/components/StepIndicator.js +346 -0
  176. package/src/components/Stepper.js +39 -0
  177. package/src/components/Surface.js +32 -0
  178. package/src/components/Swiper/Swiper.js +29 -0
  179. package/src/components/Swiper/SwiperItem.js +9 -0
  180. package/src/components/Swiper/index.js +2 -0
  181. package/src/components/Switch.js +56 -0
  182. package/src/components/Text.js +27 -0
  183. package/src/components/TextField.js +423 -0
  184. package/src/components/ToggleButton.js +39 -0
  185. package/src/components/Touchable.js +12 -0
  186. package/src/components/Touchable.web.js +2 -0
  187. package/src/components/Typography.js +36 -0
  188. package/src/components/useAuthState.js +31 -0
  189. package/src/constants.js +10 -0
  190. package/src/hooks.js +12 -0
  191. package/src/index.js +52 -0
  192. package/src/interfaces/Icon.js +8 -0
  193. package/src/mappings/Accordion.js +41 -0
  194. package/src/mappings/AccordionItem.js +16 -0
  195. package/src/mappings/ActionSheet.js +13 -0
  196. package/src/mappings/ActionSheetCancel.js +19 -0
  197. package/src/mappings/ActionSheetItem.js +23 -0
  198. package/src/mappings/ActivityIndicator.js +53 -0
  199. package/src/mappings/AudioPlayer.js +20 -0
  200. package/src/mappings/AvatarEdit.js +37 -0
  201. package/src/mappings/Banner.js +32 -0
  202. package/src/mappings/BlurView.js +41 -0
  203. package/src/mappings/Button.js +56 -0
  204. package/src/mappings/Card.js +52 -0
  205. package/src/mappings/CardBlock.js +122 -0
  206. package/src/mappings/CardContainer.js +102 -0
  207. package/src/mappings/CardContainerRating.js +124 -0
  208. package/src/mappings/CardContainerShortImage.js +118 -0
  209. package/src/mappings/CardInline.js +51 -0
  210. package/src/mappings/Carousel.js +18 -0
  211. package/src/mappings/Checkbox.js +45 -0
  212. package/src/mappings/CheckboxGroup.js +25 -0
  213. package/src/mappings/CheckboxRow.js +56 -0
  214. package/src/mappings/CircleImage.js +24 -0
  215. package/src/mappings/Container.js +29 -0
  216. package/src/mappings/CustomCode.js +8 -0
  217. package/src/mappings/DatePicker.js +157 -0
  218. package/src/mappings/DatePicker.ts +10 -0
  219. package/src/mappings/Divider.js +26 -0
  220. package/src/mappings/FAB.js +36 -0
  221. package/src/mappings/Fetch.js +12 -0
  222. package/src/mappings/FieldSearchBarFull.js +49 -0
  223. package/src/mappings/FlatList.js +19 -0
  224. package/src/mappings/HeaderLarge.js +28 -0
  225. package/src/mappings/HeaderMedium.js +54 -0
  226. package/src/mappings/HeaderOverline.js +54 -0
  227. package/src/mappings/Icon.js +25 -0
  228. package/src/mappings/IconButton.js +30 -0
  229. package/src/mappings/Image.js +15 -0
  230. package/src/mappings/ImageBackground.js +28 -0
  231. package/src/mappings/KeyboardAvoidingView.js +40 -0
  232. package/src/mappings/KeyboardAwareScrollView.js +49 -0
  233. package/src/mappings/Layout.js +195 -0
  234. package/src/mappings/LinearGradient.js +77 -0
  235. package/src/mappings/MapCallout.js +21 -0
  236. package/src/mappings/MapMarker.js +47 -0
  237. package/src/mappings/MapView.js +138 -0
  238. package/src/mappings/Modal.js +41 -0
  239. package/src/mappings/NumberInput.js +248 -0
  240. package/src/mappings/NumberInput.ts +267 -0
  241. package/src/mappings/Picker.js +139 -0
  242. package/src/mappings/ProgressBar.js +100 -0
  243. package/src/mappings/ProgressCircle.js +108 -0
  244. package/src/mappings/ProgressIndicator.js +180 -0
  245. package/src/mappings/RadioButton.js +50 -0
  246. package/src/mappings/RadioButtonGroup.js +16 -0
  247. package/src/mappings/RadioButtonRow.js +37 -0
  248. package/src/mappings/RowBodyIcon.js +75 -0
  249. package/src/mappings/RowHeadlineImageCaption.js +167 -0
  250. package/src/mappings/RowHeadlineImageIcon.js +99 -0
  251. package/src/mappings/SafeAreaView.js +33 -0
  252. package/src/mappings/ScrollView.js +30 -0
  253. package/src/mappings/Slider.js +59 -0
  254. package/src/mappings/StarRating.js +42 -0
  255. package/src/mappings/Stepper.js +28 -0
  256. package/src/mappings/Surface.js +13 -0
  257. package/src/mappings/Swiper.js +60 -0
  258. package/src/mappings/SwiperItem.js +8 -0
  259. package/src/mappings/Switch.js +75 -0
  260. package/src/mappings/Text.js +239 -0
  261. package/src/mappings/Text.ts +34 -27
  262. package/src/mappings/TextArea.js +259 -0
  263. package/src/mappings/TextArea.ts +216 -3
  264. package/src/mappings/TextField.js +375 -0
  265. package/src/mappings/TextField.ts +227 -3
  266. package/src/mappings/TextInput.js +385 -0
  267. package/src/mappings/TextInput.ts +214 -34
  268. package/src/mappings/ToggleButton.js +45 -0
  269. package/src/mappings/Touchable.js +12 -0
  270. package/src/mappings/Video.js +74 -0
  271. package/src/mappings/View.js +206 -0
  272. package/src/mappings/WebView.js +18 -0
  273. package/src/styles/DarkTheme.js +26 -0
  274. package/src/styles/DefaultTheme.js +111 -0
  275. package/src/styles/fonts.js +62 -0
  276. package/src/styles/overlay.js +60 -0
  277. package/src/styles/shadow.js +51 -0
  278. package/src/theming.js +3 -0
  279. package/src/utilities.js +102 -0
@@ -0,0 +1,59 @@
1
+ import { COMPONENT_TYPES, GROUPS, createNumberProp, createColorProp, createFieldNameProp, createIconProp, Triggers, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Slider",
4
+ tag: "Slider",
5
+ description: "A component used to set a value in a range",
6
+ category: COMPONENT_TYPES.input,
7
+ layout: {
8
+ marginLeft: 12,
9
+ marginRight: 12,
10
+ },
11
+ triggers: [Triggers.OnValueChange],
12
+ props: {
13
+ fieldName: createFieldNameProp({
14
+ defaultValue: "sliderValue",
15
+ handlerPropName: "onValueChange",
16
+ valuePropName: "value",
17
+ }),
18
+ minimumValue: createNumberProp({
19
+ group: GROUPS.basic,
20
+ label: "Min Value",
21
+ min: 0,
22
+ max: 1000,
23
+ }),
24
+ maximumValue: createNumberProp({
25
+ group: GROUPS.basic,
26
+ label: "Max Value",
27
+ min: 1,
28
+ max: 10000,
29
+ }),
30
+ step: createNumberProp({
31
+ group: GROUPS.basic,
32
+ label: "Step",
33
+ min: 0,
34
+ max: 100,
35
+ step: 0.01,
36
+ precision: 2,
37
+ }),
38
+ leftIcon: createIconProp({
39
+ label: "Left Icon",
40
+ defaultValue: null,
41
+ }),
42
+ rightIcon: createIconProp({
43
+ label: "Right Icon",
44
+ defaultValue: null,
45
+ }),
46
+ minimumTrackTintColor: createColorProp({
47
+ label: "Min Track Color",
48
+ defaultValue: null,
49
+ }),
50
+ maximumTrackTintColor: createColorProp({
51
+ label: "Max Track Color",
52
+ defaultValue: null,
53
+ }),
54
+ thumbTintColor: createColorProp({
55
+ label: "Thumb Color",
56
+ defaultValue: null,
57
+ }),
58
+ },
59
+ };
@@ -0,0 +1,42 @@
1
+ import { COMPONENT_TYPES, createStaticNumberProp, createFieldNameProp, createStaticBoolProp, Triggers, createColorProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Star Rating",
4
+ tag: "StarRating",
5
+ description: "A star rating component",
6
+ category: COMPONENT_TYPES.button,
7
+ triggers: [Triggers.OnPress],
8
+ props: {
9
+ starSize: createStaticNumberProp({
10
+ label: "Star size",
11
+ description: "Size of each individual star",
12
+ defaultValue: 16,
13
+ min: 8,
14
+ max: 36,
15
+ step: 1,
16
+ }),
17
+ fieldName: createFieldNameProp({
18
+ defaultValue: "ratingValue",
19
+ handlerPropName: "onPress",
20
+ valuePropName: "rating", // the value prop in this component
21
+ }),
22
+ maxStars: createStaticNumberProp({
23
+ label: "Max stars",
24
+ description: "The max number of stars",
25
+ defaultValue: 5,
26
+ min: 0,
27
+ max: 10,
28
+ step: 1,
29
+ }),
30
+ isEditable: createStaticBoolProp({
31
+ label: "Editable",
32
+ }),
33
+ activeColor: createColorProp({
34
+ label: "Active Color",
35
+ defaultValue: "primary",
36
+ }),
37
+ inactiveColor: createColorProp({
38
+ label: "Inactive Color",
39
+ defaultValue: "divider",
40
+ }),
41
+ },
42
+ };
@@ -0,0 +1,28 @@
1
+ import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, createStaticNumberProp, Triggers, } from "@draftbit/types";
2
+ export const SEED_DATA = [
3
+ {
4
+ name: "Stepper",
5
+ tag: "Stepper",
6
+ description: "A component used to control the quantity of something",
7
+ category: COMPONENT_TYPES.input,
8
+ layout: {},
9
+ triggers: [Triggers.OnChange],
10
+ props: {
11
+ fieldName: createFieldNameProp({
12
+ defaultValue: "stepperValue",
13
+ handlerPropName: "onChange",
14
+ valuePropName: "value",
15
+ }),
16
+ iconSize: createIconSizeProp({ defaultValue: 24 }),
17
+ iconColor: createColorProp({ defaultValue: "strong" }),
18
+ min: createStaticNumberProp({
19
+ label: "Minimum",
20
+ description: "Minimum Number",
21
+ }),
22
+ max: createStaticNumberProp({
23
+ label: "Maximum",
24
+ description: "Maximum Number",
25
+ }),
26
+ },
27
+ },
28
+ ];
@@ -0,0 +1,13 @@
1
+ import { COMPONENT_TYPES, createElevationType } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Surface",
4
+ tag: "Surface",
5
+ description: "An elevated container",
6
+ category: COMPONENT_TYPES.layout,
7
+ layout: {
8
+ minHeight: 40,
9
+ },
10
+ props: {
11
+ elevation: createElevationType(0),
12
+ },
13
+ };
@@ -0,0 +1,60 @@
1
+ import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Swiper",
4
+ tag: "Swiper",
5
+ description: "Swiper container",
6
+ category: COMPONENT_TYPES.container,
7
+ layout: {
8
+ height: 300,
9
+ width: "100%",
10
+ },
11
+ props: {
12
+ from: createNumberProp({
13
+ group: GROUPS.basic,
14
+ label: "Initial Slide",
15
+ }),
16
+ loop: createBoolProp({
17
+ group: GROUPS.basic,
18
+ label: "Loop",
19
+ }),
20
+ timeout: createNumberProp({
21
+ group: GROUPS.basic,
22
+ label: "Timeout",
23
+ defaultValue: 0,
24
+ }),
25
+ vertical: createBoolProp({
26
+ group: GROUPS.basic,
27
+ label: "Vertical",
28
+ defaultValue: false,
29
+ }),
30
+ prevTitle: createTextProp({
31
+ group: GROUPS.basic,
32
+ label: "Previous Title",
33
+ defaultValue: "",
34
+ }),
35
+ nextTitle: createTextProp({
36
+ group: GROUPS.basic,
37
+ label: "Next Title",
38
+ defaultValue: "",
39
+ }),
40
+ prevTitleColor: createColorProp({
41
+ label: "Previous Title Color",
42
+ }),
43
+ nextTitleColor: createColorProp({
44
+ label: "Next Title Color",
45
+ }),
46
+ dotColor: createColorProp({
47
+ label: "Dot Color",
48
+ defaultValue: "light",
49
+ }),
50
+ dotActiveColor: createColorProp({
51
+ label: "Dot Active Color",
52
+ defaultValue: "primary",
53
+ }),
54
+ dotsTouchable: createBoolProp({
55
+ group: GROUPS.basic,
56
+ label: "Dots Touchable",
57
+ defaultValue: true,
58
+ }),
59
+ },
60
+ };
@@ -0,0 +1,8 @@
1
+ import { COMPONENT_TYPES } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Swiper Item",
4
+ tag: "SwiperItem",
5
+ description: "Swiper item",
6
+ category: COMPONENT_TYPES.button,
7
+ props: {},
8
+ };
@@ -0,0 +1,75 @@
1
+ import { COMPONENT_TYPES, GROUPS, createBoolProp, createColorProp, createFieldNameProp, createTextProp, createRowDirectionProp, Triggers, } from "@draftbit/types";
2
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
+ export const SEED_DATA = [
4
+ {
5
+ name: "Switch",
6
+ tag: "Switch",
7
+ category: COMPONENT_TYPES.input,
8
+ layout: {},
9
+ triggers: SEED_DATA_TRIGGERS,
10
+ props: {
11
+ disabled: createBoolProp({
12
+ label: "Disabled",
13
+ description: "Boolean to handle disabling the switch",
14
+ }),
15
+ fieldName: createFieldNameProp({
16
+ handlerPropName: "onValueChange",
17
+ valuePropName: "value",
18
+ defaultValue: "switchValue",
19
+ }),
20
+ activeTrackColor: createColorProp({
21
+ label: "Active Track Color",
22
+ }),
23
+ inactiveTrackColor: createColorProp({
24
+ label: "Inactive Track Color",
25
+ }),
26
+ activeThumbColor: createColorProp({
27
+ label: "Active Thumb Color",
28
+ }),
29
+ inactiveThumbColor: createColorProp({
30
+ label: "Inactive Thumb Color",
31
+ }),
32
+ },
33
+ },
34
+ {
35
+ name: "Switch Row",
36
+ tag: "SwitchRow",
37
+ category: COMPONENT_TYPES.input,
38
+ layout: {
39
+ marginLeft: 0,
40
+ marginRight: 0,
41
+ },
42
+ triggers: SEED_DATA_TRIGGERS,
43
+ props: {
44
+ label: createTextProp({
45
+ label: "Label",
46
+ description: "Label to show with the checkbox",
47
+ required: true,
48
+ defaultValue: "First Option",
49
+ }),
50
+ direction: createRowDirectionProp(),
51
+ disabled: createBoolProp({
52
+ label: "Disabled",
53
+ description: "Boolean to handle disabling the switch",
54
+ group: GROUPS.data,
55
+ }),
56
+ fieldName: createFieldNameProp({
57
+ handlerPropName: "onValueChange",
58
+ valuePropName: "value",
59
+ defaultValue: "switchValue",
60
+ }),
61
+ activeTrackColor: createColorProp({
62
+ label: "Active Track Color",
63
+ }),
64
+ inactiveTrackColor: createColorProp({
65
+ label: "Inactive Track Color",
66
+ }),
67
+ activeThumbColor: createColorProp({
68
+ label: "Active Thumb Color",
69
+ }),
70
+ inactiveThumbColor: createColorProp({
71
+ label: "Inactive Thumb Color",
72
+ }),
73
+ },
74
+ },
75
+ ];
@@ -0,0 +1,239 @@
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, Triggers, createActionProp, createTextProp, } from "@draftbit/types";
2
+ const SEED_DATA_PROPS = {
3
+ accessibilityLabel: {
4
+ group: GROUPS.accessibility,
5
+ name: "accessibilityLabel",
6
+ label: "accessibilityLabel",
7
+ description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
8
+ editable: true,
9
+ required: false,
10
+ formType: FORM_TYPES.string,
11
+ propType: PROP_TYPES.STRING,
12
+ defaultValue: null,
13
+ },
14
+ accessibilityHint: {
15
+ group: GROUPS.accessibility,
16
+ name: "accessibilityHint",
17
+ label: "accessibilityHint",
18
+ description: "An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.",
19
+ editable: true,
20
+ required: false,
21
+ formType: FORM_TYPES.string,
22
+ propType: PROP_TYPES.STRING,
23
+ defaultValue: null,
24
+ },
25
+ accessibilityRole: {
26
+ group: GROUPS.accessibility,
27
+ name: "accessibilityRole",
28
+ label: "accessibilityRole",
29
+ description: "Tells the screen reader to treat the currently focused on element as having a specific role.Possible values for AccessibilityRole is one of:\n'none' - The element has no role.\n'button' - The element should be treated as a button.\n'link' - The element should be treated as a link.\n'header' - The element is a header that divides content into sections.\n'search' - The element should be treated as a search field.\n'image' - The element should be treated as an image.\n'key' - The element should be treated like a keyboard key.\n'text' - The element should be treated as text.\n'summary' - The element provides app summary information.\n'imagebutton' - The element has the role of both an image and also a button.\n'adjustable' - The element allows adjustment over a range of values.\nOn iOS, these roles map to corresponding Accessibility Traits. Image button has the same functionality as if the trait was set to both 'image' and 'button'. See the Accessibility guide for more information.On Android, these roles have similar functionality on TalkBack as adding Accessibility Traits does on Voiceover in iOS",
30
+ options: [
31
+ "none",
32
+ "button",
33
+ "link",
34
+ "header",
35
+ "search",
36
+ "image",
37
+ "key",
38
+ "text",
39
+ "summary",
40
+ "imagebutton",
41
+ "adjustable",
42
+ ],
43
+ editable: true,
44
+ required: false,
45
+ formType: FORM_TYPES.flatArray,
46
+ propType: PROP_TYPES.STRING,
47
+ defaultValue: null,
48
+ },
49
+ accessible: {
50
+ group: GROUPS.accessibility,
51
+ name: "accessible",
52
+ label: "accessible",
53
+ description: "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true. See the Accessibility guide for more information.",
54
+ editable: true,
55
+ required: false,
56
+ formType: FORM_TYPES.boolean,
57
+ propType: PROP_TYPES.BOOLEAN,
58
+ defaultValue: null,
59
+ },
60
+ adjustsFontSizeToFit: {
61
+ group: GROUPS.advanced,
62
+ name: "adjustsFontSizeToFit",
63
+ label: "adjustsFontSizeToFit",
64
+ description: "Specifies whether fonts should be scaled down automatically to fit given style constraints.",
65
+ editable: true,
66
+ required: false,
67
+ formType: FORM_TYPES.boolean,
68
+ propType: PROP_TYPES.BOOLEAN,
69
+ defaultValue: null,
70
+ },
71
+ allowFontScaling: {
72
+ group: GROUPS.advanced,
73
+ name: "allowFontScaling",
74
+ label: "allowFontScaling",
75
+ description: "Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.",
76
+ editable: true,
77
+ required: false,
78
+ formType: FORM_TYPES.boolean,
79
+ propType: PROP_TYPES.BOOLEAN,
80
+ defaultValue: null,
81
+ },
82
+ dataDetectorType: {
83
+ group: GROUPS.advanced,
84
+ name: "dataDetectorType",
85
+ label: "dataDetectorType",
86
+ description: "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected. You can provide only one type. Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
87
+ options: ["phoneNumber", "link", "email", "none", "all"],
88
+ editable: true,
89
+ required: false,
90
+ formType: FORM_TYPES.flatArray,
91
+ propType: PROP_TYPES.STRING,
92
+ defaultValue: null,
93
+ },
94
+ disabled: {
95
+ group: GROUPS.basic,
96
+ name: "disabled",
97
+ label: "disabled",
98
+ description: "Specifies the disabled state of the text view for testing purposes",
99
+ editable: true,
100
+ required: false,
101
+ formType: FORM_TYPES.boolean,
102
+ propType: PROP_TYPES.BOOLEAN,
103
+ defaultValue: null,
104
+ },
105
+ ellipsizeMode: {
106
+ group: GROUPS.basic,
107
+ name: "ellipsizeMode",
108
+ label: "Truncate Text?",
109
+ description: 'When numberOfLines is set, this prop defines how text will be truncated. numberOfLines must be set in conjunction with this prop.This can be one of the following values:\nhead - The line is displayed so that the end fits in the container and the missing text at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"\nmiddle - The line is displayed so that the beginning and end fit in the container and the missing text in the middle is indicated by an ellipsis glyph. "ab...yz"\ntail - The line is displayed so that the beginning fits in the container and the missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."\nclip - Lines are not drawn past the edge of the text container.\nThe default is tail.',
110
+ options: ["head", "middle", "tail", "clip"],
111
+ editable: true,
112
+ required: false,
113
+ formType: FORM_TYPES.flatArray,
114
+ propType: PROP_TYPES.STRING,
115
+ defaultValue: null,
116
+ },
117
+ maxFontSizeMultiplier: {
118
+ group: GROUPS.advanced,
119
+ name: "maxFontSizeMultiplier",
120
+ label: "maxFontSizeMultiplier",
121
+ description: "Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:\nnull/undefined (default): inherit from the parent node or the global default (0)\n0: no max, ignore parent/global default\n>= 1: sets the maxFontSizeMultiplier of this node to this value\n",
122
+ editable: true,
123
+ required: false,
124
+ formType: FORM_TYPES.number,
125
+ propType: PROP_TYPES.NUMBER,
126
+ defaultValue: null,
127
+ },
128
+ nativeID: {
129
+ group: GROUPS.accessibility,
130
+ name: "nativeID",
131
+ label: "nativeID",
132
+ description: "Used to locate this view from native code.",
133
+ editable: true,
134
+ required: false,
135
+ formType: FORM_TYPES.string,
136
+ propType: PROP_TYPES.STRING,
137
+ defaultValue: null,
138
+ },
139
+ numberOfLines: {
140
+ group: GROUPS.basic,
141
+ name: "numberOfLines",
142
+ label: "Max # of Lines",
143
+ defaultValue: null,
144
+ description: "Used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number.This prop is commonly used with ellipsizeMode.",
145
+ editable: true,
146
+ required: false,
147
+ formType: FORM_TYPES.number,
148
+ propType: PROP_TYPES.NUMBER,
149
+ step: 1,
150
+ precision: 1,
151
+ },
152
+ selectable: {
153
+ group: GROUPS.advanced,
154
+ name: "selectable",
155
+ label: "selectable",
156
+ description: "Lets the user select text, to use the native copy and paste functionality.",
157
+ editable: true,
158
+ required: false,
159
+ formType: FORM_TYPES.boolean,
160
+ propType: PROP_TYPES.BOOLEAN,
161
+ defaultValue: null,
162
+ },
163
+ selectionColor: {
164
+ group: GROUPS.advanced,
165
+ name: "selectionColor",
166
+ label: "selectionColor",
167
+ description: "The highlight color of the text.",
168
+ editable: true,
169
+ required: false,
170
+ formType: FORM_TYPES.color,
171
+ propType: PROP_TYPES.THEME,
172
+ defaultValue: null,
173
+ },
174
+ suppressHighlighting: {
175
+ group: GROUPS.advanced,
176
+ name: "suppressHighlighting",
177
+ label: "suppressHighlighting",
178
+ description: "When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.",
179
+ editable: true,
180
+ required: false,
181
+ formType: FORM_TYPES.boolean,
182
+ propType: PROP_TYPES.BOOLEAN,
183
+ defaultValue: null,
184
+ },
185
+ textBreakStrategy: {
186
+ group: GROUPS.advanced,
187
+ name: "textBreakStrategy",
188
+ label: "textBreakStrategy",
189
+ description: "Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced The default value is highQuality.",
190
+ options: ["simple", "highQuality", "balanced"],
191
+ editable: true,
192
+ required: false,
193
+ formType: FORM_TYPES.flatArray,
194
+ propType: PROP_TYPES.STRING,
195
+ defaultValue: null,
196
+ },
197
+ };
198
+ export const SEED_DATA = [
199
+ {
200
+ name: "Text",
201
+ tag: "Text",
202
+ description: "A basic Text component",
203
+ category: COMPONENT_TYPES.basic,
204
+ layout: {
205
+ color: "strong", // This is translated on collector script run by the extractValueAndType function
206
+ },
207
+ props: {
208
+ ...SEED_DATA_PROPS,
209
+ children: {
210
+ group: GROUPS.data,
211
+ label: "Text",
212
+ description: "Text",
213
+ editable: true,
214
+ required: true,
215
+ formType: FORM_TYPES.string,
216
+ propType: PROP_TYPES.STRING,
217
+ defaultValue: "Double click me to edit 👀",
218
+ },
219
+ },
220
+ },
221
+ {
222
+ name: "Link",
223
+ tag: "Link",
224
+ category: COMPONENT_TYPES.button,
225
+ layout: {
226
+ color: "primary",
227
+ },
228
+ triggers: [Triggers.OnPress],
229
+ props: {
230
+ ...SEED_DATA_PROPS,
231
+ onPress: createActionProp(),
232
+ title: createTextProp({
233
+ label: "Title",
234
+ description: "Link title",
235
+ defaultValue: "Get Started",
236
+ }),
237
+ },
238
+ },
239
+ ];
@@ -15,7 +15,19 @@ const SEED_DATA_PROPS = {
15
15
  label: "accessibilityLabel",
16
16
  description:
17
17
  "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
18
- editable: false,
18
+ editable: true,
19
+ required: false,
20
+ formType: FORM_TYPES.string,
21
+ propType: PROP_TYPES.STRING,
22
+ defaultValue: null,
23
+ },
24
+ accessibilityHint: {
25
+ group: GROUPS.accessibility,
26
+ name: "accessibilityHint",
27
+ label: "accessibilityHint",
28
+ description:
29
+ "An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.",
30
+ editable: true,
19
31
  required: false,
20
32
  formType: FORM_TYPES.string,
21
33
  propType: PROP_TYPES.STRING,
@@ -40,7 +52,7 @@ const SEED_DATA_PROPS = {
40
52
  "imagebutton",
41
53
  "adjustable",
42
54
  ],
43
- editable: false,
55
+ editable: true,
44
56
  required: false,
45
57
  formType: FORM_TYPES.flatArray,
46
58
  propType: PROP_TYPES.STRING,
@@ -51,8 +63,8 @@ const SEED_DATA_PROPS = {
51
63
  name: "accessible",
52
64
  label: "accessible",
53
65
  description:
54
- "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true.See the Accessibility guide for more information.",
55
- editable: false,
66
+ "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true. See the Accessibility guide for more information.",
67
+ editable: true,
56
68
  required: false,
57
69
  formType: FORM_TYPES.boolean,
58
70
  propType: PROP_TYPES.BOOLEAN,
@@ -64,7 +76,7 @@ const SEED_DATA_PROPS = {
64
76
  label: "adjustsFontSizeToFit",
65
77
  description:
66
78
  "Specifies whether fonts should be scaled down automatically to fit given style constraints.",
67
- editable: false,
79
+ editable: true,
68
80
  required: false,
69
81
  formType: FORM_TYPES.boolean,
70
82
  propType: PROP_TYPES.BOOLEAN,
@@ -76,7 +88,7 @@ const SEED_DATA_PROPS = {
76
88
  label: "allowFontScaling",
77
89
  description:
78
90
  "Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.",
79
- editable: false,
91
+ editable: true,
80
92
  required: false,
81
93
  formType: FORM_TYPES.boolean,
82
94
  propType: PROP_TYPES.BOOLEAN,
@@ -87,9 +99,9 @@ const SEED_DATA_PROPS = {
87
99
  name: "dataDetectorType",
88
100
  label: "dataDetectorType",
89
101
  description:
90
- "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected.You can provide only one type.Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
102
+ "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected. You can provide only one type. Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
91
103
  options: ["phoneNumber", "link", "email", "none", "all"],
92
- editable: false,
104
+ editable: true,
93
105
  required: false,
94
106
  formType: FORM_TYPES.flatArray,
95
107
  propType: PROP_TYPES.STRING,
@@ -101,7 +113,7 @@ const SEED_DATA_PROPS = {
101
113
  label: "disabled",
102
114
  description:
103
115
  "Specifies the disabled state of the text view for testing purposes",
104
- editable: false,
116
+ editable: true,
105
117
  required: false,
106
118
  formType: FORM_TYPES.boolean,
107
119
  propType: PROP_TYPES.BOOLEAN,
@@ -126,26 +138,21 @@ const SEED_DATA_PROPS = {
126
138
  label: "maxFontSizeMultiplier",
127
139
  description:
128
140
  "Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:\nnull/undefined (default): inherit from the parent node or the global default (0)\n0: no max, ignore parent/global default\n>= 1: sets the maxFontSizeMultiplier of this node to this value\n",
129
- editable: false,
141
+ editable: true,
130
142
  required: false,
131
143
  formType: FORM_TYPES.number,
132
144
  propType: PROP_TYPES.NUMBER,
133
145
  defaultValue: null,
134
146
  },
135
- minimumFontScale: {
136
- group: GROUPS.advanced,
137
- name: "minimumFontScale",
138
- label: "minimumFontScale",
139
- description:
140
- "Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).",
141
- editable: false,
147
+ nativeID: {
148
+ group: GROUPS.accessibility,
149
+ name: "nativeID",
150
+ label: "nativeID",
151
+ description: "Used to locate this view from native code.",
152
+ editable: true,
142
153
  required: false,
143
- formType: FORM_TYPES.number,
144
- propType: PROP_TYPES.NUMBER,
145
- min: 0.01,
146
- step: 0.01,
147
- precision: 2,
148
- max: 1.0,
154
+ formType: FORM_TYPES.string,
155
+ propType: PROP_TYPES.STRING,
149
156
  defaultValue: null,
150
157
  },
151
158
  numberOfLines: {
@@ -168,7 +175,7 @@ const SEED_DATA_PROPS = {
168
175
  label: "selectable",
169
176
  description:
170
177
  "Lets the user select text, to use the native copy and paste functionality.",
171
- editable: false,
178
+ editable: true,
172
179
  required: false,
173
180
  formType: FORM_TYPES.boolean,
174
181
  propType: PROP_TYPES.BOOLEAN,
@@ -179,7 +186,7 @@ const SEED_DATA_PROPS = {
179
186
  name: "selectionColor",
180
187
  label: "selectionColor",
181
188
  description: "The highlight color of the text.",
182
- editable: false,
189
+ editable: true,
183
190
  required: false,
184
191
  formType: FORM_TYPES.color,
185
192
  propType: PROP_TYPES.THEME,
@@ -191,7 +198,7 @@ const SEED_DATA_PROPS = {
191
198
  label: "suppressHighlighting",
192
199
  description:
193
200
  "When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.",
194
- editable: false,
201
+ editable: true,
195
202
  required: false,
196
203
  formType: FORM_TYPES.boolean,
197
204
  propType: PROP_TYPES.BOOLEAN,
@@ -204,7 +211,7 @@ const SEED_DATA_PROPS = {
204
211
  description:
205
212
  "Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced The default value is highQuality.",
206
213
  options: ["simple", "highQuality", "balanced"],
207
- editable: false,
214
+ editable: true,
208
215
  required: false,
209
216
  formType: FORM_TYPES.flatArray,
210
217
  propType: PROP_TYPES.STRING,