@ankhorage/zora 27.7.1 → 27.8.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 (218) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -2
  3. package/dist/features/carousel/Carousel.d.ts +8 -0
  4. package/dist/features/carousel/Carousel.d.ts.map +1 -0
  5. package/dist/features/carousel/Carousel.js +203 -0
  6. package/dist/features/carousel/Carousel.js.map +1 -0
  7. package/dist/features/carousel/public.d.ts +3 -0
  8. package/dist/features/carousel/public.d.ts.map +1 -0
  9. package/dist/features/carousel/public.js +2 -0
  10. package/dist/features/carousel/public.js.map +1 -0
  11. package/dist/features/carousel/useCarouselPlayback.d.ts +15 -0
  12. package/dist/features/carousel/useCarouselPlayback.d.ts.map +1 -0
  13. package/dist/features/carousel/useCarouselPlayback.js +74 -0
  14. package/dist/features/carousel/useCarouselPlayback.js.map +1 -0
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/types/carousel.d.ts +52 -0
  20. package/dist/types/carousel.d.ts.map +1 -0
  21. package/dist/types/carousel.js +2 -0
  22. package/dist/types/carousel.js.map +1 -0
  23. package/package.json +1 -1
  24. package/src/features/carousel/Carousel.test.ts +66 -0
  25. package/src/features/carousel/Carousel.tsx +470 -0
  26. package/src/features/carousel/public.ts +2 -0
  27. package/src/features/carousel/useCarouselPlayback.ts +103 -0
  28. package/src/index.ts +2 -0
  29. package/src/types/carousel.ts +60 -0
  30. package/web-dist/chunks/{Accordion-9d3rd7ne.js → Accordion-19zt3dyq.js} +1 -1
  31. package/web-dist/chunks/{Accordion-8j7t77tf.js → Accordion-1j50tne9.js} +5 -5
  32. package/web-dist/chunks/{Accordion-sxzts6bj.js → Accordion-1k7pyxdd.js} +2 -2
  33. package/web-dist/chunks/{Accordion-fbehwpr1.js → Accordion-1ty4zrzd.js} +7 -7
  34. package/web-dist/chunks/{Accordion-r86ce0wj.js → Accordion-291hyjee.js} +4 -4
  35. package/web-dist/chunks/{Accordion-m3xb7z7j.js → Accordion-396cm5m0.js} +8 -8
  36. package/web-dist/chunks/{Accordion-p2f0e4pn.js → Accordion-3dk0s8hz.js} +6 -6
  37. package/web-dist/chunks/{Accordion-260pyaxy.js → Accordion-54417vp7.js} +5 -5
  38. package/web-dist/chunks/{Accordion-5pbvgvqc.js → Accordion-67a2a09x.js} +2 -2
  39. package/web-dist/chunks/{Accordion-j6bs1yfn.js → Accordion-6tfr02mw.js} +2 -2
  40. package/web-dist/chunks/{Accordion-e8dg1z2s.js → Accordion-6y42ws4p.js} +2 -2
  41. package/web-dist/chunks/{Accordion-w0prbwy0.js → Accordion-7j05jjqn.js} +8 -8
  42. package/web-dist/chunks/{Accordion-252dr90x.js → Accordion-7tg3cabd.js} +4 -4
  43. package/web-dist/chunks/{Accordion-8vcs6nz6.js → Accordion-9cpm8x92.js} +1 -1
  44. package/web-dist/chunks/{Accordion-ms1y70gq.js → Accordion-c1btejmf.js} +4 -4
  45. package/web-dist/chunks/{Accordion-yb4as6wc.js → Accordion-db40jsp6.js} +5 -5
  46. package/web-dist/chunks/{Accordion-wx0jp5cn.js → Accordion-dmkygw9c.js} +7 -7
  47. package/web-dist/chunks/{Accordion-vq8zrnwh.js → Accordion-dr8k9txz.js} +4 -4
  48. package/web-dist/chunks/{Accordion-jx9tc6p1.js → Accordion-e8r2qt0n.js} +4 -4
  49. package/web-dist/chunks/{Accordion-tnt1txfq.js → Accordion-ephzqa3t.js} +4 -4
  50. package/web-dist/chunks/{Accordion-4kmh6s2k.js → Accordion-fcpadcrg.js} +2 -2
  51. package/web-dist/chunks/{Accordion-0j4xzcwz.js → Accordion-gaevp89v.js} +3 -3
  52. package/web-dist/chunks/{Accordion-r6zvzrkd.js → Accordion-gwq0xkp9.js} +3 -3
  53. package/web-dist/chunks/{Accordion-9hcbf56f.js → Accordion-h4928ex8.js} +2 -2
  54. package/web-dist/chunks/{Accordion-mrhkw8n6.js → Accordion-hqg1zbxk.js} +6 -4
  55. package/web-dist/chunks/{Accordion-gysa24fk.js → Accordion-j5wsx41j.js} +1 -1
  56. package/web-dist/chunks/{Accordion-wvghkwxx.js → Accordion-jj6sg99e.js} +9 -9
  57. package/web-dist/chunks/{Accordion-7mnan4q4.js → Accordion-jqjnzjmt.js} +6 -6
  58. package/web-dist/chunks/{Accordion-b4yr6yq3.js → Accordion-jsdjgfn2.js} +2 -2
  59. package/web-dist/chunks/{Accordion-8ac6dkcs.js → Accordion-k058095e.js} +1 -1
  60. package/web-dist/chunks/Accordion-kcx57mk5.js +39 -0
  61. package/web-dist/chunks/{Accordion-mpebzjby.js → Accordion-kmbw4fe7.js} +4 -4
  62. package/web-dist/chunks/{Accordion-yrzm02g2.js → Accordion-kn52vs02.js} +5 -5
  63. package/web-dist/chunks/{Accordion-nnhznqgf.js → Accordion-n8dksapd.js} +2 -2
  64. package/web-dist/chunks/{Accordion-tpd1vvy9.js → Accordion-ng79nxzz.js} +1 -38
  65. package/web-dist/chunks/{Accordion-np16p9mh.js → Accordion-psxc0zjs.js} +4 -4
  66. package/web-dist/chunks/{Accordion-4c7hqeg3.js → Accordion-q3wk945k.js} +2 -2
  67. package/web-dist/chunks/{Accordion-t2cvrn0r.js → Accordion-qjp8bp5y.js} +8 -8
  68. package/web-dist/chunks/{Accordion-a8k3cvj0.js → Accordion-qyf0e72g.js} +1 -1
  69. package/web-dist/chunks/{Accordion-rcs75kj4.js → Accordion-r6gwemh9.js} +3 -3
  70. package/web-dist/chunks/{Accordion-hh48jjhk.js → Accordion-rbtgfrn4.js} +7 -7
  71. package/web-dist/chunks/{Accordion-kcca65d8.js → Accordion-rqh7264g.js} +5 -5
  72. package/web-dist/chunks/{Accordion-ew2cebyd.js → Accordion-rxc2p9md.js} +3 -3
  73. package/web-dist/chunks/{Accordion-f2n2zz1x.js → Accordion-scvx38z0.js} +6 -6
  74. package/web-dist/chunks/{Accordion-hf4nfkn0.js → Accordion-vayww2ec.js} +13 -13
  75. package/web-dist/chunks/{Accordion-vzgpdtr2.js → Accordion-wdby2v5r.js} +1 -1
  76. package/web-dist/chunks/{Accordion-7788ybcs.js → Accordion-wswm0zxe.js} +4 -4
  77. package/web-dist/chunks/{Accordion-rwc34cn2.js → Accordion-xjxam647.js} +5 -5
  78. package/web-dist/chunks/{Accordion-c44m1q0m.js → Accordion-xkewtxac.js} +2 -2
  79. package/web-dist/chunks/{Accordion-001ymezm.js → Accordion-y524ph0g.js} +1 -1
  80. package/web-dist/chunks/{Accordion-5z8pbn4z.js → Accordion-y7z4v31b.js} +3 -3
  81. package/web-dist/chunks/{Accordion-6jsea4e0.js → Accordion-yrs9sd97.js} +8 -8
  82. package/web-dist/chunks/{Accordion-jh94mg56.js → Accordion-ytvjnaz3.js} +9 -9
  83. package/web-dist/chunks/{Accordion-s9nbkzky.js → Accordion-zmee9h36.js} +2 -2
  84. package/web-dist/chunks/{Accordion-p7mxkxhs.js → Accordion-zx1qd2tf.js} +9 -9
  85. package/web-dist/components/accordion/Accordion.js +11 -10
  86. package/web-dist/components/accordion-item/AccordionItem.js +11 -10
  87. package/web-dist/components/activity-indicator/ActivityIndicator.js +4 -3
  88. package/web-dist/components/app-bar/AppBar.js +17 -16
  89. package/web-dist/components/app-header/AppHeader.js +17 -16
  90. package/web-dist/components/app-shell/AppShell.js +5 -4
  91. package/web-dist/components/auth-screen/AuthScreen.js +22 -21
  92. package/web-dist/components/avatar/Avatar.js +11 -10
  93. package/web-dist/components/avatar-group/AvatarGroup.js +11 -10
  94. package/web-dist/components/badge/Badge.js +6 -5
  95. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +20 -19
  96. package/web-dist/components/bottom-sheet/BottomSheet.js +7 -6
  97. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +7 -6
  98. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +7 -6
  99. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +7 -6
  100. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +7 -6
  101. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +7 -6
  102. package/web-dist/components/breadcrumbs/Breadcrumbs.js +14 -13
  103. package/web-dist/components/button/Button.js +12 -11
  104. package/web-dist/components/button-group/ButtonGroup.js +12 -11
  105. package/web-dist/components/calendar/Calendar.js +14 -13
  106. package/web-dist/components/camera-permission-view/CameraPermissionView.js +20 -19
  107. package/web-dist/components/card/Card.js +19 -18
  108. package/web-dist/components/card-back/CardBack.js +5 -4
  109. package/web-dist/components/card-hand/CardHand.js +5 -4
  110. package/web-dist/components/carousel/Carousel.d.ts +10 -0
  111. package/web-dist/components/carousel/Carousel.js +483 -0
  112. package/web-dist/components/carousel/Carousel.types-0.d.ts +55 -0
  113. package/web-dist/components/carousel/index.d.ts +2 -0
  114. package/web-dist/components/carousel/index.js +2 -0
  115. package/web-dist/components/chat-list-item/ChatListItem.js +15 -14
  116. package/web-dist/components/checkbox/Checkbox.js +11 -10
  117. package/web-dist/components/checkbox-group/CheckboxGroup.js +11 -10
  118. package/web-dist/components/chess-board/ChessBoard.js +5 -4
  119. package/web-dist/components/chip/Chip.js +12 -11
  120. package/web-dist/components/chip-group/ChipGroup.js +12 -11
  121. package/web-dist/components/collection-editor/CollectionEditor.js +19 -18
  122. package/web-dist/components/color-hue-scale/ColorHueScale.js +15 -14
  123. package/web-dist/components/color-picker/ColorPicker.js +15 -14
  124. package/web-dist/components/color-tone/ColorTone.js +15 -14
  125. package/web-dist/components/color-wheel/ColorWheel.js +15 -14
  126. package/web-dist/components/content-rail/ContentRail.js +13 -12
  127. package/web-dist/components/data-table/DataTable.js +25 -24
  128. package/web-dist/components/date-picker/DatePicker.js +18 -17
  129. package/web-dist/components/dialog/Dialog.js +10 -9
  130. package/web-dist/components/divider/Divider.js +5 -4
  131. package/web-dist/components/empty-state/EmptyState.js +20 -19
  132. package/web-dist/components/explorer/Explorer.js +12 -11
  133. package/web-dist/components/field/Field.js +11 -10
  134. package/web-dist/components/file-explorer/FileExplorer.js +12 -11
  135. package/web-dist/components/flat-list/FlatList.js +12 -11
  136. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +22 -21
  137. package/web-dist/components/form/Form.js +16 -15
  138. package/web-dist/components/form-actions/FormActions.js +16 -15
  139. package/web-dist/components/form-error/FormError.js +16 -15
  140. package/web-dist/components/game/Game.js +6 -5
  141. package/web-dist/components/game-entity/GameEntity.js +6 -5
  142. package/web-dist/components/game-field/GameField.js +6 -5
  143. package/web-dist/components/game-input-zone/GameInputZone.js +6 -5
  144. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +6 -5
  145. package/web-dist/components/game-overlay/GameOverlay.js +6 -5
  146. package/web-dist/components/gradient/Gradient.js +6 -5
  147. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +6 -5
  148. package/web-dist/components/grid/Grid.js +5 -4
  149. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +5 -4
  150. package/web-dist/components/grid-ruler/GridRuler.js +5 -4
  151. package/web-dist/components/heading/Heading.js +6 -5
  152. package/web-dist/components/hero/Hero.js +19 -18
  153. package/web-dist/components/icon/Icon.js +5 -4
  154. package/web-dist/components/icon-button/IconButton.js +12 -11
  155. package/web-dist/components/image/Image.js +9 -8
  156. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +4 -3
  157. package/web-dist/components/list/List.js +12 -11
  158. package/web-dist/components/list-item/ListItem.js +12 -11
  159. package/web-dist/components/list-section/ListSection.js +12 -11
  160. package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
  161. package/web-dist/components/media-card/MediaCard.js +19 -18
  162. package/web-dist/components/media-explorer/MediaExplorer.js +12 -11
  163. package/web-dist/components/message-bubble/MessageBubble.js +15 -14
  164. package/web-dist/components/metric-card/MetricCard.js +19 -18
  165. package/web-dist/components/missing-element/MissingElement.js +10 -9
  166. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +22 -21
  167. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +22 -21
  168. package/web-dist/components/opening-book/OpeningBook.js +5 -4
  169. package/web-dist/components/otp-form/OtpForm.js +22 -21
  170. package/web-dist/components/pagination/Pagination.js +13 -12
  171. package/web-dist/components/palette-item/PaletteItem.js +19 -18
  172. package/web-dist/components/playing-card/PlayingCard.js +5 -4
  173. package/web-dist/components/poker-training-table/PokerTrainingTable.js +5 -4
  174. package/web-dist/components/popover-menu/PopoverMenu.js +11 -10
  175. package/web-dist/components/post-card/PostCard.js +19 -18
  176. package/web-dist/components/product-card/ProductCard.js +19 -18
  177. package/web-dist/components/progress/Progress.js +9 -8
  178. package/web-dist/components/progress-ring/ProgressRing.js +9 -8
  179. package/web-dist/components/radio/Radio.js +13 -12
  180. package/web-dist/components/radio-group/RadioGroup.js +13 -12
  181. package/web-dist/components/rating/Rating.js +8 -7
  182. package/web-dist/components/reader/Reader.js +20 -19
  183. package/web-dist/components/scan-overlay/ScanOverlay.js +20 -19
  184. package/web-dist/components/screen/Screen.js +5 -4
  185. package/web-dist/components/screen-section/ScreenSection.js +9 -8
  186. package/web-dist/components/scroll-view/ScrollView.js +5 -4
  187. package/web-dist/components/search-input/SearchInput.js +14 -13
  188. package/web-dist/components/section-header/SectionHeader.js +9 -8
  189. package/web-dist/components/section-list/SectionList.js +12 -11
  190. package/web-dist/components/select/Select.js +15 -14
  191. package/web-dist/components/selectable-item/SelectableItem.js +4 -3
  192. package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
  193. package/web-dist/components/sign-in-form/SignInForm.js +22 -21
  194. package/web-dist/components/sign-up-form/SignUpForm.js +22 -21
  195. package/web-dist/components/skeleton/Skeleton.js +22 -21
  196. package/web-dist/components/skeleton-card/SkeletonCard.js +22 -21
  197. package/web-dist/components/skeleton-list/SkeletonList.js +22 -21
  198. package/web-dist/components/skeleton-text/SkeletonText.js +22 -21
  199. package/web-dist/components/surface/Surface.js +6 -5
  200. package/web-dist/components/switch/Switch.js +6 -5
  201. package/web-dist/components/tab/Tab.js +6 -5
  202. package/web-dist/components/tab-list/TabList.js +6 -5
  203. package/web-dist/components/tab-panel/TabPanel.js +6 -5
  204. package/web-dist/components/tabletop-table/TabletopTable.js +5 -4
  205. package/web-dist/components/tabs/Tabs.js +6 -5
  206. package/web-dist/components/text/Text.js +6 -5
  207. package/web-dist/components/text-input/TextInput.js +14 -13
  208. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +12 -11
  209. package/web-dist/components/time-picker/TimePicker.js +17 -16
  210. package/web-dist/components/timeline/Timeline.js +11 -10
  211. package/web-dist/components/toast/Toast.js +8 -7
  212. package/web-dist/components/toast-provider/ToastProvider.js +8 -7
  213. package/web-dist/components/toolbar/Toolbar.js +19 -18
  214. package/web-dist/components/tree-item/TreeItem.js +17 -16
  215. package/web-dist/components/uploader/Uploader.js +22 -21
  216. package/web-dist/components/view/View.js +5 -4
  217. package/web-dist/manifest.json +1638 -1493
  218. package/web-dist/runtime/ZoraProvider.js +11 -9
