@draftbit/core 54.0.4-c430ff.2 → 54.0.5

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 (118) hide show
  1. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  2. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
  3. package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
  4. package/lib/commonjs/components/Layout/Spacer.js +1 -1
  5. package/lib/commonjs/components/LottieAnimation.js +1 -1
  6. package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
  7. package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
  8. package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
  9. package/lib/commonjs/components/Portal/PortalHost.js +1 -1
  10. package/lib/commonjs/components/Portal/PortalManager.js +1 -1
  11. package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
  12. package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
  13. package/lib/commonjs/components/SVG.js +1 -1
  14. package/lib/commonjs/components/SVG.native.js +1 -1
  15. package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
  16. package/lib/commonjs/components/Surface.js +1 -1
  17. package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
  18. package/lib/commonjs/components/Swiper/Swiper.js +1 -1
  19. package/lib/commonjs/components/Swiper/SwiperItem.js +1 -1
  20. package/lib/commonjs/components/Table/TableCell.js +1 -1
  21. package/lib/commonjs/components/Table/TableRow.js +1 -1
  22. package/lib/commonjs/components/TextField.js +1 -1
  23. package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +1 -1
  24. package/lib/commonjs/deprecated-components/AvoidKeyboardView.js +1 -1
  25. package/lib/typescript/src/components/DatePicker/DatePicker.js +3 -2
  26. package/lib/typescript/src/components/DatePicker/DatePicker.js.map +1 -1
  27. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +1 -0
  28. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.js +3 -2
  29. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.js.map +1 -1
  30. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +2 -2
  31. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
  32. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
  33. package/lib/typescript/src/components/Layout/Spacer.d.ts +2 -2
  34. package/lib/typescript/src/components/Layout/Spacer.js +2 -2
  35. package/lib/typescript/src/components/Layout/Spacer.js.map +1 -1
  36. package/lib/typescript/src/components/LottieAnimation.js +2 -2
  37. package/lib/typescript/src/components/LottieAnimation.js.map +1 -1
  38. package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.d.ts +1 -0
  39. package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +4 -2
  40. package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
  41. package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +7 -3
  42. package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
  43. package/lib/typescript/src/components/Picker/PickerCommon.d.ts +1 -0
  44. package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
  45. package/lib/typescript/src/components/Picker/PickerInputContainer.js +4 -2
  46. package/lib/typescript/src/components/Picker/PickerInputContainer.js.map +1 -1
  47. package/lib/typescript/src/components/Portal/PortalHost.js +2 -1
  48. package/lib/typescript/src/components/Portal/PortalHost.js.map +1 -1
  49. package/lib/typescript/src/components/Portal/PortalManager.js +1 -1
  50. package/lib/typescript/src/components/Portal/PortalManager.js.map +1 -1
  51. package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js +4 -2
  52. package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
  53. package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js +4 -2
  54. package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
  55. package/lib/typescript/src/components/Progress/ProgressCommon.d.ts +1 -0
  56. package/lib/typescript/src/components/SVG.d.ts +1 -0
  57. package/lib/typescript/src/components/SVG.js +4 -2
  58. package/lib/typescript/src/components/SVG.js.map +1 -1
  59. package/lib/typescript/src/components/SVG.native.d.ts +1 -0
  60. package/lib/typescript/src/components/SVG.native.js +4 -2
  61. package/lib/typescript/src/components/SVG.native.js.map +1 -1
  62. package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +2 -2
  63. package/lib/typescript/src/components/SectionList/SectionHeader.js +1 -1
  64. package/lib/typescript/src/components/SectionList/SectionHeader.js.map +1 -1
  65. package/lib/typescript/src/components/Surface.js +1 -9
  66. package/lib/typescript/src/components/Surface.js.map +1 -1
  67. package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +1 -0
  68. package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js +4 -2
  69. package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
  70. package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -2
  71. package/lib/typescript/src/components/Swiper/Swiper.js +2 -2
  72. package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
  73. package/lib/typescript/src/components/Swiper/SwiperItem.d.ts +3 -3
  74. package/lib/typescript/src/components/Swiper/SwiperItem.js +2 -2
  75. package/lib/typescript/src/components/Swiper/SwiperItem.js.map +1 -1
  76. package/lib/typescript/src/components/Table/TableCell.d.ts +1 -0
  77. package/lib/typescript/src/components/Table/TableCell.js +4 -2
  78. package/lib/typescript/src/components/Table/TableCell.js.map +1 -1
  79. package/lib/typescript/src/components/Table/TableRow.d.ts +1 -0
  80. package/lib/typescript/src/components/Table/TableRow.js +4 -2
  81. package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
  82. package/lib/typescript/src/components/TextField.js +2 -1
  83. package/lib/typescript/src/components/TextField.js.map +1 -1
  84. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.js +2 -2
  85. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayer.js.map +1 -1
  86. package/lib/typescript/src/components/YoutubePlayer/YoutubePlayerProps.d.ts +1 -0
  87. package/lib/typescript/src/deprecated-components/AvoidKeyboardView.js +1 -3
  88. package/lib/typescript/src/deprecated-components/AvoidKeyboardView.js.map +1 -1
  89. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +3 -3
  91. package/src/components/DatePicker/DatePicker.tsx +2 -2
  92. package/src/components/DeckSwiper/DeckSwiper.tsx +5 -1
  93. package/src/components/DeckSwiper/DeckSwiperCard.tsx +11 -3
  94. package/src/components/Layout/Spacer.tsx +4 -2
  95. package/src/components/LottieAnimation.tsx +1 -2
  96. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.ts +1 -0
  97. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +3 -0
  98. package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +10 -3
  99. package/src/components/Picker/PickerCommon.ts +1 -0
  100. package/src/components/Picker/PickerInputContainer.tsx +7 -1
  101. package/src/components/Portal/PortalHost.tsx +2 -5
  102. package/src/components/Portal/PortalManager.tsx +1 -2
  103. package/src/components/Progress/CircularProgress/CircularProgress.tsx +3 -0
  104. package/src/components/Progress/LinearProgress/LinearProgress.tsx +3 -0
  105. package/src/components/Progress/ProgressCommon.ts +1 -0
  106. package/src/components/SVG.native.tsx +7 -1
  107. package/src/components/SVG.tsx +10 -1
  108. package/src/components/SectionList/SectionHeader.tsx +8 -3
  109. package/src/components/Surface.tsx +4 -10
  110. package/src/components/SwipeableItem/SwipeableItem.tsx +4 -0
  111. package/src/components/Swiper/Swiper.tsx +4 -3
  112. package/src/components/Swiper/SwiperItem.tsx +12 -4
  113. package/src/components/Table/TableCell.tsx +4 -0
  114. package/src/components/Table/TableRow.tsx +4 -0
  115. package/src/components/TextField.tsx +1 -1
  116. package/src/components/YoutubePlayer/YoutubePlayer.tsx +5 -1
  117. package/src/components/YoutubePlayer/YoutubePlayerProps.ts +1 -0
  118. package/src/deprecated-components/AvoidKeyboardView.tsx +1 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "54.0.4-c430ff.2+c430fff",
