@draftbit/core 50.2.3-6a2ab1.2 → 50.2.3-9ed7ea.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 (61) hide show
  1. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  2. package/lib/typescript/src/components/AccordionGroup.d.ts +1 -1
  3. package/lib/typescript/src/components/ActivityIndicator.d.ts +1 -1
  4. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +2 -4
  5. package/lib/typescript/src/components/BottomSheet/BottomSheet.js +6 -5
  6. package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
  7. package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +1 -1
  8. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +1 -1
  9. package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +2 -2
  10. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +1 -1
  11. package/lib/typescript/src/components/Divider.d.ts +1 -1
  12. package/lib/typescript/src/components/Elevation.d.ts +1 -1
  13. package/lib/typescript/src/components/IconButton.d.ts +1 -1
  14. package/lib/typescript/src/components/Picker/NativePicker.d.ts +1 -1
  15. package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.d.ts +1 -1
  16. package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +1 -1
  17. package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +1 -1
  18. package/lib/typescript/src/components/Picker/index.d.ts +1 -1
  19. package/lib/typescript/src/components/PinInput/PinInput.d.ts +1 -1
  20. package/lib/typescript/src/components/PinInput/PinInputText.d.ts +1 -1
  21. package/lib/typescript/src/components/Progress/CircularProgress/index.d.ts +1 -1
  22. package/lib/typescript/src/components/Progress/LinearProgress/index.d.ts +1 -1
  23. package/lib/typescript/src/components/ProgressIndicator.d.ts +1 -1
  24. package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +1 -1
  25. package/lib/typescript/src/components/Row.d.ts +1 -1
  26. package/lib/typescript/src/components/ScreenContainer.d.ts +1 -1
  27. package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +1 -1
  28. package/lib/typescript/src/components/Slider.d.ts +1 -1
  29. package/lib/typescript/src/components/StarRating.d.ts +1 -1
  30. package/lib/typescript/src/components/Stepper.d.ts +1 -1
  31. package/lib/typescript/src/components/Surface.d.ts +1 -1
  32. package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +1 -1
  33. package/lib/typescript/src/components/Swiper/Swiper.d.ts +1 -1
  34. package/lib/typescript/src/components/Switch.d.ts +3 -3
  35. package/lib/typescript/src/components/TabView/TabView.d.ts +1 -1
  36. package/lib/typescript/src/components/Table/Table.d.ts +1 -1
  37. package/lib/typescript/src/components/Table/TableRow.d.ts +1 -1
  38. package/lib/typescript/src/components/Text.d.ts +1 -1
  39. package/lib/typescript/src/components/TextField.d.ts +1 -1
  40. package/lib/typescript/src/components/Typography.d.ts +3 -3
  41. package/lib/typescript/src/deprecated-components/AccordionItem.d.ts +1 -1
  42. package/lib/typescript/src/deprecated-components/AvatarEdit.d.ts +1 -1
  43. package/lib/typescript/src/deprecated-components/Banner.d.ts +1 -1
  44. package/lib/typescript/src/deprecated-components/Card.d.ts +3 -3
  45. package/lib/typescript/src/deprecated-components/Container.d.ts +1 -1
  46. package/lib/typescript/src/deprecated-components/DeprecatedButton.d.ts +1 -1
  47. package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.d.ts +1 -1
  48. package/lib/typescript/src/deprecated-components/DeprecatedFAB.d.ts +1 -1
  49. package/lib/typescript/src/deprecated-components/FAB.d.ts +1 -1
  50. package/lib/typescript/src/deprecated-components/FieldSearchBarFull.d.ts +1 -1
  51. package/lib/typescript/src/deprecated-components/ProgressCircle.d.ts +1 -1
  52. package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.d.ts +1 -1
  53. package/lib/typescript/src/deprecated-components/RowBodyIcon.d.ts +1 -1
  54. package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.d.ts +1 -1
  55. package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.d.ts +1 -1
  56. package/lib/typescript/src/deprecated-components/ToggleButton.d.ts +1 -1
  57. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +3 -3
  59. package/src/components/BottomSheet/BottomSheet.js +6 -5
  60. package/src/components/BottomSheet/BottomSheet.js.map +1 -1
  61. package/src/components/BottomSheet/BottomSheet.tsx +7 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "50.2.3-6a2ab1.2+6a2ab10",
