@ankhorage/zora 28.5.2 → 28.6.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 (77) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -1
  3. package/dist/capabilities/index.js +73 -3
  4. package/dist/capabilities/index.js.map +3 -3
  5. package/dist/features/carousel/Carousel.d.ts.map +1 -1
  6. package/dist/features/carousel/Carousel.js +85 -8
  7. package/dist/features/carousel/Carousel.js.map +1 -1
  8. package/dist/features/form/select/adapters/inbound/Select.native.d.ts.map +1 -1
  9. package/dist/features/form/select/adapters/inbound/Select.native.js +71 -8
  10. package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -1
  11. package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -1
  12. package/dist/features/form/select/adapters/inbound/Select.web.js +5 -3
  13. package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -1
  14. package/dist/features/form/select/composition/SelectSearchInput.d.ts +10 -0
  15. package/dist/features/form/select/composition/SelectSearchInput.d.ts.map +1 -0
  16. package/dist/features/form/select/composition/SelectSearchInput.js +11 -0
  17. package/dist/features/form/select/composition/SelectSearchInput.js.map +1 -0
  18. package/dist/features/form/select/composition/getVisibleSelectOptions.d.ts +4 -0
  19. package/dist/features/form/select/composition/getVisibleSelectOptions.d.ts.map +1 -0
  20. package/dist/features/form/select/composition/getVisibleSelectOptions.js +8 -0
  21. package/dist/features/form/select/composition/getVisibleSelectOptions.js.map +1 -0
  22. package/dist/features/form/select/composition/useSelectController.d.ts +3 -0
  23. package/dist/features/form/select/composition/useSelectController.d.ts.map +1 -1
  24. package/dist/features/form/select/composition/useSelectController.js +11 -2
  25. package/dist/features/form/select/composition/useSelectController.js.map +1 -1
  26. package/dist/features/form/select/selectMeta.d.ts +99 -1
  27. package/dist/features/form/select/selectMeta.d.ts.map +1 -1
  28. package/dist/features/form/select/selectMeta.js +71 -1
  29. package/dist/features/form/select/selectMeta.js.map +1 -1
  30. package/dist/features/registry/bindableComponentMeta.d.ts +79 -1
  31. package/dist/features/registry/bindableComponentMeta.d.ts.map +1 -1
  32. package/dist/features/registry/bindableComponentMeta.js +59 -1
  33. package/dist/features/registry/bindableComponentMeta.js.map +1 -1
  34. package/dist/types/select.d.ts +10 -0
  35. package/dist/types/select.d.ts.map +1 -1
  36. package/dist/types/select.js.map +1 -1
  37. package/package.json +29 -3
  38. package/src/features/carousel/Carousel.test.ts +243 -7
  39. package/src/features/carousel/Carousel.tsx +135 -26
  40. package/src/features/form/select/adapters/inbound/Select.native.test.tsx +322 -0
  41. package/src/features/form/select/adapters/inbound/Select.native.tsx +135 -13
  42. package/src/features/form/select/adapters/inbound/Select.web.tsx +6 -3
  43. package/src/features/form/select/composition/SelectSearchInput.tsx +33 -0
  44. package/src/features/form/select/composition/getVisibleSelectOptions.test.ts +22 -0
  45. package/src/features/form/select/composition/getVisibleSelectOptions.ts +13 -0
  46. package/src/features/form/select/composition/useSelectController.ts +25 -2
  47. package/src/features/form/select/public.test.ts +31 -1
  48. package/src/features/form/select/selectMeta.ts +71 -1
  49. package/src/features/registry/bindableComponentMeta.test.ts +6 -0
  50. package/src/features/registry/bindableComponentMeta.ts +59 -1
  51. package/src/features/registry/featureManifest.test.ts +10 -0
  52. package/src/types/select.ts +10 -0
  53. package/web-dist/chunks/{Accordion-sj1n06dw.js → Accordion-9dk62zn9.js} +84 -24
  54. package/web-dist/chunks/Accordion-ar8qe05j.js +53 -0
  55. package/web-dist/chunks/{Accordion-ge7cjtwy.js → Accordion-mpb070cf.js} +3 -3
  56. package/web-dist/chunks/{Accordion-554f42yj.js → Accordion-sj30964p.js} +4 -4
  57. package/web-dist/chunks/{Accordion-2bygfpwg.js → Accordion-xhxv2v0g.js} +62 -2
  58. package/web-dist/chunks/{RichTextClient-70qt7037.js → RichTextClient-7qqj2dpw.js} +3 -4
  59. package/web-dist/components/auth-screen/AuthScreen.js +2 -3
  60. package/web-dist/components/carousel/Carousel.js +97 -24
  61. package/web-dist/components/color-hue-scale/ColorHueScale.js +4 -3
  62. package/web-dist/components/color-picker/ColorPicker.js +4 -3
  63. package/web-dist/components/color-tone/ColorTone.js +4 -3
  64. package/web-dist/components/color-wheel/ColorWheel.js +4 -3
  65. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +2 -3
  66. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +2 -3
  67. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +2 -3
  68. package/web-dist/components/otp-form/OtpForm.js +2 -3
  69. package/web-dist/components/rich-text/RichText.js +2 -2
  70. package/web-dist/components/search-input/SearchInput.js +5 -52
  71. package/web-dist/components/select/Select.js +3 -1
  72. package/web-dist/components/select/Select.types-0.d.ts +10 -0
  73. package/web-dist/components/sign-in-form/SignInForm.js +2 -3
  74. package/web-dist/components/sign-up-form/SignUpForm.js +2 -3
  75. package/web-dist/components/text-input/TextInput.js +4 -5
  76. package/web-dist/manifest.json +39 -41
  77. package/web-dist/chunks/Accordion-49d0frg7.js +0 -66
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/features/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAqC,MAAM,sBAAsB,CAAC;AAI7F;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EACV,UAAmB,EACnB,eAAsB,EACtB,cAAoB,EACpB,YAAmB,EACnB,cAAsB,EACtB,aAAa,EACb,YAAmB,EACnB,cAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,aAAgC,EAChC,SAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAoB,EACpB,UAAU,EACV,KAAK,EACL,WAAW,EACX,MAAM,GACP,EAAE,aAAa,4BA6Ff"}
1
+ {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/features/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAqC,MAAM,sBAAsB,CAAC;AAI7F;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EACV,UAAmB,EACnB,eAAsB,EACtB,cAAoB,EACpB,YAAmB,EACnB,cAAsB,EACtB,aAAa,EACb,YAAmB,EACnB,cAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,aAAgC,EAChC,SAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAoB,EACpB,UAAU,EACV,KAAK,EACL,WAAW,EACX,MAAM,GACP,EAAE,aAAa,4BAkJf"}
@@ -9,6 +9,10 @@ import { useCarouselPlayback } from './useCarouselPlayback';
9
9
  export function Carousel({ slides, index, defaultIndex, onIndexChange, autoPlay, paused, loop, intervalMs, transition = 'fade', enterDurationMs = 1200, exitDurationMs = 800, initialScale = 1.06, animateOnMount = false, reducedMotion, showProgress = true, progressHeight = 4, progressTrackColor, progressIndicatorColor, progressTrackStyle, progressIndicatorStyle, showArrows = false, showIndicators = false, previousLabel = 'Previous slide', nextLabel = 'Next slide', controlColor, controlBackgroundColor, controlsStyle, activeIndicatorColor, inactiveIndicatorColor, indicatorsStyle, resizeMode = 'cover', imageStyle, style, renderImage, testID, }) {
10
10
  const { theme } = useZoraTheme();
11
11
  const [width, setWidth] = React.useState(0);
12
+ const initialIndex = normalizeSlideIndex(index ?? defaultIndex ?? 0, slides.length);
13
+ const initialSlide = slides.at(initialIndex);
14
+ const [mountedSlideKeys, setMountedSlideKeys] = React.useState(() => initialSlide ? new Set([initialSlide.key]) : new Set());
15
+ const [readySlideKeys, setReadySlideKeys] = React.useState(() => new Set());
12
16
  const { activeIndex, controlledWithoutHandler, direction, loop: enabledLoop, navigate, progress, shouldReduceMotion, } = useCarouselPlayback({
13
17
  slides,
14
18
  index,
@@ -20,6 +24,26 @@ export function Carousel({ slides, index, defaultIndex, onIndexChange, autoPlay,
20
24
  intervalMs,
21
25
  reducedMotion,
22
26
  });
27
+ const activeSlide = slides.at(activeIndex);
28
+ const nextIndex = getNextSlideIndex(activeIndex, slides.length, enabledLoop);
29
+ const nextSlide = nextIndex === undefined ? undefined : slides.at(nextIndex);
30
+ const activeSlideKey = activeSlide?.key;
31
+ const nextSlideKey = nextSlide?.key;
32
+ const mountedKeys = ensureMountedSlide(ensureMountedSlide(mountedSlideKeys, activeSlideKey), getPreloadedSlideKey(activeSlideKey, nextSlideKey, readySlideKeys));
33
+ const markSlideLoaded = React.useCallback((slideKey) => {
34
+ setReadySlideKeys((current) => ensureMountedSlide(current, slideKey));
35
+ if (slideKey === activeSlideKey) {
36
+ setMountedSlideKeys((current) => ensureMountedSlide(current, nextSlideKey));
37
+ }
38
+ }, [activeSlideKey, nextSlideKey]);
39
+ const completeTransition = React.useCallback((completedSlideKey) => {
40
+ if (!activeSlideKey || completedSlideKey !== activeSlideKey)
41
+ return;
42
+ const transitionRetentionKeys = [activeSlideKey, nextSlideKey].filter((slideKey) => slideKey !== undefined);
43
+ setMountedSlideKeys((current) => new Set(transitionRetentionKeys.filter((slideKey) => slideKey === activeSlideKey ||
44
+ current.has(slideKey) ||
45
+ readySlideKeys.has(activeSlideKey))));
46
+ }, [activeSlideKey, nextSlideKey, readySlideKeys]);
23
47
  if (slides.length === 0)
24
48
  return null;
25
49
  const canPrevious = enabledLoop || activeIndex > 0;
@@ -27,18 +51,26 @@ export function Carousel({ slides, index, defaultIndex, onIndexChange, autoPlay,
27
51
  const markerColor = activeIndicatorColor ?? theme.colors.primary;
28
52
  const idleMarkerColor = inactiveIndicatorColor ?? theme.semantics.neutral.divider;
29
53
  return (<View onLayout={(event) => setWidth(event.nativeEvent.layout.width)} testID={testID} style={[{ position: 'relative', overflow: 'hidden', width: '100%', height: '100%' }, style]}>
30
- {slides.map((slide, slideIndex) => (<CarouselLayer key={slide.key} active={activeIndex === slideIndex} animate={slides.length > 1} animateOnMount={animateOnMount} direction={direction} enterDurationMs={enterDurationMs} exitDurationMs={exitDurationMs} imageStyle={imageStyle} initialScale={initialScale} reducedMotion={shouldReduceMotion} renderImage={renderImage} resizeMode={resizeMode} slide={slide} slideIndex={slideIndex} transition={transition} width={width}/>))}
54
+ {slides.flatMap((slide, slideIndex) => mountedKeys.has(slide.key)
55
+ ? [
56
+ <CarouselLayer key={slide.key} active={activeIndex === slideIndex} animate={slides.length > 1} animateOnMount={animateOnMount || activeIndex !== initialIndex} direction={direction} enterDurationMs={enterDurationMs} exitDurationMs={exitDurationMs} imageStyle={imageStyle} initialScale={initialScale} onImageLoad={() => markSlideLoaded(slide.key)} onTransitionComplete={completeTransition} reducedMotion={shouldReduceMotion} renderImage={renderImage} resizeMode={resizeMode} slide={slide} slideIndex={slideIndex} transition={transition} width={width}/>,
57
+ ]
58
+ : [])}
31
59
  <CarouselControls activeIndex={activeIndex} canNext={canNext} canPrevious={canPrevious} controlBackgroundColor={controlBackgroundColor ?? theme.semantics.surface.raised} controlColor={controlColor ?? theme.semantics.content.default} controlledWithoutHandler={controlledWithoutHandler} controlsStyle={controlsStyle} navigate={navigate} nextLabel={nextLabel} previousLabel={previousLabel} show={showArrows && slides.length > 1} testID={testID}/>
32
60
  <CarouselIndicators activeIndex={activeIndex} activeColor={markerColor} controlledWithoutHandler={controlledWithoutHandler} idleColor={idleMarkerColor} indicatorsStyle={indicatorsStyle} navigate={navigate} show={showIndicators && slides.length > 1} slides={slides} testID={testID}/>
33
61
  <CarouselProgress height={progressHeight} indicatorColor={progressIndicatorColor ?? theme.colors.primary} indicatorStyle={progressIndicatorStyle} progress={progress} show={showProgress && slides.length > 1} testID={testID} trackColor={progressTrackColor ?? theme.semantics.neutral.divider} trackStyle={progressTrackStyle}/>
34
62
  </View>);
35
63
  }
36
64
  /*** Keep departing slides mounted for an animated overlap without unmounting content. */
37
- function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, direction, enterDurationMs = 1200, exitDurationMs = 800, initialScale = 1.06, reducedMotion, renderImage, resizeMode, imageStyle, transition, width, }) {
65
+ function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, direction, enterDurationMs = 1200, exitDurationMs = 800, initialScale = 1.06, onImageLoad, onTransitionComplete, reducedMotion, renderImage, resizeMode, imageStyle, transition, width, }) {
38
66
  const [opacity] = React.useState(() => new Animated.Value(active && !animateOnMount ? 1 : 0));
39
67
  const [scale] = React.useState(() => new Animated.Value(active && animateOnMount ? initialScale : 1));
40
68
  const [offset] = React.useState(() => new Animated.Value(0));
41
69
  const hasMounted = React.useRef(false);
70
+ const widthRef = React.useRef(width);
71
+ React.useEffect(() => {
72
+ widthRef.current = width;
73
+ }, [width]);
42
74
  React.useEffect(() => {
43
75
  const firstRender = !hasMounted.current;
44
76
  hasMounted.current = true;
@@ -51,17 +83,19 @@ function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, dir
51
83
  opacity.setValue(active ? 1 : 0);
52
84
  scale.setValue(1);
53
85
  offset.setValue(0);
86
+ if (active)
87
+ onTransitionComplete(slide.key);
54
88
  return;
55
89
  }
56
90
  if (transition === 'slide') {
57
91
  scale.setValue(1);
58
92
  if (active) {
59
- offset.setValue(direction * width);
93
+ offset.setValue(direction * widthRef.current);
60
94
  opacity.setValue(1);
61
95
  }
62
96
  Animated.parallel([
63
97
  Animated.timing(offset, {
64
- toValue: active ? 0 : -direction * width,
98
+ toValue: active ? 0 : -direction * widthRef.current,
65
99
  duration: Math.max(0, active ? enterDurationMs : exitDurationMs),
66
100
  easing: Easing.bezier(0.4, 0, 0.2, 1),
67
101
  useNativeDriver: true,
@@ -72,7 +106,10 @@ function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, dir
72
106
  easing: Easing.linear,
73
107
  useNativeDriver: true,
74
108
  }),
75
- ]).start();
109
+ ]).start(({ finished }) => {
110
+ if (active && finished)
111
+ onTransitionComplete(slide.key);
112
+ });
76
113
  }
77
114
  else if (active) {
78
115
  opacity.setValue(0);
@@ -90,7 +127,10 @@ function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, dir
90
127
  easing: Easing.bezier(0.4, 0, 0.2, 1),
91
128
  useNativeDriver: true,
92
129
  }),
93
- ]).start();
130
+ ]).start(({ finished }) => {
131
+ if (finished)
132
+ onTransitionComplete(slide.key);
133
+ });
94
134
  }
