@ankhorage/zora 27.3.8 → 27.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/features/color/ColorHueScale.d.ts +4 -0
  4. package/dist/features/color/ColorHueScale.d.ts.map +1 -0
  5. package/dist/features/color/ColorHueScale.js +22 -0
  6. package/dist/features/color/ColorHueScale.js.map +1 -0
  7. package/dist/features/color/ColorPicker.d.ts +5 -0
  8. package/dist/features/color/ColorPicker.d.ts.map +1 -0
  9. package/dist/features/color/ColorPicker.js +48 -0
  10. package/dist/features/color/ColorPicker.js.map +1 -0
  11. package/dist/features/color/ColorTone.d.ts +5 -0
  12. package/dist/features/color/ColorTone.d.ts.map +1 -0
  13. package/dist/features/color/ColorTone.js +65 -0
  14. package/dist/features/color/ColorTone.js.map +1 -0
  15. package/dist/features/color/ColorWheel.d.ts +5 -0
  16. package/dist/features/color/ColorWheel.d.ts.map +1 -0
  17. package/dist/features/color/ColorWheel.js +125 -0
  18. package/dist/features/color/ColorWheel.js.map +1 -0
  19. package/dist/features/color/ColorWheelKeyboardProxy.d.ts +10 -0
  20. package/dist/features/color/ColorWheelKeyboardProxy.d.ts.map +1 -0
  21. package/dist/features/color/ColorWheelKeyboardProxy.js +2 -0
  22. package/dist/features/color/ColorWheelKeyboardProxy.js.map +1 -0
  23. package/dist/features/color/ColorWheelKeyboardProxy.native.d.ts +4 -0
  24. package/dist/features/color/ColorWheelKeyboardProxy.native.d.ts.map +1 -0
  25. package/dist/features/color/ColorWheelKeyboardProxy.native.js +17 -0
  26. package/dist/features/color/ColorWheelKeyboardProxy.native.js.map +1 -0
  27. package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts +5 -0
  28. package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts.map +1 -0
  29. package/dist/features/color/ColorWheelKeyboardProxy.web.js +29 -0
  30. package/dist/features/color/ColorWheelKeyboardProxy.web.js.map +1 -0
  31. package/dist/features/color/public.d.ts +6 -0
  32. package/dist/features/color/public.d.ts.map +1 -0
  33. package/dist/features/color/public.js +5 -0
  34. package/dist/features/color/public.js.map +1 -0
  35. package/dist/features/color/utils/resolveColorAtHue.d.ts +4 -0
  36. package/dist/features/color/utils/resolveColorAtHue.d.ts.map +1 -0
  37. package/dist/features/color/utils/resolveColorAtHue.js +12 -0
  38. package/dist/features/color/utils/resolveColorAtHue.js.map +1 -0
  39. package/dist/features/color/utils/resolveColorHue.d.ts +4 -0
  40. package/dist/features/color/utils/resolveColorHue.d.ts.map +1 -0
  41. package/dist/features/color/utils/resolveColorHue.js +8 -0
  42. package/dist/features/color/utils/resolveColorHue.js.map +1 -0
  43. package/dist/features/color/utils/resolveOklchColor.d.ts +5 -0
  44. package/dist/features/color/utils/resolveOklchColor.d.ts.map +1 -0
  45. package/dist/features/color/utils/resolveOklchColor.js +10 -0
  46. package/dist/features/color/utils/resolveOklchColor.js.map +1 -0
  47. package/dist/features/color/utils/resolveWheelColor.d.ts +4 -0
  48. package/dist/features/color/utils/resolveWheelColor.d.ts.map +1 -0
  49. package/dist/features/color/utils/resolveWheelColor.js +17 -0
  50. package/dist/features/color/utils/resolveWheelColor.js.map +1 -0
  51. package/dist/features/color/utils/resolveWheelColorComponents.d.ts +7 -0
  52. package/dist/features/color/utils/resolveWheelColorComponents.d.ts.map +1 -0
  53. package/dist/features/color/utils/resolveWheelColorComponents.js +11 -0
  54. package/dist/features/color/utils/resolveWheelColorComponents.js.map +1 -0
  55. package/dist/index.d.ts +2 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +1 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/types/color.d.ts +70 -0
  60. package/dist/types/color.d.ts.map +1 -0
  61. package/dist/types/color.js +2 -0
  62. package/dist/types/color.js.map +1 -0
  63. package/package.json +5 -3
  64. package/src/audit.test.ts +3 -3
  65. package/src/features/color/ColorHueScale.tsx +57 -0
  66. package/src/features/color/ColorPicker.tsx +105 -0
  67. package/src/features/color/ColorTone.tsx +137 -0
  68. package/src/features/color/ColorWheel.tsx +251 -0
  69. package/src/features/color/ColorWheelKeyboardProxy.native.tsx +34 -0
  70. package/src/features/color/ColorWheelKeyboardProxy.tsx +11 -0
  71. package/src/features/color/ColorWheelKeyboardProxy.web.tsx +47 -0
  72. package/src/features/color/public.ts +17 -0
  73. package/src/features/color/utils/colorMath.test.ts +37 -0
  74. package/src/features/color/utils/resolveColorAtHue.ts +14 -0
  75. package/src/features/color/utils/resolveColorHue.ts +10 -0
  76. package/src/features/color/utils/resolveOklchColor.ts +13 -0
  77. package/src/features/color/utils/resolveWheelColor.ts +28 -0
  78. package/src/features/color/utils/resolveWheelColorComponents.ts +16 -0
  79. package/src/index.ts +14 -0
  80. package/src/types/color.ts +75 -0
  81. package/src/webPackageExports.test.ts +15 -0
  82. package/web-dist/chunks/{Accordion-5w8chhxm.js → Accordion-001ymezm.js} +3 -63
  83. package/web-dist/chunks/{Accordion-2d5jdxeg.js → Accordion-01s50nga.js} +2 -2
  84. package/web-dist/chunks/{Accordion-dhnd347t.js → Accordion-09jkcm1x.js} +695 -4591
  85. package/web-dist/chunks/Accordion-0z2t95zw.js +548 -0
  86. package/web-dist/chunks/{Accordion-z1k4wg10.js → Accordion-120nmpbe.js} +3 -3
  87. package/web-dist/chunks/{Accordion-zrn4dy6s.js → Accordion-401452az.js} +6 -6
  88. package/web-dist/chunks/{Accordion-yy6qy5y2.js → Accordion-44bcsg35.js} +6 -6
  89. package/web-dist/chunks/{Accordion-5hvq2r84.js → Accordion-49m38edd.js} +4 -4
  90. package/web-dist/chunks/{Accordion-x4bpna1q.js → Accordion-49mzcav8.js} +4 -4
  91. package/web-dist/chunks/{Accordion-h3r90b65.js → Accordion-52a3dpsm.js} +4 -4
  92. package/web-dist/chunks/{Accordion-bhr3r525.js → Accordion-549akrjn.js} +4 -4
  93. package/web-dist/chunks/{Accordion-7atd70rg.js → Accordion-64px84rh.js} +10 -10
  94. package/web-dist/chunks/{Accordion-enracgev.js → Accordion-6ec9bfd8.js} +4 -4
  95. package/web-dist/chunks/Accordion-6jb7b67v.js +66 -0
  96. package/web-dist/chunks/{Accordion-5gbd0wzf.js → Accordion-8ac6dkcs.js} +1 -1
  97. package/web-dist/chunks/{Accordion-w18jbs39.js → Accordion-8q7hn9aj.js} +1 -1
  98. package/web-dist/chunks/{Accordion-825x4t0z.js → Accordion-8vcs6nz6.js} +1 -1
  99. package/web-dist/chunks/{Accordion-qqv9mak2.js → Accordion-9d3rd7ne.js} +1 -1
  100. package/web-dist/chunks/{Accordion-zfsnh03k.js → Accordion-9hcbf56f.js} +2 -2
  101. package/web-dist/chunks/{Accordion-s6n61fx6.js → Accordion-9n062we9.js} +2 -2
  102. package/web-dist/chunks/{Accordion-rrmy3736.js → Accordion-a6xxvydp.js} +2 -2
  103. package/web-dist/chunks/{Accordion-dv281jw0.js → Accordion-b4yr6yq3.js} +2 -2
  104. package/web-dist/chunks/{Accordion-c1x8bqnr.js → Accordion-b8t2gq8g.js} +9 -9
  105. package/web-dist/chunks/{Accordion-25xjvp3t.js → Accordion-dk40hsc0.js} +2 -2
  106. package/web-dist/chunks/{Accordion-1dr6ktbf.js → Accordion-dxhs3xwx.js} +7 -7
  107. package/web-dist/chunks/{Accordion-q5swmcwm.js → Accordion-e1krqvc4.js} +3 -3
  108. package/web-dist/chunks/{Accordion-b7jgtnvm.js → Accordion-ew2cebyd.js} +3 -3
  109. package/web-dist/chunks/{Accordion-j3twwxyt.js → Accordion-g9m813fh.js} +2 -2
  110. package/web-dist/chunks/{Accordion-b36h9a7g.js → Accordion-gysa24fk.js} +1 -1
  111. package/web-dist/chunks/{Accordion-2xdwc579.js → Accordion-h21ah8w3.js} +6 -6
  112. package/web-dist/chunks/{Accordion-2rtkfs9t.js → Accordion-hfb983jm.js} +3 -3
  113. package/web-dist/chunks/{Accordion-5p0pc8wp.js → Accordion-j61qh3rb.js} +2 -2
  114. package/web-dist/chunks/{Accordion-tf459afq.js → Accordion-kexh248h.js} +2 -2
  115. package/web-dist/chunks/{Accordion-gbe84kyw.js → Accordion-kx6695j5.js} +2 -2
  116. package/web-dist/chunks/{Accordion-w42y21pt.js → Accordion-mrhkw8n6.js} +1 -1
  117. package/web-dist/chunks/{Accordion-vyr0wyp9.js → Accordion-ng9pnz9r.js} +9 -9
  118. package/web-dist/chunks/{Accordion-x3shxr1k.js → Accordion-p43psvv8.js} +6 -6
  119. package/web-dist/chunks/{Accordion-6y9ac3ad.js → Accordion-rcs75kj4.js} +3 -3
  120. package/web-dist/chunks/Accordion-rj3ayvn5.js +3925 -0
  121. package/web-dist/chunks/{Accordion-4d12nnq0.js → Accordion-sheqvs8c.js} +11 -11
  122. package/web-dist/chunks/{Accordion-j77vvja1.js → Accordion-ss57gqjb.js} +5 -5
  123. package/web-dist/chunks/{Accordion-hsnh2dgt.js → Accordion-sttjd4rs.js} +7 -7
  124. package/web-dist/chunks/{Accordion-n95zwem8.js → Accordion-sz17szqm.js} +8 -8
  125. package/web-dist/chunks/{Accordion-0ecj6p6b.js → Accordion-tchccn9f.js} +5 -5
  126. package/web-dist/chunks/{Accordion-4d4xahgg.js → Accordion-tpd1vvy9.js} +77 -74
  127. package/web-dist/chunks/{Accordion-bm75sm6d.js → Accordion-vzgpdtr2.js} +1 -1
  128. package/web-dist/chunks/{Accordion-4hthnyjj.js → Accordion-wdefxczv.js} +9 -9
  129. package/web-dist/chunks/{Accordion-2pq8kbaq.js → Accordion-wtqev4qa.js} +7 -7
  130. package/web-dist/chunks/{Accordion-5zx8d19h.js → Accordion-xfdp8w37.js} +13 -13
  131. package/web-dist/chunks/{Accordion-st7rj6hc.js → Accordion-xs9aspze.js} +4 -4
  132. package/web-dist/chunks/{Accordion-nf16vayy.js → Accordion-z4m47w0b.js} +2 -2
  133. package/web-dist/chunks/{Accordion-x2d68rrj.js → Accordion-z5kr43w5.js} +4 -4
  134. package/web-dist/chunks/{Accordion-nks69epp.js → Accordion-z8c7y6d8.js} +5 -5
  135. package/web-dist/components/accordion/Accordion.js +10 -10
  136. package/web-dist/components/accordion-item/AccordionItem.js +10 -10
  137. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  138. package/web-dist/components/app-bar/AppBar.js +16 -15
  139. package/web-dist/components/app-header/AppHeader.js +16 -15
  140. package/web-dist/components/app-shell/AppShell.js +4 -4
  141. package/web-dist/components/auth-screen/AuthScreen.js +21 -19
  142. package/web-dist/components/avatar/Avatar.js +10 -10
  143. package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
  144. package/web-dist/components/badge/Badge.js +5 -5
  145. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +19 -18
  146. package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
  147. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
  148. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
  149. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
  150. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
  151. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
  152. package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -14
  153. package/web-dist/components/button/Button.js +11 -10
  154. package/web-dist/components/button-group/ButtonGroup.js +11 -10
  155. package/web-dist/components/camera-permission-view/CameraPermissionView.js +19 -18
  156. package/web-dist/components/card/Card.js +18 -17
  157. package/web-dist/components/card-back/CardBack.js +4 -4
  158. package/web-dist/components/card-hand/CardHand.js +4 -4
  159. package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
  160. package/web-dist/components/checkbox/Checkbox.js +10 -10
  161. package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
  162. package/web-dist/components/chess-board/ChessBoard.js +4 -4
  163. package/web-dist/components/chip/Chip.js +11 -11
  164. package/web-dist/components/chip-group/ChipGroup.js +11 -11
  165. package/web-dist/components/collection-editor/CollectionEditor.js +20 -19
  166. package/web-dist/components/color-hue-scale/ColorHueScale.d.ts +6 -0
  167. package/web-dist/components/color-hue-scale/ColorHueScale.js +33 -0
  168. package/web-dist/components/color-hue-scale/index.d.ts +1 -0
  169. package/web-dist/components/color-hue-scale/index.js +2 -0
  170. package/web-dist/components/color-picker/ColorPicker.d.ts +6 -0
  171. package/web-dist/components/color-picker/ColorPicker.js +33 -0
  172. package/web-dist/components/color-picker/index.d.ts +1 -0
  173. package/web-dist/components/color-picker/index.js +2 -0
  174. package/web-dist/components/color-tone/ColorTone.d.ts +6 -0
  175. package/web-dist/components/color-tone/ColorTone.js +33 -0
  176. package/web-dist/components/color-tone/index.d.ts +1 -0
  177. package/web-dist/components/color-tone/index.js +2 -0
  178. package/web-dist/components/color-wheel/ColorWheel.d.ts +6 -0
  179. package/web-dist/components/color-wheel/ColorWheel.js +33 -0
  180. package/web-dist/components/color-wheel/index.d.ts +1 -0
  181. package/web-dist/components/color-wheel/index.js +2 -0
  182. package/web-dist/components/content-rail/ContentRail.js +14 -13
  183. package/web-dist/components/data-table/DataTable.js +25 -24
  184. package/web-dist/components/date-picker/DatePicker.js +16 -15
  185. package/web-dist/components/dialog/Dialog.js +9 -9
  186. package/web-dist/components/divider/Divider.js +4 -4
  187. package/web-dist/components/empty-state/EmptyState.js +19 -18
  188. package/web-dist/components/explorer/Explorer.js +11 -11
  189. package/web-dist/components/field/Field.js +10 -10
  190. package/web-dist/components/file-explorer/FileExplorer.js +11 -11
  191. package/web-dist/components/flat-list/FlatList.js +11 -11
  192. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +21 -19
  193. package/web-dist/components/form/Form.js +15 -14
  194. package/web-dist/components/form-actions/FormActions.js +15 -14
  195. package/web-dist/components/form-error/FormError.js +15 -14
  196. package/web-dist/components/game/Game.js +5 -5
  197. package/web-dist/components/game-entity/GameEntity.js +5 -5
  198. package/web-dist/components/game-field/GameField.js +5 -5
  199. package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
  200. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
  201. package/web-dist/components/game-overlay/GameOverlay.js +5 -5
  202. package/web-dist/components/gradient/Gradient.js +5 -5
  203. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
  204. package/web-dist/components/grid/Grid.js +4 -4
  205. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
  206. package/web-dist/components/grid-ruler/GridRuler.js +4 -4
  207. package/web-dist/components/heading/Heading.js +5 -5
  208. package/web-dist/components/hero/Hero.js +20 -19
  209. package/web-dist/components/icon/Icon.js +4 -4
  210. package/web-dist/components/icon-button/IconButton.js +11 -10
  211. package/web-dist/components/image/Image.js +8 -8
  212. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
  213. package/web-dist/components/list/List.js +11 -11
  214. package/web-dist/components/list-item/ListItem.js +11 -11
  215. package/web-dist/components/list-section/ListSection.js +11 -11
  216. package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
  217. package/web-dist/components/media-card/MediaCard.js +18 -17
  218. package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
  219. package/web-dist/components/message-bubble/MessageBubble.js +14 -14
  220. package/web-dist/components/metric-card/MetricCard.js +18 -17
  221. package/web-dist/components/missing-element/MissingElement.js +9 -9
  222. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +21 -19
  223. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +21 -19
  224. package/web-dist/components/opening-book/OpeningBook.js +4 -4
  225. package/web-dist/components/otp-form/OtpForm.js +21 -19
  226. package/web-dist/components/pagination/Pagination.js +14 -13
  227. package/web-dist/components/palette-item/PaletteItem.js +18 -17
  228. package/web-dist/components/playing-card/PlayingCard.js +4 -4
  229. package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
  230. package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
  231. package/web-dist/components/post-card/PostCard.js +18 -17
  232. package/web-dist/components/product-card/ProductCard.js +18 -17
  233. package/web-dist/components/progress/Progress.js +8 -8
  234. package/web-dist/components/progress-ring/ProgressRing.js +8 -8
  235. package/web-dist/components/radio/Radio.js +12 -12
  236. package/web-dist/components/radio-group/RadioGroup.js +12 -12
  237. package/web-dist/components/rating/Rating.js +7 -7
  238. package/web-dist/components/reader/Reader.js +21 -20
  239. package/web-dist/components/scan-overlay/ScanOverlay.js +19 -18
  240. package/web-dist/components/screen/Screen.js +4 -4
  241. package/web-dist/components/screen-section/ScreenSection.js +8 -8
  242. package/web-dist/components/scroll-view/ScrollView.js +4 -4
  243. package/web-dist/components/search-input/SearchInput.js +14 -12
  244. package/web-dist/components/section-header/SectionHeader.js +8 -8
  245. package/web-dist/components/section-list/SectionList.js +11 -11
  246. package/web-dist/components/select/Select.js +14 -13
  247. package/web-dist/components/selectable-item/SelectableItem.js +3 -3
  248. package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
  249. package/web-dist/components/sign-in-form/SignInForm.js +21 -19
  250. package/web-dist/components/sign-up-form/SignUpForm.js +21 -19
  251. package/web-dist/components/skeleton/Skeleton.js +21 -20
  252. package/web-dist/components/skeleton-card/SkeletonCard.js +21 -20
  253. package/web-dist/components/skeleton-list/SkeletonList.js +21 -20
  254. package/web-dist/components/skeleton-text/SkeletonText.js +21 -20
  255. package/web-dist/components/surface/Surface.js +5 -5
  256. package/web-dist/components/switch/Switch.js +5 -5
  257. package/web-dist/components/tab/Tab.js +5 -5
  258. package/web-dist/components/tab-list/TabList.js +5 -5
  259. package/web-dist/components/tab-panel/TabPanel.js +5 -5
  260. package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
  261. package/web-dist/components/tabs/Tabs.js +5 -5
  262. package/web-dist/components/text/Text.js +5 -5
  263. package/web-dist/components/text-input/TextInput.js +14 -12
  264. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +13 -12
  265. package/web-dist/components/time-picker/TimePicker.js +16 -15
  266. package/web-dist/components/timeline/Timeline.js +9 -9
  267. package/web-dist/components/toast/Toast.js +7 -7
  268. package/web-dist/components/toast-provider/ToastProvider.js +7 -7
  269. package/web-dist/components/toolbar/Toolbar.js +18 -17
  270. package/web-dist/components/tree-item/TreeItem.js +18 -17
  271. package/web-dist/components/uploader/Uploader.js +23 -22
  272. package/web-dist/components/view/View.js +4 -4
  273. package/web-dist/manifest.json +1466 -1264
  274. package/web-dist/runtime/ZoraProvider.js +6 -6
