@knitui/components 1.0.0 → 1.2.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.
Files changed (192) hide show
  1. package/lib/commonjs/ActionIcon/ActionIcon.js +1 -1
  2. package/lib/commonjs/ActionIcon/ActionIcon.js.map +1 -1
  3. package/lib/commonjs/Affix/Affix.js +1 -1
  4. package/lib/commonjs/Affix/Affix.js.map +1 -1
  5. package/lib/commonjs/Alert/Alert.js +1 -1
  6. package/lib/commonjs/Alert/Alert.js.map +1 -1
  7. package/lib/commonjs/Avatar/Avatar.js +1 -1
  8. package/lib/commonjs/Avatar/Avatar.js.map +1 -1
  9. package/lib/commonjs/Badge/Badge.js +1 -1
  10. package/lib/commonjs/Badge/Badge.js.map +1 -1
  11. package/lib/commonjs/Button/Button.js +1 -1
  12. package/lib/commonjs/Button/Button.js.map +1 -1
  13. package/lib/commonjs/CloseButton/CloseButton.js +1 -1
  14. package/lib/commonjs/CloseButton/CloseButton.js.map +1 -1
  15. package/lib/commonjs/Image/Image.js +108 -27
  16. package/lib/commonjs/Image/Image.js.map +1 -1
  17. package/lib/commonjs/Image/createImage.js +26 -0
  18. package/lib/commonjs/Image/createImage.js.map +1 -1
  19. package/lib/commonjs/Image/shared.js +8 -1
  20. package/lib/commonjs/Image/shared.js.map +1 -1
  21. package/lib/commonjs/Input/Input.native.js +15 -6
  22. package/lib/commonjs/Input/Input.native.js.map +1 -1
  23. package/lib/commonjs/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js.map +1 -1
  24. package/lib/commonjs/Modal/drag/DragDismissHost.js +4 -1
  25. package/lib/commonjs/Modal/drag/DragDismissHost.js.map +1 -1
  26. package/lib/commonjs/Modal/drag/DragDismissOverlay.js +4 -1
  27. package/lib/commonjs/Modal/drag/DragDismissOverlay.js.map +1 -1
  28. package/lib/commonjs/Modal/drag/useDragDismiss.js +83 -67
  29. package/lib/commonjs/Modal/drag/useDragDismiss.js.map +1 -1
  30. package/lib/commonjs/Modal/modal-base.js +2 -2
  31. package/lib/commonjs/Modal/modal-base.js.map +1 -1
  32. package/lib/commonjs/Pill/Pill.js +1 -1
  33. package/lib/commonjs/Pill/Pill.js.map +1 -1
  34. package/lib/commonjs/Popover/Popover.shared.js +1 -1
  35. package/lib/commonjs/Popover/Popover.shared.js.map +1 -1
  36. package/lib/commonjs/Portal/OverlayHost.js.map +1 -1
  37. package/lib/commonjs/Portal/OverlayPortal.js +33 -0
  38. package/lib/commonjs/Portal/OverlayPortal.js.map +1 -0
  39. package/lib/commonjs/Portal/index.js +7 -0
  40. package/lib/commonjs/Portal/index.js.map +1 -1
  41. package/lib/commonjs/ScrollArea/ScrollArea.native.js +25 -15
  42. package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
  43. package/lib/commonjs/ThemeIcon/ThemeIcon.js +1 -1
  44. package/lib/commonjs/ThemeIcon/ThemeIcon.js.map +1 -1
  45. package/lib/commonjs/Tooltip/Tooltip.js +1 -1
  46. package/lib/commonjs/Tooltip/Tooltip.js.map +1 -1
  47. package/lib/commonjs/index.js +6 -0
  48. package/lib/commonjs/index.js.map +1 -1
  49. package/lib/commonjs/internal/gradient-shared.js +11 -1
  50. package/lib/commonjs/internal/gradient-shared.js.map +1 -1
  51. package/lib/commonjs/internal/gradient.js +6 -0
  52. package/lib/commonjs/internal/gradient.js.map +1 -1
  53. package/lib/commonjs/internal/gradient.native.js +6 -0
  54. package/lib/commonjs/internal/gradient.native.js.map +1 -1
  55. package/lib/commonjs/internal/use-looping-animation.native.js +1 -1
  56. package/lib/commonjs/internal/use-looping-animation.native.js.map +1 -1
  57. package/lib/module/ActionIcon/ActionIcon.js +2 -2
  58. package/lib/module/ActionIcon/ActionIcon.js.map +1 -1
  59. package/lib/module/Affix/Affix.js +2 -2
  60. package/lib/module/Affix/Affix.js.map +1 -1
  61. package/lib/module/Alert/Alert.js +2 -2
  62. package/lib/module/Alert/Alert.js.map +1 -1
  63. package/lib/module/Avatar/Avatar.js +2 -2
  64. package/lib/module/Avatar/Avatar.js.map +1 -1
  65. package/lib/module/Badge/Badge.js +2 -2
  66. package/lib/module/Badge/Badge.js.map +1 -1
  67. package/lib/module/Button/Button.js +2 -2
  68. package/lib/module/Button/Button.js.map +1 -1
  69. package/lib/module/CloseButton/CloseButton.js +2 -2
  70. package/lib/module/CloseButton/CloseButton.js.map +1 -1
  71. package/lib/module/Image/Image.js +108 -27
  72. package/lib/module/Image/Image.js.map +1 -1
  73. package/lib/module/Image/createImage.js +26 -1
  74. package/lib/module/Image/createImage.js.map +1 -1
  75. package/lib/module/Image/shared.js +7 -0
  76. package/lib/module/Image/shared.js.map +1 -1
  77. package/lib/module/Input/Input.native.js +15 -6
  78. package/lib/module/Input/Input.native.js.map +1 -1
  79. package/lib/module/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js.map +1 -1
  80. package/lib/module/Modal/drag/DragDismissHost.js +4 -1
  81. package/lib/module/Modal/drag/DragDismissHost.js.map +1 -1
  82. package/lib/module/Modal/drag/DragDismissOverlay.js +4 -1
  83. package/lib/module/Modal/drag/DragDismissOverlay.js.map +1 -1
  84. package/lib/module/Modal/drag/useDragDismiss.js +84 -68
  85. package/lib/module/Modal/drag/useDragDismiss.js.map +1 -1
  86. package/lib/module/Modal/modal-base.js +3 -3
  87. package/lib/module/Modal/modal-base.js.map +1 -1
  88. package/lib/module/Pill/Pill.js +2 -2
  89. package/lib/module/Pill/Pill.js.map +1 -1
  90. package/lib/module/Popover/Popover.shared.js +2 -2
  91. package/lib/module/Popover/Popover.shared.js.map +1 -1
  92. package/lib/module/Portal/OverlayHost.js.map +1 -1
  93. package/lib/module/Portal/OverlayPortal.js +28 -0
  94. package/lib/module/Portal/OverlayPortal.js.map +1 -0
  95. package/lib/module/Portal/index.js +4 -0
  96. package/lib/module/Portal/index.js.map +1 -1
  97. package/lib/module/ScrollArea/ScrollArea.native.js +26 -16
  98. package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
  99. package/lib/module/ThemeIcon/ThemeIcon.js +2 -2
  100. package/lib/module/ThemeIcon/ThemeIcon.js.map +1 -1
  101. package/lib/module/Tooltip/Tooltip.js +2 -2
  102. package/lib/module/Tooltip/Tooltip.js.map +1 -1
  103. package/lib/module/index.js +1 -1
  104. package/lib/module/index.js.map +1 -1
  105. package/lib/module/internal/gradient-shared.js +9 -0
  106. package/lib/module/internal/gradient-shared.js.map +1 -1
  107. package/lib/module/internal/gradient.js +2 -0
  108. package/lib/module/internal/gradient.js.map +1 -1
  109. package/lib/module/internal/gradient.native.js +2 -0
  110. package/lib/module/internal/gradient.native.js.map +1 -1
  111. package/lib/module/internal/use-looping-animation.native.js +1 -1
  112. package/lib/module/internal/use-looping-animation.native.js.map +1 -1
  113. package/lib/typescript/ActionIcon/ActionIcon.d.ts.map +1 -1
  114. package/lib/typescript/Alert/Alert.d.ts.map +1 -1
  115. package/lib/typescript/Avatar/Avatar.d.ts +14 -14
  116. package/lib/typescript/Avatar/Avatar.d.ts.map +1 -1
  117. package/lib/typescript/Badge/Badge.d.ts.map +1 -1
  118. package/lib/typescript/Button/Button.d.ts.map +1 -1
  119. package/lib/typescript/CloseButton/CloseButton.d.ts.map +1 -1
  120. package/lib/typescript/Image/Image.d.ts +14 -14
  121. package/lib/typescript/Image/Image.d.ts.map +1 -1
  122. package/lib/typescript/Image/Image.native.d.ts +14 -14
  123. package/lib/typescript/Image/createImage.d.ts +25 -18
  124. package/lib/typescript/Image/createImage.d.ts.map +1 -1
  125. package/lib/typescript/Image/index.d.ts +1 -1
  126. package/lib/typescript/Image/index.d.ts.map +1 -1
  127. package/lib/typescript/Image/shared.d.ts +6 -0
  128. package/lib/typescript/Image/shared.d.ts.map +1 -1
  129. package/lib/typescript/Image/types.d.ts +54 -0
  130. package/lib/typescript/Image/types.d.ts.map +1 -1
  131. package/lib/typescript/Input/Input.native.d.ts +21 -21
  132. package/lib/typescript/Input/Input.native.d.ts.map +1 -1
  133. package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.native.d.ts +2 -2
  134. package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.native.d.ts +12 -18
  135. package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.native.d.ts.map +1 -1
  136. package/lib/typescript/Modal/drag/DragDismissHost.d.ts.map +1 -1
  137. package/lib/typescript/Modal/drag/DragDismissOverlay.d.ts.map +1 -1
  138. package/lib/typescript/Modal/drag/useDragDismiss.d.ts +2 -2
  139. package/lib/typescript/Modal/drag/useDragDismiss.d.ts.map +1 -1
  140. package/lib/typescript/Modal/modal-base-inner.native.d.ts +2 -2
  141. package/lib/typescript/Modal/modal-base-inner.native.d.ts.map +1 -1
  142. package/lib/typescript/Pill/Pill.d.ts.map +1 -1
  143. package/lib/typescript/Portal/OverlayHost.d.ts +2 -2
  144. package/lib/typescript/Portal/OverlayHost.d.ts.map +1 -1
  145. package/lib/typescript/Portal/OverlayPortal.d.ts +19 -0
  146. package/lib/typescript/Portal/OverlayPortal.d.ts.map +1 -0
  147. package/lib/typescript/Portal/index.d.ts +4 -0
  148. package/lib/typescript/Portal/index.d.ts.map +1 -1
  149. package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
  150. package/lib/typescript/ThemeIcon/ThemeIcon.d.ts.map +1 -1
  151. package/lib/typescript/index.d.ts +2 -2
  152. package/lib/typescript/index.d.ts.map +1 -1
  153. package/lib/typescript/internal/gradient-shared.d.ts +1 -0
  154. package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
  155. package/lib/typescript/internal/gradient.d.ts +1 -0
  156. package/lib/typescript/internal/gradient.d.ts.map +1 -1
  157. package/lib/typescript/internal/gradient.native.d.ts +1 -0
  158. package/lib/typescript/internal/gradient.native.d.ts.map +1 -1
  159. package/lib/typescript/internal/use-looping-animation.native.d.ts +2 -2
  160. package/lib/typescript/internal/use-looping-animation.native.d.ts.map +1 -1
  161. package/package.json +12 -12
  162. package/src/ActionIcon/ActionIcon.tsx +2 -2
  163. package/src/Affix/Affix.tsx +2 -2
  164. package/src/Alert/Alert.tsx +2 -2
  165. package/src/Avatar/Avatar.tsx +2 -2
  166. package/src/Badge/Badge.tsx +2 -2
  167. package/src/Button/Button.tsx +2 -2
  168. package/src/CloseButton/CloseButton.tsx +2 -2
  169. package/src/Image/Image.tsx +109 -23
  170. package/src/Image/createImage.tsx +26 -0
  171. package/src/Image/index.ts +1 -1
  172. package/src/Image/shared.ts +14 -0
  173. package/src/Image/types.ts +57 -1
  174. package/src/Input/Input.native.tsx +22 -7
  175. package/src/KeyboardAwareScrollView/KeyboardAwareScrollView.native.tsx +33 -32
  176. package/src/Modal/drag/DragDismissHost.tsx +10 -5
  177. package/src/Modal/drag/DragDismissOverlay.tsx +9 -5
  178. package/src/Modal/drag/useDragDismiss.ts +29 -21
  179. package/src/Modal/modal-base.tsx +4 -4
  180. package/src/Pill/Pill.tsx +2 -2
  181. package/src/Popover/Popover.shared.tsx +3 -3
  182. package/src/Portal/OverlayHost.tsx +4 -4
  183. package/src/Portal/OverlayPortal.tsx +26 -0
  184. package/src/Portal/index.ts +4 -0
  185. package/src/ScrollArea/ScrollArea.native.tsx +39 -33
  186. package/src/ThemeIcon/ThemeIcon.tsx +2 -2
  187. package/src/Tooltip/Tooltip.tsx +3 -3
  188. package/src/index.ts +11 -1
  189. package/src/internal/gradient-shared.ts +13 -0
  190. package/src/internal/gradient.native.tsx +1 -0
  191. package/src/internal/gradient.tsx +1 -0
  192. package/src/internal/use-looping-animation.native.tsx +2 -2
