@draftbit/core 47.1.0 → 47.1.1-1883fa.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 (207) hide show
  1. package/lib/commonjs/components/Justification.js +5 -1
  2. package/lib/commonjs/components/ResizeMode.js +5 -1
  3. package/lib/commonjs/mappings/DatePicker.js +1 -1
  4. package/lib/commonjs/mappings/FlashList.js +37 -3
  5. package/lib/commonjs/mappings/FlatList.js +17 -2
  6. package/lib/commonjs/mappings/ScrollView.js +6 -0
  7. package/lib/commonjs/mappings/TextField.js +2 -2
  8. package/lib/module/components/Justification.js +1 -0
  9. package/lib/module/components/ResizeMode.js +1 -0
  10. package/lib/module/mappings/DatePicker.js +1 -1
  11. package/lib/module/mappings/FlashList.js +38 -4
  12. package/lib/module/mappings/FlatList.js +18 -3
  13. package/lib/module/mappings/ScrollView.js +7 -1
  14. package/lib/module/mappings/TextField.js +2 -2
  15. package/lib/typescript/src/mappings/DatePicker.d.ts +1 -1
  16. package/lib/typescript/src/mappings/FlashList.d.ts +75 -4
  17. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  18. package/lib/typescript/src/mappings/FlatList.d.ts +33 -2
  19. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  20. package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
  21. package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
  22. package/package.json +3 -3
  23. package/src/Provider.js +9 -0
  24. package/src/components/Accordion/AccordionGroup.js +44 -0
  25. package/src/components/Accordion/AccordionItem.js +32 -0
  26. package/src/components/Accordion/index.js +2 -0
  27. package/src/components/ActionSheet/ActionSheet.js +45 -0
  28. package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
  29. package/src/components/ActionSheet/ActionSheetItem.js +30 -0
  30. package/src/components/ActionSheet/index.js +3 -0
  31. package/src/components/AnimatedCircularProgress.js +43 -0
  32. package/src/components/AspectRatio.js +18 -0
  33. package/src/components/AvatarEdit.js +30 -0
  34. package/src/components/Banner.js +109 -0
  35. package/src/components/Button.js +114 -0
  36. package/src/components/Card.js +57 -0
  37. package/src/components/CardBlock.js +54 -0
  38. package/src/components/CardContainer.js +69 -0
  39. package/src/components/CardContainerRating.js +79 -0
  40. package/src/components/CardContainerShortImage.js +33 -0
  41. package/src/components/CardInline.js +36 -0
  42. package/src/components/Carousel.js +68 -0
  43. package/src/components/Checkbox/Checkbox.js +62 -0
  44. package/src/components/Checkbox/CheckboxGroup.js +21 -0
  45. package/src/components/Checkbox/CheckboxGroupRow.js +76 -0
  46. package/src/components/Checkbox/CheckboxRow.js +77 -0
  47. package/src/components/Checkbox/context.js +14 -0
  48. package/src/components/Checkbox/index.js +3 -0
  49. package/src/components/CircleImage.js +8 -0
  50. package/src/components/CircularProgress.js +81 -0
  51. package/src/components/Config.js +64 -0
  52. package/src/components/Container.js +43 -0
  53. package/src/components/DatePicker/DatePicker.js +377 -0
  54. package/src/components/DatePicker/DatePickerComponent.js +13 -0
  55. package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
  56. package/src/components/DatePicker/DatePickerComponentType.js +1 -0
  57. package/src/components/DeprecatedButton.js +83 -0
  58. package/src/components/DeprecatedCardWrapper.js +18 -0
  59. package/src/components/DeprecatedFAB.js +114 -0
  60. package/src/components/Divider.js +13 -0
  61. package/src/components/Elevation.js +20 -0
  62. package/src/components/FAB.js +46 -0
  63. package/src/components/FieldSearchBarFull.js +53 -0
  64. package/src/components/FormRow.js +19 -0
  65. package/src/components/Header.js +44 -0
  66. package/src/components/HeaderLarge.js +7 -0
  67. package/src/components/HeaderMedium.js +7 -0
  68. package/src/components/HeaderOverline.js +7 -0
  69. package/src/components/IconButton.js +35 -0
  70. package/src/components/Image.js +47 -0
  71. package/src/components/Justification.js +1 -0
  72. package/src/components/Layout.js +50 -0
  73. package/src/components/NumberInput.js +49 -0
  74. package/src/components/Picker/Picker.js +267 -0
  75. package/src/components/Picker/PickerComponent.android.js +69 -0
  76. package/src/components/Picker/PickerComponent.ios.js +79 -0
  77. package/src/components/Picker/PickerComponent.web.js +70 -0
  78. package/src/components/Picker/PickerTypes.js +1 -0
  79. package/src/components/Portal/Portal.js +35 -0
  80. package/src/components/Portal/PortalConsumer.js +27 -0
  81. package/src/components/Portal/PortalHost.js +107 -0
  82. package/src/components/Portal/PortalManager.js +32 -0
  83. package/src/components/Pressable.js +12 -0
  84. package/src/components/ProgressBar.js +118 -0
  85. package/src/components/ProgressCircle.js +13 -0
  86. package/src/components/ProgressIndicator.js +27 -0
  87. package/src/components/RadioButton/RadioButton.js +17 -0
  88. package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
  89. package/src/components/RadioButton/RadioButtonGroup.js +43 -0
  90. package/src/components/RadioButton/RadioButtonRow.js +76 -0
  91. package/src/components/RadioButton/context.js +14 -0
  92. package/src/components/RadioButton/index.js +4 -0
  93. package/src/components/ResizeMode.js +1 -0
  94. package/src/components/Row.js +48 -0
  95. package/src/components/RowBodyIcon.js +8 -0
  96. package/src/components/RowHeadlineImageCaption.js +12 -0
  97. package/src/components/RowHeadlineImageIcon.js +14 -0
  98. package/src/components/SVG.js +13 -0
  99. package/src/components/ScreenContainer.js +34 -0
  100. package/src/components/Slider.js +63 -0
  101. package/src/components/StarRating.js +50 -0
  102. package/src/components/StepIndicator.js +346 -0
  103. package/src/components/Stepper.js +41 -0
  104. package/src/components/Surface.js +32 -0
  105. package/src/components/Swiper/Swiper.js +29 -0
  106. package/src/components/Swiper/SwiperItem.js +9 -0
  107. package/src/components/Swiper/index.js +2 -0
  108. package/src/components/Switch.js +56 -0
  109. package/src/components/Text.js +33 -0
  110. package/src/components/TextField.js +428 -0
  111. package/src/components/ToggleButton.js +39 -0
  112. package/src/components/Touchable.js +12 -0
  113. package/src/components/Touchable.web.js +2 -0
  114. package/src/components/Typography.js +36 -0
  115. package/src/components/useAuthState.js +31 -0
  116. package/src/constants.js +10 -0
  117. package/src/hooks.js +12 -0
  118. package/src/index.js +53 -0
  119. package/src/interfaces/Icon.js +8 -0
  120. package/src/mappings/Accordion.js +41 -0
  121. package/src/mappings/AccordionItem.js +16 -0
  122. package/src/mappings/ActionSheet.js +13 -0
  123. package/src/mappings/ActionSheetCancel.js +19 -0
  124. package/src/mappings/ActionSheetItem.js +23 -0
  125. package/src/mappings/ActivityIndicator.js +58 -0
  126. package/src/mappings/AudioPlayer.js +57 -0
  127. package/src/mappings/AvatarEdit.js +38 -0
  128. package/src/mappings/Banner.js +32 -0
  129. package/src/mappings/BlurView.js +42 -0
  130. package/src/mappings/Button.js +116 -0
  131. package/src/mappings/Card.js +52 -0
  132. package/src/mappings/CardBlock.js +123 -0
  133. package/src/mappings/CardContainer.js +104 -0
  134. package/src/mappings/CardContainerRating.js +126 -0
  135. package/src/mappings/CardContainerShortImage.js +120 -0
  136. package/src/mappings/CardInline.js +52 -0
  137. package/src/mappings/Carousel.js +19 -0
  138. package/src/mappings/Checkbox.js +46 -0
  139. package/src/mappings/CheckboxGroup.js +26 -0
  140. package/src/mappings/CheckboxRow.js +61 -0
  141. package/src/mappings/CircleImage.js +25 -0
  142. package/src/mappings/Container.js +30 -0
  143. package/src/mappings/CustomCode.js +8 -0
  144. package/src/mappings/DatePicker.js +176 -0
  145. package/src/mappings/DatePicker.ts +1 -1
  146. package/src/mappings/Divider.js +27 -0
  147. package/src/mappings/FAB.js +37 -0
  148. package/src/mappings/Fetch.js +13 -0
  149. package/src/mappings/FieldSearchBarFull.js +50 -0
  150. package/src/mappings/FlashList.js +113 -0
  151. package/src/mappings/FlashList.ts +42 -4
  152. package/src/mappings/FlatList.js +51 -0
  153. package/src/mappings/FlatList.ts +20 -2
  154. package/src/mappings/HeaderLarge.js +29 -0
  155. package/src/mappings/HeaderMedium.js +55 -0
  156. package/src/mappings/HeaderOverline.js +55 -0
  157. package/src/mappings/Icon.js +32 -0
  158. package/src/mappings/IconButton.js +35 -0
  159. package/src/mappings/Image.js +35 -0
  160. package/src/mappings/ImageBackground.js +29 -0
  161. package/src/mappings/KeyboardAvoidingView.js +41 -0
  162. package/src/mappings/KeyboardAwareScrollView.js +50 -0
  163. package/src/mappings/Layout.js +200 -0
  164. package/src/mappings/LinearGradient.js +77 -0
  165. package/src/mappings/MapCallout.js +21 -0
  166. package/src/mappings/MapMarker.js +47 -0
  167. package/src/mappings/MapView.js +139 -0
  168. package/src/mappings/Modal.js +42 -0
  169. package/src/mappings/NumberInput.js +254 -0
  170. package/src/mappings/Picker.js +148 -0
  171. package/src/mappings/ProgressBar.js +101 -0
  172. package/src/mappings/ProgressCircle.js +109 -0
  173. package/src/mappings/ProgressIndicator.js +181 -0
  174. package/src/mappings/RadioButton.js +51 -0
  175. package/src/mappings/RadioButtonGroup.js +17 -0
  176. package/src/mappings/RadioButtonRow.js +42 -0
  177. package/src/mappings/RowBodyIcon.js +75 -0
  178. package/src/mappings/RowHeadlineImageCaption.js +167 -0
  179. package/src/mappings/RowHeadlineImageIcon.js +99 -0
  180. package/src/mappings/SVG.js +20 -0
  181. package/src/mappings/SafeAreaView.js +33 -0
  182. package/src/mappings/ScrollView.js +37 -0
  183. package/src/mappings/ScrollView.ts +9 -0
  184. package/src/mappings/Slider.js +60 -0
  185. package/src/mappings/StarRating.js +43 -0
  186. package/src/mappings/Stepper.js +32 -0
  187. package/src/mappings/Surface.js +14 -0
  188. package/src/mappings/Swiper.js +62 -0
  189. package/src/mappings/SwiperItem.js +8 -0
  190. package/src/mappings/Switch.js +81 -0
  191. package/src/mappings/Text.js +251 -0
  192. package/src/mappings/TextArea.js +274 -0
  193. package/src/mappings/TextField.js +391 -0
  194. package/src/mappings/TextField.ts +2 -2
  195. package/src/mappings/TextInput.js +402 -0
  196. package/src/mappings/ToggleButton.js +50 -0
  197. package/src/mappings/Touchable.js +60 -0
  198. package/src/mappings/Video.js +81 -0
  199. package/src/mappings/View.js +207 -0
  200. package/src/mappings/WebView.js +88 -0
  201. package/src/styles/DarkTheme.js +26 -0
  202. package/src/styles/DefaultTheme.js +111 -0
  203. package/src/styles/fonts.js +62 -0
  204. package/src/styles/overlay.js +60 -0
  205. package/src/styles/shadow.js +51 -0
  206. package/src/theming.js +3 -0
  207. package/src/utilities.js +102 -0
