@ankhorage/zora 28.10.1 → 28.11.1
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.
- package/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +2 -1
- package/dist/capabilities/index.js.map +3 -3
- package/dist/constants/authoring.d.ts +3 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +1 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.js +91 -7
- package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts +5 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts.map +1 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.js +261 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.js.map +1 -0
- package/dist/features/flow/application/createFlowEditorController.d.ts +13 -0
- package/dist/features/flow/application/createFlowEditorController.d.ts.map +1 -0
- package/dist/features/flow/application/createFlowEditorController.js +86 -0
- package/dist/features/flow/application/createFlowEditorController.js.map +1 -0
- package/dist/features/flow/application/getFlowPortAnchor.d.ts +10 -0
- package/dist/features/flow/application/getFlowPortAnchor.d.ts.map +1 -0
- package/dist/features/flow/application/getFlowPortAnchor.js +18 -0
- package/dist/features/flow/application/getFlowPortAnchor.js.map +1 -0
- package/dist/features/flow/application/mapFlowViewport.d.ts +10 -0
- package/dist/features/flow/application/mapFlowViewport.d.ts.map +1 -0
- package/dist/features/flow/application/mapFlowViewport.js +22 -0
- package/dist/features/flow/application/mapFlowViewport.js.map +1 -0
- package/dist/features/flow/public.d.ts +3 -0
- package/dist/features/flow/public.d.ts.map +1 -0
- package/dist/features/flow/public.js +2 -0
- package/dist/features/flow/public.js.map +1 -0
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts +5 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts.map +1 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.js +190 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.js.map +1 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.d.ts +17 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.d.ts.map +1 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.js +23 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.js.map +1 -0
- package/dist/features/graph-node/public.d.ts +3 -0
- package/dist/features/graph-node/public.d.ts.map +1 -0
- package/dist/features/graph-node/public.js +2 -0
- package/dist/features/graph-node/public.js.map +1 -0
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.js +105 -41
- package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
- package/dist/features/grid-view/application/createGridScrollSync.d.ts +2 -5
- package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -1
- package/dist/features/grid-view/application/createGridScrollSync.js +109 -45
- package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -1
- package/dist/features/grid-view/public.d.ts +1 -1
- package/dist/features/grid-view/public.d.ts.map +1 -1
- package/dist/features/grid-view/public.js.map +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -1
- package/dist/features/layout/utils/createScrollGestureLock.js +4 -0
- package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
- package/dist/features/popover/popoverMeta.d.ts +1 -1
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- package/dist/features/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/features/theme/node.d.ts +5 -0
- package/dist/features/theme/node.d.ts.map +1 -0
- package/dist/features/theme/node.js +4 -0
- package/dist/features/theme/node.js.map +1 -0
- package/dist/features/theme/public.d.ts +2 -0
- package/dist/features/theme/public.d.ts.map +1 -1
- package/dist/features/theme/public.js +1 -0
- package/dist/features/theme/public.js.map +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts.map +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js +45 -22
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js.map +1 -1
- package/dist/types/color.d.ts +3 -3
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/color.js.map +1 -1
- package/dist/types/flow.d.ts +81 -0
- package/dist/types/flow.d.ts.map +1 -0
- package/dist/types/flow.js +2 -0
- package/dist/types/flow.js.map +1 -0
- package/dist/types/graph-node.d.ts +42 -0
- package/dist/types/graph-node.d.ts.map +1 -0
- package/dist/types/graph-node.js +2 -0
- package/dist/types/graph-node.js.map +1 -0
- package/dist/types/grid-view.d.ts +27 -3
- package/dist/types/grid-view.d.ts.map +1 -1
- package/dist/types/grid-view.js.map +1 -1
- package/dist/types/layout.d.ts +2 -0
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/dist/types/time-grid.d.ts +9 -0
- package/dist/types/time-grid.d.ts.map +1 -1
- package/dist/types/time-grid.js.map +1 -1
- package/package.json +24 -6
- package/src/constants/authoring.ts +1 -0
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +65 -4
- package/src/features/calendar/adapters/inbound/Calendar.tsx +172 -22
- package/src/features/flow/adapters/inbound/FlowCanvas.tsx +501 -0
- package/src/features/flow/application/createFlowEditorController.test.ts +146 -0
- package/src/features/flow/application/createFlowEditorController.ts +99 -0
- package/src/features/flow/application/getFlowPortAnchor.test.ts +23 -0
- package/src/features/flow/application/getFlowPortAnchor.ts +30 -0
- package/src/features/flow/application/mapFlowViewport.test.ts +11 -0
- package/src/features/flow/application/mapFlowViewport.ts +29 -0
- package/src/features/flow/public.test.ts +7 -0
- package/src/features/flow/public.ts +13 -0
- package/src/features/graph-node/adapters/inbound/GraphNode.test.tsx +80 -0
- package/src/features/graph-node/adapters/inbound/GraphNode.tsx +259 -0
- package/src/features/graph-node/getGraphNodePortGeometry.test.ts +35 -0
- package/src/features/graph-node/getGraphNodePortGeometry.ts +41 -0
- package/src/features/graph-node/public.test.ts +7 -0
- package/src/features/graph-node/public.ts +2 -0
- package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +198 -7
- package/src/features/grid-view/adapters/inbound/GridView.tsx +248 -145
- package/src/features/grid-view/application/createGridScrollSync.test.ts +46 -17
- package/src/features/grid-view/application/createGridScrollSync.ts +100 -43
- package/src/features/grid-view/public.ts +6 -1
- package/src/features/layout/utils/createScrollGestureLock.ts +4 -0
- package/src/features/theme/application/use-cases/compileZoraTheme.test.ts +1 -1
- package/src/features/theme/node.ts +18 -0
- package/src/features/theme/public.ts +7 -0
- package/src/features/time-grid/adapters/inbound/TimeGrid.tsx +64 -21
- package/src/platformAcceptance.test.ts +15 -11
- package/src/types/color.ts +3 -3
- package/src/types/flow.ts +99 -0
- package/src/types/graph-node.ts +45 -0
- package/src/types/grid-view.ts +25 -3
- package/src/types/layout.ts +2 -0
- package/src/types/time-grid.ts +9 -0
- package/web-dist/chunks/{Accordion-9dq115tn.js → Accordion-064hgrct.js} +3 -3
- package/web-dist/chunks/{Accordion-wbf7gqrm.js → Accordion-2b3sd76b.js} +3 -3
- package/web-dist/chunks/{Accordion-k9n1yse4.js → Accordion-2kv6p7by.js} +10 -38
- package/web-dist/chunks/{Accordion-6gc0jw1n.js → Accordion-5x4cv0kv.js} +1 -1
- package/web-dist/chunks/{Accordion-r8swmfjm.js → Accordion-6d63tc7d.js} +1 -1
- package/web-dist/chunks/{Accordion-vbz1mjm6.js → Accordion-7eysykr1.js} +4 -4
- package/web-dist/chunks/{Accordion-q2yxtdzc.js → Accordion-95003ycq.js} +144 -27
- package/web-dist/chunks/{Accordion-hadw5304.js → Accordion-98886mbn.js} +1 -1
- package/web-dist/chunks/{Accordion-vtbs98r4.js → Accordion-a0hbjxg9.js} +4 -4
- package/web-dist/chunks/{Accordion-73p2mg3h.js → Accordion-a49s4ywn.js} +4 -4
- package/web-dist/chunks/{Accordion-tb0vc91c.js → Accordion-a8b6g53f.js} +4 -4
- package/web-dist/chunks/{Accordion-25v2vczc.js → Accordion-afxbyvwp.js} +3 -3
- package/web-dist/chunks/{Accordion-g5pvs1aa.js → Accordion-ajqj6ymg.js} +5 -5
- package/web-dist/chunks/{Accordion-w2kx944a.js → Accordion-ak6dvant.js} +3 -3
- package/web-dist/chunks/{Accordion-778fjjsh.js → Accordion-b1tqkxx6.js} +3 -3
- package/web-dist/chunks/{Accordion-rp9cjtpg.js → Accordion-bm30dkbw.js} +2 -2
- package/web-dist/chunks/{Accordion-rsw5jt7m.js → Accordion-cah5j61y.js} +2 -2
- package/web-dist/chunks/{Accordion-pr1tv6jx.js → Accordion-dfr26j8m.js} +1 -1
- package/web-dist/chunks/{Accordion-zmrbktd8.js → Accordion-dnfgtbq3.js} +8 -8
- package/web-dist/chunks/{Accordion-m3tq2vcc.js → Accordion-dy1j2a7p.js} +6 -6
- package/web-dist/chunks/{Accordion-7pgh8q4h.js → Accordion-e9jwetg7.js} +2 -2
- package/web-dist/chunks/{Accordion-gnkzvj03.js → Accordion-e9xmwxzp.js} +1 -1
- package/web-dist/chunks/{Accordion-q8ymmar7.js → Accordion-ek0hh2nx.js} +4 -4
- package/web-dist/chunks/{Accordion-2berhsg5.js → Accordion-et7xzm6k.js} +9 -9
- package/web-dist/chunks/Accordion-eysfka31.js +1590 -0
- package/web-dist/chunks/{Accordion-59x6e7bs.js → Accordion-gb3mfjmx.js} +43 -20
- package/web-dist/chunks/{Accordion-3xfqmr1r.js → Accordion-gy3bx3xa.js} +2 -2
- package/web-dist/chunks/{Accordion-tj4fe6wk.js → Accordion-h2rnzgyv.js} +3 -3
- package/web-dist/chunks/Accordion-hbwhya78.js +83 -0
- package/web-dist/chunks/{Accordion-t9w365ke.js → Accordion-hbwyj12m.js} +1 -1
- package/web-dist/chunks/Accordion-jkgd7dmf.js +1 -0
- package/web-dist/chunks/{Accordion-qwftammh.js → Accordion-kxjjp03t.js} +5 -5
- package/web-dist/chunks/Accordion-mkd3k28h.js +275 -0
- package/web-dist/chunks/{Accordion-xqkkfwkm.js → Accordion-nhf8zjt4.js} +2 -2
- package/web-dist/chunks/{Accordion-hg4db1sk.js → Accordion-p84h11ek.js} +4 -4
- package/web-dist/chunks/{Accordion-zhgty1ae.js → Accordion-pagdkp07.js} +3 -3
- package/web-dist/chunks/{Accordion-dv5c27w4.js → Accordion-pjbmmr20.js} +1 -1
- package/web-dist/chunks/{Accordion-7ayxbm7k.js → Accordion-pr4a281g.js} +1 -1
- package/web-dist/chunks/{Accordion-yca8r7kx.js → Accordion-qz6ddnmv.js} +3 -3
- package/web-dist/chunks/{Accordion-dcjzxzv3.js → Accordion-rv90tjqr.js} +2 -2
- package/web-dist/chunks/{Accordion-0zk0xp73.js → Accordion-snk6nggm.js} +326 -174
- package/web-dist/chunks/{Accordion-casb2ndy.js → Accordion-th7yhwhf.js} +5 -5
- package/web-dist/chunks/{Accordion-e6ettgh0.js → Accordion-vbh3xqv6.js} +2 -2
- package/web-dist/chunks/{Accordion-vdzyhtyd.js → Accordion-w4zh2nws.js} +8 -8
- package/web-dist/chunks/Accordion-w8zke8fa.js +37 -0
- package/web-dist/chunks/{Accordion-3e60xwvy.js → Accordion-wkqemqjw.js} +1 -1
- package/web-dist/chunks/{Accordion-vwqf8kn1.js → Accordion-x9sb23p3.js} +3 -3
- package/web-dist/chunks/{Accordion-xhkphta6.js → Accordion-y6sg47rv.js} +1 -1
- package/web-dist/chunks/{Accordion-mw8zh0vs.js → Accordion-yannd7r3.js} +4 -4
- package/web-dist/chunks/{Accordion-457amtv7.js → Accordion-z3m3wvfz.js} +6 -1580
- package/web-dist/chunks/{Accordion-pvcdvh3w.js → Accordion-zagrbkq1.js} +2 -2
- package/web-dist/chunks/{Accordion-2jcas7qq.js → Accordion-zays65re.js} +5 -5
- package/web-dist/chunks/{RichTextClient-w75r2x97.js → RichTextClient-qd6gmm0x.js} +12 -11
- package/web-dist/chunks/{Video.native-bb9g33nd.js → Video.native-7zsbp5vg.js} +7 -6
- package/web-dist/components/accordion/Accordion.js +6 -5
- package/web-dist/components/accordion-item/AccordionItem.js +6 -5
- package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
- package/web-dist/components/app-bar/AppBar.js +8 -7
- package/web-dist/components/app-header/AppHeader.js +8 -7
- package/web-dist/components/app-shell/AppShell.js +3 -2
- package/web-dist/components/audio/Audio.js +6 -5
- package/web-dist/components/auth-screen/AuthScreen.js +11 -10
- package/web-dist/components/avatar/Avatar.js +6 -5
- package/web-dist/components/avatar-group/AvatarGroup.js +6 -5
- package/web-dist/components/badge/Badge.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -10
- package/web-dist/components/bottom-sheet/BottomSheet.js +4 -3
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -3
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -3
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -3
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -3
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -3
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +6 -5
- package/web-dist/components/button/Button.js +4 -3
- package/web-dist/components/button-group/ButtonGroup.js +4 -3
- package/web-dist/components/calendar/Calendar.js +8 -7
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -10
- package/web-dist/components/card/Card.js +10 -9
- package/web-dist/components/card-back/CardBack.js +2 -2
- package/web-dist/components/card-hand/CardHand.js +2 -2
- package/web-dist/components/chat-list-item/ChatListItem.js +8 -7
- package/web-dist/components/checkbox/Checkbox.js +5 -4
- package/web-dist/components/checkbox-group/CheckboxGroup.js +5 -4
- package/web-dist/components/chess-board/ChessBoard.js +4 -3
- package/web-dist/components/chip/Chip.js +6 -5
- package/web-dist/components/chip-group/ChipGroup.js +6 -5
- package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
- package/web-dist/components/color-hue-scale/ColorHueScale.js +17 -15
- package/web-dist/components/color-picker/ColorPicker.js +17 -15
- package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +3 -3
- package/web-dist/components/color-tone/ColorTone.js +17 -15
- package/web-dist/components/color-tone/ColorTone.types-0.d.ts +3 -3
- package/web-dist/components/color-wheel/ColorWheel.js +17 -15
- package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +1 -1
- package/web-dist/components/content-rail/ContentRail.js +5 -4
- package/web-dist/components/data-table/DataTable.js +16 -15
- package/web-dist/components/date-picker/DatePicker.js +10 -9
- package/web-dist/components/dialog/Dialog.js +5 -4
- package/web-dist/components/divider/Divider.js +3 -2
- package/web-dist/components/empty-state/EmptyState.js +11 -10
- package/web-dist/components/explorer/Explorer.js +8 -7
- package/web-dist/components/field/Field.js +5 -4
- package/web-dist/components/file-explorer/FileExplorer.js +8 -7
- package/web-dist/components/flat-list/FlatList.js +6 -5
- package/web-dist/components/flow-canvas/FlowCanvas.d.ts +7 -0
- package/web-dist/components/flow-canvas/FlowCanvas.dependency-0.d.ts +27 -0
- package/web-dist/components/flow-canvas/FlowCanvas.dependency-1.d.ts +3 -0
- package/web-dist/components/flow-canvas/FlowCanvas.js +513 -0
- package/web-dist/components/flow-canvas/FlowCanvas.types-0.d.ts +92 -0
- package/web-dist/components/flow-canvas/index.d.ts +2 -0
- package/web-dist/components/flow-canvas/index.js +2 -0
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +11 -10
- package/web-dist/components/form/Form.js +7 -6
- package/web-dist/components/form-actions/FormActions.js +7 -6
- package/web-dist/components/form-error/FormError.js +7 -6
- package/web-dist/components/game/Game.js +4 -3
- package/web-dist/components/game-entity/GameEntity.js +4 -3
- package/web-dist/components/game-field/GameField.js +4 -3
- package/web-dist/components/game-input-zone/GameInputZone.js +4 -3
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -3
- package/web-dist/components/game-overlay/GameOverlay.js +4 -3
- package/web-dist/components/gradient/Gradient.js +4 -3
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -3
- package/web-dist/components/graph-node/GraphNode.d.ts +7 -0
- package/web-dist/components/graph-node/GraphNode.dependency-0.d.ts +27 -0
- package/web-dist/components/graph-node/GraphNode.dependency-1.d.ts +3 -0
- package/web-dist/components/graph-node/GraphNode.dependency-2.d.ts +5 -0
- package/web-dist/components/graph-node/GraphNode.js +20 -0
- package/web-dist/components/graph-node/GraphNode.types-0.d.ts +46 -0
- package/web-dist/components/graph-node/index.d.ts +2 -0
- package/web-dist/components/graph-node/index.js +2 -0
- package/web-dist/components/grid/Grid.js +3 -2
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
- package/web-dist/components/grid-ruler/GridRuler.js +2 -2
- package/web-dist/components/grid-view/GridView.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +2 -1
- package/web-dist/components/grid-view/GridView.types-0.d.ts +21 -0
- package/web-dist/components/heading/Heading.js +2 -2
- package/web-dist/components/hero/Hero.js +10 -9
- package/web-dist/components/icon/Icon.js +2 -2
- package/web-dist/components/icon-button/IconButton.js +4 -3
- package/web-dist/components/image/Image.js +5 -4
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
- package/web-dist/components/link/Link.js +2 -2
- package/web-dist/components/list/List.js +6 -5
- package/web-dist/components/list-item/ListItem.js +6 -5
- package/web-dist/components/list-section/ListSection.js +6 -5
- package/web-dist/components/master-detail/MasterDetail.js +3 -2
- package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
- package/web-dist/components/media-card/MediaCard.js +10 -9
- package/web-dist/components/media-explorer/MediaExplorer.js +8 -7
- package/web-dist/components/message-bubble/MessageBubble.js +8 -7
- package/web-dist/components/metric-card/MetricCard.js +10 -9
- package/web-dist/components/missing-element/MissingElement.js +5 -4
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +11 -10
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +11 -10
- package/web-dist/components/opening-book/OpeningBook.js +4 -3
- package/web-dist/components/otp-form/OtpForm.js +11 -10
- package/web-dist/components/pagination/Pagination.js +5 -4
- package/web-dist/components/palette-item/PaletteItem.js +10 -9
- package/web-dist/components/playing-card/PlayingCard.js +2 -2
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
- package/web-dist/components/popover/Popover.js +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.js +5 -4
- package/web-dist/components/post-card/PostCard.js +10 -9
- package/web-dist/components/product-card/ProductCard.js +10 -9
- package/web-dist/components/progress/Progress.js +5 -4
- package/web-dist/components/progress-ring/ProgressRing.js +5 -4
- package/web-dist/components/radio/Radio.js +6 -5
- package/web-dist/components/radio-group/RadioGroup.js +6 -5
- package/web-dist/components/rating/Rating.js +4 -3
- package/web-dist/components/reader/Reader.js +11 -10
- package/web-dist/components/rich-text/RichText.js +3 -3
- package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +4 -3
- package/web-dist/components/scan-overlay/ScanOverlay.js +11 -10
- package/web-dist/components/screen/Screen.js +3 -2
- package/web-dist/components/screen-section/ScreenSection.js +5 -4
- package/web-dist/components/scroll-view/ScrollView.js +3 -2
- package/web-dist/components/search-input/SearchInput.js +6 -5
- package/web-dist/components/section-header/SectionHeader.js +5 -4
- package/web-dist/components/section-list/SectionList.js +6 -5
- package/web-dist/components/select/Select.js +11 -10
- package/web-dist/components/selectable-item/SelectableItem.js +4 -3
- package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
- package/web-dist/components/sign-in-form/SignInForm.js +11 -10
- package/web-dist/components/sign-up-form/SignUpForm.js +11 -10
- package/web-dist/components/skeleton/Skeleton.js +13 -12
- package/web-dist/components/skeleton-card/SkeletonCard.js +13 -12
- package/web-dist/components/skeleton-list/SkeletonList.js +13 -12
- package/web-dist/components/skeleton-text/SkeletonText.js +13 -12
- package/web-dist/components/spatial-grid/SpatialGrid.js +2 -1
- package/web-dist/components/surface/Surface.js +2 -2
- package/web-dist/components/switch/Switch.js +1 -1
- package/web-dist/components/tab/Tab.js +2 -2
- package/web-dist/components/tab-list/TabList.js +2 -2
- package/web-dist/components/tab-panel/TabPanel.js +2 -2
- package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
- package/web-dist/components/tabs/Tabs.js +2 -2
- package/web-dist/components/text/Text.js +2 -2
- package/web-dist/components/text-input/TextInput.js +5 -4
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
- package/web-dist/components/tile-grid/TileGrid.js +2 -1
- package/web-dist/components/time-grid/TimeGrid.d.ts +1 -1
- package/web-dist/components/time-grid/TimeGrid.dependency-2.d.ts +13 -0
- package/web-dist/components/time-grid/TimeGrid.js +3 -2
- package/web-dist/components/time-grid/TimeGrid.types-0.d.ts +10 -0
- package/web-dist/components/time-picker/TimePicker.js +7 -6
- package/web-dist/components/timeline/Timeline.js +6 -5
- package/web-dist/components/toast/Toast.js +2 -2
- package/web-dist/components/toast-provider/ToastProvider.js +2 -2
- package/web-dist/components/toolbar/Toolbar.js +11 -10
- package/web-dist/components/tree-item/TreeItem.js +9 -8
- package/web-dist/components/uploader/Uploader.js +13 -12
- package/web-dist/components/video/Video.js +7 -6
- package/web-dist/components/view/View.js +3 -2
- package/web-dist/components/zora-provider/ZoraProvider.d.ts +7 -0
- package/web-dist/components/zora-provider/ZoraProvider.dependency-0.d.ts +15 -0
- package/web-dist/components/zora-provider/ZoraProvider.js +11 -0
- package/web-dist/components/zora-provider/ZoraProvider.types-0.d.ts +19 -0
- package/web-dist/components/zora-provider/index.d.ts +2 -0
- package/web-dist/components/zora-provider/index.js +2 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.d.ts +14 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.js +11 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.types-0.d.ts +3 -0
- package/web-dist/components/zora-theme-scope/index.d.ts +2 -0
- package/web-dist/components/zora-theme-scope/index.js +2 -0
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -2
- package/web-dist/manifest.json +1059 -832
- package/web-dist/runtime/ZoraProvider.js +4 -80
|
@@ -1,48 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
converter_default,
|
|
4
|
-
formatHex,
|
|
5
|
-
normalizeHueDegrees,
|
|
6
|
-
parseHexToOklch,
|
|
7
|
-
oklchToHex,
|
|
8
|
-
deltaEoklch
|
|
9
|
-
} from "./Accordion-cwx73cjc.js";
|
|
10
|
-
import {
|
|
11
|
-
withZoraThemeScope
|
|
12
|
-
} from "./Accordion-zhgty1ae.js";
|
|
13
|
-
import {
|
|
14
|
-
View2,
|
|
15
|
-
Divider2
|
|
16
|
-
} from "./Accordion-k9n1yse4.js";
|
|
17
|
-
import {
|
|
18
|
-
useZoraTheme2
|
|
19
|
-
} from "./Accordion-x1ze1wvk.js";
|
|
20
|
-
import {
|
|
21
|
-
Heading2,
|
|
22
|
-
Text2
|
|
23
|
-
} from "./Accordion-6gc0jw1n.js";
|
|
24
|
-
import {
|
|
25
|
-
IconButton2
|
|
26
|
-
} from "./Accordion-e6ettgh0.js";
|
|
27
|
-
import {
|
|
28
|
-
Card2
|
|
29
|
-
} from "./Accordion-zmrbktd8.js";
|
|
30
|
-
import {
|
|
31
|
-
Icon2
|
|
32
|
-
} from "./Accordion-t9w365ke.js";
|
|
33
|
-
import {
|
|
34
|
-
Select2
|
|
35
|
-
} from "./Accordion-vdzyhtyd.js";
|
|
36
|
-
import {
|
|
37
|
-
Gradient2
|
|
38
|
-
} from "./Accordion-pvcdvh3w.js";
|
|
39
2
|
import {
|
|
40
3
|
require_registry
|
|
41
4
|
} from "./Accordion-2ej7s27r.js";
|
|
42
|
-
import {
|
|
43
|
-
isHexColor,
|
|
44
|
-
parseHexColorOrThrow
|
|
45
|
-
} from "./Accordion-fsdgssfq.js";
|
|
46
5
|
import {
|
|
47
6
|
__toESM,
|
|
48
7
|
__commonJS
|
|
@@ -2620,320 +2579,8 @@ var require_transformToRn = __commonJS(function(exports, module) {
|
|
|
2620
2579
|
};
|
|
2621
2580
|
});
|
|
2622
2581
|
|
|
2623
|
-
// node_modules/@ankhorage/color-theory/dist/harmony.js
|
|
2624
|
-
var COLOR_HARMONY_CATALOG = [
|
|
2625
|
-
{
|
|
2626
|
-
id: "monochromatic",
|
|
2627
|
-
label: "Monochromatic",
|
|
2628
|
-
description: "Uses one hue with ramp variation.",
|
|
2629
|
-
offsets: [0],
|
|
2630
|
-
roles: ["primary"],
|
|
2631
|
-
roleCount: 1
|
|
2632
|
-
},
|
|
2633
|
-
{
|
|
2634
|
-
id: "analogous",
|
|
2635
|
-
label: "Analogous",
|
|
2636
|
-
description: "Uses the primary hue and its two neighboring hues at minus and plus 30 degrees.",
|
|
2637
|
-
offsets: [0, -30, 30],
|
|
2638
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
2639
|
-
roleCount: 3
|
|
2640
|
-
},
|
|
2641
|
-
{
|
|
2642
|
-
id: "complementary",
|
|
2643
|
-
label: "Complementary",
|
|
2644
|
-
description: "Pairs the primary hue with its opposite hue at 180 degrees.",
|
|
2645
|
-
offsets: [0, 180],
|
|
2646
|
-
roles: ["primary", "secondary"],
|
|
2647
|
-
roleCount: 2
|
|
2648
|
-
},
|
|
2649
|
-
{
|
|
2650
|
-
id: "splitComplementary",
|
|
2651
|
-
label: "Split complementary",
|
|
2652
|
-
description: "Uses the primary hue with hues at 150 and 210 degrees.",
|
|
2653
|
-
offsets: [0, 150, 210],
|
|
2654
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
2655
|
-
roleCount: 3
|
|
2656
|
-
},
|
|
2657
|
-
{
|
|
2658
|
-
id: "triadic",
|
|
2659
|
-
label: "Triadic",
|
|
2660
|
-
description: "Uses three evenly spaced hues at 120-degree intervals.",
|
|
2661
|
-
offsets: [0, 120, 240],
|
|
2662
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
2663
|
-
roleCount: 3
|
|
2664
|
-
},
|
|
2665
|
-
{
|
|
2666
|
-
id: "tetradic",
|
|
2667
|
-
label: "Tetradic",
|
|
2668
|
-
description: "Uses a rectangular tetrad at 0, 60, 180, and 240 degrees.",
|
|
2669
|
-
offsets: [0, 60, 180, 240],
|
|
2670
|
-
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
2671
|
-
roleCount: 4
|
|
2672
|
-
},
|
|
2673
|
-
{
|
|
2674
|
-
id: "square",
|
|
2675
|
-
label: "Square",
|
|
2676
|
-
description: "Uses four evenly spaced hues at 90-degree intervals.",
|
|
2677
|
-
offsets: [0, 90, 180, 270],
|
|
2678
|
-
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
2679
|
-
roleCount: 4
|
|
2680
|
-
}
|
|
2681
|
-
];
|
|
2682
|
-
var COLOR_HARMONIES = COLOR_HARMONY_CATALOG.map(({ id }) => id);
|
|
2683
|
-
var MIN_HUEFUL_CHROMA = 0.015;
|
|
2684
|
-
function createHarmonyGenerationDiagnostics(primaryChroma) {
|
|
2685
|
-
const warnings = [];
|
|
2686
|
-
if (primaryChroma === 0) {
|
|
2687
|
-
warnings.push({
|
|
2688
|
-
code: "achromatic_primary",
|
|
2689
|
-
message: "The selected primary is achromatic, so generated hue relationships are not visible."
|
|
2690
|
-
});
|
|
2691
|
-
} else if (primaryChroma < MIN_HUEFUL_CHROMA) {
|
|
2692
|
-
warnings.push({
|
|
2693
|
-
code: "low_chroma_primary",
|
|
2694
|
-
message: "The selected primary has low chroma, so generated hue relationships may be weak."
|
|
2695
|
-
});
|
|
2696
|
-
}
|
|
2697
|
-
return {
|
|
2698
|
-
isHueReliable: primaryChroma >= MIN_HUEFUL_CHROMA,
|
|
2699
|
-
primaryChroma,
|
|
2700
|
-
warnings
|
|
2701
|
-
};
|
|
2702
|
-
}
|
|
2703
|
-
function getHarmonyDefinition(harmony) {
|
|
2704
|
-
const definition = COLOR_HARMONY_CATALOG.find(({ id }) => id === harmony);
|
|
2705
|
-
if (!definition) {
|
|
2706
|
-
throw new Error(`[color-theory] Missing definition for harmony ${harmony}.`);
|
|
2707
|
-
}
|
|
2708
|
-
return definition;
|
|
2709
|
-
}
|
|
2710
|
-
function generateHarmonyRoleColors(primaryColor, harmony) {
|
|
2711
|
-
const base = parseHexToOklch(primaryColor);
|
|
2712
|
-
const definition = getHarmonyDefinition(harmony);
|
|
2713
|
-
const baseHue = normalizeHueDegrees(base.h);
|
|
2714
|
-
const colors = definition.roles.map((role, index) => {
|
|
2715
|
-
const hueDegrees = normalizeHueDegrees(baseHue + (definition.offsets.at(index) ?? 0));
|
|
2716
|
-
return {
|
|
2717
|
-
role,
|
|
2718
|
-
hex: role === "primary" ? primaryColor : oklchToHex({ ...base, h: hueDegrees }),
|
|
2719
|
-
hueDegrees,
|
|
2720
|
-
source: role === "primary" ? "selected" : "generated"
|
|
2721
|
-
};
|
|
2722
|
-
});
|
|
2723
|
-
const primary = colors.find((color) => color.role === "primary");
|
|
2724
|
-
if (!primary) {
|
|
2725
|
-
throw new Error("[color-theory] Expected generated harmony role colors to include primary.");
|
|
2726
|
-
}
|
|
2727
|
-
const secondary = colors.find((color) => color.role === "secondary");
|
|
2728
|
-
const tertiary = colors.find((color) => color.role === "tertiary");
|
|
2729
|
-
const quaternary = colors.find((color) => color.role === "quaternary");
|
|
2730
|
-
return {
|
|
2731
|
-
harmony,
|
|
2732
|
-
colors,
|
|
2733
|
-
primary,
|
|
2734
|
-
...secondary ? { secondary } : {},
|
|
2735
|
-
...tertiary ? { tertiary } : {},
|
|
2736
|
-
...quaternary ? { quaternary } : {},
|
|
2737
|
-
diagnostics: createHarmonyGenerationDiagnostics(base.c)
|
|
2738
|
-
};
|
|
2739
|
-
}
|
|
2740
|
-
|
|
2741
|
-
// node_modules/@ankhorage/color-theory/dist/swatches.js
|
|
2742
|
-
var COLOR_SWATCH_STEPS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
2743
|
-
var COLOR_SWATCH_BASE_STEP = 500;
|
|
2744
|
-
var COLOR_SWATCH_BASE_LIGHTNESS = 0.551;
|
|
2745
|
-
var BASELINE_LIGHTNESS_BY_STEP = new Map([
|
|
2746
|
-
[50, 0.985],
|
|
2747
|
-
[100, 0.967],
|
|
2748
|
-
[200, 0.928],
|
|
2749
|
-
[300, 0.872],
|
|
2750
|
-
[400, 0.707],
|
|
2751
|
-
[COLOR_SWATCH_BASE_STEP, COLOR_SWATCH_BASE_LIGHTNESS],
|
|
2752
|
-
[600, 0.446],
|
|
2753
|
-
[700, 0.373],
|
|
2754
|
-
[800, 0.278],
|
|
2755
|
-
[900, 0.21],
|
|
2756
|
-
[950, 0.13]
|
|
2757
|
-
]);
|
|
2758
|
-
var MIN_USABLE_ADJACENT_DELTA = 0.012;
|
|
2759
|
-
var MIN_USABLE_LIGHTNESS_RANGE = 0.35;
|
|
2760
|
-
function clamp01(value) {
|
|
2761
|
-
if (!Number.isFinite(value))
|
|
2762
|
-
return 0;
|
|
2763
|
-
return Math.min(1, Math.max(0, value));
|
|
2764
|
-
}
|
|
2765
|
-
function chromaMultiplierForStep(step) {
|
|
2766
|
-
if (step <= 200)
|
|
2767
|
-
return 0.55;
|
|
2768
|
-
if (step <= 400)
|
|
2769
|
-
return 0.75;
|
|
2770
|
-
if (step === COLOR_SWATCH_BASE_STEP)
|
|
2771
|
-
return 1;
|
|
2772
|
-
if (step <= 700)
|
|
2773
|
-
return 0.9;
|
|
2774
|
-
return 0.8;
|
|
2775
|
-
}
|
|
2776
|
-
function getBaselineLightness(step) {
|
|
2777
|
-
const lightness = BASELINE_LIGHTNESS_BY_STEP.get(step);
|
|
2778
|
-
if (lightness === undefined) {
|
|
2779
|
-
throw new Error(`[color-theory] Missing baseline lightness for swatch step ${step}.`);
|
|
2780
|
-
}
|
|
2781
|
-
return lightness;
|
|
2782
|
-
}
|
|
2783
|
-
function createSwatchSample(baseColor, step, baseOffset) {
|
|
2784
|
-
const base = parseHexToOklch(baseColor);
|
|
2785
|
-
if (step === COLOR_SWATCH_BASE_STEP) {
|
|
2786
|
-
return { hex: baseColor, lightness: base.l, step };
|
|
2787
|
-
}
|
|
2788
|
-
const target = {
|
|
2789
|
-
...base,
|
|
2790
|
-
l: clamp01(getBaselineLightness(step) + baseOffset),
|
|
2791
|
-
c: clamp01(base.c * chromaMultiplierForStep(step))
|
|
2792
|
-
};
|
|
2793
|
-
const hex = oklchToHex(target);
|
|
2794
|
-
return { hex, lightness: parseHexToOklch(hex).l, step };
|
|
2795
|
-
}
|
|
2796
|
-
function createWeakStepWarning(baseColor, sample) {
|
|
2797
|
-
if (sample.step === COLOR_SWATCH_BASE_STEP)
|
|
2798
|
-
return;
|
|
2799
|
-
const deltaEFromBase = deltaEoklch(parseHexToOklch(baseColor), parseHexToOklch(sample.hex));
|
|
2800
|
-
if (deltaEFromBase >= 0.02)
|
|
2801
|
-
return;
|
|
2802
|
-
return {
|
|
2803
|
-
code: "weak_step",
|
|
2804
|
-
step: sample.step,
|
|
2805
|
-
deltaEFromBase,
|
|
2806
|
-
message: `Swatch step ${sample.step} is visually close to the base color.`
|
|
2807
|
-
};
|
|
2808
|
-
}
|
|
2809
|
-
function generateSwatchSamples(baseColor) {
|
|
2810
|
-
const baseOffset = parseHexToOklch(baseColor).l - COLOR_SWATCH_BASE_LIGHTNESS;
|
|
2811
|
-
const samples = COLOR_SWATCH_STEPS.map((step) => createSwatchSample(baseColor, step, baseOffset));
|
|
2812
|
-
const warnings = samples.map((sample) => createWeakStepWarning(baseColor, sample)).filter((warning) => warning !== undefined);
|
|
2813
|
-
return { samples, warnings };
|
|
2814
|
-
}
|
|
2815
|
-
function measureAdjacentSamples(samples) {
|
|
2816
|
-
const pairs = samples.slice(1).map((current, index) => ({ current, previous: samples.at(index) }));
|
|
2817
|
-
const measured = pairs.flatMap(({ current, previous }) => {
|
|
2818
|
-
if (!previous)
|
|
2819
|
-
return [];
|
|
2820
|
-
const delta = deltaEoklch(parseHexToOklch(previous.hex), parseHexToOklch(current.hex));
|
|
2821
|
-
const warning = delta < MIN_USABLE_ADJACENT_DELTA ? {
|
|
2822
|
-
code: "weak_adjacent_delta",
|
|
2823
|
-
step: current.step,
|
|
2824
|
-
deltaEFromBase: delta,
|
|
2825
|
-
message: `Swatch step ${current.step} is visually close to adjacent step ${previous.step}.`
|
|
2826
|
-
} : undefined;
|
|
2827
|
-
return [{ delta, warning }];
|
|
2828
|
-
});
|
|
2829
|
-
return {
|
|
2830
|
-
deltas: measured.map(({ delta }) => delta),
|
|
2831
|
-
warnings: measured.map(({ warning }) => warning).filter((warning) => warning !== undefined)
|
|
2832
|
-
};
|
|
2833
|
-
}
|
|
2834
|
-
function createSwatchDiagnostics(samples, adjacentDeltas, warnings) {
|
|
2835
|
-
const minAdjacentDelta = Math.min(...adjacentDeltas);
|
|
2836
|
-
const maxAdjacentDelta = Math.max(...adjacentDeltas);
|
|
2837
|
-
const lightnessEntries = samples.map(({ lightness }) => lightness);
|
|
2838
|
-
const minLightness = Math.min(...lightnessEntries);
|
|
2839
|
-
const maxLightness = Math.max(...lightnessEntries);
|
|
2840
|
-
const lightnessRange = maxLightness - minLightness;
|
|
2841
|
-
const rangeWarnings = lightnessRange < MIN_USABLE_LIGHTNESS_RANGE ? [
|
|
2842
|
-
{
|
|
2843
|
-
code: "limited_lightness_range",
|
|
2844
|
-
message: "Generated swatch has a limited lightness range."
|
|
2845
|
-
}
|
|
2846
|
-
] : [];
|
|
2847
|
-
return {
|
|
2848
|
-
isUsable: minAdjacentDelta >= MIN_USABLE_ADJACENT_DELTA && lightnessRange >= MIN_USABLE_LIGHTNESS_RANGE,
|
|
2849
|
-
warnings: [...warnings, ...rangeWarnings],
|
|
2850
|
-
minAdjacentDelta,
|
|
2851
|
-
maxAdjacentDelta,
|
|
2852
|
-
lightnessRange: { min: minLightness, max: maxLightness }
|
|
2853
|
-
};
|
|
2854
|
-
}
|
|
2855
|
-
function generateColorSwatch(baseColor) {
|
|
2856
|
-
const generated = generateSwatchSamples(baseColor);
|
|
2857
|
-
const adjacent = measureAdjacentSamples(generated.samples);
|
|
2858
|
-
const swatch = Object.fromEntries(generated.samples.map(({ hex, step }) => [step, hex]));
|
|
2859
|
-
return {
|
|
2860
|
-
swatch,
|
|
2861
|
-
diagnostics: createSwatchDiagnostics(generated.samples, adjacent.deltas, [
|
|
2862
|
-
...generated.warnings,
|
|
2863
|
-
...adjacent.warnings
|
|
2864
|
-
])
|
|
2865
|
-
};
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
|
-
// src/features/color/ColorHueScale.tsx
|
|
2869
|
-
import { Pressable } from "@ankhorage/surface/web";
|
|
2870
|
-
|
|
2871
|
-
// src/features/color/ColorHexField.tsx
|
|
2872
|
-
import { useClipboardWriter, writeClipboardTextAsync } from "@ankhorage/runtime";
|
|
2873
|
-
import { TextInput } from "@ankhorage/surface/web";
|
|
2874
|
-
import React from "react";
|
|
2875
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2876
|
-
function ColorHexField({
|
|
2877
|
-
disabled,
|
|
2878
|
-
onChange,
|
|
2879
|
-
value
|
|
2880
|
-
}) {
|
|
2881
|
-
const [input, setInput] = React.useState(value);
|
|
2882
|
-
const [previousValue, setPreviousValue] = React.useState(value);
|
|
2883
|
-
const [copyFeedback, setCopyFeedback] = React.useState();
|
|
2884
|
-
const clipboardWriter = useClipboardWriter();
|
|
2885
|
-
const { theme } = useZoraTheme2();
|
|
2886
|
-
if (value !== previousValue) {
|
|
2887
|
-
setPreviousValue(value);
|
|
2888
|
-
setInput(value);
|
|
2889
|
-
}
|
|
2890
|
-
return /* @__PURE__ */ jsxs(View2, {
|
|
2891
|
-
children: [
|
|
2892
|
-
/* @__PURE__ */ jsx(TextInput, {
|
|
2893
|
-
accessibilityLabel: "Color hex value",
|
|
2894
|
-
disabled,
|
|
2895
|
-
leadingAccessory: /* @__PURE__ */ jsx(View2, {
|
|
2896
|
-
bg: value,
|
|
2897
|
-
borderColor: theme.semantics.border.default,
|
|
2898
|
-
borderWidth: 1,
|
|
2899
|
-
height: 30,
|
|
2900
|
-
radius: "s",
|
|
2901
|
-
width: 30
|
|
2902
|
-
}),
|
|
2903
|
-
onChangeText: (nextValue) => {
|
|
2904
|
-
setInput(nextValue);
|
|
2905
|
-
if (isHexColor(nextValue))
|
|
2906
|
-
onChange(nextValue);
|
|
2907
|
-
},
|
|
2908
|
-
trailingAccessory: /* @__PURE__ */ jsx(IconButton2, {
|
|
2909
|
-
iconName: copyFeedback === "Color hex copied." ? "checkmark" : copyFeedback ? "warning" : "copy-outline",
|
|
2910
|
-
label: copyFeedback ?? "Copy color hex value",
|
|
2911
|
-
disabled,
|
|
2912
|
-
onPress: () => {
|
|
2913
|
-
writeClipboardTextAsync(clipboardWriter, value).then((result) => {
|
|
2914
|
-
setCopyFeedback(result === "written" ? "Color hex copied." : result === "denied" ? "Clipboard access was denied." : "Clipboard is unavailable.");
|
|
2915
|
-
});
|
|
2916
|
-
},
|
|
2917
|
-
variant: "ghost"
|
|
2918
|
-
}),
|
|
2919
|
-
value: input
|
|
2920
|
-
}),
|
|
2921
|
-
copyFeedback ? /* @__PURE__ */ jsx(Text2, {
|
|
2922
|
-
accessibilityLiveRegion: "polite",
|
|
2923
|
-
emphasis: "muted",
|
|
2924
|
-
style: { position: "absolute", opacity: 0 },
|
|
2925
|
-
variant: "caption",
|
|
2926
|
-
children: copyFeedback
|
|
2927
|
-
}) : null
|
|
2928
|
-
]
|
|
2929
|
-
});
|
|
2930
|
-
}
|
|
2931
|
-
|
|
2932
|
-
// src/features/color/ColorSpectrumSlider.tsx
|
|
2933
|
-
import React5 from "react";
|
|
2934
|
-
|
|
2935
2582
|
// node_modules/react-native-svg/lib/module/xml.js
|
|
2936
|
-
import * as
|
|
2583
|
+
import * as React2 from "react";
|
|
2937
2584
|
import { Component, useEffect, useMemo, useState } from "react";
|
|
2938
2585
|
|
|
2939
2586
|
// node_modules/react-native-svg/lib/module/utils/fetchData.js
|
|
@@ -2985,7 +2632,7 @@ var getAttributeName = (attr) => {
|
|
|
2985
2632
|
};
|
|
2986
2633
|
|
|
2987
2634
|
// node_modules/react-native-svg/lib/module/web/WebShape.js
|
|
2988
|
-
import
|
|
2635
|
+
import React from "react";
|
|
2989
2636
|
import {
|
|
2990
2637
|
unstable_createElement as createElement
|
|
2991
2638
|
} from "react-native-web";
|
|
@@ -3374,11 +3021,11 @@ var SvgTouchableMixin_default = (target) => {
|
|
|
3374
3021
|
};
|
|
3375
3022
|
|
|
3376
3023
|
// node_modules/react-native-svg/lib/module/web/WebShape.js
|
|
3377
|
-
class WebShape extends
|
|
3024
|
+
class WebShape extends React.Component {
|
|
3378
3025
|
prepareProps(props) {
|
|
3379
3026
|
return props;
|
|
3380
3027
|
}
|
|
3381
|
-
elementRef = /* @__PURE__ */
|
|
3028
|
+
elementRef = /* @__PURE__ */ React.createRef();
|
|
3382
3029
|
lastMergedProps = {};
|
|
3383
3030
|
setNativeProps(props) {
|
|
3384
3031
|
const merged = Object.assign({}, this.props, this.lastMergedProps, props.style);
|
|
@@ -3491,1231 +3138,10 @@ class Svg extends WebShape {
|
|
|
3491
3138
|
img.src = `data:image/svg+xml;utf8,${encodeSvg(new window.XMLSerializer().serializeToString(svg))}`;
|
|
3492
3139
|
}
|
|
3493
3140
|
}
|
|
3141
|
+
var elements_web_default = Svg;
|
|
3494
3142
|
|
|
3495
3143
|
// node_modules/react-native-svg/lib/module/xml.js
|
|
3496
3144
|
var err = console.error.bind(console);
|
|
3497
3145
|
// node_modules/react-native-svg/lib/module/index.js
|
|
3498
3146
|
|
|
3499
|
-
|
|
3500
|
-
import React4 from "react";
|
|
3501
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3502
|
-
function ColorHorizontalPointerProxy({
|
|
3503
|
-
children,
|
|
3504
|
-
disabled,
|
|
3505
|
-
onChange,
|
|
3506
|
-
width
|
|
3507
|
-
}) {
|
|
3508
|
-
const dragging = React4.useRef(false);
|
|
3509
|
-
const changeAt = (event) => {
|
|
3510
|
-
const target = event.currentTarget;
|
|
3511
|
-
const rect = target.getBoundingClientRect();
|
|
3512
|
-
onChange((event.clientX - rect.left) / rect.width * width);
|
|
3513
|
-
};
|
|
3514
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
3515
|
-
onMouseDown: (event) => {
|
|
3516
|
-
if (disabled)
|
|
3517
|
-
return;
|
|
3518
|
-
dragging.current = true;
|
|
3519
|
-
changeAt(event);
|
|
3520
|
-
},
|
|
3521
|
-
onMouseMove: (event) => {
|
|
3522
|
-
if (!disabled && dragging.current)
|
|
3523
|
-
changeAt(event);
|
|
3524
|
-
},
|
|
3525
|
-
onMouseUp: (event) => {
|
|
3526
|
-
if (!disabled && dragging.current)
|
|
3527
|
-
changeAt(event);
|
|
3528
|
-
dragging.current = false;
|
|
3529
|
-
},
|
|
3530
|
-
style: { touchAction: "none" },
|
|
3531
|
-
children
|
|
3532
|
-
});
|
|
3533
|
-
}
|
|
3534
|
-
// src/features/color/utils/resolveOklchColor.ts
|
|
3535
|
-
function resolveOklchColor(target, hue) {
|
|
3536
|
-
const formatted = formatHex({ mode: "oklch", l: target.lightness, c: target.chroma, h: hue });
|
|
3537
|
-
if (!formatted)
|
|
3538
|
-
throw new Error("The supplied OKLCH target cannot be represented as a hex color.");
|
|
3539
|
-
return parseHexColorOrThrow(formatted);
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
// src/features/color/ColorSpectrumSlider.tsx
|
|
3543
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3544
|
-
var SPECTRUM_WIDTH = 280;
|
|
3545
|
-
var SPECTRUM_HUES = [0, 60, 120, 180, 240, 300, 360];
|
|
3546
|
-
function ColorSpectrumSlider({
|
|
3547
|
-
disabled,
|
|
3548
|
-
hue,
|
|
3549
|
-
label = "Hue",
|
|
3550
|
-
onChange
|
|
3551
|
-
}) {
|
|
3552
|
-
const { theme } = useZoraTheme2();
|
|
3553
|
-
const [trackWidth, setTrackWidth] = React5.useState(SPECTRUM_WIDTH);
|
|
3554
|
-
const gradientId = `color-spectrum-${React5.useId().replaceAll(":", "")}`;
|
|
3555
|
-
const changeAt = (locationX) => {
|
|
3556
|
-
if (!disabled)
|
|
3557
|
-
onChange(Math.max(0, Math.min(360, locationX / trackWidth * 360)));
|
|
3558
|
-
};
|
|
3559
|
-
return /* @__PURE__ */ jsxs2(View2, {
|
|
3560
|
-
gap: "xxs",
|
|
3561
|
-
width: "100%",
|
|
3562
|
-
children: [
|
|
3563
|
-
/* @__PURE__ */ jsxs2(View2, {
|
|
3564
|
-
direction: "row",
|
|
3565
|
-
justify: "space-between",
|
|
3566
|
-
children: [
|
|
3567
|
-
/* @__PURE__ */ jsx3(Text2, {
|
|
3568
|
-
variant: "label",
|
|
3569
|
-
children: label
|
|
3570
|
-
}),
|
|
3571
|
-
/* @__PURE__ */ jsx3(Text2, {
|
|
3572
|
-
variant: "label",
|
|
3573
|
-
children: `${Math.round(hue)}°`
|
|
3574
|
-
})
|
|
3575
|
-
]
|
|
3576
|
-
}),
|
|
3577
|
-
/* @__PURE__ */ jsx3(ColorHorizontalPointerProxy, {
|
|
3578
|
-
disabled,
|
|
3579
|
-
onChange: changeAt,
|
|
3580
|
-
width: SPECTRUM_WIDTH,
|
|
3581
|
-
children: /* @__PURE__ */ jsxs2(Svg, {
|
|
3582
|
-
accessibilityLabel: `${label} spectrum`,
|
|
3583
|
-
height: 36,
|
|
3584
|
-
onLayout: (event) => setTrackWidth(Math.max(1, event.nativeEvent.layout.width)),
|
|
3585
|
-
viewBox: `0 0 ${SPECTRUM_WIDTH} 36`,
|
|
3586
|
-
width: "100%",
|
|
3587
|
-
children: [
|
|
3588
|
-
/* @__PURE__ */ jsx3(Defs, {
|
|
3589
|
-
children: /* @__PURE__ */ jsx3(LinearGradient, {
|
|
3590
|
-
id: gradientId,
|
|
3591
|
-
x1: "0",
|
|
3592
|
-
x2: "1",
|
|
3593
|
-
y1: "0",
|
|
3594
|
-
y2: "0",
|
|
3595
|
-
children: SPECTRUM_HUES.map((stopHue, index) => /* @__PURE__ */ jsx3(Stop, {
|
|
3596
|
-
offset: String(index / (SPECTRUM_HUES.length - 1)),
|
|
3597
|
-
stopColor: resolveOklchColor({ lightness: 0.65, chroma: 0.2 }, stopHue)
|
|
3598
|
-
}, stopHue))
|
|
3599
|
-
})
|
|
3600
|
-
}),
|
|
3601
|
-
/* @__PURE__ */ jsx3(Rect, {
|
|
3602
|
-
fill: `url(#${gradientId})`,
|
|
3603
|
-
height: 12,
|
|
3604
|
-
rx: 6,
|
|
3605
|
-
width: SPECTRUM_WIDTH,
|
|
3606
|
-
y: 12
|
|
3607
|
-
}),
|
|
3608
|
-
/* @__PURE__ */ jsx3(Circle, {
|
|
3609
|
-
cx: hue / 360 * SPECTRUM_WIDTH,
|
|
3610
|
-
cy: 18,
|
|
3611
|
-
fill: "white",
|
|
3612
|
-
r: 10,
|
|
3613
|
-
stroke: theme.semantics.content.default,
|
|
3614
|
-
strokeWidth: 2
|
|
3615
|
-
}),
|
|
3616
|
-
/* @__PURE__ */ jsx3(Rect, {
|
|
3617
|
-
fill: "transparent",
|
|
3618
|
-
height: 36,
|
|
3619
|
-
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX),
|
|
3620
|
-
onResponderMove: (event) => changeAt(event.nativeEvent.locationX),
|
|
3621
|
-
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX),
|
|
3622
|
-
onStartShouldSetResponder: () => !disabled,
|
|
3623
|
-
width: SPECTRUM_WIDTH
|
|
3624
|
-
})
|
|
3625
|
-
]
|
|
3626
|
-
})
|
|
3627
|
-
})
|
|
3628
|
-
]
|
|
3629
|
-
});
|
|
3630
|
-
}
|
|
3631
|
-
|
|
3632
|
-
// src/features/color/utils/resolveColorAtHue.ts
|
|
3633
|
-
var toOklch = converter_default("oklch");
|
|
3634
|
-
function resolveColorAtHue(color, hue) {
|
|
3635
|
-
const parsed = toOklch(color);
|
|
3636
|
-
if (!parsed || typeof parsed.l !== "number" || typeof parsed.c !== "number")
|
|
3637
|
-
return color;
|
|
3638
|
-
const formatted = formatHex({ mode: "oklch", l: parsed.l, c: parsed.c, h: hue });
|
|
3639
|
-
return formatted ? parseHexColorOrThrow(formatted) : color;
|
|
3640
|
-
}
|
|
3641
|
-
|
|
3642
|
-
// src/features/color/utils/resolveColorHue.ts
|
|
3643
|
-
var toOklch2 = converter_default("oklch");
|
|
3644
|
-
function resolveColorHue(color) {
|
|
3645
|
-
const parsed = toOklch2(color);
|
|
3646
|
-
return typeof parsed?.h === "number" ? parsed.h : 0;
|
|
3647
|
-
}
|
|
3648
|
-
|
|
3649
|
-
// src/features/color/ColorHueScale.tsx
|
|
3650
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3651
|
-
var ColorHueScale2 = withZoraThemeScope(ColorHueScaleInner);
|
|
3652
|
-
function ColorHueScaleInner({
|
|
3653
|
-
themeId: _themeId,
|
|
3654
|
-
mode: _mode,
|
|
3655
|
-
inverted: _inverted,
|
|
3656
|
-
interactionPolicy,
|
|
3657
|
-
value,
|
|
3658
|
-
onChange,
|
|
3659
|
-
testID
|
|
3660
|
-
}) {
|
|
3661
|
-
const { theme } = useZoraTheme2();
|
|
3662
|
-
const { swatch } = generateColorSwatch(value);
|
|
3663
|
-
const swatches = Object.entries(swatch);
|
|
3664
|
-
return /* @__PURE__ */ jsxs3(View2, {
|
|
3665
|
-
gap: "m",
|
|
3666
|
-
testID,
|
|
3667
|
-
children: [
|
|
3668
|
-
/* @__PURE__ */ jsx4(ColorSpectrumSlider, {
|
|
3669
|
-
disabled: interactionPolicy === "passive",
|
|
3670
|
-
hue: resolveColorHue(value),
|
|
3671
|
-
onChange: (nextHue) => onChange(resolveColorAtHue(value, nextHue))
|
|
3672
|
-
}),
|
|
3673
|
-
/* @__PURE__ */ jsx4(Text2, {
|
|
3674
|
-
variant: "label",
|
|
3675
|
-
children: "Intensity"
|
|
3676
|
-
}),
|
|
3677
|
-
/* @__PURE__ */ jsx4(View2, {
|
|
3678
|
-
accessibilityLabel: "Color scale previews; choose a preview as the next 500 base color",
|
|
3679
|
-
direction: "row",
|
|
3680
|
-
gap: "xs",
|
|
3681
|
-
wrap: "wrap",
|
|
3682
|
-
children: swatches.map(([step, color]) => /* @__PURE__ */ jsx4(Pressable, {
|
|
3683
|
-
accessibilityLabel: Number(step) === 500 ? `Current editable base color 500: ${color}` : `Use generated ${step} preview ${color} as the next base color 500`,
|
|
3684
|
-
bg: color,
|
|
3685
|
-
borderColor: theme.semantics.border.default,
|
|
3686
|
-
borderWidth: Number(step) === 500 ? 3 : 1,
|
|
3687
|
-
disabled: interactionPolicy === "passive",
|
|
3688
|
-
height: 48,
|
|
3689
|
-
onPress: () => onChange(color),
|
|
3690
|
-
radius: "s",
|
|
3691
|
-
width: "18%",
|
|
3692
|
-
children: /* @__PURE__ */ jsx4(Text2, {
|
|
3693
|
-
align: "center",
|
|
3694
|
-
variant: "caption",
|
|
3695
|
-
children: step
|
|
3696
|
-
})
|
|
3697
|
-
}, step))
|
|
3698
|
-
}),
|
|
3699
|
-
/* @__PURE__ */ jsx4(ColorHexField, {
|
|
3700
|
-
disabled: interactionPolicy === "passive",
|
|
3701
|
-
onChange,
|
|
3702
|
-
value
|
|
3703
|
-
}, value)
|
|
3704
|
-
]
|
|
3705
|
-
});
|
|
3706
|
-
}
|
|
3707
|
-
// src/features/color/ColorPicker.tsx
|
|
3708
|
-
import { Pressable as Pressable2 } from "@ankhorage/surface/web";
|
|
3709
|
-
import React8 from "react";
|
|
3710
|
-
import { View as NativeView } from "react-native-web";
|
|
3711
|
-
|
|
3712
|
-
// src/features/color/ColorWheel.tsx
|
|
3713
|
-
import React7 from "react";
|
|
3714
|
-
|
|
3715
|
-
// src/features/color/ColorWheelKeyboardProxy.web.tsx
|
|
3716
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3717
|
-
function ColorWheelKeyboardProxy({
|
|
3718
|
-
children,
|
|
3719
|
-
chroma,
|
|
3720
|
-
disabled,
|
|
3721
|
-
hue,
|
|
3722
|
-
maxChroma = 0.2,
|
|
3723
|
-
onChange
|
|
3724
|
-
}) {
|
|
3725
|
-
return /* @__PURE__ */ jsx5("div", {
|
|
3726
|
-
"aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
3727
|
-
"aria-valuemax": 360,
|
|
3728
|
-
"aria-valuemin": 0,
|
|
3729
|
-
"aria-valuenow": Math.round(hue),
|
|
3730
|
-
"aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
3731
|
-
"aria-disabled": disabled,
|
|
3732
|
-
onKeyDown: (event) => {
|
|
3733
|
-
const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma, maxChroma);
|
|
3734
|
-
if (!nextValue || disabled)
|
|
3735
|
-
return;
|
|
3736
|
-
event.preventDefault();
|
|
3737
|
-
onChange(nextValue.hue, nextValue.chroma);
|
|
3738
|
-
},
|
|
3739
|
-
role: "slider",
|
|
3740
|
-
tabIndex: disabled ? -1 : 0,
|
|
3741
|
-
children
|
|
3742
|
-
});
|
|
3743
|
-
}
|
|
3744
|
-
function resolveKeyboardWheelValue(key, hue, chroma, maxChroma) {
|
|
3745
|
-
if (key === "ArrowLeft")
|
|
3746
|
-
return { chroma, hue: normalizeHue(hue - 5) };
|
|
3747
|
-
if (key === "ArrowRight")
|
|
3748
|
-
return { chroma, hue: normalizeHue(hue + 5) };
|
|
3749
|
-
if (key === "ArrowDown")
|
|
3750
|
-
return { chroma: Math.max(0, chroma - 0.02), hue };
|
|
3751
|
-
if (key === "ArrowUp")
|
|
3752
|
-
return { chroma: Math.min(maxChroma, chroma + 0.02), hue };
|
|
3753
|
-
return;
|
|
3754
|
-
}
|
|
3755
|
-
function normalizeHue(hue) {
|
|
3756
|
-
return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
|
|
3757
|
-
}
|
|
3758
|
-
|
|
3759
|
-
// src/features/color/ColorWheelPointerProxy.web.tsx
|
|
3760
|
-
import React6 from "react";
|
|
3761
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
3762
|
-
function ColorWheelPointerProxy({
|
|
3763
|
-
children,
|
|
3764
|
-
disabled,
|
|
3765
|
-
height,
|
|
3766
|
-
onChange,
|
|
3767
|
-
renderedSize: _renderedSize,
|
|
3768
|
-
width
|
|
3769
|
-
}) {
|
|
3770
|
-
const dragging = React6.useRef(false);
|
|
3771
|
-
const changeAt = (event) => {
|
|
3772
|
-
const target = event.currentTarget;
|
|
3773
|
-
const rect = target.getBoundingClientRect();
|
|
3774
|
-
onChange((event.clientX - rect.left) / rect.width * width, (event.clientY - rect.top) / rect.height * height);
|
|
3775
|
-
};
|
|
3776
|
-
return /* @__PURE__ */ jsx6("div", {
|
|
3777
|
-
onPointerDown: (event) => {
|
|
3778
|
-
if (disabled)
|
|
3779
|
-
return;
|
|
3780
|
-
dragging.current = true;
|
|
3781
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
3782
|
-
changeAt(event);
|
|
3783
|
-
},
|
|
3784
|
-
onPointerMove: (event) => {
|
|
3785
|
-
if (!disabled && dragging.current)
|
|
3786
|
-
changeAt(event);
|
|
3787
|
-
},
|
|
3788
|
-
onPointerUp: (event) => {
|
|
3789
|
-
if (!disabled && dragging.current)
|
|
3790
|
-
changeAt(event);
|
|
3791
|
-
dragging.current = false;
|
|
3792
|
-
},
|
|
3793
|
-
onPointerCancel: () => {
|
|
3794
|
-
dragging.current = false;
|
|
3795
|
-
},
|
|
3796
|
-
style: { touchAction: "none" },
|
|
3797
|
-
children
|
|
3798
|
-
});
|
|
3799
|
-
}
|
|
3800
|
-
|
|
3801
|
-
// src/features/color/utils/resolveWheelColorComponents.ts
|
|
3802
|
-
var toOklch3 = converter_default("oklch");
|
|
3803
|
-
function resolveWheelColorComponents(color) {
|
|
3804
|
-
const parsed = toOklch3(color);
|
|
3805
|
-
return {
|
|
3806
|
-
chroma: typeof parsed?.c === "number" ? parsed.c : 0,
|
|
3807
|
-
lightness: typeof parsed?.l === "number" ? parsed.l : 0.65
|
|
3808
|
-
};
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
|
-
// src/features/color/utils/resolveWheelColor.ts
|
|
3812
|
-
function resolveWheelColor(color, x, y, center, radius, maxChroma, lightness = resolveWheelColorComponents(color).lightness) {
|
|
3813
|
-
const deltaX = x - center;
|
|
3814
|
-
const deltaY = y - center;
|
|
3815
|
-
const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
|
|
3816
|
-
const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
|
|
3817
|
-
const chroma = distance / radius * maxChroma;
|
|
3818
|
-
return resolveOklchColor({ lightness, chroma }, hue);
|
|
3819
|
-
}
|
|
3820
|
-
function normalizeHue2(hue) {
|
|
3821
|
-
return hue < 0 ? hue + 360 : hue;
|
|
3822
|
-
}
|
|
3823
|
-
|
|
3824
|
-
// src/features/color/ColorWheel.tsx
|
|
3825
|
-
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3826
|
-
var VIEWBOX = 1000;
|
|
3827
|
-
var CENTER = VIEWBOX / 2;
|
|
3828
|
-
var RADIUS = 480;
|
|
3829
|
-
var SEGMENTS = 720;
|
|
3830
|
-
var MAX_CHROMA = 0.2;
|
|
3831
|
-
var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
|
|
3832
|
-
function ColorWheelInner({
|
|
3833
|
-
themeId: _themeId,
|
|
3834
|
-
mode: _mode,
|
|
3835
|
-
inverted: _inverted,
|
|
3836
|
-
interactionPolicy,
|
|
3837
|
-
value,
|
|
3838
|
-
harmony = null,
|
|
3839
|
-
toneTarget,
|
|
3840
|
-
onChange,
|
|
3841
|
-
size = 340,
|
|
3842
|
-
testID
|
|
3843
|
-
}) {
|
|
3844
|
-
const hue = resolveColorHue(value);
|
|
3845
|
-
const { chroma, lightness } = resolveWheelColorComponents(value);
|
|
3846
|
-
const targetLightness = toneTarget?.lightness ?? lightness;
|
|
3847
|
-
const maximumChroma = toneTarget?.chroma ?? MAX_CHROMA;
|
|
3848
|
-
const primaryPoint = pointFor(hue, Math.min(1, chroma / maximumChroma));
|
|
3849
|
-
const harmonyRoles = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];
|
|
3850
|
-
const harmonyPoints = harmonyRoles.map((role) => ({
|
|
3851
|
-
color: role.hex,
|
|
3852
|
-
...pointFor(role.hueDegrees, Math.min(1, resolveWheelColorComponents(role.hex).chroma / maximumChroma))
|
|
3853
|
-
}));
|
|
3854
|
-
const gradientId = `color-wheel-${React7.useId().replaceAll(":", "")}`;
|
|
3855
|
-
const changeAt = (x, y) => {
|
|
3856
|
-
if (interactionPolicy !== "passive")
|
|
3857
|
-
onChange({
|
|
3858
|
-
color: resolveWheelColor(value, x, y, CENTER, RADIUS, maximumChroma, targetLightness),
|
|
3859
|
-
harmony
|
|
3860
|
-
});
|
|
3861
|
-
};
|
|
3862
|
-
return /* @__PURE__ */ jsx7(ColorWheelKeyboardProxy, {
|
|
3863
|
-
chroma,
|
|
3864
|
-
disabled: interactionPolicy === "passive",
|
|
3865
|
-
hue,
|
|
3866
|
-
maxChroma: maximumChroma,
|
|
3867
|
-
onChange: (nextHue, nextChroma) => onChange({
|
|
3868
|
-
color: resolveOklchColor({ chroma: nextChroma, lightness: targetLightness }, nextHue),
|
|
3869
|
-
harmony
|
|
3870
|
-
}),
|
|
3871
|
-
children: /* @__PURE__ */ jsx7(ColorWheelPointerProxy, {
|
|
3872
|
-
disabled: interactionPolicy === "passive",
|
|
3873
|
-
height: VIEWBOX,
|
|
3874
|
-
onChange: changeAt,
|
|
3875
|
-
renderedSize: size,
|
|
3876
|
-
width: VIEWBOX,
|
|
3877
|
-
children: /* @__PURE__ */ jsxs4(Svg, {
|
|
3878
|
-
accessibilityLabel: "Color wheel",
|
|
3879
|
-
height: size,
|
|
3880
|
-
testID,
|
|
3881
|
-
viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}`,
|
|
3882
|
-
width: size,
|
|
3883
|
-
children: [
|
|
3884
|
-
/* @__PURE__ */ jsx7(Defs, {
|
|
3885
|
-
children: segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsxs4(RadialGradient, {
|
|
3886
|
-
cx: CENTER,
|
|
3887
|
-
cy: CENTER,
|
|
3888
|
-
gradientUnits: "userSpaceOnUse",
|
|
3889
|
-
id: `${gradientId}-${segment.hue}`,
|
|
3890
|
-
r: RADIUS,
|
|
3891
|
-
children: [
|
|
3892
|
-
/* @__PURE__ */ jsx7(Stop, {
|
|
3893
|
-
offset: "0",
|
|
3894
|
-
stopColor: segment.centerColor
|
|
3895
|
-
}),
|
|
3896
|
-
/* @__PURE__ */ jsx7(Stop, {
|
|
3897
|
-
offset: "1",
|
|
3898
|
-
stopColor: segment.color
|
|
3899
|
-
})
|
|
3900
|
-
]
|
|
3901
|
-
}, segment.hue))
|
|
3902
|
-
}),
|
|
3903
|
-
segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsx7(Path, {
|
|
3904
|
-
d: segment.path,
|
|
3905
|
-
fill: `url(#${gradientId}-${segment.hue})`
|
|
3906
|
-
}, segment.hue)),
|
|
3907
|
-
harmonyPoints.length >= 3 ? /* @__PURE__ */ jsx7(Polygon, {
|
|
3908
|
-
fill: "none",
|
|
3909
|
-
points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
|
|
3910
|
-
stroke: "white",
|
|
3911
|
-
strokeWidth: 6
|
|
3912
|
-
}) : linesFor(harmonyPoints, primaryPoint, "white"),
|
|
3913
|
-
harmonyPoints.filter((point) => point.color !== value).map((point) => /* @__PURE__ */ jsx7(Circle, {
|
|
3914
|
-
cx: point.x,
|
|
3915
|
-
cy: point.y,
|
|
3916
|
-
fill: point.color,
|
|
3917
|
-
stroke: "white",
|
|
3918
|
-
strokeWidth: 6,
|
|
3919
|
-
r: 26
|
|
3920
|
-
}, `${point.x}-${point.y}`)),
|
|
3921
|
-
/* @__PURE__ */ jsx7(Circle, {
|
|
3922
|
-
cx: primaryPoint.x,
|
|
3923
|
-
cy: primaryPoint.y,
|
|
3924
|
-
fill: value,
|
|
3925
|
-
r: 36,
|
|
3926
|
-
stroke: "white",
|
|
3927
|
-
strokeWidth: 12
|
|
3928
|
-
}),
|
|
3929
|
-
/* @__PURE__ */ jsx7(Circle, {
|
|
3930
|
-
cx: primaryPoint.x,
|
|
3931
|
-
cy: primaryPoint.y,
|
|
3932
|
-
fill: "none",
|
|
3933
|
-
r: 42,
|
|
3934
|
-
stroke: "white",
|
|
3935
|
-
strokeWidth: 6
|
|
3936
|
-
})
|
|
3937
|
-
]
|
|
3938
|
-
})
|
|
3939
|
-
})
|
|
3940
|
-
});
|
|
3941
|
-
}
|
|
3942
|
-
function segments(lightness, maximumChroma) {
|
|
3943
|
-
return Array.from({ length: SEGMENTS }, (_, index) => {
|
|
3944
|
-
const hue = index * 360 / SEGMENTS;
|
|
3945
|
-
return {
|
|
3946
|
-
centerColor: resolveOklchColor({ chroma: 0, lightness }, hue),
|
|
3947
|
-
color: resolveOklchColor({ chroma: maximumChroma, lightness }, hue),
|
|
3948
|
-
hue,
|
|
3949
|
-
path: segmentPath(hue, hue + 360 / SEGMENTS)
|
|
3950
|
-
};
|
|
3951
|
-
});
|
|
3952
|
-
}
|
|
3953
|
-
function segmentPath(start, end) {
|
|
3954
|
-
const startPoint = pointFor(start);
|
|
3955
|
-
const endPoint = pointFor(end);
|
|
3956
|
-
return `M ${CENTER} ${CENTER} L ${startPoint.x} ${startPoint.y} A ${RADIUS} ${RADIUS} 0 0 1 ${endPoint.x} ${endPoint.y} Z`;
|
|
3957
|
-
}
|
|
3958
|
-
function pointFor(hue, ratio = 1) {
|
|
3959
|
-
const radians = (hue - 90) * Math.PI / 180;
|
|
3960
|
-
return {
|
|
3961
|
-
x: CENTER + RADIUS * ratio * Math.cos(radians),
|
|
3962
|
-
y: CENTER + RADIUS * ratio * Math.sin(radians)
|
|
3963
|
-
};
|
|
3964
|
-
}
|
|
3965
|
-
function linesFor(points, primary, stroke) {
|
|
3966
|
-
return points.slice(1).reduce(({ lines, previous }, point) => ({
|
|
3967
|
-
lines: [
|
|
3968
|
-
...lines,
|
|
3969
|
-
/* @__PURE__ */ jsx7(Line, {
|
|
3970
|
-
stroke,
|
|
3971
|
-
strokeWidth: 6,
|
|
3972
|
-
x1: previous.x,
|
|
3973
|
-
x2: point.x,
|
|
3974
|
-
y1: previous.y,
|
|
3975
|
-
y2: point.y
|
|
3976
|
-
}, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
|
|
3977
|
-
],
|
|
3978
|
-
previous: point
|
|
3979
|
-
}), { lines: [], previous: points.at(0) ?? primary }).lines;
|
|
3980
|
-
}
|
|
3981
|
-
|
|
3982
|
-
// src/features/color/resolveColorPickerGeometry.ts
|
|
3983
|
-
var MINIMUM_WIDTH = 360;
|
|
3984
|
-
var REFERENCE_WIDTH = 560;
|
|
3985
|
-
function resolveColorPickerGeometry(input) {
|
|
3986
|
-
const availableWidth = Math.min(input.width ?? REFERENCE_WIDTH, input.hostWidth ?? REFERENCE_WIDTH);
|
|
3987
|
-
const availableHeight = Math.min(input.height ?? Number.POSITIVE_INFINITY, input.hostHeight ?? Number.POSITIVE_INFINITY);
|
|
3988
|
-
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, input.showTabs);
|
|
3989
|
-
const maximum = resolveGeometryAtWidth(Math.max(MINIMUM_WIDTH, availableWidth), input.showTabs);
|
|
3990
|
-
const resolved = resolveLargestGeometry(maximum, availableHeight, input.showTabs);
|
|
3991
|
-
return {
|
|
3992
|
-
...resolved,
|
|
3993
|
-
insufficientSpace: availableWidth < MINIMUM_WIDTH || availableHeight < minimum.height,
|
|
3994
|
-
minimumHeight: minimum.height,
|
|
3995
|
-
minimumWidth: MINIMUM_WIDTH
|
|
3996
|
-
};
|
|
3997
|
-
}
|
|
3998
|
-
function resolveGeometryAtWidth(width, showTabs) {
|
|
3999
|
-
const progress = Math.max(0, Math.min(1, (width - MINIMUM_WIDTH) / (REFERENCE_WIDTH - MINIMUM_WIDTH)));
|
|
4000
|
-
const padding = interpolate(12, 24, progress);
|
|
4001
|
-
const rail = interpolate(104, 150, progress);
|
|
4002
|
-
const gap = interpolate(12, 20, progress);
|
|
4003
|
-
const scale = interpolate(0.75, 1, progress);
|
|
4004
|
-
const border = 1;
|
|
4005
|
-
const stage = width - border * 2 - padding * 2 - rail - gap;
|
|
4006
|
-
const headerHeight = 48 * scale;
|
|
4007
|
-
const tabHeight = showTabs ? 48 * scale : 0;
|
|
4008
|
-
const cardGap = 16 * scale;
|
|
4009
|
-
const cardHeight = 52 * scale;
|
|
4010
|
-
const settingsHeight = cardHeight * 2 + cardGap;
|
|
4011
|
-
const mainHeight = Math.max(stage, settingsHeight);
|
|
4012
|
-
const infoLineHeight = 20 * scale;
|
|
4013
|
-
const mainGap = 16 * scale;
|
|
4014
|
-
const footerGap = 10 * scale;
|
|
4015
|
-
const footerHeight = 52 * scale;
|
|
4016
|
-
const footerInset = 12 * scale;
|
|
4017
|
-
const height = border * 2 + padding + headerHeight + mainGap + tabHeight + (showTabs ? mainGap : 0) + mainHeight + mainGap + infoLineHeight + footerGap + 1 + footerGap + footerHeight + footerInset;
|
|
4018
|
-
return {
|
|
4019
|
-
border,
|
|
4020
|
-
cardGap,
|
|
4021
|
-
cardHeight,
|
|
4022
|
-
footerGap,
|
|
4023
|
-
footerHeight,
|
|
4024
|
-
footerInset,
|
|
4025
|
-
gap,
|
|
4026
|
-
headerHeight,
|
|
4027
|
-
height,
|
|
4028
|
-
infoLineHeight,
|
|
4029
|
-
mainGap,
|
|
4030
|
-
padding,
|
|
4031
|
-
rail,
|
|
4032
|
-
scale,
|
|
4033
|
-
settingsHeight,
|
|
4034
|
-
stage,
|
|
4035
|
-
tabHeight,
|
|
4036
|
-
width
|
|
4037
|
-
};
|
|
4038
|
-
}
|
|
4039
|
-
function resolveLargestGeometry(maximum, height, showTabs) {
|
|
4040
|
-
if (!Number.isFinite(height) || maximum.height <= height)
|
|
4041
|
-
return maximum;
|
|
4042
|
-
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, showTabs);
|
|
4043
|
-
if (height < minimum.height)
|
|
4044
|
-
return minimum;
|
|
4045
|
-
let lower = MINIMUM_WIDTH;
|
|
4046
|
-
let upper = maximum.width;
|
|
4047
|
-
for (let iteration = 0;iteration < 20; iteration += 1) {
|
|
4048
|
-
const midpoint = (lower + upper) / 2;
|
|
4049
|
-
if (resolveGeometryAtWidth(midpoint, showTabs).height <= height)
|
|
4050
|
-
lower = midpoint;
|
|
4051
|
-
else
|
|
4052
|
-
upper = midpoint;
|
|
4053
|
-
}
|
|
4054
|
-
return resolveGeometryAtWidth(lower, showTabs);
|
|
4055
|
-
}
|
|
4056
|
-
function interpolate(minimum, reference, progress) {
|
|
4057
|
-
return minimum + (reference - minimum) * progress;
|
|
4058
|
-
}
|
|
4059
|
-
|
|
4060
|
-
// src/features/color/ColorPicker.tsx
|
|
4061
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4062
|
-
var DEFAULT_TABS = ["grid", "wheel"];
|
|
4063
|
-
var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
|
|
4064
|
-
function ColorPickerInner({
|
|
4065
|
-
themeId: _themeId,
|
|
4066
|
-
mode: _mode,
|
|
4067
|
-
inverted: _inverted,
|
|
4068
|
-
tabs = DEFAULT_TABS,
|
|
4069
|
-
primaryColor,
|
|
4070
|
-
harmony,
|
|
4071
|
-
tone,
|
|
4072
|
-
tones = [],
|
|
4073
|
-
width = 560,
|
|
4074
|
-
height,
|
|
4075
|
-
infoLine,
|
|
4076
|
-
onInsufficientSpaceChange,
|
|
4077
|
-
activeTab,
|
|
4078
|
-
onValueChange,
|
|
4079
|
-
onActiveTabChange,
|
|
4080
|
-
onDismiss,
|
|
4081
|
-
hideTabListWhenSingle = true,
|
|
4082
|
-
wheel,
|
|
4083
|
-
interactionPolicy,
|
|
4084
|
-
testID
|
|
4085
|
-
}) {
|
|
4086
|
-
const { theme } = useZoraTheme2();
|
|
4087
|
-
const [hostBounds, setHostBounds] = React8.useState();
|
|
4088
|
-
const enabledTabs = resolveEnabledTabs(tabs);
|
|
4089
|
-
const firstTab = enabledTabs.at(0);
|
|
4090
|
-
if (!firstTab)
|
|
4091
|
-
throw new Error("ColorPicker requires at least one tab.");
|
|
4092
|
-
const [uncontrolledTab, setUncontrolledTab] = React8.useState(firstTab);
|
|
4093
|
-
const resolvedTab = activeTab && enabledTabs.includes(activeTab) ? activeTab : enabledTabs.includes(uncontrolledTab) ? uncontrolledTab : firstTab;
|
|
4094
|
-
const geometry = resolveColorPickerGeometry({
|
|
4095
|
-
height,
|
|
4096
|
-
hostHeight: hostBounds && hostBounds.height > 0 ? hostBounds.height : undefined,
|
|
4097
|
-
hostWidth: hostBounds && hostBounds.width > 0 ? hostBounds.width : undefined,
|
|
4098
|
-
showTabs: enabledTabs.length > 1 || !hideTabListWhenSingle,
|
|
4099
|
-
width
|
|
4100
|
-
});
|
|
4101
|
-
const selectedTone = tones.find((entry) => entry.id === tone);
|
|
4102
|
-
const emit = (next) => onValueChange({
|
|
4103
|
-
primaryColor: next.primaryColor ?? primaryColor,
|
|
4104
|
-
...Object.hasOwn(next, "harmony") ? { harmony: next.harmony } : harmony ? { harmony } : {},
|
|
4105
|
-
...Object.hasOwn(next, "tone") ? { tone: next.tone } : tone ? { tone } : {}
|
|
4106
|
-
});
|
|
4107
|
-
const settings = (children) => /* @__PURE__ */ jsx8(PickerRow, {
|
|
4108
|
-
geometry,
|
|
4109
|
-
tone,
|
|
4110
|
-
tones,
|
|
4111
|
-
harmony,
|
|
4112
|
-
interactionPolicy,
|
|
4113
|
-
onHarmonyChange: (next) => emit({ harmony: next }),
|
|
4114
|
-
onToneChange: (next) => emit({ tone: next }),
|
|
4115
|
-
children
|
|
4116
|
-
});
|
|
4117
|
-
React8.useEffect(() => {
|
|
4118
|
-
if (activeTab && activeTab !== resolvedTab)
|
|
4119
|
-
onActiveTabChange?.(resolvedTab);
|
|
4120
|
-
}, [activeTab, onActiveTabChange, resolvedTab]);
|
|
4121
|
-
React8.useEffect(() => {
|
|
4122
|
-
onInsufficientSpaceChange?.(geometry.insufficientSpace);
|
|
4123
|
-
}, [geometry.insufficientSpace, onInsufficientSpaceChange]);
|
|
4124
|
-
return /* @__PURE__ */ jsx8(NativeView, {
|
|
4125
|
-
onLayout: (event) => setHostBounds({
|
|
4126
|
-
height: event.nativeEvent.layout.height,
|
|
4127
|
-
width: event.nativeEvent.layout.width
|
|
4128
|
-
}),
|
|
4129
|
-
style: {
|
|
4130
|
-
alignSelf: "stretch",
|
|
4131
|
-
flexShrink: 1,
|
|
4132
|
-
height: height ?? "100%",
|
|
4133
|
-
maxHeight: "100%",
|
|
4134
|
-
maxWidth: "100%",
|
|
4135
|
-
width: "100%"
|
|
4136
|
-
},
|
|
4137
|
-
children: !geometry.insufficientSpace ? /* @__PURE__ */ jsx8(View2, {
|
|
4138
|
-
alignSelf: "center",
|
|
4139
|
-
borderColor: theme.semantics.action.primary.base,
|
|
4140
|
-
borderWidth: geometry.border,
|
|
4141
|
-
radius: "l",
|
|
4142
|
-
testID,
|
|
4143
|
-
width: geometry.width,
|
|
4144
|
-
children: /* @__PURE__ */ jsx8(Gradient2, {
|
|
4145
|
-
colors: [theme.semantics.surface.raised, theme.semantics.neutral.surface],
|
|
4146
|
-
end: { x: 0, y: 1 },
|
|
4147
|
-
radius: "l",
|
|
4148
|
-
start: { x: 0, y: 0 },
|
|
4149
|
-
children: /* @__PURE__ */ jsxs5(View2, {
|
|
4150
|
-
gap: geometry.footerGap,
|
|
4151
|
-
pb: geometry.footerInset,
|
|
4152
|
-
pt: geometry.padding,
|
|
4153
|
-
px: geometry.padding,
|
|
4154
|
-
children: [
|
|
4155
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4156
|
-
gap: geometry.mainGap,
|
|
4157
|
-
children: [
|
|
4158
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4159
|
-
align: "center",
|
|
4160
|
-
direction: "row",
|
|
4161
|
-
justify: "space-between",
|
|
4162
|
-
minHeight: geometry.headerHeight,
|
|
4163
|
-
children: [
|
|
4164
|
-
/* @__PURE__ */ jsx8(Heading2, {
|
|
4165
|
-
level: 2,
|
|
4166
|
-
children: "Color"
|
|
4167
|
-
}),
|
|
4168
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4169
|
-
align: "center",
|
|
4170
|
-
direction: "row",
|
|
4171
|
-
gap: "s",
|
|
4172
|
-
children: [
|
|
4173
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
4174
|
-
bg: primaryColor,
|
|
4175
|
-
borderColor: theme.semantics.border.default,
|
|
4176
|
-
borderWidth: 1,
|
|
4177
|
-
height: 36 * geometry.scale,
|
|
4178
|
-
radius: "s",
|
|
4179
|
-
width: 52 * geometry.scale
|
|
4180
|
-
}),
|
|
4181
|
-
onDismiss ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
4182
|
-
iconName: "close",
|
|
4183
|
-
label: "Close color picker",
|
|
4184
|
-
onPress: onDismiss
|
|
4185
|
-
}) : null
|
|
4186
|
-
]
|
|
4187
|
-
})
|
|
4188
|
-
]
|
|
4189
|
-
}),
|
|
4190
|
-
enabledTabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx8(ColorPickerTabSelector, {
|
|
4191
|
-
activeTab: resolvedTab,
|
|
4192
|
-
geometry,
|
|
4193
|
-
interactionPolicy,
|
|
4194
|
-
tabs: enabledTabs,
|
|
4195
|
-
onChange: (next) => {
|
|
4196
|
-
setUncontrolledTab(next);
|
|
4197
|
-
onActiveTabChange?.(next);
|
|
4198
|
-
}
|
|
4199
|
-
}) : null,
|
|
4200
|
-
resolvedTab === "grid" ? settings(/* @__PURE__ */ jsx8(ColorGrid, {
|
|
4201
|
-
disabled: interactionPolicy === "passive",
|
|
4202
|
-
harmony,
|
|
4203
|
-
onSelect: (color) => emit({ primaryColor: color }),
|
|
4204
|
-
palette: resolvePalette(selectedTone, primaryColor, harmony),
|
|
4205
|
-
primaryIndicatorColor: theme.semantics.action.primary.base,
|
|
4206
|
-
selectionBorderColor: theme.semantics.content.default,
|
|
4207
|
-
selected: primaryColor,
|
|
4208
|
-
size: geometry.stage
|
|
4209
|
-
})) : settings(/* @__PURE__ */ jsx8(ColorWheel2, {
|
|
4210
|
-
...wheel,
|
|
4211
|
-
harmony: harmony ?? null,
|
|
4212
|
-
interactionPolicy,
|
|
4213
|
-
onChange: (next) => emit({ primaryColor: next.color, harmony: next.harmony ?? undefined }),
|
|
4214
|
-
size: geometry.stage,
|
|
4215
|
-
toneTarget: selectedTone?.accentTarget,
|
|
4216
|
-
value: primaryColor
|
|
4217
|
-
})),
|
|
4218
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
4219
|
-
height: geometry.infoLineHeight,
|
|
4220
|
-
justify: "center",
|
|
4221
|
-
children: infoLine ? /* @__PURE__ */ jsx8(Text2, {
|
|
4222
|
-
accessibilityLabel: infoLine,
|
|
4223
|
-
numberOfLines: 1,
|
|
4224
|
-
variant: "caption",
|
|
4225
|
-
children: infoLine
|
|
4226
|
-
}) : null
|
|
4227
|
-
})
|
|
4228
|
-
]
|
|
4229
|
-
}),
|
|
4230
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4231
|
-
gap: geometry.footerGap,
|
|
4232
|
-
children: [
|
|
4233
|
-
/* @__PURE__ */ jsx8(Divider2, {}),
|
|
4234
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
4235
|
-
height: geometry.footerHeight,
|
|
4236
|
-
justify: "center",
|
|
4237
|
-
children: /* @__PURE__ */ jsx8(ColorHexField, {
|
|
4238
|
-
disabled: interactionPolicy === "passive",
|
|
4239
|
-
onChange: (color) => emit({ primaryColor: color }),
|
|
4240
|
-
value: primaryColor
|
|
4241
|
-
})
|
|
4242
|
-
})
|
|
4243
|
-
]
|
|
4244
|
-
})
|
|
4245
|
-
]
|
|
4246
|
-
})
|
|
4247
|
-
})
|
|
4248
|
-
}) : /* @__PURE__ */ jsx8(View2, {
|
|
4249
|
-
accessibilityLabel: "Color picker needs more space",
|
|
4250
|
-
testID: testID ? `${testID}-insufficient-space` : undefined
|
|
4251
|
-
})
|
|
4252
|
-
});
|
|
4253
|
-
}
|
|
4254
|
-
function ColorPickerTabSelector({
|
|
4255
|
-
activeTab,
|
|
4256
|
-
geometry,
|
|
4257
|
-
interactionPolicy,
|
|
4258
|
-
tabs,
|
|
4259
|
-
onChange
|
|
4260
|
-
}) {
|
|
4261
|
-
const { theme } = useZoraTheme2();
|
|
4262
|
-
return /* @__PURE__ */ jsx8(View2, {
|
|
4263
|
-
borderColor: theme.semantics.border.default,
|
|
4264
|
-
borderWidth: 1,
|
|
4265
|
-
direction: "row",
|
|
4266
|
-
overflow: "hidden",
|
|
4267
|
-
radius: "m",
|
|
4268
|
-
children: tabs.map((tab) => {
|
|
4269
|
-
const selected = tab === activeTab;
|
|
4270
|
-
return /* @__PURE__ */ jsx8(Pressable2, {
|
|
4271
|
-
accessibilityLabel: `${tab === "grid" ? "Grid" : "Wheel"} color picker tab`,
|
|
4272
|
-
accessibilityRole: "tab",
|
|
4273
|
-
accessibilityState: { selected },
|
|
4274
|
-
disabled: interactionPolicy === "passive",
|
|
4275
|
-
onPress: () => onChange(tab),
|
|
4276
|
-
style: { flex: 1 },
|
|
4277
|
-
children: /* @__PURE__ */ jsxs5(View2, {
|
|
4278
|
-
align: "center",
|
|
4279
|
-
bg: selected ? theme.semantics.action.primary.base : "transparent",
|
|
4280
|
-
direction: "row",
|
|
4281
|
-
gap: "xs",
|
|
4282
|
-
height: geometry.tabHeight - geometry.border * 2,
|
|
4283
|
-
justify: "center",
|
|
4284
|
-
radius: "s",
|
|
4285
|
-
children: [
|
|
4286
|
-
/* @__PURE__ */ jsx8(Icon2, {
|
|
4287
|
-
color: selected ? theme.semantics.action.primary.onSolidText : undefined,
|
|
4288
|
-
name: tab === "grid" ? "grid" : "color-palette",
|
|
4289
|
-
size: 16 * geometry.scale
|
|
4290
|
-
}),
|
|
4291
|
-
/* @__PURE__ */ jsx8(Text2, {
|
|
4292
|
-
style: selected ? { color: theme.semantics.action.primary.onSolidText } : undefined,
|
|
4293
|
-
variant: "label",
|
|
4294
|
-
weight: "medium",
|
|
4295
|
-
children: tab === "grid" ? "Grid" : "Wheel"
|
|
4296
|
-
})
|
|
4297
|
-
]
|
|
4298
|
-
})
|
|
4299
|
-
}, tab);
|
|
4300
|
-
})
|
|
4301
|
-
});
|
|
4302
|
-
}
|
|
4303
|
-
function PickerRow({
|
|
4304
|
-
children,
|
|
4305
|
-
geometry,
|
|
4306
|
-
tone,
|
|
4307
|
-
tones,
|
|
4308
|
-
harmony,
|
|
4309
|
-
interactionPolicy,
|
|
4310
|
-
onToneChange,
|
|
4311
|
-
onHarmonyChange
|
|
4312
|
-
}) {
|
|
4313
|
-
return /* @__PURE__ */ jsxs5(View2, {
|
|
4314
|
-
align: "flex-start",
|
|
4315
|
-
direction: "row",
|
|
4316
|
-
gap: geometry.gap,
|
|
4317
|
-
children: [
|
|
4318
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4319
|
-
gap: geometry.cardGap,
|
|
4320
|
-
width: geometry.rail,
|
|
4321
|
-
children: [
|
|
4322
|
-
/* @__PURE__ */ jsx8(SettingCard, {
|
|
4323
|
-
geometry,
|
|
4324
|
-
icon: "diamond",
|
|
4325
|
-
interactionPolicy,
|
|
4326
|
-
label: "Tone",
|
|
4327
|
-
onClear: tone ? () => onToneChange(undefined) : undefined,
|
|
4328
|
-
children: /* @__PURE__ */ jsx8(Select2, {
|
|
4329
|
-
compact: true,
|
|
4330
|
-
interactionPolicy,
|
|
4331
|
-
onValueChange: onToneChange,
|
|
4332
|
-
options: resolveToneOptions(tones),
|
|
4333
|
-
placeholder: "Any tone",
|
|
4334
|
-
value: tone
|
|
4335
|
-
})
|
|
4336
|
-
}),
|
|
4337
|
-
/* @__PURE__ */ jsx8(SettingCard, {
|
|
4338
|
-
geometry,
|
|
4339
|
-
icon: "color-palette",
|
|
4340
|
-
interactionPolicy,
|
|
4341
|
-
label: "Harmony",
|
|
4342
|
-
onClear: harmony ? () => onHarmonyChange(undefined) : undefined,
|
|
4343
|
-
children: /* @__PURE__ */ jsx8(Select2, {
|
|
4344
|
-
compact: true,
|
|
4345
|
-
interactionPolicy,
|
|
4346
|
-
onValueChange: onHarmonyChange,
|
|
4347
|
-
options: COLOR_HARMONY_CATALOG.map((entry) => ({
|
|
4348
|
-
label: entry.label,
|
|
4349
|
-
value: entry.id
|
|
4350
|
-
})),
|
|
4351
|
-
placeholder: "None",
|
|
4352
|
-
value: harmony
|
|
4353
|
-
})
|
|
4354
|
-
})
|
|
4355
|
-
]
|
|
4356
|
-
}),
|
|
4357
|
-
children
|
|
4358
|
-
]
|
|
4359
|
-
});
|
|
4360
|
-
}
|
|
4361
|
-
function SettingCard({
|
|
4362
|
-
children,
|
|
4363
|
-
geometry,
|
|
4364
|
-
icon,
|
|
4365
|
-
interactionPolicy,
|
|
4366
|
-
label,
|
|
4367
|
-
onClear
|
|
4368
|
-
}) {
|
|
4369
|
-
return /* @__PURE__ */ jsxs5(Card2, {
|
|
4370
|
-
compact: true,
|
|
4371
|
-
minHeight: geometry.cardHeight,
|
|
4372
|
-
padding: "s",
|
|
4373
|
-
radius: "m",
|
|
4374
|
-
tone: "subtle",
|
|
4375
|
-
children: [
|
|
4376
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4377
|
-
align: "center",
|
|
4378
|
-
direction: "row",
|
|
4379
|
-
gap: "xs",
|
|
4380
|
-
justify: "space-between",
|
|
4381
|
-
children: [
|
|
4382
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
4383
|
-
align: "center",
|
|
4384
|
-
direction: "row",
|
|
4385
|
-
gap: "xs",
|
|
4386
|
-
children: [
|
|
4387
|
-
/* @__PURE__ */ jsx8(Icon2, {
|
|
4388
|
-
name: icon,
|
|
4389
|
-
size: 20 * geometry.scale
|
|
4390
|
-
}),
|
|
4391
|
-
/* @__PURE__ */ jsx8(Text2, {
|
|
4392
|
-
numberOfLines: 1,
|
|
4393
|
-
variant: "label",
|
|
4394
|
-
weight: "medium",
|
|
4395
|
-
children: label
|
|
4396
|
-
})
|
|
4397
|
-
]
|
|
4398
|
-
}),
|
|
4399
|
-
onClear ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
4400
|
-
disabled: interactionPolicy === "passive",
|
|
4401
|
-
iconName: "close",
|
|
4402
|
-
label: `Clear ${label}`,
|
|
4403
|
-
onPress: onClear,
|
|
4404
|
-
size: "s"
|
|
4405
|
-
}) : null
|
|
4406
|
-
]
|
|
4407
|
-
}),
|
|
4408
|
-
children
|
|
4409
|
-
]
|
|
4410
|
-
});
|
|
4411
|
-
}
|
|
4412
|
-
function ColorGrid({
|
|
4413
|
-
palette,
|
|
4414
|
-
primaryIndicatorColor,
|
|
4415
|
-
selectionBorderColor,
|
|
4416
|
-
selected,
|
|
4417
|
-
size,
|
|
4418
|
-
onSelect,
|
|
4419
|
-
disabled = false,
|
|
4420
|
-
harmony
|
|
4421
|
-
}) {
|
|
4422
|
-
const gap = Math.max(3, Math.round(size / 68));
|
|
4423
|
-
const cell = (size - 7 * gap) / 8;
|
|
4424
|
-
const harmonyColors = new Set(harmony ? generateHarmonyRoleColors(selected, harmony).colors.map((role) => role.hex) : []);
|
|
4425
|
-
return /* @__PURE__ */ jsx8(View2, {
|
|
4426
|
-
accessibilityLabel: "Color grid",
|
|
4427
|
-
direction: "row",
|
|
4428
|
-
gap,
|
|
4429
|
-
width: size,
|
|
4430
|
-
wrap: "wrap",
|
|
4431
|
-
children: palette.map((color) => /* @__PURE__ */ jsx8(Pressable2, {
|
|
4432
|
-
accessibilityLabel: `Select ${color}`,
|
|
4433
|
-
bg: color,
|
|
4434
|
-
borderColor: color === selected ? selectionBorderColor : harmonyColors.has(color) ? primaryIndicatorColor : "transparent",
|
|
4435
|
-
borderWidth: color === selected ? 3 : harmonyColors.has(color) ? 1 : 0,
|
|
4436
|
-
disabled,
|
|
4437
|
-
height: cell,
|
|
4438
|
-
onPress: () => onSelect(color),
|
|
4439
|
-
radius: "s",
|
|
4440
|
-
width: cell
|
|
4441
|
-
}, color))
|
|
4442
|
-
});
|
|
4443
|
-
}
|
|
4444
|
-
function resolvePalette(tone, primaryColor, harmony) {
|
|
4445
|
-
const target = tone?.accentTarget;
|
|
4446
|
-
const candidates = Array.from({ length: 64 }, (_, index) => resolveOklchColor({
|
|
4447
|
-
chroma: target?.chroma ?? 0.08 + index % 8 * 0.018,
|
|
4448
|
-
lightness: target?.lightness ?? 0.35 + Math.floor(index / 8) * 0.065
|
|
4449
|
-
}, index * 137.508 % 360));
|
|
4450
|
-
const roleColors = harmony ? generateHarmonyRoleColors(primaryColor, harmony).colors.map((role) => role.hex) : [];
|
|
4451
|
-
return Array.from(new Set([primaryColor, ...roleColors, ...candidates])).slice(0, 64);
|
|
4452
|
-
}
|
|
4453
|
-
function resolveToneOptions(tones) {
|
|
4454
|
-
const accentCounts = new Map;
|
|
4455
|
-
for (const tone of tones) {
|
|
4456
|
-
const accent = tone.accent.trim().toLocaleLowerCase();
|
|
4457
|
-
accentCounts.set(accent, (accentCounts.get(accent) ?? 0) + 1);
|
|
4458
|
-
}
|
|
4459
|
-
return tones.map((tone) => ({
|
|
4460
|
-
label: (accentCounts.get(tone.accent.trim().toLocaleLowerCase()) ?? 0) > 1 ? `${tone.accent} · ${resolveToneQualifier(tone)}` : tone.accent,
|
|
4461
|
-
value: tone.id
|
|
4462
|
-
}));
|
|
4463
|
-
}
|
|
4464
|
-
function resolveToneQualifier(tone) {
|
|
4465
|
-
const normalizedAccent = tone.accent.trim().toLocaleLowerCase().replaceAll(" ", "-");
|
|
4466
|
-
const qualifier = tone.id.replace(new RegExp(`^${escapeRegExp(normalizedAccent)}-on-`, "i"), "").replaceAll("-", " ");
|
|
4467
|
-
return qualifier.replace(/\b\w/g, (character) => character.toLocaleUpperCase());
|
|
4468
|
-
}
|
|
4469
|
-
function escapeRegExp(value) {
|
|
4470
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4471
|
-
}
|
|
4472
|
-
function resolveEnabledTabs(tabs) {
|
|
4473
|
-
if (tabs.length === 0)
|
|
4474
|
-
throw new Error("ColorPicker requires at least one tab.");
|
|
4475
|
-
if (tabs.some((tab) => !isColorPickerTab(tab)))
|
|
4476
|
-
throw new Error("ColorPicker supports only Grid and Wheel tabs.");
|
|
4477
|
-
return tabs;
|
|
4478
|
-
}
|
|
4479
|
-
function isColorPickerTab(value) {
|
|
4480
|
-
return value === "grid" || value === "wheel";
|
|
4481
|
-
}
|
|
4482
|
-
// src/features/color/ColorTone.tsx
|
|
4483
|
-
import { Button, Pressable as Pressable3 } from "@ankhorage/surface/web";
|
|
4484
|
-
import React9 from "react";
|
|
4485
|
-
import { jsx as jsx9, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
|
|
4486
|
-
var MAX_TONE_COLORS = 4;
|
|
4487
|
-
var TONE_MAP_WIDTH = 280;
|
|
4488
|
-
var TONE_MAP_HEIGHT = 220;
|
|
4489
|
-
var TONE_MAX_CHROMA = 0.2;
|
|
4490
|
-
var ColorTone2 = withZoraThemeScope(ColorToneInner);
|
|
4491
|
-
function ColorToneInner({
|
|
4492
|
-
themeId: _themeId,
|
|
4493
|
-
mode: _mode,
|
|
4494
|
-
inverted: _inverted,
|
|
4495
|
-
interactionPolicy,
|
|
4496
|
-
tones,
|
|
4497
|
-
selectionMode = "single",
|
|
4498
|
-
value,
|
|
4499
|
-
onChange,
|
|
4500
|
-
testID
|
|
4501
|
-
}) {
|
|
4502
|
-
const { theme } = useZoraTheme2();
|
|
4503
|
-
const [editingColorIndex, setEditingColorIndex] = React9.useState(0);
|
|
4504
|
-
const selectedTone = tones.find((tone) => tone.id === value?.toneId);
|
|
4505
|
-
const colors = value ? selectionMode === "single" ? value.colors.slice(0, 1) : value.colors.slice(0, MAX_TONE_COLORS) : [];
|
|
4506
|
-
const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
|
|
4507
|
-
const selectedColor = colors.at(currentEditingColorIndex);
|
|
4508
|
-
const selectTone = (tone) => {
|
|
4509
|
-
const hue = selectedColor ? resolveColorHue(selectedColor) : 0;
|
|
4510
|
-
setEditingColorIndex(0);
|
|
4511
|
-
onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
|
|
4512
|
-
};
|
|
4513
|
-
return /* @__PURE__ */ jsxs6(View2, {
|
|
4514
|
-
gap: "m",
|
|
4515
|
-
testID,
|
|
4516
|
-
children: [
|
|
4517
|
-
/* @__PURE__ */ jsxs6(View2, {
|
|
4518
|
-
gap: "xs",
|
|
4519
|
-
children: [
|
|
4520
|
-
/* @__PURE__ */ jsx9(Text2, {
|
|
4521
|
-
variant: "label",
|
|
4522
|
-
children: "Tone"
|
|
4523
|
-
}),
|
|
4524
|
-
/* @__PURE__ */ jsx9(Text2, {
|
|
4525
|
-
emphasis: "muted",
|
|
4526
|
-
variant: "caption",
|
|
4527
|
-
children: "Choose a catalog tone"
|
|
4528
|
-
})
|
|
4529
|
-
]
|
|
4530
|
-
}),
|
|
4531
|
-
/* @__PURE__ */ jsx9(View2, {
|
|
4532
|
-
direction: "row",
|
|
4533
|
-
gap: "s",
|
|
4534
|
-
wrap: "wrap",
|
|
4535
|
-
children: tones.map((tone) => {
|
|
4536
|
-
const selected = value?.toneId === tone.id;
|
|
4537
|
-
const color = selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
|
|
4538
|
-
return /* @__PURE__ */ jsx9(Pressable3, {
|
|
4539
|
-
accessibilityLabel: tone.accent,
|
|
4540
|
-
accessibilityRole: "radio",
|
|
4541
|
-
accessibilityState: { checked: selected },
|
|
4542
|
-
bg: color,
|
|
4543
|
-
borderColor: theme.semantics.border.default,
|
|
4544
|
-
borderWidth: selected ? 3 : 1,
|
|
4545
|
-
disabled: interactionPolicy === "passive",
|
|
4546
|
-
height: 56,
|
|
4547
|
-
onPress: () => selectTone(tone),
|
|
4548
|
-
radius: "m",
|
|
4549
|
-
width: 56,
|
|
4550
|
-
children: /* @__PURE__ */ jsx9(Text2, {
|
|
4551
|
-
align: "center",
|
|
4552
|
-
variant: "caption",
|
|
4553
|
-
children: tone.accent
|
|
4554
|
-
})
|
|
4555
|
-
}, tone.id);
|
|
4556
|
-
})
|
|
4557
|
-
}),
|
|
4558
|
-
selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs6(Fragment, {
|
|
4559
|
-
children: [
|
|
4560
|
-
/* @__PURE__ */ jsx9(ColorToneMap, {
|
|
4561
|
-
color: selectedColor,
|
|
4562
|
-
disabled: interactionPolicy === "passive",
|
|
4563
|
-
onChange: (lightness, chroma) => onChange({
|
|
4564
|
-
toneId: selectedTone.id,
|
|
4565
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor({ chroma, lightness }, resolveColorHue(entry)) : entry)
|
|
4566
|
-
})
|
|
4567
|
-
}),
|
|
4568
|
-
/* @__PURE__ */ jsxs6(View2, {
|
|
4569
|
-
direction: "row",
|
|
4570
|
-
gap: "xs",
|
|
4571
|
-
wrap: "wrap",
|
|
4572
|
-
children: [
|
|
4573
|
-
colors.map((color, index) => /* @__PURE__ */ jsx9(Pressable3, {
|
|
4574
|
-
accessibilityLabel: `Selected ${selectedTone.accent} color ${index + 1}: ${color}`,
|
|
4575
|
-
accessibilityRole: "radio",
|
|
4576
|
-
accessibilityState: { checked: currentEditingColorIndex === index },
|
|
4577
|
-
bg: color,
|
|
4578
|
-
borderColor: theme.semantics.border.default,
|
|
4579
|
-
borderWidth: currentEditingColorIndex === index ? 3 : 1,
|
|
4580
|
-
disabled: interactionPolicy === "passive",
|
|
4581
|
-
height: 44,
|
|
4582
|
-
onPress: () => setEditingColorIndex(index),
|
|
4583
|
-
radius: "m",
|
|
4584
|
-
width: 44
|
|
4585
|
-
}, `${color}-${index}`)),
|
|
4586
|
-
selectionMode === "multiple" ? /* @__PURE__ */ jsx9(Button, {
|
|
4587
|
-
disabled: interactionPolicy === "passive" || colors.length >= MAX_TONE_COLORS,
|
|
4588
|
-
onPress: () => {
|
|
4589
|
-
setEditingColorIndex(colors.length);
|
|
4590
|
-
onChange({
|
|
4591
|
-
toneId: selectedTone.id,
|
|
4592
|
-
colors: [...colors, resolveOklchColor(selectedTone.accentTarget, 0)]
|
|
4593
|
-
});
|
|
4594
|
-
},
|
|
4595
|
-
children: "Add color"
|
|
4596
|
-
}) : null,
|
|
4597
|
-
selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx9(Button, {
|
|
4598
|
-
disabled: interactionPolicy === "passive",
|
|
4599
|
-
onPress: () => {
|
|
4600
|
-
const nextColors = colors.filter((_, index) => index !== currentEditingColorIndex);
|
|
4601
|
-
setEditingColorIndex(Math.min(currentEditingColorIndex, nextColors.length - 1));
|
|
4602
|
-
onChange({ toneId: selectedTone.id, colors: nextColors });
|
|
4603
|
-
},
|
|
4604
|
-
children: "Remove color"
|
|
4605
|
-
}) : null
|
|
4606
|
-
]
|
|
4607
|
-
}),
|
|
4608
|
-
/* @__PURE__ */ jsx9(ColorSpectrumSlider, {
|
|
4609
|
-
disabled: interactionPolicy === "passive",
|
|
4610
|
-
hue: resolveColorHue(selectedColor),
|
|
4611
|
-
onChange: (nextHue) => onChange({
|
|
4612
|
-
toneId: selectedTone.id,
|
|
4613
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor(selectedTone.accentTarget, nextHue) : entry)
|
|
4614
|
-
})
|
|
4615
|
-
}),
|
|
4616
|
-
/* @__PURE__ */ jsx9(ColorHexField, {
|
|
4617
|
-
disabled: interactionPolicy === "passive",
|
|
4618
|
-
onChange: (color) => onChange({
|
|
4619
|
-
toneId: selectedTone.id,
|
|
4620
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? color : entry)
|
|
4621
|
-
}),
|
|
4622
|
-
value: selectedColor
|
|
4623
|
-
}, selectedColor)
|
|
4624
|
-
]
|
|
4625
|
-
}) : null
|
|
4626
|
-
]
|
|
4627
|
-
});
|
|
4628
|
-
}
|
|
4629
|
-
function ColorToneMap({
|
|
4630
|
-
color,
|
|
4631
|
-
disabled,
|
|
4632
|
-
onChange
|
|
4633
|
-
}) {
|
|
4634
|
-
const hue = resolveColorHue(color);
|
|
4635
|
-
const { chroma, lightness } = resolveWheelColorComponents(color);
|
|
4636
|
-
const gradientId = `color-tone-${React9.useId().replaceAll(":", "")}`;
|
|
4637
|
-
const changeAt = (x, y) => {
|
|
4638
|
-
if (disabled)
|
|
4639
|
-
return;
|
|
4640
|
-
onChange(Math.max(0, Math.min(1, 1 - y / TONE_MAP_HEIGHT)), Math.max(0, Math.min(TONE_MAX_CHROMA, x / TONE_MAP_WIDTH * TONE_MAX_CHROMA)));
|
|
4641
|
-
};
|
|
4642
|
-
return /* @__PURE__ */ jsx9(ColorWheelPointerProxy, {
|
|
4643
|
-
disabled,
|
|
4644
|
-
height: TONE_MAP_HEIGHT,
|
|
4645
|
-
onChange: changeAt,
|
|
4646
|
-
width: TONE_MAP_WIDTH,
|
|
4647
|
-
children: /* @__PURE__ */ jsxs6(Svg, {
|
|
4648
|
-
accessibilityLabel: "Tone color plane",
|
|
4649
|
-
height: TONE_MAP_HEIGHT,
|
|
4650
|
-
width: TONE_MAP_WIDTH,
|
|
4651
|
-
children: [
|
|
4652
|
-
/* @__PURE__ */ jsxs6(Defs, {
|
|
4653
|
-
children: [
|
|
4654
|
-
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
4655
|
-
id: `${gradientId}-white`,
|
|
4656
|
-
x1: "0",
|
|
4657
|
-
x2: "1",
|
|
4658
|
-
y1: "0",
|
|
4659
|
-
y2: "0",
|
|
4660
|
-
children: [
|
|
4661
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
4662
|
-
offset: "0",
|
|
4663
|
-
stopColor: "white"
|
|
4664
|
-
}),
|
|
4665
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
4666
|
-
offset: "1",
|
|
4667
|
-
stopColor: resolveOklchColor({ chroma: TONE_MAX_CHROMA, lightness: 0.65 }, hue)
|
|
4668
|
-
})
|
|
4669
|
-
]
|
|
4670
|
-
}),
|
|
4671
|
-
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
4672
|
-
id: `${gradientId}-black`,
|
|
4673
|
-
x1: "0",
|
|
4674
|
-
x2: "0",
|
|
4675
|
-
y1: "0",
|
|
4676
|
-
y2: "1",
|
|
4677
|
-
children: [
|
|
4678
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
4679
|
-
offset: "0",
|
|
4680
|
-
stopColor: "transparent"
|
|
4681
|
-
}),
|
|
4682
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
4683
|
-
offset: "1",
|
|
4684
|
-
stopColor: "black"
|
|
4685
|
-
})
|
|
4686
|
-
]
|
|
4687
|
-
})
|
|
4688
|
-
]
|
|
4689
|
-
}),
|
|
4690
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
4691
|
-
fill: `url(#${gradientId}-white)`,
|
|
4692
|
-
height: TONE_MAP_HEIGHT,
|
|
4693
|
-
width: TONE_MAP_WIDTH
|
|
4694
|
-
}),
|
|
4695
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
4696
|
-
fill: `url(#${gradientId}-black)`,
|
|
4697
|
-
height: TONE_MAP_HEIGHT,
|
|
4698
|
-
width: TONE_MAP_WIDTH
|
|
4699
|
-
}),
|
|
4700
|
-
/* @__PURE__ */ jsx9(Circle, {
|
|
4701
|
-
cx: chroma / TONE_MAX_CHROMA * TONE_MAP_WIDTH,
|
|
4702
|
-
cy: (1 - lightness) * TONE_MAP_HEIGHT,
|
|
4703
|
-
fill: "none",
|
|
4704
|
-
r: 10,
|
|
4705
|
-
stroke: "white",
|
|
4706
|
-
strokeWidth: 3
|
|
4707
|
-
}),
|
|
4708
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
4709
|
-
fill: "transparent",
|
|
4710
|
-
height: TONE_MAP_HEIGHT,
|
|
4711
|
-
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4712
|
-
onResponderMove: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4713
|
-
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4714
|
-
onStartShouldSetResponder: () => !disabled,
|
|
4715
|
-
width: TONE_MAP_WIDTH
|
|
4716
|
-
})
|
|
4717
|
-
]
|
|
4718
|
-
})
|
|
4719
|
-
});
|
|
4720
|
-
}
|
|
4721
|
-
export { ColorHueScale2, ColorWheel2, ColorPicker2, ColorTone2 };
|
|
3147
|
+
export { Circle, Defs, Line, LinearGradient, Path, Polygon, RadialGradient, Rect, Stop, Svg, elements_web_default };
|