@draftbit/core 47.0.0-3bcd8b.2 → 47.0.0-alpha.1

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 (137) hide show
  1. package/lib/commonjs/components/Picker/Picker.js +2 -2
  2. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  3. package/lib/commonjs/components/Stepper.js +0 -1
  4. package/lib/commonjs/index.js +7 -0
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/mappings/View.js.map +1 -1
  7. package/lib/commonjs/mappings/WebView.js.map +1 -1
  8. package/lib/module/components/Picker/Picker.js +1 -1
  9. package/lib/module/components/Picker/Picker.js.map +1 -1
  10. package/lib/module/components/Stepper.js +0 -1
  11. package/lib/module/index.js +1 -0
  12. package/lib/module/index.js.map +1 -1
  13. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  14. package/lib/typescript/src/index.d.ts +1 -0
  15. package/lib/typescript/src/index.d.ts.map +1 -1
  16. package/package.json +3 -3
  17. package/src/components/Picker/Picker.tsx +2 -2
  18. package/src/index.tsx +1 -0
  19. package/src/Provider.js +0 -9
  20. package/src/components/Accordion/AccordionGroup.js +0 -44
  21. package/src/components/Accordion/AccordionItem.js +0 -32
  22. package/src/components/Accordion/index.js +0 -2
  23. package/src/components/ActionSheet/ActionSheet.js +0 -45
  24. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  25. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  26. package/src/components/ActionSheet/index.js +0 -3
  27. package/src/components/Banner.js +0 -109
  28. package/src/components/Button.js +0 -114
  29. package/src/components/Checkbox/Checkbox.js +0 -63
  30. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  31. package/src/components/Checkbox/CheckboxGroupRow.js +0 -77
  32. package/src/components/Checkbox/CheckboxRow.js +0 -78
  33. package/src/components/Checkbox/context.js +0 -14
  34. package/src/components/Checkbox/index.js +0 -3
  35. package/src/components/Config.js +0 -64
  36. package/src/components/DatePicker/DatePicker.js +0 -368
  37. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  38. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  39. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  40. package/src/components/DeprecatedButton.js +0 -95
  41. package/src/components/Elevation.js +0 -20
  42. package/src/components/FormRow.js +0 -19
  43. package/src/components/IconButton.js +0 -35
  44. package/src/components/Layout.js +0 -50
  45. package/src/components/NumberInput.js +0 -49
  46. package/src/components/Picker/Picker.js +0 -267
  47. package/src/components/Picker/PickerComponent.android.js +0 -69
  48. package/src/components/Picker/PickerComponent.ios.js +0 -79
  49. package/src/components/Picker/PickerComponent.web.js +0 -70
  50. package/src/components/Picker/PickerTypes.js +0 -1
  51. package/src/components/Portal/Portal.js +0 -35
  52. package/src/components/Portal/PortalConsumer.js +0 -27
  53. package/src/components/Portal/PortalHost.js +0 -107
  54. package/src/components/Portal/PortalManager.js +0 -32
  55. package/src/components/RadioButton/RadioButton.js +0 -17
  56. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  57. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  58. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  59. package/src/components/RadioButton/context.js +0 -14
  60. package/src/components/RadioButton/index.js +0 -4
  61. package/src/components/SVG.js +0 -13
  62. package/src/components/ScreenContainer.js +0 -34
  63. package/src/components/Slider.js +0 -63
  64. package/src/components/StarRating.js +0 -50
  65. package/src/components/Stepper.js +0 -39
  66. package/src/components/Surface.js +0 -32
  67. package/src/components/Swiper/Swiper.js +0 -29
  68. package/src/components/Swiper/SwiperItem.js +0 -9
  69. package/src/components/Swiper/index.js +0 -2
  70. package/src/components/Switch.js +0 -56
  71. package/src/components/Text.js +0 -33
  72. package/src/components/TextField.js +0 -428
  73. package/src/components/Touchable.js +0 -12
  74. package/src/components/Touchable.web.js +0 -2
  75. package/src/constants.js +0 -10
  76. package/src/hooks.js +0 -12
  77. package/src/index.js +0 -34
  78. package/src/interfaces/Icon.js +0 -8
  79. package/src/mappings/Accordion.js +0 -41
  80. package/src/mappings/AccordionItem.js +0 -16
  81. package/src/mappings/ActionSheet.js +0 -13
  82. package/src/mappings/ActionSheetCancel.js +0 -19
  83. package/src/mappings/ActionSheetItem.js +0 -23
  84. package/src/mappings/ActivityIndicator.js +0 -58
  85. package/src/mappings/AudioPlayer.js +0 -20
  86. package/src/mappings/BlurView.js +0 -42
  87. package/src/mappings/Button.js +0 -87
  88. package/src/mappings/Checkbox.js +0 -46
  89. package/src/mappings/CheckboxGroup.js +0 -26
  90. package/src/mappings/CheckboxRow.js +0 -61
  91. package/src/mappings/CustomCode.js +0 -8
  92. package/src/mappings/DatePicker.js +0 -157
  93. package/src/mappings/Fetch.js +0 -13
  94. package/src/mappings/FlashList.js +0 -33
  95. package/src/mappings/FlatList.js +0 -24
  96. package/src/mappings/Icon.js +0 -32
  97. package/src/mappings/IconButton.js +0 -35
  98. package/src/mappings/Image.js +0 -35
  99. package/src/mappings/ImageBackground.js +0 -29
  100. package/src/mappings/KeyboardAvoidingView.js +0 -41
  101. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  102. package/src/mappings/Layout.js +0 -200
  103. package/src/mappings/LinearGradient.js +0 -77
  104. package/src/mappings/MapCallout.js +0 -21
  105. package/src/mappings/MapMarker.js +0 -47
  106. package/src/mappings/MapView.js +0 -139
  107. package/src/mappings/Modal.js +0 -42
  108. package/src/mappings/NumberInput.js +0 -254
  109. package/src/mappings/Picker.js +0 -148
  110. package/src/mappings/RadioButton.js +0 -51
  111. package/src/mappings/RadioButtonGroup.js +0 -17
  112. package/src/mappings/RadioButtonRow.js +0 -42
  113. package/src/mappings/SVG.js +0 -20
  114. package/src/mappings/SafeAreaView.js +0 -33
  115. package/src/mappings/ScrollView.js +0 -31
  116. package/src/mappings/Slider.js +0 -60
  117. package/src/mappings/StarRating.js +0 -43
  118. package/src/mappings/Stepper.js +0 -29
  119. package/src/mappings/Surface.js +0 -14
  120. package/src/mappings/Swiper.js +0 -60
  121. package/src/mappings/SwiperItem.js +0 -8
  122. package/src/mappings/Switch.js +0 -81
  123. package/src/mappings/Text.js +0 -251
  124. package/src/mappings/TextArea.js +0 -263
  125. package/src/mappings/TextField.js +0 -381
  126. package/src/mappings/TextInput.js +0 -391
  127. package/src/mappings/Touchable.js +0 -17
  128. package/src/mappings/Video.js +0 -81
  129. package/src/mappings/View.js +0 -207
  130. package/src/mappings/WebView.js +0 -88
  131. package/src/styles/DarkTheme.js +0 -26
  132. package/src/styles/DefaultTheme.js +0 -111
  133. package/src/styles/fonts.js +0 -62
  134. package/src/styles/overlay.js +0 -60
  135. package/src/styles/shadow.js +0 -51
  136. package/src/theming.js +0 -3
  137. 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
- }