@lodev09/react-native-true-sheet 3.0.0-beta.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +29 -33
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +3 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +53 -43
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +390 -89
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +42 -4
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensFragmentObserver.kt +0 -5
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDialogObserver.kt +67 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +70 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +94 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +37 -33
- package/android/src/main/res/anim/true_sheet_slide_in.xml +13 -0
- package/android/src/main/res/anim/true_sheet_slide_out.xml +13 -0
- package/android/src/main/res/values/styles.xml +13 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +5 -3
- package/ios/TrueSheetContainerView.mm +4 -0
- package/ios/TrueSheetContentView.h +2 -1
- package/ios/TrueSheetContentView.mm +91 -11
- package/ios/TrueSheetView.mm +94 -41
- package/ios/TrueSheetViewController.h +22 -10
- package/ios/TrueSheetViewController.mm +360 -173
- package/ios/core/TrueSheetBlurView.h +26 -0
- package/ios/{utils/ConversionUtil.mm → core/TrueSheetBlurView.mm} +64 -3
- package/ios/core/TrueSheetGrabberView.h +42 -0
- package/ios/core/TrueSheetGrabberView.mm +107 -0
- package/ios/events/TrueSheetDragEvents.h +39 -0
- package/ios/events/TrueSheetDragEvents.mm +62 -0
- package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
- package/ios/events/TrueSheetFocusEvents.mm +49 -0
- package/ios/events/TrueSheetLifecycleEvents.h +40 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/utils/GestureUtil.h +7 -0
- package/ios/utils/GestureUtil.mm +12 -0
- package/lib/module/TrueSheet.js +72 -12
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +28 -5
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.js +13 -7
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +4 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +105 -6
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +25 -5
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/TrueSheet.tsx +87 -10
- package/src/TrueSheet.types.ts +114 -6
- package/src/__mocks__/index.js +0 -5
- package/src/fabric/TrueSheetViewNativeComponent.ts +28 -5
- package/src/index.ts +0 -1
- package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +11 -3
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
- package/ios/events/OnDetentChangeEvent.h +0 -28
- package/ios/events/OnDetentChangeEvent.mm +0 -30
- package/ios/events/OnDidDismissEvent.h +0 -26
- package/ios/events/OnDidDismissEvent.mm +0 -25
- package/ios/events/OnDidPresentEvent.h +0 -28
- package/ios/events/OnDidPresentEvent.mm +0 -30
- package/ios/events/OnDragBeginEvent.h +0 -28
- package/ios/events/OnDragBeginEvent.mm +0 -30
- package/ios/events/OnDragChangeEvent.h +0 -28
- package/ios/events/OnDragChangeEvent.mm +0 -30
- package/ios/events/OnDragEndEvent.h +0 -28
- package/ios/events/OnDragEndEvent.mm +0 -30
- package/ios/events/OnMountEvent.h +0 -26
- package/ios/events/OnMountEvent.mm +0 -25
- package/ios/events/OnPositionChangeEvent.mm +0 -32
- package/ios/events/OnWillDismissEvent.h +0 -26
- package/ios/events/OnWillDismissEvent.mm +0 -25
- package/ios/events/OnWillPresentEvent.h +0 -28
- package/ios/events/OnWillPresentEvent.mm +0 -30
- package/ios/utils/ConversionUtil.h +0 -24
- package/lib/module/TrueSheetGrabber.js +0 -51
- package/lib/module/TrueSheetGrabber.js.map +0 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
- package/src/TrueSheetGrabber.tsx +0 -82
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import "OnMountEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnMountEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
-
if (!eventEmitter)
|
|
17
|
-
return;
|
|
18
|
-
|
|
19
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
-
emitter->onMount({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import "OnPositionChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnPositionChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position
|
|
18
|
-
transitioning:(BOOL)transitioning {
|
|
19
|
-
if (!eventEmitter)
|
|
20
|
-
return;
|
|
21
|
-
|
|
22
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
23
|
-
TrueSheetViewEventEmitter::OnPositionChange event;
|
|
24
|
-
event.index = static_cast<int>(index);
|
|
25
|
-
event.position = static_cast<double>(position);
|
|
26
|
-
event.transitioning = static_cast<bool>(transitioning);
|
|
27
|
-
emitter->onPositionChange(event);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@end
|
|
31
|
-
|
|
32
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnWillDismissEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
25
|
-
|
|
26
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import "OnWillDismissEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillDismissEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
-
if (!eventEmitter)
|
|
17
|
-
return;
|
|
18
|
-
|
|
19
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
-
emitter->onWillDismiss({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import <Foundation/Foundation.h>
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
-
|
|
18
|
-
@interface OnWillPresentEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
-
|
|
11
|
-
#import "OnWillPresentEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillPresentEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnWillPresent event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onWillPresent(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Jovanni Lo (@lodev09)
|
|
3
|
-
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This source code is licensed under the MIT license found in the
|
|
6
|
-
// LICENSE file in the root directory of this source tree.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
-
|
|
13
|
-
@interface ConversionUtil : NSObject
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Converts a dashed-case blur tint string to UIBlurEffectStyle
|
|
17
|
-
* @param tintString The blur tint string (e.g., "system-thin-material")
|
|
18
|
-
* @return The corresponding UIBlurEffectStyle, defaults to UIBlurEffectStyleLight if not recognized
|
|
19
|
-
*/
|
|
20
|
-
+ (UIBlurEffectStyle)blurEffectStyleFromString:(NSString *)tintString;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
6
|
-
const GRABBER_DEFAULT_WIDTH = 32;
|
|
7
|
-
|
|
8
|
-
// M3 spec: #49454F 0.4 alpha
|
|
9
|
-
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
10
|
-
/**
|
|
11
|
-
* Grabber component.
|
|
12
|
-
* Used by defualt for Android but feel free to re-use.
|
|
13
|
-
*/
|
|
14
|
-
export const TrueSheetGrabber = props => {
|
|
15
|
-
const {
|
|
16
|
-
visible = true,
|
|
17
|
-
color = GRABBER_DEFAULT_COLOR,
|
|
18
|
-
width = GRABBER_DEFAULT_WIDTH,
|
|
19
|
-
height = GRABBER_DEFAULT_HEIGHT,
|
|
20
|
-
topOffset = 0,
|
|
21
|
-
style
|
|
22
|
-
} = props;
|
|
23
|
-
if (!visible) return null;
|
|
24
|
-
return /*#__PURE__*/_jsx(View, {
|
|
25
|
-
style: [styles.wrapper, style, {
|
|
26
|
-
height: GRABBER_DEFAULT_HEIGHT * 4,
|
|
27
|
-
top: topOffset
|
|
28
|
-
}],
|
|
29
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
30
|
-
style: [styles.grabber, {
|
|
31
|
-
height,
|
|
32
|
-
width,
|
|
33
|
-
backgroundColor: color
|
|
34
|
-
}]
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
const styles = StyleSheet.create({
|
|
39
|
-
wrapper: {
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
alignSelf: 'center',
|
|
42
|
-
paddingHorizontal: 12,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
zIndex: 9999
|
|
46
|
-
},
|
|
47
|
-
grabber: {
|
|
48
|
-
borderRadius: GRABBER_DEFAULT_HEIGHT / 2
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=TrueSheetGrabber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","jsx","_jsx","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","styles","wrapper","top","children","grabber","backgroundColor","create","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAyD,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjG,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEN,IAAA,CAACF,IAAI;IAACa,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAEF,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEa,GAAG,EAAEJ;IAAU,CAAC,CAAE;IAAAK,QAAA,eAC3Ff,IAAA,CAACF,IAAI;MAACa,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,EAAE;QAAEP,MAAM;QAAED,KAAK;QAAES,eAAe,EAAEV;MAAM,CAAC;IAAE,CAAE;EAAC,CACxE,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAGf,UAAU,CAACqB,MAAM,CAAC;EAC/BL,OAAO,EAAE;IACPM,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE;EACV,CAAC;EACDR,OAAO,EAAE;IACPS,YAAY,EAAExB,sBAAsB,GAAG;EACzC;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
-
export interface TrueSheetGrabberProps {
|
|
3
|
-
/**
|
|
4
|
-
* Is grabber visible.
|
|
5
|
-
* @default true
|
|
6
|
-
*/
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Optional style that overrides the default style.
|
|
10
|
-
*/
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
/**
|
|
13
|
-
* Grabber color according to M3 specs.
|
|
14
|
-
* @default rgba(73,69,79,0.4)
|
|
15
|
-
*/
|
|
16
|
-
color?: ColorValue;
|
|
17
|
-
/**
|
|
18
|
-
* Grabber height according to M3 specs.
|
|
19
|
-
* @default 4
|
|
20
|
-
*/
|
|
21
|
-
height?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Grabber top position offset.
|
|
24
|
-
*
|
|
25
|
-
* @default 6
|
|
26
|
-
*/
|
|
27
|
-
topOffset?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Grabber width according to M3 specs.
|
|
30
|
-
* @default 32
|
|
31
|
-
*/
|
|
32
|
-
width?: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Grabber component.
|
|
36
|
-
* Used by defualt for Android but feel free to re-use.
|
|
37
|
-
*/
|
|
38
|
-
export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
-
//# sourceMappingURL=TrueSheetGrabber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQjG,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,mDAiB5D,CAAC"}
|
package/src/TrueSheetGrabber.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, View, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
4
|
-
const GRABBER_DEFAULT_WIDTH = 32;
|
|
5
|
-
|
|
6
|
-
// M3 spec: #49454F 0.4 alpha
|
|
7
|
-
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
8
|
-
|
|
9
|
-
export interface TrueSheetGrabberProps {
|
|
10
|
-
/**
|
|
11
|
-
* Is grabber visible.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
visible?: boolean;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Optional style that overrides the default style.
|
|
18
|
-
*/
|
|
19
|
-
style?: StyleProp<ViewStyle>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Grabber color according to M3 specs.
|
|
23
|
-
* @default rgba(73,69,79,0.4)
|
|
24
|
-
*/
|
|
25
|
-
color?: ColorValue;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Grabber height according to M3 specs.
|
|
29
|
-
* @default 4
|
|
30
|
-
*/
|
|
31
|
-
height?: number;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Grabber top position offset.
|
|
35
|
-
*
|
|
36
|
-
* @default 6
|
|
37
|
-
*/
|
|
38
|
-
topOffset?: number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Grabber width according to M3 specs.
|
|
42
|
-
* @default 32
|
|
43
|
-
*/
|
|
44
|
-
width?: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Grabber component.
|
|
49
|
-
* Used by defualt for Android but feel free to re-use.
|
|
50
|
-
*/
|
|
51
|
-
export const TrueSheetGrabber = (props: TrueSheetGrabberProps) => {
|
|
52
|
-
const {
|
|
53
|
-
visible = true,
|
|
54
|
-
color = GRABBER_DEFAULT_COLOR,
|
|
55
|
-
width = GRABBER_DEFAULT_WIDTH,
|
|
56
|
-
height = GRABBER_DEFAULT_HEIGHT,
|
|
57
|
-
topOffset = 0,
|
|
58
|
-
style,
|
|
59
|
-
} = props;
|
|
60
|
-
|
|
61
|
-
if (!visible) return null;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<View style={[styles.wrapper, style, { height: GRABBER_DEFAULT_HEIGHT * 4, top: topOffset }]}>
|
|
65
|
-
<View style={[styles.grabber, { height, width, backgroundColor: color }]} />
|
|
66
|
-
</View>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const styles = StyleSheet.create({
|
|
71
|
-
wrapper: {
|
|
72
|
-
position: 'absolute',
|
|
73
|
-
alignSelf: 'center',
|
|
74
|
-
paddingHorizontal: 12,
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
justifyContent: 'center',
|
|
77
|
-
zIndex: 9999,
|
|
78
|
-
},
|
|
79
|
-
grabber: {
|
|
80
|
-
borderRadius: GRABBER_DEFAULT_HEIGHT / 2,
|
|
81
|
-
},
|
|
82
|
-
});
|