@appfunnel-dev/sdk 0.11.0 → 0.12.0

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.
@@ -572,10 +572,12 @@ interface SingleSelectProps<T> {
572
572
  autoAdvance?: boolean;
573
573
  /** Delay in ms before auto-advancing (default: 200) */
574
574
  autoAdvanceDelay?: number;
575
+ /** Tap/click animation style (default: "none") */
576
+ clickAnimation?: 'none' | 'shrink' | 'grow';
575
577
  /** Container className */
576
578
  className?: string;
577
579
  }
578
- declare function SingleSelect<T>({ responseKey, options, keyExtractor, renderItem, autoAdvance, autoAdvanceDelay, className, }: SingleSelectProps<T>): react_jsx_runtime.JSX.Element;
580
+ declare function SingleSelect<T>({ responseKey, options, keyExtractor, renderItem, autoAdvance, autoAdvanceDelay, clickAnimation, className, }: SingleSelectProps<T>): react_jsx_runtime.JSX.Element;
579
581
 
580
582
  interface MultiSelectProps<T> {
581
583
  /** The response key to store the selected values under (in answers.*) */
@@ -594,10 +596,12 @@ interface MultiSelectProps<T> {
594
596
  min?: number;
595
597
  /** Maximum number of selections allowed (default: unlimited) */
596
598
  max?: number;
599
+ /** Tap/click animation style (default: "none") */
600
+ clickAnimation?: 'none' | 'shrink' | 'grow';
597
601
  /** Container className */
598
602
  className?: string;
599
603
  }
600
- declare function MultiSelect<T>({ responseKey, options, keyExtractor, renderItem, min, max, className, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
604
+ declare function MultiSelect<T>({ responseKey, options, keyExtractor, renderItem, min, max, clickAnimation, className, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
601
605
 
602
606
  interface LoadingProps {
603
607
  /** Spinner color (default: currentColor, inherits from parent) */
@@ -572,10 +572,12 @@ interface SingleSelectProps<T> {
572
572
  autoAdvance?: boolean;
573
573
  /** Delay in ms before auto-advancing (default: 200) */
574
574
  autoAdvanceDelay?: number;
575
+ /** Tap/click animation style (default: "none") */
576
+ clickAnimation?: 'none' | 'shrink' | 'grow';
575
577
  /** Container className */
576
578
  className?: string;
577
579
  }
578
- declare function SingleSelect<T>({ responseKey, options, keyExtractor, renderItem, autoAdvance, autoAdvanceDelay, className, }: SingleSelectProps<T>): react_jsx_runtime.JSX.Element;
580
+ declare function SingleSelect<T>({ responseKey, options, keyExtractor, renderItem, autoAdvance, autoAdvanceDelay, clickAnimation, className, }: SingleSelectProps<T>): react_jsx_runtime.JSX.Element;
579
581
 
580
582
  interface MultiSelectProps<T> {
581
583
  /** The response key to store the selected values under (in answers.*) */
@@ -594,10 +596,12 @@ interface MultiSelectProps<T> {
594
596
  min?: number;
595
597
  /** Maximum number of selections allowed (default: unlimited) */
596
598
  max?: number;
599
+ /** Tap/click animation style (default: "none") */
600
+ clickAnimation?: 'none' | 'shrink' | 'grow';
597
601
  /** Container className */
598
602
  className?: string;
599
603
  }
600
- declare function MultiSelect<T>({ responseKey, options, keyExtractor, renderItem, min, max, className, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
604
+ declare function MultiSelect<T>({ responseKey, options, keyExtractor, renderItem, min, max, clickAnimation, className, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
601
605
 
602
606
  interface LoadingProps {
603
607
  /** Spinner color (default: currentColor, inherits from parent) */
@@ -12059,6 +12059,7 @@ function SingleSelect({
12059
12059
  renderItem,
12060
12060
  autoAdvance = true,
12061
12061
  autoAdvanceDelay = 200,
12062
+ clickAnimation = "none",
12062
12063
  className
12063
12064
  }) {
12064
12065
  const [selected, setSelected] = useResponse(responseKey);
@@ -12085,7 +12086,16 @@ function SingleSelect({
12085
12086
  return /* @__PURE__ */ jsx("div", { className, children: options.map((item, index) => {
12086
12087
  const key = getKey(item, index);
12087
12088
  const active = selected === key;
12088
- return /* @__PURE__ */ jsx("div", { onClick: () => handleSelect(key), style: { cursor: "pointer" }, children: renderItem({ item, index, active }) }, key);
12089
+ return /* @__PURE__ */ jsx(
12090
+ motion.div,
12091
+ {
12092
+ onClick: () => handleSelect(key),
12093
+ style: { cursor: "pointer" },
12094
+ ...clickAnimation !== "none" ? { whileTap: { scale: clickAnimation === "shrink" ? 0.95 : 1.05 }, transition: { duration: 0.15 } } : {},
12095
+ children: renderItem({ item, index, active })
12096
+ },
12097
+ key
12098
+ );
12089
12099
  }) });
12090
12100
  }
12091
12101
  function MultiSelect({
@@ -12095,6 +12105,7 @@ function MultiSelect({
12095
12105
  renderItem,
12096
12106
  min = 0,
12097
12107
  max,
12108
+ clickAnimation = "none",
12098
12109
  className
12099
12110
  }) {
12100
12111
  const [selected, setSelected] = useResponse(responseKey);
@@ -12127,7 +12138,16 @@ function MultiSelect({
12127
12138
  return /* @__PURE__ */ jsx("div", { className, children: options.map((item, index) => {
12128
12139
  const key = getKey(item, index);
12129
12140
  const active = currentSelection.includes(key);
12130
- return /* @__PURE__ */ jsx("div", { onClick: () => handleToggle(key), style: { cursor: "pointer" }, children: renderItem({ item, index, active }) }, key);
12141
+ return /* @__PURE__ */ jsx(
12142
+ motion.div,
12143
+ {
12144
+ onClick: () => handleToggle(key),
12145
+ style: { cursor: "pointer" },
12146
+ ...clickAnimation !== "none" ? { whileTap: { scale: clickAnimation === "shrink" ? 0.95 : 1.05 }, transition: { duration: 0.15 } } : {},
12147
+ children: renderItem({ item, index, active })
12148
+ },
12149
+ key
12150
+ );
12131
12151
  }) });
12132
12152
  }
12133
12153
  var SIZE = {