@@ -0,0 +1,4 @@
1
+ import type { HexColor } from '@ankhorage/color-theory';
2
+ /*** Read the editable hue from a selected hex color. */
3
+ export declare function resolveColorHue(color: HexColor): number;
4
+ //# sourceMappingURL=resolveColorHue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveColorHue.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveColorHue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAGvD"}
@@ -0,0 +1,8 @@
1
+ import { converter } from '@ankhorage/color-theory/culori/fn';
2
+ const toOklch = converter('oklch');
3
+ /*** Read the editable hue from a selected hex color. */
4
+ export function resolveColorHue(color) {
5
+ const parsed = toOklch(color);
6
+ return typeof parsed?.h === 'number' ? parsed.h : 0;
7
+ }
8
+ //# sourceMappingURL=resolveColorHue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveColorHue.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveColorHue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAEnC,wDAAwD;AACxD,MAAM,UAAU,eAAe,CAAC,KAAe;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,OAAO,MAAM,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\nimport { converter } from '@ankhorage/color-theory/culori/fn';\n\nconst toOklch = converter('oklch');\n\n/*** Read the editable hue from a selected hex color. */\nexport function resolveColorHue(color: HexColor): number {\n const parsed = toOklch(color);\n return typeof parsed?.h === 'number' ? parsed.h : 0;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { HexColor } from '@ankhorage/color-theory';
2
+ import type { ColorToneTarget } from '../../../types/color';
3
+ /*** Resolve a valid hex color from a bounded OKLCH target without owning color theory policy. */
4
+ export declare function resolveOklchColor(target: ColorToneTarget, hue: number): HexColor;
5
+ //# sourceMappingURL=resolveOklchColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveOklchColor.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveOklchColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAKhF"}
@@ -0,0 +1,10 @@
1
+ import { parseHexColorOrThrow } from '@ankhorage/color-theory';
2
+ import { formatHex } from '@ankhorage/color-theory/culori/fn';
3
+ /*** Resolve a valid hex color from a bounded OKLCH target without owning color theory policy. */
4
+ export function resolveOklchColor(target, hue) {
5
+ const formatted = formatHex({ mode: 'oklch', l: target.lightness, c: target.chroma, h: hue });
6
+ if (!formatted)
7
+ throw new Error('The supplied OKLCH target cannot be represented as a hex color.');
8
+ return parseHexColorOrThrow(formatted);
9
+ }
10
+ //# sourceMappingURL=resolveOklchColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveOklchColor.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveOklchColor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAI9D,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAAC,MAAuB,EAAE,GAAW;IACpE,MAAM,SAAS,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9F,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,OAAO,oBAAoB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\nimport { parseHexColorOrThrow } from '@ankhorage/color-theory';\nimport { formatHex } from '@ankhorage/color-theory/culori/fn';\n\nimport type { ColorToneTarget } from '../../../types/color';\n\n/*** Resolve a valid hex color from a bounded OKLCH target without owning color theory policy. */\nexport function resolveOklchColor(target: ColorToneTarget, hue: number): HexColor {\n const formatted = formatHex({ mode: 'oklch', l: target.lightness, c: target.chroma, h: hue });\n if (!formatted)\n throw new Error('The supplied OKLCH target cannot be represented as a hex color.');\n return parseHexColorOrThrow(formatted);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { HexColor } from '@ankhorage/color-theory';
2
+ /*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */
3
+ export declare function resolveWheelColor(color: HexColor, x: number, y: number, center: number, radius: number, maxChroma: number): HexColor;
4
+ //# sourceMappingURL=resolveWheelColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveWheelColor.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,qGAAqG;AACrG,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,EACf,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,QAAQ,CASV"}
@@ -0,0 +1,17 @@
1
+ import { resolveOklchColor } from './resolveOklchColor';
2
+ import { resolveWheelColorComponents } from './resolveWheelColorComponents';
3
+ /*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */
4
+ export function resolveWheelColor(color, x, y, center, radius, maxChroma) {
5
+ const { lightness } = resolveWheelColorComponents(color);
6
+ const deltaX = x - center;
7
+ const deltaY = y - center;
8
+ const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
9
+ const hue = normalizeHue((Math.atan2(deltaY, deltaX) * 180) / Math.PI + 90);
10
+ const chroma = (distance / radius) * maxChroma;
11
+ return resolveOklchColor({ lightness, chroma }, hue);
12
+ }
13
+ /*** Normalize an angular wheel coordinate to the OKLCH hue range. */
14
+ function normalizeHue(hue) {
15
+ return hue < 0 ? hue + 360 : hue;
16
+ }
17
+ //# sourceMappingURL=resolveWheelColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveWheelColor.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,qGAAqG;AACrG,MAAM,UAAU,iBAAiB,CAC/B,KAAe,EACf,CAAS,EACT,CAAS,EACT,MAAc,EACd,MAAc,EACd,SAAiB;IAEjB,MAAM,EAAE,SAAS,EAAE,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;IAC/C,OAAO,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC;AAED,qEAAqE;AACrE,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\n\nimport { resolveOklchColor } from './resolveOklchColor';\nimport { resolveWheelColorComponents } from './resolveWheelColorComponents';\n\n/*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */\nexport function resolveWheelColor(\n color: HexColor,\n x: number,\n y: number,\n center: number,\n radius: number,\n maxChroma: number,\n): HexColor {\n const { lightness } = resolveWheelColorComponents(color);\n\n const deltaX = x - center;\n const deltaY = y - center;\n const distance = Math.min(Math.hypot(deltaX, deltaY), radius);\n const hue = normalizeHue((Math.atan2(deltaY, deltaX) * 180) / Math.PI + 90);\n const chroma = (distance / radius) * maxChroma;\n return resolveOklchColor({ lightness, chroma }, hue);\n}\n\n/*** Normalize an angular wheel coordinate to the OKLCH hue range. */\nfunction normalizeHue(hue: number): number {\n return hue < 0 ? hue + 360 : hue;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { HexColor } from '@ankhorage/color-theory';
2
+ /*** Read the selected OKLCH values used by wheel keyboard and accessibility controls. */
3
+ export declare function resolveWheelColorComponents(color: HexColor): {
4
+ readonly chroma: number;
5
+ readonly lightness: number;
6
+ };
7
+ //# sourceMappingURL=resolveWheelColorComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveWheelColorComponents.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColorComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,yFAAyF;AACzF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,QAAQ,GAAG;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAMA"}
@@ -0,0 +1,11 @@
1
+ import { converter } from '@ankhorage/color-theory/culori/fn';
2
+ const toOklch = converter('oklch');
3
+ /*** Read the selected OKLCH values used by wheel keyboard and accessibility controls. */
4
+ export function resolveWheelColorComponents(color) {
5
+ const parsed = toOklch(color);
6
+ return {
7
+ chroma: typeof parsed?.c === 'number' ? parsed.c : 0,
8
+ lightness: typeof parsed?.l === 'number' ? parsed.l : 0.65,
9
+ };
10
+ }
11
+ //# sourceMappingURL=resolveWheelColorComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveWheelColorComponents.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColorComponents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAEnC,yFAAyF;AACzF,MAAM,UAAU,2BAA2B,CAAC,KAAe;IAIzD,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO;QACL,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,SAAS,EAAE,OAAO,MAAM,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;KAC3D,CAAC;AACJ,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\nimport { converter } from '@ankhorage/color-theory/culori/fn';\n\nconst toOklch = converter('oklch');\n\n/*** Read the selected OKLCH values used by wheel keyboard and accessibility controls. */\nexport function resolveWheelColorComponents(color: HexColor): {\n readonly chroma: number;\n readonly lightness: number;\n} {\n const parsed = toOklch(color);\n return {\n chroma: typeof parsed?.c === 'number' ? parsed.c : 0,\n lightness: typeof parsed?.l === 'number' ? parsed.l : 0.65,\n };\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps, AuthoringPropertyControlState, AuthoringPropertyInspectorAdapterProps, AuthoringSelectionAdapterProps, AuthoringSelectionItemState, ThemeEditorAdapterProps, ThemeRecipeFieldControlState, } from './authoring';
2
2
  export { AuthoringBindingEditorAdapter, AuthoringPropertyInspectorAdapter, AuthoringSelectionAdapter, ThemeEditorAdapter, } from './authoring';
