@draftbit/core 44.1.14 → 44.2.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 (228) hide show
  1. package/lib/commonjs/components/DeprecatedButton.js +19 -4
  2. package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
  3. package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
  4. package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
  5. package/lib/commonjs/components/Justification.js +3 -0
  6. package/lib/commonjs/components/Picker/Picker.js +27 -266
  7. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  8. package/lib/commonjs/components/Picker/PickerComponent.android.js +110 -34
  9. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
  10. package/lib/commonjs/components/Picker/PickerComponent.ios.js +113 -44
  11. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
  12. package/lib/commonjs/components/Picker/PickerComponent.web.js +111 -34
  13. package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
  14. package/lib/commonjs/components/Picker/PickerTypes.js +6 -0
  15. package/lib/commonjs/components/Picker/PickerTypes.js.map +1 -0
  16. package/lib/commonjs/components/ResizeMode.js +3 -0
  17. package/lib/commonjs/mappings/Picker.js +1 -7
  18. package/lib/commonjs/mappings/Picker.js.map +1 -1
  19. package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
  20. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  21. package/lib/commonjs/utilities.js +0 -19
  22. package/lib/commonjs/utilities.js.map +1 -1
  23. package/lib/module/components/Justification.js +1 -1
  24. package/lib/module/components/Picker/Picker.js +28 -260
  25. package/lib/module/components/Picker/Picker.js.map +1 -1
  26. package/lib/module/components/Picker/PickerComponent.android.js +103 -32
  27. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  28. package/lib/module/components/Picker/PickerComponent.ios.js +108 -42
  29. package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
  30. package/lib/module/components/Picker/PickerComponent.web.js +104 -32
  31. package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
  32. package/lib/module/components/Picker/PickerTypes.js +2 -0
  33. package/lib/module/components/Picker/PickerTypes.js.map +1 -0
  34. package/lib/module/components/ResizeMode.js +1 -1
  35. package/lib/module/mappings/Picker.js +2 -8
  36. package/lib/module/mappings/Picker.js.map +1 -1
  37. package/lib/module/utilities.js +1 -12
  38. package/lib/module/utilities.js.map +1 -1
  39. package/lib/typescript/src/components/Picker/Picker.d.ts +4 -28
  40. package/lib/typescript/src/components/Picker/PickerComponent.android.d.ts +5 -12
  41. package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +5 -11
  42. package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +5 -12
  43. package/lib/typescript/src/components/Picker/PickerTypes.d.ts +18 -0
  44. package/lib/typescript/src/mappings/Picker.d.ts +0 -21
  45. package/lib/typescript/src/utilities.d.ts +0 -7
  46. package/package.json +2 -2
  47. package/src/Provider.js +9 -0
  48. package/src/components/Accordion/AccordionGroup.js +44 -0
  49. package/src/components/Accordion/AccordionItem.js +32 -0
  50. package/src/components/Accordion/index.js +2 -0
  51. package/src/components/ActionSheet/ActionSheet.js +45 -0
  52. package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
  53. package/src/components/ActionSheet/ActionSheetItem.js +30 -0
  54. package/src/components/ActionSheet/index.js +3 -0
  55. package/src/components/AnimatedCircularProgress.js +43 -0
  56. package/src/components/AspectRatio.js +18 -0
  57. package/src/components/AvatarEdit.js +30 -0
  58. package/src/components/Banner.js +109 -0
  59. package/src/components/Button.js +112 -0
  60. package/src/components/Card.js +57 -0
  61. package/src/components/CardBlock.js +54 -0
  62. package/src/components/CardContainer.js +69 -0
  63. package/src/components/CardContainerRating.js +79 -0
  64. package/src/components/CardContainerShortImage.js +33 -0
  65. package/src/components/CardInline.js +36 -0
  66. package/src/components/Carousel.js +66 -0
  67. package/src/components/Checkbox/Checkbox.js +63 -0
  68. package/src/components/Checkbox/CheckboxGroup.js +21 -0
  69. package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
  70. package/src/components/Checkbox/CheckboxRow.js +78 -0
  71. package/src/components/Checkbox/context.js +14 -0
  72. package/src/components/Checkbox/index.js +3 -0
  73. package/src/components/CircleImage.js +8 -0
  74. package/src/components/CircularProgress.js +78 -0
  75. package/src/components/Config.js +63 -0
  76. package/src/components/Container.js +43 -0
  77. package/src/components/DatePicker/DatePicker.js +368 -0
  78. package/src/components/DatePicker/DatePickerComponent.js +13 -0
  79. package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
  80. package/src/components/DatePicker/DatePickerComponentType.js +1 -0
  81. package/src/components/DeprecatedButton.js +95 -0
  82. package/src/components/DeprecatedCardWrapper.js +18 -0
  83. package/src/components/DeprecatedFAB.js +115 -0
  84. package/src/components/Divider.js +13 -0
  85. package/src/components/Elevation.js +20 -0
  86. package/src/components/FAB.js +46 -0
  87. package/src/components/FieldSearchBarFull.js +53 -0
  88. package/src/components/FormRow.js +19 -0
  89. package/src/components/Header.js +44 -0
  90. package/src/components/HeaderLarge.js +7 -0
  91. package/src/components/HeaderMedium.js +7 -0
  92. package/src/components/HeaderOverline.js +7 -0
  93. package/src/components/IconButton.js +35 -0
  94. package/src/components/Image.js +47 -0
  95. package/src/components/Justification.js +1 -0
  96. package/src/components/Layout.js +50 -0
  97. package/src/components/NumberInput.js +49 -0
  98. package/src/components/Picker/Picker.js +56 -0
  99. package/src/components/Picker/Picker.tsx +34 -434
  100. package/src/components/Picker/PickerComponent.android.js +68 -0
  101. package/src/components/Picker/PickerComponent.android.tsx +101 -44
  102. package/src/components/Picker/PickerComponent.ios.js +78 -0
  103. package/src/components/Picker/PickerComponent.ios.tsx +116 -63
  104. package/src/components/Picker/PickerComponent.web.js +69 -0
  105. package/src/components/Picker/PickerComponent.web.tsx +102 -44
  106. package/src/components/Picker/PickerTypes.js +1 -0
  107. package/src/components/Picker/PickerTypes.ts +18 -0
  108. package/src/components/Portal/Portal.js +35 -0
  109. package/src/components/Portal/PortalConsumer.js +28 -0
  110. package/src/components/Portal/PortalHost.js +105 -0
  111. package/src/components/Portal/PortalManager.js +29 -0
  112. package/src/components/ProgressBar.js +118 -0
  113. package/src/components/ProgressCircle.js +13 -0
  114. package/src/components/ProgressIndicator.js +27 -0
  115. package/src/components/RadioButton/RadioButton.js +17 -0
  116. package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
  117. package/src/components/RadioButton/RadioButtonGroup.js +43 -0
  118. package/src/components/RadioButton/RadioButtonRow.js +76 -0
  119. package/src/components/RadioButton/context.js +14 -0
  120. package/src/components/RadioButton/index.js +4 -0
  121. package/src/components/ResizeMode.js +1 -0
  122. package/src/components/Row.js +48 -0
  123. package/src/components/RowBodyIcon.js +8 -0
  124. package/src/components/RowHeadlineImageCaption.js +12 -0
  125. package/src/components/RowHeadlineImageIcon.js +14 -0
  126. package/src/components/ScreenContainer.js +34 -0
  127. package/src/components/Slider.js +63 -0
  128. package/src/components/StarRating.js +50 -0
  129. package/src/components/StepIndicator.js +346 -0
  130. package/src/components/Stepper.js +39 -0
  131. package/src/components/Surface.js +32 -0
  132. package/src/components/Swiper/Swiper.js +29 -0
  133. package/src/components/Swiper/SwiperItem.js +9 -0
  134. package/src/components/Swiper/index.js +2 -0
  135. package/src/components/Switch.js +56 -0
  136. package/src/components/Text.js +28 -0
  137. package/src/components/TextField.js +420 -0
  138. package/src/components/ToggleButton.js +39 -0
  139. package/src/components/Touchable.js +12 -0
  140. package/src/components/Touchable.web.js +2 -0
  141. package/src/components/Typography.js +36 -0
  142. package/src/components/useAuthState.js +31 -0
  143. package/src/constants.js +10 -0
  144. package/src/hooks.js +12 -0
  145. package/src/index.js +52 -0
  146. package/src/interfaces/Icon.js +8 -0
  147. package/src/mappings/Accordion.js +41 -0
  148. package/src/mappings/AccordionItem.js +16 -0
  149. package/src/mappings/ActionSheet.js +13 -0
  150. package/src/mappings/ActionSheetCancel.js +19 -0
  151. package/src/mappings/ActionSheetItem.js +23 -0
  152. package/src/mappings/ActivityIndicator.js +53 -0
  153. package/src/mappings/AudioPlayer.js +20 -0
  154. package/src/mappings/AvatarEdit.js +37 -0
  155. package/src/mappings/Banner.js +32 -0
  156. package/src/mappings/BlurView.js +41 -0
  157. package/src/mappings/Button.js +56 -0
  158. package/src/mappings/Card.js +52 -0
  159. package/src/mappings/CardBlock.js +122 -0
  160. package/src/mappings/CardContainer.js +102 -0
  161. package/src/mappings/CardContainerRating.js +124 -0
  162. package/src/mappings/CardContainerShortImage.js +118 -0
  163. package/src/mappings/CardInline.js +51 -0
  164. package/src/mappings/Carousel.js +18 -0
  165. package/src/mappings/Checkbox.js +45 -0
  166. package/src/mappings/CheckboxGroup.js +25 -0
  167. package/src/mappings/CheckboxRow.js +56 -0
  168. package/src/mappings/CircleImage.js +24 -0
  169. package/src/mappings/Container.js +29 -0
  170. package/src/mappings/CustomCode.js +8 -0
  171. package/src/mappings/DatePicker.js +146 -0
  172. package/src/mappings/Divider.js +26 -0
  173. package/src/mappings/FAB.js +36 -0
  174. package/src/mappings/Fetch.js +12 -0
  175. package/src/mappings/FieldSearchBarFull.js +49 -0
  176. package/src/mappings/FlatList.js +19 -0
  177. package/src/mappings/HeaderLarge.js +28 -0
  178. package/src/mappings/HeaderMedium.js +54 -0
  179. package/src/mappings/HeaderOverline.js +54 -0
  180. package/src/mappings/Icon.js +25 -0
  181. package/src/mappings/IconButton.js +30 -0
  182. package/src/mappings/Image.js +15 -0
  183. package/src/mappings/ImageBackground.js +28 -0
  184. package/src/mappings/KeyboardAvoidingView.js +40 -0
  185. package/src/mappings/KeyboardAwareScrollView.js +49 -0
  186. package/src/mappings/Layout.js +195 -0
  187. package/src/mappings/LinearGradient.js +77 -0
  188. package/src/mappings/MapCallout.js +21 -0
  189. package/src/mappings/MapMarker.js +47 -0
  190. package/src/mappings/MapView.js +138 -0
  191. package/src/mappings/Modal.js +41 -0
  192. package/src/mappings/Picker.js +137 -0
  193. package/src/mappings/Picker.ts +0 -4
  194. package/src/mappings/ProgressBar.js +100 -0
  195. package/src/mappings/ProgressCircle.js +108 -0
  196. package/src/mappings/ProgressIndicator.js +180 -0
  197. package/src/mappings/RadioButton.js +50 -0
  198. package/src/mappings/RadioButtonGroup.js +16 -0
  199. package/src/mappings/RadioButtonRow.js +37 -0
  200. package/src/mappings/RowBodyIcon.js +75 -0
  201. package/src/mappings/RowHeadlineImageCaption.js +167 -0
  202. package/src/mappings/RowHeadlineImageIcon.js +99 -0
  203. package/src/mappings/SafeAreaView.js +33 -0
  204. package/src/mappings/ScrollView.js +30 -0
  205. package/src/mappings/Slider.js +59 -0
  206. package/src/mappings/StarRating.js +42 -0
  207. package/src/mappings/Stepper.js +28 -0
  208. package/src/mappings/Surface.js +13 -0
  209. package/src/mappings/Swiper.js +60 -0
  210. package/src/mappings/SwiperItem.js +8 -0
  211. package/src/mappings/Switch.js +75 -0
  212. package/src/mappings/Text.js +232 -0
  213. package/src/mappings/TextArea.js +52 -0
  214. package/src/mappings/TextField.js +158 -0
  215. package/src/mappings/TextInput.js +208 -0
  216. package/src/mappings/ToggleButton.js +45 -0
  217. package/src/mappings/Touchable.js +12 -0
  218. package/src/mappings/Video.js +74 -0
  219. package/src/mappings/View.js +206 -0
  220. package/src/mappings/WebView.js +18 -0
  221. package/src/styles/DarkTheme.js +26 -0
  222. package/src/styles/DefaultTheme.js +111 -0
  223. package/src/styles/fonts.js +62 -0
  224. package/src/styles/overlay.js +60 -0
  225. package/src/styles/shadow.js +51 -0
  226. package/src/theming.js +3 -0
  227. package/src/utilities.js +54 -0
  228. package/src/utilities.ts +1 -65