95
135
  else {
96
136
  Animated.timing(opacity, {
@@ -118,13 +158,50 @@ function CarouselLayer({ slide, slideIndex, active, animate, animateOnMount, dir
118
158
  reducedMotion,
119
159
  scale,
120
160
  transition,
121
- width,
161
+ onTransitionComplete,
162
+ slide.key,
122
163
  ]);
123
164
  return (<Animated.View accessibilityElementsHidden={!active} importantForAccessibility={active ? 'auto' : 'no-hide-descendants'} pointerEvents={active ? 'auto' : 'none'} style={[StyleSheet.absoluteFill, { opacity, transform: [{ scale }, { translateX: offset }] }]}>
124
- {slide.source !== undefined ? (renderImage ? (renderImage(slide, slideIndex)) : (<Image accessibilityLabel={slide.alt} accessible={Boolean(slide.alt)} resizeMode={resizeMode} source={typeof slide.source === 'string' ? { uri: slide.source } : slide.source} style={[StyleSheet.absoluteFill, imageStyle]}/>)) : null}
165
+ {slide.source !== undefined ? (renderImage ? (renderCarouselImage(renderImage(slide, slideIndex), onImageLoad)) : (<Image accessibilityLabel={slide.alt} accessible={Boolean(slide.alt)} resizeMode={resizeMode} source={typeof slide.source === 'string' ? { uri: slide.source } : slide.source} style={[StyleSheet.absoluteFill, imageStyle]} onLoad={onImageLoad}/>)) : null}
125
166
  {slide.content}
126
167
  </Animated.View>);
127
168
  }
169
+ /*** Retain consumer image behavior while observing readiness for adjacent-slide preloading. */
170
+ function renderCarouselImage(image, onImageLoad) {
171
+ if (!React.isValidElement(image))
172
+ return image;
173
+ const existingOnLoad = image.props.onLoad;
174
+ return React.cloneElement(image, {
175
+ onLoad: (event) => {
176
+ existingOnLoad?.(event);
177
+ onImageLoad();
178
+ },
179
+ });
180
+ }
181
+ /*** Return an immutable mounted-key set containing one requested slide. */
182
+ function ensureMountedSlide(mountedSlideKeys, slideKey) {
183
+ if (!slideKey || mountedSlideKeys.has(slideKey))
184
+ return mountedSlideKeys;
185
+ return new Set([...mountedSlideKeys, slideKey]);
186
+ }
187
+ /*** Return the next slide key only after the active slide image is ready. */
188
+ function getPreloadedSlideKey(activeSlideKey, nextSlideKey, readySlideKeys) {
189
+ if (!activeSlideKey || !readySlideKeys.has(activeSlideKey))
190
+ return undefined;
191
+ return nextSlideKey;
192
+ }
193
+ /*** Resolve the slide to preload without wrapping when looping is disabled. */
194
+ function getNextSlideIndex(index, length, loop) {
195
+ if (length < 2 || (!loop && index === length - 1))
196
+ return undefined;
197
+ return (index + 1) % length;
198
+ }
199
+ /*** Clamp the initial server-rendered slide to the available slide collection. */
200
+ function normalizeSlideIndex(index, length) {
201
+ if (length === 0)
202
+ return 0;
203
+ return Math.min(Math.max(Math.trunc(index), 0), length - 1);
204
+ }
128
205
  /*** Render optional previous/next buttons without coupling the slide content to navigation. */
129
206
  function CarouselControls({ activeIndex, canNext, canPrevious, controlBackgroundColor, controlColor, controlledWithoutHandler, controlsStyle, navigate, nextLabel, previousLabel, show, testID, }) {
130
207
  if (!show)
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../../src/features/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAA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AE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE;CACrF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Animated, Easing, Image, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type { CarouselProps, CarouselSlide, CarouselTransition } from '../../types/carousel';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { useCarouselPlayback } from './useCarouselPlayback';\n\n/***\n * Present images, arbitrary React content, or both as a cross-platform slideshow.\n * A published web artifact exposes the same API without consumer source imports.\n */\nexport function Carousel({\n slides,\n index,\n defaultIndex,\n onIndexChange,\n autoPlay,\n paused,\n loop,\n intervalMs,\n transition = 'fade',\n enterDurationMs = 1200,\n exitDurationMs = 800,\n initialScale = 1.06,\n animateOnMount = false,\n reducedMotion,\n showProgress = true,\n progressHeight = 4,\n progressTrackColor,\n progressIndicatorColor,\n progressTrackStyle,\n progressIndicatorStyle,\n showArrows = false,\n showIndicators = false,\n previousLabel = 'Previous slide',\n nextLabel = 'Next slide',\n controlColor,\n controlBackgroundColor,\n controlsStyle,\n activeIndicatorColor,\n inactiveIndicatorColor,\n indicatorsStyle,\n resizeMode = 'cover',\n imageStyle,\n style,\n renderImage,\n testID,\n}: CarouselProps) {\n const { theme } = useZoraTheme();\n const [width, setWidth] = React.useState(0);\n const {\n activeIndex,\n controlledWithoutHandler,\n direction,\n loop: enabledLoop,\n navigate,\n progress,\n shouldReduceMotion,\n } = useCarouselPlayback({\n slides,\n index,\n defaultIndex,\n onIndexChange,\n autoPlay,\n paused,\n loop,\n intervalMs,\n reducedMotion,\n });\n\n if (slides.length === 0) return null;\n\n const canPrevious = enabledLoop || activeIndex > 0;\n const canNext = enabledLoop || activeIndex < slides.length - 1;\n const markerColor = activeIndicatorColor ?? theme.colors.primary;\n const idleMarkerColor = inactiveIndicatorColor ?? theme.semantics.neutral.divider;\n\n return (\n <View\n onLayout={(event) => setWidth(event.nativeEvent.layout.width)}\n testID={testID}\n style={[{ position: 'relative', overflow: 'hidden', width: '100%', height: '100%' }, style]}\n >\n {slides.map((slide, slideIndex) => (\n <CarouselLayer\n key={slide.key}\n active={activeIndex === slideIndex}\n animate={slides.length > 1}\n animateOnMount={animateOnMount}\n direction={direction}\n enterDurationMs={enterDurationMs}\n exitDurationMs={exitDurationMs}\n imageStyle={imageStyle}\n initialScale={initialScale}\n reducedMotion={shouldReduceMotion}\n renderImage={renderImage}\n resizeMode={resizeMode}\n slide={slide}\n slideIndex={slideIndex}\n transition={transition}\n width={width}\n />\n ))}\n <CarouselControls\n activeIndex={activeIndex}\n canNext={canNext}\n canPrevious={canPrevious}\n controlBackgroundColor={controlBackgroundColor ?? theme.semantics.surface.raised}\n controlColor={controlColor ?? theme.semantics.content.default}\n controlledWithoutHandler={controlledWithoutHandler}\n controlsStyle={controlsStyle}\n navigate={navigate}\n nextLabel={nextLabel}\n previousLabel={previousLabel}\n show={showArrows && slides.length > 1}\n testID={testID}\n />\n <CarouselIndicators\n activeIndex={activeIndex}\n activeColor={markerColor}\n controlledWithoutHandler={controlledWithoutHandler}\n idleColor={idleMarkerColor}\n indicatorsStyle={indicatorsStyle}\n navigate={navigate}\n show={showIndicators && slides.length > 1}\n slides={slides}\n testID={testID}\n />\n <CarouselProgress\n height={progressHeight}\n indicatorColor={progressIndicatorColor ?? theme.colors.primary}\n indicatorStyle={progressIndicatorStyle}\n progress={progress}\n show={showProgress && slides.length > 1}\n testID={testID}\n trackColor={progressTrackColor ?? theme.semantics.neutral.divider}\n trackStyle={progressTrackStyle}\n />\n </View>\n );\n}\n\ninterface CarouselLayerProps {\n readonly enterDurationMs?: CarouselProps['enterDurationMs'];\n readonly exitDurationMs?: CarouselProps['exitDurationMs'];\n readonly imageStyle: CarouselProps['imageStyle'];\n readonly initialScale?: CarouselProps['initialScale'];\n readonly renderImage: CarouselProps['renderImage'];\n readonly resizeMode: CarouselProps['resizeMode'];\n readonly slide: CarouselSlide;\n readonly slideIndex: number;\n readonly active: boolean;\n readonly animate: boolean;\n readonly animateOnMount: boolean;\n readonly direction: 1 | -1;\n readonly width: number;\n readonly transition: CarouselTransition;\n readonly reducedMotion: boolean;\n}\n\n/*** Keep departing slides mounted for an animated overlap without unmounting content. */\nfunction CarouselLayer({\n slide,\n slideIndex,\n active,\n animate,\n animateOnMount,\n direction,\n enterDurationMs = 1200,\n exitDurationMs = 800,\n initialScale = 1.06,\n reducedMotion,\n renderImage,\n resizeMode,\n imageStyle,\n transition,\n width,\n}: CarouselLayerProps) {\n const [opacity] = React.useState(() => new Animated.Value(active && !animateOnMount ? 1 : 0));\n const [scale] = React.useState(\n () => new Animated.Value(active && animateOnMount ? initialScale : 1),\n );\n const [offset] = React.useState(() => new Animated.Value(0));\n const hasMounted = React.useRef(false);\n\n React.useEffect(() => {\n const firstRender = !hasMounted.current;\n hasMounted.current = true;\n if (firstRender && !animateOnMount) return;\n opacity.stopAnimation();\n scale.stopAnimation();\n offset.stopAnimation();\n if (!animate || reducedMotion || transition === 'none') {\n opacity.setValue(active ? 1 : 0);\n scale.setValue(1);\n offset.setValue(0);\n return;\n }\n if (transition === 'slide') {\n scale.setValue(1);\n if (active) {\n offset.setValue(direction * width);\n opacity.setValue(1);\n }\n Animated.parallel([\n Animated.timing(offset, {\n toValue: active ? 0 : -direction * width,\n duration: Math.max(0, active ? enterDurationMs : exitDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: active ? 1 : 0,\n duration: Math.max(0, active ? enterDurationMs : exitDurationMs),\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start();\n } else if (active) {\n opacity.setValue(0);\n scale.setValue(initialScale);\n Animated.parallel([\n Animated.timing(opacity, {\n toValue: 1,\n duration: Math.max(0, enterDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n Animated.timing(scale, {\n toValue: 1,\n duration: Math.max(0, enterDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n ]).start();\n } else {\n Animated.timing(opacity, {\n toValue: 0,\n duration: Math.max(0, exitDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n }\n return () => {\n opacity.stopAnimation();\n scale.stopAnimation();\n offset.stopAnimation();\n };\n }, [\n active,\n animate,\n animateOnMount,\n direction,\n enterDurationMs,\n exitDurationMs,\n initialScale,\n offset,\n opacity,\n reducedMotion,\n scale,\n transition,\n width,\n ]);\n\n return (\n <Animated.View\n accessibilityElementsHidden={!active}\n importantForAccessibility={active ? 'auto' : 'no-hide-descendants'}\n pointerEvents={active ? 'auto' : 'none'}\n style={[StyleSheet.absoluteFill, { opacity, transform: [{ scale }, { translateX: offset }] }]}\n >\n {slide.source !== undefined ? (\n renderImage ? (\n renderImage(slide, slideIndex)\n ) : (\n <Image\n accessibilityLabel={slide.alt}\n accessible={Boolean(slide.alt)}\n resizeMode={resizeMode}\n source={typeof slide.source === 'string' ? { uri: slide.source } : slide.source}\n style={[StyleSheet.absoluteFill, imageStyle]}\n />\n )\n ) : null}\n {slide.content}\n </Animated.View>\n );\n}\n\ninterface CarouselNavigationProps {\n readonly activeIndex: number;\n readonly navigate: (index: number, direction: 1 | -1) => void;\n readonly controlledWithoutHandler: boolean;\n readonly testID: CarouselProps['testID'];\n}\n\ninterface CarouselControlsProps extends CarouselNavigationProps {\n readonly show: boolean;\n readonly canPrevious: boolean;\n readonly canNext: boolean;\n readonly previousLabel: string;\n readonly nextLabel: string;\n readonly controlColor: string;\n readonly controlBackgroundColor: string;\n readonly controlsStyle: CarouselProps['controlsStyle'];\n}\n\n/*** Render optional previous/next buttons without coupling the slide content to navigation. */\nfunction CarouselControls({\n activeIndex,\n canNext,\n canPrevious,\n controlBackgroundColor,\n controlColor,\n controlledWithoutHandler,\n controlsStyle,\n navigate,\n nextLabel,\n previousLabel,\n show,\n testID,\n}: CarouselControlsProps) {\n if (!show) return null;\n const buttonStyle = [styles.control, { backgroundColor: controlBackgroundColor }];\n const labelStyle = { color: controlColor, fontSize: 30 };\n return (\n <View pointerEvents=\"box-none\" style={[styles.controls, controlsStyle]}>\n <Pressable\n accessibilityLabel={previousLabel}\n accessibilityRole=\"button\"\n disabled={!canPrevious || controlledWithoutHandler}\n onPress={() => navigate(activeIndex - 1, -1)}\n style={buttonStyle}\n testID={testID ? `${testID}-previous` : undefined}\n >\n <Text style={labelStyle}>{'‹'}</Text>\n </Pressable>\n <Pressable\n accessibilityLabel={nextLabel}\n accessibilityRole=\"button\"\n disabled={!canNext || controlledWithoutHandler}\n onPress={() => navigate(activeIndex + 1, 1)}\n style={buttonStyle}\n testID={testID ? `${testID}-next` : undefined}\n >\n <Text style={labelStyle}>{'›'}</Text>\n </Pressable>\n </View>\n );\n}\n\ninterface CarouselIndicatorsProps extends CarouselNavigationProps {\n readonly show: boolean;\n readonly slides: CarouselProps['slides'];\n readonly activeColor: string;\n readonly idleColor: string;\n readonly indicatorsStyle: CarouselProps['indicatorsStyle'];\n}\n\n/*** Render accessible selection dots for the currently controlled slide. */\nfunction CarouselIndicators({\n activeIndex,\n activeColor,\n controlledWithoutHandler,\n idleColor,\n indicatorsStyle,\n navigate,\n show,\n slides,\n testID,\n}: CarouselIndicatorsProps) {\n if (!show) return null;\n return (\n <View pointerEvents=\"box-none\" style={[styles.indicators, indicatorsStyle]}>\n {slides.map((slide, slideIndex) => (\n <Pressable\n key={slide.key}\n accessibilityLabel={`Go to slide ${slideIndex + 1} of ${slides.length}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: slideIndex === activeIndex }}\n disabled={controlledWithoutHandler}\n onPress={() => navigate(slideIndex, slideIndex < activeIndex ? -1 : 1)}\n style={[\n styles.indicator,\n {\n backgroundColor: slideIndex === activeIndex ? activeColor : idleColor,\n width: slideIndex === activeIndex ? 24 : 8,\n },\n ]}\n testID={testID ? `${testID}-indicator-${slideIndex}` : undefined}\n />\n ))}\n </View>\n );\n}\n\ninterface CarouselProgressProps {\n readonly show: boolean;\n readonly height: number;\n readonly trackColor: string;\n readonly indicatorColor: string;\n readonly trackStyle: CarouselProps['progressTrackStyle'];\n readonly indicatorStyle: CarouselProps['progressIndicatorStyle'];\n readonly progress: Animated.Value;\n readonly testID: CarouselProps['testID'];\n}\n\n/*** Render an optional linear autoplay timer without adding any required UI to slides. */\nfunction CarouselProgress({\n height,\n indicatorColor,\n indicatorStyle,\n progress,\n show,\n testID,\n trackColor,\n trackStyle,\n}: CarouselProgressProps) {\n if (!show) return null;\n return (\n <View\n pointerEvents=\"none\"\n style={[styles.progress, { height, backgroundColor: trackColor }, trackStyle]}\n testID={testID ? `${testID}-progress` : undefined}\n >\n <Animated.View\n style={[\n {\n height: '100%',\n width: '100%',\n transformOrigin: 'left center',\n transform: [{ scaleX: progress }],\n backgroundColor: indicatorColor,\n },\n indicatorStyle,\n ]}\n />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n controls: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 14,\n right: 14,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n control: {\n width: 44,\n height: 44,\n borderRadius: 22,\n justifyContent: 'center',\n alignItems: 'center',\n },\n indicators: {\n position: 'absolute',\n bottom: 24,\n left: 0,\n right: 0,\n flexDirection: 'row',\n gap: 10,\n justifyContent: 'center',\n alignItems: 'center',\n },\n indicator: { height: 8, borderRadius: 8 },\n progress: { position: 'absolute', bottom: 0, left: 0, right: 0, overflow: 'hidden' },\n});\n"]}
1
+ {"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../../src/features/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG1F,OAAO,EAA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E,EAAE;QACR,KAAK,EAAE,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,KAAK;QACpB,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;IACzC,QAAQ,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE;CACrF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Animated, Easing, Image, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type { CarouselProps, CarouselSlide, CarouselTransition } from '../../types/carousel';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { useCarouselPlayback } from './useCarouselPlayback';\n\n/***\n * Present images, arbitrary React content, or both as a cross-platform slideshow.\n * A published web artifact exposes the same API without consumer source imports.\n */\nexport function Carousel({\n slides,\n index,\n defaultIndex,\n onIndexChange,\n autoPlay,\n paused,\n loop,\n intervalMs,\n transition = 'fade',\n enterDurationMs = 1200,\n exitDurationMs = 800,\n initialScale = 1.06,\n animateOnMount = false,\n reducedMotion,\n showProgress = true,\n progressHeight = 4,\n progressTrackColor,\n progressIndicatorColor,\n progressTrackStyle,\n progressIndicatorStyle,\n showArrows = false,\n showIndicators = false,\n previousLabel = 'Previous slide',\n nextLabel = 'Next slide',\n controlColor,\n controlBackgroundColor,\n controlsStyle,\n activeIndicatorColor,\n inactiveIndicatorColor,\n indicatorsStyle,\n resizeMode = 'cover',\n imageStyle,\n style,\n renderImage,\n testID,\n}: CarouselProps) {\n const { theme } = useZoraTheme();\n const [width, setWidth] = React.useState(0);\n const initialIndex = normalizeSlideIndex(index ?? defaultIndex ?? 0, slides.length);\n const initialSlide = slides.at(initialIndex);\n const [mountedSlideKeys, setMountedSlideKeys] = React.useState<ReadonlySet<string>>(() =>\n initialSlide ? new Set([initialSlide.key]) : new Set(),\n );\n const [readySlideKeys, setReadySlideKeys] = React.useState<ReadonlySet<string>>(() => new Set());\n const {\n activeIndex,\n controlledWithoutHandler,\n direction,\n loop: enabledLoop,\n navigate,\n progress,\n shouldReduceMotion,\n } = useCarouselPlayback({\n slides,\n index,\n defaultIndex,\n onIndexChange,\n autoPlay,\n paused,\n loop,\n intervalMs,\n reducedMotion,\n });\n\n const activeSlide = slides.at(activeIndex);\n const nextIndex = getNextSlideIndex(activeIndex, slides.length, enabledLoop);\n const nextSlide = nextIndex === undefined ? undefined : slides.at(nextIndex);\n const activeSlideKey = activeSlide?.key;\n const nextSlideKey = nextSlide?.key;\n const mountedKeys = ensureMountedSlide(\n ensureMountedSlide(mountedSlideKeys, activeSlideKey),\n getPreloadedSlideKey(activeSlideKey, nextSlideKey, readySlideKeys),\n );\n\n const markSlideLoaded = React.useCallback(\n (slideKey: string) => {\n setReadySlideKeys((current) => ensureMountedSlide(current, slideKey));\n if (slideKey === activeSlideKey) {\n setMountedSlideKeys((current) => ensureMountedSlide(current, nextSlideKey));\n }\n },\n [activeSlideKey, nextSlideKey],\n );\n\n const completeTransition = React.useCallback(\n (completedSlideKey: string) => {\n if (!activeSlideKey || completedSlideKey !== activeSlideKey) return;\n const transitionRetentionKeys = [activeSlideKey, nextSlideKey].filter(\n (slideKey): slideKey is string => slideKey !== undefined,\n );\n setMountedSlideKeys(\n (current) =>\n new Set(\n transitionRetentionKeys.filter(\n (slideKey) =>\n slideKey === activeSlideKey ||\n current.has(slideKey) ||\n readySlideKeys.has(activeSlideKey),\n ),\n ),\n );\n },\n [activeSlideKey, nextSlideKey, readySlideKeys],\n );\n\n if (slides.length === 0) return null;\n\n const canPrevious = enabledLoop || activeIndex > 0;\n const canNext = enabledLoop || activeIndex < slides.length - 1;\n const markerColor = activeIndicatorColor ?? theme.colors.primary;\n const idleMarkerColor = inactiveIndicatorColor ?? theme.semantics.neutral.divider;\n\n return (\n <View\n onLayout={(event) => setWidth(event.nativeEvent.layout.width)}\n testID={testID}\n style={[{ position: 'relative', overflow: 'hidden', width: '100%', height: '100%' }, style]}\n >\n {slides.flatMap((slide, slideIndex) =>\n mountedKeys.has(slide.key)\n ? [\n <CarouselLayer\n key={slide.key}\n active={activeIndex === slideIndex}\n animate={slides.length > 1}\n animateOnMount={animateOnMount || activeIndex !== initialIndex}\n direction={direction}\n enterDurationMs={enterDurationMs}\n exitDurationMs={exitDurationMs}\n imageStyle={imageStyle}\n initialScale={initialScale}\n onImageLoad={() => markSlideLoaded(slide.key)}\n onTransitionComplete={completeTransition}\n reducedMotion={shouldReduceMotion}\n renderImage={renderImage}\n resizeMode={resizeMode}\n slide={slide}\n slideIndex={slideIndex}\n transition={transition}\n width={width}\n />,\n ]\n : [],\n )}\n <CarouselControls\n activeIndex={activeIndex}\n canNext={canNext}\n canPrevious={canPrevious}\n controlBackgroundColor={controlBackgroundColor ?? theme.semantics.surface.raised}\n controlColor={controlColor ?? theme.semantics.content.default}\n controlledWithoutHandler={controlledWithoutHandler}\n controlsStyle={controlsStyle}\n navigate={navigate}\n nextLabel={nextLabel}\n previousLabel={previousLabel}\n show={showArrows && slides.length > 1}\n testID={testID}\n />\n <CarouselIndicators\n activeIndex={activeIndex}\n activeColor={markerColor}\n controlledWithoutHandler={controlledWithoutHandler}\n idleColor={idleMarkerColor}\n indicatorsStyle={indicatorsStyle}\n navigate={navigate}\n show={showIndicators && slides.length > 1}\n slides={slides}\n testID={testID}\n />\n <CarouselProgress\n height={progressHeight}\n indicatorColor={progressIndicatorColor ?? theme.colors.primary}\n indicatorStyle={progressIndicatorStyle}\n progress={progress}\n show={showProgress && slides.length > 1}\n testID={testID}\n trackColor={progressTrackColor ?? theme.semantics.neutral.divider}\n trackStyle={progressTrackStyle}\n />\n </View>\n );\n}\n\ninterface CarouselLayerProps {\n readonly enterDurationMs?: CarouselProps['enterDurationMs'];\n readonly exitDurationMs?: CarouselProps['exitDurationMs'];\n readonly imageStyle: CarouselProps['imageStyle'];\n readonly initialScale?: CarouselProps['initialScale'];\n readonly onImageLoad: () => void;\n readonly onTransitionComplete: (slideKey: string) => void;\n readonly renderImage: CarouselProps['renderImage'];\n readonly resizeMode: CarouselProps['resizeMode'];\n readonly slide: CarouselSlide;\n readonly slideIndex: number;\n readonly active: boolean;\n readonly animate: boolean;\n readonly animateOnMount: boolean;\n readonly direction: 1 | -1;\n readonly width: number;\n readonly transition: CarouselTransition;\n readonly reducedMotion: boolean;\n}\n\n/*** Keep departing slides mounted for an animated overlap without unmounting content. */\nfunction CarouselLayer({\n slide,\n slideIndex,\n active,\n animate,\n animateOnMount,\n direction,\n enterDurationMs = 1200,\n exitDurationMs = 800,\n initialScale = 1.06,\n onImageLoad,\n onTransitionComplete,\n reducedMotion,\n renderImage,\n resizeMode,\n imageStyle,\n transition,\n width,\n}: CarouselLayerProps) {\n const [opacity] = React.useState(() => new Animated.Value(active && !animateOnMount ? 1 : 0));\n const [scale] = React.useState(\n () => new Animated.Value(active && animateOnMount ? initialScale : 1),\n );\n const [offset] = React.useState(() => new Animated.Value(0));\n const hasMounted = React.useRef(false);\n const widthRef = React.useRef(width);\n\n React.useEffect(() => {\n widthRef.current = width;\n }, [width]);\n\n React.useEffect(() => {\n const firstRender = !hasMounted.current;\n hasMounted.current = true;\n if (firstRender && !animateOnMount) return;\n opacity.stopAnimation();\n scale.stopAnimation();\n offset.stopAnimation();\n if (!animate || reducedMotion || transition === 'none') {\n opacity.setValue(active ? 1 : 0);\n scale.setValue(1);\n offset.setValue(0);\n if (active) onTransitionComplete(slide.key);\n return;\n }\n if (transition === 'slide') {\n scale.setValue(1);\n if (active) {\n offset.setValue(direction * widthRef.current);\n opacity.setValue(1);\n }\n Animated.parallel([\n Animated.timing(offset, {\n toValue: active ? 0 : -direction * widthRef.current,\n duration: Math.max(0, active ? enterDurationMs : exitDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: active ? 1 : 0,\n duration: Math.max(0, active ? enterDurationMs : exitDurationMs),\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(({ finished }) => {\n if (active && finished) onTransitionComplete(slide.key);\n });\n } else if (active) {\n opacity.setValue(0);\n scale.setValue(initialScale);\n Animated.parallel([\n Animated.timing(opacity, {\n toValue: 1,\n duration: Math.max(0, enterDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n Animated.timing(scale, {\n toValue: 1,\n duration: Math.max(0, enterDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }),\n ]).start(({ finished }) => {\n if (finished) onTransitionComplete(slide.key);\n });\n } else {\n Animated.timing(opacity, {\n toValue: 0,\n duration: Math.max(0, exitDurationMs),\n easing: Easing.bezier(0.4, 0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n }\n return () => {\n opacity.stopAnimation();\n scale.stopAnimation();\n offset.stopAnimation();\n };\n }, [\n active,\n animate,\n animateOnMount,\n direction,\n enterDurationMs,\n exitDurationMs,\n initialScale,\n offset,\n opacity,\n reducedMotion,\n scale,\n transition,\n onTransitionComplete,\n slide.key,\n ]);\n\n return (\n <Animated.View\n accessibilityElementsHidden={!active}\n importantForAccessibility={active ? 'auto' : 'no-hide-descendants'}\n pointerEvents={active ? 'auto' : 'none'}\n style={[StyleSheet.absoluteFill, { opacity, transform: [{ scale }, { translateX: offset }] }]}\n >\n {slide.source !== undefined ? (\n renderImage ? (\n renderCarouselImage(renderImage(slide, slideIndex), onImageLoad)\n ) : (\n <Image\n accessibilityLabel={slide.alt}\n accessible={Boolean(slide.alt)}\n resizeMode={resizeMode}\n source={typeof slide.source === 'string' ? { uri: slide.source } : slide.source}\n style={[StyleSheet.absoluteFill, imageStyle]}\n onLoad={onImageLoad}\n />\n )\n ) : null}\n {slide.content}\n </Animated.View>\n );\n}\n\n/*** Retain consumer image behavior while observing readiness for adjacent-slide preloading. */\nfunction renderCarouselImage(image: React.ReactNode, onImageLoad: () => void): React.ReactNode {\n if (!React.isValidElement<{ onLoad?: (event: unknown) => void }>(image)) return image;\n const existingOnLoad = image.props.onLoad;\n return React.cloneElement(image, {\n onLoad: (event: unknown) => {\n existingOnLoad?.(event);\n onImageLoad();\n },\n });\n}\n\n/*** Return an immutable mounted-key set containing one requested slide. */\nfunction ensureMountedSlide(mountedSlideKeys: ReadonlySet<string>, slideKey: string | undefined) {\n if (!slideKey || mountedSlideKeys.has(slideKey)) return mountedSlideKeys;\n return new Set([...mountedSlideKeys, slideKey]);\n}\n\n/*** Return the next slide key only after the active slide image is ready. */\nfunction getPreloadedSlideKey(\n activeSlideKey: string | undefined,\n nextSlideKey: string | undefined,\n readySlideKeys: ReadonlySet<string>,\n) {\n if (!activeSlideKey || !readySlideKeys.has(activeSlideKey)) return undefined;\n return nextSlideKey;\n}\n\n/*** Resolve the slide to preload without wrapping when looping is disabled. */\nfunction getNextSlideIndex(index: number, length: number, loop: boolean): number | undefined {\n if (length < 2 || (!loop && index === length - 1)) return undefined;\n return (index + 1) % length;\n}\n\n/*** Clamp the initial server-rendered slide to the available slide collection. */\nfunction normalizeSlideIndex(index: number, length: number): number {\n if (length === 0) return 0;\n return Math.min(Math.max(Math.trunc(index), 0), length - 1);\n}\n\ninterface CarouselNavigationProps {\n readonly activeIndex: number;\n readonly navigate: (index: number, direction: 1 | -1) => void;\n readonly controlledWithoutHandler: boolean;\n readonly testID: CarouselProps['testID'];\n}\n\ninterface CarouselControlsProps extends CarouselNavigationProps {\n readonly show: boolean;\n readonly canPrevious: boolean;\n readonly canNext: boolean;\n readonly previousLabel: string;\n readonly nextLabel: string;\n readonly controlColor: string;\n readonly controlBackgroundColor: string;\n readonly controlsStyle: CarouselProps['controlsStyle'];\n}\n\n/*** Render optional previous/next buttons without coupling the slide content to navigation. */\nfunction CarouselControls({\n activeIndex,\n canNext,\n canPrevious,\n controlBackgroundColor,\n controlColor,\n controlledWithoutHandler,\n controlsStyle,\n navigate,\n nextLabel,\n previousLabel,\n show,\n testID,\n}: CarouselControlsProps) {\n if (!show) return null;\n const buttonStyle = [styles.control, { backgroundColor: controlBackgroundColor }];\n const labelStyle = { color: controlColor, fontSize: 30 };\n return (\n <View pointerEvents=\"box-none\" style={[styles.controls, controlsStyle]}>\n <Pressable\n accessibilityLabel={previousLabel}\n accessibilityRole=\"button\"\n disabled={!canPrevious || controlledWithoutHandler}\n onPress={() => navigate(activeIndex - 1, -1)}\n style={buttonStyle}\n testID={testID ? `${testID}-previous` : undefined}\n >\n <Text style={labelStyle}>{'‹'}</Text>\n </Pressable>\n <Pressable\n accessibilityLabel={nextLabel}\n accessibilityRole=\"button\"\n disabled={!canNext || controlledWithoutHandler}\n onPress={() => navigate(activeIndex + 1, 1)}\n style={buttonStyle}\n testID={testID ? `${testID}-next` : undefined}\n >\n <Text style={labelStyle}>{'›'}</Text>\n </Pressable>\n </View>\n );\n}\n\ninterface CarouselIndicatorsProps extends CarouselNavigationProps {\n readonly show: boolean;\n readonly slides: CarouselProps['slides'];\n readonly activeColor: string;\n readonly idleColor: string;\n readonly indicatorsStyle: CarouselProps['indicatorsStyle'];\n}\n\n/*** Render accessible selection dots for the currently controlled slide. */\nfunction CarouselIndicators({\n activeIndex,\n activeColor,\n controlledWithoutHandler,\n idleColor,\n indicatorsStyle,\n navigate,\n show,\n slides,\n testID,\n}: CarouselIndicatorsProps) {\n if (!show) return null;\n return (\n <View pointerEvents=\"box-none\" style={[styles.indicators, indicatorsStyle]}>\n {slides.map((slide, slideIndex) => (\n <Pressable\n key={slide.key}\n accessibilityLabel={`Go to slide ${slideIndex + 1} of ${slides.length}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: slideIndex === activeIndex }}\n disabled={controlledWithoutHandler}\n onPress={() => navigate(slideIndex, slideIndex < activeIndex ? -1 : 1)}\n style={[\n styles.indicator,\n {\n backgroundColor: slideIndex === activeIndex ? activeColor : idleColor,\n width: slideIndex === activeIndex ? 24 : 8,\n },\n ]}\n testID={testID ? `${testID}-indicator-${slideIndex}` : undefined}\n />\n ))}\n </View>\n );\n}\n\ninterface CarouselProgressProps {\n readonly show: boolean;\n readonly height: number;\n readonly trackColor: string;\n readonly indicatorColor: string;\n readonly trackStyle: CarouselProps['progressTrackStyle'];\n readonly indicatorStyle: CarouselProps['progressIndicatorStyle'];\n readonly progress: Animated.Value;\n readonly testID: CarouselProps['testID'];\n}\n\n/*** Render an optional linear autoplay timer without adding any required UI to slides. */\nfunction CarouselProgress({\n height,\n indicatorColor,\n indicatorStyle,\n progress,\n show,\n testID,\n trackColor,\n trackStyle,\n}: CarouselProgressProps) {\n if (!show) return null;\n return (\n <View\n pointerEvents=\"none\"\n style={[styles.progress, { height, backgroundColor: trackColor }, trackStyle]}\n testID={testID ? `${testID}-progress` : undefined}\n >\n <Animated.View\n style={[\n {\n height: '100%',\n width: '100%',\n transformOrigin: 'left center',\n transform: [{ scaleX: progress }],\n backgroundColor: indicatorColor,\n },\n indicatorStyle,\n ]}\n />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n controls: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 14,\n right: 14,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n control: {\n width: 44,\n height: 44,\n borderRadius: 22,\n justifyContent: 'center',\n alignItems: 'center',\n },\n indicators: {\n position: 'absolute',\n bottom: 24,\n left: 0,\n right: 0,\n flexDirection: 'row',\n gap: 10,\n justifyContent: 'center',\n alignItems: 'center',\n },\n indicator: { height: 8, borderRadius: 8 },\n progress: { position: 'absolute', bottom: 0, left: 0, right: 0, overflow: 'hidden' },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.native.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAU7E,iFAAiF;AACjF,eAAO,MAAM,MAAM,GAGE,MAAM,SAAS,MAAM,mEAHW,CAAC"}
1
+ {"version":3,"file":"Select.native.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAW7E,iFAAiF;AACjF,eAAO,MAAM,MAAM,GAGE,MAAM,SAAS,MAAM,mEAHW,CAAC"}
@@ -4,6 +4,7 @@ import { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/pu
4
4
  import { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';
5
5
  import { SelectField } from '../../composition/SelectField';
6
6
  import { SelectOptionRow } from '../../composition/SelectOptionRow';
7
+ import { SelectSearchInput } from '../../composition/SelectSearchInput';
7
8
  import { SelectTrigger } from '../../composition/SelectTrigger';
8
9
  import { useSelectController } from '../../composition/useSelectController';
9
10
  const SELECT_SHEET_MAX_HEIGHT = 480;
@@ -12,28 +13,90 @@ export const Select = withZoraThemeScope(SelectInner);
12
13
  /*** Connects shared Select state and controls to the native BottomSheet host. */
13
14
  function SelectInner({ themeId: _themeId, mode: _mode, ...props }) {
14
15
  const { dismiss, present } = useBottomSheet();
15
- const { select, selectedOption, value } = useSelectController(props);
16
+ const [open, setOpen] = React.useState(false);
17
+ const ownsSheet = React.useRef(false);
18
+ const sheetRequestId = React.useRef(0);
19
+ const sheetId = React.useId();
20
+ const { search, searchValue, select, selectedOption, value, visibleOptions } = useSelectController(props);
16
21
  const passive = props.interactionPolicy === 'passive';
17
- const { disabled, interactionPolicy, options, readOnly, testID } = props;
18
- const listData = React.useMemo(() => [...options], [options]);
22
+ const { disabled, interactionPolicy, readOnly, testID } = props;
23
+ const listData = React.useMemo(() => [...visibleOptions], [visibleOptions]);
24
+ const releaseSheet = React.useCallback(() => {
25
+ ownsSheet.current = false;
26
+ setOpen(false);
27
+ }, []);
28
+ const isCurrentSheetRequest = React.useCallback((requestId) => sheetRequestId.current === requestId, []);
29
+ const claimSheet = React.useCallback((requestId) => {
30
+ if (isCurrentSheetRequest(requestId))
31
+ ownsSheet.current = true;
32
+ }, [isCurrentSheetRequest]);
33
+ const releaseSheetOwnership = React.useCallback((requestId) => {
34
+ if (isCurrentSheetRequest(requestId))
35
+ ownsSheet.current = false;
36
+ }, [isCurrentSheetRequest]);
19
37
  const handleSelect = React.useCallback((nextValue) => {
20
38
  select(nextValue);
39
+ releaseSheet();
21
40
  dismiss();
22
- }, [dismiss, select]);
41
+ }, [dismiss, releaseSheet, select]);
23
42
  const renderOption = React.useCallback(({ item }) => (<SelectOptionRow interactionPolicy={interactionPolicy} onSelect={handleSelect} option={item} selected={value === item.value} testID={testID}/>), [handleSelect, interactionPolicy, testID, value]);
24
- const openSelect = React.useCallback(() => {
25
- if (disabled || readOnly || passive)
43
+ React.useEffect(() => {
44
+ if (!open || !ownsSheet.current)
26
45
  return;
46
+ ownsSheet.current = true;
47
+ const requestId = sheetRequestId.current + 1;
48
+ sheetRequestId.current = requestId;
27
49
  present({
28
50
  contentMode: 'direct',
29
51
  maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,
30
- content: (<BottomSheetFlatList contentContainerStyle={styles.listContent} data={listData} keyExtractor={(item) => item.value} renderItem={renderOption}/>),
52
+ content: (<SelectSheetContent key={sheetId} onClaim={claimSheet} listData={listData} isCurrentRequest={isCurrentSheetRequest} onRelease={releaseSheet} onReleaseOwnership={releaseSheetOwnership} props={props} renderOption={renderOption} requestId={requestId} search={search} searchValue={searchValue}/>),
53
+ onDismiss: releaseSheet,
31
54
  });
32
- }, [disabled, listData, passive, present, readOnly, renderOption]);
55
+ }, [
56
+ claimSheet,
57
+ isCurrentSheetRequest,
58
+ listData,
59
+ open,
60
+ present,
61
+ props,
62
+ releaseSheet,
63
+ releaseSheetOwnership,
64
+ renderOption,
65
+ search,
66
+ searchValue,
67
+ sheetId,
68
+ ]);
69
+ React.useEffect(() => () => {
70
+ if (ownsSheet.current)
71
+ dismiss();
72
+ }, [dismiss]);
73
+ const openSelect = React.useCallback(() => {
74
+ if (disabled || readOnly || passive)
75
+ return;
76
+ ownsSheet.current = true;
77
+ setOpen(true);
78
+ }, [disabled, passive, readOnly]);
33
79
  return (<SelectField props={props}>
34
80
  <SelectTrigger displayLabel={selectedOption?.label} leadingMedia={selectedOption?.leadingMedia} onPress={openSelect} props={props}/>
35
81
  </SelectField>);
36
82
  }
83
+ /*** Renders and releases the Select-owned sheet content when another request replaces it. */
84
+ function SelectSheetContent({ isCurrentRequest, listData, onClaim, onRelease, onReleaseOwnership, props, renderOption, requestId, search, searchValue, }) {
85
+ const mounted = React.useRef(false);
86
+ React.useEffect(() => {
87
+ mounted.current = true;
88
+ onClaim(requestId);
89
+ return () => {
90
+ mounted.current = false;
91
+ onReleaseOwnership(requestId);
92
+ void Promise.resolve().then(() => {
93
+ if (!mounted.current && isCurrentRequest(requestId))
94
+ onRelease();
95
+ });
96
+ };
97
+ }, [isCurrentRequest, onClaim, onRelease, onReleaseOwnership, requestId]);
98
+ return (<BottomSheetFlatList contentContainerStyle={styles.listContent} data={listData} keyExtractor={(item) => item.value} ListHeaderComponent={<SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue}/>} renderItem={renderOption}/>);
99
+ }
37
100
  const styles = StyleSheet.create({
38
101
  listContent: {
39
102
  padding: 16,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.native.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAEtD,iFAAiF;AACjF,SAAS,WAAW,CAAiC,EACnD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACY;IACpB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,KAAK,CAAC,iBAAiB,KAAK,SAAS,CAAC;IACtD,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9D,MAAM,YAAY,GAAG,KA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,YAAY,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CACpC,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,OAAO,EAAE,EAAE;KACZ;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { type ListRenderItemInfo, StyleSheet } from 'react-native';\n\nimport type { SelectOption, SelectProps } from '../../../../../types/select';\nimport { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\nconst SELECT_SHEET_MAX_HEIGHT = 480;\n\n/*** Renders Select with BottomSheetFlatList presentation on native platforms. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the native BottomSheet host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const { dismiss, present } = useBottomSheet();\n const { select, selectedOption, value } = useSelectController(props);\n const passive = props.interactionPolicy === 'passive';\n const { disabled, interactionPolicy, options, readOnly, testID } = props;\n const listData = React.useMemo(() => [...options], [options]);\n\n const handleSelect = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n dismiss();\n },\n [dismiss, select],\n );\n\n const renderOption = React.useCallback(\n ({ item }: ListRenderItemInfo<SelectOption<TValue>>) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n onSelect={handleSelect}\n option={item}\n selected={value === item.value}\n testID={testID}\n />\n ),\n [handleSelect, interactionPolicy, testID, value],\n );\n\n const openSelect = React.useCallback(() => {\n if (disabled || readOnly || passive) return;\n\n present({\n contentMode: 'direct',\n maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,\n content: (\n <BottomSheetFlatList\n contentContainerStyle={styles.listContent}\n data={listData}\n keyExtractor={(item: SelectOption<TValue>) => item.value}\n renderItem={renderOption}\n />\n ),\n });\n }, [disabled, listData, passive, present, readOnly, renderOption]);\n\n return (\n <SelectField props={props}>\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={openSelect}\n props={props}\n />\n </SelectField>\n );\n}\n\nconst styles = StyleSheet.create({\n listContent: {\n padding: 16,\n },\n});\n"]}
1
+ {"version":3,"file":"Select.native.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAEtD,iFAAiF;AACjF,SAAS,WAAW,CAAiC,EACnD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,E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CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EACpF,CAAC,CACD,UAAU,CAAC,CAAC,YAAY,CAAC,EACzB,CACH,CAAC;AACJ,CAAC;AAeD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,OAAO,EAAE,EAAE;KACZ;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { type ListRenderItemInfo, StyleSheet } from 'react-native';\n\nimport type { SelectOption, SelectProps } from '../../../../../types/select';\nimport { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectSearchInput } from '../../composition/SelectSearchInput';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\nconst SELECT_SHEET_MAX_HEIGHT = 480;\n\n/*** Renders Select with BottomSheetFlatList presentation on native platforms. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the native BottomSheet host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const { dismiss, present } = useBottomSheet();\n const [open, setOpen] = React.useState(false);\n const ownsSheet = React.useRef(false);\n const sheetRequestId = React.useRef(0);\n const sheetId = React.useId();\n const { search, searchValue, select, selectedOption, value, visibleOptions } =\n useSelectController(props);\n const passive = props.interactionPolicy === 'passive';\n const { disabled, interactionPolicy, readOnly, testID } = props;\n const listData = React.useMemo(() => [...visibleOptions], [visibleOptions]);\n\n const releaseSheet = React.useCallback(() => {\n ownsSheet.current = false;\n setOpen(false);\n }, []);\n\n const isCurrentSheetRequest = React.useCallback(\n (requestId: number) => sheetRequestId.current === requestId,\n [],\n );\n\n const claimSheet = React.useCallback(\n (requestId: number) => {\n if (isCurrentSheetRequest(requestId)) ownsSheet.current = true;\n },\n [isCurrentSheetRequest],\n );\n\n const releaseSheetOwnership = React.useCallback(\n (requestId: number) => {\n if (isCurrentSheetRequest(requestId)) ownsSheet.current = false;\n },\n [isCurrentSheetRequest],\n );\n\n const handleSelect = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n releaseSheet();\n dismiss();\n },\n [dismiss, releaseSheet, select],\n );\n\n const renderOption = React.useCallback(\n ({ item }: ListRenderItemInfo<SelectOption<TValue>>) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n onSelect={handleSelect}\n option={item}\n selected={value === item.value}\n testID={testID}\n />\n ),\n [handleSelect, interactionPolicy, testID, value],\n );\n\n React.useEffect(() => {\n if (!open || !ownsSheet.current) return;\n ownsSheet.current = true;\n const requestId = sheetRequestId.current + 1;\n sheetRequestId.current = requestId;\n present({\n contentMode: 'direct',\n maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,\n content: (\n <SelectSheetContent\n key={sheetId}\n onClaim={claimSheet}\n listData={listData}\n isCurrentRequest={isCurrentSheetRequest}\n onRelease={releaseSheet}\n onReleaseOwnership={releaseSheetOwnership}\n props={props}\n renderOption={renderOption}\n requestId={requestId}\n search={search}\n searchValue={searchValue}\n />\n ),\n onDismiss: releaseSheet,\n });\n }, [\n claimSheet,\n isCurrentSheetRequest,\n listData,\n open,\n present,\n props,\n releaseSheet,\n releaseSheetOwnership,\n renderOption,\n search,\n searchValue,\n sheetId,\n ]);\n\n React.useEffect(\n () => () => {\n if (ownsSheet.current) dismiss();\n },\n [dismiss],\n );\n\n const openSelect = React.useCallback(() => {\n if (disabled || readOnly || passive) return;\n\n ownsSheet.current = true;\n setOpen(true);\n }, [disabled, passive, readOnly]);\n\n return (\n <SelectField props={props}>\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={openSelect}\n props={props}\n />\n </SelectField>\n );\n}\n\n/*** Renders and releases the Select-owned sheet content when another request replaces it. */\nfunction SelectSheetContent<TValue extends string>({\n isCurrentRequest,\n listData,\n onClaim,\n onRelease,\n onReleaseOwnership,\n props,\n renderOption,\n requestId,\n search,\n searchValue,\n}: SelectSheetContentProps<TValue>) {\n const mounted = React.useRef(false);\n\n React.useEffect(() => {\n mounted.current = true;\n onClaim(requestId);\n\n return () => {\n mounted.current = false;\n onReleaseOwnership(requestId);\n void Promise.resolve().then(() => {\n if (!mounted.current && isCurrentRequest(requestId)) onRelease();\n });\n };\n }, [isCurrentRequest, onClaim, onRelease, onReleaseOwnership, requestId]);\n\n return (\n <BottomSheetFlatList\n contentContainerStyle={styles.listContent}\n data={listData}\n keyExtractor={(item: SelectOption<TValue>) => item.value}\n ListHeaderComponent={\n <SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue} />\n }\n renderItem={renderOption}\n />\n );\n}\n\ninterface SelectSheetContentProps<TValue extends string> {\n readonly isCurrentRequest: (requestId: number) => boolean;\n readonly listData: readonly SelectOption<TValue>[];\n readonly onClaim: (requestId: number) => void;\n readonly onRelease: () => void;\n readonly onReleaseOwnership: (requestId: number) => void;\n readonly props: SelectProps<TValue>;\n readonly renderOption: (info: ListRenderItemInfo<SelectOption<TValue>>) => React.ReactElement;\n readonly requestId: number;\n readonly search: (value: string) => void;\n readonly searchValue: string;\n}\n\nconst styles = StyleSheet.create({\n listContent: {\n padding: 16,\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.web.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAS/D,iEAAiE;AACjE,eAAO,MAAM,MAAM,GAGE,MAAM,SAAS,MAAM,mEAHW,CAAC"}
1
+ {"version":3,"file":"Select.web.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAU/D,iEAAiE;AACjE,eAAO,MAAM,MAAM,GAGE,MAAM,SAAS,MAAM,mEAHW,CAAC"}
@@ -5,6 +5,7 @@ import { Surface } from '../../../../surface/public';
5
5
  import { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';
6
6
  import { SelectField } from '../../composition/SelectField';
7
7
  import { SelectOptionRow } from '../../composition/SelectOptionRow';
8
+ import { SelectSearchInput } from '../../composition/SelectSearchInput';
8
9
  import { SelectTrigger } from '../../composition/SelectTrigger';
9
10
  import { useSelectController } from '../../composition/useSelectController';
10
11
  /*** Renders Select with anchored Popover presentation on web. */
@@ -12,8 +13,8 @@ export const Select = withZoraThemeScope(SelectInner);
12
13
  /*** Connects shared Select state and controls to the web Popover host. */
13
14
  function SelectInner({ themeId: _themeId, mode: _mode, ...props }) {
14
15
  const [open, setOpen] = React.useState(false);
15
- const { select, selectedOption, value } = useSelectController(props);
16
- const { interactionPolicy, options, testID } = props;
16
+ const { search, searchValue, select, selectedOption, value, visibleOptions } = useSelectController(props);
17
+ const { interactionPolicy, testID } = props;
17
18
  const selectAndClose = React.useCallback((nextValue) => {
18
19
  select(nextValue);
19
20
  setOpen(false);
@@ -22,7 +23,8 @@ function SelectInner({ themeId: _themeId, mode: _mode, ...props }) {
22
23
  <Popover anchor={({ toggle }) => (<SelectTrigger displayLabel={selectedOption?.label} leadingMedia={selectedOption?.leadingMedia} onPress={toggle} props={props}/>)} interactionPolicy={props.interactionPolicy} onOpenChange={setOpen} open={open} placement="bottom-start" testID={testID ? `${testID}-popover` : undefined}>
23
24
  <Surface variant="raised">
24
25
  <View gap="xs" p="xs">
25
- {options.map((option) => (<SelectOptionRow interactionPolicy={interactionPolicy} key={option.value} onSelect={selectAndClose} option={option} selected={value === option.value} testID={testID}/>))}
26
+ <SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue}/>
27
+ {visibleOptions.map((option) => (<SelectOptionRow interactionPolicy={interactionPolicy} key={option.value} onSelect={selectAndClose} option={option} selected={value === option.value} testID={testID}/>))}
26
28
  </View>
27
29
  </Surface>
28
30
  </Popover>
@@ -1 +1 @@
1
- {"version":3,"file":"Select.web.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,iEAAiE;AACjE,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAEtD,0EAA0E;AAC1E,SAAS,WAAW,CAAiC,EACnD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACY;IACpB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACrE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,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ACJ;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,OAAO,CACX;MAAA,EAAE,OAAO,CACX;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { Popover } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { SelectProps } from '../../../../../types/select';\nimport { View } from '../../../../layout/public';\nimport { Surface } from '../../../../surface/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\n/*** Renders Select with anchored Popover presentation on web. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the web Popover host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const [open, setOpen] = React.useState(false);\n const { select, selectedOption, value } = useSelectController(props);\n const { interactionPolicy, options, testID } = props;\n\n const selectAndClose = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n setOpen(false);\n },\n [select],\n );\n\n return (\n <SelectField props={props}>\n <Popover\n anchor={({ toggle }) => (\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={toggle}\n props={props}\n />\n )}\n interactionPolicy={props.interactionPolicy}\n onOpenChange={setOpen}\n open={open}\n placement=\"bottom-start\"\n testID={testID ? `${testID}-popover` : undefined}\n >\n <Surface variant=\"raised\">\n <View gap=\"xs\" p=\"xs\">\n {options.map((option) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n key={option.value}\n onSelect={selectAndClose}\n option={option}\n selected={value === option.value}\n testID={testID}\n />\n ))}\n </View>\n </Surface>\n </Popover>\n </SelectField>\n );\n}\n"]}
1
+ {"version":3,"file":"Select.web.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inb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,EAAE,OAAO,CACX;MAAA,EAAE,OAAO,CACX;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { Popover } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { SelectProps } from '../../../../../types/select';\nimport { View } from '../../../../layout/public';\nimport { Surface } from '../../../../surface/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectSearchInput } from '../../composition/SelectSearchInput';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\n/*** Renders Select with anchored Popover presentation on web. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the web Popover host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const [open, setOpen] = React.useState(false);\n const { search, searchValue, select, selectedOption, value, visibleOptions } =\n useSelectController(props);\n const { interactionPolicy, testID } = props;\n\n const selectAndClose = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n setOpen(false);\n },\n [select],\n );\n\n return (\n <SelectField props={props}>\n <Popover\n anchor={({ toggle }) => (\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={toggle}\n props={props}\n />\n )}\n interactionPolicy={props.interactionPolicy}\n onOpenChange={setOpen}\n open={open}\n placement=\"bottom-start\"\n testID={testID ? `${testID}-popover` : undefined}\n >\n <Surface variant=\"raised\">\n <View gap=\"xs\" p=\"xs\">\n <SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue} />\n {visibleOptions.map((option) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n key={option.value}\n onSelect={selectAndClose}\n option={option}\n selected={value === option.value}\n testID={testID}\n />\n ))}\n </View>\n </Surface>\n </Popover>\n </SelectField>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { SelectProps } from '../../../../types/select';
2
+ /*** Renders the optional controlled search input shared by Select presentations. */
3
+ export declare function SelectSearchInput<TValue extends string>({ onSearchChange, props, searchValue, }: SelectSearchInputProps<TValue>): import("react").JSX.Element | null;
4
+ interface SelectSearchInputProps<TValue extends string> {
5
+ readonly onSearchChange: (value: string) => void;
6
+ readonly props: SelectProps<TValue>;
7
+ readonly searchValue: string;
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=SelectSearchInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectSearchInput.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectSearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,MAAM,SAAS,MAAM,EAAE,EACvD,cAAc,EACd,KAAK,EACL,WAAW,GACZ,EAAE,sBAAsB,CAAC,MAAM,CAAC,sCAiBhC;AAED,UAAU,sBAAsB,CAAC,MAAM,SAAS,MAAM;IACpD,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,11 @@
1
+ import { View } from '../../../layout/public';
2
+ import { SearchInput } from '../../search-input/public';
3
+ /*** Renders the optional controlled search input shared by Select presentations. */
4
+ export function SelectSearchInput({ onSearchChange, props, searchValue, }) {
5
+ if (!props.searchable)
6
+ return null;
7
+ return (<View pb="xs">
8
+ <SearchInput disabled={props.disabled} interactionPolicy={props.interactionPolicy} onValueChange={onSearchChange} placeholder={props.searchPlaceholder ?? 'Search options'} readOnly={props.readOnly} size="m" testID={props.testID ? `${props.testID}-search` : undefined} value={searchValue}/>
9
+ </View>);
10
+ }
11
+ //# sourceMappingURL=SelectSearchInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectSearchInput.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectSearchInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAwB,EACvD,cAAc,EACd,KAAK,EACL,WAAW,GACoB;IAC/B,IAAI,CAAC,KAAK,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CACX;MAAA,CAAC,WAAW,CACV,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,aAAa,CAAC,CAAC,cAAc,CAAC,CAC9B,WAAW,CAAC,CAAC,KAAK,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,CACzD,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,IAAI,CAAC,GAAG,CACR,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAC5D,KAAK,CAAC,CAAC,WAAW,CAAC,EAEvB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { SelectProps } from '../../../../types/select';\nimport { View } from '../../../layout/public';\nimport { SearchInput } from '../../search-input/public';\n\n/*** Renders the optional controlled search input shared by Select presentations. */\nexport function SelectSearchInput<TValue extends string>({\n onSearchChange,\n props,\n searchValue,\n}: SelectSearchInputProps<TValue>) {\n if (!props.searchable) return null;\n\n return (\n <View pb=\"xs\">\n <SearchInput\n disabled={props.disabled}\n interactionPolicy={props.interactionPolicy}\n onValueChange={onSearchChange}\n placeholder={props.searchPlaceholder ?? 'Search options'}\n readOnly={props.readOnly}\n size=\"m\"\n testID={props.testID ? `${props.testID}-search` : undefined}\n value={searchValue}\n />\n </View>\n );\n}\n\ninterface SelectSearchInputProps<TValue extends string> {\n readonly onSearchChange: (value: string) => void;\n readonly props: SelectProps<TValue>;\n readonly searchValue: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { SelectOption } from '../../../../types/select';
2
+ /*** Preserves option identity while limiting a searchable Select to labels matching its query. */
3
+ export declare function getVisibleSelectOptions<TValue extends string>(options: readonly SelectOption<TValue>[], searchable: boolean | undefined, searchValue: string): readonly SelectOption<TValue>[];
4
+ //# sourceMappingURL=getVisibleSelectOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVisibleSelectOptions.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/getVisibleSelectOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,kGAAkG;AAClG,wBAAgB,uBAAuB,CAAC,MAAM,SAAS,MAAM,EAC3D,OAAO,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,EACxC,UAAU,EAAE,OAAO,GAAG,SAAS,EAC/B,WAAW,EAAE,MAAM,GAClB,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,CAKjC"}
@@ -0,0 +1,8 @@
1
+ /*** Preserves option identity while limiting a searchable Select to labels matching its query. */
2
+ export function getVisibleSelectOptions(options, searchable, searchValue) {
3
+ const query = searchValue.trim().toLocaleLowerCase();
4
+ if (!searchable || query.length === 0)
5
+ return options;
6
+ return options.filter((option) => option.label.toLocaleLowerCase().includes(query));
7
+ }
8
+ //# sourceMappingURL=getVisibleSelectOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVisibleSelectOptions.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/getVisibleSelectOptions.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,UAAU,uBAAuB,CACrC,OAAwC,EACxC,UAA+B,EAC/B,WAAmB;IAEnB,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC;IACrD,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IAEtD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { SelectOption } from '../../../../types/select';\n\n/*** Preserves option identity while limiting a searchable Select to labels matching its query. */\nexport function getVisibleSelectOptions<TValue extends string>(\n options: readonly SelectOption<TValue>[],\n searchable: boolean | undefined,\n searchValue: string,\n): readonly SelectOption<TValue>[] {\n const query = searchValue.trim().toLocaleLowerCase();\n if (!searchable || query.length === 0) return options;\n\n return options.filter((option) => option.label.toLocaleLowerCase().includes(query));\n}\n"]}