3
+ export type { ColorHueScaleProps, ColorPickerProps, ColorPickerSelection, ColorPickerTab, ColorPickerValue, ColorToneDefinition, ColorToneProps, ColorToneSelection, ColorToneTarget, ColorWheelProps, ColorWheelSelection, } from './features/color/public';
4
+ export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
3
5
  export type { ReaderColorScheme, ReaderDocumentFormat, ReaderErrorCode, ReaderErrorEvent, ReaderExternalLinkEvent, ReaderLineHeight, ReaderLocationChangeEvent, ReaderNavigationTrigger, ReaderProps, ReaderResolvedSource, ReaderStatus, } from './features/reader/public';
4
6
  export { Reader, resolveReaderProgress } from './features/reader/public';
5
7
  export { ZORA_COMPONENT_REGISTRY } from './features/registry/public';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5F,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { AuthoringBindingEditorAdapter, AuthoringPropertyInspectorAdapter, AuthoringSelectionAdapter, ThemeEditorAdapter, } from './authoring';
2
+ export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
2
3
  export { Reader, resolveReaderProgress } from './features/reader/public';
3
4
  export { ZORA_COMPONENT_REGISTRY } from './features/registry/public';
4
5
  export * from './readerFree';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAcrB,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC","sourcesContent":["export type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './authoring';\nexport {\n AuthoringBindingEditorAdapter,\n AuthoringPropertyInspectorAdapter,\n AuthoringSelectionAdapter,\n ThemeEditorAdapter,\n} from './authoring';\nexport type {\n ReaderColorScheme,\n ReaderDocumentFormat,\n ReaderErrorCode,\n ReaderErrorEvent,\n ReaderExternalLinkEvent,\n ReaderLineHeight,\n ReaderLocationChangeEvent,\n ReaderNavigationTrigger,\n ReaderProps,\n ReaderResolvedSource,\n ReaderStatus,\n} from './features/reader/public';\nexport { Reader, resolveReaderProgress } from './features/reader/public';\nexport { ZORA_COMPONENT_REGISTRY } from './features/registry/public';\nexport * from './readerFree';\nexport type { ZoraComponentRegistry } from './types/registry';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAcrB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAc5F,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC","sourcesContent":["export type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './authoring';\nexport {\n AuthoringBindingEditorAdapter,\n AuthoringPropertyInspectorAdapter,\n AuthoringSelectionAdapter,\n ThemeEditorAdapter,\n} from './authoring';\nexport type {\n ColorHueScaleProps,\n ColorPickerProps,\n ColorPickerSelection,\n ColorPickerTab,\n ColorPickerValue,\n ColorToneDefinition,\n ColorToneProps,\n ColorToneSelection,\n ColorToneTarget,\n ColorWheelProps,\n ColorWheelSelection,\n} from './features/color/public';\nexport { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';\nexport type {\n ReaderColorScheme,\n ReaderDocumentFormat,\n ReaderErrorCode,\n ReaderErrorEvent,\n ReaderExternalLinkEvent,\n ReaderLineHeight,\n ReaderLocationChangeEvent,\n ReaderNavigationTrigger,\n ReaderProps,\n ReaderResolvedSource,\n ReaderStatus,\n} from './features/reader/public';\nexport { Reader, resolveReaderProgress } from './features/reader/public';\nexport { ZORA_COMPONENT_REGISTRY } from './features/registry/public';\nexport * from './readerFree';\nexport type { ZoraComponentRegistry } from './types/registry';\n"]}
@@ -0,0 +1,70 @@
1
+ import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
2
+ import type { ZoraBaseProps } from './base';
3
+ export type ColorPickerTab = 'wheel' | 'tone' | 'hue';
4
+ /** A consumer-owned OKLCH target from the published Templates tone catalog. */
5
+ export interface ColorToneTarget {
6
+ readonly lightness: number;
7
+ readonly chroma: number;
8
+ }
9
+ /**
10
+ * Structural boundary for a Templates tone-pair entry. ZORA intentionally owns
11
+ * neither the catalog nor its classifications.
12
+ */
13
+ export interface ColorToneDefinition {
14
+ readonly id: string;
15
+ readonly accent: string;
16
+ readonly accentTarget: ColorToneTarget;
17
+ }
18
+ export interface ColorWheelSelection {
19
+ readonly color: HexColor;
20
+ readonly harmony: ColorHarmony | null;
21
+ }
22
+ export interface ColorToneSelection {
23
+ readonly toneId: string;
24
+ readonly colors: readonly HexColor[];
25
+ }
26
+ /** The persistent, controlled state for every independently selectable picker mode. */
27
+ export interface ColorPickerValue {
28
+ readonly tab: ColorPickerTab;
29
+ readonly wheel: ColorWheelSelection;
30
+ readonly tone: ColorToneSelection | null;
31
+ readonly hue: HexColor;
32
+ }
33
+ /** A single mode-specific update emitted by the composed picker. */
34
+ export type ColorPickerSelection = {
35
+ readonly mode: 'wheel';
36
+ readonly value: ColorWheelSelection;
37
+ } | {
38
+ readonly mode: 'tone';
39
+ readonly value: ColorToneSelection;
40
+ } | {
41
+ readonly mode: 'hue';
42
+ readonly value: HexColor;
43
+ };
44
+ export interface ColorWheelProps extends ZoraBaseProps {
45
+ readonly value: HexColor;
46
+ readonly harmony?: ColorHarmony | null;
47
+ readonly harmonies?: readonly ColorHarmony[];
48
+ readonly onChange: (selection: ColorWheelSelection) => void;
49
+ }
50
+ export interface ColorToneProps extends ZoraBaseProps {
51
+ readonly tones: readonly ColorToneDefinition[];
52
+ readonly selectionMode?: 'single' | 'multiple';
53
+ readonly value: ColorToneSelection | null;
54
+ readonly onChange: (selection: ColorToneSelection) => void;
55
+ }
56
+ export interface ColorHueScaleProps extends ZoraBaseProps {
57
+ readonly value: HexColor;
58
+ readonly onChange: (color: HexColor) => void;
59
+ }
60
+ export interface ColorPickerProps extends ZoraBaseProps {
61
+ readonly tabs: readonly ColorPickerTab[];
62
+ readonly value: ColorPickerValue;
63
+ readonly onValueChange: (value: ColorPickerValue) => void;
64
+ readonly onSelectionChange?: (selection: ColorPickerSelection) => void;
65
+ readonly hideTabListWhenSingle?: boolean;
66
+ readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;
67
+ readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;
68
+ readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;
69
+ }
70
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtD,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAED,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;CACxB;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;CAC/D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ColorPickerTab = 'wheel' | 'tone' | 'hue';\n\n/** A consumer-owned OKLCH target from the published Templates tone catalog. */\nexport interface ColorToneTarget {\n readonly lightness: number;\n readonly chroma: number;\n}\n\n/**\n * Structural boundary for a Templates tone-pair entry. ZORA intentionally owns\n * neither the catalog nor its classifications.\n */\nexport interface ColorToneDefinition {\n readonly id: string;\n readonly accent: string;\n readonly accentTarget: ColorToneTarget;\n}\n\nexport interface ColorWheelSelection {\n readonly color: HexColor;\n readonly harmony: ColorHarmony | null;\n}\n\nexport interface ColorToneSelection {\n readonly toneId: string;\n readonly colors: readonly HexColor[];\n}\n\n/** The persistent, controlled state for every independently selectable picker mode. */\nexport interface ColorPickerValue {\n readonly tab: ColorPickerTab;\n readonly wheel: ColorWheelSelection;\n readonly tone: ColorToneSelection | null;\n readonly hue: HexColor;\n}\n\n/** A single mode-specific update emitted by the composed picker. */\nexport type ColorPickerSelection =\n | { readonly mode: 'wheel'; readonly value: ColorWheelSelection }\n | { readonly mode: 'tone'; readonly value: ColorToneSelection }\n | { readonly mode: 'hue'; readonly value: HexColor };\n\nexport interface ColorWheelProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly harmony?: ColorHarmony | null;\n readonly harmonies?: readonly ColorHarmony[];\n readonly onChange: (selection: ColorWheelSelection) => void;\n}\n\nexport interface ColorToneProps extends ZoraBaseProps {\n readonly tones: readonly ColorToneDefinition[];\n readonly selectionMode?: 'single' | 'multiple';\n readonly value: ColorToneSelection | null;\n readonly onChange: (selection: ColorToneSelection) => void;\n}\n\nexport interface ColorHueScaleProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly onChange: (color: HexColor) => void;\n}\n\nexport interface ColorPickerProps extends ZoraBaseProps {\n readonly tabs: readonly ColorPickerTab[];\n readonly value: ColorPickerValue;\n readonly onValueChange: (value: ColorPickerValue) => void;\n readonly onSelectionChange?: (selection: ColorPickerSelection) => void;\n readonly hideTabListWhenSingle?: boolean;\n readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;\n readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;\n readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "27.3.8",
4
+ "version": "27.4.0",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -47,8 +47,8 @@
47
47
  "@ankhorage/game": "^0.1.4",
48
48
  "@ankhorage/grid-view": "^0.5.0",
49
49
  "@ankhorage/reader": "^0.1.3",
50
- "@ankhorage/runtime": "^5.5.4",
51
- "@ankhorage/surface": "^9.5.17",
50
+ "@ankhorage/runtime": "^5.5.6",
51
+ "@ankhorage/surface": "^9.5.18",
52
52
  "@ankhorage/utility": "^1.10.1",
53
53
  "expo-document-picker": "~57.0.3",
54
54
  "expo-image-picker": "~57.0.20"
@@ -161,6 +161,7 @@
161
161
  "test:checkbox:chromium": "bun scripts/test-packed-checkbox-chromium.ts",
162
162
  "test:chess:chromium": "bun scripts/test-chess-chromium.ts",
163
163
  "test:graph-view:chromium": "bun scripts/test-graph-view-chromium.ts",
164
+ "test:color-picker:chromium": "bun scripts/test-packed-color-picker-chromium.ts",
164
165
  "typecheck": "bun x tsc --noEmit -p tsconfig.json && bun x tsc --noEmit -p tsconfig.scripts.json && bun x tsc -p tsconfig.typecheck.json",
165
166
  "version-packages": "ankhorage-changeset version"
166
167
  },