@@ -0,0 +1,483 @@
1
+ 'use client';
2
+ import"../../chunks/Accordion-ng79nxzz.js";
3
+ import {
4
+ useZoraTheme2
5
+ } from "../../chunks/Accordion-j5wsx41j.js";
6
+ import {
7
+ require_cjs
8
+ } from "../../chunks/Accordion-xgpzh4wq.js";
9
+ import {
10
+ __toESM
11
+ } from "../../chunks/Accordion-nh0cs9hq.js";
12
+
13
+ // src/features/carousel/Carousel.tsx
14
+ var import_react_native2 = __toESM(require_cjs(), 1);
15
+ import React2 from "react";
16
+
17
+ // src/features/carousel/useCarouselPlayback.ts
18
+ var import_react_native = __toESM(require_cjs(), 1);
19
+ import React from "react";
20
+ function useCarouselPlayback({
21
+ slides,
22
+ index,
23
+ defaultIndex = 0,
24
+ onIndexChange,
25
+ autoPlay = true,
26
+ paused = false,
27
+ loop = true,
28
+ intervalMs = 6000,
29
+ reducedMotion
30
+ }) {
31
+ const [uncontrolledIndex, setUncontrolledIndex] = React.useState(defaultIndex);
32
+ const [direction, setDirection] = React.useState(1);
33
+ const [progress] = React.useState(() => new import_react_native.Animated.Value(0));
34
+ const systemReducedMotion = useSystemReducedMotion();
35
+ const shouldReduceMotion = reducedMotion ?? systemReducedMotion;
36
+ const activeIndex = normalizeIndex(index ?? uncontrolledIndex, slides.length);
37
+ const duration = Math.max(1, intervalMs);
38
+ const controlledWithoutHandler = index !== undefined && onIndexChange === undefined;
39
+ const canAdvance = loop || activeIndex < slides.length - 1;
40
+ const shouldPlay = autoPlay && !paused && slides.length > 1 && canAdvance && !controlledWithoutHandler;
41
+ const navigate = React.useCallback((target, nextDirection) => {
42
+ if (slides.length < 2 || controlledWithoutHandler)
43
+ return;
44
+ const next = loop ? (target + slides.length) % slides.length : normalizeIndex(target, slides.length);
45
+ if (next === activeIndex)
46
+ return;
47
+ setDirection(nextDirection);
48
+ if (index === undefined)
49
+ setUncontrolledIndex(next);
50
+ onIndexChange?.(next);
51
+ }, [activeIndex, controlledWithoutHandler, index, loop, onIndexChange, slides.length]);
52
+ React.useEffect(() => {
53
+ if (!shouldPlay)
54
+ return;
55
+ const timeout = setTimeout(() => navigate(activeIndex + 1, 1), duration);
56
+ return () => clearTimeout(timeout);
57
+ }, [activeIndex, duration, navigate, shouldPlay]);
58
+ React.useEffect(() => {
59
+ progress.stopAnimation();
60
+ progress.setValue(0);
61
+ if (!shouldPlay || shouldReduceMotion)
62
+ return;
63
+ const animation = import_react_native.Animated.timing(progress, {
64
+ toValue: 1,
65
+ duration,
66
+ easing: import_react_native.Easing.linear,
67
+ useNativeDriver: false
68
+ });
69
+ animation.start();
70
+ return () => animation.stop();
71
+ }, [activeIndex, duration, progress, shouldPlay, shouldReduceMotion]);
72
+ return {
73
+ activeIndex,
74
+ controlledWithoutHandler,
75
+ direction,
76
+ loop,
77
+ navigate,
78
+ progress,
79
+ shouldReduceMotion
80
+ };
81
+ }
82
+ function normalizeIndex(value, count) {
83
+ if (count <= 0 || !Number.isFinite(value))
84
+ return 0;
85
+ return Math.min(Math.max(Math.trunc(value), 0), count - 1);
86
+ }
87
+ function useSystemReducedMotion() {
88
+ const [reduced, setReduced] = React.useState(false);
89
+ React.useEffect(() => {
90
+ import_react_native.AccessibilityInfo.isReduceMotionEnabled().then(setReduced);
91
+ const listener = import_react_native.AccessibilityInfo.addEventListener("reduceMotionChanged", setReduced);
92
+ return () => listener.remove();
93
+ }, []);
94
+ return reduced;
95
+ }
96
+
97
+ // src/features/carousel/Carousel.tsx
98
+ import { jsx, jsxs } from "react/jsx-runtime";
99
+ function Carousel({
100
+ slides,
101
+ index,
102
+ defaultIndex,
103
+ onIndexChange,
104
+ autoPlay,
105
+ paused,
106
+ loop,
107
+ intervalMs,
108
+ transition = "fade",
109
+ enterDurationMs = 1200,
110
+ exitDurationMs = 800,
111
+ initialScale = 1.06,
112
+ animateOnMount = false,
113
+ reducedMotion,
114
+ showProgress = true,
115
+ progressHeight = 4,
116
+ progressTrackColor,
117
+ progressIndicatorColor,
118
+ progressTrackStyle,
119
+ progressIndicatorStyle,
120
+ showArrows = false,
121
+ showIndicators = false,
122
+ previousLabel = "Previous slide",
123
+ nextLabel = "Next slide",
124
+ controlColor,
125
+ controlBackgroundColor,
126
+ controlsStyle,
127
+ activeIndicatorColor,
128
+ inactiveIndicatorColor,
129
+ indicatorsStyle,
130
+ resizeMode = "cover",
131
+ imageStyle,
132
+ style,
133
+ renderImage,
134
+ testID
135
+ }) {
136
+ const { theme } = useZoraTheme2();
137
+ const [width, setWidth] = React2.useState(0);
138
+ const {
139
+ activeIndex,
140
+ controlledWithoutHandler,
141
+ direction,
142
+ loop: enabledLoop,
143
+ navigate,
144
+ progress,
145
+ shouldReduceMotion
146
+ } = useCarouselPlayback({
147
+ slides,
148
+ index,
149
+ defaultIndex,
150
+ onIndexChange,
151
+ autoPlay,
152
+ paused,
153
+ loop,
154
+ intervalMs,
155
+ reducedMotion
156
+ });
157
+ if (slides.length === 0)
158
+ return null;
159
+ const canPrevious = enabledLoop || activeIndex > 0;
160
+ const canNext = enabledLoop || activeIndex < slides.length - 1;
161
+ const markerColor = activeIndicatorColor ?? theme.colors.primary;
162
+ const idleMarkerColor = inactiveIndicatorColor ?? theme.semantics.neutral.divider;
163
+ return /* @__PURE__ */ jsxs(import_react_native2.View, {
164
+ onLayout: (event) => setWidth(event.nativeEvent.layout.width),
165
+ testID,
166
+ style: [{ position: "relative", overflow: "hidden", width: "100%", height: "100%" }, style],
167
+ children: [
168
+ slides.map((slide, slideIndex) => /* @__PURE__ */ jsx(CarouselLayer, {
169
+ active: activeIndex === slideIndex,
170
+ animate: slides.length > 1,
171
+ animateOnMount,
172
+ direction,
173
+ enterDurationMs,
174
+ exitDurationMs,
175
+ imageStyle,
176
+ initialScale,
177
+ reducedMotion: shouldReduceMotion,
178
+ renderImage,
179
+ resizeMode,
180
+ slide,
181
+ slideIndex,
182
+ transition,
183
+ width
184
+ }, slide.key)),
185
+ /* @__PURE__ */ jsx(CarouselControls, {
186
+ activeIndex,
187
+ canNext,
188
+ canPrevious,
189
+ controlBackgroundColor: controlBackgroundColor ?? theme.semantics.surface.raised,
190
+ controlColor: controlColor ?? theme.semantics.content.default,
191
+ controlledWithoutHandler,
192
+ controlsStyle,
193
+ navigate,
194
+ nextLabel,
195
+ previousLabel,
196
+ show: showArrows && slides.length > 1,
197
+ testID
198
+ }),
199
+ /* @__PURE__ */ jsx(CarouselIndicators, {
200
+ activeIndex,
201
+ activeColor: markerColor,
202
+ controlledWithoutHandler,
203
+ idleColor: idleMarkerColor,
204
+ indicatorsStyle,
205
+ navigate,
206
+ show: showIndicators && slides.length > 1,
207
+ slides,
208
+ testID
209
+ }),
210
+ /* @__PURE__ */ jsx(CarouselProgress, {
211
+ height: progressHeight,
212
+ indicatorColor: progressIndicatorColor ?? theme.colors.primary,
213
+ indicatorStyle: progressIndicatorStyle,
214
+ progress,
215
+ show: showProgress && slides.length > 1,
216
+ testID,
217
+ trackColor: progressTrackColor ?? theme.semantics.neutral.divider,
218
+ trackStyle: progressTrackStyle
219
+ })
220
+ ]
221
+ });
222
+ }
223
+ function CarouselLayer({
224
+ slide,
225
+ slideIndex,
226
+ active,
227
+ animate,
228
+ animateOnMount,
229
+ direction,
230
+ enterDurationMs = 1200,
231
+ exitDurationMs = 800,
232
+ initialScale = 1.06,
233
+ reducedMotion,
234
+ renderImage,
235
+ resizeMode,
236
+ imageStyle,
237
+ transition,
238
+ width
239
+ }) {
240
+ const [opacity] = React2.useState(() => new import_react_native2.Animated.Value(active && !animateOnMount ? 1 : 0));
241
+ const [scale] = React2.useState(() => new import_react_native2.Animated.Value(active && animateOnMount ? initialScale : 1));
242
+ const [offset] = React2.useState(() => new import_react_native2.Animated.Value(0));
243
+ const hasMounted = React2.useRef(false);
244
+ React2.useEffect(() => {
245
+ const firstRender = !hasMounted.current;
246
+ hasMounted.current = true;
247
+ if (firstRender && !animateOnMount)
248
+ return;
249
+ opacity.stopAnimation();
250
+ scale.stopAnimation();
251
+ offset.stopAnimation();
252
+ if (!animate || reducedMotion || transition === "none") {
253
+ opacity.setValue(active ? 1 : 0);
254
+ scale.setValue(1);
255
+ offset.setValue(0);
256
+ return;
257
+ }
258
+ if (transition === "slide") {
259
+ scale.setValue(1);
260
+ if (active) {
261
+ offset.setValue(direction * width);
262
+ opacity.setValue(1);
263
+ }
264
+ import_react_native2.Animated.parallel([
265
+ import_react_native2.Animated.timing(offset, {
266
+ toValue: active ? 0 : -direction * width,
267
+ duration: Math.max(0, active ? enterDurationMs : exitDurationMs),
268
+ easing: import_react_native2.Easing.bezier(0.4, 0, 0.2, 1),
269
+ useNativeDriver: true
270
+ }),
271
+ import_react_native2.Animated.timing(opacity, {
272
+ toValue: active ? 1 : 0,
273
+ duration: Math.max(0, active ? enterDurationMs : exitDurationMs),
274
+ easing: import_react_native2.Easing.linear,
275
+ useNativeDriver: true
276
+ })
277
+ ]).start();
278
+ } else if (active) {
279
+ opacity.setValue(0);
280
+ scale.setValue(initialScale);
281
+ import_react_native2.Animated.parallel([
282
+ import_react_native2.Animated.timing(opacity, {
283
+ toValue: 1,
284
+ duration: Math.max(0, enterDurationMs),
285
+ easing: import_react_native2.Easing.bezier(0.4, 0, 0.2, 1),
286
+ useNativeDriver: true
287
+ }),
288
+ import_react_native2.Animated.timing(scale, {
289
+ toValue: 1,
290
+ duration: Math.max(0, enterDurationMs),
291
+ easing: import_react_native2.Easing.bezier(0.4, 0, 0.2, 1),
292
+ useNativeDriver: true
293
+ })
294
+ ]).start();
295
+ } else {
296
+ import_react_native2.Animated.timing(opacity, {
297
+ toValue: 0,
298
+ duration: Math.max(0, exitDurationMs),
299
+ easing: import_react_native2.Easing.bezier(0.4, 0, 0.2, 1),
300
+ useNativeDriver: true
301
+ }).start();
302
+ }
303
+ return () => {
304
+ opacity.stopAnimation();
305
+ scale.stopAnimation();
306
+ offset.stopAnimation();
307
+ };
308
+ }, [
309
+ active,
310
+ animate,
311
+ animateOnMount,
312
+ direction,
313
+ enterDurationMs,
314
+ exitDurationMs,
315
+ initialScale,
316
+ offset,
317
+ opacity,
318
+ reducedMotion,
319
+ scale,
320
+ transition,
321
+ width
322
+ ]);
323
+ return /* @__PURE__ */ jsxs(import_react_native2.Animated.View, {
324
+ accessibilityElementsHidden: !active,
325
+ importantForAccessibility: active ? "auto" : "no-hide-descendants",
326
+ pointerEvents: active ? "auto" : "none",
327
+ style: [import_react_native2.StyleSheet.absoluteFill, { opacity, transform: [{ scale }, { translateX: offset }] }],
328
+ children: [
329
+ slide.source !== undefined ? renderImage ? renderImage(slide, slideIndex) : /* @__PURE__ */ jsx(import_react_native2.Image, {
330
+ accessibilityLabel: slide.alt,
331
+ accessible: Boolean(slide.alt),
332
+ resizeMode,
333
+ source: typeof slide.source === "string" ? { uri: slide.source } : slide.source,
334
+ style: [import_react_native2.StyleSheet.absoluteFill, imageStyle]
335
+ }) : null,
336
+ slide.content
337
+ ]
338
+ });
339
+ }
340
+ function CarouselControls({
341
+ activeIndex,
342
+ canNext,
343
+ canPrevious,
344
+ controlBackgroundColor,
345
+ controlColor,
346
+ controlledWithoutHandler,
347
+ controlsStyle,
348
+ navigate,
349
+ nextLabel,
350
+ previousLabel,
351
+ show,
352
+ testID
353
+ }) {
354
+ if (!show)
355
+ return null;
356
+ const buttonStyle = [styles.control, { backgroundColor: controlBackgroundColor }];
357
+ const labelStyle = { color: controlColor, fontSize: 30 };
358
+ return /* @__PURE__ */ jsxs(import_react_native2.View, {
359
+ pointerEvents: "box-none",
360
+ style: [styles.controls, controlsStyle],
361
+ children: [
362
+ /* @__PURE__ */ jsx(import_react_native2.Pressable, {
363
+ accessibilityLabel: previousLabel,
364
+ accessibilityRole: "button",
365
+ disabled: !canPrevious || controlledWithoutHandler,
366
+ onPress: () => navigate(activeIndex - 1, -1),
367
+ style: buttonStyle,
368
+ testID: testID ? `${testID}-previous` : undefined,
369
+ children: /* @__PURE__ */ jsx(import_react_native2.Text, {
370
+ style: labelStyle,
371
+ children: "‹"
372
+ })
373
+ }),
374
+ /* @__PURE__ */ jsx(import_react_native2.Pressable, {
375
+ accessibilityLabel: nextLabel,
376
+ accessibilityRole: "button",
377
+ disabled: !canNext || controlledWithoutHandler,
378
+ onPress: () => navigate(activeIndex + 1, 1),
379
+ style: buttonStyle,
380
+ testID: testID ? `${testID}-next` : undefined,
381
+ children: /* @__PURE__ */ jsx(import_react_native2.Text, {
382
+ style: labelStyle,
383
+ children: "›"
384
+ })
385
+ })
386
+ ]
387
+ });
388
+ }
389
+ function CarouselIndicators({
390
+ activeIndex,
391
+ activeColor,
392
+ controlledWithoutHandler,
393
+ idleColor,
394
+ indicatorsStyle,
395
+ navigate,
396
+ show,
397
+ slides,
398
+ testID
399
+ }) {
400
+ if (!show)
401
+ return null;
402
+ return /* @__PURE__ */ jsx(import_react_native2.View, {
403
+ pointerEvents: "box-none",
404
+ style: [styles.indicators, indicatorsStyle],
405
+ children: slides.map((slide, slideIndex) => /* @__PURE__ */ jsx(import_react_native2.Pressable, {
406
+ accessibilityLabel: `Go to slide ${slideIndex + 1} of ${slides.length}`,
407
+ accessibilityRole: "button",
408
+ accessibilityState: { selected: slideIndex === activeIndex },
409
+ disabled: controlledWithoutHandler,
410
+ onPress: () => navigate(slideIndex, slideIndex < activeIndex ? -1 : 1),
411
+ style: [
412
+ styles.indicator,
413
+ {
414
+ backgroundColor: slideIndex === activeIndex ? activeColor : idleColor,
415
+ width: slideIndex === activeIndex ? 24 : 8
416
+ }
417
+ ],
418
+ testID: testID ? `${testID}-indicator-${slideIndex}` : undefined
419
+ }, slide.key))
420
+ });
421
+ }
422
+ function CarouselProgress({
423
+ height,
424
+ indicatorColor,
425
+ indicatorStyle,
426
+ progress,
427
+ show,
428
+ testID,
429
+ trackColor,
430
+ trackStyle
431
+ }) {
432
+ if (!show)
433
+ return null;
434
+ return /* @__PURE__ */ jsx(import_react_native2.View, {
435
+ pointerEvents: "none",
436
+ style: [styles.progress, { height, backgroundColor: trackColor }, trackStyle],
437
+ testID: testID ? `${testID}-progress` : undefined,
438
+ children: /* @__PURE__ */ jsx(import_react_native2.Animated.View, {
439
+ style: [
440
+ {
441
+ height: "100%",
442
+ width: progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }),
443
+ backgroundColor: indicatorColor
444
+ },
445
+ indicatorStyle
446
+ ]
447
+ })
448
+ });
449
+ }
450
+ var styles = import_react_native2.StyleSheet.create({
451
+ controls: {
452
+ position: "absolute",
453
+ top: 0,
454
+ bottom: 0,
455
+ left: 14,
456
+ right: 14,
457
+ flexDirection: "row",
458
+ justifyContent: "space-between",
459
+ alignItems: "center"
460
+ },
461
+ control: {
462
+ width: 44,
463
+ height: 44,
464
+ borderRadius: 22,
465
+ justifyContent: "center",
466
+ alignItems: "center"
467
+ },
468
+ indicators: {
469
+ position: "absolute",
470
+ bottom: 24,
471
+ left: 0,
472
+ right: 0,
473
+ flexDirection: "row",
474
+ gap: 10,
475
+ justifyContent: "center",
476
+ alignItems: "center"
477
+ },
478
+ indicator: { height: 8, borderRadius: 8 },
479
+ progress: { position: "absolute", bottom: 0, left: 0, right: 0, overflow: "hidden" }
480
+ });
481
+ export {
482
+ Carousel
483
+ };
@@ -0,0 +1,55 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import type { ImageResizeMode, ImageSourcePropType, ImageStyle, StyleProp, ViewStyle } from 'react-native';
4
+
5
+ export type CarouselTransition = 'fade' | 'slide' | 'none';
6
+
7
+ /** One presentation frame: an image, arbitrary React content, or both. */
8
+ export interface CarouselSlide {
9
+ key: string;
10
+ source?: string | ImageSourcePropType;
11
+ alt?: string;
12
+ content?: ReactNode;
13
+ }
14
+
15
+ /** Configurable cross-platform carousel; the consumer owns slide content. */
16
+ export interface CarouselProps {
17
+ slides: readonly CarouselSlide[];
18
+ /** Controlled index. If omitted, Carousel manages its own position. */
19
+ index?: number;
20
+ defaultIndex?: number;
21
+ onIndexChange?: (index: number) => void;
22
+ autoPlay?: boolean;
23
+ paused?: boolean;
24
+ loop?: boolean;
25
+ intervalMs?: number;
26
+ transition?: CarouselTransition;
27
+ enterDurationMs?: number;
28
+ exitDurationMs?: number;
29
+ initialScale?: number;
30
+ animateOnMount?: boolean;
31
+ /** Overrides the host OS preference when explicitly supplied. */
32
+ reducedMotion?: boolean;
33
+ showProgress?: boolean;
34
+ progressHeight?: number;
35
+ progressTrackColor?: string;
36
+ progressIndicatorColor?: string;
37
+ progressTrackStyle?: StyleProp<ViewStyle>;
38
+ progressIndicatorStyle?: StyleProp<ViewStyle>;
39
+ showArrows?: boolean;
40
+ showIndicators?: boolean;
41
+ previousLabel?: string;
42
+ nextLabel?: string;
43
+ controlColor?: string;
44
+ controlBackgroundColor?: string;
45
+ controlsStyle?: StyleProp<ViewStyle>;
46
+ activeIndicatorColor?: string;
47
+ inactiveIndicatorColor?: string;
48
+ indicatorsStyle?: StyleProp<ViewStyle>;
49
+ resizeMode?: ImageResizeMode;
50
+ imageStyle?: StyleProp<ImageStyle>;
51
+ style?: StyleProp<ViewStyle>;
52
+ /** Enables Next/Image or another consumer-specific image optimization. */
53
+ renderImage?: (slide: CarouselSlide, index: number) => ReactNode;
54
+ testID?: string;
55
+ }
@@ -0,0 +1,2 @@
1
+ export { Carousel } from './Carousel.js';
2
+ export type { CarouselProps, CarouselSlide, CarouselTransition } from './Carousel.js';
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { Carousel } from './Carousel.js';
@@ -1,22 +1,23 @@
1
1
  'use client';
