@ankhorage/zora 27.10.4 → 27.10.6

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 (265) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/features/carousel/Carousel.js +3 -1
  4. package/dist/features/carousel/Carousel.js.map +1 -1
  5. package/dist/features/carousel/useCarouselPlayback.d.ts.map +1 -1
  6. package/dist/features/carousel/useCarouselPlayback.js +2 -1
  7. package/dist/features/carousel/useCarouselPlayback.js.map +1 -1
  8. package/dist/features/color/ColorHexField.d.ts +9 -0
  9. package/dist/features/color/ColorHexField.d.ts.map +1 -0
  10. package/dist/features/color/ColorHexField.js +17 -0
  11. package/dist/features/color/ColorHexField.js.map +1 -0
  12. package/dist/features/color/ColorHorizontalPointerProxy.d.ts +9 -0
  13. package/dist/features/color/ColorHorizontalPointerProxy.d.ts.map +1 -0
  14. package/dist/features/color/ColorHorizontalPointerProxy.js +2 -0
  15. package/dist/features/color/ColorHorizontalPointerProxy.js.map +1 -0
  16. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts +4 -0
  17. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts.map +1 -0
  18. package/dist/features/color/ColorHorizontalPointerProxy.native.js +5 -0
  19. package/dist/features/color/ColorHorizontalPointerProxy.native.js.map +1 -0
  20. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts +5 -0
  21. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts.map +1 -0
  22. package/dist/features/color/ColorHorizontalPointerProxy.web.js +26 -0
  23. package/dist/features/color/ColorHorizontalPointerProxy.web.js.map +1 -0
  24. package/dist/features/color/ColorHueScale.d.ts.map +1 -1
  25. package/dist/features/color/ColorHueScale.js +18 -7
  26. package/dist/features/color/ColorHueScale.js.map +1 -1
  27. package/dist/features/color/ColorPicker.d.ts.map +1 -1
  28. package/dist/features/color/ColorPicker.js +37 -10
  29. package/dist/features/color/ColorPicker.js.map +1 -1
  30. package/dist/features/color/ColorSpectrumSlider.d.ts +9 -0
  31. package/dist/features/color/ColorSpectrumSlider.d.ts.map +1 -0
  32. package/dist/features/color/ColorSpectrumSlider.js +38 -0
  33. package/dist/features/color/ColorSpectrumSlider.js.map +1 -0
  34. package/dist/features/color/ColorTone.d.ts.map +1 -1
  35. package/dist/features/color/ColorTone.js +71 -12
  36. package/dist/features/color/ColorTone.js.map +1 -1
  37. package/dist/features/color/ColorWheel.d.ts.map +1 -1
  38. package/dist/features/color/ColorWheel.js +64 -36
  39. package/dist/features/color/ColorWheel.js.map +1 -1
  40. package/dist/features/color/ColorWheelPointerProxy.d.ts +10 -0
  41. package/dist/features/color/ColorWheelPointerProxy.d.ts.map +1 -0
  42. package/dist/features/color/ColorWheelPointerProxy.js +2 -0
  43. package/dist/features/color/ColorWheelPointerProxy.js.map +1 -0
  44. package/dist/features/color/ColorWheelPointerProxy.native.d.ts +4 -0
  45. package/dist/features/color/ColorWheelPointerProxy.native.d.ts.map +1 -0
  46. package/dist/features/color/ColorWheelPointerProxy.native.js +5 -0
  47. package/dist/features/color/ColorWheelPointerProxy.native.js.map +1 -0
  48. package/dist/features/color/ColorWheelPointerProxy.web.d.ts +5 -0
  49. package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -0
  50. package/dist/features/color/ColorWheelPointerProxy.web.js +26 -0
  51. package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -0
  52. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
  53. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +14 -2
  54. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
  55. package/dist/types/color.d.ts +2 -0
  56. package/dist/types/color.d.ts.map +1 -1
  57. package/dist/types/color.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/features/carousel/Carousel.test.ts +1 -0
  60. package/src/features/carousel/Carousel.tsx +3 -1
  61. package/src/features/carousel/useCarouselPlayback.ts +2 -1
  62. package/src/features/color/ColorHexField.tsx +45 -0
  63. package/src/features/color/ColorHorizontalPointerProxy.native.tsx +6 -0
  64. package/src/features/color/ColorHorizontalPointerProxy.tsx +10 -0
  65. package/src/features/color/ColorHorizontalPointerProxy.web.tsx +45 -0
  66. package/src/features/color/ColorHueScale.tsx +48 -29
  67. package/src/features/color/ColorPicker.layout.test.tsx +72 -0
  68. package/src/features/color/ColorPicker.tsx +74 -20
  69. package/src/features/color/ColorSpectrumSlider.tsx +79 -0
  70. package/src/features/color/ColorTone.tsx +138 -21
  71. package/src/features/color/ColorWheel.tsx +173 -92
  72. package/src/features/color/ColorWheelPointerProxy.native.tsx +6 -0
  73. package/src/features/color/ColorWheelPointerProxy.tsx +11 -0
  74. package/src/features/color/ColorWheelPointerProxy.web.tsx +51 -0
  75. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +18 -0
  76. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +18 -2
  77. package/src/types/color.ts +2 -0
  78. package/web-dist/chunks/{Accordion-mxad79vq.js → Accordion-0kr0h68p.js} +4568 -669
  79. package/web-dist/chunks/{Accordion-0jkpvxwd.js → Accordion-1etqb3cj.js} +2 -2
  80. package/web-dist/chunks/{Accordion-jr0201qc.js → Accordion-1mxnyexh.js} +17 -17
  81. package/web-dist/chunks/{Accordion-9kkfz7s8.js → Accordion-3ecnh8d0.js} +4 -4
  82. package/web-dist/chunks/{Accordion-jsapannb.js → Accordion-3jkeydhb.js} +4 -4
  83. package/web-dist/chunks/{Accordion-r6gwemh9.js → Accordion-3wkd5x2q.js} +3 -3
  84. package/web-dist/chunks/{Accordion-0bgzetnd.js → Accordion-3zw817fr.js} +6 -6
  85. package/web-dist/chunks/{Accordion-91v243pz.js → Accordion-49w9bc2f.js} +2 -2
  86. package/web-dist/chunks/{Accordion-8vw4k0s6.js → Accordion-4g54je0w.js} +2 -2
  87. package/web-dist/chunks/{Accordion-1andv7gg.js → Accordion-5vs1k81g.js} +8 -8
  88. package/web-dist/chunks/{Accordion-ttjyk97v.js → Accordion-6m3k4avp.js} +2 -2
  89. package/web-dist/chunks/{Accordion-dnfrzbpb.js → Accordion-6nrpdbmb.js} +7 -7
  90. package/web-dist/chunks/{Accordion-y524ph0g.js → Accordion-6yv4beha.js} +1 -1
  91. package/web-dist/chunks/{Accordion-9cpm8x92.js → Accordion-705yrq6w.js} +1 -1
  92. package/web-dist/chunks/{Accordion-th8pkeqc.js → Accordion-8g9c7890.js} +4 -4
  93. package/web-dist/chunks/{Accordion-6qesggn9.js → Accordion-9c63jn3m.js} +4 -4
  94. package/web-dist/chunks/{Accordion-1mjn0atk.js → Accordion-aws0caav.js} +3 -3
  95. package/web-dist/chunks/{Accordion-hha54x4c.js → Accordion-bd6q61s1.js} +5 -5
  96. package/web-dist/chunks/{Accordion-8rkwd0wx.js → Accordion-c0a7mhq3.js} +2 -2
  97. package/web-dist/chunks/{Accordion-j5wsx41j.js → Accordion-c3nna2bz.js} +1 -1
  98. package/web-dist/chunks/{Accordion-r6mc7qtj.js → Accordion-dfq04q82.js} +9 -9
  99. package/web-dist/chunks/{Accordion-nbje2ywp.js → Accordion-e3r3573t.js} +3 -3
  100. package/web-dist/chunks/{Accordion-hqg1zbxk.js → Accordion-e5jr9ahb.js} +1 -1
  101. package/web-dist/chunks/{Accordion-pkbvsn5y.js → Accordion-eak89n4n.js} +6 -6
  102. package/web-dist/chunks/{Accordion-7e0mb55z.js → Accordion-f60g73bp.js} +6 -6
  103. package/web-dist/chunks/{Accordion-grtf75xt.js → Accordion-g451f3g9.js} +4 -4
  104. package/web-dist/chunks/{Accordion-27rxpbvf.js → Accordion-gezcm372.js} +4 -4
  105. package/web-dist/chunks/{Accordion-45tbe5v0.js → Accordion-h0e95qxp.js} +9 -9
  106. package/web-dist/chunks/{Accordion-m7jt3c87.js → Accordion-h2nd5y0z.js} +5 -5
  107. package/web-dist/chunks/{Accordion-f6k281sv.js → Accordion-j0zhpq4s.js} +7 -7
  108. package/web-dist/chunks/{Accordion-q6xnm1k4.js → Accordion-jbwey4za.js} +17 -17
  109. package/web-dist/chunks/{Accordion-vdqc8rxv.js → Accordion-jd26f516.js} +3 -3
  110. package/web-dist/chunks/{Accordion-1k7pyxdd.js → Accordion-ne91vwkd.js} +2 -2
  111. package/web-dist/chunks/{Accordion-k058095e.js → Accordion-p29kmwh9.js} +1 -1
  112. package/web-dist/chunks/{Accordion-0pbcs0xf.js → Accordion-pcj256bc.js} +5 -5
  113. package/web-dist/chunks/{Accordion-8wq38d9b.js → Accordion-phtyg3k4.js} +7 -7
  114. package/web-dist/chunks/{Accordion-b991pn6e.js → Accordion-pmfdf08d.js} +1 -1
  115. package/web-dist/chunks/{Accordion-xp2t3pkj.js → Accordion-q1tdazgq.js} +8 -8
  116. package/web-dist/chunks/{Accordion-v21vz0cg.js → Accordion-qhn8z92r.js} +3 -3
  117. package/web-dist/chunks/Accordion-r1wkgt7c.js +1074 -0
  118. package/web-dist/chunks/{Accordion-ctcxh9pk.js → Accordion-rzf52xq8.js} +2 -2
  119. package/web-dist/chunks/{Accordion-hrxdchkq.js → Accordion-vewhx028.js} +8 -8
  120. package/web-dist/chunks/{Accordion-jsdjgfn2.js → Accordion-vk2v1zwv.js} +2 -2
  121. package/web-dist/chunks/{Accordion-19zt3dyq.js → Accordion-vnrqvfca.js} +1 -1
  122. package/web-dist/chunks/{Accordion-rt4jfq2r.js → Accordion-x0p3wxfp.js} +2 -2
  123. package/web-dist/chunks/{Accordion-w1ag7sr4.js → Accordion-x7ynjdv7.js} +1 -1
  124. package/web-dist/chunks/{Accordion-ga82tcs9.js → Accordion-xb174981.js} +10 -10
  125. package/web-dist/chunks/{Accordion-yskcfahv.js → Accordion-xwstve3k.js} +2 -2
  126. package/web-dist/chunks/{Accordion-xb2nj0q6.js → Accordion-ysmzrvhn.js} +3 -3
  127. package/web-dist/chunks/{Accordion-tnq8bt8v.js → Accordion-z4qakakw.js} +2 -2
  128. package/web-dist/chunks/{Accordion-w9vbdg9r.js → Accordion-z8ryq8cb.js} +11 -11
  129. package/web-dist/chunks/{Accordion-x3em7tpd.js → Accordion-zx8gmww4.js} +9 -9
  130. package/web-dist/components/accordion/Accordion.js +10 -10
  131. package/web-dist/components/accordion-item/AccordionItem.js +10 -10
  132. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  133. package/web-dist/components/app-bar/AppBar.js +15 -16
  134. package/web-dist/components/app-header/AppHeader.js +15 -16
  135. package/web-dist/components/app-shell/AppShell.js +4 -4
  136. package/web-dist/components/auth-screen/AuthScreen.js +20 -21
  137. package/web-dist/components/avatar/Avatar.js +10 -10
  138. package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
  139. package/web-dist/components/badge/Badge.js +5 -5
  140. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -19
  141. package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
  142. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
  143. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
  144. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
  145. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
  146. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
  147. package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -16
  148. package/web-dist/components/button/Button.js +13 -14
  149. package/web-dist/components/button-group/ButtonGroup.js +11 -12
  150. package/web-dist/components/calendar/Calendar.js +12 -13
  151. package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -19
  152. package/web-dist/components/card/Card.js +17 -18
  153. package/web-dist/components/card-back/CardBack.js +4 -4
  154. package/web-dist/components/card-hand/CardHand.js +4 -4
  155. package/web-dist/components/carousel/Carousel.js +7 -4
  156. package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
  157. package/web-dist/components/checkbox/Checkbox.js +10 -10
  158. package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
  159. package/web-dist/components/chess-board/ChessBoard.js +4 -4
  160. package/web-dist/components/chip/Chip.js +11 -11
  161. package/web-dist/components/chip-group/ChipGroup.js +11 -11
  162. package/web-dist/components/collection-editor/CollectionEditor.js +21 -22
  163. package/web-dist/components/color-hue-scale/ColorHueScale.js +15 -14
  164. package/web-dist/components/color-picker/ColorPicker.js +15 -14
  165. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +2 -0
  166. package/web-dist/components/color-tone/ColorTone.js +15 -14
  167. package/web-dist/components/color-wheel/ColorWheel.js +15 -14
  168. package/web-dist/components/content-rail/ContentRail.js +13 -14
  169. package/web-dist/components/data-table/DataTable.js +27 -28
  170. package/web-dist/components/date-picker/DatePicker.js +19 -20
  171. package/web-dist/components/dialog/Dialog.js +9 -9
  172. package/web-dist/components/divider/Divider.js +4 -4
  173. package/web-dist/components/empty-state/EmptyState.js +18 -19
  174. package/web-dist/components/explorer/Explorer.js +11 -11
  175. package/web-dist/components/field/Field.js +10 -10
  176. package/web-dist/components/file-explorer/FileExplorer.js +11 -11
  177. package/web-dist/components/flat-list/FlatList.js +11 -11
  178. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +20 -21
  179. package/web-dist/components/form/Form.js +14 -15
  180. package/web-dist/components/form-actions/FormActions.js +14 -15
  181. package/web-dist/components/form-error/FormError.js +14 -15
  182. package/web-dist/components/game/Game.js +5 -5
  183. package/web-dist/components/game-entity/GameEntity.js +5 -5
  184. package/web-dist/components/game-field/GameField.js +5 -5
  185. package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
  186. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
  187. package/web-dist/components/game-overlay/GameOverlay.js +5 -5
  188. package/web-dist/components/gradient/Gradient.js +5 -5
  189. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
  190. package/web-dist/components/graph-view/GraphView.js +9 -2
  191. package/web-dist/components/grid/Grid.js +4 -4
  192. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
  193. package/web-dist/components/grid-ruler/GridRuler.js +4 -4
  194. package/web-dist/components/heading/Heading.js +5 -5
  195. package/web-dist/components/hero/Hero.js +20 -21
  196. package/web-dist/components/icon/Icon.js +4 -4
  197. package/web-dist/components/icon-button/IconButton.js +11 -12
  198. package/web-dist/components/image/Image.js +8 -8
  199. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
  200. package/web-dist/components/list/List.js +11 -11
  201. package/web-dist/components/list-item/ListItem.js +11 -11
  202. package/web-dist/components/list-section/ListSection.js +11 -11
  203. package/web-dist/components/master-detail/MasterDetail.js +4 -4
  204. package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
  205. package/web-dist/components/media-card/MediaCard.js +17 -18
  206. package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
  207. package/web-dist/components/message-bubble/MessageBubble.js +14 -14
  208. package/web-dist/components/metric-card/MetricCard.js +17 -18
  209. package/web-dist/components/missing-element/MissingElement.js +9 -9
  210. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +20 -21
  211. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +20 -21
  212. package/web-dist/components/opening-book/OpeningBook.js +4 -4
  213. package/web-dist/components/otp-form/OtpForm.js +20 -21
  214. package/web-dist/components/pagination/Pagination.js +18 -19
  215. package/web-dist/components/palette-item/PaletteItem.js +17 -18
  216. package/web-dist/components/playing-card/PlayingCard.js +4 -4
  217. package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
  218. package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
  219. package/web-dist/components/post-card/PostCard.js +17 -18
  220. package/web-dist/components/product-card/ProductCard.js +17 -18
  221. package/web-dist/components/progress/Progress.js +8 -8
  222. package/web-dist/components/progress-ring/ProgressRing.js +8 -8
  223. package/web-dist/components/radio/Radio.js +12 -12
  224. package/web-dist/components/radio-group/RadioGroup.js +12 -12
  225. package/web-dist/components/rating/Rating.js +7 -7
  226. package/web-dist/components/reader/Reader.js +20 -21
  227. package/web-dist/components/scan-overlay/ScanOverlay.js +18 -19
  228. package/web-dist/components/screen/Screen.js +4 -4
  229. package/web-dist/components/screen-section/ScreenSection.js +8 -8
  230. package/web-dist/components/scroll-view/ScrollView.js +4 -4
  231. package/web-dist/components/search-input/SearchInput.js +12 -13
  232. package/web-dist/components/section-header/SectionHeader.js +8 -8
  233. package/web-dist/components/section-list/SectionList.js +11 -11
  234. package/web-dist/components/select/Select.js +16 -17
  235. package/web-dist/components/selectable-item/SelectableItem.js +3 -3
  236. package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
  237. package/web-dist/components/sign-in-form/SignInForm.js +20 -21
  238. package/web-dist/components/sign-up-form/SignUpForm.js +20 -21
  239. package/web-dist/components/skeleton/Skeleton.js +20 -21
  240. package/web-dist/components/skeleton-card/SkeletonCard.js +20 -21
  241. package/web-dist/components/skeleton-list/SkeletonList.js +20 -21
  242. package/web-dist/components/skeleton-text/SkeletonText.js +20 -21
  243. package/web-dist/components/surface/Surface.js +5 -5
  244. package/web-dist/components/switch/Switch.js +5 -5
  245. package/web-dist/components/tab/Tab.js +5 -5
  246. package/web-dist/components/tab-list/TabList.js +5 -5
  247. package/web-dist/components/tab-panel/TabPanel.js +5 -5
  248. package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
  249. package/web-dist/components/tabs/Tabs.js +5 -5
  250. package/web-dist/components/text/Text.js +5 -5
  251. package/web-dist/components/text-input/TextInput.js +12 -13
  252. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +12 -13
  253. package/web-dist/components/time-picker/TimePicker.js +19 -20
  254. package/web-dist/components/timeline/Timeline.js +10 -10
  255. package/web-dist/components/toast/Toast.js +7 -7
  256. package/web-dist/components/toast-provider/ToastProvider.js +7 -7
  257. package/web-dist/components/toolbar/Toolbar.js +17 -18
  258. package/web-dist/components/tree-item/TreeItem.js +17 -18
  259. package/web-dist/components/uploader/Uploader.js +26 -27
  260. package/web-dist/components/view/View.js +4 -4
  261. package/web-dist/manifest.json +1417 -1459
  262. package/web-dist/runtime/ZoraProvider.js +6 -6
  263. package/web-dist/chunks/Accordion-fjnb7anx.js +0 -548
  264. package/web-dist/chunks/Accordion-ztcmb44y.js +0 -3928
  265. package/web-dist/chunks/{Accordion-ng79nxzz.js → Accordion-an5prgty.js} +18 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 27.10.6
