@draftbit/core 47.0.0-0362d7.2 → 47.0.0-alpha.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 (135) hide show
  1. package/lib/commonjs/components/FormRow.js +3 -17
  2. package/lib/commonjs/components/FormRow.js.map +1 -1
  3. package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -30
  4. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
  5. package/lib/commonjs/components/Portal/PortalHost.js +15 -45
  6. package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
  7. package/lib/commonjs/components/RadioButton/RadioButton.js +3 -14
  8. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  9. package/lib/commonjs/components/Stepper.js +0 -1
  10. package/lib/commonjs/components/Surface.js +2 -13
  11. package/lib/commonjs/components/Surface.js.map +1 -1
  12. package/lib/commonjs/mappings/View.js.map +1 -1
  13. package/lib/commonjs/mappings/WebView.js.map +1 -1
  14. package/lib/module/components/Accordion/AccordionItem.js +4 -23
  15. package/lib/module/components/Accordion/AccordionItem.js.map +1 -1
  16. package/lib/module/components/Stepper.js +0 -1
  17. package/package.json +3 -3
  18. package/src/Provider.js +0 -9
  19. package/src/components/Accordion/AccordionGroup.js +0 -44
  20. package/src/components/Accordion/AccordionItem.js +0 -32
  21. package/src/components/Accordion/index.js +0 -2
  22. package/src/components/ActionSheet/ActionSheet.js +0 -45
  23. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  24. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  25. package/src/components/ActionSheet/index.js +0 -3
  26. package/src/components/Button.js +0 -114
  27. package/src/components/Checkbox/Checkbox.js +0 -63
  28. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  29. package/src/components/Checkbox/CheckboxGroupRow.js +0 -77
  30. package/src/components/Checkbox/CheckboxRow.js +0 -78
  31. package/src/components/Checkbox/context.js +0 -14
  32. package/src/components/Checkbox/index.js +0 -3
  33. package/src/components/Config.js +0 -64
  34. package/src/components/DatePicker/DatePicker.js +0 -368
  35. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  36. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  37. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  38. package/src/components/DeprecatedButton.js +0 -95
  39. package/src/components/Elevation.js +0 -20
  40. package/src/components/FormRow.js +0 -19
  41. package/src/components/IconButton.js +0 -35
  42. package/src/components/Layout.js +0 -50
  43. package/src/components/NumberInput.js +0 -49
  44. package/src/components/Picker/Picker.js +0 -267
  45. package/src/components/Picker/PickerComponent.android.js +0 -69
  46. package/src/components/Picker/PickerComponent.ios.js +0 -79
  47. package/src/components/Picker/PickerComponent.web.js +0 -70
  48. package/src/components/Picker/PickerTypes.js +0 -1
  49. package/src/components/Portal/Portal.js +0 -35
  50. package/src/components/Portal/PortalConsumer.js +0 -27
  51. package/src/components/Portal/PortalHost.js +0 -107
  52. package/src/components/Portal/PortalManager.js +0 -32
  53. package/src/components/RadioButton/RadioButton.js +0 -17
  54. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  55. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  56. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  57. package/src/components/RadioButton/context.js +0 -14
  58. package/src/components/RadioButton/index.js +0 -4
  59. package/src/components/SVG.js +0 -13
  60. package/src/components/ScreenContainer.js +0 -34
  61. package/src/components/Slider.js +0 -63
  62. package/src/components/StarRating.js +0 -50
  63. package/src/components/Stepper.js +0 -39
  64. package/src/components/Surface.js +0 -32
  65. package/src/components/Swiper/Swiper.js +0 -29
  66. package/src/components/Swiper/SwiperItem.js +0 -9
  67. package/src/components/Swiper/index.js +0 -2
  68. package/src/components/Switch.js +0 -56
  69. package/src/components/Text.js +0 -33
  70. package/src/components/TextField.js +0 -428
  71. package/src/components/Touchable.js +0 -12
  72. package/src/components/Touchable.web.js +0 -2
  73. package/src/constants.js +0 -10
  74. package/src/hooks.js +0 -12
  75. package/src/index.js +0 -33
  76. package/src/interfaces/Icon.js +0 -8
  77. package/src/mappings/Accordion.js +0 -41
  78. package/src/mappings/AccordionItem.js +0 -16
  79. package/src/mappings/ActionSheet.js +0 -13
  80. package/src/mappings/ActionSheetCancel.js +0 -19
  81. package/src/mappings/ActionSheetItem.js +0 -23
  82. package/src/mappings/ActivityIndicator.js +0 -58
  83. package/src/mappings/AudioPlayer.js +0 -20
  84. package/src/mappings/BlurView.js +0 -42
  85. package/src/mappings/Button.js +0 -87
  86. package/src/mappings/Checkbox.js +0 -46
  87. package/src/mappings/CheckboxGroup.js +0 -26
  88. package/src/mappings/CheckboxRow.js +0 -61
  89. package/src/mappings/CustomCode.js +0 -8
  90. package/src/mappings/DatePicker.js +0 -157
  91. package/src/mappings/Fetch.js +0 -13
  92. package/src/mappings/FlashList.js +0 -33
  93. package/src/mappings/FlatList.js +0 -24
  94. package/src/mappings/Icon.js +0 -32
  95. package/src/mappings/IconButton.js +0 -35
  96. package/src/mappings/Image.js +0 -35
  97. package/src/mappings/ImageBackground.js +0 -29
  98. package/src/mappings/KeyboardAvoidingView.js +0 -41
  99. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  100. package/src/mappings/Layout.js +0 -200
  101. package/src/mappings/LinearGradient.js +0 -77
  102. package/src/mappings/MapCallout.js +0 -21
  103. package/src/mappings/MapMarker.js +0 -47
  104. package/src/mappings/MapView.js +0 -139
  105. package/src/mappings/Modal.js +0 -42
  106. package/src/mappings/NumberInput.js +0 -254
  107. package/src/mappings/Picker.js +0 -148
  108. package/src/mappings/RadioButton.js +0 -51
  109. package/src/mappings/RadioButtonGroup.js +0 -17
  110. package/src/mappings/RadioButtonRow.js +0 -42
  111. package/src/mappings/SVG.js +0 -20
  112. package/src/mappings/SafeAreaView.js +0 -33
  113. package/src/mappings/ScrollView.js +0 -31
  114. package/src/mappings/Slider.js +0 -60
  115. package/src/mappings/StarRating.js +0 -43
  116. package/src/mappings/Stepper.js +0 -29
  117. package/src/mappings/Surface.js +0 -14
  118. package/src/mappings/Swiper.js +0 -60
  119. package/src/mappings/SwiperItem.js +0 -8
  120. package/src/mappings/Switch.js +0 -81
  121. package/src/mappings/Text.js +0 -251
  122. package/src/mappings/TextArea.js +0 -263
  123. package/src/mappings/TextField.js +0 -381
  124. package/src/mappings/TextInput.js +0 -391
  125. package/src/mappings/Touchable.js +0 -17
  126. package/src/mappings/Video.js +0 -81
  127. package/src/mappings/View.js +0 -207
  128. package/src/mappings/WebView.js +0 -88
  129. package/src/styles/DarkTheme.js +0 -26
  130. package/src/styles/DefaultTheme.js +0 -111
  131. package/src/styles/fonts.js +0 -62
  132. package/src/styles/overlay.js +0 -60
  133. package/src/styles/shadow.js +0 -51
  134. package/src/theming.js +0 -3
  135. package/src/utilities.js +0 -102
