@ankhorage/zora 27.11.3 → 28.1.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 (288) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +4 -3
  3. package/dist/features/bottom-sheet/adapters/inbound/BottomSheet.js.map +1 -1
  4. package/dist/features/color/ColorHexField.d.ts +1 -1
  5. package/dist/features/color/ColorHexField.d.ts.map +1 -1
  6. package/dist/features/color/ColorHexField.js +30 -4
  7. package/dist/features/color/ColorHexField.js.map +1 -1
  8. package/dist/features/color/ColorPicker.d.ts +1 -1
  9. package/dist/features/color/ColorPicker.d.ts.map +1 -1
  10. package/dist/features/color/ColorPicker.js +174 -59
  11. package/dist/features/color/ColorPicker.js.map +1 -1
  12. package/dist/features/color/ColorWheel.d.ts +1 -1
  13. package/dist/features/color/ColorWheel.d.ts.map +1 -1
  14. package/dist/features/color/ColorWheel.js +61 -117
  15. package/dist/features/color/ColorWheel.js.map +1 -1
  16. package/dist/features/color/ColorWheelKeyboardProxy.d.ts +1 -0
  17. package/dist/features/color/ColorWheelKeyboardProxy.d.ts.map +1 -1
  18. package/dist/features/color/ColorWheelKeyboardProxy.js.map +1 -1
  19. package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts +1 -1
  20. package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts.map +1 -1
  21. package/dist/features/color/ColorWheelKeyboardProxy.web.js +4 -4
  22. package/dist/features/color/ColorWheelKeyboardProxy.web.js.map +1 -1
  23. package/dist/features/color/ColorWheelPointerProxy.d.ts +1 -0
  24. package/dist/features/color/ColorWheelPointerProxy.d.ts.map +1 -1
  25. package/dist/features/color/ColorWheelPointerProxy.js.map +1 -1
  26. package/dist/features/color/ColorWheelPointerProxy.native.d.ts +3 -2
  27. package/dist/features/color/ColorWheelPointerProxy.native.d.ts.map +1 -1
  28. package/dist/features/color/ColorWheelPointerProxy.native.js +12 -3
  29. package/dist/features/color/ColorWheelPointerProxy.native.js.map +1 -1
  30. package/dist/features/color/ColorWheelPointerProxy.web.d.ts +2 -2
  31. package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -1
  32. package/dist/features/color/ColorWheelPointerProxy.web.js +8 -5
  33. package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -1
  34. package/dist/features/color/public.d.ts +1 -1
  35. package/dist/features/color/public.d.ts.map +1 -1
  36. package/dist/features/color/public.js.map +1 -1
  37. package/dist/features/color/resolveColorPickerGeometry.d.ts +31 -0
  38. package/dist/features/color/resolveColorPickerGeometry.d.ts.map +1 -0
  39. package/dist/features/color/resolveColorPickerGeometry.js +94 -0
  40. package/dist/features/color/resolveColorPickerGeometry.js.map +1 -0
  41. package/dist/features/color/utils/resolveWheelColor.d.ts +2 -2
  42. package/dist/features/color/utils/resolveWheelColor.d.ts.map +1 -1
  43. package/dist/features/color/utils/resolveWheelColor.js +2 -3
  44. package/dist/features/color/utils/resolveWheelColor.js.map +1 -1
  45. package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -1
  46. package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -1
  47. package/dist/features/form/select/composition/SelectTrigger.js +2 -2
  48. package/dist/features/form/select/composition/SelectTrigger.js.map +1 -1
  49. package/dist/index.d.ts +3 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -0
  52. package/dist/index.js.map +1 -1
  53. package/dist/types/color.d.ts +34 -26
  54. package/dist/types/color.d.ts.map +1 -1
  55. package/dist/types/color.js.map +1 -1
  56. package/dist/types/select.d.ts +2 -0
  57. package/dist/types/select.d.ts.map +1 -1
  58. package/dist/types/select.js.map +1 -1
  59. package/package.json +6 -6
  60. package/src/features/bottom-sheet/adapters/inbound/BottomSheet.tsx +1 -1
  61. package/src/features/color/ColorHexField.tsx +67 -23
  62. package/src/features/color/ColorPicker.layout.test.tsx +28 -24
  63. package/src/features/color/ColorPicker.tsx +449 -121
  64. package/src/features/color/ColorWheel.tsx +124 -248
  65. package/src/features/color/ColorWheelKeyboardProxy.tsx +1 -0
  66. package/src/features/color/ColorWheelKeyboardProxy.web.tsx +4 -3
  67. package/src/features/color/ColorWheelPointerProxy.native.tsx +25 -3
  68. package/src/features/color/ColorWheelPointerProxy.tsx +1 -0
  69. package/src/features/color/ColorWheelPointerProxy.web.tsx +12 -5
  70. package/src/features/color/public.ts +0 -2
  71. package/src/features/color/resolveColorPickerGeometry.test.ts +43 -0
  72. package/src/features/color/resolveColorPickerGeometry.ts +116 -0
  73. package/src/features/color/utils/resolveWheelColor.ts +2 -3
  74. package/src/features/form/select/adapters/inbound/Select.native.tsx +1 -1
  75. package/src/features/form/select/composition/SelectTrigger.tsx +2 -1
  76. package/src/index.ts +6 -2
  77. package/src/types/color.ts +34 -22
  78. package/src/types/select.ts +2 -0
  79. package/web-dist/chunks/{Accordion-h2nd5y0z.js → Accordion-01bsg7zt.js} +5 -5
  80. package/web-dist/chunks/{Accordion-6nrpdbmb.js → Accordion-01zvarrn.js} +8 -9
  81. package/web-dist/chunks/{Accordion-pmfdf08d.js → Accordion-0dj1r7w3.js} +1 -1
  82. package/web-dist/chunks/{Accordion-3zw817fr.js → Accordion-0xaq2k2h.js} +8 -8
  83. package/web-dist/chunks/{Accordion-gezcm372.js → Accordion-15sxxjym.js} +4 -5
  84. package/web-dist/chunks/{Accordion-eq27a9ms.js → Accordion-1fz55hk4.js} +1 -1
  85. package/web-dist/chunks/{Accordion-j0zhpq4s.js → Accordion-22cda3h5.js} +7 -8
  86. package/web-dist/chunks/{Accordion-jd26f516.js → Accordion-27yg9ktv.js} +3 -3
  87. package/web-dist/chunks/{Accordion-f60g73bp.js → Accordion-34b3rwbc.js} +6 -8
  88. package/web-dist/chunks/{Accordion-1etqb3cj.js → Accordion-3zzzw7a8.js} +2 -2
  89. package/web-dist/chunks/Accordion-46n609yq.js +253 -0
  90. package/web-dist/chunks/{Accordion-3jkeydhb.js → Accordion-4zb6dcys.js} +4 -7
  91. package/web-dist/chunks/{Accordion-dfq04q82.js → Accordion-5cjhz94e.js} +5 -5
  92. package/web-dist/chunks/{Accordion-49w9bc2f.js → Accordion-5mga7hty.js} +2 -2
  93. package/web-dist/chunks/{Accordion-kcx57mk5.js → Accordion-76b0qz8y.js} +24 -22
  94. package/web-dist/chunks/{Accordion-vewhx028.js → Accordion-78tknqmc.js} +4 -4
  95. package/web-dist/chunks/{Accordion-5vs1k81g.js → Accordion-7bd6zq4s.js} +9 -9
  96. package/web-dist/chunks/{Accordion-phtyg3k4.js → Accordion-8c4w7366.js} +5 -5
  97. package/web-dist/chunks/{Accordion-vk2v1zwv.js → Accordion-8t6vh482.js} +3 -4
  98. package/web-dist/chunks/{Accordion-an5prgty.js → Accordion-9d38cgqj.js} +88 -92
  99. package/web-dist/chunks/{Accordion-1mxnyexh.js → Accordion-9k7ktksc.js} +212 -215
  100. package/web-dist/chunks/{Accordion-aws0caav.js → Accordion-afpjg1d6.js} +3 -4
  101. package/web-dist/chunks/{Accordion-c3nna2bz.js → Accordion-b1y5mjac.js} +1 -1
  102. package/web-dist/chunks/{Accordion-eak89n4n.js → Accordion-b8w0f8s0.js} +6 -7
  103. package/web-dist/chunks/{Accordion-ne91vwkd.js → Accordion-bexwrnfh.js} +3 -4
  104. package/web-dist/chunks/Accordion-chdbfcm6.js +93 -0
  105. package/web-dist/chunks/{Accordion-6yv4beha.js → Accordion-d405whfb.js} +2 -2
  106. package/web-dist/chunks/{Accordion-xb174981.js → Accordion-de8srt4x.js} +8 -8
  107. package/web-dist/chunks/{Accordion-e3r3573t.js → Accordion-epv5yhch.js} +3 -3
  108. package/web-dist/chunks/{Accordion-g451f3g9.js → Accordion-f4919ghm.js} +4 -4
  109. package/web-dist/chunks/{Accordion-qhn8z92r.js → Accordion-f8a49gy8.js} +19 -22
  110. package/web-dist/chunks/{Accordion-3s7zeagv.js → Accordion-fdzyyqe9.js} +1 -1
  111. package/web-dist/chunks/Accordion-gnxmybxx.js +1331 -0
  112. package/web-dist/chunks/{Accordion-z8ryq8cb.js → Accordion-h1q243zq.js} +13 -11
  113. package/web-dist/chunks/{Accordion-dtt4qkrb.js → Accordion-h63c9k9k.js} +1 -1
  114. package/web-dist/chunks/{Accordion-rzf52xq8.js → Accordion-hdyzyw8q.js} +3 -3
  115. package/web-dist/chunks/{Accordion-3wkd5x2q.js → Accordion-htvmkx8s.js} +118 -118
  116. package/web-dist/chunks/{Accordion-0kr0h68p.js → Accordion-jmxe6kw0.js} +9 -11
  117. package/web-dist/chunks/{Accordion-705yrq6w.js → Accordion-kcm6jcpp.js} +2 -3
  118. package/web-dist/chunks/{Accordion-fcczvwgg.js → Accordion-mrstcjcm.js} +1 -0
  119. package/web-dist/chunks/{Accordion-p29kmwh9.js → Accordion-mx7nkg85.js} +1 -1
  120. package/web-dist/chunks/{Accordion-x0p3wxfp.js → Accordion-pdjhezmz.js} +2 -2
  121. package/web-dist/chunks/{Accordion-8g9c7890.js → Accordion-q046ws5p.js} +6 -6
  122. package/web-dist/chunks/{Accordion-jbwey4za.js → Accordion-q11svb96.js} +19 -19
  123. package/web-dist/chunks/{Accordion-bd6q61s1.js → Accordion-qkkeyr18.js} +6 -8
  124. package/web-dist/chunks/{Accordion-q1tdazgq.js → Accordion-qrt9xz0h.js} +7 -8
  125. package/web-dist/chunks/{Accordion-h0e95qxp.js → Accordion-qsppnx7g.js} +10 -11
  126. package/web-dist/chunks/{Accordion-neg1cgeh.js → Accordion-rhjddvkh.js} +1 -2
  127. package/web-dist/chunks/{Accordion-ysmzrvhn.js → Accordion-rtamzg9j.js} +47 -28
  128. package/web-dist/chunks/{Accordion-xwstve3k.js → Accordion-sfvqf4fz.js} +134 -132
  129. package/web-dist/chunks/{Accordion-9c63jn3m.js → Accordion-sh79sr5g.js} +5 -5
  130. package/web-dist/chunks/{Accordion-4g54je0w.js → Accordion-t9n4ey2r.js} +5 -3
  131. package/web-dist/chunks/{Accordion-e5jr9ahb.js → Accordion-tk8zf9ff.js} +3 -3
  132. package/web-dist/chunks/{Accordion-zypyr9xw.js → Accordion-tnyqv1xv.js} +296 -305
  133. package/web-dist/chunks/{Accordion-c0a7mhq3.js → Accordion-v6vhyv31.js} +95 -165
  134. package/web-dist/chunks/{Accordion-6m3k4avp.js → Accordion-vkqqktc5.js} +3 -3
  135. package/web-dist/chunks/{Accordion-z4qakakw.js → Accordion-vzq344av.js} +2 -3
  136. package/web-dist/chunks/{Accordion-pcj256bc.js → Accordion-wb9pmykz.js} +5 -6
  137. package/web-dist/chunks/{Accordion-x7ynjdv7.js → Accordion-ww4f12ty.js} +1 -1
  138. package/web-dist/chunks/{Accordion-zx8gmww4.js → Accordion-xb9zhdhp.js} +42 -45
  139. package/web-dist/chunks/{Accordion-3ecnh8d0.js → Accordion-xfkg7dcw.js} +4 -5
  140. package/web-dist/chunks/{Accordion-6ec4gxv2.js → Accordion-xzaa9s7f.js} +12 -23
  141. package/web-dist/chunks/{Accordion-vnrqvfca.js → Accordion-yrac5a7m.js} +1 -1
  142. package/web-dist/chunks/{zip-reader-f0yphjb9.js → zip-reader-5xrcmjr8.js} +1 -1
  143. package/web-dist/components/accordion/Accordion.js +11 -11
  144. package/web-dist/components/accordion-item/AccordionItem.js +11 -11
  145. package/web-dist/components/activity-indicator/ActivityIndicator.js +4 -4
  146. package/web-dist/components/app-bar/AppBar.js +18 -18
  147. package/web-dist/components/app-header/AppHeader.js +18 -18
  148. package/web-dist/components/app-shell/AppShell.js +5 -5
  149. package/web-dist/components/auth-screen/AuthScreen.js +21 -21
  150. package/web-dist/components/avatar/Avatar.js +11 -11
  151. package/web-dist/components/avatar-group/AvatarGroup.js +11 -11
  152. package/web-dist/components/badge/Badge.js +6 -6
  153. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +19 -19
  154. package/web-dist/components/bottom-sheet/BottomSheet.js +10 -7
  155. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +10 -7
  156. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +10 -7
  157. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +10 -7
  158. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +10 -7
  159. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +10 -7
  160. package/web-dist/components/breadcrumbs/Breadcrumbs.js +13 -13
  161. package/web-dist/components/button/Button.js +11 -11
  162. package/web-dist/components/button-group/ButtonGroup.js +11 -11
  163. package/web-dist/components/calendar/Calendar.js +14 -14
  164. package/web-dist/components/camera-permission-view/CameraPermissionView.js +19 -19
  165. package/web-dist/components/card/Card.js +18 -18
  166. package/web-dist/components/card-back/CardBack.js +5 -5
  167. package/web-dist/components/card-hand/CardHand.js +5 -5
  168. package/web-dist/components/carousel/Carousel.js +2 -2
  169. package/web-dist/components/chat-list-item/ChatListItem.js +15 -15
  170. package/web-dist/components/checkbox/Checkbox.js +11 -11
  171. package/web-dist/components/checkbox-group/CheckboxGroup.js +11 -11
  172. package/web-dist/components/chess-board/ChessBoard.js +6 -6
  173. package/web-dist/components/chip/Chip.js +12 -12
  174. package/web-dist/components/chip-group/ChipGroup.js +12 -12
  175. package/web-dist/components/collection-editor/CollectionEditor.js +18 -18
  176. package/web-dist/components/color-hue-scale/ColorHueScale.js +28 -17
  177. package/web-dist/components/color-picker/ColorPicker.d.ts +2 -2
  178. package/web-dist/components/color-picker/ColorPicker.js +28 -17
  179. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +34 -45
  180. package/web-dist/components/color-picker/index.d.ts +1 -1
  181. package/web-dist/components/color-tone/ColorTone.js +28 -17
  182. package/web-dist/components/color-wheel/ColorWheel.d.ts +1 -1
  183. package/web-dist/components/color-wheel/ColorWheel.js +28 -17
  184. package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +10 -0
  185. package/web-dist/components/content-rail/ContentRail.js +12 -12
  186. package/web-dist/components/data-table/DataTable.js +26 -26
  187. package/web-dist/components/date-picker/DatePicker.js +20 -20
  188. package/web-dist/components/dialog/Dialog.js +11 -11
  189. package/web-dist/components/divider/Divider.js +5 -5
  190. package/web-dist/components/empty-state/EmptyState.js +19 -19
  191. package/web-dist/components/explorer/Explorer.js +13 -13
  192. package/web-dist/components/field/Field.js +11 -11
  193. package/web-dist/components/file-explorer/FileExplorer.js +13 -13
  194. package/web-dist/components/flat-list/FlatList.js +12 -12
  195. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +21 -21
  196. package/web-dist/components/form/Form.js +15 -15
  197. package/web-dist/components/form-actions/FormActions.js +15 -15
  198. package/web-dist/components/form-error/FormError.js +15 -15
  199. package/web-dist/components/game/Game.js +7 -6
  200. package/web-dist/components/game-entity/GameEntity.js +7 -6
  201. package/web-dist/components/game-field/GameField.js +7 -6
  202. package/web-dist/components/game-input-zone/GameInputZone.js +7 -6
  203. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +7 -6
  204. package/web-dist/components/game-overlay/GameOverlay.js +7 -6
  205. package/web-dist/components/gradient/Gradient.js +6 -6
  206. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +6 -6
  207. package/web-dist/components/graph-view/GraphView.js +2 -2
  208. package/web-dist/components/grid/Grid.js +5 -5
  209. package/web-dist/components/grid-interactions/GridInteractions.js +1 -1
  210. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +5 -5
  211. package/web-dist/components/grid-ruler/GridRuler.js +5 -5
  212. package/web-dist/components/grid-view/GridView.js +1 -1
  213. package/web-dist/components/heading/Heading.js +6 -6
  214. package/web-dist/components/hero/Hero.js +18 -18
  215. package/web-dist/components/icon/Icon.js +5 -5
  216. package/web-dist/components/icon-button/IconButton.js +11 -11
  217. package/web-dist/components/image/Image.js +9 -9
  218. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +4 -4
  219. package/web-dist/components/list/List.js +12 -12
  220. package/web-dist/components/list-item/ListItem.js +12 -12
  221. package/web-dist/components/list-section/ListSection.js +12 -12
  222. package/web-dist/components/master-detail/MasterDetail.js +5 -5
  223. package/web-dist/components/matrix-grid/MatrixGrid.js +9 -9
  224. package/web-dist/components/media-card/MediaCard.js +18 -18
  225. package/web-dist/components/media-explorer/MediaExplorer.js +13 -13
  226. package/web-dist/components/message-bubble/MessageBubble.js +15 -15
  227. package/web-dist/components/metric-card/MetricCard.js +18 -18
  228. package/web-dist/components/missing-element/MissingElement.js +10 -10
  229. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +21 -21
  230. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +21 -21
  231. package/web-dist/components/opening-book/OpeningBook.js +6 -6
  232. package/web-dist/components/otp-form/OtpForm.js +21 -21
  233. package/web-dist/components/pagination/Pagination.js +12 -12
  234. package/web-dist/components/palette-item/PaletteItem.js +18 -18
  235. package/web-dist/components/playing-card/PlayingCard.js +5 -5
  236. package/web-dist/components/poker-training-table/PokerTrainingTable.js +5 -5
  237. package/web-dist/components/popover-menu/PopoverMenu.js +13 -13
  238. package/web-dist/components/post-card/PostCard.js +18 -18
  239. package/web-dist/components/product-card/ProductCard.js +18 -18
  240. package/web-dist/components/progress/Progress.js +9 -9
  241. package/web-dist/components/progress-ring/ProgressRing.js +9 -9
  242. package/web-dist/components/radio/Radio.js +13 -13
  243. package/web-dist/components/radio-group/RadioGroup.js +13 -13
  244. package/web-dist/components/rating/Rating.js +8 -8
  245. package/web-dist/components/reader/Reader.js +34 -34
  246. package/web-dist/components/scan-overlay/ScanOverlay.js +19 -19
  247. package/web-dist/components/screen/Screen.js +5 -5
  248. package/web-dist/components/screen-section/ScreenSection.js +9 -9
  249. package/web-dist/components/scroll-view/ScrollView.js +5 -5
  250. package/web-dist/components/search-input/SearchInput.js +13 -13
  251. package/web-dist/components/section-header/SectionHeader.js +9 -9
  252. package/web-dist/components/section-list/SectionList.js +12 -12
  253. package/web-dist/components/select/Select.js +23 -259
  254. package/web-dist/components/select/Select.types-0.d.ts +2 -0
  255. package/web-dist/components/selectable-item/SelectableItem.js +4 -4
  256. package/web-dist/components/selection-provider/SelectionProvider.js +4 -4
  257. package/web-dist/components/sign-in-form/SignInForm.js +21 -21
  258. package/web-dist/components/sign-up-form/SignUpForm.js +21 -21
  259. package/web-dist/components/skeleton/Skeleton.js +21 -21
  260. package/web-dist/components/skeleton-card/SkeletonCard.js +21 -21
  261. package/web-dist/components/skeleton-list/SkeletonList.js +21 -21
  262. package/web-dist/components/skeleton-text/SkeletonText.js +21 -21
  263. package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
  264. package/web-dist/components/surface/Surface.js +6 -6
  265. package/web-dist/components/switch/Switch.js +8 -8
  266. package/web-dist/components/tab/Tab.js +6 -6
  267. package/web-dist/components/tab-list/TabList.js +6 -6
  268. package/web-dist/components/tab-panel/TabPanel.js +6 -6
  269. package/web-dist/components/tabletop-table/TabletopTable.js +5 -5
  270. package/web-dist/components/tabs/Tabs.js +6 -6
  271. package/web-dist/components/text/Text.js +6 -6
  272. package/web-dist/components/text-input/TextInput.js +13 -13
  273. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +11 -11
  274. package/web-dist/components/tile-grid/TileGrid.js +1 -1
  275. package/web-dist/components/time-grid/TimeGrid.js +2 -2
  276. package/web-dist/components/time-picker/TimePicker.js +18 -18
  277. package/web-dist/components/timeline/Timeline.js +11 -11
  278. package/web-dist/components/toast/Toast.js +9 -9
  279. package/web-dist/components/toast-provider/ToastProvider.js +9 -9
  280. package/web-dist/components/toolbar/Toolbar.js +18 -18
  281. package/web-dist/components/tree-item/TreeItem.js +17 -17
  282. package/web-dist/components/tree-view/TreeView.js +1 -1
  283. package/web-dist/components/uploader/Uploader.js +23 -23
  284. package/web-dist/components/view/View.js +5 -5
  285. package/web-dist/manifest.json +1950 -1877
  286. package/web-dist/runtime/ZoraProvider.js +9 -9
  287. package/web-dist/chunks/Accordion-r1wkgt7c.js +0 -1074
  288. package/web-dist/chunks/{Accordion-vgkvvdvg.js → Accordion-ykk40jz9.js} +36 -36