4
+
5
+ ### Patch Changes
6
+
7
+ - d9e3eb6: Animate Carousel autoplay progress using a native-capable scale transform instead of layout width changes, without blocking interactions.
8
+
9
+ ## 27.10.5
10
+
11
+ ### Patch Changes
12
+
13
+ - b8aaf87: Improve the controlled ColorPicker header and wheel press selection while consuming the viewport-safe Surface Popover release.
14
+ - e0eb68b: Preserve retained GraphView positions when rich-node measurements arrive after a controlled topology update.
15
+
3
16
  ## 27.10.4
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # ZORA
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v27.10.4](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: configured](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v27.10.6](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: configured](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Provides opinionated React Native and React Native Web UI components, theme primitives, registries, and reader surfaces built on @ankhorage/surface.
9
9
 
@@ -162,7 +162,9 @@ function CarouselProgress({ height, indicatorColor, indicatorStyle, progress, sh
162
162
  <Animated.View style={[
163
163
  {
164
164
  height: '100%',
165
- width: progress.interpolate({ inputRange: [0, 1], outputRange: ['0%', '100%'] }),
165
+ width: '100%',
166
+ transformOrigin: 'left center',
167
+ transform: [{ scaleX: progress }],
166
168
  backgroundColor: indicatorColor,
167
169
  },
168
170
  indicatorStyle,
@@ -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,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG1F,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EACV,UAAU,GAAG,MAAM,EACnB,eAAe,GAAG,IAAI,EACtB,cAAc,GAAG,GAAG,EACpB,YAAY,GAAG,IAAI,EACnB,cAAc,GAAG,KAAK,EACtB,aAAa,EACb,YAAY,GAAG,IAAI,EACnB,cAAc,GAAG,CAAC,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,gBAAgB,EAChC,SAAS,GAAG,YAAY,EACxB,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAU,GAAG,OAAO,EACpB,UAAU,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AU,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 {\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: progress.interpolate({ inputRange: [0, 1], outputRange: ['0%', '100%'] }),\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,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EACV,UAAU,GAAG,MAAM,EACnB,eAAe,GAAG,IAAI,EACtB,cAAc,GAAG,GAAG,EACpB,YAAY,GAAG,IAAI,EACnB,cAAc,GAAG,KAAK,EACtB,aAAa,EACb,YAAY,GAAG,IAAI,EACnB,cAAc,GAAG,CAAC,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,gBAAgB,EAChC,SAAS,GAAG,YAAY,EACxB,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,UAAU,GAAG,OAAO,EACpB,UAAU,EACV,KAAK,EACL,WAAW,EACX,MAAM,GACQ;IACd,MAAM,EAAE,KAAK,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,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 {\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 +1 @@
1
- {"version":3,"file":"useCarouselPlayback.d.ts","sourceRoot":"","sources":["../../../src/features/carousel/useCarouselPlayback.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,QAAQ,EAAU,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,YAAgB,EAChB,aAAa,EACb,QAAe,EACf,MAAc,EACd,IAAW,EACX,UAAiB,EACjB,aAAa,GACd,EAAE,uBAAuB;;;;;gCAcb,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;;;EA0CzC;AAED,KAAK,uBAAuB,GAAG,IAAI,CACjC,aAAa,EACX,QAAQ,GACR,OAAO,GACP,cAAc,GACd,eAAe,GACf,UAAU,GACV,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,eAAe,CAClB,CAAC"}
1
+ {"version":3,"file":"useCarouselPlayback.d.ts","sourceRoot":"","sources":["../../../src/features/carousel/useCarouselPlayback.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,QAAQ,EAAU,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,YAAgB,EAChB,aAAa,EACb,QAAe,EACf,MAAc,EACd,IAAW,EACX,UAAiB,EACjB,aAAa,GACd,EAAE,uBAAuB;;;;;gCAcb,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;;;EA2CzC;AAED,KAAK,uBAAuB,GAAG,IAAI,CACjC,aAAa,EACX,QAAQ,GACR,OAAO,GACP,cAAc,GACd,eAAe,GACf,UAAU,GACV,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,eAAe,CAClB,CAAC"}
@@ -40,7 +40,8 @@ export function useCarouselPlayback({ slides, index, defaultIndex = 0, onIndexCh
40
40
  toValue: 1,
41
41
  duration,
42
42
  easing: Easing.linear,
43
- useNativeDriver: false,
43
+ useNativeDriver: true,
44
+ isInteraction: false,
44
45
  });
45
46
  animation.start();
46
47
  return () => animation.stop();
@@ -1 +1 @@
1
- {"version":3,"file":"useCarouselPlayback.js","sourceRoot":"","sources":["../../../src/features/carousel/useCarouselPlayback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAInE,uFAAuF;AACvF,MAAM,UAAU,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,aAAa,EACb,QAAQ,GAAG,IAAI,EACf,MAAM,GAAG,KAAK,EACd,IAAI,GAAG,IAAI,EACX,UAAU,GAAG,IAAI,EACjB,aAAa,GACW;IACxB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IACrD,MAAM,kBAAkB,GAAG,aAAa,IAAI,mBAAmB,CAAC;IAChE,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,IAAI,iBAAiB,EAAE,MAAM,CAAC,MAAM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GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,KAAK,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;QACvF,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import React from 'react';\nimport { AccessibilityInfo, Animated, Easing } from 'react-native';\n\nimport type { CarouselProps } from '../../types/carousel';\n\n/*** Own controlled/uncontrolled slide navigation, autoplay, and progress lifecycle. */\nexport function useCarouselPlayback({\n slides,\n index,\n defaultIndex = 0,\n onIndexChange,\n autoPlay = true,\n paused = false,\n loop = true,\n intervalMs = 6000,\n reducedMotion,\n}: CarouselPlaybackOptions) {\n const [uncontrolledIndex, setUncontrolledIndex] = React.useState(defaultIndex);\n const [direction, setDirection] = React.useState<1 | -1>(1);\n const [progress] = React.useState(() => new Animated.Value(0));\n const systemReducedMotion = useSystemReducedMotion();\n const shouldReduceMotion = reducedMotion ?? systemReducedMotion;\n const activeIndex = normalizeIndex(index ?? uncontrolledIndex, slides.length);\n const duration = Math.max(1, intervalMs);\n const controlledWithoutHandler = index !== undefined && onIndexChange === undefined;\n const canAdvance = loop || activeIndex < slides.length - 1;\n const shouldPlay =\n autoPlay && !paused && slides.length > 1 && canAdvance && !controlledWithoutHandler;\n\n const navigate = React.useCallback(\n (target: number, nextDirection: 1 | -1) => {\n if (slides.length < 2 || controlledWithoutHandler) return;\n const next = loop\n ? (target + slides.length) % slides.length\n : normalizeIndex(target, slides.length);\n if (next === activeIndex) return;\n setDirection(nextDirection);\n if (index === undefined) setUncontrolledIndex(next);\n onIndexChange?.(next);\n },\n [activeIndex, controlledWithoutHandler, index, loop, onIndexChange, slides.length],\n );\n\n React.useEffect(() => {\n if (!shouldPlay) return;\n const timeout = setTimeout(() => navigate(activeIndex + 1, 1), duration);\n return () => clearTimeout(timeout);\n }, [activeIndex, duration, navigate, shouldPlay]);\n\n React.useEffect(() => {\n progress.stopAnimation();\n progress.setValue(0);\n if (!shouldPlay || shouldReduceMotion) return;\n const animation = Animated.timing(progress, {\n toValue: 1,\n duration,\n easing: Easing.linear,\n useNativeDriver: false,\n });\n animation.start();\n return () => animation.stop();\n }, [activeIndex, duration, progress, shouldPlay, shouldReduceMotion]);\n\n return {\n activeIndex,\n controlledWithoutHandler,\n direction,\n loop,\n navigate,\n progress,\n shouldReduceMotion,\n } as const;\n}\n\ntype CarouselPlaybackOptions = Pick<\n CarouselProps,\n | 'slides'\n | 'index'\n | 'defaultIndex'\n | 'onIndexChange'\n | 'autoPlay'\n | 'paused'\n | 'loop'\n | 'intervalMs'\n | 'reducedMotion'\n>;\n\n/*** Clamp a controlled index whenever the consumer changes the slide collection. */\nfunction normalizeIndex(value: number, count: number): number {\n if (count <= 0 || !Number.isFinite(value)) return 0;\n return Math.min(Math.max(Math.trunc(value), 0), count - 1);\n}\n\n/*** Observe reduced-motion preferences without adding browser-only imports. */\nfunction useSystemReducedMotion(): boolean {\n const [reduced, setReduced] = React.useState(false);\n React.useEffect(() => {\n void AccessibilityInfo.isReduceMotionEnabled().then(setReduced);\n const listener = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduced);\n return () => listener.remove();\n }, []);\n return reduced;\n}\n"]}
1
+ {"version":3,"file":"useCarouselPlayback.js","sourceRoot":"","sources":["../../../src/features/carousel/useCarouselPlayback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAInE,uFAAuF;AACvF,MAAM,UAAU,mBAAmB,CAAC,EAClC,MAAM,E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;QAClB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEtE,OAAO;QACL,WAAW;QACX,wBAAwB;QACxB,SAAS;QACT,IAAI;QACJ,QAAQ;QACR,QAAQ;QACR,kBAAkB;KACV,CAAC;AACb,CAAC;AAeD,oFAAoF;AACpF,SAAS,cAAc,CAAC,KAAa,EAAE,KAAa;IAClD,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,+EAA+E;AAC/E,SAAS,sBAAsB;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,KAAK,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;QACvF,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import React from 'react';\nimport { AccessibilityInfo, Animated, Easing } from 'react-native';\n\nimport type { CarouselProps } from '../../types/carousel';\n\n/*** Own controlled/uncontrolled slide navigation, autoplay, and progress lifecycle. */\nexport function useCarouselPlayback({\n slides,\n index,\n defaultIndex = 0,\n onIndexChange,\n autoPlay = true,\n paused = false,\n loop = true,\n intervalMs = 6000,\n reducedMotion,\n}: CarouselPlaybackOptions) {\n const [uncontrolledIndex, setUncontrolledIndex] = React.useState(defaultIndex);\n const [direction, setDirection] = React.useState<1 | -1>(1);\n const [progress] = React.useState(() => new Animated.Value(0));\n const systemReducedMotion = useSystemReducedMotion();\n const shouldReduceMotion = reducedMotion ?? systemReducedMotion;\n const activeIndex = normalizeIndex(index ?? uncontrolledIndex, slides.length);\n const duration = Math.max(1, intervalMs);\n const controlledWithoutHandler = index !== undefined && onIndexChange === undefined;\n const canAdvance = loop || activeIndex < slides.length - 1;\n const shouldPlay =\n autoPlay && !paused && slides.length > 1 && canAdvance && !controlledWithoutHandler;\n\n const navigate = React.useCallback(\n (target: number, nextDirection: 1 | -1) => {\n if (slides.length < 2 || controlledWithoutHandler) return;\n const next = loop\n ? (target + slides.length) % slides.length\n : normalizeIndex(target, slides.length);\n if (next === activeIndex) return;\n setDirection(nextDirection);\n if (index === undefined) setUncontrolledIndex(next);\n onIndexChange?.(next);\n },\n [activeIndex, controlledWithoutHandler, index, loop, onIndexChange, slides.length],\n );\n\n React.useEffect(() => {\n if (!shouldPlay) return;\n const timeout = setTimeout(() => navigate(activeIndex + 1, 1), duration);\n return () => clearTimeout(timeout);\n }, [activeIndex, duration, navigate, shouldPlay]);\n\n React.useEffect(() => {\n progress.stopAnimation();\n progress.setValue(0);\n if (!shouldPlay || shouldReduceMotion) return;\n const animation = Animated.timing(progress, {\n toValue: 1,\n duration,\n easing: Easing.linear,\n useNativeDriver: true,\n isInteraction: false,\n });\n animation.start();\n return () => animation.stop();\n }, [activeIndex, duration, progress, shouldPlay, shouldReduceMotion]);\n\n return {\n activeIndex,\n controlledWithoutHandler,\n direction,\n loop,\n navigate,\n progress,\n shouldReduceMotion,\n } as const;\n}\n\ntype CarouselPlaybackOptions = Pick<\n CarouselProps,\n | 'slides'\n | 'index'\n | 'defaultIndex'\n | 'onIndexChange'\n | 'autoPlay'\n | 'paused'\n | 'loop'\n | 'intervalMs'\n | 'reducedMotion'\n>;\n\n/*** Clamp a controlled index whenever the consumer changes the slide collection. */\nfunction normalizeIndex(value: number, count: number): number {\n if (count <= 0 || !Number.isFinite(value)) return 0;\n return Math.min(Math.max(Math.trunc(value), 0), count - 1);\n}\n\n/*** Observe reduced-motion preferences without adding browser-only imports. */\nfunction useSystemReducedMotion(): boolean {\n const [reduced, setReduced] = React.useState(false);\n React.useEffect(() => {\n void AccessibilityInfo.isReduceMotionEnabled().then(setReduced);\n const listener = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduced);\n return () => listener.remove();\n }, []);\n return reduced;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { type HexColor } from '@ankhorage/color-theory';
2
+ import React from 'react';
3
+ /*** Edits one controlled HEX color with the Studio-style swatch and copy affordance. */
4
+ export declare function ColorHexField({ disabled, onChange, value, }: {
5
+ readonly disabled: boolean;
6
+ readonly onChange: (color: HexColor) => void;
7
+ readonly value: HexColor;
8
+ }): React.JSX.Element;
9
+ //# sourceMappingURL=ColorHexField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHexField.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHexField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B,qBA2BA"}
@@ -0,0 +1,17 @@
1
+ import { isHexColor } from '@ankhorage/color-theory';
2
+ import { TextInput } from '@ankhorage/surface';
3
+ import React from 'react';
4
+ import { Icon } from '../icon/public';
5
+ import { View } from '../layout/public';
6
+ import { useZoraTheme } from '../theme/composition/useZoraTheme';
7
+ /*** Edits one controlled HEX color with the Studio-style swatch and copy affordance. */
8
+ export function ColorHexField({ disabled, onChange, value, }) {
9
+ const [input, setInput] = React.useState(value);
10
+ const { theme } = useZoraTheme();
11
+ return (<TextInput accessibilityLabel="Color hex value" disabled={disabled} key={value} leadingAccessory={<View bg={value} borderColor={theme.semantics.border.default} borderWidth={1} height={30} radius="s" width={30}/>} onChangeText={(nextValue) => {
12
+ setInput(nextValue);
13
+ if (isHexColor(nextValue))
14
+ onChange(nextValue);
15
+ }} trailingAccessory={<Icon color="textMuted" name="copy-outline" size="m"/>} value={input}/>);
16
+ }
17
+ //# sourceMappingURL=ColorHexField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHexField.js","sourceRoot":"","sources":["../../../src/features/color/ColorHexField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,KAAK,GAKN;IACC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,KAAK,CAAC,CAAC;IACxD,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAEjC,OAAO,CACL,CAAC,SAAS,CACR,kBAAkB,CAAC,iBAAiB,CACpC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,gBAAgB,CAAC,CACf,CAAC,IAAI,CACH,EAAE,CAAC,CAAC,KAAK,CAAC,CACV,WAAW,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAC5C,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,MAAM,CAAC,CAAC,EAAE,CAAC,CACX,MAAM,CAAC,GAAG,CACV,KAAK,CAAC,CAAC,EAAE,CAAC,EAEd,CAAC,CACD,YAAY,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE;YAC1B,QAAQ,CAAC,SAAS,CAAC,CAAC;YACpB,IAAI,UAAU,CAAC,SAAS,CAAC;gBAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC,CAAC,CACF,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAG,CAAC,CAC3E,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { type HexColor, isHexColor } from '@ankhorage/color-theory';\nimport { TextInput } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Icon } from '../icon/public';\nimport { View } from '../layout/public';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\n\n/*** Edits one controlled HEX color with the Studio-style swatch and copy affordance. */\nexport function ColorHexField({\n disabled,\n onChange,\n value,\n}: {\n readonly disabled: boolean;\n readonly onChange: (color: HexColor) => void;\n readonly value: HexColor;\n}) {\n const [input, setInput] = React.useState<string>(value);\n const { theme } = useZoraTheme();\n\n return (\n <TextInput\n accessibilityLabel=\"Color hex value\"\n disabled={disabled}\n key={value}\n leadingAccessory={\n <View\n bg={value}\n borderColor={theme.semantics.border.default}\n borderWidth={1}\n height={30}\n radius=\"s\"\n width={30}\n />\n }\n onChangeText={(nextValue) => {\n setInput(nextValue);\n if (isHexColor(nextValue)) onChange(nextValue);\n }}\n trailingAccessory={<Icon color=\"textMuted\" name=\"copy-outline\" size=\"m\" />}\n value={input}\n />\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type React from 'react';
2
+ export { ColorHorizontalPointerProxy } from './ColorHorizontalPointerProxy.native';
3
+ export interface ColorHorizontalPointerProxyProps {
4
+ readonly children: React.ReactNode;
5
+ readonly disabled: boolean;
6
+ readonly onChange: (locationX: number) => void;
7
+ readonly width: number;
8
+ }
9
+ //# sourceMappingURL=ColorHorizontalPointerProxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export { ColorHorizontalPointerProxy } from './ColorHorizontalPointerProxy.native';
2
+ //# sourceMappingURL=ColorHorizontalPointerProxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.js","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["import type React from 'react';\n\nexport { ColorHorizontalPointerProxy } from './ColorHorizontalPointerProxy.native';\n\nexport interface ColorHorizontalPointerProxyProps {\n readonly children: React.ReactNode;\n readonly disabled: boolean;\n readonly onChange: (locationX: number) => void;\n readonly width: number;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ColorHorizontalPointerProxyProps } from './ColorHorizontalPointerProxy';
2
+ /*** Leaves native SVG responders in charge of horizontal slider gestures. */
3
+ export declare function ColorHorizontalPointerProxy({ children }: ColorHorizontalPointerProxyProps): import("react").ReactNode;
4
+ //# sourceMappingURL=ColorHorizontalPointerProxy.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.native.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEtF,6EAA6E;AAC7E,wBAAgB,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE,gCAAgC,6BAEzF"}
@@ -0,0 +1,5 @@
1
+ /*** Leaves native SVG responders in charge of horizontal slider gestures. */
2
+ export function ColorHorizontalPointerProxy({ children }) {
3
+ return children;
4
+ }
5
+ //# sourceMappingURL=ColorHorizontalPointerProxy.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.native.js","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.native.tsx"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,UAAU,2BAA2B,CAAC,EAAE,QAAQ,EAAoC;IACxF,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { ColorHorizontalPointerProxyProps } from './ColorHorizontalPointerProxy';\n\n/*** Leaves native SVG responders in charge of horizontal slider gestures. */\nexport function ColorHorizontalPointerProxy({ children }: ColorHorizontalPointerProxyProps) {\n return children;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ColorHorizontalPointerProxyProps } from './ColorHorizontalPointerProxy';
3
+ /*** Maps browser drag coordinates into an SVG slider's stable viewbox width. */
4
+ export declare function ColorHorizontalPointerProxy({ children, disabled, onChange, width, }: ColorHorizontalPointerProxyProps): React.JSX.Element;
5
+ //# sourceMappingURL=ColorHorizontalPointerProxy.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.web.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEtF,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,GACN,EAAE,gCAAgC,qBA2BlC"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ /*** Maps browser drag coordinates into an SVG slider's stable viewbox width. */
3
+ export function ColorHorizontalPointerProxy({ children, disabled, onChange, width, }) {
4
+ const dragging = React.useRef(false);
5
+ const changeAt = (event) => {
6
+ const target = event.currentTarget;
7
+ const rect = target.getBoundingClientRect();
8
+ onChange(((event.clientX - rect.left) / rect.width) * width);
9
+ };
10
+ return (<div onMouseDown={(event) => {
11
+ if (disabled)
12
+ return;
13
+ dragging.current = true;
14
+ changeAt(event);
15
+ }} onMouseMove={(event) => {
16
+ if (!disabled && dragging.current)
17
+ changeAt(event);
18
+ }} onMouseUp={(event) => {
19
+ if (!disabled && dragging.current)
20
+ changeAt(event);
21
+ dragging.current = false;
22
+ }} style={{ touchAction: 'none' }}>
23
+ {children}
24
+ </div>);
25
+ }
26
+ //# sourceMappingURL=ColorHorizontalPointerProxy.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHorizontalPointerProxy.web.js","sourceRoot":"","sources":["../../../src/features/color/ColorHorizontalPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,gFAAgF;AAChF,MAAM,UAAU,2BAA2B,CAAC,EAC1C,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,GAC4B;IACjC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,CAAC,KAAuC,EAAE,EAAE;QAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,aAAgD,CAAC;QACtE,MAAM,IAAI,GAAG,MAAM,CAAC,qBAAqB,EAAE,CAAC;QAC5C,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CACF,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YACxB,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACF,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO;gBAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC,CAAC,CACF,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO;gBAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;YACnD,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAE/B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ColorHorizontalPointerProxyProps } from './ColorHorizontalPointerProxy';\n\n/*** Maps browser drag coordinates into an SVG slider's stable viewbox width. */\nexport function ColorHorizontalPointerProxy({\n children,\n disabled,\n onChange,\n width,\n}: ColorHorizontalPointerProxyProps) {\n const dragging = React.useRef(false);\n const changeAt = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.currentTarget as unknown as BrowserPointerTarget;\n const rect = target.getBoundingClientRect();\n onChange(((event.clientX - rect.left) / rect.width) * width);\n };\n\n return (\n <div\n onMouseDown={(event) => {\n if (disabled) return;\n dragging.current = true;\n changeAt(event);\n }}\n onMouseMove={(event) => {\n if (!disabled && dragging.current) changeAt(event);\n }}\n onMouseUp={(event) => {\n if (!disabled && dragging.current) changeAt(event);\n dragging.current = false;\n }}\n style={{ touchAction: 'none' }}\n >\n {children}\n </div>\n );\n}\n\ninterface BrowserPointerTarget {\n readonly getBoundingClientRect: () => {\n readonly left: number;\n readonly width: number;\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorHueScale.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHueScale.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,6EAA6E;AAC7E,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
1
+ {"version":3,"file":"ColorHueScale.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorHueScale.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAU5D,6EAA6E;AAC7E,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
@@ -2,21 +2,32 @@ import { generateColorSwatch } from '@ankhorage/color-theory';
2
2
  import { Pressable } from '@ankhorage/surface';
3
3
  import { View } from '../layout/public';
4
4
  import { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';
5
+ import { useZoraTheme } from '../theme/composition/useZoraTheme';
5
6
  import { Text } from '../typography/public';
7
+ import { ColorHexField } from './ColorHexField';
8
+ import { ColorSpectrumSlider } from './ColorSpectrumSlider';
9
+ import { resolveColorAtHue } from './utils/resolveColorAtHue';
10
+ import { resolveColorHue } from './utils/resolveColorHue';
6
11
  /*** Edits the 500 base color and previews its canonical 50-to-950 swatch. */
7
12
  export const ColorHueScale = withZoraThemeScope(ColorHueScaleInner);
8
13
  /*** Maps generated previews to an explicitly editable 500 base without misreporting preview selection. */
9
14
  function ColorHueScaleInner({ themeId: _themeId, mode: _mode, inverted: _inverted, interactionPolicy, value, onChange, testID, }) {
15
+ const { theme } = useZoraTheme();
10
16
  const { swatch } = generateColorSwatch(value);
11
17
  const swatches = Object.entries(swatch);
12
- return (<View accessibilityLabel="Color scale previews; choose a preview as the next 500 base color" direction="row" gap="xs" testID={testID} wrap="wrap">
13
- {swatches.map(([step, color]) => (<Pressable key={step} accessibilityLabel={Number(step) === 500
18
+ return (<View gap="m" testID={testID}>
19
+ <ColorSpectrumSlider disabled={interactionPolicy === 'passive'} hue={resolveColorHue(value)} onChange={(nextHue) => onChange(resolveColorAtHue(value, nextHue))}/>
20
+ <Text variant="label">Intensity</Text>
21
+ <View accessibilityLabel="Color scale previews; choose a preview as the next 500 base color" direction="row" gap="xs" wrap="wrap">
22
+ {swatches.map(([step, color]) => (<Pressable key={step} accessibilityLabel={Number(step) === 500
14
23
  ? `Current editable base color 500: ${color}`
15
- : `Use generated ${step} preview ${color} as the next base color 500`} bg={color} borderColor="border" borderWidth={Number(step) === 500 ? 3 : 1} disabled={interactionPolicy === 'passive'} height={48} onPress={() => onChange(color)} radius="sm" width={48}>
16
- <Text align="center" variant="caption">
17
- {step}
18
- </Text>
19
- </Pressable>))}
24
+ : `Use generated ${step} preview ${color} as the next base color 500`} bg={color} borderColor={theme.semantics.border.default} borderWidth={Number(step) === 500 ? 3 : 1} disabled={interactionPolicy === 'passive'} height={48} onPress={() => onChange(color)} radius="s" width="18%">
25
+ <Text align="center" variant="caption">
26
+ {step}
27
+ </Text>
28
+ </Pressable>))}
29
+ </View>
30
+ <ColorHexField disabled={interactionPolicy === 'passive'} key={value} onChange={onChange} value={value}/>
20
31
  </View>);
21
32
  }
22
33
  //# sourceMappingURL=ColorHueScale.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorHueScale.js","sourceRoot":"","sources":["../../../src/features/color/ColorHueScale.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEpE,0GAA0G;AAC1G,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,EACnB,iBAAiB,EACjB,KAAK,EACL,QAAQ,EACR,MAAM,GACa;IACnB,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC,OAAO,CACL,CAAC,IAAI,CACH,kBAAkB,CAAC,mEAAmE,CACtF,SAAS,CAAC,KAAK,CACf,GAAG,CAAC,IAAI,CACR,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,CAAC,MAAM,CAEX;MAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC/B,CAAC,SAAS,CACR,GAAG,CAAC,CAAC,IAAI,CAAC,CACV,kBAAkB,CAAC,CACjB,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG;gBAClB,CAAC,CAAC,oCAAoC,KAAK,EAAE;gBAC7C,CAAC,CAAC,iBAAiB,IAAI,YAAY,KAAK,6BAC5C,CAAC,CACD,EAAE,CAAC,CAAC,KAAK,CAAC,CACV,WAAW,CAAC,QAAQ,CACpB,WAAW,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC1C,QAAQ,CAAC,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAC1C,MAAM,CAAC,CAAC,EAAE,CAAC,CACX,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAC/B,MAAM,CAAC,IAAI,CACX,KAAK,CAAC,CAAC,EAAE,CAAC,CAEV;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CACpC;YAAA,CAAC,IAAI,CACP;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,SAAS,CAAC,CACb,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { generateColorSwatch } from '@ankhorage/color-theory';\nimport { Pressable } from '@ankhorage/surface';\n\nimport type { ColorHueScaleProps } from '../../types/color';\nimport { View } from '../layout/public';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { Text } from '../typography/public';\n\n/*** Edits the 500 base color and previews its canonical 50-to-950 swatch. */\nexport const ColorHueScale = withZoraThemeScope(ColorHueScaleInner);\n\n/*** Maps generated previews to an explicitly editable 500 base without misreporting preview selection. */\nfunction ColorHueScaleInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n interactionPolicy,\n value,\n onChange,\n testID,\n}: ColorHueScaleProps) {\n const { swatch } = generateColorSwatch(value);\n const swatches = Object.entries(swatch);\n\n return (\n <View\n accessibilityLabel=\"Color scale previews; choose a preview as the next 500 base color\"\n direction=\"row\"\n gap=\"xs\"\n testID={testID}\n wrap=\"wrap\"\n >\n {swatches.map(([step, color]) => (\n <Pressable\n key={step}\n accessibilityLabel={\n Number(step) === 500\n ? `Current editable base color 500: ${color}`\n : `Use generated ${step} preview ${color} as the next base color 500`\n }\n bg={color}\n borderColor=\"border\"\n borderWidth={Number(step) === 500 ? 3 : 1}\n disabled={interactionPolicy === 'passive'}\n height={48}\n onPress={() => onChange(color)}\n radius=\"sm\"\n width={48}\n >\n <Text align=\"center\" variant=\"caption\">\n {step}\n </Text>\n </Pressable>\n ))}\n </View>\n );\n}\n"]}
1
+ {"version":3,"file":"ColorHueScale.js","sourceRoot":"","sources":["../../../src/features/color/ColorHueScale.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEpE,0GAA0G;AAC1G,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,EACnB,iBAAiB,EACjB,KAAK,EACL,QAAQ,EACR,MAAM,GACa;IACnB,MAAM,EAAE,KAAK,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C,CAAC,CAC1C,QAAQ,CAAC,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAC1C,MAAM,CAAC,CAAC,EAAE,CAAC,CACX,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAC/B,MAAM,CAAC,GAAG,CACV,KAAK,CAAC,KAAK,CAEX;YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CACpC;cAAA,CAAC,IAAI,CACP;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,SAAS,CAAC,CACb,CAAC,CACJ;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,aAAa,CACZ,QAAQ,CAAC,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAC1C,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { generateColorSwatch } from '@ankhorage/color-theory';\nimport { Pressable } from '@ankhorage/surface';\n\nimport type { ColorHueScaleProps } from '../../types/color';\nimport { View } from '../layout/public';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { Text } from '../typography/public';\nimport { ColorHexField } from './ColorHexField';\nimport { ColorSpectrumSlider } from './ColorSpectrumSlider';\nimport { resolveColorAtHue } from './utils/resolveColorAtHue';\nimport { resolveColorHue } from './utils/resolveColorHue';\n\n/*** Edits the 500 base color and previews its canonical 50-to-950 swatch. */\nexport const ColorHueScale = withZoraThemeScope(ColorHueScaleInner);\n\n/*** Maps generated previews to an explicitly editable 500 base without misreporting preview selection. */\nfunction ColorHueScaleInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n interactionPolicy,\n value,\n onChange,\n testID,\n}: ColorHueScaleProps) {\n const { theme } = useZoraTheme();\n const { swatch } = generateColorSwatch(value);\n const swatches = Object.entries(swatch);\n\n return (\n <View gap=\"m\" testID={testID}>\n <ColorSpectrumSlider\n disabled={interactionPolicy === 'passive'}\n hue={resolveColorHue(value)}\n onChange={(nextHue) => onChange(resolveColorAtHue(value, nextHue))}\n />\n <Text variant=\"label\">Intensity</Text>\n <View\n accessibilityLabel=\"Color scale previews; choose a preview as the next 500 base color\"\n direction=\"row\"\n gap=\"xs\"\n wrap=\"wrap\"\n >\n {swatches.map(([step, color]) => (\n <Pressable\n key={step}\n accessibilityLabel={\n Number(step) === 500\n ? `Current editable base color 500: ${color}`\n : `Use generated ${step} preview ${color} as the next base color 500`\n }\n bg={color}\n borderColor={theme.semantics.border.default}\n borderWidth={Number(step) === 500 ? 3 : 1}\n disabled={interactionPolicy === 'passive'}\n height={48}\n onPress={() => onChange(color)}\n radius=\"s\"\n width=\"18%\"\n >\n <Text align=\"center\" variant=\"caption\">\n {step}\n </Text>\n </Pressable>\n ))}\n </View>\n <ColorHexField\n disabled={interactionPolicy === 'passive'}\n key={value}\n onChange={onChange}\n value={value}\n />\n </View>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAoC,MAAM,mBAAmB,CAAC;AAO5F,iGAAiG;AACjG,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
1
+ {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAoC,MAAM,mBAAmB,CAAC;AAW5F,iGAAiG;AACjG,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
@@ -1,33 +1,60 @@
1
1
  import React from 'react';
2
+ import { IconButton } from '../button/public';
3
+ import { View } from '../layout/public';
2
4
  import { Tab, TabList, TabPanel, Tabs } from '../tabs/public';
3
5
  import { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';
6
+ import { useZoraTheme } from '../theme/composition/useZoraTheme';
7
+ import { Text } from '../typography/public';
4
8
  import { ColorHueScale } from './ColorHueScale';
5
9
  import { ColorTone } from './ColorTone';
6
10
  import { ColorWheel } from './ColorWheel';
7
11
  /*** Composes independently usable color controls into an ordered, consumer-configured picker. */
8
12
  export const ColorPicker = withZoraThemeScope(ColorPickerInner);
9
13
  /*** Coordinates persistent controlled color selections across independently usable picker tabs. */
10
- function ColorPickerInner({ themeId: _themeId, mode: _mode, inverted: _inverted, tabs, value, onValueChange, onSelectionChange, hideTabListWhenSingle = true, wheel, tone, hue, testID, }) {
14
+ function ColorPickerInner({ themeId: _themeId, mode: _mode, inverted: _inverted, tabs, value, onValueChange, onSelectionChange, onDismiss, hideTabListWhenSingle = true, wheel, tone, hue, testID, }) {
15
+ const { theme } = useZoraTheme();
11
16
  if (tabs.length === 0)
12
17
  throw new Error('ColorPicker requires at least one tab.');
13
18
  if (!tabs.includes(value.tab))
14
19
  throw new Error('ColorPicker value must be configured in tabs.');
15
- return (<Tabs defaultValue={value.tab} onValueChange={(nextValue) => {
20
+ const previewColor = resolvePickerPreviewColor(value);
21
+ return (<View alignSelf="center" bg={theme.semantics.surface.raised} borderColor={theme.semantics.border.default} borderWidth={1} flexShrink={1} gap="s" maxWidth={400} p="m" radius="l" testID={testID} width="100%">
22
+ <View align="center" direction="row" justify="space-between">
23
+ <Text variant="lead" weight="semiBold">
24
+ Color
25
+ </Text>
26
+ <View align="center" direction="row" gap="s">
27
+ <View bg={previewColor} borderColor={theme.semantics.border.default} borderWidth={1} height={38} radius="s" width={38}/>
28
+ {onDismiss ? (<IconButton iconName="close" label="Close color picker" onPress={onDismiss}/>) : null}
29
+ </View>
30
+ </View>
31
+ <Tabs defaultValue={value.tab} onValueChange={(nextValue) => {
16
32
  if (isColorPickerTab(nextValue) && tabs.includes(nextValue))
17
33
  onValueChange({ ...value, tab: nextValue });
18
- }} testID={testID} value={value.tab}>
19
- {tabs.length > 1 || !hideTabListWhenSingle ? (<TabList fill>
20
- {tabs.map((tab) => (<Tab key={tab} label={tab} value={tab}/>))}
21
- </TabList>) : null}
22
- {tabs.map((tab) => (<TabPanel key={tab} value={tab}>
23
- {resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)}
24
- </TabPanel>))}
25
- </Tabs>);
34
+ }} testID={testID ? `${testID}-tabs` : undefined} value={value.tab} variant="attached">
35
+ {tabs.length > 1 || !hideTabListWhenSingle ? (<View borderColor={theme.semantics.border.default} borderWidth={1} overflow="hidden" radius="m">
36
+ <TabList fill>
37
+ {tabs.map((tab) => (<Tab key={tab} label={tab} value={tab}/>))}
38
+ </TabList>
39
+ </View>) : null}
40
+ {tabs.map((tab) => (<TabPanel key={tab} value={tab}>
41
+ {resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)}
42
+ </TabPanel>))}
43
+ </Tabs>
44
+ </View>);
26
45
  }
27
46
  /*** Check whether a Surface tab value belongs to the configured picker vocabulary. */
28
47
  function isColorPickerTab(value) {
29
48
  return value === 'wheel' || value === 'tone' || value === 'hue';
30
49
  }
50
+ /*** Resolves the visible active-tab color without introducing a second picker state. */
51
+ function resolvePickerPreviewColor(value) {
52
+ if (value.tab === 'hue')
53
+ return value.hue;
54
+ if (value.tab === 'tone')
55
+ return value.tone?.colors.at(0) ?? value.wheel.color;
56
+ return value.wheel.color;
57
+ }
31
58
  /*** Resolve the configured control for one picker tab without adding fallback feature modes. */
32
59
  function resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange) {
33
60
  if (tab === 'wheel')
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/features/color/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,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types/color';\nimport { Tab, TabList, TabPanel, Tabs } from '../tabs/public';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { ColorHueScale } from './ColorHueScale';\nimport { ColorTone } from './ColorTone';\nimport { ColorWheel } from './ColorWheel';\n\n/*** Composes independently usable color controls into an ordered, consumer-configured picker. */\nexport const ColorPicker = withZoraThemeScope(ColorPickerInner);\n\n/*** Coordinates persistent controlled color selections across independently usable picker tabs. */\nfunction ColorPickerInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n tabs,\n value,\n onValueChange,\n onSelectionChange,\n hideTabListWhenSingle = true,\n wheel,\n tone,\n hue,\n testID,\n}: ColorPickerProps) {\n if (tabs.length === 0) throw new Error('ColorPicker requires at least one tab.');\n if (!tabs.includes(value.tab)) throw new Error('ColorPicker value must be configured in tabs.');\n\n return (\n <Tabs\n defaultValue={value.tab}\n onValueChange={(nextValue) => {\n if (isColorPickerTab(nextValue) && tabs.includes(nextValue))\n onValueChange({ ...value, tab: nextValue });\n }}\n testID={testID}\n value={value.tab}\n >\n {tabs.length > 1 || !hideTabListWhenSingle ? (\n <TabList fill>\n {tabs.map((tab) => (\n <Tab key={tab} label={tab} value={tab} />\n ))}\n </TabList>\n ) : null}\n {tabs.map((tab) => (\n <TabPanel key={tab} value={tab}>\n {resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)}\n </TabPanel>\n ))}\n </Tabs>\n );\n}\n\n/*** Check whether a Surface tab value belongs to the configured picker vocabulary. */\nfunction isColorPickerTab(value: string): value is ColorPickerTab {\n return value === 'wheel' || value === 'tone' || value === 'hue';\n}\n\n/*** Resolve the configured control for one picker tab without adding fallback feature modes. */\nfunction resolveTabContent(\n tab: ColorPickerTab,\n value: ColorPickerValue,\n wheel: ColorPickerProps['wheel'],\n tone: ColorPickerProps['tone'],\n hue: ColorPickerProps['hue'],\n onValueChange: (value: ColorPickerValue) => void,\n onSelectionChange: ColorPickerProps['onSelectionChange'],\n) {\n if (tab === 'wheel')\n return wheel ? (\n <ColorWheel\n {...wheel}\n harmony={value.wheel.harmony}\n onChange={(next) => {\n onValueChange({ ...value, wheel: next });\n onSelectionChange?.({ mode: 'wheel', value: next });\n }}\n value={value.wheel.color}\n />\n ) : null;\n if (tab === 'tone')\n return tone ? (\n <ColorTone\n {...tone}\n onChange={(next) => {\n onValueChange({ ...value, tone: next });\n onSelectionChange?.({ mode: 'tone', value: next });\n }}\n value={value.tone}\n />\n ) : null;\n return hue ? (\n <ColorHueScale\n {...hue}\n onChange={(next) => {\n onValueChange({ ...value, hue: next });\n onSelectionChange?.({ mode: 'hue', value: next });\n }}\n value={value.hue}\n />\n ) : null;\n}\n"]}
1
+ {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/features/color/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,iGAAiG;AACjG,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEhE,mGAAmG;AACnG,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAA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AiB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ColorPickerProps, ColorPickerTab, ColorPickerValue } from '../../types/color';\nimport { IconButton } from '../button/public';\nimport { View } from '../layout/public';\nimport { Tab, TabList, TabPanel, Tabs } from '../tabs/public';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { Text } from '../typography/public';\nimport { ColorHueScale } from './ColorHueScale';\nimport { ColorTone } from './ColorTone';\nimport { ColorWheel } from './ColorWheel';\n\n/*** Composes independently usable color controls into an ordered, consumer-configured picker. */\nexport const ColorPicker = withZoraThemeScope(ColorPickerInner);\n\n/*** Coordinates persistent controlled color selections across independently usable picker tabs. */\nfunction ColorPickerInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n tabs,\n value,\n onValueChange,\n onSelectionChange,\n onDismiss,\n hideTabListWhenSingle = true,\n wheel,\n tone,\n hue,\n testID,\n}: ColorPickerProps) {\n const { theme } = useZoraTheme();\n if (tabs.length === 0) throw new Error('ColorPicker requires at least one tab.');\n if (!tabs.includes(value.tab)) throw new Error('ColorPicker value must be configured in tabs.');\n const previewColor = resolvePickerPreviewColor(value);\n\n return (\n <View\n alignSelf=\"center\"\n bg={theme.semantics.surface.raised}\n borderColor={theme.semantics.border.default}\n borderWidth={1}\n flexShrink={1}\n gap=\"s\"\n maxWidth={400}\n p=\"m\"\n radius=\"l\"\n testID={testID}\n width=\"100%\"\n >\n <View align=\"center\" direction=\"row\" justify=\"space-between\">\n <Text variant=\"lead\" weight=\"semiBold\">\n Color\n </Text>\n <View align=\"center\" direction=\"row\" gap=\"s\">\n <View\n bg={previewColor}\n borderColor={theme.semantics.border.default}\n borderWidth={1}\n height={38}\n radius=\"s\"\n width={38}\n />\n {onDismiss ? (\n <IconButton iconName=\"close\" label=\"Close color picker\" onPress={onDismiss} />\n ) : null}\n </View>\n </View>\n <Tabs\n defaultValue={value.tab}\n onValueChange={(nextValue) => {\n if (isColorPickerTab(nextValue) && tabs.includes(nextValue))\n onValueChange({ ...value, tab: nextValue });\n }}\n testID={testID ? `${testID}-tabs` : undefined}\n value={value.tab}\n variant=\"attached\"\n >\n {tabs.length > 1 || !hideTabListWhenSingle ? (\n <View\n borderColor={theme.semantics.border.default}\n borderWidth={1}\n overflow=\"hidden\"\n radius=\"m\"\n >\n <TabList fill>\n {tabs.map((tab) => (\n <Tab key={tab} label={tab} value={tab} />\n ))}\n </TabList>\n </View>\n ) : null}\n {tabs.map((tab) => (\n <TabPanel key={tab} value={tab}>\n {resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)}\n </TabPanel>\n ))}\n </Tabs>\n </View>\n );\n}\n\n/*** Check whether a Surface tab value belongs to the configured picker vocabulary. */\nfunction isColorPickerTab(value: string): value is ColorPickerTab {\n return value === 'wheel' || value === 'tone' || value === 'hue';\n}\n\n/*** Resolves the visible active-tab color without introducing a second picker state. */\nfunction resolvePickerPreviewColor(value: ColorPickerValue) {\n if (value.tab === 'hue') return value.hue;\n if (value.tab === 'tone') return value.tone?.colors.at(0) ?? value.wheel.color;\n return value.wheel.color;\n}\n\n/*** Resolve the configured control for one picker tab without adding fallback feature modes. */\nfunction resolveTabContent(\n tab: ColorPickerTab,\n value: ColorPickerValue,\n wheel: ColorPickerProps['wheel'],\n tone: ColorPickerProps['tone'],\n hue: ColorPickerProps['hue'],\n onValueChange: (value: ColorPickerValue) => void,\n onSelectionChange: ColorPickerProps['onSelectionChange'],\n) {\n if (tab === 'wheel')\n return wheel ? (\n <ColorWheel\n {...wheel}\n harmony={value.wheel.harmony}\n onChange={(next) => {\n onValueChange({ ...value, wheel: next });\n onSelectionChange?.({ mode: 'wheel', value: next });\n }}\n value={value.wheel.color}\n />\n ) : null;\n if (tab === 'tone')\n return tone ? (\n <ColorTone\n {...tone}\n onChange={(next) => {\n onValueChange({ ...value, tone: next });\n onSelectionChange?.({ mode: 'tone', value: next });\n }}\n value={value.tone}\n />\n ) : null;\n return hue ? (\n <ColorHueScale\n {...hue}\n onChange={(next) => {\n onValueChange({ ...value, hue: next });\n onSelectionChange?.({ mode: 'hue', value: next });\n }}\n value={value.hue}\n />\n ) : null;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ /*** Selects a controlled hue across the same full-spectrum track used by Studio tabs. */
3
+ export declare function ColorSpectrumSlider({ disabled, hue, label, onChange, }: {
4
+ readonly disabled: boolean;
5
+ readonly hue: number;
6
+ readonly label?: string;
7
+ readonly onChange: (hue: number) => void;
8
+ }): React.JSX.Element;
9
+ //# sourceMappingURL=ColorSpectrumSlider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorSpectrumSlider.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorSpectrumSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,GAAG,EACH,KAAa,EACb,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,qBAuDA"}