@@ -0,0 +1,99 @@
1
+ import { COMPONENT_TYPES, createIconProp, createTextProp, createImageProp, createStaticBoolProp, } from "@draftbit/types";
2
+ const SEED_DATA_PROPS = {
3
+ title: createTextProp({
4
+ label: "Title",
5
+ description: "Headline text to display",
6
+ }),
7
+ icon: createIconProp({
8
+ defaultValue: null,
9
+ }),
10
+ };
11
+ const IMAGE_PROP = createImageProp();
12
+ const MULTILINE_PROP = createStaticBoolProp({
13
+ defaultValue: true,
14
+ editable: false,
15
+ });
16
+ const SUBTITLE_PROP = createTextProp({
17
+ label: "Subtitle",
18
+ description: "Subtitle text to display",
19
+ defaultValue: "San Diego",
20
+ });
21
+ export const SEED_DATA = [
22
+ {
23
+ name: "Row Single Line Headline Icon",
24
+ tag: "RowHeadlineImageIcon",
25
+ description: "A row with left aligned headline text and a right aligned icon",
26
+ category: COMPONENT_TYPES.row,
27
+ layout: {},
28
+ props: {
29
+ ...SEED_DATA_PROPS,
30
+ },
31
+ },
32
+ {
33
+ name: "Row Single Line Headline Icon Image",
34
+ tag: "RowHeadlineImageIcon",
35
+ description: "A row with left aligned image and headline text and a right aligned icon",
36
+ category: COMPONENT_TYPES.row,
37
+ layout: {},
38
+ props: {
39
+ ...SEED_DATA_PROPS,
40
+ image: IMAGE_PROP,
41
+ },
42
+ },
43
+ {
44
+ name: "Row Double Line Headline Icon",
45
+ tag: "RowHeadlineImageIcon",
46
+ description: "A row with left aligned headline text and subtitle text and a right aligned icon",
47
+ category: COMPONENT_TYPES.row,
48
+ layout: {},
49
+ props: {
50
+ ...SEED_DATA_PROPS,
51
+ subtitle: SUBTITLE_PROP,
52
+ },
53
+ },
54
+ {
55
+ name: "Row Double Line Headline Image Icon",
56
+ tag: "RowHeadlineImageIcon",
57
+ description: "A row with left aligned headline text and subtitle text and a right aligned icon",
58
+ category: COMPONENT_TYPES.row,
59
+ layout: {},
60
+ props: {
61
+ ...SEED_DATA_PROPS,
62
+ image: IMAGE_PROP,
63
+ subtitle: SUBTITLE_PROP,
64
+ },
65
+ },
66
+ {
67
+ name: "Row Multiline Headline Icon",
68
+ tag: "RowHeadlineImageIcon",
69
+ description: "A row with left aligned headline text and multiline subtitle text and a right aligned icon",
70
+ category: COMPONENT_TYPES.row,
71
+ layout: {},
72
+ props: {
73
+ ...SEED_DATA_PROPS,
74
+ multilineSubtitle: MULTILINE_PROP,
75
+ subtitle: createTextProp({
76
+ label: "Subtitle",
77
+ description: "Subtitle text to display",
78
+ defaultValue: "San Diego is a city on the Pacific coast of California known for its beaches, parks and warm climate",
79
+ }),
80
+ },
81
+ },
82
+ {
83
+ name: "Row Multiline Headline Image Icon",
84
+ tag: "RowHeadlineImageIcon",
85
+ description: "A row with left aligned image, headline text, and multiline subtitle text, and a right aligned icon",
86
+ category: COMPONENT_TYPES.row,
87
+ layout: {},
88
+ props: {
89
+ ...SEED_DATA_PROPS,
90
+ image: IMAGE_PROP,
91
+ multilineSubtitle: MULTILINE_PROP,
92
+ subtitle: createTextProp({
93
+ label: "Subtitle",
94
+ description: "Subtitle text to display",
95
+ defaultValue: "San Diego is a city on the Pacific coast of California known for its beaches, parks and warm climate",
96
+ }),
97
+ },
98
+ },
99
+ ];
@@ -0,0 +1,20 @@
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ category: COMPONENT_TYPES.media,
7
+ layout: {
8
+ width: 100,
9
+ height: 100,
10
+ },
11
+ stylesPanelSections: [
12
+ StylesPanelSections.Size,
13
+ StylesPanelSections.Margins,
14
+ StylesPanelSections.Position,
15
+ StylesPanelSections.Effects,
16
+ ],
17
+ props: {
18
+ source: createSVGProp(),
19
+ },
20
+ };
@@ -0,0 +1,33 @@
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SafeAreaView",
4
+ tag: "SafeAreaView",
5
+ description: "A basic View that handles safe area",
6
+ category: COMPONENT_TYPES.deprecated,
7
+ props: {
8
+ edges: {
9
+ group: GROUPS.basic,
10
+ name: "edges",
11
+ label: "edges",
12
+ description: "Provides edges to be used by safe area view",
13
+ editable: true,
14
+ required: false,
15
+ formType: FORM_TYPES.flatArray,
16
+ propType: PROP_TYPES.STRING,
17
+ options: ["right", "bottom", "left", "top"],
18
+ defaultValue: ["right", "bottom", "left", "top"],
19
+ },
20
+ mode: {
21
+ group: GROUPS.basic,
22
+ name: "mode",
23
+ label: "mode",
24
+ description: "Mode used by safe area view",
25
+ editable: true,
26
+ required: false,
27
+ options: ["padding", "margin"],
28
+ formType: FORM_TYPES.flatArray,
29
+ propType: PROP_TYPES.STRING,
30
+ defaultValue: "padding",
31
+ },
32
+ },
33
+ };
@@ -0,0 +1,37 @@
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Scroll View",
4
+ tag: "ScrollView",
5
+ description: "A basic ScrollView component",
6
+ category: COMPONENT_TYPES.view,
7
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ layout: {},
9
+ triggers: [Triggers.OnRefresh],
10
+ props: {
11
+ onRefresh: createActionProp(),
12
+ horizontal: createStaticBoolProp({
13
+ label: "Horizontal",
14
+ description: "Render your list horizontally",
15
+ defaultValue: false,
16
+ }),
17
+ showsHorizontalScrollIndicator: createStaticBoolProp({
18
+ label: "Show Horizontal Scroll Indicator",
19
+ description: "When true, shows a horizontal scroll indicator. The default value is true.",
20
+ defaultValue: false,
21
+ }),
22
+ showsVerticalScrollIndicator: createStaticBoolProp({
23
+ label: "Show Vertical Scroll Indicator",
24
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
25
+ defaultValue: true,
26
+ }),
27
+ bounces: createStaticBoolProp({
28
+ label: "Bounce",
29
+ description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
30
+ defaultValue: true,
31
+ }),
32
+ refreshColor: createColorProp({
33
+ label: "Refreshing Color",
34
+ description: "Color of the refresh indicator",
35
+ }),
36
+ },
37
+ };
@@ -2,6 +2,9 @@ import {
2
2
  COMPONENT_TYPES,
3
3
  createStaticBoolProp,
4
4
  CONTAINER_COMPONENT_STYLES_SECTIONS,
5
+ Triggers,
6
+ createActionProp,
7
+ createColorProp,
5
8
  } from "@draftbit/types";
