@draftbit/core 46.4.4-287a83.2 → 46.4.4-2fce56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +25 -5
  2. package/lib/commonjs/components/CircleImage.js +2 -16
  3. package/lib/commonjs/index.js +0 -8
  4. package/lib/commonjs/mappings/TextField.js +12 -2
  5. package/lib/module/components/CardContainerShortImage.js +5 -19
  6. package/lib/module/components/Carousel.js +10 -35
  7. package/lib/module/components/CircleImage.js +2 -17
  8. package/lib/module/components/DeprecatedButton.js +4 -21
  9. package/lib/module/components/NumberInput.js +2 -13
  10. package/lib/module/components/RadioButton/RadioButton.js +2 -15
  11. package/lib/module/components/Touchable.js +2 -18
  12. package/lib/module/constants.js +0 -1
  13. package/lib/module/index.js +0 -1
  14. package/lib/module/mappings/TextField.js +12 -2
  15. package/lib/typescript/src/index.d.ts +0 -1
  16. package/lib/typescript/src/index.d.ts.map +1 -1
  17. package/lib/typescript/src/mappings/TextField.d.ts +20 -0
  18. package/lib/typescript/src/mappings/TextField.d.ts.map +1 -1
  19. package/package.json +3 -5
  20. package/src/index.js +0 -1
  21. package/src/index.tsx +0 -1
  22. package/src/mappings/TextField.js +12 -2
  23. package/src/mappings/TextField.ts +12 -2
  24. package/lib/commonjs/components/BottomSheet/BottomSheet.native.js +0 -68
  25. package/lib/commonjs/components/BottomSheet/BottomSheet.web.js +0 -97
  26. package/lib/commonjs/components/BottomSheet/index.js +0 -15
  27. package/lib/commonjs/components/BottomSheet/types.js +0 -5
  28. package/lib/commonjs/mappings/BottomSheet.js +0 -22
  29. package/lib/module/components/BottomSheet/BottomSheet.native.js +0 -50
  30. package/lib/module/components/BottomSheet/BottomSheet.web.js +0 -78
  31. package/lib/module/components/BottomSheet/index.js +0 -2
  32. package/lib/module/components/BottomSheet/types.js +0 -1
  33. package/lib/module/mappings/BottomSheet.js +0 -13
  34. package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts +0 -5
  35. package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts.map +0 -1
  36. package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts +0 -5
  37. package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts.map +0 -1
  38. package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -2
  39. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +0 -1
  40. package/lib/typescript/src/components/BottomSheet/types.d.ts +0 -9
  41. package/lib/typescript/src/components/BottomSheet/types.d.ts.map +0 -1
  42. package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -20
  43. package/lib/typescript/src/mappings/BottomSheet.d.ts.map +0 -1
  44. package/src/components/BottomSheet/BottomSheet.native.js +0 -37
  45. package/src/components/BottomSheet/BottomSheet.native.tsx +0 -60
  46. package/src/components/BottomSheet/BottomSheet.web.js +0 -56
  47. package/src/components/BottomSheet/BottomSheet.web.tsx +0 -90
  48. package/src/components/BottomSheet/index.js +0 -2
  49. package/src/components/BottomSheet/index.tsx +0 -2
  50. package/src/components/BottomSheet/types.js +0 -1
  51. package/src/components/BottomSheet/types.tsx +0 -8
  52. package/src/mappings/BottomSheet.js +0 -20
  53. package/src/mappings/BottomSheet.ts +0 -25
