@ankhorage/zora 27.11.3 → 28.0.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 (226) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +4 -3
  3. package/dist/features/color/ColorHexField.d.ts +1 -1
  4. package/dist/features/color/ColorHexField.d.ts.map +1 -1
  5. package/dist/features/color/ColorHexField.js +2 -3
  6. package/dist/features/color/ColorHexField.js.map +1 -1
  7. package/dist/features/color/ColorPicker.d.ts +1 -1
  8. package/dist/features/color/ColorPicker.d.ts.map +1 -1
  9. package/dist/features/color/ColorPicker.js +106 -52
  10. package/dist/features/color/ColorPicker.js.map +1 -1
  11. package/dist/features/color/ColorWheel.d.ts +1 -1
  12. package/dist/features/color/ColorWheel.d.ts.map +1 -1
  13. package/dist/features/color/ColorWheel.js +50 -117
  14. package/dist/features/color/ColorWheel.js.map +1 -1
  15. package/dist/features/color/ColorWheelPointerProxy.web.d.ts +1 -1
  16. package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -1
  17. package/dist/features/color/ColorWheelPointerProxy.web.js +7 -4
  18. package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -1
  19. package/dist/features/color/public.d.ts +1 -1
  20. package/dist/features/color/public.d.ts.map +1 -1
  21. package/dist/features/color/public.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/types/color.d.ts +26 -26
  26. package/dist/types/color.d.ts.map +1 -1
  27. package/dist/types/color.js.map +1 -1
  28. package/package.json +2 -2
  29. package/src/features/color/ColorHexField.tsx +1 -3
  30. package/src/features/color/ColorPicker.layout.test.tsx +11 -16
  31. package/src/features/color/ColorPicker.tsx +217 -93
  32. package/src/features/color/ColorWheel.tsx +122 -248
  33. package/src/features/color/ColorWheelPointerProxy.web.tsx +11 -5
  34. package/src/features/color/public.ts +0 -2
  35. package/src/index.ts +0 -2
  36. package/src/types/color.ts +26 -22
  37. package/web-dist/chunks/Accordion-00h253nv.js +252 -0
  38. package/web-dist/chunks/{Accordion-qhn8z92r.js → Accordion-0gae3kzr.js} +3 -3
  39. package/web-dist/chunks/{Accordion-3jkeydhb.js → Accordion-0t53jhx1.js} +4 -4
  40. package/web-dist/chunks/{Accordion-vk2v1zwv.js → Accordion-1b2t4k36.js} +2 -2
  41. package/web-dist/chunks/{Accordion-aws0caav.js → Accordion-1dv8wytq.js} +3 -3
  42. package/web-dist/chunks/{Accordion-ysmzrvhn.js → Accordion-238zba4h.js} +3 -3
  43. package/web-dist/chunks/{Accordion-z8ryq8cb.js → Accordion-36674tfw.js} +7 -7
  44. package/web-dist/chunks/{Accordion-bd6q61s1.js → Accordion-36j1fw8r.js} +5 -5
  45. package/web-dist/chunks/{Accordion-jd26f516.js → Accordion-3ar6p84m.js} +3 -3
  46. package/web-dist/chunks/{Accordion-gezcm372.js → Accordion-3t2936t6.js} +4 -4
  47. package/web-dist/chunks/{Accordion-rzf52xq8.js → Accordion-43gp801f.js} +2 -2
  48. package/web-dist/chunks/{Accordion-c0a7mhq3.js → Accordion-52s4t1aq.js} +2 -2
  49. package/web-dist/chunks/{Accordion-vewhx028.js → Accordion-5adv6dv1.js} +4 -4
  50. package/web-dist/chunks/{Accordion-49w9bc2f.js → Accordion-5wx67nhg.js} +2 -2
  51. package/web-dist/chunks/{Accordion-p29kmwh9.js → Accordion-6225tr9r.js} +1 -1
  52. package/web-dist/chunks/{Accordion-x7ynjdv7.js → Accordion-6r1e7k5r.js} +1 -1
  53. package/web-dist/chunks/{Accordion-1mxnyexh.js → Accordion-6wcbzxzb.js} +13 -13
  54. package/web-dist/chunks/{Accordion-an5prgty.js → Accordion-7d0e5vhe.js} +1 -1
  55. package/web-dist/chunks/{Accordion-phtyg3k4.js → Accordion-7ppf31tg.js} +5 -5
  56. package/web-dist/chunks/{Accordion-5vs1k81g.js → Accordion-81rx3bh0.js} +8 -8
  57. package/web-dist/chunks/{Accordion-1etqb3cj.js → Accordion-8wm25z0h.js} +2 -2
  58. package/web-dist/chunks/{Accordion-f60g73bp.js → Accordion-94vndckf.js} +6 -6
  59. package/web-dist/chunks/{Accordion-ne91vwkd.js → Accordion-9fhsfynt.js} +2 -2
  60. package/web-dist/chunks/{Accordion-9c63jn3m.js → Accordion-ah1d9b6z.js} +4 -4
  61. package/web-dist/chunks/{Accordion-0kr0h68p.js → Accordion-b41rev86.js} +8 -8
  62. package/web-dist/chunks/{Accordion-q1tdazgq.js → Accordion-c8mmgjtj.js} +5 -5
  63. package/web-dist/chunks/{Accordion-pcj256bc.js → Accordion-d2kg4729.js} +5 -5
  64. package/web-dist/chunks/{Accordion-g451f3g9.js → Accordion-d4dp5ryp.js} +4 -4
  65. package/web-dist/chunks/{Accordion-dfq04q82.js → Accordion-dfv6p6gt.js} +4 -4
  66. package/web-dist/chunks/{Accordion-e3r3573t.js → Accordion-dpkp0y4p.js} +3 -3
  67. package/web-dist/chunks/{Accordion-pmfdf08d.js → Accordion-dxh9yn4f.js} +1 -1
  68. package/web-dist/chunks/{Accordion-zx8gmww4.js → Accordion-ec1tt3be.js} +9 -9
  69. package/web-dist/chunks/{Accordion-vnrqvfca.js → Accordion-epwpdegg.js} +1 -1
  70. package/web-dist/chunks/{Accordion-8g9c7890.js → Accordion-hbkzy0bg.js} +4 -4
  71. package/web-dist/chunks/{Accordion-c3nna2bz.js → Accordion-j6hgazmz.js} +1 -1
  72. package/web-dist/chunks/{Accordion-6nrpdbmb.js → Accordion-jara9sqj.js} +7 -7
  73. package/web-dist/chunks/{Accordion-3ecnh8d0.js → Accordion-knb3e18b.js} +4 -4
  74. package/web-dist/chunks/{Accordion-6m3k4avp.js → Accordion-m5baah44.js} +2 -2
  75. package/web-dist/chunks/{Accordion-3zw817fr.js → Accordion-nkppqfz4.js} +6 -6
  76. package/web-dist/chunks/{Accordion-3wkd5x2q.js → Accordion-phcp8d5v.js} +3 -3
  77. package/web-dist/chunks/{Accordion-x0p3wxfp.js → Accordion-pm2f2j32.js} +2 -2
  78. package/web-dist/chunks/{Accordion-j0zhpq4s.js → Accordion-q697hacs.js} +7 -7
  79. package/web-dist/chunks/{Accordion-eak89n4n.js → Accordion-re4r47xn.js} +6 -6
  80. package/web-dist/chunks/{Accordion-r1wkgt7c.js → Accordion-rev9ssd4.js} +516 -544
  81. package/web-dist/chunks/{Accordion-h2nd5y0z.js → Accordion-sn241nek.js} +5 -5
  82. package/web-dist/chunks/{Accordion-jbwey4za.js → Accordion-tppk4vwt.js} +9 -9
  83. package/web-dist/chunks/{Accordion-6yv4beha.js → Accordion-wbmzvfaw.js} +1 -1
  84. package/web-dist/chunks/{Accordion-4g54je0w.js → Accordion-wcw153f0.js} +2 -2
  85. package/web-dist/chunks/{Accordion-705yrq6w.js → Accordion-wpj8pd40.js} +1 -1
  86. package/web-dist/chunks/{Accordion-z4qakakw.js → Accordion-ytxgphds.js} +2 -2
  87. package/web-dist/chunks/{Accordion-h0e95qxp.js → Accordion-z1cq2mnx.js} +9 -9
  88. package/web-dist/chunks/{Accordion-xb174981.js → Accordion-z9yw0xy9.js} +8 -8
  89. package/web-dist/chunks/{Accordion-e5jr9ahb.js → Accordion-zte416jw.js} +1 -1
  90. package/web-dist/chunks/{Accordion-xwstve3k.js → Accordion-zzymcpty.js} +2 -2
  91. package/web-dist/components/accordion/Accordion.js +10 -10
  92. package/web-dist/components/accordion-item/AccordionItem.js +10 -10
  93. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  94. package/web-dist/components/app-bar/AppBar.js +15 -15
  95. package/web-dist/components/app-header/AppHeader.js +15 -15
  96. package/web-dist/components/app-shell/AppShell.js +4 -4
  97. package/web-dist/components/auth-screen/AuthScreen.js +20 -20
  98. package/web-dist/components/avatar/Avatar.js +10 -10
  99. package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
  100. package/web-dist/components/badge/Badge.js +5 -5
  101. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -18
  102. package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
  103. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
  104. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
  105. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
  106. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
  107. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
  108. package/web-dist/components/breadcrumbs/Breadcrumbs.js +12 -12
  109. package/web-dist/components/button/Button.js +10 -10
  110. package/web-dist/components/button-group/ButtonGroup.js +10 -10
  111. package/web-dist/components/calendar/Calendar.js +12 -12
  112. package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -18
  113. package/web-dist/components/card/Card.js +17 -17
  114. package/web-dist/components/card-back/CardBack.js +4 -4
  115. package/web-dist/components/card-hand/CardHand.js +4 -4
  116. package/web-dist/components/carousel/Carousel.js +2 -2
  117. package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
  118. package/web-dist/components/checkbox/Checkbox.js +10 -10
  119. package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
  120. package/web-dist/components/chess-board/ChessBoard.js +4 -4
  121. package/web-dist/components/chip/Chip.js +11 -11
  122. package/web-dist/components/chip-group/ChipGroup.js +11 -11
  123. package/web-dist/components/collection-editor/CollectionEditor.js +17 -17
  124. package/web-dist/components/color-hue-scale/ColorHueScale.js +27 -16
  125. package/web-dist/components/color-picker/ColorPicker.d.ts +2 -2
  126. package/web-dist/components/color-picker/ColorPicker.js +27 -16
  127. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +26 -45
  128. package/web-dist/components/color-picker/index.d.ts +1 -1
  129. package/web-dist/components/color-tone/ColorTone.js +27 -16
  130. package/web-dist/components/color-wheel/ColorWheel.d.ts +1 -1
  131. package/web-dist/components/color-wheel/ColorWheel.js +27 -16
  132. package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +2 -0
  133. package/web-dist/components/content-rail/ContentRail.js +11 -11
  134. package/web-dist/components/data-table/DataTable.js +23 -23
  135. package/web-dist/components/date-picker/DatePicker.js +16 -16
  136. package/web-dist/components/dialog/Dialog.js +9 -9
  137. package/web-dist/components/divider/Divider.js +4 -4
  138. package/web-dist/components/empty-state/EmptyState.js +18 -18
  139. package/web-dist/components/explorer/Explorer.js +11 -11
  140. package/web-dist/components/field/Field.js +10 -10
  141. package/web-dist/components/file-explorer/FileExplorer.js +11 -11
  142. package/web-dist/components/flat-list/FlatList.js +11 -11
  143. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +20 -20
  144. package/web-dist/components/form/Form.js +14 -14
  145. package/web-dist/components/form-actions/FormActions.js +14 -14
  146. package/web-dist/components/form-error/FormError.js +14 -14
  147. package/web-dist/components/game/Game.js +5 -5
  148. package/web-dist/components/game-entity/GameEntity.js +5 -5
  149. package/web-dist/components/game-field/GameField.js +5 -5
  150. package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
  151. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
  152. package/web-dist/components/game-overlay/GameOverlay.js +5 -5
  153. package/web-dist/components/gradient/Gradient.js +5 -5
  154. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
  155. package/web-dist/components/grid/Grid.js +4 -4
  156. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
  157. package/web-dist/components/grid-ruler/GridRuler.js +4 -4
  158. package/web-dist/components/heading/Heading.js +5 -5
  159. package/web-dist/components/hero/Hero.js +17 -17
  160. package/web-dist/components/icon/Icon.js +4 -4
  161. package/web-dist/components/icon-button/IconButton.js +10 -10
  162. package/web-dist/components/image/Image.js +8 -8
  163. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
  164. package/web-dist/components/list/List.js +11 -11
  165. package/web-dist/components/list-item/ListItem.js +11 -11
  166. package/web-dist/components/list-section/ListSection.js +11 -11
  167. package/web-dist/components/master-detail/MasterDetail.js +4 -4
  168. package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
  169. package/web-dist/components/media-card/MediaCard.js +17 -17
  170. package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
  171. package/web-dist/components/message-bubble/MessageBubble.js +14 -14
  172. package/web-dist/components/metric-card/MetricCard.js +17 -17
  173. package/web-dist/components/missing-element/MissingElement.js +9 -9
  174. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +20 -20
  175. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +20 -20
  176. package/web-dist/components/opening-book/OpeningBook.js +4 -4
  177. package/web-dist/components/otp-form/OtpForm.js +20 -20
  178. package/web-dist/components/pagination/Pagination.js +11 -11
  179. package/web-dist/components/palette-item/PaletteItem.js +17 -17
  180. package/web-dist/components/playing-card/PlayingCard.js +4 -4
  181. package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
  182. package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
  183. package/web-dist/components/post-card/PostCard.js +17 -17
  184. package/web-dist/components/product-card/ProductCard.js +17 -17
  185. package/web-dist/components/progress/Progress.js +8 -8
  186. package/web-dist/components/progress-ring/ProgressRing.js +8 -8
  187. package/web-dist/components/radio/Radio.js +12 -12
  188. package/web-dist/components/radio-group/RadioGroup.js +12 -12
  189. package/web-dist/components/rating/Rating.js +7 -7
  190. package/web-dist/components/reader/Reader.js +18 -18
  191. package/web-dist/components/scan-overlay/ScanOverlay.js +18 -18
  192. package/web-dist/components/screen/Screen.js +4 -4
  193. package/web-dist/components/screen-section/ScreenSection.js +8 -8
  194. package/web-dist/components/scroll-view/ScrollView.js +4 -4
  195. package/web-dist/components/search-input/SearchInput.js +12 -12
  196. package/web-dist/components/section-header/SectionHeader.js +8 -8
  197. package/web-dist/components/section-list/SectionList.js +11 -11
  198. package/web-dist/components/select/Select.js +21 -257
  199. package/web-dist/components/selectable-item/SelectableItem.js +3 -3
  200. package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
  201. package/web-dist/components/sign-in-form/SignInForm.js +20 -20
  202. package/web-dist/components/sign-up-form/SignUpForm.js +20 -20
  203. package/web-dist/components/skeleton/Skeleton.js +20 -20
  204. package/web-dist/components/skeleton-card/SkeletonCard.js +20 -20
  205. package/web-dist/components/skeleton-list/SkeletonList.js +20 -20
  206. package/web-dist/components/skeleton-text/SkeletonText.js +20 -20
  207. package/web-dist/components/surface/Surface.js +5 -5
  208. package/web-dist/components/switch/Switch.js +5 -5
  209. package/web-dist/components/tab/Tab.js +5 -5
  210. package/web-dist/components/tab-list/TabList.js +5 -5
  211. package/web-dist/components/tab-panel/TabPanel.js +5 -5
  212. package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
  213. package/web-dist/components/tabs/Tabs.js +5 -5
  214. package/web-dist/components/text/Text.js +5 -5
  215. package/web-dist/components/text-input/TextInput.js +12 -12
  216. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +10 -10
  217. package/web-dist/components/time-picker/TimePicker.js +15 -15
  218. package/web-dist/components/timeline/Timeline.js +10 -10
  219. package/web-dist/components/toast/Toast.js +7 -7
  220. package/web-dist/components/toast-provider/ToastProvider.js +7 -7
  221. package/web-dist/components/toolbar/Toolbar.js +17 -17
  222. package/web-dist/components/tree-item/TreeItem.js +15 -15
  223. package/web-dist/components/uploader/Uploader.js +20 -20
  224. package/web-dist/components/view/View.js +4 -4
  225. package/web-dist/manifest.json +1495 -1446
  226. package/web-dist/runtime/ZoraProvider.js +6 -6