@@ -1 +1 @@
1
- {"version":3,"sources":["Picker.ts"],"names":["COMPONENT_TYPES","Triggers","GROUPS","FORM_TYPES","PROP_TYPES","FIELD_NAME","createIconSizeProp","createColorProp","SEED_DATA_PROPS","label","group","data","description","formType","string","propType","STRING","defaultValue","editable","required","placeholder","basic","placeholderTextColor","color","assistiveText","options","array","OBJECT","disabled","boolean","BOOLEAN","error","leftIconName","icon","ASSET","leftIconMode","flatArray","rightIconName","fieldName","handlerPropName","SEED_DATA_TRIGGERS","OnValueChange","SEED_DATA","name","tag","category","input","preview_image_url","supports_list_render","triggers","props","type","iconSize","iconColor","layout"],"mappings":"AAAA,SACEA,eADF,EAEEC,QAFF,EAGEC,MAHF,EAIEC,UAJF,EAKEC,UALF,EAMEC,UANF,EAOEC,kBAPF,EAQEC,eARF,QASO,iBATP;AAWA,MAAMC,eAAe,GAAG;AACtBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAER,MAAM,CAACS,IADT;AAELF,IAAAA,KAAK,EAAE,OAFF;AAGLG,IAAAA,WAAW,EAAE,yCAHR;AAILC,IAAAA,QAAQ,EAAEV,UAAU,CAACW,MAJhB;AAKLC,IAAAA,QAAQ,EAAEX,UAAU,CAACY,MALhB;AAMLC,IAAAA,YAAY,EAAE,IANT;AAOLC,IAAAA,QAAQ,EAAE,IAPL;AAQLC,IAAAA,QAAQ,EAAE;AARL,GADe;AAWtBC,EAAAA,WAAW,EAAE;AACXV,IAAAA,KAAK,EAAER,MAAM,CAACmB,KADH;AAEXZ,IAAAA,KAAK,EAAE,aAFI;AAGXG,IAAAA,WAAW,EAAE,oCAHF;AAIXC,IAAAA,QAAQ,EAAEV,UAAU,CAACW,MAJV;AAKXC,IAAAA,QAAQ,EAAEX,UAAU,CAACY,MALV;AAMXC,IAAAA,YAAY,EAAE,kBANH;AAOXC,IAAAA,QAAQ,EAAE,IAPC;AAQXC,IAAAA,QAAQ,EAAE;AARC,GAXS;AAqBtBG,EAAAA,oBAAoB,EAAE;AACpBZ,IAAAA,KAAK,EAAER,MAAM,CAACmB,KADM;AAEpBZ,IAAAA,KAAK,EAAE,wBAFa;AAGpBG,IAAAA,WAAW,EAAE,oCAHO;AAIpBM,IAAAA,QAAQ,EAAE,IAJU;AAKpBC,IAAAA,QAAQ,EAAE,KALU;AAMpBF,IAAAA,YAAY,EAA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BE6C,EAAAA,MAAM,EAAE;AAxBV,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n Triggers,\n GROUPS,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n createIconSizeProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nconst SEED_DATA_PROPS = {\n label: {\n group: GROUPS.data,\n label: \"Label\",\n description: \"The label to be displayed on the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: true,\n },\n placeholder: {\n group: GROUPS.basic,\n label: \"Placeholder\",\n description: \"The placeholder text of the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Select an option\",\n editable: true,\n required: false,\n },\n placeholderTextColor: {\n group: GROUPS.basic,\n label: \"Placeholder Text Color\",\n description: \"The color of the placeholder text.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.STRING,\n },\n assistiveText: {\n group: GROUPS.basic,\n label: \"Assistive text\",\n description: \"Helper text to display below the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n },\n options: {\n group: GROUPS.data,\n label: \"Options\",\n description:\n \"Array of picker options. An array of objects containing a label and value.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.array,\n propType: PROP_TYPES.OBJECT,\n options: [],\n defaultValue: null,\n },\n disabled: {\n group: GROUPS.basic,\n label: \"Disabled\",\n description:\n \"Whether the picker should be disabled. Will prevent selection and show a greyed out state.\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n },\n error: {\n group: GROUPS.data,\n label: \"Error\",\n description: \"Whether the picker should display the error state\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n },\n leftIconName: {\n group: GROUPS.basic,\n label: \"Left icon name\",\n description: \"The icon to display on the left\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n leftIconMode: {\n group: GROUPS.basic,\n label: \"Left icon mode\",\n description:\n \"The mode of the icon to display on the left. 'inset' or 'outset'.\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"inset\",\n options: [\"inset\", \"outset\"],\n editable: true,\n required: true,\n },\n rightIconName: {\n group: GROUPS.basic,\n label: \"Right icon name\",\n description: \"The icon to display on the right\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n fieldName: {\n ...FIELD_NAME,\n defaultValue: \"pickerValue\",\n handlerPropName: \"onValueChange\",\n },\n};\n\nconst SEED_DATA_TRIGGERS = [Triggers.OnValueChange];\nexport const SEED_DATA = [\n {\n name: \"Picker\",\n tag: \"Picker\",\n description: \"A component used to pick a value from a set of options\",\n category: COMPONENT_TYPES.input,\n preview_image_url: \"{CLOUDINARY_URL}/Picker.png\",\n supports_list_render: false,\n triggers: SEED_DATA_TRIGGERS,\n props: {\n ...SEED_DATA_PROPS,\n type: {\n label: \"Appearance\",\n description: \"Type of Picker\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"solid\",\n options: [\"solid\", \"underline\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n iconSize: createIconSizeProp({ defaultValue: 24 }),\n iconColor: createColorProp({ label: \"Icon Color\" }),\n },\n layout: {},\n },\n];\n"]}
1
+ {"version":3,"sources":["Picker.ts"],"names":["COMPONENT_TYPES","Triggers","GROUPS","FORM_TYPES","PROP_TYPES","FIELD_NAME","SEED_DATA_PROPS","label","group","data","description","formType","string","propType","STRING","defaultValue","editable","required","placeholder","basic","placeholderTextColor","color","assistiveText","options","array","OBJECT","disabled","boolean","BOOLEAN","error","leftIconName","icon","ASSET","leftIconMode","flatArray","rightIconName","fieldName","handlerPropName","SEED_DATA_TRIGGERS","OnValueChange","SEED_DATA","name","tag","category","input","preview_image_url","supports_list_render","triggers","props","type","layout"],"mappings":"AAAA,SACEA,eADF,EAEEC,QAFF,EAGEC,MAHF,EAIEC,UAJF,EAKEC,UALF,EAMEC,UANF,QAOO,iBAPP;AASA,MAAMC,eAAe,GAAG;AACtBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAEN,MAAM,CAACO,IADT;AAELF,IAAAA,KAAK,EAAE,OAFF;AAGLG,IAAAA,WAAW,EAAE,yCAHR;AAILC,IAAAA,QAAQ,EAAER,UAAU,CAACS,MAJhB;AAKLC,IAAAA,QAAQ,EAAET,UAAU,CAACU,MALhB;AAMLC,IAAAA,YAAY,EAAE,IANT;AAOLC,IAAAA,QAAQ,EAAE,IAPL;AAQLC,IAAAA,QAAQ,EAAE;AARL,GADe;AAWtBC,EAAAA,WAAW,EAAE;AACXV,IAAAA,KAAK,EAAEN,MAAM,CAACiB,KADH;AAEXZ,IAAAA,KAAK,EAAE,aAFI;AAGXG,IAAAA,WAAW,EAAE,oCAHF;AAIXC,IAAAA,QAAQ,EAAER,UAAU,CAACS,MAJV;AAKXC,IAAAA,QAAQ,EAAET,UAAU,CAACU,MALV;AAMXC,IAAAA,YAAY,EAAE,kBANH;AAOXC,IAAAA,QAAQ,EAAE,IAPC;AAQXC,IAAAA,QAAQ,EAAE;AARC,GAXS;AAqBtBG,EAAAA,oBAAoB,EAAE;AACpBZ,IAAAA,KAAK,EAAEN,MAAM,CAACiB,KADM;AAEpBZ,IAAAA,KAAK,EAAE,wBAFa;AAGpBG,IAAAA,WAAW,EAAE,oCAHO;AAIpBM,IAAAA,QAAQ,EAAE,IAJU;AAKpBC,IAAAA,QAAQ,EAAE,KALU;AAMpBF,IAAAA,YAAY,EAAE,IANM;AAOpBJ,IAAAA,QAAQ,EAAER,UAAU,CAACkB,KAPD;AAQpBR,IAAAA,QAAQ,EAAET,UAAU,CAACU;AARD,G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AA0GtBmB,EAAAA,SAAS,EAAE,EACT,GAAG/B,UADM;AAETU,IAAAA,YAAY,EAAE,aAFL;AAGTsB,IAAAA,eAAe,EAAE;AAHR;AA1GW,CAAxB;AAiHA,MAAMC,kBAAkB,GAAG,CAACrC,QAAQ,CAACsC,aAAV,CAA3B;AACA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,QADR;AAEEC,EAAAA,GAAG,EAAE,QAFP;AAGEhC,EAAAA,WAAW,EAAE,wDAHf;AAIEiC,EAAAA,QAAQ,EAAE3C,eAAe,CAAC4C,KAJ5B;AAKEC,EAAAA,iBAAiB,EAAE,6BALrB;AAMEC,EAAAA,oBAAoB,EAAE,KANxB;AAOEC,EAAAA,QAAQ,EAAET,kBAPZ;AAQEU,EAAAA,KAAK,EAAE,EACL,GAAG1C,eADE;AAEL2C,IAAAA,IAAI,EAAE;AACJ1C,MAAAA,KAAK,EAAE,YADH;AAEJG,MAAAA,WAAW,EAAE,gBAFT;AAGJC,MAAAA,QAAQ,EAAER,UAAU,CAAC+B,SAHjB;AAIJrB,MAAAA,QAAQ,EAAET,UAAU,CAACU,MAJjB;AAKJC,MAAAA,YAAY,EAAE,OALV;AAMJQ,MAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,WAAV,CANL;AAOJP,MAAAA,QAAQ,EAAE,IAPN;AAQJC,MAAAA,QAAQ,EAAE,IARN;AASJT,MAAAA,KAAK,EAAEN,MAAM,CAACiB;AATV;AAFD,GART;AAsBE+B,EAAAA,MAAM,EAAE;AAtBV,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n Triggers,\n GROUPS,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n} from \"@draftbit/types\";\n\nconst SEED_DATA_PROPS = {\n label: {\n group: GROUPS.data,\n label: \"Label\",\n description: \"The label to be displayed on the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: true,\n },\n placeholder: {\n group: GROUPS.basic,\n label: \"Placeholder\",\n description: \"The placeholder text of the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Select an option\",\n editable: true,\n required: false,\n },\n placeholderTextColor: {\n group: GROUPS.basic,\n label: \"Placeholder Text Color\",\n description: \"The color of the placeholder text.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.STRING,\n },\n assistiveText: {\n group: GROUPS.basic,\n label: \"Assistive text\",\n description: \"Helper text to display below the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n },\n options: {\n group: GROUPS.data,\n label: \"Options\",\n description:\n \"Array of picker options. An array of objects containing a label and value.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.array,\n propType: PROP_TYPES.OBJECT,\n options: [],\n defaultValue: null,\n },\n disabled: {\n group: GROUPS.basic,\n label: \"Disabled\",\n description:\n \"Whether the picker should be disabled. Will prevent selection and show a greyed out state.\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n },\n error: {\n group: GROUPS.data,\n label: \"Error\",\n description: \"Whether the picker should display the error state\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n },\n leftIconName: {\n group: GROUPS.basic,\n label: \"Left icon name\",\n description: \"The icon to display on the left\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n leftIconMode: {\n group: GROUPS.basic,\n label: \"Left icon mode\",\n description:\n \"The mode of the icon to display on the left. 'inset' or 'outset'.\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"inset\",\n options: [\"inset\", \"outset\"],\n editable: true,\n required: true,\n },\n rightIconName: {\n group: GROUPS.basic,\n label: \"Right icon name\",\n description: \"The icon to display on the right\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n fieldName: {\n ...FIELD_NAME,\n defaultValue: \"pickerValue\",\n handlerPropName: \"onValueChange\",\n },\n};\n\nconst SEED_DATA_TRIGGERS = [Triggers.OnValueChange];\nexport const SEED_DATA = [\n {\n name: \"Picker\",\n tag: \"Picker\",\n description: \"A component used to pick a value from a set of options\",\n category: COMPONENT_TYPES.input,\n preview_image_url: \"{CLOUDINARY_URL}/Picker.png\",\n supports_list_render: false,\n triggers: SEED_DATA_TRIGGERS,\n props: {\n ...SEED_DATA_PROPS,\n type: {\n label: \"Appearance\",\n description: \"Type of Picker\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"solid\",\n options: [\"solid\", \"underline\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n },\n layout: {},\n },\n];\n"]}
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { isString, isNumber, pick, pickBy, identity } from "lodash";
2
+ import { isString, isNumber } from "lodash";
3
3
  export function extractStyles(style) {
4
4
  const {
5
5
  color,
@@ -33,17 +33,6 @@ export function extractStyles(style) {
33
33
  textStyles
34
34
  };
35
35
  }
36
- export const borderStyleNames = ["borderRadius", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth"];
37
- export const marginStyleNames = ["margin", "marginBottom", "marginEnd", "marginHorizontal", "marginLeft", "marginRight", "marginStart", "marginTop", "marginVertical"];
38
- export function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalMarginStyles) {
39
- const flatStyle = StyleSheet.flatten(style || {});
40
- const borderStyles = pickBy(pick(flatStyle, [...borderStyleNames, ...(additionalBorderStyles ? additionalBorderStyles : [])]), identity);
41
- const marginStyles = pickBy(pick(flatStyle, [...marginStyleNames, ...(additionalMarginStyles ? additionalMarginStyles : [])]), identity);
42
- return {
43
- borderStyles,
44
- marginStyles
45
- };
46
- }
47
36
  /**
48
37
  * Merges a style object on top of another style object. In React Native,
49
38
  * keys with undefined values in a style object will still override styles
@@ -1 +1 @@
1
- {"version":3,"sources":["utilities.ts"],"names":["StyleSheet","isString","isNumber","pick","pickBy","identity","extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","flatten","textStyles","borderStyleNames","marginStyleNames","extractBorderAndMarginStyles","additionalBorderStyles","additionalMarginStyles","flatStyle","borderStyles","marginStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","String","Error"],"mappings":"AAAA,SAASA,UAAT,QAAiD,cAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,IAA7B,EAAmCC,MAAnC,EAA2CC,QAA3C,QAA2D,QAA3D;AAEA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAA8C;AACnD,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,UAFI;AAGJC,IAAAA,UAHI;AAIJC,IAAAA,QAJI;AAKJC,IAAAA,UALI;AAMJC,IAAAA,aANI;AAOJC,IAAAA,aAPI;AAQJC,IAAAA,SARI;AASJC,IAAAA,kBATI;AAUJC,IAAAA,mBAVI;AAWJC,IAAAA,mBAXI;AAYJ,OAAGC;AAZC,MAaFnB,UAAU,CAACoB,OAAX,CAAmBb,KAAK,IAAI,EAA5B,CAbJ;AAeA,QAAMc,UAAqB,GAAG;AAC5Bb,IAAAA,KAD4B;AAE5BC,IAAAA,UAF4B;AAG5BC,IAAAA,UAH4B;AAI5BC,IA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AAY,CACd,GAAGJ,gBADW,EAEd,IAAIG,sBAAsB,GAAGA,sBAAH,GAA4B,EAAtD,CAFc,CAAZ,CADqB,EAKzBrB,QALyB,CAA3B;AAQA,SAAO;AAAEuB,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,GAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,WAAT,CACLC,UADK,EAELC,aAFK,EAGL;AACA,MAAI,CAACA,aAAL,EAAoB;AAClB;AACD;;AAED,QAAMC,eAAe,GAAGjC,UAAU,CAACoB,OAAX,CAAmBW,UAAnB,CAAxB;;AAEA,OAAK,MAAM,CAACG,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeL,aAAf,CAA3B,EAA0D;AACxD,QAAIG,KAAK,IAAI,IAAb,EAAmB;AACjBF,MAAAA,eAAe,CAACC,GAAD,CAAf,GAAuBC,KAAvB;AACD;AACF;;AAED,SAAOF,eAAP;AACD;AAED,OAAO,SAASK,sBAAT,CAAgCH,KAAhC,EAAwD;AAC7D,MAAIlC,QAAQ,CAACkC,KAAD,CAAZ,EAAqB;AACnB,WAAOA,KAAP;AACD,GAFD,MAEO,IAAIjC,QAAQ,CAACiC,KAAD,CAAZ,EAAqB;AAC1B,WAAOI,MAAM,CAACJ,KAAD,CAAb;AACD,GAFM,MAEA;AACL,UAAM,IAAIK,KAAJ,CAAW,kBAAiBL,KAAM,EAAlC,CAAN;AACD;AACF","sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport { isString, isNumber, pick, pickBy, identity } from \"lodash\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return { viewStyles, textStyles };\n}\n\nexport const borderStyleNames = [\n \"borderRadius\",\n \"borderBottomColor\",\n \"borderBottomEndRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomStartRadius\",\n \"borderBottomWidth\",\n \"borderColor\",\n \"borderEndColor\",\n \"borderLeftColor\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderRightColor\",\n \"borderRightWidth\",\n \"borderStartColor\",\n \"borderStyle\",\n \"borderTopColor\",\n \"borderTopEndRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderTopStartRadius\",\n \"borderTopWidth\",\n \"borderWidth\",\n];\n\nexport const marginStyleNames = [\n \"margin\",\n \"marginBottom\",\n \"marginEnd\",\n \"marginHorizontal\",\n \"marginLeft\",\n \"marginRight\",\n \"marginStart\",\n \"marginTop\",\n \"marginVertical\",\n];\n\nexport function extractBorderAndMarginStyles(\n style: StyleProp<any>,\n additionalBorderStyles?: string[],\n additionalMarginStyles?: string[]\n) {\n const flatStyle = StyleSheet.flatten(style || {});\n\n const borderStyles = pickBy(\n pick(flatStyle, [\n ...borderStyleNames,\n ...(additionalBorderStyles ? additionalBorderStyles : []),\n ]),\n identity\n );\n\n const marginStyles = pickBy(\n pick(flatStyle, [\n ...marginStyleNames,\n ...(additionalMarginStyles ? additionalMarginStyles : []),\n ]),\n identity\n );\n\n return { borderStyles, marginStyles };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n\nexport function getValueForRadioButton(value: string | number) {\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return String(value);\n } else {\n throw new Error(`Invalid value: ${value}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["utilities.ts"],"names":["StyleSheet","isString","isNumber","extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","flatten","textStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","String","Error"],"mappings":"AAAA,SAASA,UAAT,QAAiD,cAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,QAAnC;AAEA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAA8C;AACnD,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,UAFI;AAGJC,IAAAA,UAHI;AAIJC,IAAAA,QAJI;AAKJC,IAAAA,UALI;AAMJC,IAAAA,aANI;AAOJC,IAAAA,aAPI;AAQJC,IAAAA,SARI;AASJC,IAAAA,kBATI;AAUJC,IAAAA,mBAVI;AAWJC,IAAAA,mBAXI;AAYJ,OAAGC;AAZC,MAaFhB,UAAU,CAACiB,OAAX,CAAmBb,KAAK,IAAI,EAA5B,CAbJ;AAeA,QAAMc,UAAqB,GAAG;AAC5Bb,IAAAA,KAD4B;AAE5BC,IAAAA,UAF4B;AAG5BC,IAAAA,UAH4B;AAI5BC,IAAAA,QAJ4B;AAK5BC,IAAAA,UAL4B;AAM5BC,IAAAA,aAN4B;AAO5BC,IAAAA,aAP4B;AAQ5BC,IAAAA,SAR4B;AAS5BC,IAAAA,kBAT4B;AAU5BC,IAAAA,mBAV4B;AAW5BC,IAAAA;AAX4B,GAA9B;AAcA,SAAO;AAAEC,IAAAA,UAAF;AAAcE,IAAAA;AAAd,GAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,WAAT,CACLC,UADK,EAELC,aAFK,EAGL;AACA,MAAI,CAACA,aAAL,EAAoB;AAClB;AACD;;AAED,QAAMC,eAAe,GAAGtB,UAAU,CAACiB,OAAX,CAAmBG,UAAnB,CAAxB;;AAEA,OAAK,MAAM,CAACG,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeL,aAAf,CAA3B,EAA0D;AACxD,QAAIG,KAAK,IAAI,IAAb,EAAmB;AACjBF,MAAAA,eAAe,CAACC,GAAD,CAAf,GAAuBC,KAAvB;AACD;AACF;;AAED,SAAOF,eAAP;AACD;AAED,OAAO,SAASK,sBAAT,CAAgCH,KAAhC,EAAwD;AAC7D,MAAIvB,QAAQ,CAACuB,KAAD,CAAZ,EAAqB;AACnB,WAAOA,KAAP;AACD,GAFD,MAEO,IAAItB,QAAQ,CAACsB,KAAD,CAAZ,EAAqB;AAC1B,WAAOI,MAAM,CAACJ,KAAD,CAAb;AACD,GAFM,MAEA;AACL,UAAM,IAAIK,KAAJ,CAAW,kBAAiBL,KAAM,EAAlC,CAAN;AACD;AACF","sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport { isString, isNumber } from \"lodash\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return { viewStyles, textStyles };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n\nexport function getValueForRadioButton(value: string | number) {\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return String(value);\n } else {\n throw new Error(`Invalid value: ${value}`);\n }\n}\n"]}
@@ -1,35 +1,11 @@
1
1
  import * as React from "react";
2
- import { ViewStyle, StyleProp } from "react-native";
3
- import type { Theme } from "../../styles/DefaultTheme";
4
- import type { IconSlot } from "../../interfaces/Icon";
5
- export interface PickerOption {
6
- value: string;
7
- label: string;
8
- }
9
- export declare type PickerProps = {
10
- error?: any;
2
+ import { PickerComponentProps, PickerOption } from "./PickerTypes";
3
+ declare type Props = PickerComponentProps & {
11
4
  placeholder?: string;
12
- disabled?: boolean;
13
- style?: StyleProp<ViewStyle> & {
14
- height?: number;
15
- };
16
5
  value?: string;
17
6
  options: PickerOption[] | string[];
18
- onValueChange: (value: string, index: number) => void;
19
- defaultValue?: string;
20
- assistiveText?: string;
21
- label?: string;
22
- iconColor?: string;
23
- iconSize?: number;
24
- leftIconMode?: "inset" | "outset";
25
- leftIconName?: string;
26
- placeholderTextColor?: string;
27
- rightIconName?: string;
28
- type?: "solid" | "underline";
29
- theme: Theme;
30
- Icon: IconSlot["Icon"];
31
7
  };
32
- declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<PickerProps, "theme"> & {
8
+ declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<Props, "theme"> & {
33
9
  theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
34
- }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<PickerProps> & React.FC<PickerProps>, {}>;
10
+ }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & React.FC<Props>, {}>;
35
11
  export default _default;
@@ -1,13 +1,6 @@
1
1
  import * as React from "react";
2
- import type { IconSlot } from "../../interfaces/Icon";
3
- import { PickerOption } from "./Picker";
4
- interface PickerComponentProps {
5
- Icon: IconSlot["Icon"];
6
- androidPickerRef: React.RefObject<any>;
7
- togglePickerVisible: () => void;
8
- pickerOptions: PickerOption[];
9
- internalValue: string | undefined;
10
- handleValueChange: (newValue: string, itemIndex: number) => void;
11
- }
12
- export declare const PickerComponent: React.FC<PickerComponentProps>;
13
- export {};
2
+ import { PickerComponentProps } from "./PickerTypes";
3
+ declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<PickerComponentProps, "theme"> & {
4
+ theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
5
+ }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<PickerComponentProps> & React.FC<PickerComponentProps>, {}>;
6
+ export default _default;
@@ -1,13 +1,7 @@
1
1
  import * as React from "react";
2
+ import { PickerComponentProps } from "./PickerTypes";
2
3
  import type { IconSlot } from "../../interfaces/Icon";
3
- import { PickerOption } from "./Picker";
4
- interface PickerComponentProps {
5
- Icon: IconSlot["Icon"];
6
- androidPickerRef: React.RefObject<any>;
7
- togglePickerVisible: () => void;
8
- pickerOptions: PickerOption[];
9
- internalValue: string | undefined;
10
- handleValueChange: (newValue: string, itemIndex: number) => void;
11
- }
12
- export declare const PickerComponent: React.FC<PickerComponentProps>;
13
- export {};
4
+ declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<PickerComponentProps & IconSlot, "theme"> & {
5
+ theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
6
+ }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<PickerComponentProps & IconSlot> & React.FC<PickerComponentProps & IconSlot>, {}>;
7
+ export default _default;
@@ -1,13 +1,6 @@
1
1
  import * as React from "react";
2
- import type { IconSlot } from "../../interfaces/Icon";
3
- import { PickerOption } from "./Picker";
4
- interface PickerComponentProps {
5
- Icon: IconSlot["Icon"];
6
- androidPickerRef: React.RefObject<any>;
7
- togglePickerVisible: () => void;
8
- pickerOptions: PickerOption[];
9
- internalValue: string | undefined;
10
- handleValueChange: (newValue: string, itemIndex: number) => void;
11
- }
12
- export declare const PickerComponent: React.FC<PickerComponentProps>;
13
- export {};
2
+ import { PickerComponentProps } from "./PickerTypes";
3
+ declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<PickerComponentProps, "theme"> & {
4
+ theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
5
+ }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<PickerComponentProps> & React.FC<PickerComponentProps>, {}>;
6
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { ViewStyle } from "react-native";
2
+ import { StyleProp } from "react-native";
3
+ import { Props as TextFieldProps } from "../TextField";
4
+ export interface PickerOption {
5
+ value: string;
6
+ label: string;
7
+ }
8
+ export interface PickerComponentProps extends TextFieldProps {
9
+ style?: StyleProp<ViewStyle> & {
10
+ height?: number;
11
+ };
12
+ options: PickerOption[];
13
+ placeholder?: string;
14
+ selectedValue: string;
15
+ disabled?: boolean;
16
+ onValueChange?: (value: string, index: number) => void;
17
+ defaultValue?: string;
18
+ }
@@ -18,27 +18,6 @@ export declare const SEED_DATA: {
18
18
  required: boolean;
19
19
  group: string;
20
20
  };
21
- iconSize: {
22
- group: string;
23
- label: string;
24
- description: string;
25
- editable: boolean;
26
- required: boolean;
27
- formType: string;
28
- propType: string;
29
- defaultValue: number;
30
- options: number[];
31
- };
32
- iconColor: {
33
- group: string;
34
- label: string;
35
- description: string;
36
- editable: boolean;
37
- required: boolean;
38
- defaultValue: null;
39
- formType: string;
40
- propType: string;
41
- };
42
21
  label: {
43
22
  group: string;
44
23
  label: string;
@@ -1,15 +1,8 @@
1
- /// <reference types="lodash" />
2
1
  import { StyleProp, TextStyle } from "react-native";
3
2
  export declare function extractStyles(style: StyleProp<any>): {
4
3
  viewStyles: any;
5
4
  textStyles: TextStyle;
6
5
  };
7
- export declare const borderStyleNames: string[];
8
- export declare const marginStyleNames: string[];
9
- export declare function extractBorderAndMarginStyles(style: StyleProp<any>, additionalBorderStyles?: string[], additionalMarginStyles?: string[]): {
10
- borderStyles: import("lodash").Dictionary<any>;
11
- marginStyles: import("lodash").Dictionary<any>;
12
- };
13
6
  /**
14
7
  * Merges a style object on top of another style object. In React Native,
15
8
  * keys with undefined values in a style object will still override styles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "44.1.14",
3
+ "version": "44.2.0",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -79,5 +79,5 @@
79
79
  ]
80
80
  ]
81
81
  },
82
- "gitHead": "5d730f7f97002f5c0bdd0ad810d44422b3176900"
82
+ "gitHead": "9af2da0c63f291d4707dcd340e2ca03f7cf8e0b1"
83
83
  }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { ThemeProvider } from "./theming";
3
+ import PortalHost from "./components/Portal/PortalHost";
4
+ export default class Provider extends React.Component {
5
+ render() {
6
+ return (React.createElement(PortalHost, null,
7
+ React.createElement(ThemeProvider, { theme: this.props.theme }, this.props.children)));
8
+ }
9
+ }
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet, Pressable, } from "react-native";
3
+ import Text from "../Text";
4
+ import { withTheme } from "../../theming";
5
+ import { extractStyles } from "../../utilities";
6
+ const AccordionGroup = ({ label, expanded: expandedProp = false, openColor, closedColor, caretColor: caretColorProp, caretSize = 24, icon, iconSize = 24, style, children, theme, Icon, }) => {
7
+ const [expanded, setExpanded] = React.useState(expandedProp);
8
+ const { textStyles, viewStyles } = extractStyles(style);
9
+ const expandedColor = openColor || theme.colors.primary;
10
+ const collapsedColor = closedColor || theme.colors.primary;
11
+ const labelColor = expanded ? expandedColor : collapsedColor;
12
+ const caretColor = caretColorProp || labelColor;
13
+ const handlePressAction = () => {
14
+ setExpanded(!expanded);
15
+ };
16
+ return (React.createElement(React.Fragment, null,
17
+ React.createElement(Pressable, { style: [styles.row, viewStyles], onPress: handlePressAction, accessibilityRole: "button" },
18
+ icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
19
+ React.createElement(View, { style: styles.content },
20
+ React.createElement(Text, { selectable: false, style: [
21
+ textStyles,
22
+ {
23
+ color: labelColor,
24
+ },
25
+ ] }, label)),
26
+ React.createElement(Icon, { name: expanded
27
+ ? "MaterialIcons/keyboard-arrow-up"
28
+ : "MaterialIcons/keyboard-arrow-down", color: caretColor, size: caretSize })),
29
+ expanded ? children : null));
30
+ };
31
+ const styles = StyleSheet.create({
32
+ row: {
33
+ flexDirection: "row",
34
+ alignItems: "center",
35
+ },
36
+ content: {
37
+ flex: 1,
38
+ justifyContent: "center",
39
+ },
40
+ icon: {
41
+ marginRight: 8,
42
+ },
43
+ });
44
+ export default withTheme(AccordionGroup);
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { Pressable, StyleSheet, View, } from "react-native";
3
+ import Text from "../Text";
4
+ import { extractStyles } from "../../utilities";
5
+ import { withTheme } from "../../theming";
6
+ const AccordionItem = ({ Icon, icon, label, style, iconColor, theme, ...rest }) => {
7
+ const { textStyles, viewStyles } = extractStyles(style);
8
+ return (React.createElement(Pressable, { style: [styles.container, viewStyles], ...rest },
9
+ React.createElement(View, { style: styles.row },
10
+ icon ? (React.createElement(Icon, { name: icon, size: 24, color: iconColor || theme.colors.primary })) : null,
11
+ React.createElement(View, { style: [styles.item, styles.content] },
12
+ React.createElement(Text, { selectable: false, style: textStyles }, label)))));
13
+ };
14
+ const styles = StyleSheet.create({
15
+ container: {
16
+ padding: 8,
17
+ },
18
+ row: {
19
+ flexDirection: "row",
20
+ alignItems: "center",
21
+ paddingLeft: 8,
22
+ },
23
+ item: {
24
+ marginVertical: 6,
25
+ paddingLeft: 8,
26
+ },
27
+ content: {
28
+ flex: 1,
29
+ justifyContent: "center",
30
+ },
31
+ });
32
+ export default withTheme(AccordionItem);
@@ -0,0 +1,2 @@
1
+ export { default as AccordionGroup } from "./AccordionGroup";
2
+ export { default as AccordionItem } from "./AccordionItem";
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import Portal from "../Portal/Portal";
4
+ import Touchable from "../Touchable";
5
+ import ActionSheetCancel from "./ActionSheetCancel";
6
+ const ActionSheet = ({ visible = false, onClose, children }) => {
7
+ return visible ? (React.createElement(Portal, null,
8
+ React.createElement(Touchable, { style: styles.wrapper, onPress: onClose },
9
+ React.createElement(View, { style: styles.overlay }),
10
+ React.createElement(View, { style: styles.groupWrapper },
11
+ React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child?.type !== ActionSheetCancel)),
12
+ React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child.type === ActionSheetCancel)))))) : (React.createElement(React.Fragment, null));
13
+ };
14
+ const styles = StyleSheet.create({
15
+ wrapper: {
16
+ flex: 1,
17
+ display: "flex",
18
+ flexDirection: "column",
19
+ },
20
+ overlay: {
21
+ position: "absolute",
22
+ top: 0,
23
+ left: 0,
24
+ right: 0,
25
+ bottom: 0,
26
+ backgroundColor: "#000000",
27
+ opacity: 0.3,
28
+ },
29
+ groupWrapper: {
30
+ flex: 1,
31
+ flexDirection: "column",
32
+ justifyContent: "flex-end",
33
+ display: "flex",
34
+ marginBottom: 25,
35
+ },
36
+ group: {
37
+ display: "flex",
38
+ flexDirection: "column",
39
+ borderRadius: 10,
40
+ marginHorizontal: 7,
41
+ marginVertical: 2.5,
42
+ overflow: "hidden",
43
+ },
44
+ });
45
+ export default ActionSheet;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import ActionSheetItem from "./ActionSheetItem";
3
+ const ActionSheetCancel = ({ label = "Cancel", color, style, onPress, }) => {
4
+ return (React.createElement(ActionSheetItem, { label: label, color: color || "#FF453A", style: [style], onPress: onPress }));
5
+ };
6
+ export default ActionSheetCancel;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { Text, StyleSheet, TouchableOpacity, } from "react-native";
3
+ import { extractStyles } from "../../utilities";
4
+ const ActionSheetItem = ({ label, style, color, onPress }) => {
5
+ const { textStyles, viewStyles } = extractStyles(style);
6
+ return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, style: [styles.wrapper, viewStyles], onPress: onPress },
7
+ React.createElement(Text, { style: [styles.label, textStyles, { color }] }, label)));
8
+ };
9
+ const styles = StyleSheet.create({
10
+ wrapper: {
11
+ borderBottomWidth: StyleSheet.hairlineWidth,
12
+ borderBottomColor: "#CCCCCC",
13
+ backgroundColor: "#F1F1F1",
14
+ minHeight: 50,
15
+ overflow: "hidden",
16
+ display: "flex",
17
+ justifyContent: "center",
18
+ },
19
+ label: {
20
+ fontSize: 16,
21
+ textAlign: "center",
22
+ color: "#0A84FF",
23
+ fontWeight: "500",
24
+ overflow: "hidden",
25
+ paddingHorizontal: 20,
26
+ paddingVertical: 10,
27
+ alignSelf: "center",
28
+ },
29
+ });
30
+ export default ActionSheetItem;
@@ -0,0 +1,3 @@
1
+ export { default as ActionSheet } from "./ActionSheet";
2
+ export { default as ActionSheetItem } from "./ActionSheetItem";
3
+ export { default as ActionSheetCancel } from "./ActionSheetCancel";
@@ -0,0 +1,43 @@
1
+ import * as React from "react";
2
+ import { Animated, Easing, } from "react-native";
3
+ import CircularProgress from "./CircularProgress";
4
+ const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
5
+ const AnimatedCircularProgress = ({ duration = 500, easing = Easing.out(Easing.ease), fill, prefill = 0, useNativeDriver = false, tintColorSecondary, onAnimationComplete, tintColor = "black", ...other }) => {
6
+ const [fillAnimation] = React.useState(new Animated.Value(prefill));
7
+ const animate = React.useCallback((toVal = -1, dur, ease) => {
8
+ const toValue = toVal >= 0 ? toVal : fill;
9
+ const dura = dur || duration;
10
+ const eas = ease || easing;
11
+ const useNative = useNativeDriver;
12
+ const anim = Animated.timing(fillAnimation, {
13
+ useNativeDriver: useNative,
14
+ toValue,
15
+ easing: eas,
16
+ duration: dura,
17
+ });
18
+ anim.start(onAnimationComplete);
19
+ return anim;
20
+ }, [
21
+ duration,
22
+ easing,
23
+ fill,
24
+ useNativeDriver,
25
+ fillAnimation,
26
+ onAnimationComplete,
27
+ ]);
28
+ const animateColor = () => {
29
+ if (!tintColorSecondary) {
30
+ return tintColor;
31
+ }
32
+ const tintAnimation = fillAnimation.interpolate({
33
+ inputRange: [0, 100],
34
+ outputRange: [tintColor, tintColorSecondary],
35
+ });
36
+ return tintAnimation;
37
+ };
38
+ React.useEffect(() => {
39
+ animate();
40
+ }, [fill, animate]);
41
+ return (React.createElement(AnimatedProgress, { ...other, style: other.style, childrenContainerStyle: other.childrenContainerStyle, fill: fillAnimation, tintColor: animateColor() }));
42
+ };
43
+ export default AnimatedCircularProgress;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { View, StyleSheet, } from "react-native";
3
+ const AspectRatio = (props) => {
4
+ const [layout, setLayout] = React.useState(null);
5
+ const { aspectRatio = 1, ...inputStyle } = StyleSheet.flatten(props.style) || {};
6
+ const style = [inputStyle, { aspectRatio }];
7
+ if (layout) {
8
+ const { width = 0, height = 0 } = layout;
9
+ if (width === 0) {
10
+ style.push({ width: height * (1 / aspectRatio), height });
11
+ }
12
+ else {
13
+ style.push({ width, height: width * (1 / aspectRatio) });
14
+ }
15
+ }
16
+ return (React.createElement(View, { ...props, style: style, onLayout: ({ nativeEvent: { layout: l } }) => setLayout(l) }, props.children));
17
+ };
18
+ export default AspectRatio;
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { View } from "react-native";
3
+ import Touchable from "./Touchable";
4
+ import CircleImage from "./CircleImage";
5
+ import { withTheme } from "../theming";
6
+ const AvatarEdit = ({ Icon, image, size = 80, onPress = () => { }, style, theme, ...rest }) => {
7
+ const colorStyles = {
8
+ editBackgroundColor: theme.colors.primary,
9
+ editIconColor: theme.colors.surface,
10
+ editBorderColor: theme.colors.surface,
11
+ };
12
+ const dimensions = {
13
+ width: size,
14
+ height: size,
15
+ };
16
+ return (React.createElement(View, { style: [style, dimensions], ...rest },
17
+ React.createElement(Touchable, { onPress: onPress },
18
+ React.createElement(CircleImage, { source: image, size: size }),
19
+ React.createElement(View, { style: {
20
+ position: "absolute",
21
+ top: -3,
22
+ right: -3,
23
+ borderColor: colorStyles.editBorderColor,
24
+ backgroundColor: colorStyles.editBackgroundColor,
25
+ borderRadius: size * (3 / 16),
26
+ padding: size * (3 / 32),
27
+ } },
28
+ React.createElement(Icon, { name: "MaterialIcons/edit", color: colorStyles.editIconColor, size: size * (3 / 16) })))));
29
+ };
30
+ export default withTheme(AvatarEdit);