@draftbit/core 54.0.6 → 54.0.8-6e4257.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.
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +1 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js +5 -3
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/typescript/src/components/KeyboardAvoidingView.d.ts +1 -0
- package/lib/typescript/src/components/KeyboardAvoidingView.js +4 -2
- package/lib/typescript/src/components/KeyboardAvoidingView.js.map +1 -1
- package/lib/typescript/src/components/LoadingIndicator.d.ts +1 -0
- package/lib/typescript/src/components/LoadingIndicator.js +6 -2
- package/lib/typescript/src/components/LoadingIndicator.js.map +1 -1
- package/lib/typescript/src/components/LottieAnimation.d.ts +1 -0
- package/lib/typescript/src/components/LottieAnimation.js +4 -2
- package/lib/typescript/src/components/LottieAnimation.js.map +1 -1
- package/lib/typescript/src/components/Markdown.d.ts +1 -0
- package/lib/typescript/src/components/Markdown.js +13 -13
- package/lib/typescript/src/components/Markdown.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +3 -3
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/lib/typescript/src/components/PinInput/CustomPinInputCell.d.ts +2 -1
- package/lib/typescript/src/components/PinInput/CustomPinInputCell.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.d.ts +1 -0
- package/lib/typescript/src/components/PinInput/PinInput.js +10 -7
- package/lib/typescript/src/components/PinInput/PinInput.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInputText.d.ts +1 -0
- package/lib/typescript/src/components/PinInput/PinInputText.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
- package/lib/typescript/src/components/Swiper/Swiper.js +4 -2
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/src/components/Swiper/SwiperItem.d.ts +3 -2
- package/lib/typescript/src/components/Swiper/SwiperItem.js +3 -1
- package/lib/typescript/src/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/typescript/src/components/Table/TableRow.js +1 -1
- package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
- package/lib/typescript/src/components/Timer.d.ts +1 -0
- package/lib/typescript/src/components/Timer.js +4 -2
- package/lib/typescript/src/components/Timer.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +5 -2
- package/src/components/KeyboardAvoidingView.tsx +4 -0
- package/src/components/LoadingIndicator.tsx +12 -2
- package/src/components/LottieAnimation.tsx +8 -1
- package/src/components/Markdown.tsx +30 -21
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +3 -3
- package/src/components/PinInput/CustomPinInputCell.tsx +2 -1
- package/src/components/PinInput/PinInput.tsx +27 -22
- package/src/components/PinInput/PinInputText.tsx +1 -0
- package/src/components/Progress/LinearProgress/LinearProgress.tsx +1 -1
- package/src/components/Swiper/Swiper.tsx +10 -2
- package/src/components/Swiper/SwiperItem.tsx +10 -3
- package/src/components/Table/TableRow.tsx +1 -1
- package/src/components/Timer.tsx +8 -1
- package/lib/commonjs/Provider.js +0 -1
- package/lib/commonjs/components/AccordionGroup.js +0 -1
- package/lib/commonjs/components/ActionSheet/ActionSheet.js +0 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +0 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +0 -1
- package/lib/commonjs/components/ActionSheet/index.js +0 -1
- package/lib/commonjs/components/AspectRatio.js +0 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +0 -1
- package/lib/commonjs/components/BottomSheet/index.js +0 -1
- package/lib/commonjs/components/Button.js +0 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +0 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +0 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +0 -1
- package/lib/commonjs/components/Checkbox/context.js +0 -1
- package/lib/commonjs/components/Checkbox/index.js +0 -1
- package/lib/commonjs/components/Config.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +0 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js +0 -1
- package/lib/commonjs/components/DatePicker/parseDate.js +0 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +0 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/lib/commonjs/components/DeckSwiper/index.js +0 -1
- package/lib/commonjs/components/Divider.js +0 -1
- package/lib/commonjs/components/Elevation.js +0 -1
- package/lib/commonjs/components/ExpoImage.js +0 -1
- package/lib/commonjs/components/FlatList.js +0 -1
- package/lib/commonjs/components/FormRow.js +0 -1
- package/lib/commonjs/components/IconButton.js +0 -1
- package/lib/commonjs/components/Image.js +0 -1
- package/lib/commonjs/components/KeyboardAvoidingView.js +0 -1
- package/lib/commonjs/components/Layout/AspectRatio.js +0 -1
- package/lib/commonjs/components/Layout/Center.js +0 -1
- package/lib/commonjs/components/Layout/Circle.js +0 -1
- package/lib/commonjs/components/Layout/HStack.js +0 -1
- package/lib/commonjs/components/Layout/LayoutCommon.js +0 -1
- package/lib/commonjs/components/Layout/Spacer.js +0 -1
- package/lib/commonjs/components/Layout/Square.js +0 -1
- package/lib/commonjs/components/Layout/VStack.js +0 -1
- package/lib/commonjs/components/Layout/ZStack.js +0 -1
- package/lib/commonjs/components/Layout/index.js +0 -1
- package/lib/commonjs/components/LoadingIndicator.js +0 -1
- package/lib/commonjs/components/LottieAnimation.js +0 -1
- package/lib/commonjs/components/Markdown.js +0 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +0 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +0 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +0 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +0 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +0 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +0 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +0 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/index.js +0 -1
- package/lib/commonjs/components/NumberInput.js +0 -1
- package/lib/commonjs/components/Picker/NativePicker.ios.js +0 -1
- package/lib/commonjs/components/Picker/NativePicker.js +0 -1
- package/lib/commonjs/components/Picker/PickerCommon.js +0 -1
- package/lib/commonjs/components/Picker/PickerInputContainer.js +0 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +0 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +0 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +0 -1
- package/lib/commonjs/components/Picker/dropdown/PickerItem.js +0 -1
- package/lib/commonjs/components/Picker/index.js +0 -1
- package/lib/commonjs/components/PinInput/CustomPinInputCell.js +0 -1
- package/lib/commonjs/components/PinInput/PinInput.js +0 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +0 -1
- package/lib/commonjs/components/PinInput/index.js +0 -1
- package/lib/commonjs/components/Portal/Portal.js +0 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js +0 -1
- package/lib/commonjs/components/Portal/PortalHost.js +0 -1
- package/lib/commonjs/components/Portal/PortalManager.js +0 -1
- package/lib/commonjs/components/Pressable.js +0 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +0 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +0 -1
- package/lib/commonjs/components/Progress/IndeterminateProgress.js +0 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +0 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +0 -1
- package/lib/commonjs/components/Progress/ProgressCommon.js +0 -1
- package/lib/commonjs/components/ProgressIndicator.js +0 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +0 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +0 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +0 -1
- package/lib/commonjs/components/RadioButton/context.js +0 -1
- package/lib/commonjs/components/RadioButton/index.js +0 -1
- package/lib/commonjs/components/Row.js +0 -1
- package/lib/commonjs/components/SVG.js +0 -1
- package/lib/commonjs/components/SVG.native.js +0 -1
- package/lib/commonjs/components/ScreenContainer.js +0 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +0 -1
- package/lib/commonjs/components/SectionList/SectionList.js +0 -1
- package/lib/commonjs/components/SectionList/index.js +0 -1
- package/lib/commonjs/components/Shadow.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +0 -1
- package/lib/commonjs/components/Slider.js +0 -1
- package/lib/commonjs/components/StarRating.js +0 -1
- package/lib/commonjs/components/StepIndicator.js +0 -1
- package/lib/commonjs/components/Stepper.js +0 -1
- package/lib/commonjs/components/Surface.js +0 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +0 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemButton.js +0 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemCommon.js +0 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +0 -1
- package/lib/commonjs/components/SwipeableItem/index.js +0 -1
- package/lib/commonjs/components/Swiper/Swiper.js +0 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js +0 -1
- package/lib/commonjs/components/Swiper/index.js +0 -1
- package/lib/commonjs/components/Switch.js +0 -1
- package/lib/commonjs/components/TabView/TabView.js +0 -1
- package/lib/commonjs/components/TabView/TabViewItem.js +0 -1
- package/lib/commonjs/components/TabView/index.js +0 -1
- package/lib/commonjs/components/Table/Table.js +0 -1
- package/lib/commonjs/components/Table/TableCell.js +0 -1
- package/lib/commonjs/components/Table/TableCommon.js +0 -1
- package/lib/commonjs/components/Table/TableRow.js +0 -1
- package/lib/commonjs/components/Table/index.js +0 -1
- package/lib/commonjs/components/Text.js +0 -1
- package/lib/commonjs/components/TextField.js +0 -1
- package/lib/commonjs/components/TextInput.js +0 -1
- package/lib/commonjs/components/Timer.js +0 -1
- package/lib/commonjs/components/Touchable.js +0 -1
- package/lib/commonjs/components/Touchable.web.js +0 -1
- package/lib/commonjs/components/Typography.js +0 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +0 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js +0 -5
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +0 -1
- package/lib/commonjs/components/YoutubePlayer/index.js +0 -1
- package/lib/commonjs/components/useAuthState.js +0 -1
- package/lib/commonjs/constants.js +0 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +0 -1
- package/lib/commonjs/deprecated-components/AnimatedCircularProgress.js +0 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +0 -1
- package/lib/commonjs/deprecated-components/AvoidKeyboardView.js +0 -1
- package/lib/commonjs/deprecated-components/Banner.js +0 -1
- package/lib/commonjs/deprecated-components/Card.js +0 -1
- package/lib/commonjs/deprecated-components/CheckboxGroup.js +0 -1
- package/lib/commonjs/deprecated-components/CircleImage.js +0 -1
- package/lib/commonjs/deprecated-components/CircularProgress.js +0 -1
- package/lib/commonjs/deprecated-components/Container.js +0 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +0 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +0 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +0 -1
- package/lib/commonjs/deprecated-components/FAB.js +0 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +0 -1
- package/lib/commonjs/deprecated-components/Layout.js +0 -1
- package/lib/commonjs/deprecated-components/ProgressBar.js +0 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +0 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +0 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +0 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +0 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +0 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +0 -1
- package/lib/commonjs/hooks.js +0 -1
- package/lib/commonjs/index.js +0 -1
- package/lib/commonjs/interfaces/Icon.js +0 -1
- package/lib/commonjs/utilities.js +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "54.0.
|
|
3
|
+
"version": "54.0.8-6e4257.2+6e4257f",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "./src/index.tsx",
|
|
6
|
+
"react-native": "./src/index.tsx",
|
|
6
7
|
"types": "lib/typescript/src/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"src",
|
|
@@ -14,8 +15,7 @@
|
|
|
14
15
|
"scripts": {
|
|
15
16
|
"clean": "rimraf lib",
|
|
16
17
|
"clean:modules": "rimraf node_modules",
|
|
17
|
-
"build
|
|
18
|
-
"build": "yarn clean && yarn build:commonjs && yarn tsc",
|
|
18
|
+
"build": "yarn clean && yarn tsc",
|
|
19
19
|
"test": "jest",
|
|
20
20
|
"test:coverage": "jest --coverage"
|
|
21
21
|
},
|
|
@@ -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.
|
|
45
|
+
"@draftbit/theme": "^54.0.8-6e4257.2+6e4257f",
|
|
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": "
|
|
126
|
+
"gitHead": "6e4257f84664265097353e1889a939a833ceb560"
|
|
127
127
|
}
|
|
@@ -12,21 +12,24 @@ import { withTheme } from "@draftbit/theme";
|
|
|
12
12
|
export interface DeckSwiperCardProps
|
|
13
13
|
extends Omit<ViewProps, "style" | "children"> {
|
|
14
14
|
style?: StyleProp<ViewStyle>;
|
|
15
|
+
className?: string;
|
|
15
16
|
theme: ReadTheme;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const DeckSwiperCard: React.FC<
|
|
19
20
|
React.PropsWithChildren<DeckSwiperCardProps>
|
|
20
|
-
> = ({ style, children, theme, ...rest }) => (
|
|
21
|
+
> = ({ style, className, children, theme, ...rest }) => (
|
|
21
22
|
<View
|
|
22
23
|
style={[
|
|
23
24
|
styles.card,
|
|
24
|
-
{
|
|
25
|
+
!className && {
|
|
25
26
|
backgroundColor: theme.colors.background.base,
|
|
26
27
|
borderColor: theme.colors.border.base,
|
|
27
28
|
},
|
|
28
29
|
style,
|
|
29
30
|
]}
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
className={className}
|
|
30
33
|
{...rest}
|
|
31
34
|
>
|
|
32
35
|
{children}
|
|
@@ -18,6 +18,7 @@ interface KeyboardAvoidingViewProps extends ViewProps {
|
|
|
18
18
|
androidKeyboardVerticalOffset?: number;
|
|
19
19
|
iosBehavior?: KeyboardAvoidingViewBehavior;
|
|
20
20
|
iosKeyboardVerticalOffset?: number;
|
|
21
|
+
className?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const KeyboardAvoidingView: React.FC<KeyboardAvoidingViewProps> = ({
|
|
@@ -27,6 +28,7 @@ const KeyboardAvoidingView: React.FC<KeyboardAvoidingViewProps> = ({
|
|
|
27
28
|
androidKeyboardVerticalOffset,
|
|
28
29
|
iosBehavior,
|
|
29
30
|
iosKeyboardVerticalOffset,
|
|
31
|
+
className,
|
|
30
32
|
...rest
|
|
31
33
|
}) => {
|
|
32
34
|
let behaviorResult: KeyboardAvoidingViewBehavior;
|
|
@@ -53,6 +55,8 @@ const KeyboardAvoidingView: React.FC<KeyboardAvoidingViewProps> = ({
|
|
|
53
55
|
<KeyboardAvoidingViewComponent
|
|
54
56
|
behavior={behaviorResult ?? undefined}
|
|
55
57
|
keyboardVerticalOffset={keyboardVerticalOffsetResult}
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
className={className}
|
|
56
60
|
{...rest}
|
|
57
61
|
/>
|
|
58
62
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { View, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import { withTheme } from "@draftbit/theme";
|
|
4
4
|
import type { ReadTheme } from "@draftbit/theme";
|
|
5
5
|
import {
|
|
@@ -34,6 +34,7 @@ export enum LoadingIndicatorType {
|
|
|
34
34
|
|
|
35
35
|
type Props = {
|
|
36
36
|
style?: StyleProp<ViewStyle>;
|
|
37
|
+
className?: string;
|
|
37
38
|
color?: string;
|
|
38
39
|
theme: ReadTheme;
|
|
39
40
|
type?: LoadingIndicatorType;
|
|
@@ -61,10 +62,19 @@ const LoadingIndicator: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
61
62
|
type = LoadingIndicatorType.plane,
|
|
62
63
|
size,
|
|
63
64
|
style,
|
|
65
|
+
className,
|
|
64
66
|
...rest
|
|
65
67
|
}) => {
|
|
66
68
|
const SpinnerComponent = SPINNER_COMPONENTS[type];
|
|
67
|
-
return
|
|
69
|
+
return (
|
|
70
|
+
<View
|
|
71
|
+
style={style}
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
className={className}
|
|
74
|
+
>
|
|
75
|
+
<SpinnerComponent size={size} color={color} {...rest} />
|
|
76
|
+
</View>
|
|
77
|
+
);
|
|
68
78
|
};
|
|
69
79
|
|
|
70
80
|
export default withTheme(LoadingIndicator);
|
|
@@ -4,6 +4,7 @@ import LottieView, { AnimationObject } from "lottie-react-native";
|
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
style?: StyleProp<ViewStyle>;
|
|
7
|
+
className?: string;
|
|
7
8
|
resizeMode?: "cover" | "contain" | "center";
|
|
8
9
|
source: string | AnimationObject | { uri: string };
|
|
9
10
|
autoPlay?: boolean;
|
|
@@ -15,6 +16,7 @@ const LottieAnimation = forwardRef<LottieView, Props>(
|
|
|
15
16
|
(
|
|
16
17
|
{
|
|
17
18
|
style,
|
|
19
|
+
className,
|
|
18
20
|
source,
|
|
19
21
|
autoPlay = true,
|
|
20
22
|
loop = true,
|
|
@@ -25,7 +27,12 @@ const LottieAnimation = forwardRef<LottieView, Props>(
|
|
|
25
27
|
ref
|
|
26
28
|
) => {
|
|
27
29
|
return (
|
|
28
|
-
<View
|
|
30
|
+
<View
|
|
31
|
+
style={style}
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
className={className}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
29
36
|
<LottieView
|
|
30
37
|
ref={ref}
|
|
31
38
|
source={source}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import {
|
|
3
3
|
Text,
|
|
4
|
+
View,
|
|
4
5
|
StyleProp,
|
|
5
6
|
ViewStyle,
|
|
6
7
|
TextStyle,
|
|
@@ -11,6 +12,7 @@ import { extractStyles } from "../utilities";
|
|
|
11
12
|
|
|
12
13
|
type MarkdownProps = {
|
|
13
14
|
style?: StyleProp<ViewStyle & TextStyle>;
|
|
15
|
+
className?: string;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
const childToString = (child?: React.ReactNode): string => {
|
|
@@ -32,35 +34,42 @@ const childToString = (child?: React.ReactNode): string => {
|
|
|
32
34
|
const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>> = ({
|
|
33
35
|
children: childrenProp,
|
|
34
36
|
style,
|
|
37
|
+
className,
|
|
35
38
|
}) => {
|
|
36
39
|
const children = React.Children.toArray(childrenProp);
|
|
37
40
|
const text = children.map(childToString).join("");
|
|
38
41
|
|
|
39
42
|
const bodyStyle = StyleSheet.flatten(style);
|
|
40
|
-
const { textStyles } = extractStyles(bodyStyle);
|
|
43
|
+
const { viewStyles, textStyles } = extractStyles(bodyStyle);
|
|
41
44
|
|
|
42
45
|
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
rules={{
|
|
48
|
-
// By default, strong does not work with custom fonts on iOS. This addresses the issue
|
|
49
|
-
strong: (node) => (
|
|
50
|
-
<Text
|
|
51
|
-
key={node.key}
|
|
52
|
-
style={{
|
|
53
|
-
...textStyles,
|
|
54
|
-
fontWeight: "bold",
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
{node.children[0].content}
|
|
58
|
-
</Text>
|
|
59
|
-
),
|
|
60
|
-
}}
|
|
46
|
+
<View
|
|
47
|
+
style={viewStyles}
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
className={className}
|
|
61
50
|
>
|
|
62
|
-
{
|
|
63
|
-
|
|
51
|
+
{/*//'body' style applies to all markdown components*/}
|
|
52
|
+
{/*@ts-ignore TS does not like the type of this named style for some reason*/}
|
|
53
|
+
<MarkdownComponent
|
|
54
|
+
style={{ body: bodyStyle }}
|
|
55
|
+
rules={{
|
|
56
|
+
// By default, strong does not work with custom fonts on iOS. This addresses the issue
|
|
57
|
+
strong: (node) => (
|
|
58
|
+
<Text
|
|
59
|
+
key={node.key}
|
|
60
|
+
style={{
|
|
61
|
+
...textStyles,
|
|
62
|
+
fontWeight: "bold",
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
{node.children[0].content}
|
|
66
|
+
</Text>
|
|
67
|
+
),
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{text}
|
|
71
|
+
</MarkdownComponent>
|
|
72
|
+
</View>
|
|
64
73
|
);
|
|
65
74
|
};
|
|
66
75
|
|
|
@@ -52,7 +52,7 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
52
52
|
: newHeadlessAudioPlayerRef;
|
|
53
53
|
|
|
54
54
|
const {
|
|
55
|
-
color
|
|
55
|
+
color,
|
|
56
56
|
fontFamily,
|
|
57
57
|
fontWeight,
|
|
58
58
|
fontSize,
|
|
@@ -67,7 +67,7 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
67
67
|
} = StyleSheet.flatten(style || {});
|
|
68
68
|
|
|
69
69
|
const textStyles = {
|
|
70
|
-
color,
|
|
70
|
+
color: color ?? (className ? undefined : theme.colors.text.strong),
|
|
71
71
|
fontFamily,
|
|
72
72
|
fontWeight,
|
|
73
73
|
fontSize,
|
|
@@ -131,7 +131,7 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
131
131
|
// @ts-ignore
|
|
132
132
|
className={className}
|
|
133
133
|
style={[
|
|
134
|
-
{
|
|
134
|
+
!className && {
|
|
135
135
|
backgroundColor: theme.colors.background.base,
|
|
136
136
|
borderColor: theme.colors.border.base,
|
|
137
137
|
},
|
|
@@ -3,7 +3,8 @@ import { StyleProp, ViewStyle, View, LayoutChangeEvent } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
interface CustomPinInputCellProps {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -35,6 +35,7 @@ interface PinInputProps extends Omit<TextInputProps, "style"> {
|
|
|
35
35
|
focusedBorderWidth?: number;
|
|
36
36
|
focusedTextColor?: string;
|
|
37
37
|
style?: StyleProp<ViewStyle | TextStyle>;
|
|
38
|
+
className?: string;
|
|
38
39
|
theme: ReadTheme;
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -55,6 +56,7 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
|
|
|
55
56
|
focusedTextColor,
|
|
56
57
|
secureTextEntry,
|
|
57
58
|
style,
|
|
59
|
+
className,
|
|
58
60
|
...rest
|
|
59
61
|
},
|
|
60
62
|
ref
|
|
@@ -132,28 +134,31 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
|
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
return (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
<View className={className}>
|
|
139
|
+
<CodeField
|
|
140
|
+
ref={pinInputRef}
|
|
141
|
+
{...(clearOnCellFocus ? codeFieldProps : {})}
|
|
142
|
+
value={value}
|
|
143
|
+
onChangeText={onChangeText}
|
|
144
|
+
rootStyle={styles.rootContainer}
|
|
145
|
+
textInputStyle={[
|
|
146
|
+
// addresses issue on firefox where the hidden input did not fill the height
|
|
147
|
+
{ height: "100%" },
|
|
148
|
+
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
149
|
+
Platform.OS === "web" ? { outlineWidth: 0 } : {},
|
|
150
|
+
]}
|
|
151
|
+
InputComponent={TextInput}
|
|
152
|
+
cellCount={cellCount}
|
|
153
|
+
renderCell={({ symbol: cellValue, index, isFocused }) => (
|
|
154
|
+
<React.Fragment key={index}>
|
|
155
|
+
{renderCell(cellValue, index, isFocused)}
|
|
156
|
+
</React.Fragment>
|
|
157
|
+
)}
|
|
158
|
+
secureTextEntry={secureTextEntry}
|
|
159
|
+
{...rest}
|
|
160
|
+
/>
|
|
161
|
+
</View>
|
|
157
162
|
);
|
|
158
163
|
}
|
|
159
164
|
);
|
|
@@ -9,7 +9,9 @@ export interface SwiperRef {
|
|
|
9
9
|
swipePrev: () => void;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export interface SwiperProps<T>
|
|
12
|
+
export interface SwiperProps<T>
|
|
13
|
+
extends Omit<ViewProps, "style" | "children" | "className"> {
|
|
14
|
+
className?: string;
|
|
13
15
|
onSwipe?: (index: number) => void;
|
|
14
16
|
onSwipedNext?: (index: number) => void;
|
|
15
17
|
onSwipedPrevious?: (index: number) => void;
|
|
@@ -62,6 +64,7 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
|
|
|
62
64
|
minDistanceForAction,
|
|
63
65
|
minDistanceToCapture,
|
|
64
66
|
style,
|
|
67
|
+
className,
|
|
65
68
|
hideDots = false,
|
|
66
69
|
...rest
|
|
67
70
|
}: SwiperProps<any>,
|
|
@@ -142,7 +145,12 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
|
|
|
142
145
|
}));
|
|
143
146
|
|
|
144
147
|
return (
|
|
145
|
-
<View
|
|
148
|
+
<View
|
|
149
|
+
style={style}
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
className={className}
|
|
152
|
+
{...rest}
|
|
153
|
+
>
|
|
146
154
|
{/* @ts-ignore */}
|
|
147
155
|
<SwiperComponent
|
|
148
156
|
ref={swiperRef}
|
|
@@ -13,13 +13,20 @@ const styles = StyleSheet.create({
|
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export interface SwiperProps
|
|
16
|
+
export interface SwiperProps
|
|
17
|
+
extends Omit<ViewProps, "style" | "children" | "className"> {
|
|
17
18
|
children: React.ReactNode;
|
|
18
19
|
style?: StyleProp<ViewStyle>;
|
|
20
|
+
className?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
const SwiperItem = ({ children, style, ...rest }: SwiperProps) => (
|
|
22
|
-
<View
|
|
23
|
+
const SwiperItem = ({ children, style, className, ...rest }: SwiperProps) => (
|
|
24
|
+
<View
|
|
25
|
+
style={[styles.wrapper, style]}
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
className={className}
|
|
28
|
+
{...rest}
|
|
29
|
+
>
|
|
23
30
|
{children}
|
|
24
31
|
</View>
|
|
25
32
|
);
|
package/src/components/Timer.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
interface TimerProps extends TextProps {
|
|
17
17
|
style?: StyleProp<TextStyle>;
|
|
18
|
+
className?: string;
|
|
18
19
|
initialTime?: number;
|
|
19
20
|
updateInterval?: number;
|
|
20
21
|
format?: "ss" | "mm:ss" | "hh:mm:ss" | "ss:ms" | "mm:ss:ms" | "hh:mm:ss:ms";
|
|
@@ -34,6 +35,7 @@ const Timer = forwardRef<TimerHandle, TimerProps>(
|
|
|
34
35
|
(
|
|
35
36
|
{
|
|
36
37
|
style,
|
|
38
|
+
className,
|
|
37
39
|
initialTime,
|
|
38
40
|
updateInterval = 1000,
|
|
39
41
|
format = "mm:ss",
|
|
@@ -136,7 +138,12 @@ const Timer = forwardRef<TimerHandle, TimerProps>(
|
|
|
136
138
|
};
|
|
137
139
|
|
|
138
140
|
return (
|
|
139
|
-
<Text
|
|
141
|
+
<Text
|
|
142
|
+
{...rest}
|
|
143
|
+
style={[!className && styles.defaultTimerStyle, style]}
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
className={className}
|
|
146
|
+
>
|
|
140
147
|
{formatTime(time)}
|
|
141
148
|
</Text>
|
|
142
149
|
);
|
package/lib/commonjs/Provider.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _PortalHost=_interopRequireDefault(require("./components/Portal/PortalHost"));var _theme=require("@draftbit/theme");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/Provider.tsx";function _callSuper(t,o,e){return o=(0,_getPrototypeOf2.default)(o),(0,_possibleConstructorReturn2.default)(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2.default)(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var Provider=exports.default=function(_React$Component){function Provider(){(0,_classCallCheck2.default)(this,Provider);return _callSuper(this,Provider,arguments);}(0,_inherits2.default)(Provider,_React$Component);return(0,_createClass2.default)(Provider,[{key:"render",value:function render(){return(0,_jsxRuntime.jsx)(_theme.ThemeProvider,{themes:this.props.themes,breakpoints:this.props.breakpoints,initialThemeName:this.props.initialThemeName,children:(0,_jsxRuntime.jsx)(_PortalHost.default,{children:this.props.children})});}}]);}(_react.default.Component);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Text=_interopRequireDefault(require("./Text"));var _theme=require("@draftbit/theme");var _utilities=require("../utilities");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/AccordionGroup.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var AccordionGroup=function AccordionGroup(_ref){var label=_ref.label,_ref$expanded=_ref.expanded,expandedProp=_ref$expanded===void 0?false:_ref$expanded,openColor=_ref.openColor,closedColor=_ref.closedColor,caretColorProp=_ref.caretColor,_ref$caretSize=_ref.caretSize,caretSize=_ref$caretSize===void 0?24:_ref$caretSize,icon=_ref.icon,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?24:_ref$iconSize,style=_ref.style,children=_ref.children,theme=_ref.theme,Icon=_ref.Icon;var _React$useState=React.useState(expandedProp),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),expanded=_React$useState2[0],setExpanded=_React$useState2[1];var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var expandedColor=openColor||theme.colors.branding.primary;var collapsedColor=closedColor||theme.colors.branding.primary;var labelColor=expanded?expandedColor:collapsedColor;var caretColor=caretColorProp||labelColor;React.useEffect(function(){if(expandedProp!==expanded){setExpanded(expandedProp);}},[expandedProp]);var handlePressAction=function handlePressAction(){setExpanded(!expanded);};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{style:[styles.row,viewStyles],onPress:handlePressAction,accessibilityRole:"button",children:[icon?(0,_jsxRuntime.jsx)(Icon,{name:icon,size:iconSize,color:labelColor,style:styles.icon}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.content,children:(0,_jsxRuntime.jsx)(_Text.default,{selectable:false,style:[textStyles,{color:labelColor}],children:label})}),(0,_jsxRuntime.jsx)(Icon,{name:expanded?"MaterialIcons/keyboard-arrow-up":"MaterialIcons/keyboard-arrow-down",color:caretColor,size:caretSize})]}),expanded?children:null]});};var styles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},content:{flex:1,justifyContent:"center"},icon:{marginRight:8}});var _default=exports.default=(0,_theme.withTheme)(AccordionGroup);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Portal=_interopRequireDefault(require("../Portal/Portal"));var _Touchable=_interopRequireDefault(require("../Touchable"));var _ActionSheetCancel=_interopRequireDefault(require("./ActionSheetCancel"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheet.tsx";var ActionSheet=function ActionSheet(_ref){var _ref$visible=_ref.visible,visible=_ref$visible===void 0?false:_ref$visible,onClose=_ref.onClose,children=_ref.children;return visible?(0,_jsxRuntime.jsx)(_Portal.default,{children:(0,_jsxRuntime.jsxs)(_Touchable.default,{style:styles.wrapper,onPress:onClose,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.overlay}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.groupWrapper,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.group,children:_react.default.Children.toArray(children).filter(function(child){return(child==null?void 0:child.type)!==_ActionSheetCancel.default;})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.group,children:_react.default.Children.toArray(children).filter(function(child){return child.type===_ActionSheetCancel.default;})})]})]})}):(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{});};var styles=_reactNative.StyleSheet.create({wrapper:{flex:1,display:"flex",flexDirection:"column"},overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#000000",opacity:0.3},groupWrapper:{flex:1,flexDirection:"column",justifyContent:"flex-end",display:"flex",marginBottom:25},group:{display:"flex",flexDirection:"column",borderRadius:10,marginHorizontal:7,marginVertical:2.5,overflow:"hidden"}});var _default=exports.default=ActionSheet;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _ActionSheetItem=_interopRequireDefault(require("./ActionSheetItem"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheetCancel.tsx";var ActionSheetCancel=function ActionSheetCancel(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Cancel":_ref$label,color=_ref.color,style=_ref.style,onPress=_ref.onPress;return(0,_jsxRuntime.jsx)(_ActionSheetItem.default,{label:label,color:color||"#FF453A",style:style,onPress:onPress});};var _default=exports.default=ActionSheetCancel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheetItem.tsx";var ActionSheetItem=function ActionSheetItem(_ref){var label=_ref.label,style=_ref.style,color=_ref.color,onPress=_ref.onPress,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.7:_ref$activeOpacity;var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{activeOpacity:activeOpacity,style:[styles.wrapper,viewStyles],onPress:onPress,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.label,textStyles,{color:color}],children:label})});};var styles=_reactNative.StyleSheet.create({wrapper:{borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:"#CCCCCC",backgroundColor:"#F1F1F1",minHeight:50,overflow:"hidden",display:"flex",justifyContent:"center"},label:{fontSize:16,textAlign:"center",color:"#0A84FF",fontWeight:"500",overflow:"hidden",paddingHorizontal:20,paddingVertical:10,alignSelf:"center"}});var _default=exports.default=ActionSheetItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"ActionSheet",{enumerable:true,get:function get(){return _ActionSheet.default;}});Object.defineProperty(exports,"ActionSheetCancel",{enumerable:true,get:function get(){return _ActionSheetCancel.default;}});Object.defineProperty(exports,"ActionSheetItem",{enumerable:true,get:function get(){return _ActionSheetItem.default;}});var _ActionSheet=_interopRequireDefault(require("./ActionSheet"));var _ActionSheetItem=_interopRequireDefault(require("./ActionSheetItem"));var _ActionSheetCancel=_interopRequireDefault(require("./ActionSheetCancel"));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["aspectRatio"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/AspectRatio.tsx";var AspectRatio=function AspectRatio(props){var _React$useState=_react.default.useState(null),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),layout=_React$useState2[0],setLayout=_React$useState2[1];var _ref=_reactNative.StyleSheet.flatten(props.style)||{},_ref$aspectRatio=_ref.aspectRatio,aspectRatio=_ref$aspectRatio===void 0?1:_ref$aspectRatio,inputStyle=(0,_objectWithoutProperties2.default)(_ref,_excluded);var style=[inputStyle,{aspectRatio:aspectRatio}];if(layout){var _layout$width=layout.width,width=_layout$width===void 0?0:_layout$width,_layout$height=layout.height,height=_layout$height===void 0?0:_layout$height;if(width===0){style.push({width:height*(1/+aspectRatio),height:height});}else{style.push({width:width,height:width*(1/+aspectRatio)});}}return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},props,{style:style,onLayout:function onLayout(_ref2){var l=_ref2.nativeEvent.layout;return setLayout(l);},children:props.children}));};var _default=exports.default=AspectRatio;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _bottomSheet=_interopRequireWildcard(require("@gorhom/bottom-sheet"));var _theme=require("@draftbit/theme");var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","enableDynamicSizing","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var windowHeight=_reactNative.Dimensions.get("window").height;var BottomSheet=_react.default.forwardRef(function(_ref,ref){var snapPointsProp=_ref.snapPoints,_ref$topSnapPosition=_ref.topSnapPosition,topSnapPosition=_ref$topSnapPosition===void 0?"10%":_ref$topSnapPosition,_ref$middleSnapPositi=_ref.middleSnapPosition,middleSnapPosition=_ref$middleSnapPositi===void 0?"50%":_ref$middleSnapPositi,_ref$bottomSnapPositi=_ref.bottomSnapPosition,bottomSnapPosition=_ref$bottomSnapPositi===void 0?"80%":_ref$bottomSnapPositi,initialSnapIndex=_ref.initialSnapIndex,_ref$initialSnapPosit=_ref.initialSnapPosition,initialSnapPosition=_ref$initialSnapPosit===void 0?"bottom":_ref$initialSnapPosit,_ref$showHandle=_ref.showHandle,showHandle=_ref$showHandle===void 0?true:_ref$showHandle,handleColor=_ref.handleColor,_ref$topBorderRadius=_ref.topBorderRadius,topBorderRadius=_ref$topBorderRadius===void 0?20:_ref$topBorderRadius,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,borderColor=_ref.borderColor,_ref$enableDynamicSiz=_ref.enableDynamicSizing,enableDynamicSizing=_ref$enableDynamicSiz===void 0?true:_ref$enableDynamicSiz,onSettle=_ref.onSettle,style=_ref.style,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var theme=(0,_theme.useTheme)();var backgroundColor=(style==null?void 0:style.backgroundColor)||theme.colors.background.base;var snapPoints=snapPointsProp!=null?snapPointsProp:[topSnapPosition,middleSnapPosition,bottomSnapPosition];var mappedSnapPoints=(0,_utilities.useDeepCompareMemo)(function(){return convertSnapPointsForNewImplementation(snapPoints);},snapPoints);var getSnapIndexFromPosition=function getSnapIndexFromPosition(position){switch(position){case"bottom":return 0;case"middle":return 1;case"top":return 2;}};return(0,_jsxRuntime.jsx)(_bottomSheet.default,{ref:ref,enableDynamicSizing:enableDynamicSizing,snapPoints:mappedSnapPoints,index:initialSnapIndex!==undefined?mappedSnapPoints.length-initialSnapIndex-1:getSnapIndexFromPosition(initialSnapPosition),handleIndicatorStyle:[{backgroundColor:handleColor!=null?handleColor:theme.colors.border.base},!showHandle?{display:"none"}:{}],backgroundStyle:{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius,borderWidth:borderWidth,borderColor:borderColor!=null?borderColor:theme.colors.border.base},onChange:function onChange(index){return(enableDynamicSizing?onSettle==null?void 0:onSettle(mappedSnapPoints.length-index):onSettle==null?void 0:onSettle(mappedSnapPoints.length-index-1));},children:(0,_jsxRuntime.jsx)(_bottomSheet.BottomSheetScrollView,Object.assign({contentContainerStyle:[styles.contentContainerStyle,style]},rest,{children:children}))});});function convertSnapPointsForNewImplementation(snapPoints){var reversedSnapPoints=(0,_toConsumableArray2.default)(snapPoints).reverse();return reversedSnapPoints.map(function(point){if(typeof point==="string"){var percentNumber=(0,_utilities.extractPercentNumber)(point);if(percentNumber!==undefined){return`${100-percentNumber}%`;}return point;}else if(typeof point==="number"){return windowHeight-point;}else{return point;}});}var styles=_reactNative.StyleSheet.create({contentContainerStyle:{paddingHorizontal:16,paddingVertical:10}});var _default=exports.default=BottomSheet;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BottomSheet",{enumerable:true,get:function get(){return _BottomSheet.default;}});var _BottomSheet=_interopRequireDefault(require("./BottomSheet"));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ButtonSolid=exports.ButtonOutline=exports.Button=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theme=require("@draftbit/theme");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Button.tsx",_this=this;var _excluded=["Icon","icon","iconPosition","iconSize","title","loading","disabled","style","activeOpacity","disabledOpacity"],_excluded2=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"],_excluded3=["style","theme"],_excluded4=["style","theme"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var CONSTANTS={baseHeight:42,borderRadius:4,padding:8,icon:24};function Base(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?"left":_ref$iconPosition,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?CONSTANTS.icon:_ref$iconSize,title=_ref.title,loading=_ref.loading,disabled=_ref.disabled,style=_ref.style,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.8:_ref$activeOpacity,_ref$disabledOpacity=_ref.disabledOpacity,disabledOpacity=_ref$disabledOpacity===void 0?0.8:_ref$disabledOpacity,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _StyleSheet$flatten=_reactNative.StyleSheet.flatten(style||{}),color=_StyleSheet$flatten.color,fontFamily=_StyleSheet$flatten.fontFamily,fontWeight=_StyleSheet$flatten.fontWeight,fontSize=_StyleSheet$flatten.fontSize,lineHeight=_StyleSheet$flatten.lineHeight,letterSpacing=_StyleSheet$flatten.letterSpacing,textTransform=_StyleSheet$flatten.textTransform,textAlign=_StyleSheet$flatten.textAlign,textDecorationLine=_StyleSheet$flatten.textDecorationLine,textDecorationColor=_StyleSheet$flatten.textDecorationColor,textDecorationStyle=_StyleSheet$flatten.textDecorationStyle,buttonStyles=(0,_objectWithoutProperties2.default)(_StyleSheet$flatten,_excluded2);var titleStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};if(textAlign==="left"){buttonStyles.justifyContent="flex-start";}if(textAlign==="right"){buttonStyles.justifyContent="flex-end";}return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,Object.assign({disabled:disabled||loading,style:function style(_ref2){var pressed=_ref2.pressed;return[styles.base,{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},buttonStyles];}},props,{children:[loading?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:color,style:styles.loading}):null,iconPosition==="left"&&icon&&!loading?(0,_jsxRuntime.jsx)(Icon,{name:icon,color:color,style:styles.icon,size:iconSize}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:titleStyles,children:title}),iconPosition==="right"&&icon&&!loading?(0,_jsxRuntime.jsx)(Icon,{name:icon,color:color,style:styles.icon,size:iconSize}):null]}));}var Solid=function Solid(_ref3){var style=_ref3.style,theme=_ref3.theme,props=(0,_objectWithoutProperties2.default)(_ref3,_excluded3);return(0,_jsxRuntime.jsx)(Base,Object.assign({style:[{color:"#FFF",borderRadius:8,backgroundColor:theme.colors.branding.primary},style]},props));};var ButtonSolid=exports.ButtonSolid=(0,_theme.withTheme)(Solid);var Button=exports.Button=(0,_theme.withTheme)(Solid);var Outline=function Outline(_ref4){var style=_ref4.style,theme=_ref4.theme,props=(0,_objectWithoutProperties2.default)(_ref4,_excluded4);return(0,_jsxRuntime.jsx)(Base,Object.assign({style:[styles.outline,{borderRadius:8,borderColor:theme.colors.branding.primary,color:theme.colors.branding.primary},style]},props));};var ButtonOutline=exports.ButtonOutline=(0,_theme.withTheme)(Outline);var styles=_reactNative.StyleSheet.create({base:Object.assign({position:"relative",flexDirection:"row",alignItems:"center",justifyContent:"center",minHeight:CONSTANTS.baseHeight,paddingHorizontal:12,fontFamily:"System",fontWeight:"700"},_reactNative.Platform.select({web:{cursor:"pointer",userSelect:"none"}})),outline:{backgroundColor:"transparent",borderWidth:1},loading:{marginRight:6},icon:Object.assign({},_reactNative.Platform.select({web:{marginTop:1,marginRight:4,alignSelf:"center"},default:{marginBottom:2,marginRight:4,alignSelf:"center"}}))});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theme=require("@draftbit/theme");var _hooks=require("../../hooks");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/Checkbox.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Checkbox=function Checkbox(_ref){var Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,_ref$checkedIcon=_ref.checkedIcon,checkedIcon=_ref$checkedIcon===void 0?"MaterialCommunityIcons/checkbox-marked":_ref$checkedIcon,_ref$uncheckedIcon=_ref.uncheckedIcon,uncheckedIcon=_ref$uncheckedIcon===void 0?"MaterialCommunityIcons/checkbox-blank-outline":_ref$uncheckedIcon,_ref$size=_ref.size,size=_ref$size===void 0?24:_ref$size,style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=(0,_hooks.usePrevious)(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var _useTheme=(0,_theme.useTheme)(),colors=_useTheme.colors;var checkboxColor=internalValue?color||colors.branding.primary:uncheckedColor||colors.branding.primary;var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null||onPress(newValue);if(newValue){onCheck==null||onCheck();}if(!newValue){onUncheck==null||onUncheck();}};return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,Object.assign({},rest,{onPress:handlePress,disabled:disabled,accessibilityState:{disabled:disabled},accessibilityRole:"button",accessibilityLiveRegion:"polite",style:[styles.container,style,{width:size,height:size}],children:[(0,_jsxRuntime.jsx)(Icon,{style:styles.icon,name:internalValue?checkedIcon:uncheckedIcon,size:size,color:checkboxColor}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[_reactNative.StyleSheet.absoluteFill,styles.fillContainer],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.fill,{opacity:disabled?0.5:1},{borderColor:checkboxColor}]})})]}));};var styles=_reactNative.StyleSheet.create({container:{borderRadius:18},fillContainer:{alignItems:"center",justifyContent:"center"},icon:{alignSelf:"center"},fill:{borderRadius:5,width:30,height:30,alignSelf:"center"}});var _default=exports.default=Checkbox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.Direction=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Checkbox=_interopRequireDefault(require("./Checkbox"));var _Text=_interopRequireDefault(require("../Text"));var _context=require("./context");var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["Icon","label","status","value","onPress","labelContainerStyle","labelStyle","checkboxStyle","direction","disabled","style","color","uncheckedColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxGroupRow.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Direction=exports.Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var getCheckboxAlignment=function getCheckboxAlignment(parentDirection,direction){if(parentDirection===_context.Direction.Horizontal){return direction===Direction.Row?"flex-start":"flex-end";}else if(direction===Direction.RowReverse){return"flex-start";}else{return"flex-end";}};var renderLabel=function renderLabel(value,labelStyle,textStyle){if(typeof value==="string"){return(0,_jsxRuntime.jsx)(_Text.default,{style:[labelStyle,textStyle],children:value});}else{return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:value});}};var CheckboxGroupRow=function CheckboxGroupRow(_ref){var Icon=_ref.Icon,_ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,status=_ref.status,value=_ref.value,onPress=_ref.onPress,labelContainerStyle=_ref.labelContainerStyle,labelStyle=_ref.labelStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,disabled=_ref.disabled,style=_ref.style,color=_ref.color,uncheckedColor=_ref.uncheckedColor,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useCheckboxGroupCont=(0,_context.useCheckboxGroupContext)(),selectedValues=_useCheckboxGroupCont.values,onValueChange=_useCheckboxGroupCont.onValueChange,parentDirection=_useCheckboxGroupCont.direction;var values=Array.isArray(selectedValues)?selectedValues:[];var isChecked=status||values.includes(value);var handlePress=function handlePress(){if(!disabled){onPress==null||onPress(!isChecked);onValueChange==null||onValueChange(value,!isChecked);}};var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,Object.assign({onPress:handlePress,style:[styles.mainParent,{flexDirection:direction},viewStyles],disabled:disabled},rest,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,labelStyle,textStyles)}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,alignItems:getCheckboxAlignment(parentDirection,direction)},children:(0,_jsxRuntime.jsx)(_Checkbox.default,{Icon:Icon,status:isChecked,onPress:handlePress,style:checkboxStyle,disabled:disabled,color:color,uncheckedColor:uncheckedColor})})]}));};var styles=_reactNative.StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingStart:20,minHeight:50,paddingEnd:20,display:"flex"},_reactNative.Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});var _default=exports.default=CheckboxGroupRow;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.Direction=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _lodash=require("lodash");var _utilities=require("../../utilities");var _hooks=require("../../hooks");var _Text=_interopRequireDefault(require("../Text"));var _Checkbox=_interopRequireDefault(require("./Checkbox"));var _theme=require("@draftbit/theme");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["label","labelStyle","labelContainerStyle","checkboxStyle","direction","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxRow.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Direction=exports.Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var renderLabel=function renderLabel(value,labelStyle,textStyle){if((0,_lodash.isString)(value)){return(0,_jsxRuntime.jsx)(_Text.default,{style:[textStyle,labelStyle],children:value});}else{return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:value});}};var CheckboxRow=function CheckboxRow(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,labelStyle=_ref.labelStyle,labelContainerStyle=_ref.labelContainerStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,checkedIcon=_ref.checkedIcon,uncheckedIcon=_ref.uncheckedIcon,size=_ref.size,style=_ref.style,theme=_ref.theme,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=(0,_hooks.usePrevious)(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null||onPress(newValue);if(newValue){onCheck==null||onCheck();}if(!newValue){onUncheck==null||onUncheck();}};var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,Object.assign({onPress:handlePress,style:[styles.mainParent,viewStyles,,{flexDirection:direction}],disabled:disabled},rest,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,labelStyle,_reactNative.StyleSheet.flatten([{color:theme.colors.text.strong},textStyles]))}),(0,_jsxRuntime.jsx)(_Checkbox.default,{Icon:Icon,status:internalValue,style:checkboxStyle,disabled:disabled,onPress:handlePress,color:color,uncheckedColor:uncheckedColor,checkedIcon:checkedIcon,uncheckedIcon:uncheckedIcon,size:size})]}));};var styles=_reactNative.StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingLeft:20,paddingRight:20,minHeight:50,display:"flex"},_reactNative.Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});var _default=exports.default=(0,_theme.withTheme)(CheckboxRow);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.checkboxGroupContext=exports.Direction=void 0;exports.useCheckboxGroupContext=useCheckboxGroupContext;var _react=require("react");var Direction=exports.Direction=function(Direction){Direction["Horizontal"]="horizontal";Direction["Vertical"]="vertical";return Direction;}({});var checkboxGroupContext=exports.checkboxGroupContext=(0,_react.createContext)({onValueChange:function onValueChange(){},values:[],direction:undefined});function useCheckboxGroupContext(){return(0,_react.useContext)(checkboxGroupContext);}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Checkbox",{enumerable:true,get:function get(){return _Checkbox.default;}});Object.defineProperty(exports,"CheckboxRow",{enumerable:true,get:function get(){return _CheckboxRow.default;}});var _Checkbox=_interopRequireDefault(require("./Checkbox"));var _CheckboxRow=_interopRequireDefault(require("./CheckboxRow"));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var getWindowDimensions=function getWindowDimensions(){var _Dimensions$get=_reactNative.Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;return{windowWidth:width,windowHeight:height};};var _getWindowDimensions=getWindowDimensions(),windowWidth=_getWindowDimensions.windowWidth,windowHeight=_getWindowDimensions.windowHeight;var getFilters=function getFilters(options){var width=options.width,height=options.height;var filters=["c_scale","q_auto","dpr_auto"];if(width)filters.push(`w_${width}`);if(height)filters.push(`h_${height}`);return filters.join(",");};var buildImageUrl=function buildImageUrl(options,name){var filters=getFilters(options);return["https://res.cloudinary.com/altos/image/upload",filters,`${name}.png`].join("/");};var getExtension=function getExtension(){return _reactNative.Platform.OS==="web"?".svg":".png";};var _default=exports.default={windowWidth:windowWidth,windowHeight:windowHeight,avatarImageUrl:buildImageUrl({width:60,height:60},"Avatar"),avatarImageSize:60,cardImageSize:200,cardImageUrl:"https://static.draftbit.com/images/placeholder-image"+getExtension(),cardIconSize:16,cardIconBackgroundOpacity:0.24,cardIconElevation:1,placeholderImageURL:"https://static.draftbit.com/images/placeholder-image"+getExtension(),getPlaceholderImageUrl:function getPlaceholderImageUrl(size){return buildImageUrl({width:size.width,height:size.height},"image-placeholder_1");},placeholderSvgURL:"https://static.draftbit.com/images/placeholder-image.svg",squareImageUrl:buildImageUrl({width:100,height:100},"Avatar"),FABSize:40,FABBorderRadius:20,FABFixedHeight:64,cardContainerShortImageAspectRatio:1,rowSingleLineImageSize:24,rowMultiLineImageSize:48,rowSingleLineIconSize:24,rowMultiLineIconSize:16,headerIconSize:24,buttonIconSize:24,swiperInactiveDotSize:6,swiperActiveDotSize:10,fieldSearchBarFullIconSize:24,stepperButtonSize:40,radioButtonSize:24,topSafeAreaViewHeight:0};
|