@@ -4,27 +4,27 @@ import {
4
4
  parseHexColorOrThrow,
5
5
  converter_default,
6
6
  formatHex,
7
+ COLOR_HARMONY_CATALOG,
7
8
  generateHarmonyRoleColors,
8
9
  generateColorSwatch
9
- } from "./Accordion-an5prgty.js";
10
+ } from "./Accordion-7d0e5vhe.js";
10
11
  import {
11
12
  Pressable
12
- } from "./Accordion-rzf52xq8.js";
13
+ } from "./Accordion-43gp801f.js";
13
14
  import {
14
15
  withZoraThemeScope
15
- } from "./Accordion-e5jr9ahb.js";
16
+ } from "./Accordion-zte416jw.js";
16
17
  import {
17
- View2
18
- } from "./Accordion-qhn8z92r.js";
18
+ View2,
19
+ Divider2
20
+ } from "./Accordion-0gae3kzr.js";
19
21
  import {
22
+ Heading2,
20
23
  Text3
21
- } from "./Accordion-aws0caav.js";
24
+ } from "./Accordion-1dv8wytq.js";
22
25
  import {
23
26
  TextInput3
24
- } from "./Accordion-6yv4beha.js";
25
- import {
26
- Icon2
27
- } from "./Accordion-1etqb3cj.js";
27
+ } from "./Accordion-wbmzvfaw.js";
28
28
  import {
29
29
  Button2,
30
30
  Circle,
@@ -38,16 +38,22 @@ import {
38
38
  Stop,
39
39
  Svg,
40
40
  IconButton2
41
- } from "./Accordion-0kr0h68p.js";
41
+ } from "./Accordion-b41rev86.js";
42
+ import {
43
+ Card2
44
+ } from "./Accordion-6wcbzxzb.js";
45
+ import {
46
+ Select2
47
+ } from "./Accordion-00h253nv.js";
42
48
  import {
43
49
  Tab2,
44
50
  TabList2,
45
51
  TabPanel2,
46
52
  Tabs2
47
- } from "./Accordion-3jkeydhb.js";
53
+ } from "./Accordion-0t53jhx1.js";
48
54
  import {
49
55
  useZoraTheme2
50
- } from "./Accordion-c3nna2bz.js";
56
+ } from "./Accordion-j6hgazmz.js";
51
57
 