3
+ "version": "50.2.3-9ed7ea.2+9ed7ea6",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/theme": "^50.2.3-6a2ab1.2+6a2ab10",
44
+ "@draftbit/theme": "^50.2.3-9ed7ea.2+9ed7ea6",
45
45
  "@expo/vector-icons": "^14.0.0",
46
46
  "@gorhom/bottom-sheet": "5.0.0-alpha.7",
47
47
  "@material-ui/core": "^4.11.0",
@@ -118,5 +118,5 @@
118
118
  ],
119
119
  "testEnvironment": "node"
120
120
  },
121
- "gitHead": "6a2ab10b57b26778e5a951e3cfda77af3a5d63c9"
121
+ "gitHead": "9ed7ea68eb2d6dd2cd9079307c9b9509da621177"
122
122
  }
@@ -1,13 +1,14 @@
1
1
  import React from "react";
2
2
  import { StyleSheet, Dimensions, } from "react-native";
3
3
  import BottomSheetComponent, { BottomSheetScrollView, } from "@gorhom/bottom-sheet";
4
- import { withTheme } from "@draftbit/theme";
4
+ import { useTheme } from "@draftbit/theme";
5
5
  import { useDeepCompareMemo } from "../../utilities";
6
6
  const windowHeight = Dimensions.get("window").height;
7
7
  // Clarification:
8
8
  // Input of snap points is sorted top -> bottom where each value represents distance from top
9
9
  // Implementation using `@gorhom/bottom-sheet` is sorted bottom -> top where each value represents distance from bottom