2
2
  import"../../chunks/Accordion-zj4wnm3e.js";
3
- import"../../chunks/Accordion-tpd1vvy9.js";
4
- import"../../chunks/Accordion-c44m1q0m.js";
5
- import"../../chunks/Accordion-vzgpdtr2.js";
6
- import"../../chunks/Accordion-mrhkw8n6.js";
7
- import"../../chunks/Accordion-9hcbf56f.js";
8
- import"../../chunks/Accordion-a8k3cvj0.js";
9
- import"../../chunks/Accordion-r6zvzrkd.js";
10
- import"../../chunks/Accordion-ew2cebyd.js";
11
- import"../../chunks/Accordion-260pyaxy.js";
12
- import"../../chunks/Accordion-8vcs6nz6.js";
13
- import"../../chunks/Accordion-ms1y70gq.js";
3
+ import"../../chunks/Accordion-ng79nxzz.js";
4
+ import"../../chunks/Accordion-xkewtxac.js";
5
+ import"../../chunks/Accordion-wdby2v5r.js";
6
+ import"../../chunks/Accordion-kcx57mk5.js";
7
+ import"../../chunks/Accordion-hqg1zbxk.js";
8
+ import"../../chunks/Accordion-h4928ex8.js";
9
+ import"../../chunks/Accordion-qyf0e72g.js";
10
+ import"../../chunks/Accordion-gwq0xkp9.js";
11
+ import"../../chunks/Accordion-rxc2p9md.js";
12
+ import"../../chunks/Accordion-54417vp7.js";
13
+ import"../../chunks/Accordion-9cpm8x92.js";
14
+ import"../../chunks/Accordion-c1btejmf.js";
14
15
  import {
15
16
  ChatListItem2
16
- } from "../../chunks/Accordion-hh48jjhk.js";
17
+ } from "../../chunks/Accordion-rbtgfrn4.js";
17
18
  import"../../chunks/Accordion-c6edgxay.js";