3
+ "version": "54.0.5",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
43
43
  "dependencies": {
44
44
  "@draftbit/react-theme-provider": "^2.1.1",
45
- "@draftbit/theme": "^54.0.4-c430ff.2+c430fff",
45
+ "@draftbit/theme": "54.0.5",
46
46
  "@emotion/react": "^11.13.5",
47
47
  "@emotion/styled": "^11.13.5",
48
48
  "@expo/vector-icons": "^15.0.3",
@@ -123,5 +123,5 @@
123
123
  ],
124
124
  "testEnvironment": "node"
125
125
  },
126
- "gitHead": "c430fffec4ae2e6942f2234b6e9b33d9cb9a3309"
126
+ "gitHead": "51ca63d0f063dee46a9bf62c910368c165979d34"
127
127
  }
@@ -444,7 +444,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
444
444
  return (
445
445
  <>
446
446
  <Touchable disabled={disabled} onPress={toggleVisibility}>
447
- <View pointerEvents="none">
447
+ <View style={{ pointerEvents: "none" }}>
448
448
  <View
449
449
  style={StyleSheet.flatten([
450
450
  styles.container,
@@ -491,10 +491,10 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
491
491
  // Position colored placeholder and gray placeholder on top of each other and crossfade them
492
492
  // This gives the effect of animating the color, but allows us to use native driver
493
493
  <View
494
- pointerEvents="none"
495
494
  style={[
496
495
  StyleSheet.absoluteFill,
497
496
  {
497
+ pointerEvents: "none",
498
498
  opacity:
499
499
  // Hide the label in minimized state until we measure its width
500
500
  date || focused ? (labelLayout.measured ? 1 : 0) : 1,
@@ -25,6 +25,7 @@ export interface DeckSwiperProps<T> {
25
25
  keyExtractor?: (item: T) => string;
26
26
  renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
27
27
  style?: StyleProp<ViewStyle>;
28
+ className?: string;
28
29
  }
29
30
 
30
31
  const DeckSwiper = React.forwardRef<DeckSwiperRef, DeckSwiperProps<any>>(
@@ -48,6 +49,7 @@ const DeckSwiper = React.forwardRef<DeckSwiperRef, DeckSwiperProps<any>>(
48
49
  keyExtractor,
49
50
  renderItem,
50
51
  style,
52
+ className,
51
53
  children,
52
54
  }: React.PropsWithChildren<DeckSwiperProps<T>>,
53
55
  ref: React.Ref<DeckSwiperRef>
@@ -146,7 +148,9 @@ const DeckSwiper = React.forwardRef<DeckSwiperRef, DeckSwiperProps<any>>(
146
148
  */
147
149
 
148
150
  return (
149
- <View>
151
+ <View // @ts-ignore
152
+ className={className}
153
+ >
150
154
  <View style={styles.containerHeightFiller}>{renderFirstCard()}</View>
151
155
  <DeckSwiperComponent
152
156
  ref={deckSwiperRef}
@@ -1,16 +1,23 @@
1
1
  import React from "react";
2
- import { View, StyleSheet, StyleProp, ViewStyle } from "react-native";
2
+ import {
3
+ View,
4
+ ViewProps,
5
+ StyleSheet,
6
+ StyleProp,
7
+ ViewStyle,
8
+ } from "react-native";
3
9
  import type { ReadTheme } from "@draftbit/theme";
4
10
  import { withTheme } from "@draftbit/theme";
5
11
 
6
- export interface DeckSwiperCardProps {
12
+ export interface DeckSwiperCardProps
13
+ extends Omit<ViewProps, "style" | "children"> {
7
14
  style?: StyleProp<ViewStyle>;
8
15
  theme: ReadTheme;
9
16
  }
10
17
 
11
18
  const DeckSwiperCard: React.FC<
12
19
  React.PropsWithChildren<DeckSwiperCardProps>
13
- > = ({ style, children, theme }) => (
20
+ > = ({ style, children, theme, ...rest }) => (
14
21
  <View
15
22
  style={[
16
23
  styles.card,
@@ -20,6 +27,7 @@ const DeckSwiperCard: React.FC<
20
27
  },
21
28
  style,
22
29
  ]}
30
+ {...rest}
23
31
  >
24
32
  {children}
25
33
  </View>
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { View, StyleProp, ViewStyle } from "react-native";
2
+ import { View, ViewProps, StyleProp, ViewStyle } from "react-native";
3
3
 
4
- interface SpacerProps {
4
+ interface SpacerProps extends Omit<ViewProps, "style"> {
5
5
  top?: number;
6
6
  right?: number;
7
7
  left?: number;
@@ -15,6 +15,7 @@ const Spacer: React.FC<SpacerProps> = ({
15
15
  bottom = 8,
16
16
  left = 8,
17
17
  style,
18
+ ...rest
18
19
  }) => {
19
20
  return (
20
21
  <View
@@ -27,6 +28,7 @@ const Spacer: React.FC<SpacerProps> = ({
27
28
  paddingBottom: bottom,
28
29
  },
29
30
  ]}
31
+ {...rest}
30
32
  />
31
33
  );
32
34
  };
@@ -25,7 +25,7 @@ const LottieAnimation = forwardRef<LottieView, Props>(
25
25
  ref
26
26
  ) => {
27
27
  return (
28
- <View style={style}>
28
+ <View style={style} {...rest}>
29
29
  <LottieView
30
30
  ref={ref}
31
31
  source={source}
@@ -36,7 +36,6 @@ const LottieAnimation = forwardRef<LottieView, Props>(
36
36
  // A specific size is required on mobile, but not on web.
37
37
  // This ensures consistent behavior across platforms during preview.
38
38
  style={{ width: "100%", height: "100%" }}
39
- {...rest}
40
39
  />
41
40
  </View>
42
41
  );
@@ -13,6 +13,7 @@ export interface HeadlessAudioPlayerProps extends MediaPlayerProps {
13
13
  }
14
14
 
15
15
  export interface AudioPlayerInterfaceProps {
16
+ className?: string;
16
17
  style?: StyleProp<ViewStyle & TextStyle>;
17
18
  thumbColor?: string;
18
19
  completedTrackColor?: string;
@@ -21,6 +21,7 @@ const AudioPlayerWithInterface = React.forwardRef<
21
21
  (
22
22
  {
23
23
  style,
24
+ className,
24
25
  thumbColor,
25
26
  completedTrackColor,
26
27
  remainingTrackColor,
@@ -127,6 +128,8 @@ const AudioPlayerWithInterface = React.forwardRef<
127
128
  />
128
129
  <View
129
130
  testID="audio-player-interface"
131
+ // @ts-ignore
132
+ className={className}
130
133
  style={[
131
134
  {
132
135
  backgroundColor: theme.colors.background.base,
@@ -75,6 +75,9 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
75
75
  },
76
76
  ref
77
77
  ) => {
78
+ // @ts-ignore
79
+ const { className, ...videoPlayerProps } = rest;
80
+
78
81
  const stableSource = useSourceDeepCompareMemoize(
79
82
  normalizeBase64Source(source, "video")
80
83
  );
@@ -248,7 +251,11 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
248
251
  ref={mediaPlaybackWrapperRef}
249
252
  onTogglePlayback={updateAudioMode}
250
253
  >
251
- <View style={[style, styles.container]}>
254
+ <View
255
+ style={[style, styles.container]}
256
+ // @ts-ignore
257
+ className={className}
258
+ >
252
259
  <VideoPlayerComponent
253
260
  ref={videoPlayerRef}
254
261
  player={player}
@@ -258,10 +265,10 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
258
265
  onFullscreenEnter={() => onFullscreenUpdate("entered")}
259
266
  onFullscreenExit={() => onFullscreenUpdate("exited")}
260
267
  allowsFullscreen={allowsFullscreen}
261
- {...rest}
268
+ {...videoPlayerProps}
262
269
  />
263
270
  {showPoster && posterSource && (
264
- <View style={StyleSheet.absoluteFill} pointerEvents="none">
271
+ <View style={[StyleSheet.absoluteFill, { pointerEvents: "none" }]}>
265
272
  <Image
266
273
  source={posterSource}
267
274
  resizeMode={posterResizeMode}
@@ -12,6 +12,7 @@ export interface PickerOption {
12
12
  }
13
13
 
14
14
  export interface PickerInputContainerProps extends IconSlot {
15
+ className?: string;
15
16
  error?: boolean;
16
17
  placeholder?: string;
17
18
  disabled?: boolean;
@@ -33,6 +33,7 @@ const PickerInputContainer: React.FC<
33
33
  options = [],
34
34
  onPress,
35
35
  Icon,
36
+ className,
36
37
  style,
37
38
  selectedValue,
38
39
  disabled = false,
@@ -70,7 +71,12 @@ const PickerInputContainer: React.FC<
70
71
  }
71
72
 
72
73
  return (
73
- <View testID={testID} style={[containerStyle, { zIndex }]}>
74
+ <View
75
+ testID={testID}
76
+ style={[containerStyle, { zIndex }]}
77
+ // @ts-ignore
78
+ className={className}
79
+ >
74
80
  <TextField
75
81
  Icon={Icon}
76
82
  numberOfLines={1}
@@ -124,11 +124,7 @@ export default class PortalHost extends React.Component<Props> {
124
124
  }}
125
125
  >
126
126
  {/* Need collapsable=false here to clip the elevations, otherwise they appear above Portal components */}
127
- <View
128
- style={styles.container}
129
- collapsable={false}
130
- pointerEvents="box-none"
131
- >
127
+ <View style={styles.container} collapsable={false}>
132
128
  {this.props.children}
133
129
  </View>
134
130
  <PortalManager ref={this.setManager} />
@@ -140,5 +136,6 @@ export default class PortalHost extends React.Component<Props> {
140
136
  const styles = StyleSheet.create({
141
137
  container: {
142
138
  flex: 1,
139
+ pointerEvents: "none",
143
140
  },
144
141
  });
@@ -44,8 +44,7 @@ export default class PortalManager extends React.PureComponent<object, State> {
44
44
  collapsable={
45
45
  false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */
46
46
  }
47
- pointerEvents="box-none"
48
- style={StyleSheet.absoluteFill}
47
+ style={[StyleSheet.absoluteFill, { pointerEvents: "none" }]}
49
48
  >
50
49
  {children}
51
50
  </View>
@@ -41,6 +41,7 @@ export const CircularProgress: React.FC<
41
41
  trackCustomDashArray,
42
42
  onFullPathWidth,
43
43
  startPosition = "top",
44
+ className,
44
45
  style,
45
46
  testID,
46
47
  }) => {
@@ -128,6 +129,8 @@ export const CircularProgress: React.FC<
128
129
  },
129
130
  style,
130
131
  ]}
132
+ // @ts-ignore
133
+ className={className}
131
134
  >
132
135
  <Svg testID={testID ?? "circular-progress-component"} style={{ flex: 1 }}>
133
136
  {showTrack && (
@@ -37,6 +37,7 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
37
37
  customDashArray,
38
38
  trackCustomDashArray,
39
39
  onFullPathWidth,
40
+ className,
40
41
  style,
41
42
  testID,
42
43
  }) => {
@@ -101,6 +102,8 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
101
102
  },
102
103
  style,
103
104
  ]}
105
+ // @ts-ignore
106
+ className={className}
104
107
  >
105
108
  <Svg testID={testID ?? "linear-progress-component"} style={{ flex: 1 }}>
106
109
  {showTrack && (
@@ -25,6 +25,7 @@ export interface BaseProgressProps {
25
25
  customDashArray?: string;
26
26
  trackCustomDashArray?: string;
27
27
  onFullPathWidth?: (width: number) => void;
28
+ className?: string;
28
29
  style?: StyleProp<ViewStyle>;
29
30
  theme: ReadTheme;
30
31
  testID?: string;
@@ -7,14 +7,20 @@ import Config from "./Config";
7
7
  type SVGComponentProps = {
8
8
  source: string;
9
9
  style?: StyleProp<ImageStyle>;
10
+ className?: string;
10
11
  };
11
12
 
12
13
  const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
13
14
  source = Config.placeholderSvgURL,
14
15
  style,
16
+ className,
15
17
  }) => {
16
18
  return (
17
- <View style={style as StyleProp<ViewStyle>}>
19
+ <View
20
+ style={style as StyleProp<ViewStyle>}
21
+ // @ts-ignore
22
+ className={className}
23
+ >
18
24
  <SvgUri width="100%" height="100%" uri={source} />
19
25
  </View>
20
26
  );
@@ -6,13 +6,22 @@ import Config from "./Config";
6
6
  type SVGComponentProps = {
7
7
  source: string;
8
8
  style?: StyleProp<ImageStyle>;
9
+ className?: string;
9
10
  };
10
11
 
11
12
  const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
12
13
  source = Config.placeholderSvgURL,
13
14
  style,
15
+ className,
14
16
  }) => {
15
- return <Image style={style} source={{ uri: source }} />;
17
+ return (
18
+ <Image
19
+ style={style}
20
+ source={{ uri: source }}
21
+ // @ts-ignore
22
+ className={className}
23
+ />
24
+ );
16
25
  };
17
26
 
18
27
  export default SVG;
@@ -1,16 +1,21 @@
1
1
  import React from "react";
2
- import { View, StyleProp, ViewStyle, Text } from "react-native";
2
+ import { View, ViewProps, StyleProp, ViewStyle, Text } from "react-native";
3
3
  import { withTheme } from "@draftbit/theme";
4
4
  import type { ReadTheme } from "@draftbit/theme";
5
5
 
6
- interface SectionHeaderProps {
6
+ interface SectionHeaderProps extends Omit<ViewProps, "style" | "children"> {
7
7
  style?: StyleProp<ViewStyle>;
8
8
  }
9
9
 
10
10
  const SectionHeader: React.FC<React.PropsWithChildren<SectionHeaderProps>> = ({
11
11
  style,
12
12
  children,
13
- }) => <View style={style}>{children}</View>;
13
+ ...rest
14
+ }) => (
15
+ <View style={style} {...rest}>
16
+ {children}
17
+ </View>
18
+ );
14
19
 
15
20
  interface DefaultSectionHeaderProps {
16
21
  title: string;
@@ -56,10 +56,11 @@ const Surface: React.FC<React.PropsWithChildren<Props>> = ({
56
56
  );
57
57
  };
58
58
 
59
- const SHADOW_COLOR = "#000";
60
59
  const SHADOW_OPACITY = 0.24;
61
60
 
62
- function shadow(elevation: number) {
61
+ function shadow(
62
+ elevation: number
63
+ ): { boxShadow: string } | Record<string, never> {
63
64
  if (elevation === 0) {
64
65
  return {};
65
66
  }
@@ -80,14 +81,7 @@ function shadow(elevation: number) {
80
81
  }
81
82
 
82
83
  return {
83
- shadowColor: SHADOW_COLOR,
84
- shadowOffset: {
85
- width: 0,
86
- height,
87
- },
88
- shadowOpacity: SHADOW_OPACITY,
89
- shadowRadius: radius,
90
- elevation,
84
+ boxShadow: `0px ${height}px ${radius}px rgba(0, 0, 0, ${SHADOW_OPACITY})`,
91
85
  };
92
86
  }
93
87
 
@@ -50,6 +50,7 @@ import {
50
50
  */
51
51
 
52
52
  export interface SwipeableItemProps extends IconSlot {
53
+ className?: string;
53
54
  closeOnPress?: boolean;
54
55
  leftOpenValue?: number;
55
56
  rightOpenValue?: number;
@@ -74,6 +75,7 @@ type Props = SwipeableItemProps & RightSwipeProps & LeftSwipeProps;
74
75
 
75
76
  const SwipeableItem: React.FC<React.PropsWithChildren<Props>> = ({
76
77
  theme,
78
+ className,
77
79
  style,
78
80
  children: childrenProp,
79
81
  Icon,
@@ -232,6 +234,8 @@ const SwipeableItem: React.FC<React.PropsWithChildren<Props>> = ({
232
234
  setComponentWidth(event.nativeEvent.layout.width);
233
235
  }}
234
236
  style={[styles.parentContainer, parentContainerStyles]}
237
+ // @ts-ignore
238
+ className={className}
235
239
  >
236
240
  {/*@ts-ignore*/}
237
241
  <SwipeRow
@@ -1,6 +1,6 @@
1
1
  import { ReadTheme, withTheme } from "@draftbit/theme";
2
2
  import React, { forwardRef, useImperativeHandle } from "react";
3
- import { View, StyleProp, ViewStyle } from "react-native";
3
+ import { View, StyleProp, ViewStyle, ViewProps } from "react-native";
4
4
  import SwiperComponent from "react-native-web-swiper";
5
5
 
6
6
  export interface SwiperRef {
@@ -9,7 +9,7 @@ export interface SwiperRef {
9
9
  swipePrev: () => void;
10
10
  }
11
11
 
12
- export interface SwiperProps<T> {
12
+ export interface SwiperProps<T> extends Omit<ViewProps, "style" | "children"> {
13
13
  onSwipe?: (index: number) => void;
14
14
  onSwipedNext?: (index: number) => void;
15
15
  onSwipedPrevious?: (index: number) => void;
@@ -63,6 +63,7 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
63
63
  minDistanceToCapture,
64
64
  style,
65
65
  hideDots = false,
66
+ ...rest
66
67
  }: SwiperProps<any>,
67
68
  ref
68
69
  ) => {
@@ -141,7 +142,7 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
141
142
  }));
142
143
 
143
144
  return (
144
- <View style={style}>
145
+ <View style={style} {...rest}>
145
146
  {/* @ts-ignore */}
146
147
  <SwiperComponent
147
148
  ref={swiperRef}
@@ -1,5 +1,11 @@
1
1
  import React from "react";
2
- import { View, StyleSheet, StyleProp, ViewStyle } from "react-native";
2
+ import {
3
+ View,
4
+ StyleSheet,
5
+ StyleProp,
6
+ ViewStyle,
7
+ ViewProps,
8
+ } from "react-native";
3
9
 
4
10
  const styles = StyleSheet.create({
5
11
  wrapper: {
@@ -7,13 +13,15 @@ const styles = StyleSheet.create({
7
13
  },
8
14
  });
9
15
 
10
- export interface SwiperProps {
16
+ export interface SwiperProps extends Omit<ViewProps, "style" | "children"> {
11
17
  children: React.ReactNode;
12
18
  style?: StyleProp<ViewStyle>;
13
19
  }
14
20
 
15
- const SwiperItem = ({ children, style }: SwiperProps) => (
16
- <View style={[styles.wrapper, style]}>{children}</View>
21
+ const SwiperItem = ({ children, style, ...rest }: SwiperProps) => (
22
+ <View style={[styles.wrapper, style]} {...rest}>
23
+ {children}
24
+ </View>
17
25
  );
18
26
 
19
27
  export default SwiperItem;
@@ -10,6 +10,7 @@ import Pressable from "../Pressable";
10
10
  export interface Props extends TableProps {
11
11
  onPress?: () => void;
12
12
  style?: StyleProp<ViewStyle>;
13
+ className?: string;
13
14
  }
14
15
 
15
16
  const TableCell: React.FC<React.PropsWithChildren<Props>> = ({
@@ -24,6 +25,7 @@ const TableCell: React.FC<React.PropsWithChildren<Props>> = ({
24
25
  cellHorizontalPadding,
25
26
  children,
26
27
  onPress,
28
+ className,
27
29
  style,
28
30
  }) => {
29
31
  const parentContextValue = React.useContext(TableStyleContext);
@@ -42,6 +44,8 @@ const TableCell: React.FC<React.PropsWithChildren<Props>> = ({
42
44
  return (
43
45
  <ContainerComponent
44
46
  onPress={onPress}
47
+ // @ts-ignore
48
+ className={className}
45
49
  style={[
46
50
  styles.cellContainer,
47
51
  borderViewStyle,
@@ -14,6 +14,7 @@ export interface Props extends TableProps {
14
14
  onPress?: () => void;
15
15
  isTableHeader?: boolean;
16
16
  style?: StyleProp<ViewStyle>;
17
+ className?: string;
17
18
  theme: ReadTheme;
18
19
  }
19
20
 
@@ -30,6 +31,7 @@ const TableRow: React.FC<React.PropsWithChildren<Props>> = ({
30
31
  isTableHeader = false,
31
32
  children,
32
33
  onPress,
34
+ className,
33
35
  style,
34
36
  theme,
35
37
  }) => {
@@ -61,6 +63,8 @@ const TableRow: React.FC<React.PropsWithChildren<Props>> = ({
61
63
  <TableStyleContext.Provider value={contextValue}>
62
64
  <ContainerComponent
63
65
  onPress={onPress}
66
+ // @ts-ignore
67
+ className={className}
64
68
  style={[
65
69
  borderViewStyle,
66
70
  isTableHeader
@@ -472,10 +472,10 @@ class TextField extends React.Component<Props, State> {
472
472
  // Position colored placeholder and gray placeholder on top of each other and crossfade them
473
473
  // This gives the effect of animating the color, but allows us to use native driver
474
474
  <View
475
- pointerEvents="none"
476
475
  style={[
477
476
  StyleSheet.absoluteFill,
478
477
  {
478
+ pointerEvents: "none",
479
479
  opacity:
480
480
  // Hide the label in minimized state until we measure its width
481
481
  this.state.value || this.state.focused
@@ -9,6 +9,7 @@ const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
9
9
  playlist,
10
10
  autoplay = false,
11
11
  style,
12
+ className,
12
13
  }) => {
13
14
  const { viewStyles } = extractStyles(style);
14
15
  const defaultVideoId = "nwMUpDESXrI";
@@ -24,7 +25,10 @@ const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
24
25
  };
25
26
 
26
27
  return (
27
- <View style={viewStyles}>
28
+ <View
29
+ style={viewStyles} // @ts-ignore
30
+ className={className}
31
+ >
28
32
  <YouTube
29
33
  style={{ flex: 1 }}
30
34
  videoId={!videoId && !playlist ? defaultVideoId : videoId}
@@ -5,4 +5,5 @@ export interface YoutubePlayerProps {
5
5
  playlist?: string;
6
6
  autoplay?: boolean;
7
7
  style?: StyleProp<ViewStyle>;
8
+ className?: string;
8
9
  }
@@ -14,11 +14,7 @@ try {
14
14
  const avoidSoftInputPackage = require("react-native-avoid-softinput");
15
15
  AvoidSoftInput = avoidSoftInputPackage.AvoidSoftInput;
16
16
  AvoidSoftInputView = avoidSoftInputPackage.AvoidSoftInputView;
17
- } catch (_) {
18
- console.warn(
19
- "AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used."
20
- );
21
- }
17
+ } catch (_) {}
22
18
 
23
19
  /**
24
20
  * Requires additional setup: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides