@ankhorage/zora 27.10.4 → 27.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/features/carousel/Carousel.js +3 -1
  4. package/dist/features/carousel/Carousel.js.map +1 -1
  5. package/dist/features/carousel/useCarouselPlayback.d.ts.map +1 -1
  6. package/dist/features/carousel/useCarouselPlayback.js +2 -1
  7. package/dist/features/carousel/useCarouselPlayback.js.map +1 -1
  8. package/dist/features/color/ColorHexField.d.ts +9 -0
  9. package/dist/features/color/ColorHexField.d.ts.map +1 -0
  10. package/dist/features/color/ColorHexField.js +17 -0
  11. package/dist/features/color/ColorHexField.js.map +1 -0
  12. package/dist/features/color/ColorHorizontalPointerProxy.d.ts +9 -0
  13. package/dist/features/color/ColorHorizontalPointerProxy.d.ts.map +1 -0
  14. package/dist/features/color/ColorHorizontalPointerProxy.js +2 -0
  15. package/dist/features/color/ColorHorizontalPointerProxy.js.map +1 -0
  16. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts +4 -0
  17. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts.map +1 -0
  18. package/dist/features/color/ColorHorizontalPointerProxy.native.js +5 -0
  19. package/dist/features/color/ColorHorizontalPointerProxy.native.js.map +1 -0
  20. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts +5 -0
  21. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts.map +1 -0
  22. package/dist/features/color/ColorHorizontalPointerProxy.web.js +26 -0
  23. package/dist/features/color/ColorHorizontalPointerProxy.web.js.map +1 -0
  24. package/dist/features/color/ColorHueScale.d.ts.map +1 -1
  25. package/dist/features/color/ColorHueScale.js +18 -7
  26. package/dist/features/color/ColorHueScale.js.map +1 -1
  27. package/dist/features/color/ColorPicker.d.ts.map +1 -1
  28. package/dist/features/color/ColorPicker.js +37 -10
  29. package/dist/features/color/ColorPicker.js.map +1 -1
  30. package/dist/features/color/ColorSpectrumSlider.d.ts +9 -0
  31. package/dist/features/color/ColorSpectrumSlider.d.ts.map +1 -0
  32. package/dist/features/color/ColorSpectrumSlider.js +38 -0
  33. package/dist/features/color/ColorSpectrumSlider.js.map +1 -0
  34. package/dist/features/color/ColorTone.d.ts.map +1 -1
  35. package/dist/features/color/ColorTone.js +71 -12
  36. package/dist/features/color/ColorTone.js.map +1 -1
  37. package/dist/features/color/ColorWheel.d.ts.map +1 -1
  38. package/dist/features/color/ColorWheel.js +64 -36
  39. package/dist/features/color/ColorWheel.js.map +1 -1
  40. package/dist/features/color/ColorWheelPointerProxy.d.ts +10 -0
  41. package/dist/features/color/ColorWheelPointerProxy.d.ts.map +1 -0
  42. package/dist/features/color/ColorWheelPointerProxy.js +2 -0
  43. package/dist/features/color/ColorWheelPointerProxy.js.map +1 -0
  44. package/dist/features/color/ColorWheelPointerProxy.native.d.ts +4 -0
  45. package/dist/features/color/ColorWheelPointerProxy.native.d.ts.map +1 -0
  46. package/dist/features/color/ColorWheelPointerProxy.native.js +5 -0
  47. package/dist/features/color/ColorWheelPointerProxy.native.js.map +1 -0
  48. package/dist/features/color/ColorWheelPointerProxy.web.d.ts +5 -0
  49. package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -0
  50. package/dist/features/color/ColorWheelPointerProxy.web.js +26 -0
  51. package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -0
  52. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
  53. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +14 -2
  54. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
  55. package/dist/types/color.d.ts +2 -0
  56. package/dist/types/color.d.ts.map +1 -1
  57. package/dist/types/color.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/features/carousel/Carousel.test.ts +1 -0
  60. package/src/features/carousel/Carousel.tsx +3 -1
  61. package/src/features/carousel/useCarouselPlayback.ts +2 -1
  62. package/src/features/color/ColorHexField.tsx +45 -0
  63. package/src/features/color/ColorHorizontalPointerProxy.native.tsx +6 -0
  64. package/src/features/color/ColorHorizontalPointerProxy.tsx +10 -0
  65. package/src/features/color/ColorHorizontalPointerProxy.web.tsx +45 -0
  66. package/src/features/color/ColorHueScale.tsx +48 -29
  67. package/src/features/color/ColorPicker.layout.test.tsx +72 -0
  68. package/src/features/color/ColorPicker.tsx +74 -20
  69. package/src/features/color/ColorSpectrumSlider.tsx +79 -0
  70. package/src/features/color/ColorTone.tsx +138 -21
  71. package/src/features/color/ColorWheel.tsx +173 -92
  72. package/src/features/color/ColorWheelPointerProxy.native.tsx +6 -0
  73. package/src/features/color/ColorWheelPointerProxy.tsx +11 -0
  74. package/src/features/color/ColorWheelPointerProxy.web.tsx +51 -0
  75. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +18 -0
  76. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +18 -2
  77. package/src/types/color.ts +2 -0
  78. package/web-dist/chunks/{Accordion-mxad79vq.js → Accordion-0kr0h68p.js} +4568 -669
  79. package/web-dist/chunks/{Accordion-0jkpvxwd.js → Accordion-1etqb3cj.js} +2 -2
  80. package/web-dist/chunks/{Accordion-jr0201qc.js → Accordion-1mxnyexh.js} +17 -17
  81. package/web-dist/chunks/{Accordion-9kkfz7s8.js → Accordion-3ecnh8d0.js} +4 -4
  82. package/web-dist/chunks/{Accordion-jsapannb.js → Accordion-3jkeydhb.js} +4 -4
  83. package/web-dist/chunks/{Accordion-r6gwemh9.js → Accordion-3wkd5x2q.js} +3 -3
  84. package/web-dist/chunks/{Accordion-0bgzetnd.js → Accordion-3zw817fr.js} +6 -6
  85. package/web-dist/chunks/{Accordion-91v243pz.js → Accordion-49w9bc2f.js} +2 -2
  86. package/web-dist/chunks/{Accordion-8vw4k0s6.js → Accordion-4g54je0w.js} +2 -2
  87. package/web-dist/chunks/{Accordion-1andv7gg.js → Accordion-5vs1k81g.js} +8 -8
  88. package/web-dist/chunks/{Accordion-ttjyk97v.js → Accordion-6m3k4avp.js} +2 -2
  89. package/web-dist/chunks/{Accordion-dnfrzbpb.js → Accordion-6nrpdbmb.js} +7 -7
  90. package/web-dist/chunks/{Accordion-y524ph0g.js → Accordion-6yv4beha.js} +1 -1
  91. package/web-dist/chunks/{Accordion-9cpm8x92.js → Accordion-705yrq6w.js} +1 -1
  92. package/web-dist/chunks/{Accordion-th8pkeqc.js → Accordion-8g9c7890.js} +4 -4
  93. package/web-dist/chunks/{Accordion-6qesggn9.js → Accordion-9c63jn3m.js} +4 -4
  94. package/web-dist/chunks/{Accordion-1mjn0atk.js → Accordion-aws0caav.js} +3 -3
  95. package/web-dist/chunks/{Accordion-hha54x4c.js → Accordion-bd6q61s1.js} +5 -5
  96. package/web-dist/chunks/{Accordion-8rkwd0wx.js → Accordion-c0a7mhq3.js} +2 -2
  97. package/web-dist/chunks/{Accordion-j5wsx41j.js → Accordion-c3nna2bz.js} +1 -1
  98. package/web-dist/chunks/{Accordion-r6mc7qtj.js → Accordion-dfq04q82.js} +9 -9
  99. package/web-dist/chunks/{Accordion-nbje2ywp.js → Accordion-e3r3573t.js} +3 -3
  100. package/web-dist/chunks/{Accordion-hqg1zbxk.js → Accordion-e5jr9ahb.js} +1 -1
  101. package/web-dist/chunks/{Accordion-pkbvsn5y.js → Accordion-eak89n4n.js} +6 -6
  102. package/web-dist/chunks/{Accordion-7e0mb55z.js → Accordion-f60g73bp.js} +6 -6
  103. package/web-dist/chunks/{Accordion-grtf75xt.js → Accordion-g451f3g9.js} +4 -4
  104. package/web-dist/chunks/{Accordion-27rxpbvf.js → Accordion-gezcm372.js} +4 -4
  105. package/web-dist/chunks/{Accordion-45tbe5v0.js → Accordion-h0e95qxp.js} +9 -9
  106. package/web-dist/chunks/{Accordion-m7jt3c87.js → Accordion-h2nd5y0z.js} +5 -5
  107. package/web-dist/chunks/{Accordion-f6k281sv.js → Accordion-j0zhpq4s.js} +7 -7
  108. package/web-dist/chunks/{Accordion-q6xnm1k4.js → Accordion-jbwey4za.js} +17 -17
  109. package/web-dist/chunks/{Accordion-vdqc8rxv.js → Accordion-jd26f516.js} +3 -3
  110. package/web-dist/chunks/{Accordion-1k7pyxdd.js → Accordion-ne91vwkd.js} +2 -2
  111. package/web-dist/chunks/{Accordion-k058095e.js → Accordion-p29kmwh9.js} +1 -1
  112. package/web-dist/chunks/{Accordion-0pbcs0xf.js → Accordion-pcj256bc.js} +5 -5
  113. package/web-dist/chunks/{Accordion-8wq38d9b.js → Accordion-phtyg3k4.js} +7 -7
  114. package/web-dist/chunks/{Accordion-b991pn6e.js → Accordion-pmfdf08d.js} +1 -1
  115. package/web-dist/chunks/{Accordion-xp2t3pkj.js → Accordion-q1tdazgq.js} +8 -8
  116. package/web-dist/chunks/{Accordion-v21vz0cg.js → Accordion-qhn8z92r.js} +3 -3
  117. package/web-dist/chunks/Accordion-r1wkgt7c.js +1074 -0
  118. package/web-dist/chunks/{Accordion-ctcxh9pk.js → Accordion-rzf52xq8.js} +2 -2
  119. package/web-dist/chunks/{Accordion-hrxdchkq.js → Accordion-vewhx028.js} +8 -8
  120. package/web-dist/chunks/{Accordion-jsdjgfn2.js → Accordion-vk2v1zwv.js} +2 -2
  121. package/web-dist/chunks/{Accordion-19zt3dyq.js → Accordion-vnrqvfca.js} +1 -1
  122. package/web-dist/chunks/{Accordion-rt4jfq2r.js → Accordion-x0p3wxfp.js} +2 -2
  123. package/web-dist/chunks/{Accordion-w1ag7sr4.js → Accordion-x7ynjdv7.js} +1 -1
  124. package/web-dist/chunks/{Accordion-ga82tcs9.js → Accordion-xb174981.js} +10 -10
  125. package/web-dist/chunks/{Accordion-yskcfahv.js → Accordion-xwstve3k.js} +2 -2
  126. package/web-dist/chunks/{Accordion-xb2nj0q6.js → Accordion-ysmzrvhn.js} +3 -3
  127. package/web-dist/chunks/{Accordion-tnq8bt8v.js → Accordion-z4qakakw.js} +2 -2
  128. package/web-dist/chunks/{Accordion-w9vbdg9r.js → Accordion-z8ryq8cb.js} +11 -11
  129. package/web-dist/chunks/{Accordion-x3em7tpd.js → Accordion-zx8gmww4.js} +9 -9
  130. package/web-dist/components/accordion/Accordion.js +10 -10
  131. package/web-dist/components/accordion-item/AccordionItem.js +10 -10
  132. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  133. package/web-dist/components/app-bar/AppBar.js +15 -16
  134. package/web-dist/components/app-header/AppHeader.js +15 -16
  135. package/web-dist/components/app-shell/AppShell.js +4 -4
  136. package/web-dist/components/auth-screen/AuthScreen.js +20 -21
  137. package/web-dist/components/avatar/Avatar.js +10 -10
  138. package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
  139. package/web-dist/components/badge/Badge.js +5 -5
  140. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -19
  141. package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
  142. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
  143. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
  144. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
  145. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
  146. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
  147. package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -16
  148. package/web-dist/components/button/Button.js +13 -14
  149. package/web-dist/components/button-group/ButtonGroup.js +11 -12
  150. package/web-dist/components/calendar/Calendar.js +12 -13
  151. package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -19
  152. package/web-dist/components/card/Card.js +17 -18
  153. package/web-dist/components/card-back/CardBack.js +4 -4
  154. package/web-dist/components/card-hand/CardHand.js +4 -4
  155. package/web-dist/components/carousel/Carousel.js +7 -4
  156. package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
  157. package/web-dist/components/checkbox/Checkbox.js +10 -10
  158. package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
  159. package/web-dist/components/chess-board/ChessBoard.js +4 -4
  160. package/web-dist/components/chip/Chip.js +11 -11
  161. package/web-dist/components/chip-group/ChipGroup.js +11 -11
  162. package/web-dist/components/collection-editor/CollectionEditor.js +21 -22
  163. package/web-dist/components/color-hue-scale/ColorHueScale.js +15 -14
  164. package/web-dist/components/color-picker/ColorPicker.js +15 -14
  165. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +2 -0
  166. package/web-dist/components/color-tone/ColorTone.js +15 -14
  167. package/web-dist/components/color-wheel/ColorWheel.js +15 -14
  168. package/web-dist/components/content-rail/ContentRail.js +13 -14
  169. package/web-dist/components/data-table/DataTable.js +27 -28
  170. package/web-dist/components/date-picker/DatePicker.js +19 -20
  171. package/web-dist/components/dialog/Dialog.js +9 -9
  172. package/web-dist/components/divider/Divider.js +4 -4
  173. package/web-dist/components/empty-state/EmptyState.js +18 -19
  174. package/web-dist/components/explorer/Explorer.js +11 -11
  175. package/web-dist/components/field/Field.js +10 -10
  176. package/web-dist/components/file-explorer/FileExplorer.js +11 -11
  177. package/web-dist/components/flat-list/FlatList.js +11 -11
  178. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +20 -21
  179. package/web-dist/components/form/Form.js +14 -15
  180. package/web-dist/components/form-actions/FormActions.js +14 -15
  181. package/web-dist/components/form-error/FormError.js +14 -15
  182. package/web-dist/components/game/Game.js +5 -5
  183. package/web-dist/components/game-entity/GameEntity.js +5 -5
  184. package/web-dist/components/game-field/GameField.js +5 -5
  185. package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
  186. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
  187. package/web-dist/components/game-overlay/GameOverlay.js +5 -5
  188. package/web-dist/components/gradient/Gradient.js +5 -5
  189. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
  190. package/web-dist/components/graph-view/GraphView.js +9 -2
  191. package/web-dist/components/grid/Grid.js +4 -4
  192. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
  193. package/web-dist/components/grid-ruler/GridRuler.js +4 -4
  194. package/web-dist/components/heading/Heading.js +5 -5
  195. package/web-dist/components/hero/Hero.js +20 -21
  196. package/web-dist/components/icon/Icon.js +4 -4
  197. package/web-dist/components/icon-button/IconButton.js +11 -12
  198. package/web-dist/components/image/Image.js +8 -8
  199. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
  200. package/web-dist/components/list/List.js +11 -11
  201. package/web-dist/components/list-item/ListItem.js +11 -11
  202. package/web-dist/components/list-section/ListSection.js +11 -11
  203. package/web-dist/components/master-detail/MasterDetail.js +4 -4
  204. package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
  205. package/web-dist/components/media-card/MediaCard.js +17 -18
  206. package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
  207. package/web-dist/components/message-bubble/MessageBubble.js +14 -14
  208. package/web-dist/components/metric-card/MetricCard.js +17 -18
  209. package/web-dist/components/missing-element/MissingElement.js +9 -9
  210. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +20 -21
  211. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +20 -21
  212. package/web-dist/components/opening-book/OpeningBook.js +4 -4
  213. package/web-dist/components/otp-form/OtpForm.js +20 -21
  214. package/web-dist/components/pagination/Pagination.js +18 -19
  215. package/web-dist/components/palette-item/PaletteItem.js +17 -18
  216. package/web-dist/components/playing-card/PlayingCard.js +4 -4
  217. package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
  218. package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
  219. package/web-dist/components/post-card/PostCard.js +17 -18
  220. package/web-dist/components/product-card/ProductCard.js +17 -18
  221. package/web-dist/components/progress/Progress.js +8 -8
  222. package/web-dist/components/progress-ring/ProgressRing.js +8 -8
  223. package/web-dist/components/radio/Radio.js +12 -12
  224. package/web-dist/components/radio-group/RadioGroup.js +12 -12
  225. package/web-dist/components/rating/Rating.js +7 -7
  226. package/web-dist/components/reader/Reader.js +20 -21
  227. package/web-dist/components/scan-overlay/ScanOverlay.js +18 -19
  228. package/web-dist/components/screen/Screen.js +4 -4
  229. package/web-dist/components/screen-section/ScreenSection.js +8 -8
  230. package/web-dist/components/scroll-view/ScrollView.js +4 -4
  231. package/web-dist/components/search-input/SearchInput.js +12 -13
  232. package/web-dist/components/section-header/SectionHeader.js +8 -8
  233. package/web-dist/components/section-list/SectionList.js +11 -11
  234. package/web-dist/components/select/Select.js +16 -17
  235. package/web-dist/components/selectable-item/SelectableItem.js +3 -3
  236. package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
  237. package/web-dist/components/sign-in-form/SignInForm.js +20 -21
  238. package/web-dist/components/sign-up-form/SignUpForm.js +20 -21
  239. package/web-dist/components/skeleton/Skeleton.js +20 -21
  240. package/web-dist/components/skeleton-card/SkeletonCard.js +20 -21
  241. package/web-dist/components/skeleton-list/SkeletonList.js +20 -21
  242. package/web-dist/components/skeleton-text/SkeletonText.js +20 -21
  243. package/web-dist/components/surface/Surface.js +5 -5
  244. package/web-dist/components/switch/Switch.js +5 -5
  245. package/web-dist/components/tab/Tab.js +5 -5
  246. package/web-dist/components/tab-list/TabList.js +5 -5
  247. package/web-dist/components/tab-panel/TabPanel.js +5 -5
  248. package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
  249. package/web-dist/components/tabs/Tabs.js +5 -5
  250. package/web-dist/components/text/Text.js +5 -5
  251. package/web-dist/components/text-input/TextInput.js +12 -13
  252. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +12 -13
  253. package/web-dist/components/time-picker/TimePicker.js +19 -20
  254. package/web-dist/components/timeline/Timeline.js +10 -10
  255. package/web-dist/components/toast/Toast.js +7 -7
  256. package/web-dist/components/toast-provider/ToastProvider.js +7 -7
  257. package/web-dist/components/toolbar/Toolbar.js +17 -18
  258. package/web-dist/components/tree-item/TreeItem.js +17 -18
  259. package/web-dist/components/uploader/Uploader.js +26 -27
  260. package/web-dist/components/view/View.js +4 -4
  261. package/web-dist/manifest.json +1417 -1459
  262. package/web-dist/runtime/ZoraProvider.js +6 -6
  263. package/web-dist/chunks/Accordion-fjnb7anx.js +0 -548
  264. package/web-dist/chunks/Accordion-ztcmb44y.js +0 -3928
  265. package/web-dist/chunks/{Accordion-ng79nxzz.js → Accordion-an5prgty.js} +18 -18
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunks/Accordion-wgc67k1g.js";
5
5
  import {
6
6
  resolvePointerEvents
7
- } from "../chunks/Accordion-w1ag7sr4.js";
7
+ } from "../chunks/Accordion-x7ynjdv7.js";
8
8
  import {
9
9
  sortOverlayEntries,
10
10
  OverlayStackContext,
@@ -21,17 +21,17 @@ import {
21
21
  createTheme,
22
22
  ThemeRuntimeContext,
23
23
  useTheme
24
- } from "../chunks/Accordion-ng79nxzz.js";
24
+ } from "../chunks/Accordion-an5prgty.js";
25
25
  import {
26
26
  ToastProvider3
27
- } from "../chunks/Accordion-th8pkeqc.js";
28
- import"../chunks/Accordion-rt4jfq2r.js";
29
- import"../chunks/Accordion-9cpm8x92.js";
27
+ } from "../chunks/Accordion-8g9c7890.js";
28
+ import"../chunks/Accordion-x0p3wxfp.js";
29
+ import"../chunks/Accordion-705yrq6w.js";
30
30
  import"../chunks/Accordion-eqvdv7tt.js";
