@kaushverse/pickify 1.1.12 → 1.1.14

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 CHANGED
@@ -151,6 +151,10 @@ type Props = {
151
151
  styles?: FloatingButtonStyles;
152
152
  style?: ViewStyle;
153
153
  mainIconName?: string;
154
+ spacing?: number;
155
+ animationDuration?: number;
156
+ buttonSize?: number;
157
+ secondaryButtonSize?: number;
154
158
  };
155
159
  declare class FloatingButton extends React$1.Component<Props> {
156
160
  animation: Animated.Value;
package/dist/index.d.ts CHANGED
@@ -151,6 +151,10 @@ type Props = {
151
151
  styles?: FloatingButtonStyles;
152
152
  style?: ViewStyle;
153
153
  mainIconName?: string;
154
+ spacing?: number;
155
+ animationDuration?: number;
156
+ buttonSize?: number;
157
+ secondaryButtonSize?: number;
154
158
  };
155
159
  declare class FloatingButton extends React$1.Component<Props> {
156
160
  animation: Animated.Value;
package/dist/index.js CHANGED
@@ -728,38 +728,38 @@ var FloatingButton = class extends import_react4.default.Component {
728
728
  import_react_native5.Animated.spring(this.animation, {
729
729
  toValue: this.open ? 0 : 1,
730
730
  useNativeDriver: true,
731
- damping: 12,
732
- mass: 0.6,
733
- stiffness: 180
731
+ // ✅ ONLY physics-based config (FIXED)
732
+ stiffness: 250,
733
+ damping: 20,
734
+ mass: 1
734
735
  }).start();
735
736
  this.open = !this.open;
736
737
  };
737
738
  renderAction = (action, index) => {
738
739
  const {
739
740
  mode = "vertical",
740
- radius = 100,
741
+ radius = 90,
741
742
  actions,
742
743
  renderItemIcon,
743
- styles: styles2
744
+ styles: styles2,
745
+ spacing = 65,
746
+ secondaryButtonSize = 48
744
747
  } = this.props;
745
748
  let translateX = 0;
746
749
  let translateY = 0;
747
750
  if (mode === "vertical") {
748
- translateY = -70 * (index + 1);
749
- translateX = 0;
751
+ translateY = -spacing * (index + 1);
750
752
  }
751
753
  if (mode === "horizontal") {
752
- translateX = -70 * (index + 1);
753
- translateY = 0;
754
+ translateX = -spacing * (index + 1);
754
755
  }
755
756
  if (mode === "circle") {
756
757
  const totalActions = actions.length;
757
- const startAngle = -Math.PI / 3;
758
- const endAngle = -Math.PI * 0.8;
758
+ const startAngle = -Math.PI / 2.5;
759
+ const endAngle = -Math.PI * 0.7;
759
760
  const angle = startAngle + index / (totalActions - 1 || 1) * (endAngle - startAngle);
760
- const adjustedRadius = radius * 0.65;
761
- translateX = adjustedRadius * Math.cos(angle);
762
- translateY = adjustedRadius * Math.sin(angle);
761
+ translateX = radius * Math.cos(angle);
762
+ translateY = radius * Math.sin(angle);
763
763
  }
764
764
  const animStyle = {
765
765
  transform: [
@@ -777,20 +777,40 @@ var FloatingButton = class extends import_react4.default.Component {
777
777
  },
778
778
  {
779
779
  scale: this.animation.interpolate({
780
- inputRange: [0, 0.5, 1],
781
- outputRange: [0, 1.2, 1]
780
+ inputRange: [0, 0.3, 0.7, 1],
781
+ outputRange: [0, 1.1, 0.95, 1]
782
782
  })
783
783
  }
784
784
  ],
785
- opacity: this.animation
785
+ opacity: this.animation.interpolate({
786
+ inputRange: [0, 0.2, 1],
787
+ outputRange: [0, 0.8, 1]
788
+ })
789
+ };
790
+ const delay = index * 30;
791
+ const delayedStyle = {
792
+ opacity: this.animation.interpolate({
793
+ inputRange: [0, 0.2 + delay / 100, 1],
794
+ outputRange: [0, 0, 1]
795
+ }),
796
+ transform: [
797
+ {
798
+ scale: this.animation.interpolate({
799
+ inputRange: [0, 0.3 + delay / 100, 1],
800
+ outputRange: [0, 0.8, 1]
801
+ })
802
+ }
803
+ ]
786
804
  };
787
805
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
788
806
  import_react_native5.TouchableWithoutFeedback,
789
807
  {
790
808
  onPress: () => {
791
809
  this.toggleMenu();
792
- action.onPress?.();
793
- action.navigateTo?.();
810
+ setTimeout(() => {
811
+ action.onPress?.();
812
+ action.navigateTo?.();
813
+ }, 100);
794
814
  },
795
815
  children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
796
816
  import_react_native5.Animated.View,
@@ -798,12 +818,18 @@ var FloatingButton = class extends import_react4.default.Component {
798
818
  style: [
799
819
  defaultStyles4.secondary,
800
820
  styles2?.secondaryButton,
801
- { backgroundColor: action.color || "#F02A4B" },
802
- animStyle
821
+ {
822
+ backgroundColor: action.color || "#F02A4B",
823
+ width: secondaryButtonSize,
824
+ height: secondaryButtonSize,
825
+ borderRadius: secondaryButtonSize / 2
826
+ },
827
+ animStyle,
828
+ mode !== "circle" && delayedStyle
803
829
  ],
804
830
  children: renderItemIcon?.({
805
831
  name: action.icon,
806
- size: 20,
832
+ size: secondaryButtonSize * 0.42,
807
833
  color: action.iconColor || "#FFF"
808
834
  })
809
835
  }
@@ -813,7 +839,15 @@ var FloatingButton = class extends import_react4.default.Component {
813
839
  );
814
840
  };
815
841
  render() {
816
- const { actions, renderMainIcon, styles: styles2, style, mainIconName } = this.props;
842
+ const {
843
+ actions,
844
+ renderMainIcon,
845
+ styles: styles2,
846
+ style,
847
+ mainIconName,
848
+ mode = "vertical",
849
+ buttonSize = 56
850
+ } = this.props;
817
851
  const rotation = {
818
852
  transform: [
819
853
  {
@@ -824,48 +858,57 @@ var FloatingButton = class extends import_react4.default.Component {
824
858
  }
825
859
  ]
826
860
  };
827
- const scale = {
861
+ const mainScale = {
828
862
  transform: [
829
863
  {
830
864
  scale: this.animation.interpolate({
831
865
  inputRange: [0, 0.5, 1],
832
- outputRange: [1, 1.1, 1]
866
+ outputRange: [1, 1.15, 1]
833
867
  })
834
868
  }
835
869
  ]
836
870
  };
837
871
  const mainIcon = mainIconName || "add";
838
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.View, { style: [defaultStyles4.container, styles2?.container, style], children: [
839
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
872
+ const containerStyle = [
873
+ defaultStyles4.container,
874
+ styles2?.container,
875
+ style,
876
+ { right: 20, bottom: 100 }
877
+ ];
878
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.View, { style: containerStyle, children: [
879
+ actions.map(this.renderAction),
880
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.TouchableWithoutFeedback, { onPress: this.toggleMenu, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
840
881
  import_react_native5.Animated.View,
841
882
  {
842
883
  style: [
843
- defaultStyles4.circleContainer,
844
- styles2?.circleContainer,
884
+ defaultStyles4.mainButtonWrapper,
885
+ styles2?.mainButton,
886
+ rotation,
887
+ mainScale,
845
888
  {
846
- transform: [
889
+ width: buttonSize,
890
+ height: buttonSize,
891
+ borderRadius: buttonSize / 2
892
+ }
893
+ ],
894
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
895
+ import_react_native5.View,
896
+ {
897
+ style: [
898
+ defaultStyles4.button,
847
899
  {
848
- scale: this.animation.interpolate({
849
- inputRange: [0, 1],
850
- outputRange: [0, 1]
851
- })
900
+ width: buttonSize,
901
+ height: buttonSize,
902
+ borderRadius: buttonSize / 2
852
903
  }
853
904
  ],
854
- opacity: this.animation
905
+ children: renderMainIcon?.({
906
+ name: mainIcon,
907
+ size: buttonSize * 0.46,
908
+ color: "#FFF"
909
+ })
855
910
  }
856
- ],
857
- children: actions.map(this.renderAction)
858
- }
859
- ),
860
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.TouchableWithoutFeedback, { onPress: this.toggleMenu, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
861
- import_react_native5.Animated.View,
862
- {
863
- style: [defaultStyles4.mainButtonWrapper, rotation, scale],
864
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.View, { style: [defaultStyles4.button, styles2?.mainButton], children: renderMainIcon?.({
865
- name: mainIcon,
866
- size: 26,
867
- color: "#FFF"
868
- }) })
911
+ )
869
912
  }
870
913
  ) })
871
914
  ] });
@@ -874,59 +917,26 @@ var FloatingButton = class extends import_react4.default.Component {
874
917
  var defaultStyles4 = import_react_native5.StyleSheet.create({
875
918
  container: {
876
919
  position: "absolute",
877
- bottom: 100,
878
- right: 20,
879
920
  alignItems: "center",
880
- justifyContent: "center"
921
+ justifyContent: "center",
922
+ zIndex: 1e3
881
923
  },
882
924
  mainButtonWrapper: {
883
- width: 60,
884
- height: 60,
885
- borderRadius: 30,
886
925
  backgroundColor: "#F02A4B",
887
926
  alignItems: "center",
888
927
  justifyContent: "center",
889
- shadowColor: "#000",
890
- shadowOffset: {
891
- width: 0,
892
- height: 2
893
- },
894
- shadowOpacity: 0.25,
895
- shadowRadius: 3.84,
896
- elevation: 5
928
+ elevation: 8
897
929
  },
898
930
  button: {
899
- width: 60,
900
- height: 60,
901
- borderRadius: 30,
902
931
  backgroundColor: "#F02A4B",
903
932
  alignItems: "center",
904
933
  justifyContent: "center"
905
934
  },
906
- circleContainer: {
907
- position: "absolute",
908
- width: 200,
909
- height: 200,
910
- right: -70,
911
- bottom: -70,
912
- alignItems: "center",
913
- justifyContent: "center"
914
- },
915
935
  secondary: {
916
936
  position: "absolute",
917
- width: 48,
918
- height: 48,
919
- borderRadius: 24,
920
937
  backgroundColor: "#F02A4B",
921
938
  alignItems: "center",
922
939
  justifyContent: "center",
923
- shadowColor: "#000",
924
- shadowOffset: {
925
- width: 0,
926
- height: 2
927
- },
928
- shadowOpacity: 0.25,
929
- shadowRadius: 3.84,
930
940
  elevation: 5
931
941
  }
932
942
  });
package/dist/index.mjs CHANGED
@@ -712,38 +712,38 @@ var FloatingButton = class extends React4.Component {
712
712
  Animated3.spring(this.animation, {
713
713
  toValue: this.open ? 0 : 1,
714
714
  useNativeDriver: true,
715
- damping: 12,
716
- mass: 0.6,
717
- stiffness: 180
715
+ // ✅ ONLY physics-based config (FIXED)
716
+ stiffness: 250,
717
+ damping: 20,
718
+ mass: 1
718
719
  }).start();
719
720
  this.open = !this.open;
720
721
  };
721
722
  renderAction = (action, index) => {
722
723
  const {
723
724
  mode = "vertical",
724
- radius = 100,
725
+ radius = 90,
725
726
  actions,
726
727
  renderItemIcon,
727
- styles: styles2
728
+ styles: styles2,
729
+ spacing = 65,
730
+ secondaryButtonSize = 48
728
731
  } = this.props;
729
732
  let translateX = 0;
730
733
  let translateY = 0;
731
734
  if (mode === "vertical") {
732
- translateY = -70 * (index + 1);
733
- translateX = 0;
735
+ translateY = -spacing * (index + 1);
734
736
  }
735
737
  if (mode === "horizontal") {
736
- translateX = -70 * (index + 1);
737
- translateY = 0;
738
+ translateX = -spacing * (index + 1);
738
739
  }
739
740
  if (mode === "circle") {
740
741
  const totalActions = actions.length;
741
- const startAngle = -Math.PI / 3;
742
- const endAngle = -Math.PI * 0.8;
742
+ const startAngle = -Math.PI / 2.5;
743
+ const endAngle = -Math.PI * 0.7;
743
744
  const angle = startAngle + index / (totalActions - 1 || 1) * (endAngle - startAngle);
744
- const adjustedRadius = radius * 0.65;
745
- translateX = adjustedRadius * Math.cos(angle);
746
- translateY = adjustedRadius * Math.sin(angle);
745
+ translateX = radius * Math.cos(angle);
746
+ translateY = radius * Math.sin(angle);
747
747
  }
748
748
  const animStyle = {
749
749
  transform: [
@@ -761,20 +761,40 @@ var FloatingButton = class extends React4.Component {
761
761
  },
762
762
  {
763
763
  scale: this.animation.interpolate({
764
- inputRange: [0, 0.5, 1],
765
- outputRange: [0, 1.2, 1]
764
+ inputRange: [0, 0.3, 0.7, 1],
765
+ outputRange: [0, 1.1, 0.95, 1]
766
766
  })
767
767
  }
768
768
  ],
769
- opacity: this.animation
769
+ opacity: this.animation.interpolate({
770
+ inputRange: [0, 0.2, 1],
771
+ outputRange: [0, 0.8, 1]
772
+ })
773
+ };
774
+ const delay = index * 30;
775
+ const delayedStyle = {
776
+ opacity: this.animation.interpolate({
777
+ inputRange: [0, 0.2 + delay / 100, 1],
778
+ outputRange: [0, 0, 1]
779
+ }),
780
+ transform: [
781
+ {
782
+ scale: this.animation.interpolate({
783
+ inputRange: [0, 0.3 + delay / 100, 1],
784
+ outputRange: [0, 0.8, 1]
785
+ })
786
+ }
787
+ ]
770
788
  };
771
789
  return /* @__PURE__ */ jsx5(
772
790
  TouchableWithoutFeedback,
773
791
  {
774
792
  onPress: () => {
775
793
  this.toggleMenu();
776
- action.onPress?.();
777
- action.navigateTo?.();
794
+ setTimeout(() => {
795
+ action.onPress?.();
796
+ action.navigateTo?.();
797
+ }, 100);
778
798
  },
779
799
  children: /* @__PURE__ */ jsx5(
780
800
  Animated3.View,
@@ -782,12 +802,18 @@ var FloatingButton = class extends React4.Component {
782
802
  style: [
783
803
  defaultStyles4.secondary,
784
804
  styles2?.secondaryButton,
785
- { backgroundColor: action.color || "#F02A4B" },
786
- animStyle
805
+ {
806
+ backgroundColor: action.color || "#F02A4B",
807
+ width: secondaryButtonSize,
808
+ height: secondaryButtonSize,
809
+ borderRadius: secondaryButtonSize / 2
810
+ },
811
+ animStyle,
812
+ mode !== "circle" && delayedStyle
787
813
  ],
788
814
  children: renderItemIcon?.({
789
815
  name: action.icon,
790
- size: 20,
816
+ size: secondaryButtonSize * 0.42,
791
817
  color: action.iconColor || "#FFF"
792
818
  })
793
819
  }
@@ -797,7 +823,15 @@ var FloatingButton = class extends React4.Component {
797
823
  );
798
824
  };
799
825
  render() {
800
- const { actions, renderMainIcon, styles: styles2, style, mainIconName } = this.props;
826
+ const {
827
+ actions,
828
+ renderMainIcon,
829
+ styles: styles2,
830
+ style,
831
+ mainIconName,
832
+ mode = "vertical",
833
+ buttonSize = 56
834
+ } = this.props;
801
835
  const rotation = {
802
836
  transform: [
803
837
  {
@@ -808,48 +842,57 @@ var FloatingButton = class extends React4.Component {
808
842
  }
809
843
  ]
810
844
  };
811
- const scale = {
845
+ const mainScale = {
812
846
  transform: [
813
847
  {
814
848
  scale: this.animation.interpolate({
815
849
  inputRange: [0, 0.5, 1],
816
- outputRange: [1, 1.1, 1]
850
+ outputRange: [1, 1.15, 1]
817
851
  })
818
852
  }
819
853
  ]
820
854
  };
821
855
  const mainIcon = mainIconName || "add";
822
- return /* @__PURE__ */ jsxs5(View5, { style: [defaultStyles4.container, styles2?.container, style], children: [
823
- /* @__PURE__ */ jsx5(
856
+ const containerStyle = [
857
+ defaultStyles4.container,
858
+ styles2?.container,
859
+ style,
860
+ { right: 20, bottom: 100 }
861
+ ];
862
+ return /* @__PURE__ */ jsxs5(View5, { style: containerStyle, children: [
863
+ actions.map(this.renderAction),
864
+ /* @__PURE__ */ jsx5(TouchableWithoutFeedback, { onPress: this.toggleMenu, children: /* @__PURE__ */ jsx5(
824
865
  Animated3.View,
825
866
  {
826
867
  style: [
827
- defaultStyles4.circleContainer,
828
- styles2?.circleContainer,
868
+ defaultStyles4.mainButtonWrapper,
869
+ styles2?.mainButton,
870
+ rotation,
871
+ mainScale,
829
872
  {
830
- transform: [
873
+ width: buttonSize,
874
+ height: buttonSize,
875
+ borderRadius: buttonSize / 2
876
+ }
877
+ ],
878
+ children: /* @__PURE__ */ jsx5(
879
+ View5,
880
+ {
881
+ style: [
882
+ defaultStyles4.button,
831
883
  {
832
- scale: this.animation.interpolate({
833
- inputRange: [0, 1],
834
- outputRange: [0, 1]
835
- })
884
+ width: buttonSize,
885
+ height: buttonSize,
886
+ borderRadius: buttonSize / 2
836
887
  }
837
888
  ],
838
- opacity: this.animation
889
+ children: renderMainIcon?.({
890
+ name: mainIcon,
891
+ size: buttonSize * 0.46,
892
+ color: "#FFF"
893
+ })
839
894
  }
840
- ],
841
- children: actions.map(this.renderAction)
842
- }
843
- ),
844
- /* @__PURE__ */ jsx5(TouchableWithoutFeedback, { onPress: this.toggleMenu, children: /* @__PURE__ */ jsx5(
845
- Animated3.View,
846
- {
847
- style: [defaultStyles4.mainButtonWrapper, rotation, scale],
848
- children: /* @__PURE__ */ jsx5(View5, { style: [defaultStyles4.button, styles2?.mainButton], children: renderMainIcon?.({
849
- name: mainIcon,
850
- size: 26,
851
- color: "#FFF"
852
- }) })
895
+ )
853
896
  }
854
897
  ) })
855
898
  ] });
@@ -858,59 +901,26 @@ var FloatingButton = class extends React4.Component {
858
901
  var defaultStyles4 = StyleSheet5.create({
859
902
  container: {
860
903
  position: "absolute",
861
- bottom: 100,
862
- right: 20,
863
904
  alignItems: "center",
864
- justifyContent: "center"
905
+ justifyContent: "center",
906
+ zIndex: 1e3
865
907
  },
866
908
  mainButtonWrapper: {
867
- width: 60,
868
- height: 60,
869
- borderRadius: 30,
870
909
  backgroundColor: "#F02A4B",
871
910
  alignItems: "center",
872
911
  justifyContent: "center",
873
- shadowColor: "#000",
874
- shadowOffset: {
875
- width: 0,
876
- height: 2
877
- },
878
- shadowOpacity: 0.25,
879
- shadowRadius: 3.84,
880
- elevation: 5
912
+ elevation: 8
881
913
  },
882
914
  button: {
883
- width: 60,
884
- height: 60,
885
- borderRadius: 30,
886
915
  backgroundColor: "#F02A4B",
887
916
  alignItems: "center",
888
917
  justifyContent: "center"
889
918
  },
890
- circleContainer: {
891
- position: "absolute",
892
- width: 200,
893
- height: 200,
894
- right: -70,
895
- bottom: -70,
896
- alignItems: "center",
897
- justifyContent: "center"
898
- },
899
919
  secondary: {
900
920
  position: "absolute",
901
- width: 48,
902
- height: 48,
903
- borderRadius: 24,
904
921
  backgroundColor: "#F02A4B",
905
922
  alignItems: "center",
906
923
  justifyContent: "center",
907
- shadowColor: "#000",
908
- shadowOffset: {
909
- width: 0,
910
- height: 2
911
- },
912
- shadowOpacity: 0.25,
913
- shadowRadius: 3.84,
914
924
  elevation: 5
915
925
  }
916
926
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaushverse/pickify",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "A fully customizable React Native picker with search, multi-select, grouping, and async support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",