@@ -0,0 +1,94 @@
1
+ const MINIMUM_WIDTH = 360;
2
+ const REFERENCE_WIDTH = 560;
3
+ /*** Resolves one coherent ColorPicker geometry from the host's actual available bounds. */
4
+ export function resolveColorPickerGeometry(input) {
5
+ const availableWidth = Math.min(input.width ?? REFERENCE_WIDTH, input.hostWidth ?? REFERENCE_WIDTH);
6
+ const availableHeight = Math.min(input.height ?? Number.POSITIVE_INFINITY, input.hostHeight ?? Number.POSITIVE_INFINITY);
7
+ const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, input.showTabs);
8
+ const maximum = resolveGeometryAtWidth(Math.max(MINIMUM_WIDTH, availableWidth), input.showTabs);
9
+ const resolved = resolveLargestGeometry(maximum, availableHeight, input.showTabs);
10
+ return {
11
+ ...resolved,
12
+ insufficientSpace: availableWidth < MINIMUM_WIDTH || availableHeight < minimum.height,
13
+ minimumHeight: minimum.height,
14
+ minimumWidth: MINIMUM_WIDTH,
15
+ };
16
+ }
17
+ /*** Calculates every descendant measurement from a single continuous logical width. */
18
+ function resolveGeometryAtWidth(width, showTabs) {
19
+ const progress = Math.max(0, Math.min(1, (width - MINIMUM_WIDTH) / (REFERENCE_WIDTH - MINIMUM_WIDTH)));
20
+ const padding = interpolate(12, 24, progress);
21
+ const rail = interpolate(104, 150, progress);
22
+ const gap = interpolate(12, 20, progress);
23
+ const scale = interpolate(0.75, 1, progress);
24
+ const border = 1;
25
+ const stage = width - border * 2 - padding * 2 - rail - gap;
26
+ const headerHeight = 48 * scale;
27
+ const tabHeight = showTabs ? 48 * scale : 0;
28
+ const cardGap = 16 * scale;
29
+ const cardHeight = 52 * scale;
30
+ const settingsHeight = cardHeight * 2 + cardGap;
31
+ const mainHeight = Math.max(stage, settingsHeight);
32
+ const infoLineHeight = 20 * scale;
33
+ const mainGap = 16 * scale;
34
+ const footerGap = 10 * scale;
35
+ const footerHeight = 52 * scale;
36
+ const footerInset = 12 * scale;
37
+ const height = border * 2 +
38
+ padding +
39
+ headerHeight +
40
+ mainGap +
41
+ tabHeight +
42
+ (showTabs ? mainGap : 0) +
43
+ mainHeight +
44
+ mainGap +
45
+ infoLineHeight +
46
+ footerGap +
47
+ 1 +
48
+ footerGap +
49
+ footerHeight +
50
+ footerInset;
51
+ return {
52
+ border,
53
+ cardGap,
54
+ cardHeight,
55
+ footerGap,
56
+ footerHeight,
57
+ footerInset,
58
+ gap,
59
+ headerHeight,
60
+ height,
61
+ infoLineHeight,
62
+ mainGap,
63
+ padding,
64
+ rail,
65
+ scale,
66
+ settingsHeight,
67
+ stage,
68
+ tabHeight,
69
+ width,
70
+ };
71
+ }
72
+ /*** Finds the largest coherent width geometry that fits the available host height. */
73
+ function resolveLargestGeometry(maximum, height, showTabs) {
74
+ if (!Number.isFinite(height) || maximum.height <= height)
75
+ return maximum;
76
+ const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, showTabs);
77
+ if (height < minimum.height)
78
+ return minimum;
79
+ let lower = MINIMUM_WIDTH;
80
+ let upper = maximum.width;
81
+ for (let iteration = 0; iteration < 20; iteration += 1) {
82
+ const midpoint = (lower + upper) / 2;
83
+ if (resolveGeometryAtWidth(midpoint, showTabs).height <= height)
84
+ lower = midpoint;
85
+ else
86
+ upper = midpoint;
87
+ }
88
+ return resolveGeometryAtWidth(lower, showTabs);
89
+ }
90
+ /*** Interpolates a reference measurement without changing component hierarchy. */
91
+ function interpolate(minimum, reference, progress) {
92
+ return minimum + (reference - minimum) * progress;
93
+ }
94
+ //# sourceMappingURL=resolveColorPickerGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveColorPickerGeometry.js","sourceRoot":"","sources":["../../../src/features/color/resolveColorPickerGeometry.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,2FAA2F;AAC3F,MAAM,UAAU,0BAA0B,CAAC,KAM1C;IACC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAC7B,KAAK,CAAC,KAAK,IAAI,eAAe,EAC9B,KAAK,CAAC,SAAS,IAAI,eAAe,CACnC,CAA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CAAC;AAED,sFAAsF;AACtF,SAAS,sBAAsB,CAC7B,OAAkD,EAClD,MAAc,EACd,QAAiB;IAEjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM;QAAE,OAAO,OAAO,CAAC;IACzE,MAAM,OAAO,GAAG,sBAAsB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC;IAE5C,IAAI,KAAK,GAAG,aAAa,CAAC;IAC1B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC1B,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,IAAI,CAAC,EAAE,CAAC;QACvD,MAAM,QAAQ,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,MAAM,IAAI,MAAM;YAAE,KAAK,GAAG,QAAQ,CAAC;;YAC7E,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;IACD,OAAO,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED,kFAAkF;AAClF,SAAS,WAAW,CAAC,OAAe,EAAE,SAAiB,EAAE,QAAgB;IACvE,OAAO,OAAO,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,QAAQ,CAAC;AACpD,CAAC","sourcesContent":["const MINIMUM_WIDTH = 360;\nconst REFERENCE_WIDTH = 560;\n\n/*** Resolves one coherent ColorPicker geometry from the host's actual available bounds. */\nexport function resolveColorPickerGeometry(input: {\n readonly height?: number;\n readonly hostHeight?: number;\n readonly hostWidth?: number;\n readonly showTabs: boolean;\n readonly width?: number;\n}) {\n const availableWidth = Math.min(\n input.width ?? REFERENCE_WIDTH,\n input.hostWidth ?? REFERENCE_WIDTH,\n );\n const availableHeight = Math.min(\n input.height ?? Number.POSITIVE_INFINITY,\n input.hostHeight ?? Number.POSITIVE_INFINITY,\n );\n const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, input.showTabs);\n const maximum = resolveGeometryAtWidth(Math.max(MINIMUM_WIDTH, availableWidth), input.showTabs);\n const resolved = resolveLargestGeometry(maximum, availableHeight, input.showTabs);\n\n return {\n ...resolved,\n insufficientSpace: availableWidth < MINIMUM_WIDTH || availableHeight < minimum.height,\n minimumHeight: minimum.height,\n minimumWidth: MINIMUM_WIDTH,\n };\n}\n\n/*** Calculates every descendant measurement from a single continuous logical width. */\nfunction resolveGeometryAtWidth(width: number, showTabs: boolean) {\n const progress = Math.max(\n 0,\n Math.min(1, (width - MINIMUM_WIDTH) / (REFERENCE_WIDTH - MINIMUM_WIDTH)),\n );\n const padding = interpolate(12, 24, progress);\n const rail = interpolate(104, 150, progress);\n const gap = interpolate(12, 20, progress);\n const scale = interpolate(0.75, 1, progress);\n const border = 1;\n const stage = width - border * 2 - padding * 2 - rail - gap;\n const headerHeight = 48 * scale;\n const tabHeight = showTabs ? 48 * scale : 0;\n const cardGap = 16 * scale;\n const cardHeight = 52 * scale;\n const settingsHeight = cardHeight * 2 + cardGap;\n const mainHeight = Math.max(stage, settingsHeight);\n const infoLineHeight = 20 * scale;\n const mainGap = 16 * scale;\n const footerGap = 10 * scale;\n const footerHeight = 52 * scale;\n const footerInset = 12 * scale;\n const height =\n border * 2 +\n padding +\n headerHeight +\n mainGap +\n tabHeight +\n (showTabs ? mainGap : 0) +\n mainHeight +\n mainGap +\n infoLineHeight +\n footerGap +\n 1 +\n footerGap +\n footerHeight +\n footerInset;\n\n return {\n border,\n cardGap,\n cardHeight,\n footerGap,\n footerHeight,\n footerInset,\n gap,\n headerHeight,\n height,\n infoLineHeight,\n mainGap,\n padding,\n rail,\n scale,\n settingsHeight,\n stage,\n tabHeight,\n width,\n };\n}\n\n/*** Finds the largest coherent width geometry that fits the available host height. */\nfunction resolveLargestGeometry(\n maximum: ReturnType<typeof resolveGeometryAtWidth>,\n height: number,\n showTabs: boolean,\n) {\n if (!Number.isFinite(height) || maximum.height <= height) return maximum;\n const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, showTabs);\n if (height < minimum.height) return minimum;\n\n let lower = MINIMUM_WIDTH;\n let upper = maximum.width;\n for (let iteration = 0; iteration < 20; iteration += 1) {\n const midpoint = (lower + upper) / 2;\n if (resolveGeometryAtWidth(midpoint, showTabs).height <= height) lower = midpoint;\n else upper = midpoint;\n }\n return resolveGeometryAtWidth(lower, showTabs);\n}\n\n/*** Interpolates a reference measurement without changing component hierarchy. */\nfunction interpolate(minimum: number, reference: number, progress: number) {\n return minimum + (reference - minimum) * progress;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { HexColor } from '@ankhorage/color-theory';
2
- /*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */
3
- export declare function resolveWheelColor(color: HexColor, x: number, y: number, center: number, radius: number, maxChroma: number): HexColor;
2
+ /*** Resolve a wheel coordinate into the same bounded OKLCH projection rendered by the wheel. */
3
+ export declare function resolveWheelColor(color: HexColor, x: number, y: number, center: number, radius: number, maxChroma: number, lightness?: number): HexColor;
4
4
  //# sourceMappingURL=resolveWheelColor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveWheelColor.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,qGAAqG;AACrG,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,EACf,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,QAAQ,CASV"}