31
31
  import"../chunks/Accordion-c6edgxay.js";
32
32
  import {
33
33
  useZoraTheme2
34
- } from "../chunks/Accordion-j5wsx41j.js";
34
+ } from "../chunks/Accordion-c3nna2bz.js";
35
35
  import"../chunks/Accordion-fre84yaq.js";
36
36
  import {
37
37
  require_cjs
@@ -1,548 +0,0 @@
1
- 'use client';
2
- import {
3
- isHexColor,
4
- parseHexColorOrThrow,
5
- converter_default,
6
- formatHex,
7
- generateHarmonyRoleColors,
8
- generateColorSwatch
9
- } from "./Accordion-ng79nxzz.js";
10
- import {
11
- Pressable
12
- } from "./Accordion-ctcxh9pk.js";
13
- import {
14
- withZoraThemeScope
15
- } from "./Accordion-hqg1zbxk.js";
16
- import {
17
- View2
18
- } from "./Accordion-v21vz0cg.js";
19
- import {
20
- Text3
21
- } from "./Accordion-1mjn0atk.js";
22
- import {
23
- Button3,
24
- Circle,
25
- Line,
26
- Path,
27
- Polygon,
28
- Svg
29
- } from "./Accordion-ztcmb44y.js";
30
- import {
31
- TextInput3
32
- } from "./Accordion-y524ph0g.js";
33
- import {
34
- Tab2,
35
- TabList2,
36
- TabPanel2,
37
- Tabs2
38
- } from "./Accordion-jsapannb.js";
39
-
40
- // src/features/color/ColorHueScale.tsx
41
- import { jsx } from "react/jsx-runtime";
42
- var ColorHueScale2 = withZoraThemeScope(ColorHueScaleInner);
43
- function ColorHueScaleInner({
44
- themeId: _themeId,
45
- mode: _mode,
46
- inverted: _inverted,
47
- interactionPolicy,
48
- value,
49
- onChange,
50
- testID
51
- }) {
52
- const { swatch } = generateColorSwatch(value);
53
- const swatches = Object.entries(swatch);
54
- return /* @__PURE__ */ jsx(View2, {
55
- accessibilityLabel: "Color scale previews; choose a preview as the next 500 base color",
56
- direction: "row",
57
- gap: "xs",
58
- testID,
59
- wrap: "wrap",
60
- children: swatches.map(([step, color]) => /* @__PURE__ */ jsx(Pressable, {
61
- accessibilityLabel: Number(step) === 500 ? `Current editable base color 500: ${color}` : `Use generated ${step} preview ${color} as the next base color 500`,
62
- bg: color,
63
- borderColor: "border",
64
- borderWidth: Number(step) === 500 ? 3 : 1,
65
- disabled: interactionPolicy === "passive",
66
- height: 48,
67
- onPress: () => onChange(color),
68
- radius: "sm",
69
- width: 48,
70
- children: /* @__PURE__ */ jsx(Text3, {
71
- align: "center",
72
- variant: "caption",
73
- children: step
74
- })
75
- }, step))
76
- });
77
- }
78
-
79
- // src/features/color/ColorWheel.tsx
80
- import React from "react";
81
-
82
- // src/features/color/ColorWheelKeyboardProxy.web.tsx
83
- import { jsx as jsx2 } from "react/jsx-runtime";
84
- function ColorWheelKeyboardProxy({
85
- children,
86
- chroma,
87
- disabled,
88
- hue,
89
- onChange
90
- }) {
91
- return /* @__PURE__ */ jsx2("div", {
92
- "aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
93
- "aria-valuemax": 360,
94
- "aria-valuemin": 0,
95
- "aria-valuenow": Math.round(hue),
96
- "aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
97
- "aria-disabled": disabled,
98
- onKeyDown: (event) => {
99
- const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma);
100
- if (!nextValue || disabled)
101
- return;
102
- event.preventDefault();
103
- onChange(nextValue.hue, nextValue.chroma);
104
- },
105
- role: "slider",
106
- tabIndex: disabled ? -1 : 0,
107
- children
108
- });
109
- }
110
- function resolveKeyboardWheelValue(key, hue, chroma) {
111
- if (key === "ArrowLeft")
112
- return { chroma, hue: normalizeHue(hue - 5) };
113
- if (key === "ArrowRight")
114
- return { chroma, hue: normalizeHue(hue + 5) };
115
- if (key === "ArrowDown")
116
- return { chroma: Math.max(0, chroma - 0.02), hue };
117
- if (key === "ArrowUp")
118
- return { chroma: Math.min(0.2, chroma + 0.02), hue };
119
- return;
120
- }
121
- function normalizeHue(hue) {
122
- return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
123
- }
124
- // src/features/color/utils/resolveColorHue.ts
125
- var toOklch = converter_default("oklch");
126
- function resolveColorHue(color) {
127
- const parsed = toOklch(color);
128
- return typeof parsed?.h === "number" ? parsed.h : 0;
129
- }
130
-
131
- // src/features/color/utils/resolveOklchColor.ts
132
- function resolveOklchColor(target, hue) {
133
- const formatted = formatHex({ mode: "oklch", l: target.lightness, c: target.chroma, h: hue });
134
- if (!formatted)
135
- throw new Error("The supplied OKLCH target cannot be represented as a hex color.");
136
- return parseHexColorOrThrow(formatted);
137
- }
138
-
139
- // src/features/color/utils/resolveWheelColorComponents.ts
140
- var toOklch2 = converter_default("oklch");
141
- function resolveWheelColorComponents(color) {
142
- const parsed = toOklch2(color);
143
- return {
144
- chroma: typeof parsed?.c === "number" ? parsed.c : 0,
145
- lightness: typeof parsed?.l === "number" ? parsed.l : 0.65
146
- };
147
- }
148
-
149
- // src/features/color/utils/resolveWheelColor.ts
150
- function resolveWheelColor(color, x, y, center, radius, maxChroma) {
151
- const { lightness } = resolveWheelColorComponents(color);
152
- const deltaX = x - center;
153
- const deltaY = y - center;
154
- const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
155
- const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
156
- const chroma = distance / radius * maxChroma;
157
- return resolveOklchColor({ lightness, chroma }, hue);
158
- }
159
- function normalizeHue2(hue) {
160
- return hue < 0 ? hue + 360 : hue;
161
- }
162
-
163
- // src/features/color/ColorWheel.tsx
164
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
165
- var WHEEL_SIZE = 240;
166
- var WHEEL_CENTER = WHEEL_SIZE / 2;
167
- var WHEEL_RADIUS = 104;
168
- var WHEEL_SEGMENT_COUNT = 36;
169
- var WHEEL_MAX_CHROMA = 0.2;
170
- var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
171
- function ColorWheelInner({
172
- themeId: _themeId,
173
- mode: _mode,
174
- inverted: _inverted,
175
- interactionPolicy,
176
- value,
177
- harmony = null,
178
- harmonies,
179
- onChange,
180
- testID
181
- }) {
182
- const hue = resolveColorHue(value);
183
- const { chroma, lightness } = resolveWheelColorComponents(value);
184
- const harmonyColors = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];
185
- const selectedPoint = resolveWheelPoint(hue, Math.min(1, chroma / WHEEL_MAX_CHROMA));
186
- const harmonyPoints = harmonyColors.map((color) => resolveWheelPoint(color.hueDegrees));
187
- const harmonyLines = resolveHarmonyLines(harmonyPoints, selectedPoint);
188
- const changeColorAt = (x, y) => {
189
- if (interactionPolicy === "passive")
190
- return;
191
- onChange({
192
- color: resolveWheelColor(value, x, y, WHEEL_CENTER, WHEEL_RADIUS, WHEEL_MAX_CHROMA),
193
- harmony
194
- });
195
- };
196
- const changeLightness = (offset) => onChange({
197
- color: resolveOklchColor({ chroma, lightness: Math.max(0, Math.min(1, lightness + offset)) }, hue),
198
- harmony
199
- });
200
- return /* @__PURE__ */ jsxs(View2, {
201
- align: "center",
202
- gap: "sm",
203
- testID,
204
- children: [
205
- /* @__PURE__ */ jsx3(ColorWheelKeyboardProxy, {
206
- chroma,
207
- disabled: interactionPolicy === "passive",
208
- hue,
209
- onChange: (nextHue, nextChroma) => onChange({
210
- color: resolveOklchColor({ lightness: resolveWheelLightness(value), chroma: nextChroma }, nextHue),
211
- harmony
212
- }),
213
- children: /* @__PURE__ */ jsxs(Svg, {
214
- accessibilityLabel: "Color wheel",
215
- height: WHEEL_SIZE,
216
- onResponderGrant: (event) => {
217
- const { locationX, locationY } = event.nativeEvent;
218
- changeColorAt(locationX, locationY);
219
- },
220
- onResponderMove: (event) => {
221
- const { locationX, locationY } = event.nativeEvent;
222
- changeColorAt(locationX, locationY);
223
- },
224
- onStartShouldSetResponder: () => interactionPolicy !== "passive",
225
- width: WHEEL_SIZE,
226
- children: [
227
- resolveWheelSegments().map((segment) => /* @__PURE__ */ jsx3(Path, {
228
- d: segment.path,
229
- fill: segment.color
230
- }, segment.hue)),
231
- harmony === "triadic" && harmonyPoints.length === 3 ? /* @__PURE__ */ jsx3(Polygon, {
232
- fill: "none",
233
- points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
234
- stroke: "currentColor",
235
- strokeWidth: 2
236
- }) : harmonyLines,
237
- harmonyPoints.map((point) => /* @__PURE__ */ jsx3(Circle, {
238
- cx: point.x,
239
- cy: point.y,
240
- fill: "currentColor",
241
- r: 5
242
- }, `${point.x}-${point.y}`)),
243
- /* @__PURE__ */ jsx3(Circle, {
244
- cx: selectedPoint.x,
245
- cy: selectedPoint.y,
246
- fill: "none",
247
- r: 9,
248
- stroke: "currentColor",
249
- strokeWidth: 3
250
- })
251
- ]
252
- })
253
- }),
254
- /* @__PURE__ */ jsxs(View2, {
255
- direction: "row",
256
- gap: "xs",
257
- wrap: "wrap",
258
- children: [
259
- /* @__PURE__ */ jsx3(Button3, {
260
- disabled: interactionPolicy === "passive" || lightness <= 0,
261
- onPress: () => changeLightness(-0.05),
262
- children: "Lightness -"
263
- }),
264
- /* @__PURE__ */ jsx3(Button3, {
265
- disabled: interactionPolicy === "passive" || lightness >= 1,
266
- onPress: () => changeLightness(0.05),
267
- children: "Lightness +"
268
- })
269
- ]
270
- }),
271
- /* @__PURE__ */ jsx3(ColorHexInput, {
272
- disabled: interactionPolicy === "passive",
273
- harmony,
274
- onChange,
275
- value
276
- }, value),
277
- harmonies ? /* @__PURE__ */ jsxs(View2, {
278
- direction: "row",
279
- gap: "xs",
280
- wrap: "wrap",
281
- children: [
282
- /* @__PURE__ */ jsx3(Button3, {
283
- disabled: interactionPolicy === "passive",
284
- onPress: () => onChange({ color: value, harmony: null }),
285
- variant: harmony === null ? "solid" : "outline",
286
- children: "None"
287
- }),
288
- harmonies.map((candidate) => /* @__PURE__ */ jsx3(Button3, {
289
- disabled: interactionPolicy === "passive",
290
- onPress: () => onChange({ color: value, harmony: candidate }),
291
- variant: harmony === candidate ? "solid" : "outline",
292
- children: candidate
293
- }, candidate))
294
- ]
295
- }) : null
296
- ]
297
- });
298
- }
299
- function resolveWheelSegments() {
300
- return Array.from({ length: WHEEL_SEGMENT_COUNT }, (_, index) => {
301
- const hue = index * 360 / WHEEL_SEGMENT_COUNT;
302
- return {
303
- color: resolveOklchColor({ lightness: 0.65, chroma: WHEEL_MAX_CHROMA }, hue),
304
- hue,
305
- path: resolveSegmentPath(hue, hue + 360 / WHEEL_SEGMENT_COUNT)
306
- };
307
- });
308
- }
309
- function resolveSegmentPath(startHue, endHue) {
310
- const start = resolveWheelPoint(startHue);
311
- const end = resolveWheelPoint(endHue);
312
- return `M ${WHEEL_CENTER} ${WHEEL_CENTER} L ${start.x} ${start.y} A ${WHEEL_RADIUS} ${WHEEL_RADIUS} 0 0 1 ${end.x} ${end.y} Z`;
313
- }
314
- function resolveWheelPoint(hue, radiusRatio = 1) {
315
- const radians = (hue - 90) * Math.PI / 180;
316
- return {
317
- x: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.cos(radians),
318
- y: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.sin(radians)
319
- };
320
- }
321
- function resolveHarmonyLines(points, selectedPoint) {
322
- return points.slice(1).reduce(({ lines, previous }, point) => ({
323
- lines: [
324
- ...lines,
325
- /* @__PURE__ */ jsx3(Line, {
326
- stroke: "currentColor",
327
- strokeWidth: 2,
328
- x1: previous.x,
329
- x2: point.x,
330
- y1: previous.y,
331
- y2: point.y
332
- }, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
333
- ],
334
- previous: point
335
- }), { lines: [], previous: points.at(0) ?? selectedPoint }).lines;
336
- }
337
- function resolveWheelLightness(color) {
338
- const { lightness } = resolveWheelColorComponents(color);
339
- return lightness;
340
- }
341
- function ColorHexInput({
342
- disabled,
343
- harmony,
344
- onChange,
345
- value
346
- }) {
347
- const [input, setInput] = React.useState(value);
348
- return /* @__PURE__ */ jsx3(TextInput3, {
349
- accessibilityLabel: "Color hex value",
350
- disabled,
351
- onChangeText: (nextValue) => {
352
- setInput(nextValue);
353
- if (isHexColor(nextValue))
354
- onChange({ color: nextValue, harmony: harmony ?? null });
355
- },
356
- value: input
357
- });
358
- }
359
-
360
- // src/features/color/ColorTone.tsx
361
- import React2 from "react";
362
- import { jsx as jsx4, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
363
- var MAX_TONE_COLORS = 4;
364
- var ColorTone2 = withZoraThemeScope(ColorToneInner);
365
- function ColorToneInner({
366
- themeId: _themeId,
367
- mode: _mode,
368
- inverted: _inverted,
369
- interactionPolicy,
370
- tones,
371
- selectionMode = "single",
372
- value,
373
- onChange,
374
- testID
375
- }) {
376
- const [editingColorIndex, setEditingColorIndex] = React2.useState(0);
377
- const selectedTone = tones.find((tone) => tone.id === value?.toneId);
378
- const colors = value ? selectionMode === "single" ? value.colors.slice(0, 1) : value.colors.slice(0, MAX_TONE_COLORS) : [];
379
- const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
380
- const selectedColor = colors.at(currentEditingColorIndex);
381
- const selectTone = (tone) => {
382
- const hue = selectedColor ? resolveColorHue(selectedColor) : 0;
383
- setEditingColorIndex(0);
384
- onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
385
- };
386
- return /* @__PURE__ */ jsxs2(View2, {
387
- gap: "sm",
388
- testID,
389
- children: [
390
- /* @__PURE__ */ jsx4(View2, {
391
- direction: "row",
392
- wrap: "wrap",
393
- gap: "sm",
394
- children: tones.map((tone) => {
395
- const selected = value?.toneId === tone.id;
396
- const color = selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
397
- return /* @__PURE__ */ jsx4(Pressable, {
398
- accessibilityLabel: tone.accent,
399
- accessibilityRole: "radio",
400
- accessibilityState: { checked: selected },
401
- bg: color,
402
- borderColor: "border",
403
- borderWidth: selected ? 3 : 1,
404
- disabled: interactionPolicy === "passive",
405
- height: 44,
406
- onPress: () => selectTone(tone),
407
- radius: "md",
408
- width: 44
409
- }, tone.id);
410
- })
411
- }),
412
- selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs2(Fragment, {
413
- children: [
414
- /* @__PURE__ */ jsxs2(View2, {
415
- direction: "row",
416
- gap: "xs",
417
- wrap: "wrap",
418
- children: [
419
- colors.map((color, index) => /* @__PURE__ */ jsx4(Pressable, {
420
- accessibilityLabel: `Selected ${selectedTone.accent} color ${index + 1}: ${color}`,
421
- accessibilityRole: "radio",
422
- accessibilityState: { checked: currentEditingColorIndex === index },
423
- bg: color,
424
- borderColor: "border",
425
- borderWidth: currentEditingColorIndex === index ? 3 : 1,
426
- disabled: interactionPolicy === "passive",
427
- height: 44,
428
- onPress: () => setEditingColorIndex(index),
429
- radius: "md",
430
- width: 44
431
- }, `${color}-${index}`)),
432
- selectionMode === "multiple" ? /* @__PURE__ */ jsx4(Button3, {
433
- disabled: interactionPolicy === "passive" || colors.length >= MAX_TONE_COLORS,
434
- onPress: () => {
435
- setEditingColorIndex(colors.length);
436
- onChange({
437
- toneId: selectedTone.id,
438
- colors: [...colors, resolveOklchColor(selectedTone.accentTarget, 0)]
439
- });
440
- },
441
- children: "Add color"
442
- }) : null,
443
- selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx4(Button3, {
444
- disabled: interactionPolicy === "passive",
445
- onPress: () => {
446
- const nextColors = colors.filter((_, index) => index !== currentEditingColorIndex);
447
- setEditingColorIndex(Math.min(currentEditingColorIndex, nextColors.length - 1));
448
- onChange({ toneId: selectedTone.id, colors: nextColors });
449
- },
450
- children: "Remove color"
451
- }) : null
452
- ]
453
- }),
454
- /* @__PURE__ */ jsx4(ColorWheel2, {
455
- harmony: null,
456
- interactionPolicy,
457
- onChange: ({ color }) => {
458
- const nextColor = resolveOklchColor(selectedTone.accentTarget, resolveColorHue(color));
459
- onChange({
460
- toneId: selectedTone.id,
461
- colors: colors.map((entry, index) => index === currentEditingColorIndex ? nextColor : entry)
462
- });
463
- },
464
- value: selectedColor
465
- })
466
- ]
467
- }) : null
468
- ]
469
- });
470
- }
471
-
472
- // src/features/color/ColorPicker.tsx
473
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
474
- var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
475
- function ColorPickerInner({
476
- themeId: _themeId,
477
- mode: _mode,
478
- inverted: _inverted,
479
- tabs,
480
- value,
481
- onValueChange,
482
- onSelectionChange,
483
- hideTabListWhenSingle = true,
484
- wheel,
485
- tone,
486
- hue,
487
- testID
488
- }) {
489
- if (tabs.length === 0)
490
- throw new Error("ColorPicker requires at least one tab.");
491
- if (!tabs.includes(value.tab))
492
- throw new Error("ColorPicker value must be configured in tabs.");
493
- return /* @__PURE__ */ jsxs3(Tabs2, {
494
- defaultValue: value.tab,
495
- onValueChange: (nextValue) => {
496
- if (isColorPickerTab(nextValue) && tabs.includes(nextValue))
497
- onValueChange({ ...value, tab: nextValue });
498
- },
499
- testID,
500
- value: value.tab,
501
- children: [
502
- tabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx5(TabList2, {
503
- fill: true,
504
- children: tabs.map((tab) => /* @__PURE__ */ jsx5(Tab2, {
505
- label: tab,
506
- value: tab
507
- }, tab))
508
- }) : null,
509
- tabs.map((tab) => /* @__PURE__ */ jsx5(TabPanel2, {
510
- value: tab,
511
- children: resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange)
512
- }, tab))
513
- ]
514
- });
515
- }
516
- function isColorPickerTab(value) {
517
- return value === "wheel" || value === "tone" || value === "hue";
518
- }
519
- function resolveTabContent(tab, value, wheel, tone, hue, onValueChange, onSelectionChange) {
520
- if (tab === "wheel")
521
- return wheel ? /* @__PURE__ */ jsx5(ColorWheel2, {
522
- ...wheel,
523
- harmony: value.wheel.harmony,
524
- onChange: (next) => {
525
- onValueChange({ ...value, wheel: next });
526
- onSelectionChange?.({ mode: "wheel", value: next });
527
- },
528
- value: value.wheel.color
529
- }) : null;
530
- if (tab === "tone")
531
- return tone ? /* @__PURE__ */ jsx5(ColorTone2, {
532
- ...tone,
533
- onChange: (next) => {
534
- onValueChange({ ...value, tone: next });
535
- onSelectionChange?.({ mode: "tone", value: next });
536
- },
537
- value: value.tone
538
- }) : null;
539
- return hue ? /* @__PURE__ */ jsx5(ColorHueScale2, {
540
- ...hue,
541
- onChange: (next) => {
542
- onValueChange({ ...value, hue: next });
543
- onSelectionChange?.({ mode: "hue", value: next });
544
- },
545
- value: value.hue
546
- }) : null;
547
- }
548
- export { ColorHueScale2, ColorWheel2, ColorTone2, ColorPicker2 };