18
- import"../../chunks/Accordion-9d3rd7ne.js";
19
- import"../../chunks/Accordion-gysa24fk.js";
19
+ import"../../chunks/Accordion-19zt3dyq.js";
20
+ import"../../chunks/Accordion-j5wsx41j.js";
20
21
  import"../../chunks/Accordion-fre84yaq.js";
21
22
  import"../../chunks/Accordion-xgpzh4wq.js";
22
23
  export {
@@ -1,20 +1,21 @@
1
1
  'use client';
2
2
  import"../../chunks/Accordion-mnac2z83.js";
3
3
  import"../../chunks/Accordion-zj4wnm3e.js";
4
- import"../../chunks/Accordion-a8k3cvj0.js";
5
- import"../../chunks/Accordion-tpd1vvy9.js";
6
- import"../../chunks/Accordion-c44m1q0m.js";
7
- import"../../chunks/Accordion-8vcs6nz6.js";
4
+ import"../../chunks/Accordion-qyf0e72g.js";
5
+ import"../../chunks/Accordion-ng79nxzz.js";
6
+ import"../../chunks/Accordion-xkewtxac.js";
7
+ import"../../chunks/Accordion-9cpm8x92.js";
8
8
  import {
9
9
  Checkbox2
10
- } from "../../chunks/Accordion-fbehwpr1.js";
11
- import"../../chunks/Accordion-mrhkw8n6.js";
12
- import"../../chunks/Accordion-r6zvzrkd.js";
13
- import"../../chunks/Accordion-ew2cebyd.js";
10
+ } from "../../chunks/Accordion-1ty4zrzd.js";
11
+ import"../../chunks/Accordion-kcx57mk5.js";
12
+ import"../../chunks/Accordion-hqg1zbxk.js";
13
+ import"../../chunks/Accordion-gwq0xkp9.js";
14
+ import"../../chunks/Accordion-rxc2p9md.js";
14
15
  import"../../chunks/Accordion-61e19g3e.js";