1
+ {"version":3,"file":"resolveWheelColor.d.ts","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,gGAAgG;AAChG,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,EACf,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,SAA+C,GACvD,QAAQ,CAOV"}
@@ -1,8 +1,7 @@
1
1
  import { resolveOklchColor } from './resolveOklchColor';
2
2
  import { resolveWheelColorComponents } from './resolveWheelColorComponents';
3
- /*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */
4
- export function resolveWheelColor(color, x, y, center, radius, maxChroma) {
5
- const { lightness } = resolveWheelColorComponents(color);
3
+ /*** Resolve a wheel coordinate into the same bounded OKLCH projection rendered by the wheel. */
4
+ export function resolveWheelColor(color, x, y, center, radius, maxChroma, lightness = resolveWheelColorComponents(color).lightness) {
6
5
  const deltaX = x - center;
7
6
  const deltaY = y - center;
8
7
  const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
@@ -1 +1 @@
1
- {"version":3,"file":"resolveWheelColor.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,qGAAqG;AACrG,MAAM,UAAU,iBAAiB,CAC/B,KAAe,EACf,CAAS,EACT,CAAS,EACT,MAAc,EACd,MAAc,EACd,SAAiB;IAEjB,MAAM,EAAE,SAAS,EAAE,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;IAC/C,OAAO,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC;AAED,qEAAqE;AACrE,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\n\nimport { resolveOklchColor } from './resolveOklchColor';\nimport { resolveWheelColorComponents } from './resolveWheelColorComponents';\n\n/*** Resolve a wheel coordinate into a bounded OKLCH color while retaining the selected lightness. */\nexport function resolveWheelColor(\n color: HexColor,\n x: number,\n y: number,\n center: number,\n radius: number,\n maxChroma: number,\n): HexColor {\n const { lightness } = resolveWheelColorComponents(color);\n\n const deltaX = x - center;\n const deltaY = y - center;\n const distance = Math.min(Math.hypot(deltaX, deltaY), radius);\n const hue = normalizeHue((Math.atan2(deltaY, deltaX) * 180) / Math.PI + 90);\n const chroma = (distance / radius) * maxChroma;\n return resolveOklchColor({ lightness, chroma }, hue);\n}\n\n/*** Normalize an angular wheel coordinate to the OKLCH hue range. */\nfunction normalizeHue(hue: number): number {\n return hue < 0 ? hue + 360 : hue;\n}\n"]}
1
+ {"version":3,"file":"resolveWheelColor.js","sourceRoot":"","sources":["../../../../src/features/color/utils/resolveWheelColor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,gGAAgG;AAChG,MAAM,UAAU,iBAAiB,CAC/B,KAAe,EACf,CAAS,EACT,CAAS,EACT,MAAc,EACd,MAAc,EACd,SAAiB,EACjB,SAAS,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC,SAAS;IAExD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;IAC/C,OAAO,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC;AAED,qEAAqE;AACrE,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC","sourcesContent":["import type { HexColor } from '@ankhorage/color-theory';\n\nimport { resolveOklchColor } from './resolveOklchColor';\nimport { resolveWheelColorComponents } from './resolveWheelColorComponents';\n\n/*** Resolve a wheel coordinate into the same bounded OKLCH projection rendered by the wheel. */\nexport function resolveWheelColor(\n color: HexColor,\n x: number,\n y: number,\n center: number,\n radius: number,\n maxChroma: number,\n lightness = resolveWheelColorComponents(color).lightness,\n): HexColor {\n const deltaX = x - center;\n const deltaY = y - center;\n const distance = Math.min(Math.hypot(deltaX, deltaY), radius);\n const hue = normalizeHue((Math.atan2(deltaY, deltaX) * 180) / Math.PI + 90);\n const chroma = (distance / radius) * maxChroma;\n return resolveOklchColor({ lightness, chroma }, hue);\n}\n\n/*** Normalize an angular wheel coordinate to the OKLCH hue range. */\nfunction normalizeHue(hue: number): number {\n return hue < 0 ? hue + 360 : hue;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.native.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAEtD,iFAAiF;AACjF,SAAS,WAAW,CAAiC,EACnD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACY;IACpB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,KAAK,CAAC,iBAAiB,KA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C,CACnC,UAAU,CAAC,CAAC,YAAY,CAAC,EACzB,CACH;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAEnE,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CACxB;MAAA,CAAC,aAAa,CACZ,YAAY,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CACpC,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,OAAO,EAAE,EAAE;KACZ;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { type ListRenderItemInfo, StyleSheet } from 'react-native';\n\nimport type { SelectOption, SelectProps } from '../../../../../types/select';\nimport { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\nconst SELECT_SHEET_MAX_HEIGHT = 480;\n\n/*** Renders Select with BottomSheetFlatList presentation on native platforms. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the native BottomSheet host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const { dismiss, present } = useBottomSheet();\n const { select, selectedOption, value } = useSelectController(props);\n const passive = props.interactionPolicy === 'passive';\n const { disabled, interactionPolicy, options, readOnly, testID } = props;\n const listData = React.useMemo(() => [...options], [options]);\n\n const handleSelect = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n dismiss();\n },\n [dismiss, select],\n );\n\n const renderOption = React.useCallback(\n ({ item }: ListRenderItemInfo<SelectOption<TValue>>) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n onSelect={handleSelect}\n option={item}\n selected={value === item.value}\n testID={testID}\n />\n ),\n [handleSelect, interactionPolicy, testID, value],\n );\n\n const openSelect = React.useCallback(() => {\n if (disabled || readOnly || passive) return;\n\n present({\n contentMode: 'direct',\n maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,\n content: (\n <BottomSheetFlatList\n contentContainerStyle={styles.listContent}\n data={listData}\n keyExtractor={(item) => item.value}\n renderItem={renderOption}\n />\n ),\n });\n }, [disabled, listData, passive, present, readOnly, renderOption]);\n\n return (\n <SelectField props={props}>\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={openSelect}\n props={props}\n />\n </SelectField>\n );\n}\n\nconst styles = StyleSheet.create({\n listContent: {\n padding: 16,\n },\n});\n"]}
1
+ {"version":3,"file":"Select.native.js","sourceRoot":"","sources":["../../../../../../src/features/form/select/adapters/inbound/Select.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,MAA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AAE,MAAM,EAAE,KAAK,CAAC,CACjD,CAAC;IAEF,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,IAAI,QAAQ,IAAI,QAAQ,IAAI,OAAO;YAAE,OAAO;QAE5C,OAAO,CAAC;YACN,WAAW,EAAE,QAAQ;YACrB,qBAAqB,EAAE,uBAAuB;YAC9C,OAAO,EAAE,CACP,CAAC,mBAAmB,CAClB,qBAAqB,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC1C,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,YAAY,CAAC,CAAC,CAAC,IAA0B,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CACzD,UAAU,CAAC,CAAC,YAAY,CAAC,EACzB,CACH;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAEnE,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CACxB;MAAA,CAAC,aAAa,CACZ,YAAY,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CACpC,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,OAAO,EAAE,EAAE;KACZ;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { type ListRenderItemInfo, StyleSheet } from 'react-native';\n\nimport type { SelectOption, SelectProps } from '../../../../../types/select';\nimport { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/public';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { SelectField } from '../../composition/SelectField';\nimport { SelectOptionRow } from '../../composition/SelectOptionRow';\nimport { SelectTrigger } from '../../composition/SelectTrigger';\nimport { useSelectController } from '../../composition/useSelectController';\n\nconst SELECT_SHEET_MAX_HEIGHT = 480;\n\n/*** Renders Select with BottomSheetFlatList presentation on native platforms. */\nexport const Select = withZoraThemeScope(SelectInner);\n\n/*** Connects shared Select state and controls to the native BottomSheet host. */\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: SelectProps<TValue>) {\n const { dismiss, present } = useBottomSheet();\n const { select, selectedOption, value } = useSelectController(props);\n const passive = props.interactionPolicy === 'passive';\n const { disabled, interactionPolicy, options, readOnly, testID } = props;\n const listData = React.useMemo(() => [...options], [options]);\n\n const handleSelect = React.useCallback(\n (nextValue: TValue) => {\n select(nextValue);\n dismiss();\n },\n [dismiss, select],\n );\n\n const renderOption = React.useCallback(\n ({ item }: ListRenderItemInfo<SelectOption<TValue>>) => (\n <SelectOptionRow\n interactionPolicy={interactionPolicy}\n onSelect={handleSelect}\n option={item}\n selected={value === item.value}\n testID={testID}\n />\n ),\n [handleSelect, interactionPolicy, testID, value],\n );\n\n const openSelect = React.useCallback(() => {\n if (disabled || readOnly || passive) return;\n\n present({\n contentMode: 'direct',\n maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,\n content: (\n <BottomSheetFlatList\n contentContainerStyle={styles.listContent}\n data={listData}\n keyExtractor={(item: SelectOption<TValue>) => item.value}\n renderItem={renderOption}\n />\n ),\n });\n }, [disabled, listData, passive, present, readOnly, renderOption]);\n\n return (\n <SelectField props={props}>\n <SelectTrigger\n displayLabel={selectedOption?.label}\n leadingMedia={selectedOption?.leadingMedia}\n onPress={openSelect}\n props={props}\n />\n </SelectField>\n );\n}\n\nconst styles = StyleSheet.create({\n listContent: {\n padding: 16,\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAU5D,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,EACnD,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE,kBAAkB,CAAC,MAAM,CAAC,+BA0D5B;AAED,UAAU,kBAAkB,CAAC,MAAM,SAAS,MAAM;IAChD,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B"}
1
+ {"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAU5D,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,EACnD,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE,kBAAkB,CAAC,MAAM,CAAC,+BA2D5B;AAED,UAAU,kBAAkB,CAAC,MAAM,SAAS,MAAM;IAChD,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B"}
@@ -12,7 +12,7 @@ export function SelectTrigger({ displayLabel, leadingMedia, onPress, props, }) {
12
12
  const media = leadingMedia ?? props.leadingMedia;
13
13
  if (media) {
14
14
  return (<Pressable accessibilityLabel={displayLabel ?? props.placeholder ?? 'Select'} disabled={props.disabled} interactionPolicy={props.interactionPolicy} onPress={props.readOnly ? undefined : onPress} style={{ alignSelf: 'stretch' }} testID={props.testID ? `${props.testID}-trigger` : undefined}>
15
- <View align="center" bg={props.invalid ? theme.semantics.error.softBg : theme.semantics.neutral.surface} borderColor={props.invalid ? theme.semantics.error.base : theme.semantics.neutral.divider} borderWidth={1} direction="row" gap="s" minHeight={44} px="m" radius="m">
15
+ <View align="center" bg={props.invalid ? theme.semantics.error.softBg : theme.semantics.neutral.surface} borderColor={props.invalid ? theme.semantics.error.base : theme.semantics.neutral.divider} borderWidth={1} direction="row" gap="s" minHeight={props.compact ? 36 : 44} px="m" radius="m">
16
16
  <Image alt="" height={28} radius="s" source={media} width={28}/>
17
17
  <View flex={1}>
18
18
  <Text emphasis={displayLabel ? 'default' : 'muted'} numberOfLines={1} variant="label" weight={props.labelWeight ?? 'semiBold'}>
@@ -23,7 +23,7 @@ export function SelectTrigger({ displayLabel, leadingMedia, onPress, props, }) {
23
23
  </View>
24
24
  </Pressable>);
25
25
  }
26
- return (<Button color={props.invalid ? 'danger' : 'neutral'} disabled={props.disabled} fullWidth interactionPolicy={props.interactionPolicy} leadingIcon={props.leadingIcon} labelWeight={props.labelWeight ?? 'semiBold'} onPress={props.readOnly ? undefined : onPress} testID={props.testID ? `${props.testID}-trigger` : undefined} trailingIcon={SELECT_CHEVRON_ICON} variant="outline">
26
+ return (<Button color={props.invalid ? 'danger' : 'neutral'} disabled={props.disabled} fullWidth interactionPolicy={props.interactionPolicy} leadingIcon={props.leadingIcon} labelWeight={props.labelWeight ?? 'semiBold'} onPress={props.readOnly ? undefined : onPress} size={props.compact ? 's' : undefined} testID={props.testID ? `${props.testID}-trigger` : undefined} trailingIcon={SELECT_CHEVRON_ICON} variant="outline">
27
27
  {displayLabel ?? props.placeholder ?? 'Select'}
28
28
  </Button>);
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],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CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAC5C,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,SAAS,CACT,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,CAC7C,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAC9C,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAC7D,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,OAAO,CAAC,SAAS,CAEjB;MAAA,CAAC,YAAY,IAAI,KAAK,CAAC,WAAW,IAAI,QAAQ,CAChD;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { Pressable } from '@ankhorage/surface';\n\nimport type { SelectProps } from '../../../../types/select';\nimport { Button } from '../../../button/public';\nimport { Icon } from '../../../icon/public';\nimport { Image } from '../../../image/public';\nimport { View } from '../../../layout/public';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { Text } from '../../../typography/public';\n\nconst SELECT_CHEVRON_ICON = { name: 'chevron-down' } as const;\n\n/*** Renders the shared Select trigger with the resolved option label or placeholder. */\nexport function SelectTrigger<TValue extends string>({\n displayLabel,\n leadingMedia,\n onPress,\n props,\n}: SelectTriggerProps<TValue>) {\n const { theme } = useZoraTheme();\n const media = leadingMedia ?? props.leadingMedia;\n\n if (media) {\n return (\n <Pressable\n accessibilityLabel={displayLabel ?? props.placeholder ?? 'Select'}\n disabled={props.disabled}\n interactionPolicy={props.interactionPolicy}\n onPress={props.readOnly ? undefined : onPress}\n style={{ alignSelf: 'stretch' }}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n >\n <View\n align=\"center\"\n bg={props.invalid ? theme.semantics.error.softBg : theme.semantics.neutral.surface}\n borderColor={props.invalid ? theme.semantics.error.base : theme.semantics.neutral.divider}\n borderWidth={1}\n direction=\"row\"\n gap=\"s\"\n minHeight={44}\n px=\"m\"\n radius=\"m\"\n >\n <Image alt=\"\" height={28} radius=\"s\" source={media} width={28} />\n <View flex={1}>\n <Text\n emphasis={displayLabel ? 'default' : 'muted'}\n numberOfLines={1}\n variant=\"label\"\n weight={props.labelWeight ?? 'semiBold'}\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Text>\n </View>\n <Icon name=\"chevron-down\" size={18} />\n </View>\n </Pressable>\n );\n }\n\n return (\n <Button\n color={props.invalid ? 'danger' : 'neutral'}\n disabled={props.disabled}\n fullWidth\n interactionPolicy={props.interactionPolicy}\n leadingIcon={props.leadingIcon}\n labelWeight={props.labelWeight ?? 'semiBold'}\n onPress={props.readOnly ? undefined : onPress}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n trailingIcon={SELECT_CHEVRON_ICON}\n variant=\"outline\"\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Button>\n );\n}\n\ninterface SelectTriggerProps<TValue extends string> {\n displayLabel: string | undefined;\n leadingMedia: SelectProps<TValue>['leadingMedia'];\n onPress: () => void;\n props: SelectProps<TValue>;\n}\n"]}
1
+ {"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MA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,KAAK,CAAC,QAAQ,CAAC,CACzB,SAAS,CACT,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,CAC7C,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAC9C,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CACtC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAC7D,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,OAAO,CAAC,SAAS,CAEjB;MAAA,CAAC,YAAY,IAAI,KAAK,CAAC,WAAW,IAAI,QAAQ,CAChD;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { Pressable } from '@ankhorage/surface';\n\nimport type { SelectProps } from '../../../../types/select';\nimport { Button } from '../../../button/public';\nimport { Icon } from '../../../icon/public';\nimport { Image } from '../../../image/public';\nimport { View } from '../../../layout/public';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { Text } from '../../../typography/public';\n\nconst SELECT_CHEVRON_ICON = { name: 'chevron-down' } as const;\n\n/*** Renders the shared Select trigger with the resolved option label or placeholder. */\nexport function SelectTrigger<TValue extends string>({\n displayLabel,\n leadingMedia,\n onPress,\n props,\n}: SelectTriggerProps<TValue>) {\n const { theme } = useZoraTheme();\n const media = leadingMedia ?? props.leadingMedia;\n\n if (media) {\n return (\n <Pressable\n accessibilityLabel={displayLabel ?? props.placeholder ?? 'Select'}\n disabled={props.disabled}\n interactionPolicy={props.interactionPolicy}\n onPress={props.readOnly ? undefined : onPress}\n style={{ alignSelf: 'stretch' }}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n >\n <View\n align=\"center\"\n bg={props.invalid ? theme.semantics.error.softBg : theme.semantics.neutral.surface}\n borderColor={props.invalid ? theme.semantics.error.base : theme.semantics.neutral.divider}\n borderWidth={1}\n direction=\"row\"\n gap=\"s\"\n minHeight={props.compact ? 36 : 44}\n px=\"m\"\n radius=\"m\"\n >\n <Image alt=\"\" height={28} radius=\"s\" source={media} width={28} />\n <View flex={1}>\n <Text\n emphasis={displayLabel ? 'default' : 'muted'}\n numberOfLines={1}\n variant=\"label\"\n weight={props.labelWeight ?? 'semiBold'}\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Text>\n </View>\n <Icon name=\"chevron-down\" size={18} />\n </View>\n </Pressable>\n );\n }\n\n return (\n <Button\n color={props.invalid ? 'danger' : 'neutral'}\n disabled={props.disabled}\n fullWidth\n interactionPolicy={props.interactionPolicy}\n leadingIcon={props.leadingIcon}\n labelWeight={props.labelWeight ?? 'semiBold'}\n onPress={props.readOnly ? undefined : onPress}\n size={props.compact ? 's' : undefined}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n trailingIcon={SELECT_CHEVRON_ICON}\n variant=\"outline\"\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Button>\n );\n}\n\ninterface SelectTriggerProps<TValue extends string> {\n displayLabel: string | undefined;\n leadingMedia: SelectProps<TValue>['leadingMedia'];\n onPress: () => void;\n props: SelectProps<TValue>;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,8 +2,10 @@ export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps,
2
2
  export { AuthoringBindingEditorAdapter, AuthoringPropertyInspectorAdapter, AuthoringSelectionAdapter, ThemeEditorAdapter, } from './authoring';
3
3
  export type { CarouselProps, CarouselSlide, CarouselTransition } from './features/carousel/public';
4
4
  export { Carousel } from './features/carousel/public';
5
- export type { ColorHueScaleProps, ColorPickerProps, ColorPickerSelection, ColorPickerTab, ColorPickerValue, ColorToneDefinition, ColorToneProps, ColorToneSelection, ColorToneTarget, ColorWheelProps, ColorWheelSelection, } from './features/color/public';
5
+ export type { ColorHueScaleProps, ColorPickerProps, ColorPickerTab, ColorToneDefinition, ColorToneProps, ColorToneSelection, ColorToneTarget, ColorWheelProps, ColorWheelSelection, } from './features/color/public';
6
6
  export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
7
+ export type { GradientRenderer, GradientRendererProps, GradientRendererProviderProps, } from './features/gradient/public';
8
+ export { GradientRendererProvider } from './features/gradient/public';
7
9
  export type { MasterDetailActivePane, MasterDetailDesktopMode, MasterDetailMasterWidth, MasterDetailProps, } from './features/master-detail/public';
8
10
  export { MasterDetail } from './features/master-detail/public';
9
11
  export type { ReaderColorScheme, ReaderDocumentFormat, ReaderErrorCode, ReaderErrorEvent, ReaderExternalLinkEvent, ReaderLineHeight, ReaderLocationChangeEvent, ReaderNavigationTrigger, ReaderProps, ReaderResolvedSource, ReaderStatus, } from './features/reader/public';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,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EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5F,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { AuthoringBindingEditorAdapter, AuthoringPropertyInspectorAdapter, AuthoringSelectionAdapter, ThemeEditorAdapter, } from './authoring';
2
2
  export { Carousel } from './features/carousel/public';
3
3
  export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
4
+ export { GradientRendererProvider } from './features/gradient/public';
4
5
  export { MasterDetail } from './features/master-detail/public';
5
6
  export { Reader, resolveReaderProgress } from './features/reader/public';
6
7
  export { ZORA_COMPONENT_REGISTRY } from './features/registry/public';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AActD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAO5F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAc/D,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC","sourcesContent":["export type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './authoring';\nexport {\n AuthoringBindingEditorAdapter,\n AuthoringPropertyInspectorAdapter,\n AuthoringSelectionAdapter,\n ThemeEditorAdapter,\n} from './authoring';\nexport type { CarouselProps, CarouselSlide, CarouselTransition } from './features/carousel/public';\nexport { Carousel } from './features/carousel/public';\nexport type {\n ColorHueScaleProps,\n ColorPickerProps,\n ColorPickerSelection,\n ColorPickerTab,\n ColorPickerValue,\n ColorToneDefinition,\n ColorToneProps,\n ColorToneSelection,\n ColorToneTarget,\n ColorWheelProps,\n ColorWheelSelection,\n} from './features/color/public';\nexport { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';\nexport type {\n MasterDetailActivePane,\n MasterDetailDesktopMode,\n MasterDetailMasterWidth,\n MasterDetailProps,\n} from './features/master-detail/public';\nexport { MasterDetail } from './features/master-detail/public';\nexport type {\n ReaderColorScheme,\n ReaderDocumentFormat,\n ReaderErrorCode,\n ReaderErrorEvent,\n ReaderExternalLinkEvent,\n ReaderLineHeight,\n ReaderLocationChangeEvent,\n ReaderNavigationTrigger,\n ReaderProps,\n ReaderResolvedSource,\n ReaderStatus,\n} from './features/reader/public';\nexport { Reader, resolveReaderProgress } from './features/reader/public';\nexport { ZORA_COMPONENT_REGISTRY } from './features/registry/public';\nexport * from './readerFree';\nexport type { ZoraComponentRegistry } from './types/registry';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAYtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAOtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAc/D,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC","sourcesContent":["export type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './authoring';\nexport {\n AuthoringBindingEditorAdapter,\n AuthoringPropertyInspectorAdapter,\n AuthoringSelectionAdapter,\n ThemeEditorAdapter,\n} from './authoring';\nexport type { CarouselProps, CarouselSlide, CarouselTransition } from './features/carousel/public';\nexport { Carousel } from './features/carousel/public';\nexport type {\n ColorHueScaleProps,\n ColorPickerProps,\n ColorPickerTab,\n ColorToneDefinition,\n ColorToneProps,\n ColorToneSelection,\n ColorToneTarget,\n ColorWheelProps,\n ColorWheelSelection,\n} from './features/color/public';\nexport { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';\nexport type {\n GradientRenderer,\n GradientRendererProps,\n GradientRendererProviderProps,\n} from './features/gradient/public';\nexport { GradientRendererProvider } from './features/gradient/public';\nexport type {\n MasterDetailActivePane,\n MasterDetailDesktopMode,\n MasterDetailMasterWidth,\n MasterDetailProps,\n} from './features/master-detail/public';\nexport { MasterDetail } from './features/master-detail/public';\nexport type {\n ReaderColorScheme,\n ReaderDocumentFormat,\n ReaderErrorCode,\n ReaderErrorEvent,\n ReaderExternalLinkEvent,\n ReaderLineHeight,\n ReaderLocationChangeEvent,\n ReaderNavigationTrigger,\n ReaderProps,\n ReaderResolvedSource,\n ReaderStatus,\n} from './features/reader/public';\nexport { Reader, resolveReaderProgress } from './features/reader/public';\nexport { ZORA_COMPONENT_REGISTRY } from './features/registry/public';\nexport * from './readerFree';\nexport type { ZoraComponentRegistry } from './types/registry';\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
2
2
  import type { ZoraBaseProps } from './base';
3
- export type ColorPickerTab = 'wheel' | 'tone' | 'hue';
3
+ export type ColorPickerTab = 'grid' | 'wheel';
4
4
  /** A consumer-owned OKLCH target from the published Templates tone catalog. */
5
5
  export interface ColorToneTarget {
6
6
  readonly lightness: number;
@@ -23,27 +23,13 @@ export interface ColorToneSelection {
23
23
  readonly toneId: string;
24
24
  readonly colors: readonly HexColor[];
25
25
  }
26
- /** The persistent, controlled state for every independently selectable picker mode. */
27
- export interface ColorPickerValue {
28
- readonly tab: ColorPickerTab;
29
- readonly wheel: ColorWheelSelection;
30
- readonly tone: ColorToneSelection | null;
31
- readonly hue: HexColor;
32
- }
33
- /** A single mode-specific update emitted by the composed picker. */
34
- export type ColorPickerSelection = {
35
- readonly mode: 'wheel';
36
- readonly value: ColorWheelSelection;
37
- } | {
38
- readonly mode: 'tone';
39
- readonly value: ColorToneSelection;
40
- } | {
41
- readonly mode: 'hue';
42
- readonly value: HexColor;
43
- };
44
26
  export interface ColorWheelProps extends ZoraBaseProps {
45
27
  readonly value: HexColor;
28
+ /** Square stage side derived by the owning ColorPicker geometry. */
29
+ readonly size?: number;
46
30
  readonly harmony?: ColorHarmony | null;
31
+ /** Optional consumer-provided target applied consistently to wheel rendering and selection. */
32
+ readonly toneTarget?: ColorToneTarget;
47
33
  readonly harmonies?: readonly ColorHarmony[];
48
34
  readonly onChange: (selection: ColorWheelSelection) => void;
49
35
  }
@@ -58,15 +44,37 @@ export interface ColorHueScaleProps extends ZoraBaseProps {
58
44
  readonly onChange: (color: HexColor) => void;
59
45
  }
60
46
  export interface ColorPickerProps extends ZoraBaseProps {
61
- readonly tabs: readonly ColorPickerTab[];
62
- readonly value: ColorPickerValue;
63
- readonly onValueChange: (value: ColorPickerValue) => void;
64
- readonly onSelectionChange?: (selection: ColorPickerSelection) => void;
47
+ /** Enabled presentations, in Grid then Wheel order by default. */
48
+ readonly tabs?: readonly ColorPickerTab[];
49
+ /** The one authoritative selected colour. */
50
+ readonly primaryColor: HexColor;
51
+ /** Optional owner-provided harmony applied to both presentations. */
52
+ readonly harmony?: ColorHarmony;
53
+ /** Optional consumer-owned tone-family id. */
54
+ readonly tone?: string;
55
+ /** Consumer-owned tone catalogue; ZORA deliberately does not copy it. */
56
+ readonly tones?: readonly ColorToneDefinition[];
57
+ /** Requested outer logical width; it is clamped to the measured host width. */
58
+ readonly width?: number;
59
+ /** Requested outer logical height; it is clamped to the measured host height. */
60
+ readonly height?: number;
61
+ /** Receives whether the host must provide a larger or full-screen presentation. */
62
+ readonly onInsufficientSpaceChange?: (insufficient: boolean) => void;
63
+ /** Optional one-line contextual information rendered above the footer. */
64
+ readonly infoLine?: string;
65
+ /** Controlled active presentation. */
66
+ readonly activeTab?: ColorPickerTab;
67
+ /** Emits one canonical controlled selection payload. */
68
+ readonly onValueChange: (value: {
69
+ readonly primaryColor: HexColor;
70
+ readonly harmony?: ColorHarmony;
71
+ readonly tone?: string;
72
+ }) => void;
73
+ /** Notifies a consumer that a controlled active presentation must change. */
74
+ readonly onActiveTabChange?: (tab: ColorPickerTab) => void;
65
75
  /** Requests dismissal from the owning Popover or BottomSheet presentation. */
66
76
  readonly onDismiss?: () => void;
67
77
  readonly hideTabListWhenSingle?: boolean;
68
- readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;
69
- readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;
70
- readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;
78
+ readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value' | 'harmony'>;
71
79
  }
72
80
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtD,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,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AS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ColorPickerTab = 'wheel' | 'tone' | 'hue';\n\n/** A consumer-owned OKLCH target from the published Templates tone catalog. */\nexport interface ColorToneTarget {\n readonly lightness: number;\n readonly chroma: number;\n}\n\n/**\n * Structural boundary for a Templates tone-pair entry. ZORA intentionally owns\n * neither the catalog nor its classifications.\n */\nexport interface ColorToneDefinition {\n readonly id: string;\n readonly accent: string;\n readonly accentTarget: ColorToneTarget;\n}\n\nexport interface ColorWheelSelection {\n readonly color: HexColor;\n readonly harmony: ColorHarmony | null;\n}\n\nexport interface ColorToneSelection {\n readonly toneId: string;\n readonly colors: readonly HexColor[];\n}\n\n/** The persistent, controlled state for every independently selectable picker mode. */\nexport interface ColorPickerValue {\n readonly tab: ColorPickerTab;\n readonly wheel: ColorWheelSelection;\n readonly tone: ColorToneSelection | null;\n readonly hue: HexColor;\n}\n\n/** A single mode-specific update emitted by the composed picker. */\nexport type ColorPickerSelection =\n | { readonly mode: 'wheel'; readonly value: ColorWheelSelection }\n | { readonly mode: 'tone'; readonly value: ColorToneSelection }\n | { readonly mode: 'hue'; readonly value: HexColor };\n\nexport interface ColorWheelProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly harmony?: ColorHarmony | null;\n readonly harmonies?: readonly ColorHarmony[];\n readonly onChange: (selection: ColorWheelSelection) => void;\n}\n\nexport interface ColorToneProps extends ZoraBaseProps {\n readonly tones: readonly ColorToneDefinition[];\n readonly selectionMode?: 'single' | 'multiple';\n readonly value: ColorToneSelection | null;\n readonly onChange: (selection: ColorToneSelection) => void;\n}\n\nexport interface ColorHueScaleProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly onChange: (color: HexColor) => void;\n}\n\nexport interface ColorPickerProps extends ZoraBaseProps {\n readonly tabs: readonly ColorPickerTab[];\n readonly value: ColorPickerValue;\n readonly onValueChange: (value: ColorPickerValue) => void;\n readonly onSelectionChange?: (selection: ColorPickerSelection) => void;\n /** Requests dismissal from the owning Popover or BottomSheet presentation. */\n readonly onDismiss?: () => void;\n readonly hideTabListWhenSingle?: boolean;\n readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;\n readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;\n readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;\n}\n"]}
1
+ {"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ColorPickerTab = 'grid' | 'wheel';\n\n/** A consumer-owned OKLCH target from the published Templates tone catalog. */\nexport interface ColorToneTarget {\n readonly lightness: number;\n readonly chroma: number;\n}\n\n/**\n * Structural boundary for a Templates tone-pair entry. ZORA intentionally owns\n * neither the catalog nor its classifications.\n */\nexport interface ColorToneDefinition {\n readonly id: string;\n readonly accent: string;\n readonly accentTarget: ColorToneTarget;\n}\n\nexport interface ColorWheelSelection {\n readonly color: HexColor;\n readonly harmony: ColorHarmony | null;\n}\n\nexport interface ColorToneSelection {\n readonly toneId: string;\n readonly colors: readonly HexColor[];\n}\n\nexport interface ColorWheelProps extends ZoraBaseProps {\n readonly value: HexColor;\n /** Square stage side derived by the owning ColorPicker geometry. */\n readonly size?: number;\n readonly harmony?: ColorHarmony | null;\n /** Optional consumer-provided target applied consistently to wheel rendering and selection. */\n readonly toneTarget?: ColorToneTarget;\n readonly harmonies?: readonly ColorHarmony[];\n readonly onChange: (selection: ColorWheelSelection) => void;\n}\n\nexport interface ColorToneProps extends ZoraBaseProps {\n readonly tones: readonly ColorToneDefinition[];\n readonly selectionMode?: 'single' | 'multiple';\n readonly value: ColorToneSelection | null;\n readonly onChange: (selection: ColorToneSelection) => void;\n}\n\nexport interface ColorHueScaleProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly onChange: (color: HexColor) => void;\n}\n\nexport interface ColorPickerProps extends ZoraBaseProps {\n /** Enabled presentations, in Grid then Wheel order by default. */\n readonly tabs?: readonly ColorPickerTab[];\n /** The one authoritative selected colour. */\n readonly primaryColor: HexColor;\n /** Optional owner-provided harmony applied to both presentations. */\n readonly harmony?: ColorHarmony;\n /** Optional consumer-owned tone-family id. */\n readonly tone?: string;\n /** Consumer-owned tone catalogue; ZORA deliberately does not copy it. */\n readonly tones?: readonly ColorToneDefinition[];\n /** Requested outer logical width; it is clamped to the measured host width. */\n readonly width?: number;\n /** Requested outer logical height; it is clamped to the measured host height. */\n readonly height?: number;\n /** Receives whether the host must provide a larger or full-screen presentation. */\n readonly onInsufficientSpaceChange?: (insufficient: boolean) => void;\n /** Optional one-line contextual information rendered above the footer. */\n readonly infoLine?: string;\n /** Controlled active presentation. */\n readonly activeTab?: ColorPickerTab;\n /** Emits one canonical controlled selection payload. */\n readonly onValueChange: (value: {\n readonly primaryColor: HexColor;\n readonly harmony?: ColorHarmony;\n readonly tone?: string;\n }) => void;\n /** Notifies a consumer that a controlled active presentation must change. */\n readonly onActiveTabChange?: (tab: ColorPickerTab) => void;\n /** Requests dismissal from the owning Popover or BottomSheet presentation. */\n readonly onDismiss?: () => void;\n readonly hideTabListWhenSingle?: boolean;\n readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value' | 'harmony'>;\n}\n"]}
@@ -26,6 +26,8 @@ export interface SelectProps<TValue extends string = string> extends ZoraBasePro
26
26
  leadingMedia?: ImageProps['source'];
27
27
  /** Optional Surface Button label emphasis; defaults to semiBold. */
28
28
  labelWeight?: ButtonLabelWeight;
29
+ /** Uses the compact control height for dense settings surfaces. */
30
+ compact?: boolean;
29
31
  required?: boolean;
30
32
  disabled?: boolean;
31
33
  readOnly?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,YAAY,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,oEAAoE;IACpE,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,QAAQ,C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C,EAAE,iBAAiB,CAAC;IAChC,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';\n\nimport type { ZoraBaseProps } from './base';\nimport type { ImageProps } from './image';\n\nexport interface SelectOption<TValue extends string = string> {\n value: TValue;\n label: string;\n /** Optional image rendered before this option label and in the trigger when selected. */\n leadingMedia?: ImageProps['source'];\n disabled?: boolean;\n}\n\nexport interface SelectProps<TValue extends string = string> extends ZoraBaseProps {\n value?: TValue;\n defaultValue?: TValue;\n options: readonly SelectOption<TValue>[];\n onValueChange?: (value: TValue) => void;\n label?: string;\n helperText?: string;\n errorText?: string;\n placeholder?: string;\n /** Optional Surface icon source rendered before the trigger label. */\n leadingIcon?: ButtonIconSpec;\n /**\n * Optional image rendered before the trigger label. A selected option's leadingMedia takes\n * precedence. When present, media takes precedence over leadingIcon.\n */\n leadingMedia?: ImageProps['source'];\n /** Optional Surface Button label emphasis; defaults to semiBold. */\n labelWeight?: ButtonLabelWeight;\n required?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n testID?: string;\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';\n\nimport type { ZoraBaseProps } from './base';\nimport type { ImageProps } from './image';\n\nexport interface SelectOption<TValue extends string = string> {\n value: TValue;\n label: string;\n /** Optional image rendered before this option label and in the trigger when selected. */\n leadingMedia?: ImageProps['source'];\n disabled?: boolean;\n}\n\nexport interface SelectProps<TValue extends string = string> extends ZoraBaseProps {\n value?: TValue;\n defaultValue?: TValue;\n options: readonly SelectOption<TValue>[];\n onValueChange?: (value: TValue) => void;\n label?: string;\n helperText?: string;\n errorText?: string;\n placeholder?: string;\n /** Optional Surface icon source rendered before the trigger label. */\n leadingIcon?: ButtonIconSpec;\n /**\n * Optional image rendered before the trigger label. A selected option's leadingMedia takes\n * precedence. When present, media takes precedence over leadingIcon.\n */\n leadingMedia?: ImageProps['source'];\n /** Optional Surface Button label emphasis; defaults to semiBold. */\n labelWeight?: ButtonLabelWeight;\n /** Uses the compact control height for dense settings surfaces. */\n compact?: boolean;\n required?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n testID?: string;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "27.11.3",
4
+ "version": "28.1.0",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -48,7 +48,7 @@
48
48
  "@ankhorage/graph": "^0.4.0",
49
49
  "@ankhorage/grid-view": "^0.5.0",
50
50
  "@ankhorage/reader": "^0.1.3",
51
- "@ankhorage/runtime": "^5.6.4",
51
+ "@ankhorage/runtime": "^5.7.1",
52
52
  "@ankhorage/surface": "^9.7.2",
53
53
  "@ankhorage/utility": "^1.11.0",
54
54
  "expo-document-picker": "~57.0.3",
@@ -187,14 +187,14 @@
187
187
  "version-packages": "ankhorage-changeset version"
188
188
  },
189
189
  "devDependencies": {
190
- "@ankhorage/devtools": "^2.11.1",
191
- "@ankhorage/paradox": "^0.6.0",
190
+ "@ankhorage/devtools": "^2.12.5",
191
+ "@ankhorage/paradox": "^0.6.1",
192
192
  "@react-native-vector-icons/fontawesome": "^14.0.0",
193
193
  "@react-native-vector-icons/fontawesome5": "^14.0.0",
194
194
  "@react-native-vector-icons/fontawesome6": "^14.0.0",
195
195
  "@react-native-vector-icons/ionicons": "^14.0.0",
196
196
  "@react-native-vector-icons/material-design-icons": "^14.0.0",
197
- "@types/bun": "^1.4.2",
197
+ "@types/bun": "^1.4.5",
198
198
  "@types/culori": "^4.0.1",
199
199
  "@types/node": "^26.6.11",
200
200
  "@types/react": "^19.3.3",
@@ -214,7 +214,7 @@
214
214
  "react-native-worklets": "0.10.1",
215
215
  "typescript": "~6.0.3"
216
216
  },
217
- "packageManager": "bun@1.4.2",
217
+ "packageManager": "bun@1.4.5",
218
218
  "ankh": {
219
219
  "category": "zora",
220
220
  "capabilities": [
@@ -61,7 +61,7 @@ function BottomSheetInner({
61
61
  dismissed.current = true;
62
62
  onDismiss?.();
63
63
  },
64
- onIndexChange: (index) => onIndexChange?.({ index }),
64
+ onIndexChange: (index: number) => onIndexChange?.({ index }),
65
65
  });
66
66
  }, [
67
67
  active,
@@ -1,12 +1,14 @@
1
1
  import { type HexColor, isHexColor } from '@ankhorage/color-theory';
2
+ import { useClipboardWriter, writeClipboardTextAsync } from '@ankhorage/runtime';
2
3
  import { TextInput } from '@ankhorage/surface';
3
4
  import React from 'react';
4
5
 
5
- import { Icon } from '../icon/public';
6
+ import { IconButton } from '../button/public';
6
7
  import { View } from '../layout/public';
7
8
  import { useZoraTheme } from '../theme/composition/useZoraTheme';
9
+ import { Text } from '../typography/public';
8
10
 
9
- /*** Edits one controlled HEX color with the Studio-style swatch and copy affordance. */
11
+ /*** Edits one controlled HEX color and delegates copying to the host-owned clipboard capability. */
10
12
  export function ColorHexField({
11
13
  disabled,
12
14
  onChange,
@@ -17,29 +19,71 @@ export function ColorHexField({
17
19
  readonly value: HexColor;
18
20
  }) {
19
21
  const [input, setInput] = React.useState<string>(value);
22
+ const [previousValue, setPreviousValue] = React.useState(value);
23
+ const [copyFeedback, setCopyFeedback] = React.useState<string>();
24
+ const clipboardWriter = useClipboardWriter();
20
25
  const { theme } = useZoraTheme();
26
+ if (value !== previousValue) {
27
+ setPreviousValue(value);
28
+ setInput(value);
29
+ }
21
30
 
22
31
  return (
23
- <TextInput
24
- accessibilityLabel="Color hex value"
25
- disabled={disabled}
26
- key={value}
27
- leadingAccessory={
28
- <View
29
- bg={value}
30
- borderColor={theme.semantics.border.default}
31
- borderWidth={1}
32
- height={30}
33
- radius="s"
34
- width={30}
35
- />
36
- }
37
- onChangeText={(nextValue) => {
38
- setInput(nextValue);
39
- if (isHexColor(nextValue)) onChange(nextValue);
40
- }}
41
- trailingAccessory={<Icon color="textMuted" name="copy-outline" size="m" />}
42
- value={input}
43
- />
32
+ <View>
33
+ <TextInput
34
+ accessibilityLabel="Color hex value"
35
+ disabled={disabled}
36
+ leadingAccessory={
37
+ <View
38
+ bg={value}
39
+ borderColor={theme.semantics.border.default}
40
+ borderWidth={1}
41
+ height={30}
42
+ radius="s"
43
+ width={30}
44
+ />
45
+ }
46
+ onChangeText={(nextValue) => {
47
+ setInput(nextValue);
48
+ if (isHexColor(nextValue)) onChange(nextValue);
49
+ }}
50
+ trailingAccessory={
51
+ <IconButton
52
+ iconName={
53
+ copyFeedback === 'Color hex copied.'
54
+ ? 'checkmark'
55
+ : copyFeedback
56
+ ? 'warning'
57
+ : 'copy-outline'
58
+ }
59
+ label={copyFeedback ?? 'Copy color hex value'}
60
+ disabled={disabled}
61
+ onPress={() => {
62
+ void writeClipboardTextAsync(clipboardWriter, value).then((result) => {
63
+ setCopyFeedback(
64
+ result === 'written'
65
+ ? 'Color hex copied.'
66
+ : result === 'denied'
67
+ ? 'Clipboard access was denied.'
68
+ : 'Clipboard is unavailable.',
69
+ );
70
+ });
71
+ }}
72
+ variant="ghost"
73
+ />
74
+ }
75
+ value={input}
76
+ />
77
+ {copyFeedback ? (
78
+ <Text
79
+ accessibilityLiveRegion="polite"
80
+ emphasis="muted"
81
+ style={{ position: 'absolute', opacity: 0 }}
82
+ variant="caption"
83
+ >
84
+ {copyFeedback}
85
+ </Text>
86
+ ) : null}
87
+ </View>
44
88
  );
45
89
  }