@@ -1,6 +1,10 @@
1
1
  import * as React from "react";
2
- import { RefreshControl, type ScrollView } from "react-native";
3
- import { Gesture, GestureDetector } from "react-native-gesture-handler";
2
+ import { RefreshControl, type ScrollViewInstance } from "react-native";
3
+ import {
4
+ GestureDetector,
5
+ type PanGestureConfig,
6
+ usePanGesture,
7
+ } from "react-native-gesture-handler";
4
8
  import Animated, {
5
9
  cancelAnimation,
6
10
  useAnimatedReaction,
@@ -329,7 +333,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
329
333
  const reducedMotion = useReducedMotion();
330
334
 
331
335
  // The live native scroller (Autosize only; the Pan engine has none).
332
- const scrollViewRef = React.useRef<ScrollView | null>(null);
336
+ const scrollViewRef = React.useRef<ScrollViewInstance | null>(null);
333
337
 
334
338
  // ── UI-thread state (shared values) ──────────────────────────────────────
335
339
  // Scroll offset lives here, not in React state: the thumb worklet reads it every
@@ -565,19 +569,16 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
565
569
 
566
570
  /* ---------------- native (Autosize) scroll handler ---------------- */
567
571
 
568
- const scrollHandler = useAnimatedScrollHandler(
569
- {
570
- onScroll: (event) => {
571
- "worklet";
572
- scrollX.value = event.contentOffset.x;
573
- scrollY.value = event.contentOffset.y;
574
- if (needsJsScroll && shouldReportW(lastReportSV, reportIntervalMs)) {
575
- runOnJS(reportScroll)(event.contentOffset.x, event.contentOffset.y);
576
- }
577
- },
572
+ const scrollHandler = useAnimatedScrollHandler({
573
+ onScroll: (event) => {
574
+ "worklet";
575
+ scrollX.value = event.contentOffset.x;
576
+ scrollY.value = event.contentOffset.y;
577
+ if (needsJsScroll && shouldReportW(lastReportSV, reportIntervalMs)) {
578
+ runOnJS(reportScroll)(event.contentOffset.x, event.contentOffset.y);
579
+ }
578
580
  },
579
- [needsJsScroll, reportIntervalMs, lastReportSV, reportScroll],
580
- );
581
+ });
581
582
 
582
583
  /* ---------------- Pan engine ---------------- */
583
584
 
@@ -615,21 +616,28 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
615
616
  },
616
617
  );