15
16
  import"../../chunks/Accordion-c6edgxay.js";
16
- import"../../chunks/Accordion-9d3rd7ne.js";
17
- import"../../chunks/Accordion-gysa24fk.js";
17
+ import"../../chunks/Accordion-19zt3dyq.js";
18
+ import"../../chunks/Accordion-j5wsx41j.js";
18
19
  import"../../chunks/Accordion-fre84yaq.js";
19
20
  import"../../chunks/Accordion-xgpzh4wq.js";
20
21
  export {
@@ -1,20 +1,21 @@
1
1
  'use client';
2
2
  import"../../chunks/Accordion-mnac2z83.js";
3
3
  import"../../chunks/Accordion-zj4wnm3e.js";
4
- import"../../chunks/Accordion-a8k3cvj0.js";
5
- import"../../chunks/Accordion-tpd1vvy9.js";
6
- import"../../chunks/Accordion-c44m1q0m.js";
7
- import"../../chunks/Accordion-8vcs6nz6.js";
4
+ import"../../chunks/Accordion-qyf0e72g.js";
5
+ import"../../chunks/Accordion-ng79nxzz.js";
6
+ import"../../chunks/Accordion-xkewtxac.js";
7
+ import"../../chunks/Accordion-9cpm8x92.js";
8
8
  import {
9
9
  CheckboxGroup2
10
- } from "../../chunks/Accordion-fbehwpr1.js";
11
- import"../../chunks/Accordion-mrhkw8n6.js";
12
- import"../../chunks/Accordion-r6zvzrkd.js";
13
- import"../../chunks/Accordion-ew2cebyd.js";
10
+ } from "../../chunks/Accordion-1ty4zrzd.js";
11
+ import"../../chunks/Accordion-kcx57mk5.js";
12
+ import"../../chunks/Accordion-hqg1zbxk.js";
13
+ import"../../chunks/Accordion-gwq0xkp9.js";
14
+ import"../../chunks/Accordion-rxc2p9md.js";
14
15
  import"../../chunks/Accordion-61e19g3e.js";
