@kaushverse/pickify 1.2.6 → 1.2.8
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/dist/index.d.mts +46 -16
- package/dist/index.d.ts +46 -16
- package/dist/index.js +266 -140
- package/dist/index.mjs +276 -130
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,20 +15,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
31
21
|
var index_exports = {};
|
|
32
22
|
__export(index_exports, {
|
|
33
|
-
|
|
23
|
+
AnimatedSearchBar: () => AnimatedSearchBar,
|
|
24
|
+
FloatingButton: () => FloatingButton_default,
|
|
34
25
|
MultiPickerGroup: () => MultiPickerGroup,
|
|
35
26
|
MultiPickerItem: () => MultiPickerItem,
|
|
36
27
|
MultiPickerModal: () => MultiPickerModal,
|
|
@@ -50,7 +41,7 @@ function PickerModal({
|
|
|
50
41
|
selectedValue,
|
|
51
42
|
options,
|
|
52
43
|
groups = [],
|
|
53
|
-
styles:
|
|
44
|
+
styles: styles3,
|
|
54
45
|
theme,
|
|
55
46
|
renderTab,
|
|
56
47
|
renderItem,
|
|
@@ -108,7 +99,7 @@ function PickerModal({
|
|
|
108
99
|
style: [
|
|
109
100
|
defaultStyles.container,
|
|
110
101
|
{ backgroundColor: bg },
|
|
111
|
-
|
|
102
|
+
styles3?.container
|
|
112
103
|
],
|
|
113
104
|
children: [
|
|
114
105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -117,10 +108,10 @@ function PickerModal({
|
|
|
117
108
|
style: [
|
|
118
109
|
defaultStyles.doneBtn,
|
|
119
110
|
{ backgroundColor: primary },
|
|
120
|
-
|
|
111
|
+
styles3?.doneBtn
|
|
121
112
|
],
|
|
122
113
|
onPress: handleClose,
|
|
123
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.doneText,
|
|
114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.doneText, styles3?.doneText], children: "Done" })
|
|
124
115
|
}
|
|
125
116
|
),
|
|
126
117
|
hasGroups && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: groups.map((tab, index) => {
|
|
@@ -133,7 +124,7 @@ function PickerModal({
|
|
|
133
124
|
{
|
|
134
125
|
style: [
|
|
135
126
|
defaultStyles.tab,
|
|
136
|
-
|
|
127
|
+
styles3?.tab,
|
|
137
128
|
isActive && { backgroundColor: primary }
|
|
138
129
|
],
|
|
139
130
|
onPress: () => setActiveTab(index),
|
|
@@ -143,7 +134,7 @@ function PickerModal({
|
|
|
143
134
|
style: [
|
|
144
135
|
defaultStyles.tabText,
|
|
145
136
|
{ color: isActive ? "#fff" : text },
|
|
146
|
-
|
|
137
|
+
styles3?.tabText
|
|
147
138
|
],
|
|
148
139
|
children: tab.label
|
|
149
140
|
}
|
|
@@ -174,14 +165,14 @@ function PickerModal({
|
|
|
174
165
|
}
|
|
175
166
|
);
|
|
176
167
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style:
|
|
178
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.label,
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles3?.inputContainer, children: [
|
|
169
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.label, styles3?.label, labelStyle], children: label }),
|
|
179
170
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
180
171
|
import_react_native.TouchableOpacity,
|
|
181
172
|
{
|
|
182
173
|
style: [
|
|
183
174
|
defaultStyles.selectBox,
|
|
184
|
-
|
|
175
|
+
styles3?.selectBox,
|
|
185
176
|
selectBoxStyle,
|
|
186
177
|
error && { borderColor: "red" }
|
|
187
178
|
],
|
|
@@ -192,7 +183,7 @@ function PickerModal({
|
|
|
192
183
|
{
|
|
193
184
|
style: [
|
|
194
185
|
defaultStyles.selectText,
|
|
195
|
-
|
|
186
|
+
styles3?.selectText,
|
|
196
187
|
selectTextStyle
|
|
197
188
|
],
|
|
198
189
|
children: getLabel() || placeholder
|
|
@@ -206,7 +197,7 @@ function PickerModal({
|
|
|
206
197
|
]
|
|
207
198
|
}
|
|
208
199
|
),
|
|
209
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.error,
|
|
200
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [defaultStyles.error, styles3?.error, errorStyle], children: error })
|
|
210
201
|
] }),
|
|
211
202
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, { visible: isVisible, transparent: true, animationType: "slide", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: defaultStyles.modalOverlay, children: renderContainer ? renderContainer(content) : content }) })
|
|
212
203
|
] });
|
|
@@ -493,7 +484,7 @@ function MultiPickerModal({
|
|
|
493
484
|
renderInputIcon,
|
|
494
485
|
renderGroupIcon,
|
|
495
486
|
renderItemIcon,
|
|
496
|
-
styles:
|
|
487
|
+
styles: styles3
|
|
497
488
|
}) {
|
|
498
489
|
const [internalVisible, setInternalVisible] = (0, import_react3.useState)(false);
|
|
499
490
|
const [modalKey, setModalKey] = (0, import_react3.useState)(0);
|
|
@@ -554,7 +545,7 @@ function MultiPickerModal({
|
|
|
554
545
|
selected: selectedValues.includes(item.value),
|
|
555
546
|
onPress: () => handleSelect(item.value),
|
|
556
547
|
renderItemIcon,
|
|
557
|
-
styles:
|
|
548
|
+
styles: styles3?.item
|
|
558
549
|
},
|
|
559
550
|
item.value
|
|
560
551
|
))
|
|
@@ -569,7 +560,7 @@ function MultiPickerModal({
|
|
|
569
560
|
selected: selectedValues.includes(item.value),
|
|
570
561
|
onPress: () => handleSelect(item.value),
|
|
571
562
|
renderItemIcon,
|
|
572
|
-
styles:
|
|
563
|
+
styles: styles3?.item
|
|
573
564
|
},
|
|
574
565
|
item.value
|
|
575
566
|
));
|
|
@@ -585,11 +576,11 @@ function MultiPickerModal({
|
|
|
585
576
|
]
|
|
586
577
|
};
|
|
587
578
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
588
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.label,
|
|
579
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.label, styles3?.label], children: label }),
|
|
589
580
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
590
581
|
import_react_native4.TouchableOpacity,
|
|
591
582
|
{
|
|
592
|
-
style: [defaultStyles3.box,
|
|
583
|
+
style: [defaultStyles3.box, styles3?.selectBox],
|
|
593
584
|
onPress: open,
|
|
594
585
|
activeOpacity: 0.7,
|
|
595
586
|
children: [
|
|
@@ -598,7 +589,7 @@ function MultiPickerModal({
|
|
|
598
589
|
{
|
|
599
590
|
style: [
|
|
600
591
|
defaultStyles3.text,
|
|
601
|
-
|
|
592
|
+
styles3?.selectText,
|
|
602
593
|
!selectedValues?.length && defaultStyles3.placeholder
|
|
603
594
|
],
|
|
604
595
|
numberOfLines: 1,
|
|
@@ -613,7 +604,7 @@ function MultiPickerModal({
|
|
|
613
604
|
]
|
|
614
605
|
}
|
|
615
606
|
),
|
|
616
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.error,
|
|
607
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.error, styles3?.error], children: error }),
|
|
617
608
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
618
609
|
import_react_native4.Modal,
|
|
619
610
|
{
|
|
@@ -621,12 +612,12 @@ function MultiPickerModal({
|
|
|
621
612
|
transparent: true,
|
|
622
613
|
animationType: "none",
|
|
623
614
|
onRequestClose: close,
|
|
624
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [defaultStyles3.overlay,
|
|
615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [defaultStyles3.overlay, styles3?.overlay], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
625
616
|
import_react_native4.Animated.View,
|
|
626
617
|
{
|
|
627
618
|
style: [
|
|
628
619
|
defaultStyles3.container,
|
|
629
|
-
|
|
620
|
+
styles3?.container,
|
|
630
621
|
modalAnimatedStyle
|
|
631
622
|
],
|
|
632
623
|
children: [
|
|
@@ -634,9 +625,9 @@ function MultiPickerModal({
|
|
|
634
625
|
import_react_native4.TouchableOpacity,
|
|
635
626
|
{
|
|
636
627
|
onPress: close,
|
|
637
|
-
style: [defaultStyles3.done,
|
|
628
|
+
style: [defaultStyles3.done, styles3?.doneBtn],
|
|
638
629
|
activeOpacity: 0.7,
|
|
639
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.doneText,
|
|
630
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [defaultStyles3.doneText, styles3?.doneText], children: "Done" })
|
|
640
631
|
}
|
|
641
632
|
),
|
|
642
633
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -718,107 +709,131 @@ var defaultStyles3 = import_react_native4.StyleSheet.create({
|
|
|
718
709
|
});
|
|
719
710
|
|
|
720
711
|
// src/core/FloatingButton.tsx
|
|
721
|
-
var import_react4 =
|
|
712
|
+
var import_react4 = require("react");
|
|
722
713
|
var import_react_native5 = require("react-native");
|
|
723
714
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
724
|
-
var FloatingButton =
|
|
725
|
-
|
|
726
|
-
open = false;
|
|
727
|
-
toggleMenu = () => {
|
|
728
|
-
import_react_native5.Animated.spring(this.animation, {
|
|
729
|
-
toValue: this.open ? 0 : 1,
|
|
730
|
-
useNativeDriver: true,
|
|
731
|
-
damping: 12,
|
|
732
|
-
mass: 0.6,
|
|
733
|
-
stiffness: 180
|
|
734
|
-
}).start();
|
|
735
|
-
this.open = !this.open;
|
|
736
|
-
};
|
|
737
|
-
renderAction = (action, index) => {
|
|
715
|
+
var FloatingButton = (0, import_react4.forwardRef)(
|
|
716
|
+
(props, ref) => {
|
|
738
717
|
const {
|
|
718
|
+
actions,
|
|
739
719
|
mode = "vertical",
|
|
740
720
|
radius = 100,
|
|
741
|
-
|
|
721
|
+
renderMainIcon,
|
|
742
722
|
renderItemIcon,
|
|
743
|
-
styles:
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
outputRange: [0, 1.2, 1]
|
|
783
|
-
})
|
|
784
|
-
}
|
|
785
|
-
],
|
|
786
|
-
opacity: this.animation
|
|
723
|
+
styles: customStyles,
|
|
724
|
+
style,
|
|
725
|
+
mainIconName = "add",
|
|
726
|
+
open: controlledOpen,
|
|
727
|
+
onToggle,
|
|
728
|
+
animationConfig = {}
|
|
729
|
+
} = props;
|
|
730
|
+
const animation = (0, import_react4.useRef)(new import_react_native5.Animated.Value(0)).current;
|
|
731
|
+
const [internalOpen, setInternalOpen] = (0, import_react4.useState)(false);
|
|
732
|
+
const isOpen = controlledOpen !== void 0 ? controlledOpen : internalOpen;
|
|
733
|
+
(0, import_react4.useEffect)(() => {
|
|
734
|
+
import_react_native5.Animated.spring(animation, {
|
|
735
|
+
toValue: isOpen ? 1 : 0,
|
|
736
|
+
useNativeDriver: true,
|
|
737
|
+
damping: 12,
|
|
738
|
+
mass: 0.6,
|
|
739
|
+
stiffness: 180,
|
|
740
|
+
...animationConfig
|
|
741
|
+
}).start();
|
|
742
|
+
}, [isOpen, animation, animationConfig]);
|
|
743
|
+
(0, import_react4.useImperativeHandle)(ref, () => ({
|
|
744
|
+
openMenu: () => {
|
|
745
|
+
if (controlledOpen === void 0) setInternalOpen(true);
|
|
746
|
+
onToggle?.(true);
|
|
747
|
+
},
|
|
748
|
+
closeMenu: () => {
|
|
749
|
+
if (controlledOpen === void 0) setInternalOpen(false);
|
|
750
|
+
onToggle?.(false);
|
|
751
|
+
},
|
|
752
|
+
toggleMenu: () => {
|
|
753
|
+
const newState = !isOpen;
|
|
754
|
+
if (controlledOpen === void 0) setInternalOpen(newState);
|
|
755
|
+
onToggle?.(newState);
|
|
756
|
+
}
|
|
757
|
+
}));
|
|
758
|
+
const toggleMenu = () => {
|
|
759
|
+
const newState = !isOpen;
|
|
760
|
+
if (controlledOpen === void 0) setInternalOpen(newState);
|
|
761
|
+
onToggle?.(newState);
|
|
787
762
|
};
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
763
|
+
const renderAction = (action, index) => {
|
|
764
|
+
let translateX = 0;
|
|
765
|
+
let translateY = 0;
|
|
766
|
+
if (mode === "vertical") {
|
|
767
|
+
translateY = -60 * (index + 1);
|
|
768
|
+
translateX = 0;
|
|
769
|
+
} else if (mode === "horizontal") {
|
|
770
|
+
translateX = -60 * (index + 1);
|
|
771
|
+
translateY = 0;
|
|
772
|
+
} else if (mode === "circle") {
|
|
773
|
+
const totalActions = actions.length;
|
|
774
|
+
const startAngle = -Math.PI / 3;
|
|
775
|
+
const endAngle = -Math.PI * 0.8;
|
|
776
|
+
const angle = startAngle + index / (totalActions - 1 || 1) * (endAngle - startAngle);
|
|
777
|
+
const baseRadius = radius * 0.65;
|
|
778
|
+
const adjustedRadius = index === actions.length - 1 ? baseRadius * 0.8 : baseRadius;
|
|
779
|
+
translateX = adjustedRadius * Math.cos(angle);
|
|
780
|
+
translateY = adjustedRadius * Math.sin(angle);
|
|
781
|
+
}
|
|
782
|
+
const animStyle = {
|
|
783
|
+
transform: [
|
|
798
784
|
{
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
785
|
+
translateX: animation.interpolate({
|
|
786
|
+
inputRange: [0, 1],
|
|
787
|
+
outputRange: [0, translateX]
|
|
788
|
+
})
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
translateY: animation.interpolate({
|
|
792
|
+
inputRange: [0, 1],
|
|
793
|
+
outputRange: [0, translateY]
|
|
794
|
+
})
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
scale: animation.interpolate({
|
|
798
|
+
inputRange: [0, 0.5, 1],
|
|
799
|
+
outputRange: [0, 1.2, 1]
|
|
809
800
|
})
|
|
810
801
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
802
|
+
],
|
|
803
|
+
opacity: animation
|
|
804
|
+
};
|
|
805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
806
|
+
import_react_native5.TouchableWithoutFeedback,
|
|
807
|
+
{
|
|
808
|
+
onPress: () => {
|
|
809
|
+
toggleMenu();
|
|
810
|
+
action.onPress?.();
|
|
811
|
+
action.navigateTo?.();
|
|
812
|
+
},
|
|
813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
814
|
+
import_react_native5.Animated.View,
|
|
815
|
+
{
|
|
816
|
+
style: [
|
|
817
|
+
defaultStyles4.secondary,
|
|
818
|
+
customStyles?.secondaryButton,
|
|
819
|
+
{ backgroundColor: action.color || "#F02A4B" },
|
|
820
|
+
animStyle
|
|
821
|
+
],
|
|
822
|
+
children: renderItemIcon?.({
|
|
823
|
+
name: action.icon,
|
|
824
|
+
size: 20,
|
|
825
|
+
color: action.iconColor || "#FFF"
|
|
826
|
+
})
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
},
|
|
830
|
+
index
|
|
831
|
+
);
|
|
832
|
+
};
|
|
818
833
|
const rotation = {
|
|
819
834
|
transform: [
|
|
820
835
|
{
|
|
821
|
-
rotate:
|
|
836
|
+
rotate: animation.interpolate({
|
|
822
837
|
inputRange: [0, 1],
|
|
823
838
|
outputRange: ["0deg", "45deg"]
|
|
824
839
|
})
|
|
@@ -828,42 +843,41 @@ var FloatingButton = class extends import_react4.default.Component {
|
|
|
828
843
|
const scale = {
|
|
829
844
|
transform: [
|
|
830
845
|
{
|
|
831
|
-
scale:
|
|
846
|
+
scale: animation.interpolate({
|
|
832
847
|
inputRange: [0, 0.5, 1],
|
|
833
848
|
outputRange: [1, 1.1, 1]
|
|
834
849
|
})
|
|
835
850
|
}
|
|
836
851
|
]
|
|
837
852
|
};
|
|
838
|
-
|
|
839
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.View, { style: [defaultStyles4.container, styles2?.container, style], children: [
|
|
853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.View, { style: [defaultStyles4.container, customStyles?.container, style], children: [
|
|
840
854
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
841
855
|
import_react_native5.Animated.View,
|
|
842
856
|
{
|
|
843
857
|
style: [
|
|
844
858
|
defaultStyles4.circleContainer,
|
|
845
|
-
|
|
859
|
+
customStyles?.circleContainer,
|
|
846
860
|
{
|
|
847
861
|
transform: [
|
|
848
862
|
{
|
|
849
|
-
scale:
|
|
863
|
+
scale: animation.interpolate({
|
|
850
864
|
inputRange: [0, 1],
|
|
851
865
|
outputRange: [0, 1]
|
|
852
866
|
})
|
|
853
867
|
}
|
|
854
868
|
],
|
|
855
|
-
opacity:
|
|
869
|
+
opacity: animation
|
|
856
870
|
}
|
|
857
871
|
],
|
|
858
|
-
children: actions.map(
|
|
872
|
+
children: actions.map(renderAction)
|
|
859
873
|
}
|
|
860
874
|
),
|
|
861
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.TouchableWithoutFeedback, { onPress:
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.TouchableWithoutFeedback, { onPress: toggleMenu, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
862
876
|
import_react_native5.Animated.View,
|
|
863
877
|
{
|
|
864
878
|
style: [defaultStyles4.mainButtonWrapper, rotation, scale],
|
|
865
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.View, { style: [defaultStyles4.button,
|
|
866
|
-
name:
|
|
879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.View, { style: [defaultStyles4.button, customStyles?.mainButton], children: renderMainIcon?.({
|
|
880
|
+
name: mainIconName,
|
|
867
881
|
size: 26,
|
|
868
882
|
color: "#FFF"
|
|
869
883
|
}) })
|
|
@@ -871,7 +885,7 @@ var FloatingButton = class extends import_react4.default.Component {
|
|
|
871
885
|
) })
|
|
872
886
|
] });
|
|
873
887
|
}
|
|
874
|
-
|
|
888
|
+
);
|
|
875
889
|
var defaultStyles4 = import_react_native5.StyleSheet.create({
|
|
876
890
|
container: {
|
|
877
891
|
position: "absolute",
|
|
@@ -888,10 +902,7 @@ var defaultStyles4 = import_react_native5.StyleSheet.create({
|
|
|
888
902
|
alignItems: "center",
|
|
889
903
|
justifyContent: "center",
|
|
890
904
|
shadowColor: "#000",
|
|
891
|
-
shadowOffset: {
|
|
892
|
-
width: 0,
|
|
893
|
-
height: 2
|
|
894
|
-
},
|
|
905
|
+
shadowOffset: { width: 0, height: 2 },
|
|
895
906
|
shadowOpacity: 0.25,
|
|
896
907
|
shadowRadius: 3.84,
|
|
897
908
|
elevation: 5
|
|
@@ -922,15 +933,129 @@ var defaultStyles4 = import_react_native5.StyleSheet.create({
|
|
|
922
933
|
alignItems: "center",
|
|
923
934
|
justifyContent: "center",
|
|
924
935
|
shadowColor: "#000",
|
|
925
|
-
shadowOffset: {
|
|
926
|
-
width: 0,
|
|
927
|
-
height: 2
|
|
928
|
-
},
|
|
936
|
+
shadowOffset: { width: 0, height: 2 },
|
|
929
937
|
shadowOpacity: 0.25,
|
|
930
938
|
shadowRadius: 3.84,
|
|
931
939
|
elevation: 5
|
|
932
940
|
}
|
|
933
941
|
});
|
|
942
|
+
var FloatingButton_default = FloatingButton;
|
|
943
|
+
|
|
944
|
+
// src/core/AnimatedSearchBar.tsx
|
|
945
|
+
var import_react5 = require("react");
|
|
946
|
+
var import_react_native6 = require("react-native");
|
|
947
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
948
|
+
function AnimatedSearchBar({
|
|
949
|
+
data,
|
|
950
|
+
onSearch,
|
|
951
|
+
renderLeftIcon,
|
|
952
|
+
renderRightIcons
|
|
953
|
+
}) {
|
|
954
|
+
const [index, setIndex] = (0, import_react5.useState)(0);
|
|
955
|
+
const translateY = (0, import_react5.useRef)(new import_react_native6.Animated.Value(20)).current;
|
|
956
|
+
const opacity = (0, import_react5.useRef)(new import_react_native6.Animated.Value(0)).current;
|
|
957
|
+
const animate = () => {
|
|
958
|
+
translateY.setValue(20);
|
|
959
|
+
opacity.setValue(0);
|
|
960
|
+
import_react_native6.Animated.sequence([
|
|
961
|
+
import_react_native6.Animated.parallel([
|
|
962
|
+
import_react_native6.Animated.timing(translateY, {
|
|
963
|
+
toValue: 0,
|
|
964
|
+
duration: 400,
|
|
965
|
+
useNativeDriver: true
|
|
966
|
+
}),
|
|
967
|
+
import_react_native6.Animated.timing(opacity, {
|
|
968
|
+
toValue: 1,
|
|
969
|
+
duration: 400,
|
|
970
|
+
useNativeDriver: true
|
|
971
|
+
})
|
|
972
|
+
]),
|
|
973
|
+
import_react_native6.Animated.delay(1200),
|
|
974
|
+
import_react_native6.Animated.parallel([
|
|
975
|
+
import_react_native6.Animated.timing(translateY, {
|
|
976
|
+
toValue: -20,
|
|
977
|
+
duration: 400,
|
|
978
|
+
useNativeDriver: true
|
|
979
|
+
}),
|
|
980
|
+
import_react_native6.Animated.timing(opacity, {
|
|
981
|
+
toValue: 0,
|
|
982
|
+
duration: 400,
|
|
983
|
+
useNativeDriver: true
|
|
984
|
+
})
|
|
985
|
+
])
|
|
986
|
+
]).start(() => {
|
|
987
|
+
setIndex((prev) => (prev + 1) % data.length);
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
(0, import_react5.useEffect)(() => {
|
|
991
|
+
if (data.length) animate();
|
|
992
|
+
}, [index]);
|
|
993
|
+
const current = data[index];
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native6.View, { style: styles2.container, children: [
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native6.View, { style: styles2.left, children: renderLeftIcon() }),
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native6.View, { style: styles2.inputContainer, children: [
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
998
|
+
import_react_native6.TextInput,
|
|
999
|
+
{
|
|
1000
|
+
style: styles2.input,
|
|
1001
|
+
placeholder: "",
|
|
1002
|
+
onChangeText: onSearch
|
|
1003
|
+
}
|
|
1004
|
+
),
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1006
|
+
import_react_native6.Animated.Text,
|
|
1007
|
+
{
|
|
1008
|
+
style: [
|
|
1009
|
+
styles2.placeholder,
|
|
1010
|
+
{
|
|
1011
|
+
transform: [{ translateY }],
|
|
1012
|
+
opacity
|
|
1013
|
+
}
|
|
1014
|
+
],
|
|
1015
|
+
children: [
|
|
1016
|
+
"Search for",
|
|
1017
|
+
" ",
|
|
1018
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native6.Animated.Text, { style: { color: current?.color || "#999" }, children: current?.text })
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
] }),
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native6.View, { style: styles2.right, children: renderRightIcons?.() })
|
|
1024
|
+
] });
|
|
1025
|
+
}
|
|
1026
|
+
var styles2 = import_react_native6.StyleSheet.create({
|
|
1027
|
+
container: {
|
|
1028
|
+
flexDirection: "row",
|
|
1029
|
+
alignItems: "center",
|
|
1030
|
+
backgroundColor: "#111",
|
|
1031
|
+
borderRadius: 12,
|
|
1032
|
+
paddingHorizontal: 10,
|
|
1033
|
+
height: 50
|
|
1034
|
+
},
|
|
1035
|
+
left: {
|
|
1036
|
+
paddingRight: 8,
|
|
1037
|
+
borderRightWidth: 1,
|
|
1038
|
+
borderColor: "#333"
|
|
1039
|
+
},
|
|
1040
|
+
inputContainer: {
|
|
1041
|
+
flex: 1,
|
|
1042
|
+
justifyContent: "center",
|
|
1043
|
+
paddingHorizontal: 10
|
|
1044
|
+
},
|
|
1045
|
+
input: {
|
|
1046
|
+
color: "#fff",
|
|
1047
|
+
height: "100%"
|
|
1048
|
+
},
|
|
1049
|
+
placeholder: {
|
|
1050
|
+
position: "absolute",
|
|
1051
|
+
color: "#888",
|
|
1052
|
+
fontSize: 14
|
|
1053
|
+
},
|
|
1054
|
+
right: {
|
|
1055
|
+
flexDirection: "row",
|
|
1056
|
+
gap: 10
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
934
1059
|
|
|
935
1060
|
// src/utils/groupOptions.ts
|
|
936
1061
|
var groupOptions = (options, config) => {
|
|
@@ -941,6 +1066,7 @@ var groupOptions = (options, config) => {
|
|
|
941
1066
|
};
|
|
942
1067
|
// Annotate the CommonJS export names for ESM import in node:
|
|
943
1068
|
0 && (module.exports = {
|
|
1069
|
+
AnimatedSearchBar,
|
|
944
1070
|
FloatingButton,
|
|
945
1071
|
MultiPickerGroup,
|
|
946
1072
|
MultiPickerItem,
|