617
618
 
618
- const panGesture = React.useMemo(() => {
619
- let g = Gesture.Pan()
620
- .onBegin(() => {
619
+ // RNGH 3 hook API: the config object is memoized so its identity (which drives
620
+ // the handler re-configuration) only changes with the inputs it closes over.
621
+ const panConfig = React.useMemo(
622
+ (): PanGestureConfig => ({
623
+ // Only claim the axes we actually scroll, so a cross-axis drag (and a tap)
624
+ // passes through to ancestors / pressable children. Spread conditionally:
625
+ // an `undefined` offset key would be forwarded to the native config.
626
+ ...(axes.x ? { activeOffsetX: [-PAN_ACTIVATE_THRESHOLD, PAN_ACTIVATE_THRESHOLD] } : null),
627
+ ...(axes.y ? { activeOffsetY: [-PAN_ACTIVATE_THRESHOLD, PAN_ACTIVATE_THRESHOLD] } : null),
628
+ onBegin: () => {
621
629
  "worklet";
622
630
  cancelAnimation(scrollX);
623
631
  cancelAnimation(scrollY);
624
632
  panStartX.value = scrollX.value;
625
633
  panStartY.value = scrollY.value;
626
- })
627
- .onUpdate((e) => {
634
+ },
635
+ onUpdate: (e) => {
628
636
  "worklet";
629
637
  scrollX.value = clampW(panStartX.value - e.translationX, 0, maxXSV.value);
630
638
  scrollY.value = clampW(panStartY.value - e.translationY, 0, maxYSV.value);
631
- })
632
- .onEnd((e) => {
639
+ },
640
+ onDeactivate: (e) => {
633
641
  "worklet";
634
642
  // No momentum under reduced motion — settle where the finger lifted.
635
643
  if (reducedMotion) return;
@@ -647,13 +655,11 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
647
655
  rubberBandEffect: false,
648
656
  });
649
657
  }
650
- });
651
- // Only claim the axes we actually scroll, so a cross-axis drag (and a tap)
652
- // passes through to ancestors / pressable children.
653
- if (axes.x) g = g.activeOffsetX([-PAN_ACTIVATE_THRESHOLD, PAN_ACTIVATE_THRESHOLD]);
654
- if (axes.y) g = g.activeOffsetY([-PAN_ACTIVATE_THRESHOLD, PAN_ACTIVATE_THRESHOLD]);
655
- return g;
656
- }, [axes.x, axes.y, reducedMotion, scrollX, scrollY, panStartX, panStartY, maxXSV, maxYSV]);
658
+ },
659
+ }),
660
+ [axes.x, axes.y, reducedMotion, scrollX, scrollY, panStartX, panStartY, maxXSV, maxYSV],
661
+ );
662
+ const panGesture = usePanGesture(panConfig);
657
663
 