52
58
  // src/features/color/ColorHexField.tsx
53
59
  import React from "react";
@@ -75,11 +81,6 @@ function ColorHexField({
75
81
  if (isHexColor(nextValue))
76
82
  onChange(nextValue);
77
83
  },
78
- trailingAccessory: /* @__PURE__ */ jsx(Icon2, {
79
- color: "textMuted",
80
- name: "copy-outline",
81
- size: "m"
82
- }),
83
84
  value: input
84
85
  }, value);
85
86
  }
@@ -296,12 +297,55 @@ function ColorHueScaleInner({
296
297
  });
297
298
  }
298
299
 
299
- // src/features/color/ColorTone.tsx
300
+ // src/features/color/ColorWheel.tsx
300
301
  import React5 from "react";
301
302
 
303
+ // src/features/color/ColorWheelKeyboardProxy.web.tsx
304
+ import { jsx as jsx5 } from "react/jsx-runtime";
305
+ function ColorWheelKeyboardProxy({
306
+ children,
307
+ chroma,
308
+ disabled,
309
+ hue,
310
+ onChange
311
+ }) {
312
+ return /* @__PURE__ */ jsx5("div", {
313
+ "aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
314
+ "aria-valuemax": 360,
315
+ "aria-valuemin": 0,
316
+ "aria-valuenow": Math.round(hue),
317
+ "aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
318
+ "aria-disabled": disabled,
319
+ onKeyDown: (event) => {
320
+ const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma);
321
+ if (!nextValue || disabled)
322
+ return;
323
+ event.preventDefault();
324
+ onChange(nextValue.hue, nextValue.chroma);
325
+ },
326
+ role: "slider",
327
+ tabIndex: disabled ? -1 : 0,
328
+ children
329
+ });
330
+ }
331
+ function resolveKeyboardWheelValue(key, hue, chroma) {
332
+ if (key === "ArrowLeft")
333
+ return { chroma, hue: normalizeHue(hue - 5) };
334
+ if (key === "ArrowRight")
335
+ return { chroma, hue: normalizeHue(hue + 5) };
336
+ if (key === "ArrowDown")
337
+ return { chroma: Math.max(0, chroma - 0.02), hue };
338
+ if (key === "ArrowUp")
339
+ return { chroma: Math.min(0.2, chroma + 0.02), hue };
340
+ return;
341
+ }
342
+ function normalizeHue(hue) {
343
+ return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
344
+ }
345
+
302
346
  // src/features/color/ColorWheelPointerProxy.web.tsx
303
347
  import React4 from "react";