package/src/utilities.js DELETED
@@ -1,102 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { isString, isNumber, pick, pickBy, identity } from "lodash";
3
- export function extractStyles(style) {
4
- const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
5
- const textStyles = {
6
- color,
7
- fontFamily,
8
- fontWeight,
9
- fontSize,
10
- lineHeight,
11
- letterSpacing,
12
- textTransform,
13
- textAlign,
14
- textDecorationLine,
15
- textDecorationColor,
16
- textDecorationStyle,
17
- };
18
- return { viewStyles, textStyles };
19
- }
20
- export const borderStyleNames = [
21
- "borderRadius",
22
- "borderBottomColor",
23
- "borderBottomEndRadius",
24
- "borderBottomLeftRadius",
25
- "borderBottomRightRadius",
26
- "borderBottomStartRadius",
27
- "borderBottomWidth",
28
- "borderColor",
29
- "borderEndColor",
30
- "borderLeftColor",
31
- "borderLeftWidth",
32
- "borderRadius",
33
- "borderRightColor",
34
- "borderRightWidth",
35
- "borderStartColor",
36
- "borderStyle",
37
- "borderTopColor",
38
- "borderTopEndRadius",
39
- "borderTopLeftRadius",
40
- "borderTopRightRadius",
41
- "borderTopStartRadius",
42
- "borderTopWidth",
43
- "borderWidth",
44
- ];
45
- export const marginStyleNames = [
46
- "margin",
47
- "marginBottom",
48
- "marginEnd",
49
- "marginHorizontal",
50
- "marginLeft",
51
- "marginRight",
52
- "marginStart",
53
- "marginTop",
54
- "marginVertical",
55
- ];
56
- export function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalMarginStyles) {
57
- const flatStyle = StyleSheet.flatten(style || {});
58
- const borderStyles = pickBy(pick(flatStyle, [
59
- ...borderStyleNames,
60
- ...(additionalBorderStyles ? additionalBorderStyles : []),
61
- ]), identity);
62
- const marginStyles = pickBy(pick(flatStyle, [
63
- ...marginStyleNames,
64
- ...(additionalMarginStyles ? additionalMarginStyles : []),
65
- ]), identity);
66
- return { borderStyles, marginStyles };
67
- }
68
- /**
69
- * Merges a style object on top of another style object. In React Native,
70
- * keys with undefined values in a style object will still override styles
71
- * that appear earlier in a sequence. This avoids that problem.
72
- *
73
- * This lets us avoid the `...(something ? { something } : {})` pattern.
74
- * There doesn't seem to be a better way to do this. These all seem to not
75
- * work (i.e. they all result in `{ color: undefined }`:
76
- * `const mergedStyles = [{ color: "red" }, { color: undefined }]`
77
- * `const mergedStyles = StyleSheet.compose({ color: "red" }, { color: undefined })`
78
- * `const mergedStyles = StyleSheet.flatten([{ color: "red" }, { color: undefined }])`
79
- */
80
- export function applyStyles(baseStyles, stylesToApply) {
81
- if (!stylesToApply) {
82
- return;
83
- }
84
- const flattenedStyles = StyleSheet.flatten(baseStyles);
85
- for (const [key, value] of Object.entries(stylesToApply)) {
86
- if (value != null) {
87
- flattenedStyles[key] = value;
88
- }
89
- }
90
- return flattenedStyles;
91
- }
92
- export function getValueForRadioButton(value) {
93
- if (isString(value)) {
94
- return value;
95
- }
96
- else if (isNumber(value)) {
97
- return String(value);
98
- }
99
- else {
100
- throw new Error(`Invalid value: ${value}`);
101
- }
102
- }