15
16
  import"../../chunks/Accordion-c6edgxay.js";
16
- import"../../chunks/Accordion-9d3rd7ne.js";
17
- import"../../chunks/Accordion-gysa24fk.js";
17
+ import"../../chunks/Accordion-19zt3dyq.js";
18
+ import"../../chunks/Accordion-j5wsx41j.js";
18
19
  import"../../chunks/Accordion-fre84yaq.js";
19
20
  import"../../chunks/Accordion-xgpzh4wq.js";
20
21
  export {
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
  import"../../chunks/Accordion-neg1cgeh.js";
3
- import"../../chunks/Accordion-tpd1vvy9.js";
4
- import"../../chunks/Accordion-mrhkw8n6.js";
3
+ import"../../chunks/Accordion-kcx57mk5.js";
4
+ import"../../chunks/Accordion-ng79nxzz.js";
5
+ import"../../chunks/Accordion-hqg1zbxk.js";
5
6
  import {
6
7
  ChessBoard2
7
- } from "../../chunks/Accordion-sxzts6bj.js";
8
- import"../../chunks/Accordion-gysa24fk.js";
8
+ } from "../../chunks/Accordion-1k7pyxdd.js";
9
+ import"../../chunks/Accordion-j5wsx41j.js";
9
10
  import"../../chunks/Accordion-xgpzh4wq.js";
10
11
  export {
11
12
  ChessBoard2 as ChessBoard