@@ -1,90 +0,0 @@
1
- import React from "react";
2
- import { StyleSheet, View, Dimensions } from "react-native";
3
- import ScrollBottomSheet from "react-native-scroll-bottom-sheet";
4
-
5
- import { extractStyles } from "../../utilities";
6
- import { BottomSheetProps } from "./types";
7
-
8
- const windowHeight = Dimensions.get("window").height;
9
-
10
- const BottomSheetComponent: React.FC<BottomSheetProps> = ({
11
- style,
12
- children,
13
- step,
14
- }) => {
15
- const { viewStyles } = extractStyles(style);
16
- const bottomSheetRef = React.useRef<any>();
17
-
18
- const webStep = React.useMemo(() => step + 1, [step]);
19
- const snapPoints = React.useMemo(
20
- () => ["25%", "50%", windowHeight - 200],
21
- []
22
- );
23
-
24
- React.useEffect(() => {
25
- bottomSheetRef?.current?.snapTo(snapPoints.length - webStep);
26
- // bottomSheetRef.current.snapTo(step);
27
- }, [webStep, step, snapPoints]);
28
-
29
- if (step === -1) {
30
- return <></>;
31
- }
32
-
33
- return (
34
- <View style={styles.container}>
35
- <ScrollBottomSheet
36
- ref={bottomSheetRef}
37
- componentType="ScrollView"
38
- snapPoints={snapPoints}
39
- initialSnapIndex={0}
40
- renderHandle={() => (
41
- <View style={styles.header}>
42
- <View style={styles.panelHandle} />
43
- </View>
44
- )}
45
- contentContainerStyle={styles.contentContainerStyle}
46
- >
47
- <View
48
- style={{
49
- ...styles.container,
50
- ...viewStyles,
51
- backgroundColor: webStep !== -1 ? "grey" : "transparent",
52
- }}
53
- >
54
- {children}
55
- </View>
56
- </ScrollBottomSheet>
57
- </View>
58
- );
59
- };
60
-
61
- export default BottomSheetComponent;
62
-
63
- const styles = StyleSheet.create({
64
- container: {
65
- flex: 1,
66
- },
67
- contentContainerStyle: {
68
- padding: 16,
69
- },
70
- header: {
71
- alignItems: "center",
72
- backgroundColor: "white",
73
- paddingVertical: 20,
74
- borderTopLeftRadius: 20,
75
- borderTopRightRadius: 20,
76
- },
77
- panelHandle: {
78
- width: 40,
79
- height: 2,
80
- backgroundColor: "rgba(0,0,0,0.3)",
81
- borderRadius: 4,
82
- },
83
- item: {
84
- padding: 20,
85
- justifyContent: "center",
86
- backgroundColor: "white",
87
- alignItems: "center",
88
- marginVertical: 10,
89
- },
90
- });
@@ -1,2 +0,0 @@
1
- //@ts-ignore
2
- export { default as BottomSheet } from "./BottomSheet";
@@ -1,2 +0,0 @@
1
- //@ts-ignore
2
- export { default as BottomSheet } from "./BottomSheet";
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { StyleProp, ViewStyle, TextStyle } from "react-native";
2
-
3
- export interface BottomSheetProps {
4
- style: StyleProp<ViewStyle | TextStyle>;
5
- children: React.ReactNode;
6
- step: number;
7
- isOpen?: Boolean;
8
- }
@@ -1,20 +0,0 @@
1
- import { COMPONENT_TYPES, createNumberProp, StylesPanelSections, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Bottom Sheet",
4
- tag: "BottomSheet",
5
- category: COMPONENT_TYPES.container,
6
- stylesPanelSections: [
7
- StylesPanelSections.Background,
8
- StylesPanelSections.Borders,
9
- StylesPanelSections.Size,
10
- StylesPanelSections.MarginsAndPaddings,
11
- StylesPanelSections.Position,
12
- StylesPanelSections.Effects,
13
- ],
14
- props: {
15
- step: createNumberProp({
16
- label: "Step",
17
- description: "Step can be -1, 0, 1, or 2.",
18
- }),
19
- },
20
- };
@@ -1,25 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createNumberProp,
4
- StylesPanelSections,
5
- } from "@draftbit/types";
6
-
7
- export const SEED_DATA = {
8
- name: "Bottom Sheet",
9
- tag: "BottomSheet",
10
- category: COMPONENT_TYPES.container,
11
- stylesPanelSections: [
12
- StylesPanelSections.Background,
13
- StylesPanelSections.Borders,
14
- StylesPanelSections.Size,
15
- StylesPanelSections.MarginsAndPaddings,
16
- StylesPanelSections.Position,
17
- StylesPanelSections.Effects,
18
- ],
19
- props: {
20
- step: createNumberProp({
21
- label: "Step",
22
- description: "Step can be -1, 0, 1, or 2.",
23
- }),
24
- },
25
- };