304
- import { jsx as jsx5 } from "react/jsx-runtime";
348
+ import { jsx as jsx6 } from "react/jsx-runtime";
305
349
  function ColorWheelPointerProxy({
306
350
  children,
307
351
  disabled,
@@ -315,22 +359,26 @@ function ColorWheelPointerProxy({
315
359
  const rect = target.getBoundingClientRect();
316
360
  onChange((event.clientX - rect.left) / rect.width * width, (event.clientY - rect.top) / rect.height * height);
317
361
  };
318
- return /* @__PURE__ */ jsx5("div", {
319
- onMouseDown: (event) => {
362
+ return /* @__PURE__ */ jsx6("div", {
363
+ onPointerDown: (event) => {
320
364
  if (disabled)
321
365
  return;
322
366
  dragging.current = true;
367
+ event.currentTarget.setPointerCapture(event.pointerId);
323
368
  changeAt(event);
324
369
  },
325
- onMouseMove: (event) => {
370
+ onPointerMove: (event) => {
326
371
  if (!disabled && dragging.current)
327
372
  changeAt(event);
328
373
  },
329
- onMouseUp: (event) => {
374
+ onPointerUp: (event) => {
330
375
  if (!disabled && dragging.current)
331
376
  changeAt(event);
332
377
  dragging.current = false;
333
378
  },
379
+ onPointerCancel: () => {
380
+ dragging.current = false;
381
+ },
334
382
  style: { touchAction: "none" },
335
383
  children
336
384
  });
@@ -346,8 +394,420 @@ function resolveWheelColorComponents(color) {
346
394
  };
347
395
  }
348
396
 
397
+ // src/features/color/utils/resolveWheelColor.ts
398
+ function resolveWheelColor(color, x, y, center, radius, maxChroma) {
399
+ const { lightness } = resolveWheelColorComponents(color);
400
+ const deltaX = x - center;
401
+ const deltaY = y - center;
402
+ const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
403
+ const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
404
+ const chroma = distance / radius * maxChroma;
405
+ return resolveOklchColor({ lightness, chroma }, hue);
406
+ }
407
+ function normalizeHue2(hue) {
408
+ return hue < 0 ? hue + 360 : hue;
409
+ }
410
+
411
+ // src/features/color/ColorWheel.tsx
412
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
413
+ var VIEWBOX = 1000;
414
+ var CENTER = VIEWBOX / 2;
415
+ var RADIUS = 480;
416
+ var SEGMENTS = 96;
417
+ var MAX_CHROMA = 0.2;
418
+ var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
419
+ function ColorWheelInner({
420
+ themeId: _themeId,
421
+ mode: _mode,
422
+ inverted: _inverted,
423
+ interactionPolicy,
424
+ value,
425
+ harmony = null,
426
+ onChange,
427
+ size = 340,
428
+ testID
429
+ }) {
430
+ const { theme } = useZoraTheme2();
431
+ const hue = resolveColorHue(value);
432
+ const { chroma, lightness } = resolveWheelColorComponents(value);
433
+ const primaryPoint = pointFor(hue, Math.min(1, chroma / MAX_CHROMA));
434
+ const harmonyPoints = harmony ? generateHarmonyRoleColors(value, harmony).colors.map((color) => pointFor(color.hueDegrees)) : [];
435
+ const gradientId = `color-wheel-${React5.useId().replaceAll(":", "")}`;
436
+ const changeAt = (x, y) => {
437
+ if (interactionPolicy !== "passive")
438
+ onChange({ color: resolveWheelColor(value, x, y, CENTER, RADIUS, MAX_CHROMA), harmony });
439
+ };
440
+ return /* @__PURE__ */ jsx7(ColorWheelKeyboardProxy, {
441
+ chroma,
442
+ disabled: interactionPolicy === "passive",
443
+ hue,
444
+ onChange: (nextHue, nextChroma) => onChange({ color: resolveOklchColor({ chroma: nextChroma, lightness }, nextHue), harmony }),
445
+ children: /* @__PURE__ */ jsx7(ColorWheelPointerProxy, {
446
+ disabled: interactionPolicy === "passive",
447
+ height: VIEWBOX,
448
+ onChange: changeAt,
449
+ width: VIEWBOX,
450
+ children: /* @__PURE__ */ jsxs3(Svg, {
451
+ accessibilityLabel: "Color wheel",
452
+ height: size,
453
+ onResponderGrant: (event) => changeAt(event.nativeEvent.locationX / size * VIEWBOX, event.nativeEvent.locationY / size * VIEWBOX),
454
+ onResponderMove: (event) => changeAt(event.nativeEvent.locationX / size * VIEWBOX, event.nativeEvent.locationY / size * VIEWBOX),
455
+ onResponderRelease: (event) => changeAt(event.nativeEvent.locationX / size * VIEWBOX, event.nativeEvent.locationY / size * VIEWBOX),
456
+ onStartShouldSetResponder: () => interactionPolicy !== "passive",
457
+ testID,
458
+ viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}`,
459
+ width: size,
460
+ children: [
461
+ /* @__PURE__ */ jsx7(Defs, {
462
+ children: segments().map((segment) => /* @__PURE__ */ jsxs3(RadialGradient, {
463
+ cx: CENTER,
464
+ cy: CENTER,
465
+ id: `${gradientId}-${segment.hue}`,
466
+ r: RADIUS,
467
+ children: [
468
+ /* @__PURE__ */ jsx7(Stop, {
469
+ offset: "0",
470
+ stopColor: resolveOklchColor({ chroma: 0, lightness: 0.72 }, segment.hue)
471
+ }),
472
+ /* @__PURE__ */ jsx7(Stop, {
473
+ offset: "1",
474
+ stopColor: segment.color
475
+ })
476
+ ]
477
+ }, segment.hue))
478
+ }),
479
+ segments().map((segment) => /* @__PURE__ */ jsx7(Path, {
480
+ d: segment.path,
481
+ fill: `url(#${gradientId}-${segment.hue})`
482
+ }, segment.hue)),
483
+ harmonyPoints.length === 3 ? /* @__PURE__ */ jsx7(Polygon, {
484
+ fill: "none",
485
+ points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
486
+ stroke: theme.semantics.content.default,
487
+ strokeWidth: 6
488
+ }) : linesFor(harmonyPoints, primaryPoint, theme.semantics.content.default),
489
+ harmonyPoints.map((point) => /* @__PURE__ */ jsx7(Circle, {
490
+ cx: point.x,
491
+ cy: point.y,
492
+ fill: theme.semantics.content.default,
493
+ r: 26
494
+ }, `${point.x}-${point.y}`)),
495
+ /* @__PURE__ */ jsx7(Circle, {
496
+ cx: primaryPoint.x,
497
+ cy: primaryPoint.y,
498
+ fill: "none",
499
+ r: 36,
500
+ stroke: "white",
501
+ strokeWidth: 12
502
+ }),
503
+ /* @__PURE__ */ jsx7(Circle, {
504
+ cx: primaryPoint.x,
505
+ cy: primaryPoint.y,
506
+ fill: "none",
507
+ r: 42,
508
+ stroke: theme.semantics.content.default,
509
+ strokeWidth: 6
510
+ })
511
+ ]
512
+ })
513
+ })
514
+ });
515
+ }
516
+ function segments() {
517
+ return Array.from({ length: SEGMENTS }, (_, index) => {
518
+ const hue = index * 360 / SEGMENTS;
519
+ return {
520
+ color: resolveOklchColor({ chroma: MAX_CHROMA, lightness: 0.65 }, hue),
521
+ hue,
522
+ path: segmentPath(hue, hue + 360 / SEGMENTS)
523
+ };
524
+ });
525
+ }
526
+ function segmentPath(start, end) {
527
+ const startPoint = pointFor(start);
528
+ const endPoint = pointFor(end);
529
+ return `M ${CENTER} ${CENTER} L ${startPoint.x} ${startPoint.y} A ${RADIUS} ${RADIUS} 0 0 1 ${endPoint.x} ${endPoint.y} Z`;
530
+ }
531
+ function pointFor(hue, ratio = 1) {
532
+ const radians = (hue - 90) * Math.PI / 180;
533
+ return {
534
+ x: CENTER + RADIUS * ratio * Math.cos(radians),
535
+ y: CENTER + RADIUS * ratio * Math.sin(radians)
536
+ };
537
+ }
538
+ function linesFor(points, primary, stroke) {
539
+ return points.slice(1).reduce(({ lines, previous }, point) => ({
540
+ lines: [
541
+ ...lines,
542
+ /* @__PURE__ */ jsx7(Line, {
543
+ stroke,
544
+ strokeWidth: 6,
545
+ x1: previous.x,
546
+ x2: point.x,
547
+ y1: previous.y,
548
+ y2: point.y
549
+ }, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
550
+ ],
551
+ previous: point
552
+ }), { lines: [], previous: points.at(0) ?? primary }).lines;
553
+ }
554
+
555
+ // src/features/color/ColorPicker.tsx
556
+ import React6 from "react";
557
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
558
+ var DEFAULT_TABS = ["grid", "wheel"];
559
+ var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
560
+ function ColorPickerInner({
561
+ themeId: _themeId,
562
+ mode: _mode,
563
+ inverted: _inverted,
564
+ tabs = DEFAULT_TABS,
565
+ primaryColor,
566
+ harmony,
567
+ tone,
568
+ tones = [],
569
+ width = 560,
570
+ activeTab,
571
+ onValueChange,
572
+ onActiveTabChange,
573
+ onDismiss,
574
+ hideTabListWhenSingle = true,
575
+ wheel,
576
+ interactionPolicy,
577
+ testID
578
+ }) {
579
+ const { theme } = useZoraTheme2();
580
+ const enabledTabs = resolveEnabledTabs(tabs);
581
+ const firstTab = enabledTabs.at(0);
582
+ if (!firstTab)
583
+ throw new Error("ColorPicker requires at least one tab.");
584
+ const resolvedTab = activeTab && enabledTabs.includes(activeTab) ? activeTab : firstTab;
585
+ const geometry = resolveGeometry(width);
586
+ const selectedTone = tones.find((entry) => entry.id === tone);
587
+ const emit = (next) => onValueChange({
588
+ primaryColor: next.primaryColor ?? primaryColor,
589
+ ...next.harmony === undefined ? harmony ? { harmony } : {} : { harmony: next.harmony },
590
+ ...next.tone === undefined ? tone ? { tone } : {} : { tone: next.tone }
591
+ });
592
+ const settings = (children) => /* @__PURE__ */ jsx8(PickerRow, {
593
+ geometry,
594
+ tone,
595
+ tones,
596
+ harmony,
597
+ onHarmonyChange: (next) => emit({ harmony: next }),
598
+ onToneChange: (next) => emit({ tone: next }),
599
+ children
600
+ });
601
+ React6.useEffect(() => {
602
+ if (activeTab && activeTab !== resolvedTab)
603
+ onActiveTabChange?.(resolvedTab);
604
+ }, [activeTab, onActiveTabChange, resolvedTab]);
605
+ return /* @__PURE__ */ jsxs4(View2, {
606
+ alignSelf: "center",
607
+ bg: theme.semantics.surface.raised,
608
+ borderColor: theme.semantics.border.default,
609
+ borderWidth: 1,
610
+ gap: "m",
611
+ maxWidth: "100%",
612
+ p: geometry.padding,
613
+ radius: "xl",
614
+ testID,
615
+ width: geometry.width,
616
+ children: [
617
+ /* @__PURE__ */ jsxs4(View2, {
618
+ align: "center",
619
+ direction: "row",
620
+ justify: "space-between",
621
+ minHeight: 48,
622
+ children: [
623
+ /* @__PURE__ */ jsx8(Heading2, {
624
+ level: 2,
625
+ children: "Color"
626
+ }),
627
+ /* @__PURE__ */ jsxs4(View2, {
628
+ align: "center",
629
+ direction: "row",
630
+ gap: "s",
631
+ children: [
632
+ /* @__PURE__ */ jsx8(View2, {
633
+ bg: primaryColor,
634
+ borderColor: theme.semantics.border.default,
635
+ borderWidth: 1,
636
+ height: 36,
637
+ radius: "s",
638
+ width: 52
639
+ }),
640
+ onDismiss ? /* @__PURE__ */ jsx8(IconButton2, {
641
+ iconName: "close",
642
+ label: "Close color picker",
643
+ onPress: onDismiss
644
+ }) : null
645
+ ]
646
+ })
647
+ ]
648
+ }),
649
+ /* @__PURE__ */ jsxs4(Tabs2, {
650
+ onValueChange: (next) => {
651
+ if (isColorPickerTab(next) && enabledTabs.includes(next))
652
+ onActiveTabChange?.(next);
653
+ },
654
+ value: resolvedTab,
655
+ variant: "attached",
656
+ children: [
657
+ enabledTabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx8(View2, {
658
+ borderColor: theme.semantics.border.default,
659
+ borderWidth: 1,
660
+ overflow: "hidden",
661
+ radius: "m",
662
+ children: /* @__PURE__ */ jsx8(TabList2, {
663
+ fill: true,
664
+ children: enabledTabs.map((tab) => /* @__PURE__ */ jsx8(Tab2, {
665
+ label: tab === "grid" ? "Grid" : "Wheel",
666
+ value: tab
667
+ }, tab))
668
+ })
669
+ }) : null,
670
+ enabledTabs.includes("grid") ? /* @__PURE__ */ jsx8(TabPanel2, {
671
+ value: "grid",
672
+ children: settings(/* @__PURE__ */ jsx8(ColorGrid, {
673
+ onSelect: (color) => emit({ primaryColor: color }),
674
+ palette: resolvePalette(selectedTone),
675
+ selectionBorderColor: theme.semantics.content.default,
676
+ selected: primaryColor,
677
+ size: geometry.stage
678
+ }))
679
+ }) : null,
680
+ enabledTabs.includes("wheel") ? /* @__PURE__ */ jsx8(TabPanel2, {
681
+ value: "wheel",
682
+ children: settings(/* @__PURE__ */ jsx8(ColorWheel2, {
683
+ ...wheel,
684
+ harmony: harmony ?? null,
685
+ onChange: (next) => emit({ primaryColor: next.color, harmony: next.harmony ?? undefined }),
686
+ size: geometry.stage,
687
+ value: primaryColor
688
+ }))
689
+ }) : null
690
+ ]
691
+ }),
692
+ /* @__PURE__ */ jsx8(Divider2, {}),
693
+ /* @__PURE__ */ jsx8(ColorHexField, {
694
+ disabled: interactionPolicy === "passive",
695
+ onChange: (color) => emit({ primaryColor: color }),
696
+ value: primaryColor
697
+ })
698
+ ]
699
+ });
700
+ }
701
+ function PickerRow({
702
+ children,
703
+ geometry,
704
+ tone,
705
+ tones,
706
+ harmony,
707
+ onToneChange,
708
+ onHarmonyChange
709
+ }) {
710
+ return /* @__PURE__ */ jsxs4(View2, {
711
+ align: "flex-start",
712
+ direction: "row",
713
+ gap: geometry.gap,
714
+ children: [
715
+ /* @__PURE__ */ jsxs4(View2, {
716
+ gap: "m",
717
+ width: geometry.rail,
718
+ children: [
719
+ /* @__PURE__ */ jsx8(Card2, {
720
+ compact: true,
721
+ title: "Tone",
722
+ children: /* @__PURE__ */ jsx8(Select2, {
723
+ onValueChange: onToneChange,
724
+ options: tones.map((entry) => ({ label: entry.accent, value: entry.id })),
725
+ placeholder: "Any tone",
726
+ value: tone
727
+ })
728
+ }),
729
+ /* @__PURE__ */ jsx8(Card2, {
730
+ compact: true,
731
+ title: "Harmony",
732
+ children: /* @__PURE__ */ jsx8(Select2, {
733
+ onValueChange: onHarmonyChange,
734
+ options: COLOR_HARMONY_CATALOG.map((entry) => ({
735
+ label: entry.label,
736
+ value: entry.id
737
+ })),
738
+ placeholder: "None",
739
+ value: harmony
740
+ })
741
+ })
742
+ ]
743
+ }),
744
+ children
745
+ ]
746
+ });
747
+ }
748
+ function ColorGrid({
749
+ palette,
750
+ selectionBorderColor,
751
+ selected,
752
+ size,
753
+ onSelect
754
+ }) {
755
+ const gap = Math.max(3, Math.round(size / 68));
756
+ const cell = (size - 7 * gap) / 8;
757
+ return /* @__PURE__ */ jsx8(View2, {
758
+ accessibilityLabel: "Color grid",
759
+ direction: "row",
760
+ gap,
761
+ width: size,
762
+ wrap: "wrap",
763
+ children: palette.map((color) => /* @__PURE__ */ jsx8(Pressable, {
764
+ accessibilityLabel: `Select ${color}`,
765
+ bg: color,
766
+ borderColor: color === selected ? selectionBorderColor : "transparent",
767
+ borderWidth: color === selected ? 3 : 1,
768
+ height: cell,
769
+ onPress: () => onSelect(color),
770
+ radius: "s",
771
+ width: cell
772
+ }, color))
773
+ });
774
+ }
775
+ function resolvePalette(tone) {
776
+ const target = tone?.accentTarget;
777
+ return Array.from({ length: 64 }, (_, index) => resolveOklchColor({
778
+ chroma: target?.chroma ?? 0.08 + index % 8 * 0.018,
779
+ lightness: target?.lightness ?? 0.35 + Math.floor(index / 8) * 0.065
780
+ }, index * 137.508 % 360));
781
+ }
782
+ function resolveGeometry(requestedWidth) {
783
+ if (requestedWidth < 360)
784
+ throw new Error("ColorPicker requires a host width of at least 360 logical pixels.");
785
+ const scale = Math.max(0, (Math.min(requestedWidth, 560) - 360) / 200);
786
+ const padding = 12 + scale * 12;
787
+ const rail = 104 + scale * 46;
788
+ const gap = 12 + scale * 8;
789
+ return {
790
+ width: requestedWidth,
791
+ padding,
792
+ rail,
793
+ gap,
794
+ stage: requestedWidth - 2 - 2 * padding - rail - gap
795
+ };
796
+ }
797
+ function resolveEnabledTabs(tabs) {
798
+ if (tabs.length === 0)
799
+ throw new Error("ColorPicker requires at least one tab.");
800
+ if (tabs.some((tab) => !isColorPickerTab(tab)))
801
+ throw new Error("ColorPicker supports only Grid and Wheel tabs.");
802
+ return tabs;
803
+ }
804
+ function isColorPickerTab(value) {
805
+ return value === "grid" || value === "wheel";
806
+ }
807
+
349
808
  // src/features/color/ColorTone.tsx
350
- import { jsx as jsx6, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
809
+ import React7 from "react";
810
+ import { jsx as jsx9, jsxs as jsxs5, Fragment } from "react/jsx-runtime";
351
811
  var MAX_TONE_COLORS = 4;
352
812
  var TONE_MAP_WIDTH = 280;
353
813
  var TONE_MAP_HEIGHT = 220;
@@ -365,7 +825,7 @@ function ColorToneInner({
365
825
  testID
366
826
  }) {
367
827
  const { theme } = useZoraTheme2();
368
- const [editingColorIndex, setEditingColorIndex] = React5.useState(0);
828
+ const [editingColorIndex, setEditingColorIndex] = React7.useState(0);
369
829
  const selectedTone = tones.find((tone) => tone.id === value?.toneId);
370
830
  const colors = value ? selectionMode === "single" ? value.colors.slice(0, 1) : value.colors.slice(0, MAX_TONE_COLORS) : [];
371
831
  const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
@@ -375,32 +835,32 @@ function ColorToneInner({
375
835
  setEditingColorIndex(0);
376
836
  onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
377
837
  };
378
- return /* @__PURE__ */ jsxs3(View2, {
838
+ return /* @__PURE__ */ jsxs5(View2, {
379
839
  gap: "m",
380
840
  testID,
381
841
  children: [
382
- /* @__PURE__ */ jsxs3(View2, {
842
+ /* @__PURE__ */ jsxs5(View2, {
383
843
  gap: "xs",
384
844
  children: [
385
- /* @__PURE__ */ jsx6(Text3, {
845
+ /* @__PURE__ */ jsx9(Text3, {
386
846
  variant: "label",
387
847
  children: "Tone"
388
848
  }),
389
- /* @__PURE__ */ jsx6(Text3, {
849
+ /* @__PURE__ */ jsx9(Text3, {
390
850
  emphasis: "muted",
391
851
  variant: "caption",
392
852
  children: "Choose a catalog tone"
393
853
  })
394
854
  ]
395
855
  }),
396
- /* @__PURE__ */ jsx6(View2, {
856
+ /* @__PURE__ */ jsx9(View2, {
397
857
  direction: "row",
398
858
  gap: "s",
399
859
  wrap: "wrap",
400
860
  children: tones.map((tone) => {
401
861
  const selected = value?.toneId === tone.id;
402
862
  const color = selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
403
- return /* @__PURE__ */ jsx6(Pressable, {
863
+ return /* @__PURE__ */ jsx9(Pressable, {
404
864
  accessibilityLabel: tone.accent,
405
865
  accessibilityRole: "radio",
406
866
  accessibilityState: { checked: selected },
@@ -412,7 +872,7 @@ function ColorToneInner({
412
872
  onPress: () => selectTone(tone),
413
873
  radius: "m",
414
874
  width: 56,
415
- children: /* @__PURE__ */ jsx6(Text3, {
875
+ children: /* @__PURE__ */ jsx9(Text3, {
416
876
  align: "center",
417
877
  variant: "caption",
418
878
  children: tone.accent
@@ -420,9 +880,9 @@ function ColorToneInner({
420
880
  }, tone.id);
421
881
  })
422
882
  }),
423
- selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs3(Fragment, {
883
+ selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs5(Fragment, {
424
884
  children: [
425
- /* @__PURE__ */ jsx6(ColorToneMap, {
885
+ /* @__PURE__ */ jsx9(ColorToneMap, {
426
886
  color: selectedColor,
427
887
  disabled: interactionPolicy === "passive",
428
888
  onChange: (lightness, chroma) => onChange({
@@ -430,12 +890,12 @@ function ColorToneInner({
430
890
  colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor({ chroma, lightness }, resolveColorHue(entry)) : entry)
431
891
  })
432
892
  }),
433
- /* @__PURE__ */ jsxs3(View2, {
893
+ /* @__PURE__ */ jsxs5(View2, {
434
894
  direction: "row",
435
895
  gap: "xs",
436
896
  wrap: "wrap",
437
897
  children: [
438
- colors.map((color, index) => /* @__PURE__ */ jsx6(Pressable, {
898
+ colors.map((color, index) => /* @__PURE__ */ jsx9(Pressable, {
439
899
  accessibilityLabel: `Selected ${selectedTone.accent} color ${index + 1}: ${color}`,
440
900
  accessibilityRole: "radio",
441
901
  accessibilityState: { checked: currentEditingColorIndex === index },
@@ -448,7 +908,7 @@ function ColorToneInner({
448
908
  radius: "m",
449
909
  width: 44
450
910
  }, `${color}-${index}`)),
451
- selectionMode === "multiple" ? /* @__PURE__ */ jsx6(Button2, {
911
+ selectionMode === "multiple" ? /* @__PURE__ */ jsx9(Button2, {
452
912
  disabled: interactionPolicy === "passive" || colors.length >= MAX_TONE_COLORS,
453
913
  onPress: () => {
454
914
  setEditingColorIndex(colors.length);
@@ -459,7 +919,7 @@ function ColorToneInner({
459
919
  },
460
920
  children: "Add color"
461
921
  }) : null,
462
- selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx6(Button2, {
922
+ selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx9(Button2, {
463
923
  disabled: interactionPolicy === "passive",
464
924
  onPress: () => {
465
925
  const nextColors = colors.filter((_, index) => index !== currentEditingColorIndex);
@@ -470,7 +930,7 @@ function ColorToneInner({
470
930
  }) : null
471
931
  ]
472
932
  }),
473
- /* @__PURE__ */ jsx6(ColorSpectrumSlider, {
933
+ /* @__PURE__ */ jsx9(ColorSpectrumSlider, {
474
934
  disabled: interactionPolicy === "passive",
475
935
  hue: resolveColorHue(selectedColor),
476
936
  onChange: (nextHue) => onChange({
@@ -478,7 +938,7 @@ function ColorToneInner({
478
938
  colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor(selectedTone.accentTarget, nextHue) : entry)
479
939
  })
480
940
  }),
481
- /* @__PURE__ */ jsx6(ColorHexField, {
941
+ /* @__PURE__ */ jsx9(ColorHexField, {
482
942
  disabled: interactionPolicy === "passive",
483
943
  onChange: (color) => onChange({
484
944
  toneId: selectedTone.id,
@@ -498,53 +958,53 @@ function ColorToneMap({
498
958
  }) {
499
959
  const hue = resolveColorHue(color);
500
960
  const { chroma, lightness } = resolveWheelColorComponents(color);
501
- const gradientId = `color-tone-${React5.useId().replaceAll(":", "")}`;
961
+ const gradientId = `color-tone-${React7.useId().replaceAll(":", "")}`;
502
962
  const changeAt = (x, y) => {
503
963
  if (disabled)
504
964
  return;
505
965
  onChange(Math.max(0, Math.min(1, 1 - y / TONE_MAP_HEIGHT)), Math.max(0, Math.min(TONE_MAX_CHROMA, x / TONE_MAP_WIDTH * TONE_MAX_CHROMA)));
506
966
  };
507
- return /* @__PURE__ */ jsx6(ColorWheelPointerProxy, {
967
+ return /* @__PURE__ */ jsx9(ColorWheelPointerProxy, {
508
968
  disabled,
509
969
  height: TONE_MAP_HEIGHT,
510
970
  onChange: changeAt,
511
971
  width: TONE_MAP_WIDTH,
512
- children: /* @__PURE__ */ jsxs3(Svg, {
972
+ children: /* @__PURE__ */ jsxs5(Svg, {
513
973
  accessibilityLabel: "Tone color plane",
514
974
  height: TONE_MAP_HEIGHT,
515
975
  width: TONE_MAP_WIDTH,
516
976
  children: [
517
- /* @__PURE__ */ jsxs3(Defs, {
977
+ /* @__PURE__ */ jsxs5(Defs, {
518
978
  children: [
519
- /* @__PURE__ */ jsxs3(LinearGradient, {
979
+ /* @__PURE__ */ jsxs5(LinearGradient, {
520
980
  id: `${gradientId}-white`,
521
981
  x1: "0",
522
982
  x2: "1",
523
983
  y1: "0",
524
984
  y2: "0",
525
985
  children: [
526
- /* @__PURE__ */ jsx6(Stop, {
986
+ /* @__PURE__ */ jsx9(Stop, {
527
987
  offset: "0",
528
988
  stopColor: "white"
529
989
  }),
530
- /* @__PURE__ */ jsx6(Stop, {
990
+ /* @__PURE__ */ jsx9(Stop, {
531
991
  offset: "1",
532
992
  stopColor: resolveOklchColor({ chroma: TONE_MAX_CHROMA, lightness: 0.65 }, hue)
533
993
  })
534
994
  ]
535
995
  }),
536
- /* @__PURE__ */ jsxs3(LinearGradient, {
996
+ /* @__PURE__ */ jsxs5(LinearGradient, {
537
997
  id: `${gradientId}-black`,
538
998
  x1: "0",
539
999
  x2: "0",
540
1000
  y1: "0",
541
1001
  y2: "1",
542
1002
  children: [
543
- /* @__PURE__ */ jsx6(Stop, {
1003
+ /* @__PURE__ */ jsx9(Stop, {
544
1004
  offset: "0",
545
1005
  stopColor: "transparent"
546
1006
  }),
547
- /* @__PURE__ */ jsx6(Stop, {
1007
+ /* @__PURE__ */ jsx9(Stop, {
548
1008
  offset: "1",
549
1009
  stopColor: "black"
550
1010
  })
@@ -552,17 +1012,17 @@ function ColorToneMap({
552
1012
  })
553
1013
  ]
554
1014
  }),
555
- /* @__PURE__ */ jsx6(Rect, {
1015
+ /* @__PURE__ */ jsx9(Rect, {
556
1016
  fill: `url(#${gradientId}-white)`,
557
1017
  height: TONE_MAP_HEIGHT,
558
1018
  width: TONE_MAP_WIDTH
559
1019
  }),
560
- /* @__PURE__ */ jsx6(Rect, {
1020
+ /* @__PURE__ */ jsx9(Rect, {
561
1021
  fill: `url(#${gradientId}-black)`,
562
1022
  height: TONE_MAP_HEIGHT,
563
1023
  width: TONE_MAP_WIDTH
564
1024
  }),
565
- /* @__PURE__ */ jsx6(Circle, {
1025
+ /* @__PURE__ */ jsx9(Circle, {
566
1026
  cx: chroma / TONE_MAX_CHROMA * TONE_MAP_WIDTH,
567
1027
  cy: (1 - lightness) * TONE_MAP_HEIGHT,
568
1028
  fill: "none",
@@ -570,7 +1030,7 @@ function ColorToneMap({
570
1030
  stroke: "white",
571
1031
  strokeWidth: 3
572
1032
  }),
573
- /* @__PURE__ */ jsx6(Rect, {
1033
+ /* @__PURE__ */ jsx9(Rect, {
574
1034
  fill: "transparent",
575
1035
  height: TONE_MAP_HEIGHT,
576
1036
  onResponderGrant: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
@@ -583,492 +1043,4 @@ function ColorToneMap({
583
1043
  })
584
1044
  });
585
1045
  }
586
-
587
- // src/features/color/ColorWheel.tsx
588
- import React6 from "react";
589
-
590
- // src/features/color/ColorWheelKeyboardProxy.web.tsx
591
- import { jsx as jsx7 } from "react/jsx-runtime";
592
- function ColorWheelKeyboardProxy({
593
- children,
594
- chroma,
595
- disabled,
596
- hue,
597
- onChange
598
- }) {
599
- return /* @__PURE__ */ jsx7("div", {
600
- "aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
601
- "aria-valuemax": 360,
602
- "aria-valuemin": 0,
603
- "aria-valuenow": Math.round(hue),
604
- "aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
605
- "aria-disabled": disabled,
606
- onKeyDown: (event) => {
607
- const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma);
608
- if (!nextValue || disabled)
609
- return;
610
- event.preventDefault();
611
- onChange(nextValue.hue, nextValue.chroma);
612
- },
613
- role: "slider",
614
- tabIndex: disabled ? -1 : 0,
615
- children
616
- });
617
- }
618
- function resolveKeyboardWheelValue(key, hue, chroma) {
619
- if (key === "ArrowLeft")
620
- return { chroma, hue: normalizeHue(hue - 5) };
621
- if (key === "ArrowRight")
622
- return { chroma, hue: normalizeHue(hue + 5) };
623
- if (key === "ArrowDown")
624
- return { chroma: Math.max(0, chroma - 0.02), hue };
625
- if (key === "ArrowUp")
626
- return { chroma: Math.min(0.2, chroma + 0.02), hue };
627
- return;
628
- }
629
- function normalizeHue(hue) {
630
- return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
631
- }
632
-
633
- // src/features/color/utils/resolveWheelColor.ts
634
- function resolveWheelColor(color, x, y, center, radius, maxChroma) {
635
- const { lightness } = resolveWheelColorComponents(color);
636
- const deltaX = x - center;
637
- const deltaY = y - center;
638
- const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
639
- const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
640
- const chroma = distance / radius * maxChroma;
641
- return resolveOklchColor({ lightness, chroma }, hue);
642
- }
643
- function normalizeHue2(hue) {
644
- return hue < 0 ? hue + 360 : hue;
645
- }
646
-
647
- // src/features/color/ColorWheel.tsx
648
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
649
- var WHEEL_SIZE = 280;
650
- var WHEEL_CENTER = WHEEL_SIZE / 2;
651
- var WHEEL_RADIUS = 128;
652
- var WHEEL_SEGMENT_COUNT = 72;
653
- var WHEEL_MAX_CHROMA = 0.2;
654
- var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
655
- function ColorWheelInner({
656
- themeId: _themeId,
657
- mode: _mode,
658
- inverted: _inverted,
659
- interactionPolicy,
660
- value,
661
- harmony = null,
662
- harmonies,
663
- onChange,
664
- testID
665
- }) {
666
- const { theme } = useZoraTheme2();
667
- const hue = resolveColorHue(value);
668
- const { chroma, lightness } = resolveWheelColorComponents(value);
669
- const harmonyColors = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];
670
- const selectedPoint = resolveWheelPoint(hue, Math.min(1, chroma / WHEEL_MAX_CHROMA));
671
- const harmonyPoints = harmonyColors.map((color) => resolveWheelPoint(color.hueDegrees));
672
- const harmonyLines = resolveHarmonyLines(harmonyPoints, selectedPoint, theme.semantics.content.default);
673
- const wheelGradientId = `color-wheel-${React6.useId().replaceAll(":", "")}`;
674
- const changeColorAt = (x, y) => {
675
- if (interactionPolicy === "passive")
676
- return;
677
- onChange({
678
- color: resolveWheelColor(value, x, y, WHEEL_CENTER, WHEEL_RADIUS, WHEEL_MAX_CHROMA),
679
- harmony
680
- });
681
- };
682
- const changeLightness = (nextLightness) => onChange({
683
- color: resolveOklchColor({ chroma, lightness: Math.max(0, Math.min(1, nextLightness)) }, hue),
684
- harmony
685
- });
686
- return /* @__PURE__ */ jsxs4(View2, {
687
- align: "center",
688
- gap: "s",
689
- testID,
690
- children: [
691
- /* @__PURE__ */ jsx8(ColorWheelKeyboardProxy, {
692
- chroma,
693
- disabled: interactionPolicy === "passive",
694
- hue,
695
- onChange: (nextHue, nextChroma) => onChange({
696
- color: resolveOklchColor({ lightness: resolveWheelLightness(value), chroma: nextChroma }, nextHue),
697
- harmony
698
- }),
699
- children: /* @__PURE__ */ jsx8(ColorWheelPointerProxy, {
700
- disabled: interactionPolicy === "passive",
701
- height: WHEEL_SIZE,
702
- onChange: changeColorAt,
703
- width: WHEEL_SIZE,
704
- children: /* @__PURE__ */ jsxs4(Svg, {
705
- accessibilityLabel: "Color wheel",
706
- height: WHEEL_SIZE,
707
- onResponderGrant: (event) => {
708
- const { locationX, locationY } = event.nativeEvent;
709
- changeColorAt(locationX, locationY);
710
- },
711
- onResponderMove: (event) => {
712
- const { locationX, locationY } = event.nativeEvent;
713
- changeColorAt(locationX, locationY);
714
- },
715
- onResponderRelease: (event) => {
716
- const { locationX, locationY } = event.nativeEvent;
717
- changeColorAt(locationX, locationY);
718
- },
719
- onStartShouldSetResponder: () => interactionPolicy !== "passive",
720
- width: WHEEL_SIZE,
721
- children: [
722
- /* @__PURE__ */ jsx8(Defs, {
723
- children: resolveWheelSegments().map((segment) => /* @__PURE__ */ jsxs4(RadialGradient, {
724
- cx: WHEEL_CENTER,
725
- cy: WHEEL_CENTER,
726
- id: `${wheelGradientId}-${segment.hue}`,
727
- r: WHEEL_RADIUS,
728
- children: [
729
- /* @__PURE__ */ jsx8(Stop, {
730
- offset: "0",
731
- stopColor: resolveOklchColor({ lightness: 0.65, chroma: 0 }, segment.hue)
732
- }),
733
- /* @__PURE__ */ jsx8(Stop, {
734
- offset: "1",
735
- stopColor: segment.color
736
- })
737
- ]
738
- }, segment.hue))
739
- }),
740
- resolveWheelSegments().map((segment) => /* @__PURE__ */ jsx8(Path, {
741
- d: segment.path,
742
- fill: `url(#${wheelGradientId}-${segment.hue})`
743
- }, segment.hue)),
744
- harmony === "triadic" && harmonyPoints.length === 3 ? /* @__PURE__ */ jsx8(Polygon, {
745
- fill: "none",
746
- points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
747
- stroke: theme.semantics.content.default,
748
- strokeWidth: 2
749
- }) : harmonyLines,
750
- harmonyPoints.map((point) => /* @__PURE__ */ jsx8(Circle, {
751
- cx: point.x,
752
- cy: point.y,
753
- fill: theme.semantics.content.default,
754
- r: 5
755
- }, `${point.x}-${point.y}`)),
756
- /* @__PURE__ */ jsx8(Circle, {
757
- cx: selectedPoint.x,
758
- cy: selectedPoint.y,
759
- fill: "none",
760
- r: 9,
761
- stroke: theme.semantics.content.default,
762
- strokeWidth: 3
763
- })
764
- ]
765
- })
766
- })
767
- }),
768
- /* @__PURE__ */ jsx8(ColorLightnessSlider, {
769
- chroma,
770
- disabled: interactionPolicy === "passive",
771
- hue,
772
- lightness,
773
- onChange: changeLightness,
774
- selectionBorderColor: theme.semantics.content.default
775
- }),
776
- /* @__PURE__ */ jsx8(ColorHexField, {
777
- disabled: interactionPolicy === "passive",
778
- onChange: (color) => onChange({ color, harmony }),
779
- value
780
- }, value),
781
- harmonies ? /* @__PURE__ */ jsxs4(View2, {
782
- direction: "row",
783
- gap: "xs",
784
- wrap: "wrap",
785
- children: [
786
- /* @__PURE__ */ jsx8(Button2, {
787
- disabled: interactionPolicy === "passive",
788
- onPress: () => onChange({ color: value, harmony: null }),
789
- variant: harmony === null ? "solid" : "outline",
790
- children: "None"
791
- }),
792
- harmonies.map((candidate) => /* @__PURE__ */ jsx8(Button2, {
793
- disabled: interactionPolicy === "passive",
794
- onPress: () => onChange({ color: value, harmony: candidate }),
795
- variant: harmony === candidate ? "solid" : "outline",
796
- children: candidate
797
- }, candidate))
798
- ]
799
- }) : null
800
- ]
801
- });
802
- }
803
- function ColorLightnessSlider({
804
- chroma,
805
- disabled,
806
- hue,
807
- lightness,
808
- onChange,
809
- selectionBorderColor
810
- }) {
811
- const changeAt = (locationX) => {
812
- if (!disabled)
813
- onChange(Math.max(0, Math.min(1, locationX / WHEEL_SIZE)));
814
- };
815
- return /* @__PURE__ */ jsxs4(View2, {
816
- gap: "xxs",
817
- width: WHEEL_SIZE,
818
- children: [
819
- /* @__PURE__ */ jsxs4(View2, {
820
- direction: "row",
821
- justify: "space-between",
822
- children: [
823
- /* @__PURE__ */ jsx8(Text3, {
824
- variant: "label",
825
- children: "Lightness"
826
- }),
827
- /* @__PURE__ */ jsx8(Text3, {
828
- variant: "label",
829
- children: `${Math.round(lightness * 100)}%`
830
- })
831
- ]
832
- }),
833
- /* @__PURE__ */ jsx8(ColorHorizontalPointerProxy, {
834
- disabled,
835
- onChange: changeAt,
836
- width: WHEEL_SIZE,
837
- children: /* @__PURE__ */ jsxs4(Svg, {
838
- accessibilityLabel: "Color lightness",
839
- height: 36,
840
- width: WHEEL_SIZE,
841
- children: [
842
- /* @__PURE__ */ jsx8(Defs, {
843
- children: /* @__PURE__ */ jsxs4(LinearGradient, {
844
- id: "color-lightness",
845
- x1: "0",
846
- x2: "1",
847
- y1: "0",
848
- y2: "0",
849
- children: [
850
- /* @__PURE__ */ jsx8(Stop, {
851
- offset: "0",
852
- stopColor: resolveOklchColor({ chroma, lightness: 0 }, hue)
853
- }),
854
- /* @__PURE__ */ jsx8(Stop, {
855
- offset: "1",
856
- stopColor: resolveOklchColor({ chroma, lightness: 1 }, hue)
857
- })
858
- ]
859
- })
860
- }),
861
- /* @__PURE__ */ jsx8(Rect, {
862
- fill: "url(#color-lightness)",
863
- height: 10,
864
- rx: 5,
865
- y: 13,
866
- width: WHEEL_SIZE
867
- }),
868
- /* @__PURE__ */ jsx8(Circle, {
869
- cx: lightness * WHEEL_SIZE,
870
- cy: 18,
871
- fill: "white",
872
- r: 10,
873
- stroke: selectionBorderColor,
874
- strokeWidth: 2
875
- }),
876
- /* @__PURE__ */ jsx8(Rect, {
877
- fill: "transparent",
878
- height: 36,
879
- onResponderGrant: (event) => changeAt(event.nativeEvent.locationX),
880
- onResponderMove: (event) => changeAt(event.nativeEvent.locationX),
881
- onResponderRelease: (event) => changeAt(event.nativeEvent.locationX),
882
- onStartShouldSetResponder: () => !disabled,
883
- width: WHEEL_SIZE
884
- })
885
- ]
886
- })
887
- })
888
- ]
889
- });
890
- }
891
- function resolveWheelSegments() {
892
- return Array.from({ length: WHEEL_SEGMENT_COUNT }, (_, index) => {
893
- const hue = index * 360 / WHEEL_SEGMENT_COUNT;
894
- return {
895
- color: resolveOklchColor({ lightness: 0.65, chroma: WHEEL_MAX_CHROMA }, hue),
896
- hue,
897
- path: resolveSegmentPath(hue, hue + 360 / WHEEL_SEGMENT_COUNT)
898
- };
899
- });
900
- }
901
- function resolveSegmentPath(startHue, endHue) {
902
- const start = resolveWheelPoint(startHue);
903
- const end = resolveWheelPoint(endHue);
904
- return `M ${WHEEL_CENTER} ${WHEEL_CENTER} L ${start.x} ${start.y} A ${WHEEL_RADIUS} ${WHEEL_RADIUS} 0 0 1 ${end.x} ${end.y} Z`;
905
- }
906
- function resolveWheelPoint(hue, radiusRatio = 1) {
907
- const radians = (hue - 90) * Math.PI / 180;
908
- return {
909
- x: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.cos(radians),
910
- y: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.sin(radians)
911
- };
912
- }
913
- function resolveHarmonyLines(points, selectedPoint, stroke) {
914
- return points.slice(1).reduce(({ lines, previous }, point) => ({
915
- lines: [
916
- ...lines,
917
- /* @__PURE__ */ jsx8(Line, {
918
- stroke,
919
- strokeWidth: 2,
920
- x1: previous.x,
921
- x2: point.x,
922
- y1: previous.y,
923
- y2: point.y
924
- }, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
925
- ],
926
- previous: point
927
- }), { lines: [], previous: points.at(0) ?? selectedPoint }).lines;
928
- }
929
- function resolveWheelLightness(color) {
930
- const { lightness } = resolveWheelColorComponents(color);
931
- return lightness;
932
- }
933
-
934
- // src/features/color/ColorPicker.tsx
935
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
936
- var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
937
- function ColorPickerInner({
938
- themeId: _themeId,
939
- mode: _mode,
940
- inverted: _inverted,
941
- tabs,
942
- value,
943
- onValueChange,
944
- onSelectionChange,
945
- onDismiss,
946
- hideTabListWhenSingle = true,
947
- wheel,
948
- tone,
949
- hue,
950
- testID
951
- }) {
952
- const { theme } = useZoraTheme2();
953
- if (tabs.length === 0)
954
- throw new Error("ColorPicker requires at least one tab.");
955
- if (!tabs.includes(value.tab))
956
- throw new Error("ColorPicker value must be configured in tabs.");
957
- const previewColor = resolvePickerPreviewColor(value);
958
- return /* @__PURE__ */ jsxs5(View2, {
959
- alignSelf: "center",
960
- bg: theme.semantics.surface.raised,
961
- borderColor: theme.semantics.border.default,
962
- borderWidth: 1,
963
- flexShrink: 1,
964
- gap: "s",
965
- maxWidth: 400,
966
- p: "m",
967
- radius: "l",
968
- testID,
969
- width: "100%",
970
- children: [
971
- /* @__PURE__ */ jsxs5(View2, {
972
- align: "center",
973
- direction: "row",
974
- justify: "space-between",
975
- children: [
976
- /* @__PURE__ */ jsx9(Text3, {
977
- variant: "lead",
978
- weight: "semiBold",
979
- children: "Color"
980
- }),
981
- /* @__PURE__ */ jsxs5(View2, {
982
- align: "center",
983
- direction: "row",
984
- gap: "s",
985
- children: [
986
- /* @__PURE__ */ jsx9(View2, {
987
- bg: previewColor,
988
- borderColor: theme.semantics.border.default,
989
- borderWidth: 1,
990
- height: 38,
991
- radius: "s",
992
- width: 38
993
- }),
994
- onDismiss ? /* @__PURE__ */ jsx9(IconButton2, {
995
- iconName: "close",
996
- label: "Close color picker",
997
- onPress: onDismiss
998
- }) : null
999
- ]
1000
- })
1001
- ]
1002
- }),
1003
- /* @__PURE__ */ jsxs5(Tabs2, {
1004
- defaultValue: value.tab,
1005
- onValueChange: (nextValue) => {
1006
- if (isColorPickerTab(nextValue) && tabs.includes(nextValue))
1007
- onValueChange({ ...value, tab: nextValue });
1008
- },
1009
- testID: testID ? `${testID}-tabs` : undefined,
1010
- value: value.tab,
1011
- variant: "attached",
1012
- children: [
1013
- tabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx9(View2, {
1014
- borderColor: theme.semantics.border.default,
1015
- borderWidth: 1,
1016
- overflow: "hidden",
1017
- radius: "m",
1018
- children: /* @__PURE__ */ jsx9(TabList2, {
1019
- fill: true,
1020
- children: tabs.map((tab) => /* @__PURE__ */ jsx9(Tab2, {
1021
- label: tab,
1022
- value: tab
1023
- }, tab))
1024
- })
1025
- }) : null,
1026
- tabs.map((tab) => /* @__PURE__ */ jsx9(TabPanel2, {
1027
- value: tab,
1028
- children: resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)
1029
- }, tab))
1030
- ]
1031
- })
1032
- ]
1033
- });
1034
- }
1035
- function isColorPickerTab(value) {
1036
- return value === "wheel" || value === "tone" || value === "hue";
1037
- }
1038
- function resolvePickerPreviewColor(value) {
1039
- if (value.tab === "hue")
1040
- return value.hue;
1041
- if (value.tab === "tone")
1042
- return value.tone?.colors.at(0) ?? value.wheel.color;
1043
- return value.wheel.color;
1044
- }
1045
- function resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange) {
1046
- if (tab === "wheel")
1047
- return wheel ? /* @__PURE__ */ jsx9(ColorWheel2, {
1048
- ...wheel,
1049
- harmony: value.wheel.harmony,
1050
- onChange: (next) => {
1051
- onValueChange({ ...value, wheel: next });
1052
- onSelectionChange?.({ mode: "wheel", value: next });
1053
- },
1054
- value: value.wheel.color
1055
- }) : null;
1056
- if (tab === "tone")
1057
- return tone ? /* @__PURE__ */ jsx9(ColorTone2, {
1058
- ...tone,
1059
- onChange: (next) => {
1060
- onValueChange({ ...value, tone: next });
1061
- onSelectionChange?.({ mode: "tone", value: next });
1062
- },
1063
- value: value.tone
1064
- }) : null;
1065
- return hue ? /* @__PURE__ */ jsx9(ColorHueScale2, {
1066
- ...hue,
1067
- onChange: (next) => {
1068
- onValueChange({ ...value, hue: next });
1069
- onSelectionChange?.({ mode: "hue", value: next });
1070
- },
1071
- value: value.hue
1072
- }) : null;
1073
- }
1074
- export { ColorHueScale2, ColorTone2, ColorWheel2, ColorPicker2 };
1046
+ export { ColorHueScale2, ColorWheel2, ColorPicker2, ColorTone2 };