6
9
 
7
10
  export const SEED_DATA = {
@@ -11,7 +14,9 @@ export const SEED_DATA = {
11
14
  category: COMPONENT_TYPES.view,
12
15
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
13
16
  layout: {},
17
+ triggers: [Triggers.OnRefresh],
14
18
  props: {
19
+ onRefresh: createActionProp(),
15
20
  horizontal: createStaticBoolProp({
16
21
  label: "Horizontal",
17
22
  description: "Render your list horizontally",
@@ -35,5 +40,9 @@ export const SEED_DATA = {
35
40
  "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
36
41
  defaultValue: true,
37
42
  }),
43
+ refreshColor: createColorProp({
44
+ label: "Refreshing Color",
45
+ description: "Color of the refresh indicator",
46
+ }),
38
47
  },
39
48
  };
@@ -0,0 +1,60 @@
1
+ import { COMPONENT_TYPES, GROUPS, createNumberProp, createColorProp, createFieldNameProp, createIconProp, Triggers, BLOCK_STYLES_SECTIONS, } 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.control,
7
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
+ layout: {
9
+ marginLeft: 12,
10
+ marginRight: 12,
11
+ },
12
+ triggers: [Triggers.OnValueChange],
13
+ props: {
14
+ fieldName: createFieldNameProp({
15
+ defaultValue: "sliderValue",
16
+ handlerPropName: "onValueChange",
17
+ valuePropName: "value",
18
+ }),
19
+ minimumValue: createNumberProp({
20
+ group: GROUPS.basic,
21
+ label: "Min Value",
22
+ min: 0,
23
+ max: 1000,
24
+ }),
25
+ maximumValue: createNumberProp({
26
+ group: GROUPS.basic,
27
+ label: "Max Value",
28
+ min: 1,
29
+ max: 10000,
30
+ }),
31
+ step: createNumberProp({
32
+ group: GROUPS.basic,
33
+ label: "Step",
34
+ min: 0,
35
+ max: 100,
36
+ step: 0.01,
37
+ precision: 2,
38
+ }),
39
+ leftIcon: createIconProp({
40
+ label: "Left Icon",
41
+ defaultValue: null,
42
+ }),
43
+ rightIcon: createIconProp({
44
+ label: "Right Icon",
45
+ defaultValue: null,
46
+ }),
47
+ minimumTrackTintColor: createColorProp({
48
+ label: "Min Track Color",
49
+ defaultValue: null,
50
+ }),
51
+ maximumTrackTintColor: createColorProp({
52
+ label: "Max Track Color",
53
+ defaultValue: null,
54
+ }),
55
+ thumbTintColor: createColorProp({
56
+ label: "Thumb Color",
57
+ defaultValue: null,
58
+ }),
59
+ },
60
+ };
@@ -0,0 +1,43 @@
1
+ import { COMPONENT_TYPES, createStaticNumberProp, createFieldNameProp, createStaticBoolProp, Triggers, createColorProp, BLOCK_STYLES_SECTIONS, } 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.control,
7
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
+ triggers: [Triggers.OnPress],
9
+ props: {
10
+ starSize: createStaticNumberProp({
11
+ label: "Star size",
12
+ description: "Size of each individual star",
13
+ defaultValue: 16,
14
+ min: 8,
15
+ max: 36,
16
+ step: 1,
17
+ }),
18
+ fieldName: createFieldNameProp({
19
+ defaultValue: "ratingValue",
20
+ handlerPropName: "onPress",
21
+ valuePropName: "rating", // the value prop in this component
22
+ }),
23
+ maxStars: createStaticNumberProp({
24
+ label: "Max stars",
25
+ description: "The max number of stars",
26
+ defaultValue: 5,
27
+ min: 0,
28
+ max: 10,
29
+ step: 1,
30
+ }),
31
+ isEditable: createStaticBoolProp({
32
+ label: "Editable",
33
+ }),
34
+ activeColor: createColorProp({
35
+ label: "Active Color",
36
+ defaultValue: "primary",
37
+ }),
38
+ inactiveColor: createColorProp({
39
+ label: "Inactive Color",
40
+ defaultValue: "divider",
41
+ }),
42
+ },
43
+ };
@@ -0,0 +1,32 @@
1
+ import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, createStaticNumberProp, Triggers, BLOCK_STYLES_SECTIONS, StylesPanelSections, } 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.control,
8
+ stylesPanelSections: [
9
+ StylesPanelSections.Typography,
10
+ ...BLOCK_STYLES_SECTIONS,
11
+ ],
12
+ layout: {},
13
+ triggers: [Triggers.OnChange],
14
+ props: {
15
+ fieldName: createFieldNameProp({
16
+ defaultValue: "stepperValue",
17
+ handlerPropName: "onChange",
18
+ valuePropName: "value",
19
+ }),
20
+ iconSize: createIconSizeProp({ defaultValue: 24 }),
21
+ iconColor: createColorProp({ defaultValue: "strong" }),
22
+ min: createStaticNumberProp({
23
+ label: "Minimum",
24
+ description: "Minimum Number",
25
+ }),
26
+ max: createStaticNumberProp({
27
+ label: "Maximum",
28
+ description: "Maximum Number",
29
+ }),
30
+ },
31
+ },
32
+ ];
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createElevationType, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Surface",
4
+ tag: "Surface",
5
+ description: "An elevated container",
6
+ category: COMPONENT_TYPES.container,
7
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ layout: {
9
+ minHeight: 40,
10
+ },
11
+ props: {
12
+ elevation: createElevationType(0),
13
+ },
14
+ };
@@ -0,0 +1,62 @@
1
+ import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, Triggers, createActionProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Swiper",
4
+ tag: "Swiper",
5
+ description: "Swiper container",
6
+ category: COMPONENT_TYPES.swiper,
7
+ layout: {
8
+ height: 300,
9
+ width: "100%",
10
+ },
11
+ triggers: [Triggers.OnIndexChanged],
12
+ props: {
13
+ onIndexChanged: createActionProp(),
14
+ from: createNumberProp({
15
+ group: GROUPS.basic,
16
+ label: "Initial Slide",
17
+ }),
18
+ loop: createBoolProp({
19
+ group: GROUPS.basic,
20
+ label: "Loop",
21
+ }),
22
+ timeout: createNumberProp({
23
+ group: GROUPS.basic,
24
+ label: "Timeout",
25
+ defaultValue: 0,
26
+ }),
27
+ vertical: createBoolProp({
28
+ group: GROUPS.basic,
29
+ label: "Vertical",
30
+ defaultValue: false,
31
+ }),
32
+ prevTitle: createTextProp({
33
+ group: GROUPS.basic,
34
+ label: "Previous Title",
35
+ defaultValue: "",
36
+ }),
37
+ nextTitle: createTextProp({
38
+ group: GROUPS.basic,
39
+ label: "Next Title",
40
+ defaultValue: "",
41
+ }),
42
+ prevTitleColor: createColorProp({
43
+ label: "Previous Title Color",
44
+ }),
45
+ nextTitleColor: createColorProp({
46
+ label: "Next Title Color",
47
+ }),
48
+ dotColor: createColorProp({
49
+ label: "Dot Color",
50
+ defaultValue: "light",
51
+ }),
52
+ dotActiveColor: createColorProp({
53
+ label: "Dot Active Color",
54
+ defaultValue: "primary",
55
+ }),
56
+ dotsTouchable: createBoolProp({
57
+ group: GROUPS.basic,
58
+ label: "Dots Touchable",
59
+ defaultValue: true,
60
+ }),
61
+ },
62
+ };
@@ -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.swiper,
7
+ props: {},
8
+ };
@@ -0,0 +1,81 @@
1
+ import { COMPONENT_TYPES, GROUPS, createBoolProp, createColorProp, createFieldNameProp, createTextProp, createRowDirectionProp, Triggers, StylesPanelSections, BLOCK_STYLES_SECTIONS, } 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.control,
8
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
9
+ layout: {},
10
+ triggers: SEED_DATA_TRIGGERS,
11
+ props: {
12
+ disabled: createBoolProp({
13
+ label: "Disabled",
14
+ description: "Boolean to handle disabling the switch",
15
+ }),
16
+ fieldName: createFieldNameProp({
17
+ handlerPropName: "onValueChange",
18
+ valuePropName: "value",
19
+ defaultValue: "switchValue",
20
+ }),
21
+ activeTrackColor: createColorProp({
22
+ label: "Active Track Color",
23
+ }),
24
+ inactiveTrackColor: createColorProp({
25
+ label: "Inactive Track Color",
26
+ }),
27
+ activeThumbColor: createColorProp({
28
+ label: "Active Thumb Color",
29
+ }),
30
+ inactiveThumbColor: createColorProp({
31
+ label: "Inactive Thumb Color",
32
+ }),
33
+ },
34
+ },
35
+ {
36
+ name: "Switch Row",
37
+ tag: "SwitchRow",
38
+ category: COMPONENT_TYPES.control,
39
+ stylesPanelSections: [
40
+ StylesPanelSections.Typography,
41
+ StylesPanelSections.Margins,
42
+ StylesPanelSections.Effects,
43
+ ],
44
+ layout: {
45
+ marginLeft: 0,
46
+ marginRight: 0,
47
+ },
48
+ triggers: SEED_DATA_TRIGGERS,
49
+ props: {
50
+ label: createTextProp({
51
+ label: "Label",
52
+ description: "Label to show with the checkbox",
53
+ required: true,
54
+ defaultValue: "First Option",
55
+ }),
56
+ direction: createRowDirectionProp(),
57
+ disabled: createBoolProp({
58
+ label: "Disabled",
59
+ description: "Boolean to handle disabling the switch",
60
+ group: GROUPS.data,
61
+ }),
62
+ fieldName: createFieldNameProp({
63
+ handlerPropName: "onValueChange",
64
+ valuePropName: "value",
65
+ defaultValue: "switchValue",
66
+ }),
67
+ activeTrackColor: createColorProp({
68
+ label: "Active Track Color",
69
+ }),
70
+ inactiveTrackColor: createColorProp({
71
+ label: "Inactive Track Color",
72
+ }),
73
+ activeThumbColor: createColorProp({
74
+ label: "Active Thumb Color",
75
+ }),
76
+ inactiveThumbColor: createColorProp({
77
+ label: "Inactive Thumb Color",
78
+ }),
79
+ },
80
+ },
81
+ ];