@@ -173,6 +174,7 @@
173
174
  "@react-native-vector-icons/ionicons": "^14.0.0",
174
175
  "@react-native-vector-icons/material-design-icons": "^14.0.0",
175
176
  "@types/bun": "^1.4.2",
177
+ "@types/culori": "^4.0.1",
176
178
  "@types/node": "^26.6.6",
177
179
  "@types/react": "^19.3.0",
178
180
  "@types/react-dom": "^19.3.0",
package/src/audit.test.ts CHANGED
@@ -66,9 +66,9 @@ const packageJsonSource = readFileSync(PACKAGE_JSON_PATH, 'utf8');
66
66
 
67
67
  const allSource = [srcSource, examplesSource, readmeSource, packageJsonSource].join('\n');
68
68
 
69
- describe('Plan 5 audit — no stale color-tone APIs', () => {
70
- test('no ColorTone / colorTone / ZORA_COLOR_TONES / ZoraColorTone references', () => {
71
- expect(allSource).not.toMatch(/ColorTone|colorTone|ZORA_COLOR_TONES|ZoraColorTone/);
69
+ describe('Plan 5 audit — no stale color-tone catalogs', () => {
70
+ test('no retired ZORA tone catalog references', () => {
71
+ expect(allSource).not.toMatch(/ZORA_COLOR_TONES|ZoraColorTone/);
72
72
  });
73
73
 
74
74
  test('no ZORA_COLOR_HARMONIES / ZoraColorHarmony references', () => {
@@ -0,0 +1,57 @@
1
+ import { generateColorSwatch } from '@ankhorage/color-theory';
2
+ import { Pressable } from '@ankhorage/surface';
3
+
4
+ import type { ColorHueScaleProps } from '../../types/color';
5
+ import { View } from '../layout/public';
6
+ import { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';
7
+ import { Text } from '../typography/public';
8
+
9
+ /*** Edits the 500 base color and previews its canonical 50-to-950 swatch. */
10
+ export const ColorHueScale = withZoraThemeScope(ColorHueScaleInner);
11
+
12
+ /*** Maps generated previews to an explicitly editable 500 base without misreporting preview selection. */
13
+ function ColorHueScaleInner({
14
+ themeId: _themeId,
15
+ mode: _mode,
16
+ inverted: _inverted,
17
+ interactionPolicy,
18
+ value,
19
+ onChange,
20
+ testID,
21
+ }: ColorHueScaleProps) {
22
+ const { swatch } = generateColorSwatch(value);
23
+ const swatches = Object.entries(swatch);
24
+
25
+ return (
26
+ <View
27
+ accessibilityLabel="Color scale previews; choose a preview as the next 500 base color"
28
+ direction="row"
29
+ gap="xs"
30
+ testID={testID}
31
+ wrap="wrap"
32
+ >
33
+ {swatches.map(([step, color]) => (
34
+ <Pressable
35
+ key={step}
36
+ accessibilityLabel={
37
+ Number(step) === 500
38
+ ? `Current editable base color 500: ${color}`
39
+ : `Use generated ${step} preview ${color} as the next base color 500`
40
+ }
41
+ bg={color}
42
+ borderColor="border"
43
+ borderWidth={Number(step) === 500 ? 3 : 1}
44
+ disabled={interactionPolicy === 'passive'}
45
+ height={48}
46
+ onPress={() => onChange(color)}
47
+ radius="sm"
48
+ width={48}
49
+ >
50
+ <Text align="center" variant="caption">
51
+ {step}
52
+ </Text>
53
+ </Pressable>
54
+ ))}
55
+ </View>
56
+ );
57
+ }
@@ -0,0 +1,105 @@
1
+ import React from 'react';
2
+
3
+ import type { ColorPickerProps, ColorPickerTab, ColorPickerValue } from '../../types/color';
4
+ import { Tab, TabList, TabPanel, Tabs } from '../tabs/public';
5
+ import { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';
6
+ import { ColorHueScale } from './ColorHueScale';
7
+ import { ColorTone } from './ColorTone';
8
+ import { ColorWheel } from './ColorWheel';
9
+
10
+ /*** Composes independently usable color controls into an ordered, consumer-configured picker. */
11
+ export const ColorPicker = withZoraThemeScope(ColorPickerInner);
12
+
13
+ /*** Coordinates persistent controlled color selections across independently usable picker tabs. */
14
+ function ColorPickerInner({
15
+ themeId: _themeId,
16
+ mode: _mode,
17
+ inverted: _inverted,
18
+ tabs,
19
+ value,
20
+ onValueChange,
21
+ onSelectionChange,
22
+ hideTabListWhenSingle = true,
23
+ wheel,
24
+ tone,
25
+ hue,
26
+ testID,
27
+ }: ColorPickerProps) {
28
+ if (tabs.length === 0) throw new Error('ColorPicker requires at least one tab.');
29
+ if (!tabs.includes(value.tab)) throw new Error('ColorPicker value must be configured in tabs.');
30
+
31
+ return (
32
+ <Tabs
33
+ defaultValue={value.tab}
34
+ onValueChange={(nextValue) => {
35
+ if (isColorPickerTab(nextValue) && tabs.includes(nextValue))
36
+ onValueChange({ ...value, tab: nextValue });
37
+ }}
38
+ testID={testID}
39
+ value={value.tab}
40
+ >
41
+ {tabs.length > 1 || !hideTabListWhenSingle ? (
42
+ <TabList fill>
43
+ {tabs.map((tab) => (
44
+ <Tab key={tab} label={tab} value={tab} />
45
+ ))}
46
+ </TabList>
47
+ ) : null}
48
+ {tabs.map((tab) => (
49
+ <TabPanel key={tab} value={tab}>
50
+ {resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)}
51
+ </TabPanel>
52
+ ))}
53
+ </Tabs>
54
+ );
55
+ }
56
+
57
+ /*** Check whether a Surface tab value belongs to the configured picker vocabulary. */
58
+ function isColorPickerTab(value: string): value is ColorPickerTab {
59
+ return value === 'wheel' || value === 'tone' || value === 'hue';
60
+ }
61
+
62
+ /*** Resolve the configured control for one picker tab without adding fallback feature modes. */
63
+ function resolveTabContent(
64
+ tab: ColorPickerTab,
65
+ value: ColorPickerValue,
66
+ wheel: ColorPickerProps['wheel'],
67
+ tone: ColorPickerProps['tone'],
68
+ hue: ColorPickerProps['hue'],
69
+ onValueChange: (value: ColorPickerValue) => void,
70
+ onSelectionChange: ColorPickerProps['onSelectionChange'],
71
+ ) {
72
+ if (tab === 'wheel')
73
+ return wheel ? (
74
+ <ColorWheel
75
+ {...wheel}
76
+ harmony={value.wheel.harmony}
77
+ onChange={(next) => {
78
+ onValueChange({ ...value, wheel: next });
79
+ onSelectionChange?.({ mode: 'wheel', value: next });
80
+ }}
81
+ value={value.wheel.color}
82
+ />
83
+ ) : null;
84
+ if (tab === 'tone')
85
+ return tone ? (
86
+ <ColorTone
87
+ {...tone}
88
+ onChange={(next) => {
89
+ onValueChange({ ...value, tone: next });
90
+ onSelectionChange?.({ mode: 'tone', value: next });
91
+ }}
92
+ value={value.tone}
93
+ />
94
+ ) : null;
95
+ return hue ? (
96
+ <ColorHueScale
97
+ {...hue}
98
+ onChange={(next) => {
99
+ onValueChange({ ...value, hue: next });
100
+ onSelectionChange?.({ mode: 'hue', value: next });
101
+ }}
102
+ value={value.hue}
103
+ />
104
+ ) : null;
105
+ }
@@ -0,0 +1,137 @@
1
+ import { Button, Pressable } from '@ankhorage/surface';
2
+ import React from 'react';
3
+
4
+ import type { ColorToneProps } from '../../types/color';
5
+ import { View } from '../layout/public';
6
+ import { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';
7
+ import { ColorWheel } from './ColorWheel';
8
+ import { resolveColorHue } from './utils/resolveColorHue';
9
+ import { resolveOklchColor } from './utils/resolveOklchColor';
10
+
11
+ const MAX_TONE_COLORS = 4;
12
+
13
+ /*** Selects consumer-provided OKLCH tone targets while keeping hue adjustable. */
14
+ export const ColorTone = withZoraThemeScope(ColorToneInner);
15
+
16
+ /*** Renders one supplied tone and its actual, editable OKLCH color selections. */
17
+ function ColorToneInner({
18
+ themeId: _themeId,
19
+ mode: _mode,
20
+ inverted: _inverted,
21
+ interactionPolicy,
22
+ tones,
23
+ selectionMode = 'single',
24
+ value,
25
+ onChange,
26
+ testID,
27
+ }: ColorToneProps) {
28
+ const [editingColorIndex, setEditingColorIndex] = React.useState(0);
29
+ const selectedTone = tones.find((tone) => tone.id === value?.toneId);
30
+ const colors = value
31
+ ? selectionMode === 'single'
32
+ ? value.colors.slice(0, 1)
33
+ : value.colors.slice(0, MAX_TONE_COLORS)
34
+ : [];
35
+ const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
36
+ const selectedColor = colors.at(currentEditingColorIndex);
37
+ const selectTone = (tone: ColorToneProps['tones'][number]) => {
38
+ const hue = selectedColor ? resolveColorHue(selectedColor) : 0;
39
+ setEditingColorIndex(0);
40
+ onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
41
+ };
42
+
43
+ return (
44
+ <View gap="sm" testID={testID}>
45
+ <View direction="row" wrap="wrap" gap="sm">
46
+ {tones.map((tone) => {
47
+ const selected = value?.toneId === tone.id;
48
+ const color =
49
+ selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
50
+ return (
51
+ <Pressable
52
+ key={tone.id}
53
+ accessibilityLabel={tone.accent}
54
+ accessibilityRole="radio"
55
+ accessibilityState={{ checked: selected }}
56
+ bg={color}
57
+ borderColor="border"
58
+ borderWidth={selected ? 3 : 1}
59
+ disabled={interactionPolicy === 'passive'}
60
+ height={44}
61
+ onPress={() => selectTone(tone)}
62
+ radius="md"
63
+ width={44}
64
+ />
65
+ );
66
+ })}
67
+ </View>
68
+ {selectedTone && selectedColor && value ? (
69
+ <>
70
+ <View direction="row" gap="xs" wrap="wrap">
71
+ {colors.map((color, index) => (
72
+ <Pressable
73
+ key={`${color}-${index}`}
74
+ accessibilityLabel={`Selected ${selectedTone.accent} color ${index + 1}: ${color}`}
75
+ accessibilityRole="radio"
76
+ accessibilityState={{ checked: currentEditingColorIndex === index }}
77
+ bg={color}
78
+ borderColor="border"
79
+ borderWidth={currentEditingColorIndex === index ? 3 : 1}
80
+ disabled={interactionPolicy === 'passive'}
81
+ height={44}
82
+ onPress={() => setEditingColorIndex(index)}
83
+ radius="md"
84
+ width={44}
85
+ />
86
+ ))}
87
+ {selectionMode === 'multiple' ? (
88
+ <Button
89
+ disabled={interactionPolicy === 'passive' || colors.length >= MAX_TONE_COLORS}
90
+ onPress={() => {
91
+ setEditingColorIndex(colors.length);
92
+ onChange({
93
+ toneId: selectedTone.id,
94
+ colors: [...colors, resolveOklchColor(selectedTone.accentTarget, 0)],
95
+ });
96
+ }}
97
+ >
98
+ Add color
99
+ </Button>
100
+ ) : null}
101
+ {selectionMode === 'multiple' && colors.length > 1 ? (
102
+ <Button
103
+ disabled={interactionPolicy === 'passive'}
104
+ onPress={() => {
105
+ const nextColors = colors.filter(
106
+ (_, index) => index !== currentEditingColorIndex,
107
+ );
108
+ setEditingColorIndex(Math.min(currentEditingColorIndex, nextColors.length - 1));
109
+ onChange({ toneId: selectedTone.id, colors: nextColors });
110
+ }}
111
+ >
112
+ Remove color
113
+ </Button>
114
+ ) : null}
115
+ </View>
116
+ <ColorWheel
117
+ harmony={null}
118
+ interactionPolicy={interactionPolicy}
119
+ onChange={({ color }) => {
120
+ const nextColor = resolveOklchColor(
121
+ selectedTone.accentTarget,
122
+ resolveColorHue(color),
123
+ );
124
+ onChange({
125
+ toneId: selectedTone.id,
126
+ colors: colors.map((entry, index) =>
127
+ index === currentEditingColorIndex ? nextColor : entry,
128
+ ),
129
+ });
130
+ }}
131
+ value={selectedColor}
132
+ />
133
+ </>
134
+ ) : null}
135
+ </View>
136
+ );
137
+ }