10
- const BottomSheet = React.forwardRef(({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor = theme.colors.border.brand, topBorderRadius = 20, borderWidth = 1, borderColor = theme.colors.border.brand, onSettle, style, children, ...rest }, ref) => {
10
+ const BottomSheet = React.forwardRef(({ snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor, topBorderRadius = 20, borderWidth = 1, borderColor, onSettle, style, children, ...rest }, ref) => {
11
+ const theme = useTheme();
11
12
  const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background.brand;
12
13
  const snapPoints = snapPointsProp !== null && snapPointsProp !== void 0 ? snapPointsProp : [
13
14
  topSnapPosition,
@@ -28,14 +29,14 @@ const BottomSheet = React.forwardRef(({ theme, snapPoints: snapPointsProp, topSn
28
29
  return (React.createElement(BottomSheetComponent, { ref: ref, snapPoints: mappedSnapPoints, index: initialSnapIndex !== undefined
29
30
  ? mappedSnapPoints.length - initialSnapIndex - 1
30
31
  : getSnapIndexFromPosition(initialSnapPosition), handleIndicatorStyle: [
31
- { backgroundColor: handleColor },
32
+ { backgroundColor: handleColor !== null && handleColor !== void 0 ? handleColor : theme.colors.border.brand },
32
33
  !showHandle ? { display: "none" } : {},
33
34
  ], backgroundStyle: {
34
35
  backgroundColor,
35
36
  borderTopLeftRadius: topBorderRadius,
36
37
  borderTopRightRadius: topBorderRadius,
37
38
  borderWidth,
38
- borderColor,
39
+ borderColor: borderColor !== null && borderColor !== void 0 ? borderColor : theme.colors.border.brand,
39
40
  }, onChange: (index) => onSettle === null || onSettle === void 0 ? void 0 : onSettle(mappedSnapPoints.length - index - 1) },
40
41
  React.createElement(BottomSheetScrollView, { contentContainerStyle: [styles.contentContainerStyle, style], ...rest }, children)));
41
42
  });
@@ -77,5 +78,5 @@ const styles = StyleSheet.create({
77
78
  paddingVertical: 10,
78
79
  },
79
80
  });
80
- export default withTheme(BottomSheet);
81
+ export default BottomSheet;
81
82
  //# sourceMappingURL=BottomSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EAIV,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,oBAAoB,EAAE,EAC3B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AAyBrD,iBAAiB;AACjB,6FAA6F;AAC7F,uHAAuH;AACvH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,KAAK,EACL,UAAU,EAAE,cAAc,EAC1B,eAAe,GAAG,KAAK,EACvB,kBAAkB,GAAG,KAAK,EAC1B,kBAAkB,GAAG,KAAK,EAC1B,gBAAgB,EAChB,mBAAmB,GAAG,QAAQ,EAC9B,UAAU,GAAG,IAAI,EACjB,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EACvC,eAAe,GAAG,EAAE,EACpB,WAAW,GAAG,CAAC,EACf,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EACvC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,G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"@gorhom/bottom-sheet";
13
- import type { ReadTheme } from "@draftbit/theme";
14
- import { withTheme } from "@draftbit/theme";
13
+ import { useTheme } from "@draftbit/theme";
15
14
  import { useDeepCompareMemo } from "../../utilities";
16
15
 
17
16
  type SnapPosition = "top" | "middle" | "bottom";
@@ -38,7 +37,6 @@ export interface BottomSheetProps extends ScrollViewProps {
38
37
  borderColor?: string;
39
38
  onSettle?: (index: number) => void;
40
39
  style?: StyleProp<ViewStyle>;
41
- theme: ReadTheme;
42
40
  }
43
41
 
44
42
  // Clarification:
@@ -47,7 +45,6 @@ export interface BottomSheetProps extends ScrollViewProps {
47
45
  const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
48
46
  (
49
47
  {
50
- theme,
51
48
  snapPoints: snapPointsProp,
52
49
  topSnapPosition = "10%",
53
50
  middleSnapPosition = "50%",
@@ -55,10 +52,10 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
55
52
  initialSnapIndex,
56
53
  initialSnapPosition = "bottom",
57
54
  showHandle = true,
58
- handleColor = theme.colors.border.brand,
55
+ handleColor,
59
56
  topBorderRadius = 20,
60
57
  borderWidth = 1,
61
- borderColor = theme.colors.border.brand,
58
+ borderColor,
62
59
  onSettle,
63
60
  style,
64
61
  children,
@@ -66,6 +63,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
66
63
  },
67
64
  ref
68
65
  ) => {
66
+ const theme = useTheme();
69
67
  const backgroundColor =
70
68
  (style as ViewStyle)?.backgroundColor || theme.colors.background.brand;
71
69
 
@@ -101,7 +99,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
101
99
  : getSnapIndexFromPosition(initialSnapPosition)
102
100
  }
103
101
  handleIndicatorStyle={[
104
- { backgroundColor: handleColor },
102
+ { backgroundColor: handleColor ?? theme.colors.border.brand },
105
103
  !showHandle ? { display: "none" } : {},
106
104
  ]}
107
105
  backgroundStyle={{
@@ -109,7 +107,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
109
107
  borderTopLeftRadius: topBorderRadius,
110
108
  borderTopRightRadius: topBorderRadius,
111
109
  borderWidth,
112
- borderColor,
110
+ borderColor: borderColor ?? theme.colors.border.brand,
113
111
  }}
114
112
  onChange={(index) => onSettle?.(mappedSnapPoints.length - index - 1)}
115
113
  >
@@ -166,4 +164,4 @@ const styles = StyleSheet.create({
166
164
  },
167
165
  });
168
166
 
169
- export default withTheme(BottomSheet);
167
+ export default BottomSheet;