658
664
  /* ---------------- geometry (layout decisions, JS) ---------------- */
659
665
 
@@ -832,7 +838,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
832
838
  "worklet";
833
839
  const { offset } = thumbGeometryW(size.contentH, size.viewportH, yTrack, scrollY.value);
834
840
  return { transform: [{ translateY: offset }] };
835
- }, [size.contentH, size.viewportH, yTrack]);
841
+ });
836
842
 
837
843
  const yThumbInsetStyle = useAnimatedStyle(() => {
838
844
  "worklet";
@@ -843,7 +849,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
843
849
  "worklet";
844
850
  const { offset } = thumbGeometryW(size.contentW, size.viewportW, xTrack, scrollX.value);
845
851
  return { transform: [{ translateX: offset }] };
846
- }, [size.contentW, size.viewportW, xTrack]);
852
+ });
847
853
 
848
854
  const xThumbInsetStyle = useAnimatedStyle(() => {
849
855
  "worklet";
@@ -903,7 +909,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
903
909
  showsHorizontalScrollIndicator: false,
904
910
  scrollEventThrottle: 16,
905
911
  nestedScrollEnabled: true,
906
- keyboardShouldPersistTaps,
912
+ keyboardShouldPersistTaps: keyboardShouldPersistTaps as never,
907
913
  ...(onRefresh
908
914
  ? {
909
915
  refreshControl: (
@@ -918,7 +924,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
918
924
  ...(mergedViewportProps as object),
919
925
  };
920
926
 
921
- const assignScroller = (node: ScrollView | null) => {
927
+ const assignScroller = (node: ScrollViewInstance | null) => {
922
928
  scrollViewRef.current = node;
923
929
  assignRef(viewportRef, node as unknown as TamaguiElement);
924
930
  };
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  import { Box } from "../Box";
12
12
  import { ControlIconProvider } from "../internal/ControlIconProvider";
13
- import { type GradientValue, useGradient } from "../internal/gradient";
13
+ import { gradientForVariant, type GradientValue, useGradient } from "../internal/gradient";
14
14
  import {
15
15
  pickVariants,
16
16
  radiusVariant,
@@ -99,7 +99,7 @@ const ThemeIconComponent = styleable<ThemeIconProps>(
99
99
 
100
100
  // Gradient fill (only when `variant="gradient"`): web paints a CSS
101
101
  // `backgroundImage`; native renders the `layer` (an SVG fill) behind the icon.
102
- const grad = useGradient(variant === "gradient" ? gradient : undefined);
102
+ const grad = useGradient(gradientForVariant(variant, gradient));
103
103
 
104
104
  return (
105
105
  <ThemeIconFrame ref={ref} variant={variant} size={size} {...grad.frameProps} {...rest}>
@@ -35,7 +35,7 @@ import { type MotionPresetName } from "../internal/motion";
35
35
  import { useOverlayChrome } from "../internal/overlay-chrome";
36
36
  import { type RadiusValue, radiusVariant, shadowVariant } from "../internal/style-props";
37
37
  import { type SlotStyles } from "../internal/styles";
38
- import { Portal, useOverlayHost } from "../Portal";
38
+ import { OverlayPortal, useOverlayHost } from "../Portal";
39
39
  import { Text } from "../Text";
40
40
  import {
41
41
  type OverlayTransitionConfig,
@@ -592,7 +592,7 @@ const TooltipBase = styleable<TooltipProps>(TooltipLabelFrame, function Tooltip(
592
592
  const dropdownSlot = s.get("dropdown");
593
593
 
594
594
  const labelNode = !t.rendered ? null : (
595
- <Portal hostName={withinPortal ? overlayHost : undefined}>
595
+ <OverlayPortal hostName={withinPortal ? overlayHost : undefined}>
596
596
  <Theme name={themeName}>
597
597
  <TooltipLabelFrame
598
598
  ref={floatingRef}
@@ -648,7 +648,7 @@ const TooltipBase = styleable<TooltipProps>(TooltipLabelFrame, function Tooltip(
648
648
  ) : null}
649
649
  </TooltipLabelFrame>
650
650
  </Theme>
651
- </Portal>
651
+ </OverlayPortal>
652
652
  );
653
653
 
654
654
  return (
package/src/index.ts CHANGED
@@ -216,7 +216,15 @@ export {
216
216
  type HoverCardTargetProps,
217
217
  type HoverCardWidth,
218
218
  } from "./HoverCard";
219
- export { createImage, Image, type ImageProps, type ImageStyles, type ImageType } from "./Image";
219
+ export {
220
+ createImage,
221
+ Image,
222
+ type ImageProps,
223
+ type ImageStyles,
224
+ type ImageType,
225
+ type ImageWebProps,
226
+ type ImageWebSource,
227
+ } from "./Image";
220
228
  export {
221
229
  Indicator,
222
230
  type IndicatorPosition,
@@ -412,6 +420,8 @@ export {
412
420
  export {
413
421
  OverlayHost,
414
422
  type OverlayHostProps,
423
+ OverlayPortal,
424
+ type OverlayPortalProps,
415
425
  Portal,
416
426
  PortalHost,
417
427
  type PortalHostProps,
@@ -65,6 +65,19 @@ const DEFAULT_FROM = "color5";
65
65
  const DEFAULT_TO = "color9";
66
66
  const DEFAULT_DEG = 45;
67
67
 
68
+ /**
69
+ * The gradient a component paints for its `variant` / `gradient` props: `undefined`
70
+ * unless `variant="gradient"`, and the theme-ramp default (`color5` → `color9` at
71
+ * 45°) when the variant is set without a `gradient` prop. A shared frozen object,
72
+ * so the default keeps a stable identity across renders.
73
+ */
74
+ const DEFAULT_GRADIENT: GradientValue = Object.freeze({});
75
+ export const gradientForVariant = (
76
+ variant: unknown,
77
+ gradient: GradientValue | undefined,
78
+ ): GradientValue | undefined =>
79
+ variant === "gradient" ? (gradient ?? DEFAULT_GRADIENT) : undefined;
80
+
68
81
  /** The resolved angle, defaulting to Mantine's 45°. */
69
82
  export const gradientDeg = (gradient: GradientValue): number => gradient.deg ?? DEFAULT_DEG;
70
83
 
@@ -27,6 +27,7 @@ import type { GradientResult, GradientValue } from "./gradient-shared";
27
27
  import { degToSvgCoords, gradientDeg, resolveStops } from "./gradient-shared";
28
28
 
29
29
  export type { GradientStop, GradientValue } from "./gradient-shared";
30
+ export { gradientForVariant } from "./gradient-shared";
30
31
 
31
32
  /**
32
33
  * The no-gradient result, shared and frozen so the (overwhelmingly common)
@@ -20,6 +20,7 @@ import type { GradientResult, GradientValue } from "./gradient-shared";
20
20
  import { gradientToCss } from "./gradient-shared";
21
21
 
22
22
  export type { GradientStop, GradientValue } from "./gradient-shared";
23
+ export { gradientForVariant } from "./gradient-shared";
23
24
 
24
25
  /**
25
26
  * The no-gradient result, shared and frozen so the (overwhelmingly common)
@@ -28,7 +28,7 @@ type Easer = EasingFunction | EasingFunctionFactory;
28
28
  * worklet output) drives on the UI thread. Mirrors `LoopView` on web (a `Box`); the
29
29
  * spread API (`<LoopView {...loop} />`) is identical across platforms.
30
30
  */
31
- export const LoopView = Animated.View;
31
+ export const LoopView: typeof Animated.View = Animated.View;
32
32
 
33
33
  /**
34
34
  * Promote a frame component into a reanimated host so a {@link useLoopingAnimation}
@@ -116,7 +116,7 @@ export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
116
116
  // shimmer
117
117
  const offset = progress.value * distance;
118
118
  return { transform: axis === "y" ? [{ translateY: offset }] : [{ translateX: offset }] };
119
- }, [reduced, kind, minOpacity, distance, axis]);
119
+ });
120
120
 
121
121
  return { style };
122
122
  }