@ankhorage/zora 28.7.1 → 28.7.3
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 +13 -0
- package/README.md +1 -1
- package/dist/features/carousel/Carousel.d.ts.map +1 -1
- package/dist/features/carousel/Carousel.js +22 -4
- package/dist/features/carousel/Carousel.js.map +1 -1
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -1
- package/dist/features/form/select/adapters/inbound/Select.web.js +4 -1
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -1
- package/dist/features/form/select/composition/SelectOptionsList.d.ts +9 -0
- package/dist/features/form/select/composition/SelectOptionsList.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectOptionsList.js +17 -0
- package/dist/features/form/select/composition/SelectOptionsList.js.map +1 -0
- package/package.json +2 -2
- package/src/features/carousel/Carousel.tsx +27 -5
- package/src/features/form/select/adapters/inbound/Select.web.tsx +13 -10
- package/src/features/form/select/composition/SelectOptionsList.tsx +29 -0
- package/src/webPackageExports.test.ts +40 -0
- package/web-dist/authoring/index.d.ts +2 -2
- package/web-dist/authoring/index.js +132 -23545
- package/web-dist/chunks/{Accordion-nh0cs9hq.js → Accordion-0g45tq8n.js} +1 -43
- package/web-dist/chunks/{Accordion-rhjddvkh.js → Accordion-0zk0xp73.js} +26 -27
- package/web-dist/chunks/Accordion-2ej7s27r.js +18 -0
- package/web-dist/chunks/{Accordion-0spfxhpg.js → Accordion-2gvv7h5p.js} +22 -28
- package/web-dist/chunks/{Accordion-mpb070cf.js → Accordion-4gfrfgh5.js} +27 -33
- package/web-dist/chunks/{Accordion-3cpkxpdg.js → Accordion-53c30cqa.js} +5 -5
- package/web-dist/chunks/{Accordion-8skz71ct.js → Accordion-6gc0jw1n.js} +25 -30
- package/web-dist/chunks/Accordion-6n2r35qh.js +103 -0
- package/web-dist/chunks/Accordion-6sa9z92t.js +99 -0
- package/web-dist/chunks/{Accordion-gs838h0n.js → Accordion-772gn1m6.js} +8 -10
- package/web-dist/chunks/Accordion-7ayxbm7k.js +20 -0
- package/web-dist/chunks/{Accordion-arr9ayv0.js → Accordion-92py9m3m.js} +12 -18
- package/web-dist/chunks/{Accordion-zd15byha.js → Accordion-a6a0za8s.js} +2 -2
- package/web-dist/chunks/Accordion-c781654t.js +171 -0
- package/web-dist/chunks/{Accordion-516n2cx4.js → Accordion-ce2r66e1.js} +43 -168
- package/web-dist/chunks/{Accordion-9d38cgqj.js → Accordion-cwx73cjc.js} +4 -1426
- package/web-dist/chunks/{Accordion-1fz55hk4.js → Accordion-d15mjc4n.js} +5 -4
- package/web-dist/chunks/Accordion-ddzm7pnp.js +4721 -0
- package/web-dist/chunks/{Accordion-htvmkx8s.js → Accordion-dv5c27w4.js} +105 -41
- package/web-dist/chunks/Accordion-e8tapf5a.js +22 -0
- package/web-dist/chunks/{Accordion-78astqx3.js → Accordion-enfevvwv.js} +100 -170
- package/web-dist/chunks/{Accordion-1g91we37.js → Accordion-f7czh00h.js} +48 -205
- package/web-dist/chunks/{Accordion-2ad57stc.js → Accordion-f8dj4gbw.js} +12 -12
- package/web-dist/chunks/{Accordion-yrac5a7m.js → Accordion-fkftnxgw.js} +7 -17
- package/web-dist/chunks/Accordion-fsdgssfq.js +20 -0
- package/web-dist/chunks/Accordion-gnkzvj03.js +40 -0
- package/web-dist/chunks/{Accordion-jtgh2tep.js → Accordion-gtsxpnxf.js} +24 -30
- package/web-dist/chunks/Accordion-h7ae9ybw.js +70 -0
- package/web-dist/chunks/Accordion-hadw5304.js +78 -0
- package/web-dist/chunks/Accordion-jf0vrgw4.js +219 -0
- package/web-dist/chunks/{Accordion-agt9vt85.js → Accordion-jn70wf9s.js} +13 -13
- package/web-dist/chunks/{Accordion-9m5asd8r.js → Accordion-jqk96gt9.js} +9 -15
- package/web-dist/chunks/Accordion-kgfw6vj3.js +117 -0
- package/web-dist/chunks/Accordion-kjv0pfyp.js +136 -0
- package/web-dist/chunks/{Accordion-19aegsx2.js → Accordion-knd9nb8v.js} +21 -22
- package/web-dist/chunks/Accordion-nkv2pzj8.js +203 -0
- package/web-dist/chunks/{Accordion-5mga7hty.js → Accordion-pr1tv6jx.js} +3 -5
- package/web-dist/chunks/{Accordion-d5sz8vaq.js → Accordion-r8swmfjm.js} +5 -7
- package/web-dist/chunks/{Accordion-bexwrnfh.js → Accordion-rp9cjtpg.js} +28 -34
- package/web-dist/chunks/{Accordion-9dk62zn9.js → Accordion-sam71gw6.js} +66 -48
- package/web-dist/chunks/Accordion-se0pee16.js +213 -0
- package/web-dist/chunks/{Accordion-tdrk9cyn.js → Accordion-t9v6kw4n.js} +8 -8
- package/web-dist/chunks/{Accordion-3zzzw7a8.js → Accordion-t9w365ke.js} +3 -5
- package/web-dist/chunks/{Accordion-ar8qe05j.js → Accordion-vhr7js3e.js} +4 -4
- package/web-dist/chunks/{Accordion-ytf9ba8v.js → Accordion-w35n9p3n.js} +10 -10
- package/web-dist/chunks/{Accordion-0egwarcs.js → Accordion-wcref68q.js} +8 -8
- package/web-dist/chunks/Accordion-wf6pk2j9.js +61 -0
- package/web-dist/chunks/{Accordion-b1y5mjac.js → Accordion-x1ze1wvk.js} +1 -4
- package/web-dist/chunks/Accordion-xfwdh07r.js +235 -0
- package/web-dist/chunks/{Accordion-8t6vh482.js → Accordion-xhkphta6.js} +15 -21
- package/web-dist/chunks/{Accordion-77514sk9.js → Accordion-ycatfb1v.js} +6 -6
- package/web-dist/chunks/{Accordion-kcspvk6q.js → Accordion-ysy3ezf0.js} +9 -11
- package/web-dist/chunks/{Accordion-qjxx43r1.js → Accordion-zdwbxeq1.js} +40 -48
- package/web-dist/chunks/{Accordion-tk8zf9ff.js → Accordion-zhgty1ae.js} +10 -35
- package/web-dist/chunks/{RichTextClient-7qqj2dpw.js → RichTextClient-tsah5t7v.js} +19 -31
- package/web-dist/chunks/{Video.native-6142s9f7.js → Video.native-y947mrfb.js} +22 -32
- package/web-dist/chunks/{index-n6p0wdvg.js → index-m1y984nz.js} +547 -241
- package/web-dist/components/accordion/Accordion.dependency-0.d.ts +1 -1
- package/web-dist/components/accordion/Accordion.js +8 -14
- package/web-dist/components/accordion/Accordion.types-0.d.ts +1 -1
- package/web-dist/components/accordion-item/AccordionItem.dependency-0.d.ts +1 -1
- package/web-dist/components/accordion-item/AccordionItem.js +8 -14
- package/web-dist/components/accordion-item/AccordionItem.types-0.d.ts +1 -1
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -4
- package/web-dist/components/app-bar/AppBar.dependency-0.d.ts +1 -1
- package/web-dist/components/app-bar/AppBar.dependency-2.d.ts +1 -1
- package/web-dist/components/app-bar/AppBar.js +10 -27
- package/web-dist/components/app-bar/AppBar.types-0.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-0.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-1.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-3.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.js +10 -27
- package/web-dist/components/app-shell/AppShell.dependency-0.d.ts +1 -1
- package/web-dist/components/app-shell/AppShell.js +3 -8
- package/web-dist/components/audio/Audio.dependency-0.d.ts +1 -1
- package/web-dist/components/audio/Audio.js +17 -28
- package/web-dist/components/auth-screen/AuthScreen.dependency-0.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.dependency-3.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.dependency-4.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.js +13 -25
- package/web-dist/components/auth-screen/AuthScreen.types-0.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.dependency-0.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.dependency-2.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.js +8 -14
- package/web-dist/components/avatar/Avatar.types-0.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.dependency-1.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.dependency-3.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.js +8 -14
- package/web-dist/components/avatar-group/AvatarGroup.types-0.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-0.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-2.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-3.d.ts +1 -1
- package/web-dist/components/badge/Badge.js +3 -10
- package/web-dist/components/badge/Badge.types-0.d.ts +1 -1
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.dependency-0.d.ts +1 -1
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +13 -25
- package/web-dist/components/bottom-sheet/BottomSheet.dependency-0.d.ts +1 -1
- package/web-dist/components/bottom-sheet/BottomSheet.js +5 -13
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +5 -13
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.d.ts +1 -1
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +5 -13
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +5 -13
- package/web-dist/components/bottom-sheet-view/BottomSheetView.d.ts +1 -1
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +5 -13
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +5 -13
- package/web-dist/components/breadcrumbs/Breadcrumbs.dependency-0.d.ts +1 -1
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +17 -27
- package/web-dist/components/breadcrumbs/Breadcrumbs.types-0.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-0.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-2.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-3.d.ts +1 -1
- package/web-dist/components/button/Button.js +8 -18
- package/web-dist/components/button/Button.types-0.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.js +6 -16
- package/web-dist/components/calendar/Calendar.dependency-0.d.ts +1 -1
- package/web-dist/components/calendar/Calendar.js +9 -19
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-0.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-2.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-3.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-4.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +13 -25
- package/web-dist/components/card/Card.dependency-0.d.ts +1 -1
- package/web-dist/components/card/Card.js +12 -24
- package/web-dist/components/card/Card.types-0.d.ts +1 -1
- package/web-dist/components/card-back/CardBack.dependency-0.d.ts +1 -1
- package/web-dist/components/card-back/CardBack.js +5 -6
- package/web-dist/components/card-hand/CardHand.dependency-0.d.ts +1 -1
- package/web-dist/components/card-hand/CardHand.js +5 -6
- package/web-dist/components/carousel/Carousel.js +58 -49
- package/web-dist/components/chat-list-item/ChatListItem.dependency-1.d.ts +1 -1
- package/web-dist/components/chat-list-item/ChatListItem.dependency-3.d.ts +1 -1
- package/web-dist/components/chat-list-item/ChatListItem.js +10 -19
- package/web-dist/components/checkbox/Checkbox.dependency-0.d.ts +1 -1
- package/web-dist/components/checkbox/Checkbox.js +7 -17
- package/web-dist/components/checkbox/Checkbox.types-0.d.ts +1 -1
- package/web-dist/components/checkbox-group/CheckboxGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/checkbox-group/CheckboxGroup.js +7 -17
- package/web-dist/components/checkbox-group/CheckboxGroup.types-0.d.ts +1 -1
- package/web-dist/components/chess-board/ChessBoard.dependency-0.d.ts +1 -1
- package/web-dist/components/chess-board/ChessBoard.js +5 -7
- package/web-dist/components/chip/Chip.dependency-0.d.ts +1 -1
- package/web-dist/components/chip/Chip.dependency-2.d.ts +1 -1
- package/web-dist/components/chip/Chip.dependency-3.d.ts +1 -1
- package/web-dist/components/chip/Chip.js +8 -15
- package/web-dist/components/chip/Chip.types-0.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-3.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.js +8 -15
- package/web-dist/components/chip-group/ChipGroup.types-0.d.ts +1 -1
- package/web-dist/components/collection-editor/CollectionEditor.dependency-0.d.ts +1 -1
- package/web-dist/components/collection-editor/CollectionEditor.js +19 -31
- package/web-dist/components/color-hue-scale/ColorHueScale.dependency-0.d.ts +1 -1
- package/web-dist/components/color-hue-scale/ColorHueScale.js +19 -35
- package/web-dist/components/color-picker/ColorPicker.dependency-0.d.ts +1 -1
- package/web-dist/components/color-picker/ColorPicker.js +19 -35
- package/web-dist/components/color-tone/ColorTone.dependency-0.d.ts +1 -1
- package/web-dist/components/color-tone/ColorTone.js +19 -35
- package/web-dist/components/color-wheel/ColorWheel.dependency-0.d.ts +1 -1
- package/web-dist/components/color-wheel/ColorWheel.js +19 -35
- package/web-dist/components/content-rail/ContentRail.dependency-0.d.ts +1 -1
- package/web-dist/components/content-rail/ContentRail.js +23 -35
- package/web-dist/components/data-table/DataTable.dependency-0.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.dependency-2.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.js +67 -101
- package/web-dist/components/data-table/DataTable.types-0.d.ts +1 -1
- package/web-dist/components/date-picker/DatePicker.dependency-0.d.ts +1 -1
- package/web-dist/components/date-picker/DatePicker.js +16 -32
- package/web-dist/components/dialog/Dialog.dependency-0.d.ts +1 -1
- package/web-dist/components/dialog/Dialog.js +7 -18
- package/web-dist/components/divider/Divider.dependency-0.d.ts +1 -1
- package/web-dist/components/divider/Divider.js +3 -8
- package/web-dist/components/divider/Divider.types-0.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-0.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-2.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-3.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.js +13 -25
- package/web-dist/components/explorer/Explorer.dependency-0.d.ts +1 -1
- package/web-dist/components/explorer/Explorer.js +10 -16
- package/web-dist/components/field/Field.dependency-0.d.ts +1 -1
- package/web-dist/components/field/Field.dependency-1.d.ts +1 -1
- package/web-dist/components/field/Field.js +7 -15
- package/web-dist/components/file-explorer/FileExplorer.dependency-0.d.ts +1 -1
- package/web-dist/components/file-explorer/FileExplorer.js +10 -16
- package/web-dist/components/flat-list/FlatList.dependency-0.d.ts +1 -1
- package/web-dist/components/flat-list/FlatList.js +8 -17
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-0.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-3.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-4.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +13 -25
- package/web-dist/components/form/Form.dependency-0.d.ts +1 -1
- package/web-dist/components/form/Form.js +9 -20
- package/web-dist/components/form-actions/FormActions.dependency-0.d.ts +1 -1
- package/web-dist/components/form-actions/FormActions.js +9 -20
- package/web-dist/components/form-error/FormError.dependency-0.d.ts +1 -1
- package/web-dist/components/form-error/FormError.js +9 -20
- package/web-dist/components/game/Game.dependency-0.d.ts +1 -1
- package/web-dist/components/game/Game.js +4 -10
- package/web-dist/components/game-entity/GameEntity.dependency-0.d.ts +1 -1
- package/web-dist/components/game-entity/GameEntity.js +4 -10
- package/web-dist/components/game-field/GameField.dependency-0.d.ts +1 -1
- package/web-dist/components/game-field/GameField.js +4 -10
- package/web-dist/components/game-input-zone/GameInputZone.dependency-0.d.ts +1 -1
- package/web-dist/components/game-input-zone/GameInputZone.js +4 -10
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.dependency-0.d.ts +1 -1
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -10
- package/web-dist/components/game-overlay/GameOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/game-overlay/GameOverlay.js +4 -10
- package/web-dist/components/gradient/Gradient.dependency-0.d.ts +1 -1
- package/web-dist/components/gradient/Gradient.dependency-2.d.ts +1 -1
- package/web-dist/components/gradient/Gradient.js +4 -9
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -9
- package/web-dist/components/graph-view/GraphView.js +3 -5
- package/web-dist/components/grid/Grid.dependency-0.d.ts +1 -1
- package/web-dist/components/grid/Grid.js +3 -8
- package/web-dist/components/grid/Grid.types-0.d.ts +1 -1
- package/web-dist/components/grid-interactions/GridInteractions.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-interactions/GridInteractions.js +2 -8
- package/web-dist/components/grid-line-overlay/GridLineOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -6
- package/web-dist/components/grid-ruler/GridRuler.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-ruler/GridRuler.js +4 -6
- package/web-dist/components/grid-view/GridView.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +1 -2
- package/web-dist/components/heading/Heading.dependency-0.d.ts +1 -1
- package/web-dist/components/heading/Heading.dependency-2.d.ts +1 -1
- package/web-dist/components/heading/Heading.js +5 -8
- package/web-dist/components/heading/Heading.types-0.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-0.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-2.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-3.d.ts +1 -1
- package/web-dist/components/hero/Hero.js +20 -32
- package/web-dist/components/icon/Icon.dependency-0.d.ts +1 -1
- package/web-dist/components/icon/Icon.js +3 -7
- package/web-dist/components/icon/Icon.types-0.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-0.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-2.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-3.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-4.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.js +6 -16
- package/web-dist/components/icon-button/IconButton.types-0.d.ts +1 -1
- package/web-dist/components/image/Image.dependency-0.d.ts +1 -1
- package/web-dist/components/image/Image.js +6 -12
- package/web-dist/components/image/Image.types-0.d.ts +1 -1
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.dependency-0.d.ts +1 -1
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -5
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.types-0.d.ts +1 -1
- package/web-dist/components/link/Link.dependency-0.d.ts +1 -1
- package/web-dist/components/link/Link.dependency-3.d.ts +1 -1
- package/web-dist/components/link/Link.js +9 -12
- package/web-dist/components/link/Link.types-0.d.ts +1 -1
- package/web-dist/components/list/List.dependency-0.d.ts +1 -1
- package/web-dist/components/list/List.js +8 -17
- package/web-dist/components/list/List.types-0.d.ts +1 -1
- package/web-dist/components/list-item/ListItem.dependency-0.d.ts +1 -1
- package/web-dist/components/list-item/ListItem.js +8 -17
- package/web-dist/components/list-item/ListItem.types-0.d.ts +1 -1
- package/web-dist/components/list-section/ListSection.dependency-0.d.ts +1 -1
- package/web-dist/components/list-section/ListSection.js +8 -17
- package/web-dist/components/list-section/ListSection.types-0.d.ts +1 -1
- package/web-dist/components/master-detail/MasterDetail.dependency-0.d.ts +1 -1
- package/web-dist/components/master-detail/MasterDetail.js +4 -17
- package/web-dist/components/matrix-grid/MatrixGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/matrix-grid/MatrixGrid.js +14 -23
- package/web-dist/components/media-card/MediaCard.dependency-0.d.ts +1 -1
- package/web-dist/components/media-card/MediaCard.js +12 -24
- package/web-dist/components/media-explorer/MediaExplorer.dependency-0.d.ts +1 -1
- package/web-dist/components/media-explorer/MediaExplorer.js +10 -16
- package/web-dist/components/message-bubble/MessageBubble.dependency-1.d.ts +1 -1
- package/web-dist/components/message-bubble/MessageBubble.dependency-3.d.ts +1 -1
- package/web-dist/components/message-bubble/MessageBubble.js +10 -19
- package/web-dist/components/metric-card/MetricCard.dependency-0.d.ts +1 -1
- package/web-dist/components/metric-card/MetricCard.dependency-3.d.ts +1 -1
- package/web-dist/components/metric-card/MetricCard.js +12 -24
- package/web-dist/components/metric-card/MetricCard.types-0.d.ts +1 -1
- package/web-dist/components/missing-element/MissingElement.dependency-0.d.ts +1 -1
- package/web-dist/components/missing-element/MissingElement.js +15 -27
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-2.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-3.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-4.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +13 -25
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.types-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-2.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-3.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-4.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +13 -25
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.types-0.d.ts +1 -1
- package/web-dist/components/opening-book/OpeningBook.dependency-0.d.ts +1 -1
- package/web-dist/components/opening-book/OpeningBook.js +5 -7
- package/web-dist/components/otp-form/OtpForm.dependency-0.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.dependency-3.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.dependency-4.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.js +13 -25
- package/web-dist/components/pagination/Pagination.dependency-0.d.ts +1 -1
- package/web-dist/components/pagination/Pagination.js +16 -26
- package/web-dist/components/palette-item/PaletteItem.dependency-0.d.ts +1 -1
- package/web-dist/components/palette-item/PaletteItem.js +17 -29
- package/web-dist/components/palette-item/PaletteItem.types-0.d.ts +1 -1
- package/web-dist/components/playing-card/PlayingCard.dependency-0.d.ts +1 -1
- package/web-dist/components/playing-card/PlayingCard.js +5 -6
- package/web-dist/components/poker-training-table/PokerTrainingTable.dependency-0.d.ts +1 -1
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +5 -6
- package/web-dist/components/popover/Popover.dependency-0.d.ts +1 -1
- package/web-dist/components/popover/Popover.js +4 -10
- package/web-dist/components/popover/Popover.types-0.d.ts +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.dependency-0.d.ts +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.js +6 -21
- package/web-dist/components/popover-menu/PopoverMenu.types-0.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.dependency-1.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.dependency-4.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.js +12 -24
- package/web-dist/components/post-card/PostCard.types-0.d.ts +1 -1
- package/web-dist/components/product-card/ProductCard.dependency-0.d.ts +1 -1
- package/web-dist/components/product-card/ProductCard.js +12 -24
- package/web-dist/components/progress/Progress.dependency-0.d.ts +1 -1
- package/web-dist/components/progress/Progress.dependency-2.d.ts +1 -1
- package/web-dist/components/progress/Progress.dependency-3.d.ts +1 -1
- package/web-dist/components/progress/Progress.js +7 -12
- package/web-dist/components/progress-ring/ProgressRing.dependency-0.d.ts +1 -1
- package/web-dist/components/progress-ring/ProgressRing.dependency-2.d.ts +1 -1
- package/web-dist/components/progress-ring/ProgressRing.js +7 -12
- package/web-dist/components/radio/Radio.dependency-0.d.ts +1 -1
- package/web-dist/components/radio/Radio.js +8 -19
- package/web-dist/components/radio/Radio.types-0.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.js +8 -19
- package/web-dist/components/radio-group/RadioGroup.types-0.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-0.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-2.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-3.d.ts +1 -1
- package/web-dist/components/rating/Rating.js +7 -13
- package/web-dist/components/reader/Reader.dependency-0.d.ts +1 -1
- package/web-dist/components/reader/Reader.js +25 -45
- package/web-dist/components/rich-text/RichText.dependency-0.d.ts +1 -1
- package/web-dist/components/rich-text/RichText.js +5 -6
- package/web-dist/components/scan-overlay/ScanOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/scan-overlay/ScanOverlay.js +13 -25
- package/web-dist/components/screen/Screen.dependency-0.d.ts +1 -1
- package/web-dist/components/screen/Screen.js +3 -8
- package/web-dist/components/screen-section/ScreenSection.dependency-0.d.ts +1 -1
- package/web-dist/components/screen-section/ScreenSection.js +7 -12
- package/web-dist/components/scroll-view/ScrollView.dependency-0.d.ts +1 -1
- package/web-dist/components/scroll-view/ScrollView.js +3 -8
- package/web-dist/components/scroll-view/ScrollView.types-0.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.dependency-0.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.dependency-2.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.js +8 -18
- package/web-dist/components/section-header/SectionHeader.dependency-0.d.ts +1 -1
- package/web-dist/components/section-header/SectionHeader.js +7 -12
- package/web-dist/components/section-list/SectionList.dependency-0.d.ts +1 -1
- package/web-dist/components/section-list/SectionList.js +8 -17
- package/web-dist/components/select/Select.dependency-0.d.ts +1 -1
- package/web-dist/components/select/Select.dependency-2.d.ts +1 -1
- package/web-dist/components/select/Select.js +13 -28
- package/web-dist/components/select/Select.types-0.d.ts +1 -1
- package/web-dist/components/selectable-item/SelectableItem.dependency-0.d.ts +1 -1
- package/web-dist/components/selectable-item/SelectableItem.js +3 -5
- package/web-dist/components/selectable-item/SelectableItem.types-0.d.ts +1 -1
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -5
- package/web-dist/components/selection-provider/SelectionProvider.types-0.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-0.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-3.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-4.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.js +13 -25
- package/web-dist/components/sign-up-form/SignUpForm.dependency-0.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.dependency-3.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.dependency-4.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.js +13 -25
- package/web-dist/components/skeleton/Skeleton.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton/Skeleton.dependency-2.d.ts +1 -1
- package/web-dist/components/skeleton/Skeleton.js +15 -27
- package/web-dist/components/skeleton-card/SkeletonCard.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-card/SkeletonCard.js +15 -27
- package/web-dist/components/skeleton-list/SkeletonList.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-list/SkeletonList.js +15 -27
- package/web-dist/components/skeleton-text/SkeletonText.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-text/SkeletonText.dependency-2.d.ts +1 -1
- package/web-dist/components/skeleton-text/SkeletonText.js +15 -27
- package/web-dist/components/spatial-grid/SpatialGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/spatial-grid/SpatialGrid.js +4 -10
- package/web-dist/components/surface/Surface.dependency-0.d.ts +1 -1
- package/web-dist/components/surface/Surface.js +3 -10
- package/web-dist/components/surface/Surface.types-0.d.ts +1 -1
- package/web-dist/components/switch/Switch.dependency-0.d.ts +1 -1
- package/web-dist/components/switch/Switch.js +7 -121
- package/web-dist/components/switch/Switch.types-0.d.ts +1 -1
- package/web-dist/components/tab/Tab.dependency-0.d.ts +1 -1
- package/web-dist/components/tab/Tab.js +3 -12
- package/web-dist/components/tab/Tab.types-0.d.ts +1 -1
- package/web-dist/components/tab-list/TabList.dependency-0.d.ts +1 -1
- package/web-dist/components/tab-list/TabList.js +3 -12
- package/web-dist/components/tab-list/TabList.types-0.d.ts +1 -1
- package/web-dist/components/tab-panel/TabPanel.dependency-0.d.ts +1 -1
- package/web-dist/components/tab-panel/TabPanel.js +3 -12
- package/web-dist/components/tab-panel/TabPanel.types-0.d.ts +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.dependency-0.d.ts +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.js +5 -6
- package/web-dist/components/tabs/Tabs.dependency-0.d.ts +1 -1
- package/web-dist/components/tabs/Tabs.js +3 -12
- package/web-dist/components/tabs/Tabs.types-0.d.ts +1 -1
- package/web-dist/components/text/Text.dependency-0.d.ts +1 -1
- package/web-dist/components/text/Text.dependency-2.d.ts +1 -1
- package/web-dist/components/text/Text.js +7 -10
- package/web-dist/components/text/Text.types-0.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.dependency-0.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.dependency-2.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.js +9 -19
- package/web-dist/components/text-input/TextInput.types-0.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-0.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-2.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-3.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-4.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-5.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +8 -18
- package/web-dist/components/tile-grid/TileGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/tile-grid/TileGrid.js +1 -2
- package/web-dist/components/time-grid/TimeGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/time-grid/TimeGrid.js +6 -12
- package/web-dist/components/time-picker/TimePicker.dependency-0.d.ts +1 -1
- package/web-dist/components/time-picker/TimePicker.js +18 -39
- package/web-dist/components/timeline/Timeline.dependency-0.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.dependency-2.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.dependency-4.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.js +15 -21
- package/web-dist/components/timeline/Timeline.types-0.d.ts +1 -1
- package/web-dist/components/toast/Toast.dependency-0.d.ts +1 -1
- package/web-dist/components/toast/Toast.js +3 -14
- package/web-dist/components/toast/Toast.types-0.d.ts +1 -1
- package/web-dist/components/toast-provider/ToastProvider.js +3 -14
- package/web-dist/components/toast-provider/ToastProvider.types-0.d.ts +1 -1
- package/web-dist/components/toolbar/Toolbar.dependency-0.d.ts +1 -1
- package/web-dist/components/toolbar/Toolbar.js +13 -25
- package/web-dist/components/tree-item/TreeItem.dependency-0.d.ts +1 -1
- package/web-dist/components/tree-item/TreeItem.js +16 -32
- package/web-dist/components/tree-item/TreeItem.types-0.d.ts +1 -1
- package/web-dist/components/tree-view/TreeView.js +1 -1
- package/web-dist/components/uploader/Uploader.dependency-0.d.ts +1 -1
- package/web-dist/components/uploader/Uploader.js +28 -44
- package/web-dist/components/video/Video.dependency-0.d.ts +1 -1
- package/web-dist/components/video/Video.dependency-2.d.ts +1 -1
- package/web-dist/components/video/Video.js +11 -17
- package/web-dist/components/view/View.dependency-0.d.ts +1 -1
- package/web-dist/components/view/View.js +3 -8
- package/web-dist/components/view/View.types-0.d.ts +1 -1
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -8
- package/web-dist/manifest.json +1104 -2714
- package/web-dist/runtime/ZoraProvider.js +19 -178
- package/web-dist/chunks/Accordion-0dj1r7w3.js +0 -13528
- package/web-dist/chunks/Accordion-224snqz3.js +0 -89
- package/web-dist/chunks/Accordion-23k6n6zk.js +0 -278
- package/web-dist/chunks/Accordion-2yat0x6x.js +0 -188
- package/web-dist/chunks/Accordion-4mg3epm9.js +0 -405
- package/web-dist/chunks/Accordion-4qrva6ye.js +0 -15
- package/web-dist/chunks/Accordion-4yrszsvs.js +0 -273
- package/web-dist/chunks/Accordion-5z75befg.js +0 -69
- package/web-dist/chunks/Accordion-61e19g3e.js +0 -1
- package/web-dist/chunks/Accordion-6a2hscrx.js +0 -50
- package/web-dist/chunks/Accordion-6zb9d92y.js +0 -87
- package/web-dist/chunks/Accordion-76b0qz8y.js +0 -41
- package/web-dist/chunks/Accordion-7nn4r909.js +0 -81
- package/web-dist/chunks/Accordion-7v6mrp8n.js +0 -311
- package/web-dist/chunks/Accordion-9b4bsxwe.js +0 -46
- package/web-dist/chunks/Accordion-9tgvr155.js +0 -9575
- package/web-dist/chunks/Accordion-a5fsrv3x.js +0 -198
- package/web-dist/chunks/Accordion-akwd4brm.js +0 -397
- package/web-dist/chunks/Accordion-c6edgxay.js +0 -1
- package/web-dist/chunks/Accordion-chdbfcm6.js +0 -93
- package/web-dist/chunks/Accordion-eqvdv7tt.js +0 -1
- package/web-dist/chunks/Accordion-fre84yaq.js +0 -12
- package/web-dist/chunks/Accordion-j1zerr6z.js +0 -389
- package/web-dist/chunks/Accordion-khfjh10v.js +0 -82
- package/web-dist/chunks/Accordion-ktscjwa2.js +0 -213
- package/web-dist/chunks/Accordion-mnac2z83.js +0 -21
- package/web-dist/chunks/Accordion-mnxf855g.js +0 -121
- package/web-dist/chunks/Accordion-mrstcjcm.js +0 -28
- package/web-dist/chunks/Accordion-mx7nkg85.js +0 -34
- package/web-dist/chunks/Accordion-pdjhezmz.js +0 -43
- package/web-dist/chunks/Accordion-q8a423pk.js +0 -379
- package/web-dist/chunks/Accordion-qjxbf8nt.js +0 -150
- package/web-dist/chunks/Accordion-sfvqf4fz.js +0 -1299
- package/web-dist/chunks/Accordion-sj30964p.js +0 -1350
- package/web-dist/chunks/Accordion-vx8bjm5k.js +0 -263
- package/web-dist/chunks/Accordion-wgc67k1g.js +0 -93
- package/web-dist/chunks/Accordion-ww4f12ty.js +0 -200
- package/web-dist/chunks/Accordion-xgpzh4wq.js +0 -18061
- package/web-dist/chunks/Accordion-xhxv2v0g.js +0 -196
|
@@ -1,1350 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
isHexColor,
|
|
4
|
-
parseHexColorOrThrow,
|
|
5
|
-
converter_default,
|
|
6
|
-
formatHex,
|
|
7
|
-
COLOR_HARMONY_CATALOG,
|
|
8
|
-
generateHarmonyRoleColors,
|
|
9
|
-
generateColorSwatch
|
|
10
|
-
} from "./Accordion-9d38cgqj.js";
|
|
11
|
-
import {
|
|
12
|
-
Pressable
|
|
13
|
-
} from "./Accordion-mnxf855g.js";
|
|
14
|
-
import {
|
|
15
|
-
withZoraThemeScope
|
|
16
|
-
} from "./Accordion-tk8zf9ff.js";
|
|
17
|
-
import {
|
|
18
|
-
View2,
|
|
19
|
-
Divider2
|
|
20
|
-
} from "./Accordion-4mg3epm9.js";
|
|
21
|
-
import {
|
|
22
|
-
Heading2,
|
|
23
|
-
Text3
|
|
24
|
-
} from "./Accordion-8skz71ct.js";
|
|
25
|
-
import {
|
|
26
|
-
useClipboardWriter,
|
|
27
|
-
writeClipboardTextAsync
|
|
28
|
-
} from "./Accordion-chdbfcm6.js";
|
|
29
|
-
import {
|
|
30
|
-
TextInput2
|
|
31
|
-
} from "./Accordion-xhxv2v0g.js";
|
|
32
|
-
import {
|
|
33
|
-
Button2,
|
|
34
|
-
Circle,
|
|
35
|
-
Defs,
|
|
36
|
-
Line,
|
|
37
|
-
LinearGradient,
|
|
38
|
-
Path,
|
|
39
|
-
Polygon,
|
|
40
|
-
RadialGradient,
|
|
41
|
-
Rect,
|
|
42
|
-
Stop,
|
|
43
|
-
Svg,
|
|
44
|
-
IconButton2
|
|
45
|
-
} from "./Accordion-9tgvr155.js";
|
|
46
|
-
import {
|
|
47
|
-
Card2
|
|
48
|
-
} from "./Accordion-78astqx3.js";
|
|
49
|
-
import {
|
|
50
|
-
Icon2
|
|
51
|
-
} from "./Accordion-3zzzw7a8.js";
|
|
52
|
-
import {
|
|
53
|
-
Select2
|
|
54
|
-
} from "./Accordion-9dk62zn9.js";
|
|
55
|
-
import {
|
|
56
|
-
Gradient2
|
|
57
|
-
} from "./Accordion-zd15byha.js";
|
|
58
|
-
import {
|
|
59
|
-
useZoraTheme2
|
|
60
|
-
} from "./Accordion-b1y5mjac.js";
|
|
61
|
-
import {
|
|
62
|
-
require_cjs
|
|
63
|
-
} from "./Accordion-xgpzh4wq.js";
|
|
64
|
-
import {
|
|
65
|
-
__toESM
|
|
66
|
-
} from "./Accordion-nh0cs9hq.js";
|
|
67
|
-
|
|
68
|
-
// src/features/color/ColorHexField.tsx
|
|
69
|
-
import React from "react";
|
|
70
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
71
|
-
function ColorHexField({
|
|
72
|
-
disabled,
|
|
73
|
-
onChange,
|
|
74
|
-
value
|
|
75
|
-
}) {
|
|
76
|
-
const [input, setInput] = React.useState(value);
|
|
77
|
-
const [previousValue, setPreviousValue] = React.useState(value);
|
|
78
|
-
const [copyFeedback, setCopyFeedback] = React.useState();
|
|
79
|
-
const clipboardWriter = useClipboardWriter();
|
|
80
|
-
const { theme } = useZoraTheme2();
|
|
81
|
-
if (value !== previousValue) {
|
|
82
|
-
setPreviousValue(value);
|
|
83
|
-
setInput(value);
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ jsxs(View2, {
|
|
86
|
-
children: [
|
|
87
|
-
/* @__PURE__ */ jsx(TextInput2, {
|
|
88
|
-
accessibilityLabel: "Color hex value",
|
|
89
|
-
disabled,
|
|
90
|
-
leadingAccessory: /* @__PURE__ */ jsx(View2, {
|
|
91
|
-
bg: value,
|
|
92
|
-
borderColor: theme.semantics.border.default,
|
|
93
|
-
borderWidth: 1,
|
|
94
|
-
height: 30,
|
|
95
|
-
radius: "s",
|
|
96
|
-
width: 30
|
|
97
|
-
}),
|
|
98
|
-
onChangeText: (nextValue) => {
|
|
99
|
-
setInput(nextValue);
|
|
100
|
-
if (isHexColor(nextValue))
|
|
101
|
-
onChange(nextValue);
|
|
102
|
-
},
|
|
103
|
-
trailingAccessory: /* @__PURE__ */ jsx(IconButton2, {
|
|
104
|
-
iconName: copyFeedback === "Color hex copied." ? "checkmark" : copyFeedback ? "warning" : "copy-outline",
|
|
105
|
-
label: copyFeedback ?? "Copy color hex value",
|
|
106
|
-
disabled,
|
|
107
|
-
onPress: () => {
|
|
108
|
-
writeClipboardTextAsync(clipboardWriter, value).then((result) => {
|
|
109
|
-
setCopyFeedback(result === "written" ? "Color hex copied." : result === "denied" ? "Clipboard access was denied." : "Clipboard is unavailable.");
|
|
110
|
-
});
|
|
111
|
-
},
|
|
112
|
-
variant: "ghost"
|
|
113
|
-
}),
|
|
114
|
-
value: input
|
|
115
|
-
}),
|
|
116
|
-
copyFeedback ? /* @__PURE__ */ jsx(Text3, {
|
|
117
|
-
accessibilityLiveRegion: "polite",
|
|
118
|
-
emphasis: "muted",
|
|
119
|
-
style: { position: "absolute", opacity: 0 },
|
|
120
|
-
variant: "caption",
|
|
121
|
-
children: copyFeedback
|
|
122
|
-
}) : null
|
|
123
|
-
]
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/features/color/ColorSpectrumSlider.tsx
|
|
128
|
-
import React3 from "react";
|
|
129
|
-
|
|
130
|
-
// src/features/color/ColorHorizontalPointerProxy.web.tsx
|
|
131
|
-
import React2 from "react";
|
|
132
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
133
|
-
function ColorHorizontalPointerProxy({
|
|
134
|
-
children,
|
|
135
|
-
disabled,
|
|
136
|
-
onChange,
|
|
137
|
-
width
|
|
138
|
-
}) {
|
|
139
|
-
const dragging = React2.useRef(false);
|
|
140
|
-
const changeAt = (event) => {
|
|
141
|
-
const target = event.currentTarget;
|
|
142
|
-
const rect = target.getBoundingClientRect();
|
|
143
|
-
onChange((event.clientX - rect.left) / rect.width * width);
|
|
144
|
-
};
|
|
145
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
146
|
-
onMouseDown: (event) => {
|
|
147
|
-
if (disabled)
|
|
148
|
-
return;
|
|
149
|
-
dragging.current = true;
|
|
150
|
-
changeAt(event);
|
|
151
|
-
},
|
|
152
|
-
onMouseMove: (event) => {
|
|
153
|
-
if (!disabled && dragging.current)
|
|
154
|
-
changeAt(event);
|
|
155
|
-
},
|
|
156
|
-
onMouseUp: (event) => {
|
|
157
|
-
if (!disabled && dragging.current)
|
|
158
|
-
changeAt(event);
|
|
159
|
-
dragging.current = false;
|
|
160
|
-
},
|
|
161
|
-
style: { touchAction: "none" },
|
|
162
|
-
children
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
// src/features/color/utils/resolveOklchColor.ts
|
|
166
|
-
function resolveOklchColor(target, hue) {
|
|
167
|
-
const formatted = formatHex({ mode: "oklch", l: target.lightness, c: target.chroma, h: hue });
|
|
168
|
-
if (!formatted)
|
|
169
|
-
throw new Error("The supplied OKLCH target cannot be represented as a hex color.");
|
|
170
|
-
return parseHexColorOrThrow(formatted);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// src/features/color/ColorSpectrumSlider.tsx
|
|
174
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
175
|
-
var SPECTRUM_WIDTH = 280;
|
|
176
|
-
var SPECTRUM_HUES = [0, 60, 120, 180, 240, 300, 360];
|
|
177
|
-
function ColorSpectrumSlider({
|
|
178
|
-
disabled,
|
|
179
|
-
hue,
|
|
180
|
-
label = "Hue",
|
|
181
|
-
onChange
|
|
182
|
-
}) {
|
|
183
|
-
const { theme } = useZoraTheme2();
|
|
184
|
-
const [trackWidth, setTrackWidth] = React3.useState(SPECTRUM_WIDTH);
|
|
185
|
-
const gradientId = `color-spectrum-${React3.useId().replaceAll(":", "")}`;
|
|
186
|
-
const changeAt = (locationX) => {
|
|
187
|
-
if (!disabled)
|
|
188
|
-
onChange(Math.max(0, Math.min(360, locationX / trackWidth * 360)));
|
|
189
|
-
};
|
|
190
|
-
return /* @__PURE__ */ jsxs2(View2, {
|
|
191
|
-
gap: "xxs",
|
|
192
|
-
width: "100%",
|
|
193
|
-
children: [
|
|
194
|
-
/* @__PURE__ */ jsxs2(View2, {
|
|
195
|
-
direction: "row",
|
|
196
|
-
justify: "space-between",
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */ jsx3(Text3, {
|
|
199
|
-
variant: "label",
|
|
200
|
-
children: label
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ jsx3(Text3, {
|
|
203
|
-
variant: "label",
|
|
204
|
-
children: `${Math.round(hue)}°`
|
|
205
|
-
})
|
|
206
|
-
]
|
|
207
|
-
}),
|
|
208
|
-
/* @__PURE__ */ jsx3(ColorHorizontalPointerProxy, {
|
|
209
|
-
disabled,
|
|
210
|
-
onChange: changeAt,
|
|
211
|
-
width: SPECTRUM_WIDTH,
|
|
212
|
-
children: /* @__PURE__ */ jsxs2(Svg, {
|
|
213
|
-
accessibilityLabel: `${label} spectrum`,
|
|
214
|
-
height: 36,
|
|
215
|
-
onLayout: (event) => setTrackWidth(Math.max(1, event.nativeEvent.layout.width)),
|
|
216
|
-
viewBox: `0 0 ${SPECTRUM_WIDTH} 36`,
|
|
217
|
-
width: "100%",
|
|
218
|
-
children: [
|
|
219
|
-
/* @__PURE__ */ jsx3(Defs, {
|
|
220
|
-
children: /* @__PURE__ */ jsx3(LinearGradient, {
|
|
221
|
-
id: gradientId,
|
|
222
|
-
x1: "0",
|
|
223
|
-
x2: "1",
|
|
224
|
-
y1: "0",
|
|
225
|
-
y2: "0",
|
|
226
|
-
children: SPECTRUM_HUES.map((stopHue, index) => /* @__PURE__ */ jsx3(Stop, {
|
|
227
|
-
offset: String(index / (SPECTRUM_HUES.length - 1)),
|
|
228
|
-
stopColor: resolveOklchColor({ lightness: 0.65, chroma: 0.2 }, stopHue)
|
|
229
|
-
}, stopHue))
|
|
230
|
-
})
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ jsx3(Rect, {
|
|
233
|
-
fill: `url(#${gradientId})`,
|
|
234
|
-
height: 12,
|
|
235
|
-
rx: 6,
|
|
236
|
-
width: SPECTRUM_WIDTH,
|
|
237
|
-
y: 12
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ jsx3(Circle, {
|
|
240
|
-
cx: hue / 360 * SPECTRUM_WIDTH,
|
|
241
|
-
cy: 18,
|
|
242
|
-
fill: "white",
|
|
243
|
-
r: 10,
|
|
244
|
-
stroke: theme.semantics.content.default,
|
|
245
|
-
strokeWidth: 2
|
|
246
|
-
}),
|
|
247
|
-
/* @__PURE__ */ jsx3(Rect, {
|
|
248
|
-
fill: "transparent",
|
|
249
|
-
height: 36,
|
|
250
|
-
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX),
|
|
251
|
-
onResponderMove: (event) => changeAt(event.nativeEvent.locationX),
|
|
252
|
-
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX),
|
|
253
|
-
onStartShouldSetResponder: () => !disabled,
|
|
254
|
-
width: SPECTRUM_WIDTH
|
|
255
|
-
})
|
|
256
|
-
]
|
|
257
|
-
})
|
|
258
|
-
})
|
|
259
|
-
]
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// src/features/color/utils/resolveColorAtHue.ts
|
|
264
|
-
var toOklch = converter_default("oklch");
|
|
265
|
-
function resolveColorAtHue(color, hue) {
|
|
266
|
-
const parsed = toOklch(color);
|
|
267
|
-
if (!parsed || typeof parsed.l !== "number" || typeof parsed.c !== "number")
|
|
268
|
-
return color;
|
|
269
|
-
const formatted = formatHex({ mode: "oklch", l: parsed.l, c: parsed.c, h: hue });
|
|
270
|
-
return formatted ? parseHexColorOrThrow(formatted) : color;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// src/features/color/utils/resolveColorHue.ts
|
|
274
|
-
var toOklch2 = converter_default("oklch");
|
|
275
|
-
function resolveColorHue(color) {
|
|
276
|
-
const parsed = toOklch2(color);
|
|
277
|
-
return typeof parsed?.h === "number" ? parsed.h : 0;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// src/features/color/ColorHueScale.tsx
|
|
281
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
282
|
-
var ColorHueScale2 = withZoraThemeScope(ColorHueScaleInner);
|
|
283
|
-
function ColorHueScaleInner({
|
|
284
|
-
themeId: _themeId,
|
|
285
|
-
mode: _mode,
|
|
286
|
-
inverted: _inverted,
|
|
287
|
-
interactionPolicy,
|
|
288
|
-
value,
|
|
289
|
-
onChange,
|
|
290
|
-
testID
|
|
291
|
-
}) {
|
|
292
|
-
const { theme } = useZoraTheme2();
|
|
293
|
-
const { swatch } = generateColorSwatch(value);
|
|
294
|
-
const swatches = Object.entries(swatch);
|
|
295
|
-
return /* @__PURE__ */ jsxs3(View2, {
|
|
296
|
-
gap: "m",
|
|
297
|
-
testID,
|
|
298
|
-
children: [
|
|
299
|
-
/* @__PURE__ */ jsx4(ColorSpectrumSlider, {
|
|
300
|
-
disabled: interactionPolicy === "passive",
|
|
301
|
-
hue: resolveColorHue(value),
|
|
302
|
-
onChange: (nextHue) => onChange(resolveColorAtHue(value, nextHue))
|
|
303
|
-
}),
|
|
304
|
-
/* @__PURE__ */ jsx4(Text3, {
|
|
305
|
-
variant: "label",
|
|
306
|
-
children: "Intensity"
|
|
307
|
-
}),
|
|
308
|
-
/* @__PURE__ */ jsx4(View2, {
|
|
309
|
-
accessibilityLabel: "Color scale previews; choose a preview as the next 500 base color",
|
|
310
|
-
direction: "row",
|
|
311
|
-
gap: "xs",
|
|
312
|
-
wrap: "wrap",
|
|
313
|
-
children: swatches.map(([step, color]) => /* @__PURE__ */ jsx4(Pressable, {
|
|
314
|
-
accessibilityLabel: Number(step) === 500 ? `Current editable base color 500: ${color}` : `Use generated ${step} preview ${color} as the next base color 500`,
|
|
315
|
-
bg: color,
|
|
316
|
-
borderColor: theme.semantics.border.default,
|
|
317
|
-
borderWidth: Number(step) === 500 ? 3 : 1,
|
|
318
|
-
disabled: interactionPolicy === "passive",
|
|
319
|
-
height: 48,
|
|
320
|
-
onPress: () => onChange(color),
|
|
321
|
-
radius: "s",
|
|
322
|
-
width: "18%",
|
|
323
|
-
children: /* @__PURE__ */ jsx4(Text3, {
|
|
324
|
-
align: "center",
|
|
325
|
-
variant: "caption",
|
|
326
|
-
children: step
|
|
327
|
-
})
|
|
328
|
-
}, step))
|
|
329
|
-
}),
|
|
330
|
-
/* @__PURE__ */ jsx4(ColorHexField, {
|
|
331
|
-
disabled: interactionPolicy === "passive",
|
|
332
|
-
onChange,
|
|
333
|
-
value
|
|
334
|
-
}, value)
|
|
335
|
-
]
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
// src/features/color/ColorPicker.tsx
|
|
339
|
-
var import_react_native = __toESM(require_cjs(), 1);
|
|
340
|
-
import React6 from "react";
|
|
341
|
-
|
|
342
|
-
// src/features/color/ColorWheel.tsx
|
|
343
|
-
import React5 from "react";
|
|
344
|
-
|
|
345
|
-
// src/features/color/ColorWheelKeyboardProxy.web.tsx
|
|
346
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
347
|
-
function ColorWheelKeyboardProxy({
|
|
348
|
-
children,
|
|
349
|
-
chroma,
|
|
350
|
-
disabled,
|
|
351
|
-
hue,
|
|
352
|
-
maxChroma = 0.2,
|
|
353
|
-
onChange
|
|
354
|
-
}) {
|
|
355
|
-
return /* @__PURE__ */ jsx5("div", {
|
|
356
|
-
"aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
357
|
-
"aria-valuemax": 360,
|
|
358
|
-
"aria-valuemin": 0,
|
|
359
|
-
"aria-valuenow": Math.round(hue),
|
|
360
|
-
"aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
361
|
-
"aria-disabled": disabled,
|
|
362
|
-
onKeyDown: (event) => {
|
|
363
|
-
const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma, maxChroma);
|
|
364
|
-
if (!nextValue || disabled)
|
|
365
|
-
return;
|
|
366
|
-
event.preventDefault();
|
|
367
|
-
onChange(nextValue.hue, nextValue.chroma);
|
|
368
|
-
},
|
|
369
|
-
role: "slider",
|
|
370
|
-
tabIndex: disabled ? -1 : 0,
|
|
371
|
-
children
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
function resolveKeyboardWheelValue(key, hue, chroma, maxChroma) {
|
|
375
|
-
if (key === "ArrowLeft")
|
|
376
|
-
return { chroma, hue: normalizeHue(hue - 5) };
|
|
377
|
-
if (key === "ArrowRight")
|
|
378
|
-
return { chroma, hue: normalizeHue(hue + 5) };
|
|
379
|
-
if (key === "ArrowDown")
|
|
380
|
-
return { chroma: Math.max(0, chroma - 0.02), hue };
|
|
381
|
-
if (key === "ArrowUp")
|
|
382
|
-
return { chroma: Math.min(maxChroma, chroma + 0.02), hue };
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
function normalizeHue(hue) {
|
|
386
|
-
return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// src/features/color/ColorWheelPointerProxy.web.tsx
|
|
390
|
-
import React4 from "react";
|
|
391
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
392
|
-
function ColorWheelPointerProxy({
|
|
393
|
-
children,
|
|
394
|
-
disabled,
|
|
395
|
-
height,
|
|
396
|
-
onChange,
|
|
397
|
-
renderedSize: _renderedSize,
|
|
398
|
-
width
|
|
399
|
-
}) {
|
|
400
|
-
const dragging = React4.useRef(false);
|
|
401
|
-
const changeAt = (event) => {
|
|
402
|
-
const target = event.currentTarget;
|
|
403
|
-
const rect = target.getBoundingClientRect();
|
|
404
|
-
onChange((event.clientX - rect.left) / rect.width * width, (event.clientY - rect.top) / rect.height * height);
|
|
405
|
-
};
|
|
406
|
-
return /* @__PURE__ */ jsx6("div", {
|
|
407
|
-
onPointerDown: (event) => {
|
|
408
|
-
if (disabled)
|
|
409
|
-
return;
|
|
410
|
-
dragging.current = true;
|
|
411
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
412
|
-
changeAt(event);
|
|
413
|
-
},
|
|
414
|
-
onPointerMove: (event) => {
|
|
415
|
-
if (!disabled && dragging.current)
|
|
416
|
-
changeAt(event);
|
|
417
|
-
},
|
|
418
|
-
onPointerUp: (event) => {
|
|
419
|
-
if (!disabled && dragging.current)
|
|
420
|
-
changeAt(event);
|
|
421
|
-
dragging.current = false;
|
|
422
|
-
},
|
|
423
|
-
onPointerCancel: () => {
|
|
424
|
-
dragging.current = false;
|
|
425
|
-
},
|
|
426
|
-
style: { touchAction: "none" },
|
|
427
|
-
children
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// src/features/color/utils/resolveWheelColorComponents.ts
|
|
432
|
-
var toOklch3 = converter_default("oklch");
|
|
433
|
-
function resolveWheelColorComponents(color) {
|
|
434
|
-
const parsed = toOklch3(color);
|
|
435
|
-
return {
|
|
436
|
-
chroma: typeof parsed?.c === "number" ? parsed.c : 0,
|
|
437
|
-
lightness: typeof parsed?.l === "number" ? parsed.l : 0.65
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
// src/features/color/utils/resolveWheelColor.ts
|
|
442
|
-
function resolveWheelColor(color, x, y, center, radius, maxChroma, lightness = resolveWheelColorComponents(color).lightness) {
|
|
443
|
-
const deltaX = x - center;
|
|
444
|
-
const deltaY = y - center;
|
|
445
|
-
const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
|
|
446
|
-
const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
|
|
447
|
-
const chroma = distance / radius * maxChroma;
|
|
448
|
-
return resolveOklchColor({ lightness, chroma }, hue);
|
|
449
|
-
}
|
|
450
|
-
function normalizeHue2(hue) {
|
|
451
|
-
return hue < 0 ? hue + 360 : hue;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
// src/features/color/ColorWheel.tsx
|
|
455
|
-
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
456
|
-
var VIEWBOX = 1000;
|
|
457
|
-
var CENTER = VIEWBOX / 2;
|
|
458
|
-
var RADIUS = 480;
|
|
459
|
-
var SEGMENTS = 720;
|
|
460
|
-
var MAX_CHROMA = 0.2;
|
|
461
|
-
var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
|
|
462
|
-
function ColorWheelInner({
|
|
463
|
-
themeId: _themeId,
|
|
464
|
-
mode: _mode,
|
|
465
|
-
inverted: _inverted,
|
|
466
|
-
interactionPolicy,
|
|
467
|
-
value,
|
|
468
|
-
harmony = null,
|
|
469
|
-
toneTarget,
|
|
470
|
-
onChange,
|
|
471
|
-
size = 340,
|
|
472
|
-
testID
|
|
473
|
-
}) {
|
|
474
|
-
const hue = resolveColorHue(value);
|
|
475
|
-
const { chroma, lightness } = resolveWheelColorComponents(value);
|
|
476
|
-
const targetLightness = toneTarget?.lightness ?? lightness;
|
|
477
|
-
const maximumChroma = toneTarget?.chroma ?? MAX_CHROMA;
|
|
478
|
-
const primaryPoint = pointFor(hue, Math.min(1, chroma / maximumChroma));
|
|
479
|
-
const harmonyRoles = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];
|
|
480
|
-
const harmonyPoints = harmonyRoles.map((role) => ({
|
|
481
|
-
color: role.hex,
|
|
482
|
-
...pointFor(role.hueDegrees, Math.min(1, resolveWheelColorComponents(role.hex).chroma / maximumChroma))
|
|
483
|
-
}));
|
|
484
|
-
const gradientId = `color-wheel-${React5.useId().replaceAll(":", "")}`;
|
|
485
|
-
const changeAt = (x, y) => {
|
|
486
|
-
if (interactionPolicy !== "passive")
|
|
487
|
-
onChange({
|
|
488
|
-
color: resolveWheelColor(value, x, y, CENTER, RADIUS, maximumChroma, targetLightness),
|
|
489
|
-
harmony
|
|
490
|
-
});
|
|
491
|
-
};
|
|
492
|
-
return /* @__PURE__ */ jsx7(ColorWheelKeyboardProxy, {
|
|
493
|
-
chroma,
|
|
494
|
-
disabled: interactionPolicy === "passive",
|
|
495
|
-
hue,
|
|
496
|
-
maxChroma: maximumChroma,
|
|
497
|
-
onChange: (nextHue, nextChroma) => onChange({
|
|
498
|
-
color: resolveOklchColor({ chroma: nextChroma, lightness: targetLightness }, nextHue),
|
|
499
|
-
harmony
|
|
500
|
-
}),
|
|
501
|
-
children: /* @__PURE__ */ jsx7(ColorWheelPointerProxy, {
|
|
502
|
-
disabled: interactionPolicy === "passive",
|
|
503
|
-
height: VIEWBOX,
|
|
504
|
-
onChange: changeAt,
|
|
505
|
-
renderedSize: size,
|
|
506
|
-
width: VIEWBOX,
|
|
507
|
-
children: /* @__PURE__ */ jsxs4(Svg, {
|
|
508
|
-
accessibilityLabel: "Color wheel",
|
|
509
|
-
height: size,
|
|
510
|
-
testID,
|
|
511
|
-
viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}`,
|
|
512
|
-
width: size,
|
|
513
|
-
children: [
|
|
514
|
-
/* @__PURE__ */ jsx7(Defs, {
|
|
515
|
-
children: segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsxs4(RadialGradient, {
|
|
516
|
-
cx: CENTER,
|
|
517
|
-
cy: CENTER,
|
|
518
|
-
gradientUnits: "userSpaceOnUse",
|
|
519
|
-
id: `${gradientId}-${segment.hue}`,
|
|
520
|
-
r: RADIUS,
|
|
521
|
-
children: [
|
|
522
|
-
/* @__PURE__ */ jsx7(Stop, {
|
|
523
|
-
offset: "0",
|
|
524
|
-
stopColor: segment.centerColor
|
|
525
|
-
}),
|
|
526
|
-
/* @__PURE__ */ jsx7(Stop, {
|
|
527
|
-
offset: "1",
|
|
528
|
-
stopColor: segment.color
|
|
529
|
-
})
|
|
530
|
-
]
|
|
531
|
-
}, segment.hue))
|
|
532
|
-
}),
|
|
533
|
-
segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsx7(Path, {
|
|
534
|
-
d: segment.path,
|
|
535
|
-
fill: `url(#${gradientId}-${segment.hue})`
|
|
536
|
-
}, segment.hue)),
|
|
537
|
-
harmonyPoints.length >= 3 ? /* @__PURE__ */ jsx7(Polygon, {
|
|
538
|
-
fill: "none",
|
|
539
|
-
points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
|
|
540
|
-
stroke: "white",
|
|
541
|
-
strokeWidth: 6
|
|
542
|
-
}) : linesFor(harmonyPoints, primaryPoint, "white"),
|
|
543
|
-
harmonyPoints.filter((point) => point.color !== value).map((point) => /* @__PURE__ */ jsx7(Circle, {
|
|
544
|
-
cx: point.x,
|
|
545
|
-
cy: point.y,
|
|
546
|
-
fill: point.color,
|
|
547
|
-
stroke: "white",
|
|
548
|
-
strokeWidth: 6,
|
|
549
|
-
r: 26
|
|
550
|
-
}, `${point.x}-${point.y}`)),
|
|
551
|
-
/* @__PURE__ */ jsx7(Circle, {
|
|
552
|
-
cx: primaryPoint.x,
|
|
553
|
-
cy: primaryPoint.y,
|
|
554
|
-
fill: value,
|
|
555
|
-
r: 36,
|
|
556
|
-
stroke: "white",
|
|
557
|
-
strokeWidth: 12
|
|
558
|
-
}),
|
|
559
|
-
/* @__PURE__ */ jsx7(Circle, {
|
|
560
|
-
cx: primaryPoint.x,
|
|
561
|
-
cy: primaryPoint.y,
|
|
562
|
-
fill: "none",
|
|
563
|
-
r: 42,
|
|
564
|
-
stroke: "white",
|
|
565
|
-
strokeWidth: 6
|
|
566
|
-
})
|
|
567
|
-
]
|
|
568
|
-
})
|
|
569
|
-
})
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
function segments(lightness, maximumChroma) {
|
|
573
|
-
return Array.from({ length: SEGMENTS }, (_, index) => {
|
|
574
|
-
const hue = index * 360 / SEGMENTS;
|
|
575
|
-
return {
|
|
576
|
-
centerColor: resolveOklchColor({ chroma: 0, lightness }, hue),
|
|
577
|
-
color: resolveOklchColor({ chroma: maximumChroma, lightness }, hue),
|
|
578
|
-
hue,
|
|
579
|
-
path: segmentPath(hue, hue + 360 / SEGMENTS)
|
|
580
|
-
};
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
function segmentPath(start, end) {
|
|
584
|
-
const startPoint = pointFor(start);
|
|
585
|
-
const endPoint = pointFor(end);
|
|
586
|
-
return `M ${CENTER} ${CENTER} L ${startPoint.x} ${startPoint.y} A ${RADIUS} ${RADIUS} 0 0 1 ${endPoint.x} ${endPoint.y} Z`;
|
|
587
|
-
}
|
|
588
|
-
function pointFor(hue, ratio = 1) {
|
|
589
|
-
const radians = (hue - 90) * Math.PI / 180;
|
|
590
|
-
return {
|
|
591
|
-
x: CENTER + RADIUS * ratio * Math.cos(radians),
|
|
592
|
-
y: CENTER + RADIUS * ratio * Math.sin(radians)
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
function linesFor(points, primary, stroke) {
|
|
596
|
-
return points.slice(1).reduce(({ lines, previous }, point) => ({
|
|
597
|
-
lines: [
|
|
598
|
-
...lines,
|
|
599
|
-
/* @__PURE__ */ jsx7(Line, {
|
|
600
|
-
stroke,
|
|
601
|
-
strokeWidth: 6,
|
|
602
|
-
x1: previous.x,
|
|
603
|
-
x2: point.x,
|
|
604
|
-
y1: previous.y,
|
|
605
|
-
y2: point.y
|
|
606
|
-
}, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
|
|
607
|
-
],
|
|
608
|
-
previous: point
|
|
609
|
-
}), { lines: [], previous: points.at(0) ?? primary }).lines;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
// src/features/color/resolveColorPickerGeometry.ts
|
|
613
|
-
var MINIMUM_WIDTH = 360;
|
|
614
|
-
var REFERENCE_WIDTH = 560;
|
|
615
|
-
function resolveColorPickerGeometry(input) {
|
|
616
|
-
const availableWidth = Math.min(input.width ?? REFERENCE_WIDTH, input.hostWidth ?? REFERENCE_WIDTH);
|
|
617
|
-
const availableHeight = Math.min(input.height ?? Number.POSITIVE_INFINITY, input.hostHeight ?? Number.POSITIVE_INFINITY);
|
|
618
|
-
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, input.showTabs);
|
|
619
|
-
const maximum = resolveGeometryAtWidth(Math.max(MINIMUM_WIDTH, availableWidth), input.showTabs);
|
|
620
|
-
const resolved = resolveLargestGeometry(maximum, availableHeight, input.showTabs);
|
|
621
|
-
return {
|
|
622
|
-
...resolved,
|
|
623
|
-
insufficientSpace: availableWidth < MINIMUM_WIDTH || availableHeight < minimum.height,
|
|
624
|
-
minimumHeight: minimum.height,
|
|
625
|
-
minimumWidth: MINIMUM_WIDTH
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
function resolveGeometryAtWidth(width, showTabs) {
|
|
629
|
-
const progress = Math.max(0, Math.min(1, (width - MINIMUM_WIDTH) / (REFERENCE_WIDTH - MINIMUM_WIDTH)));
|
|
630
|
-
const padding = interpolate(12, 24, progress);
|
|
631
|
-
const rail = interpolate(104, 150, progress);
|
|
632
|
-
const gap = interpolate(12, 20, progress);
|
|
633
|
-
const scale = interpolate(0.75, 1, progress);
|
|
634
|
-
const border = 1;
|
|
635
|
-
const stage = width - border * 2 - padding * 2 - rail - gap;
|
|
636
|
-
const headerHeight = 48 * scale;
|
|
637
|
-
const tabHeight = showTabs ? 48 * scale : 0;
|
|
638
|
-
const cardGap = 16 * scale;
|
|
639
|
-
const cardHeight = 52 * scale;
|
|
640
|
-
const settingsHeight = cardHeight * 2 + cardGap;
|
|
641
|
-
const mainHeight = Math.max(stage, settingsHeight);
|
|
642
|
-
const infoLineHeight = 20 * scale;
|
|
643
|
-
const mainGap = 16 * scale;
|
|
644
|
-
const footerGap = 10 * scale;
|
|
645
|
-
const footerHeight = 52 * scale;
|
|
646
|
-
const footerInset = 12 * scale;
|
|
647
|
-
const height = border * 2 + padding + headerHeight + mainGap + tabHeight + (showTabs ? mainGap : 0) + mainHeight + mainGap + infoLineHeight + footerGap + 1 + footerGap + footerHeight + footerInset;
|
|
648
|
-
return {
|
|
649
|
-
border,
|
|
650
|
-
cardGap,
|
|
651
|
-
cardHeight,
|
|
652
|
-
footerGap,
|
|
653
|
-
footerHeight,
|
|
654
|
-
footerInset,
|
|
655
|
-
gap,
|
|
656
|
-
headerHeight,
|
|
657
|
-
height,
|
|
658
|
-
infoLineHeight,
|
|
659
|
-
mainGap,
|
|
660
|
-
padding,
|
|
661
|
-
rail,
|
|
662
|
-
scale,
|
|
663
|
-
settingsHeight,
|
|
664
|
-
stage,
|
|
665
|
-
tabHeight,
|
|
666
|
-
width
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
function resolveLargestGeometry(maximum, height, showTabs) {
|
|
670
|
-
if (!Number.isFinite(height) || maximum.height <= height)
|
|
671
|
-
return maximum;
|
|
672
|
-
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, showTabs);
|
|
673
|
-
if (height < minimum.height)
|
|
674
|
-
return minimum;
|
|
675
|
-
let lower = MINIMUM_WIDTH;
|
|
676
|
-
let upper = maximum.width;
|
|
677
|
-
for (let iteration = 0;iteration < 20; iteration += 1) {
|
|
678
|
-
const midpoint = (lower + upper) / 2;
|
|
679
|
-
if (resolveGeometryAtWidth(midpoint, showTabs).height <= height)
|
|
680
|
-
lower = midpoint;
|
|
681
|
-
else
|
|
682
|
-
upper = midpoint;
|
|
683
|
-
}
|
|
684
|
-
return resolveGeometryAtWidth(lower, showTabs);
|
|
685
|
-
}
|
|
686
|
-
function interpolate(minimum, reference, progress) {
|
|
687
|
-
return minimum + (reference - minimum) * progress;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
// src/features/color/ColorPicker.tsx
|
|
691
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
692
|
-
var DEFAULT_TABS = ["grid", "wheel"];
|
|
693
|
-
var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
|
|
694
|
-
function ColorPickerInner({
|
|
695
|
-
themeId: _themeId,
|
|
696
|
-
mode: _mode,
|
|
697
|
-
inverted: _inverted,
|
|
698
|
-
tabs = DEFAULT_TABS,
|
|
699
|
-
primaryColor,
|
|
700
|
-
harmony,
|
|
701
|
-
tone,
|
|
702
|
-
tones = [],
|
|
703
|
-
width = 560,
|
|
704
|
-
height,
|
|
705
|
-
infoLine,
|
|
706
|
-
onInsufficientSpaceChange,
|
|
707
|
-
activeTab,
|
|
708
|
-
onValueChange,
|
|
709
|
-
onActiveTabChange,
|
|
710
|
-
onDismiss,
|
|
711
|
-
hideTabListWhenSingle = true,
|
|
712
|
-
wheel,
|
|
713
|
-
interactionPolicy,
|
|
714
|
-
testID
|
|
715
|
-
}) {
|
|
716
|
-
const { theme } = useZoraTheme2();
|
|
717
|
-
const [hostBounds, setHostBounds] = React6.useState();
|
|
718
|
-
const enabledTabs = resolveEnabledTabs(tabs);
|
|
719
|
-
const firstTab = enabledTabs.at(0);
|
|
720
|
-
if (!firstTab)
|
|
721
|
-
throw new Error("ColorPicker requires at least one tab.");
|
|
722
|
-
const [uncontrolledTab, setUncontrolledTab] = React6.useState(firstTab);
|
|
723
|
-
const resolvedTab = activeTab && enabledTabs.includes(activeTab) ? activeTab : enabledTabs.includes(uncontrolledTab) ? uncontrolledTab : firstTab;
|
|
724
|
-
const geometry = resolveColorPickerGeometry({
|
|
725
|
-
height,
|
|
726
|
-
hostHeight: hostBounds && hostBounds.height > 0 ? hostBounds.height : undefined,
|
|
727
|
-
hostWidth: hostBounds && hostBounds.width > 0 ? hostBounds.width : undefined,
|
|
728
|
-
showTabs: enabledTabs.length > 1 || !hideTabListWhenSingle,
|
|
729
|
-
width
|
|
730
|
-
});
|
|
731
|
-
const selectedTone = tones.find((entry) => entry.id === tone);
|
|
732
|
-
const emit = (next) => onValueChange({
|
|
733
|
-
primaryColor: next.primaryColor ?? primaryColor,
|
|
734
|
-
...Object.hasOwn(next, "harmony") ? { harmony: next.harmony } : harmony ? { harmony } : {},
|
|
735
|
-
...Object.hasOwn(next, "tone") ? { tone: next.tone } : tone ? { tone } : {}
|
|
736
|
-
});
|
|
737
|
-
const settings = (children) => /* @__PURE__ */ jsx8(PickerRow, {
|
|
738
|
-
geometry,
|
|
739
|
-
tone,
|
|
740
|
-
tones,
|
|
741
|
-
harmony,
|
|
742
|
-
interactionPolicy,
|
|
743
|
-
onHarmonyChange: (next) => emit({ harmony: next }),
|
|
744
|
-
onToneChange: (next) => emit({ tone: next }),
|
|
745
|
-
children
|
|
746
|
-
});
|
|
747
|
-
React6.useEffect(() => {
|
|
748
|
-
if (activeTab && activeTab !== resolvedTab)
|
|
749
|
-
onActiveTabChange?.(resolvedTab);
|
|
750
|
-
}, [activeTab, onActiveTabChange, resolvedTab]);
|
|
751
|
-
React6.useEffect(() => {
|
|
752
|
-
onInsufficientSpaceChange?.(geometry.insufficientSpace);
|
|
753
|
-
}, [geometry.insufficientSpace, onInsufficientSpaceChange]);
|
|
754
|
-
return /* @__PURE__ */ jsx8(import_react_native.View, {
|
|
755
|
-
onLayout: (event) => setHostBounds({
|
|
756
|
-
height: event.nativeEvent.layout.height,
|
|
757
|
-
width: event.nativeEvent.layout.width
|
|
758
|
-
}),
|
|
759
|
-
style: {
|
|
760
|
-
alignSelf: "stretch",
|
|
761
|
-
flexShrink: 1,
|
|
762
|
-
height: height ?? "100%",
|
|
763
|
-
maxHeight: "100%",
|
|
764
|
-
maxWidth: "100%",
|
|
765
|
-
width: "100%"
|
|
766
|
-
},
|
|
767
|
-
children: !geometry.insufficientSpace ? /* @__PURE__ */ jsx8(View2, {
|
|
768
|
-
alignSelf: "center",
|
|
769
|
-
borderColor: theme.semantics.action.primary.base,
|
|
770
|
-
borderWidth: geometry.border,
|
|
771
|
-
radius: "l",
|
|
772
|
-
testID,
|
|
773
|
-
width: geometry.width,
|
|
774
|
-
children: /* @__PURE__ */ jsx8(Gradient2, {
|
|
775
|
-
colors: [theme.semantics.surface.raised, theme.semantics.neutral.surface],
|
|
776
|
-
end: { x: 0, y: 1 },
|
|
777
|
-
radius: "l",
|
|
778
|
-
start: { x: 0, y: 0 },
|
|
779
|
-
children: /* @__PURE__ */ jsxs5(View2, {
|
|
780
|
-
gap: geometry.footerGap,
|
|
781
|
-
pb: geometry.footerInset,
|
|
782
|
-
pt: geometry.padding,
|
|
783
|
-
px: geometry.padding,
|
|
784
|
-
children: [
|
|
785
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
786
|
-
gap: geometry.mainGap,
|
|
787
|
-
children: [
|
|
788
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
789
|
-
align: "center",
|
|
790
|
-
direction: "row",
|
|
791
|
-
justify: "space-between",
|
|
792
|
-
minHeight: geometry.headerHeight,
|
|
793
|
-
children: [
|
|
794
|
-
/* @__PURE__ */ jsx8(Heading2, {
|
|
795
|
-
level: 2,
|
|
796
|
-
children: "Color"
|
|
797
|
-
}),
|
|
798
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
799
|
-
align: "center",
|
|
800
|
-
direction: "row",
|
|
801
|
-
gap: "s",
|
|
802
|
-
children: [
|
|
803
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
804
|
-
bg: primaryColor,
|
|
805
|
-
borderColor: theme.semantics.border.default,
|
|
806
|
-
borderWidth: 1,
|
|
807
|
-
height: 36 * geometry.scale,
|
|
808
|
-
radius: "s",
|
|
809
|
-
width: 52 * geometry.scale
|
|
810
|
-
}),
|
|
811
|
-
onDismiss ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
812
|
-
iconName: "close",
|
|
813
|
-
label: "Close color picker",
|
|
814
|
-
onPress: onDismiss
|
|
815
|
-
}) : null
|
|
816
|
-
]
|
|
817
|
-
})
|
|
818
|
-
]
|
|
819
|
-
}),
|
|
820
|
-
enabledTabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx8(ColorPickerTabSelector, {
|
|
821
|
-
activeTab: resolvedTab,
|
|
822
|
-
geometry,
|
|
823
|
-
interactionPolicy,
|
|
824
|
-
tabs: enabledTabs,
|
|
825
|
-
onChange: (next) => {
|
|
826
|
-
setUncontrolledTab(next);
|
|
827
|
-
onActiveTabChange?.(next);
|
|
828
|
-
}
|
|
829
|
-
}) : null,
|
|
830
|
-
resolvedTab === "grid" ? settings(/* @__PURE__ */ jsx8(ColorGrid, {
|
|
831
|
-
disabled: interactionPolicy === "passive",
|
|
832
|
-
harmony,
|
|
833
|
-
onSelect: (color) => emit({ primaryColor: color }),
|
|
834
|
-
palette: resolvePalette(selectedTone, primaryColor, harmony),
|
|
835
|
-
primaryIndicatorColor: theme.semantics.action.primary.base,
|
|
836
|
-
selectionBorderColor: theme.semantics.content.default,
|
|
837
|
-
selected: primaryColor,
|
|
838
|
-
size: geometry.stage
|
|
839
|
-
})) : settings(/* @__PURE__ */ jsx8(ColorWheel2, {
|
|
840
|
-
...wheel,
|
|
841
|
-
harmony: harmony ?? null,
|
|
842
|
-
interactionPolicy,
|
|
843
|
-
onChange: (next) => emit({ primaryColor: next.color, harmony: next.harmony ?? undefined }),
|
|
844
|
-
size: geometry.stage,
|
|
845
|
-
toneTarget: selectedTone?.accentTarget,
|
|
846
|
-
value: primaryColor
|
|
847
|
-
})),
|
|
848
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
849
|
-
height: geometry.infoLineHeight,
|
|
850
|
-
justify: "center",
|
|
851
|
-
children: infoLine ? /* @__PURE__ */ jsx8(Text3, {
|
|
852
|
-
accessibilityLabel: infoLine,
|
|
853
|
-
numberOfLines: 1,
|
|
854
|
-
variant: "caption",
|
|
855
|
-
children: infoLine
|
|
856
|
-
}) : null
|
|
857
|
-
})
|
|
858
|
-
]
|
|
859
|
-
}),
|
|
860
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
861
|
-
gap: geometry.footerGap,
|
|
862
|
-
children: [
|
|
863
|
-
/* @__PURE__ */ jsx8(Divider2, {}),
|
|
864
|
-
/* @__PURE__ */ jsx8(View2, {
|
|
865
|
-
height: geometry.footerHeight,
|
|
866
|
-
justify: "center",
|
|
867
|
-
children: /* @__PURE__ */ jsx8(ColorHexField, {
|
|
868
|
-
disabled: interactionPolicy === "passive",
|
|
869
|
-
onChange: (color) => emit({ primaryColor: color }),
|
|
870
|
-
value: primaryColor
|
|
871
|
-
})
|
|
872
|
-
})
|
|
873
|
-
]
|
|
874
|
-
})
|
|
875
|
-
]
|
|
876
|
-
})
|
|
877
|
-
})
|
|
878
|
-
}) : /* @__PURE__ */ jsx8(View2, {
|
|
879
|
-
accessibilityLabel: "Color picker needs more space",
|
|
880
|
-
testID: testID ? `${testID}-insufficient-space` : undefined
|
|
881
|
-
})
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
function ColorPickerTabSelector({
|
|
885
|
-
activeTab,
|
|
886
|
-
geometry,
|
|
887
|
-
interactionPolicy,
|
|
888
|
-
tabs,
|
|
889
|
-
onChange
|
|
890
|
-
}) {
|
|
891
|
-
const { theme } = useZoraTheme2();
|
|
892
|
-
return /* @__PURE__ */ jsx8(View2, {
|
|
893
|
-
borderColor: theme.semantics.border.default,
|
|
894
|
-
borderWidth: 1,
|
|
895
|
-
direction: "row",
|
|
896
|
-
overflow: "hidden",
|
|
897
|
-
radius: "m",
|
|
898
|
-
children: tabs.map((tab) => {
|
|
899
|
-
const selected = tab === activeTab;
|
|
900
|
-
return /* @__PURE__ */ jsx8(Pressable, {
|
|
901
|
-
accessibilityLabel: `${tab === "grid" ? "Grid" : "Wheel"} color picker tab`,
|
|
902
|
-
accessibilityRole: "tab",
|
|
903
|
-
accessibilityState: { selected },
|
|
904
|
-
disabled: interactionPolicy === "passive",
|
|
905
|
-
onPress: () => onChange(tab),
|
|
906
|
-
style: { flex: 1 },
|
|
907
|
-
children: /* @__PURE__ */ jsxs5(View2, {
|
|
908
|
-
align: "center",
|
|
909
|
-
bg: selected ? theme.semantics.action.primary.base : "transparent",
|
|
910
|
-
direction: "row",
|
|
911
|
-
gap: "xs",
|
|
912
|
-
height: geometry.tabHeight - geometry.border * 2,
|
|
913
|
-
justify: "center",
|
|
914
|
-
radius: "s",
|
|
915
|
-
children: [
|
|
916
|
-
/* @__PURE__ */ jsx8(Icon2, {
|
|
917
|
-
color: selected ? theme.semantics.action.primary.onSolidText : undefined,
|
|
918
|
-
name: tab === "grid" ? "grid" : "color-palette",
|
|
919
|
-
size: 16 * geometry.scale
|
|
920
|
-
}),
|
|
921
|
-
/* @__PURE__ */ jsx8(Text3, {
|
|
922
|
-
style: selected ? { color: theme.semantics.action.primary.onSolidText } : undefined,
|
|
923
|
-
variant: "label",
|
|
924
|
-
weight: "medium",
|
|
925
|
-
children: tab === "grid" ? "Grid" : "Wheel"
|
|
926
|
-
})
|
|
927
|
-
]
|
|
928
|
-
})
|
|
929
|
-
}, tab);
|
|
930
|
-
})
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
function PickerRow({
|
|
934
|
-
children,
|
|
935
|
-
geometry,
|
|
936
|
-
tone,
|
|
937
|
-
tones,
|
|
938
|
-
harmony,
|
|
939
|
-
interactionPolicy,
|
|
940
|
-
onToneChange,
|
|
941
|
-
onHarmonyChange
|
|
942
|
-
}) {
|
|
943
|
-
return /* @__PURE__ */ jsxs5(View2, {
|
|
944
|
-
align: "flex-start",
|
|
945
|
-
direction: "row",
|
|
946
|
-
gap: geometry.gap,
|
|
947
|
-
children: [
|
|
948
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
949
|
-
gap: geometry.cardGap,
|
|
950
|
-
width: geometry.rail,
|
|
951
|
-
children: [
|
|
952
|
-
/* @__PURE__ */ jsx8(SettingCard, {
|
|
953
|
-
geometry,
|
|
954
|
-
icon: "diamond",
|
|
955
|
-
interactionPolicy,
|
|
956
|
-
label: "Tone",
|
|
957
|
-
onClear: tone ? () => onToneChange(undefined) : undefined,
|
|
958
|
-
children: /* @__PURE__ */ jsx8(Select2, {
|
|
959
|
-
compact: true,
|
|
960
|
-
interactionPolicy,
|
|
961
|
-
onValueChange: onToneChange,
|
|
962
|
-
options: resolveToneOptions(tones),
|
|
963
|
-
placeholder: "Any tone",
|
|
964
|
-
value: tone
|
|
965
|
-
})
|
|
966
|
-
}),
|
|
967
|
-
/* @__PURE__ */ jsx8(SettingCard, {
|
|
968
|
-
geometry,
|
|
969
|
-
icon: "color-palette",
|
|
970
|
-
interactionPolicy,
|
|
971
|
-
label: "Harmony",
|
|
972
|
-
onClear: harmony ? () => onHarmonyChange(undefined) : undefined,
|
|
973
|
-
children: /* @__PURE__ */ jsx8(Select2, {
|
|
974
|
-
compact: true,
|
|
975
|
-
interactionPolicy,
|
|
976
|
-
onValueChange: onHarmonyChange,
|
|
977
|
-
options: COLOR_HARMONY_CATALOG.map((entry) => ({
|
|
978
|
-
label: entry.label,
|
|
979
|
-
value: entry.id
|
|
980
|
-
})),
|
|
981
|
-
placeholder: "None",
|
|
982
|
-
value: harmony
|
|
983
|
-
})
|
|
984
|
-
})
|
|
985
|
-
]
|
|
986
|
-
}),
|
|
987
|
-
children
|
|
988
|
-
]
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
function SettingCard({
|
|
992
|
-
children,
|
|
993
|
-
geometry,
|
|
994
|
-
icon,
|
|
995
|
-
interactionPolicy,
|
|
996
|
-
label,
|
|
997
|
-
onClear
|
|
998
|
-
}) {
|
|
999
|
-
return /* @__PURE__ */ jsxs5(Card2, {
|
|
1000
|
-
compact: true,
|
|
1001
|
-
minHeight: geometry.cardHeight,
|
|
1002
|
-
padding: "s",
|
|
1003
|
-
radius: "m",
|
|
1004
|
-
tone: "subtle",
|
|
1005
|
-
children: [
|
|
1006
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
1007
|
-
align: "center",
|
|
1008
|
-
direction: "row",
|
|
1009
|
-
gap: "xs",
|
|
1010
|
-
justify: "space-between",
|
|
1011
|
-
children: [
|
|
1012
|
-
/* @__PURE__ */ jsxs5(View2, {
|
|
1013
|
-
align: "center",
|
|
1014
|
-
direction: "row",
|
|
1015
|
-
gap: "xs",
|
|
1016
|
-
children: [
|
|
1017
|
-
/* @__PURE__ */ jsx8(Icon2, {
|
|
1018
|
-
name: icon,
|
|
1019
|
-
size: 20 * geometry.scale
|
|
1020
|
-
}),
|
|
1021
|
-
/* @__PURE__ */ jsx8(Text3, {
|
|
1022
|
-
numberOfLines: 1,
|
|
1023
|
-
variant: "label",
|
|
1024
|
-
weight: "medium",
|
|
1025
|
-
children: label
|
|
1026
|
-
})
|
|
1027
|
-
]
|
|
1028
|
-
}),
|
|
1029
|
-
onClear ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
1030
|
-
disabled: interactionPolicy === "passive",
|
|
1031
|
-
iconName: "close",
|
|
1032
|
-
label: `Clear ${label}`,
|
|
1033
|
-
onPress: onClear,
|
|
1034
|
-
size: "s"
|
|
1035
|
-
}) : null
|
|
1036
|
-
]
|
|
1037
|
-
}),
|
|
1038
|
-
children
|
|
1039
|
-
]
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
function ColorGrid({
|
|
1043
|
-
palette,
|
|
1044
|
-
primaryIndicatorColor,
|
|
1045
|
-
selectionBorderColor,
|
|
1046
|
-
selected,
|
|
1047
|
-
size,
|
|
1048
|
-
onSelect,
|
|
1049
|
-
disabled = false,
|
|
1050
|
-
harmony
|
|
1051
|
-
}) {
|
|
1052
|
-
const gap = Math.max(3, Math.round(size / 68));
|
|
1053
|
-
const cell = (size - 7 * gap) / 8;
|
|
1054
|
-
const harmonyColors = new Set(harmony ? generateHarmonyRoleColors(selected, harmony).colors.map((role) => role.hex) : []);
|
|
1055
|
-
return /* @__PURE__ */ jsx8(View2, {
|
|
1056
|
-
accessibilityLabel: "Color grid",
|
|
1057
|
-
direction: "row",
|
|
1058
|
-
gap,
|
|
1059
|
-
width: size,
|
|
1060
|
-
wrap: "wrap",
|
|
1061
|
-
children: palette.map((color) => /* @__PURE__ */ jsx8(Pressable, {
|
|
1062
|
-
accessibilityLabel: `Select ${color}`,
|
|
1063
|
-
bg: color,
|
|
1064
|
-
borderColor: color === selected ? selectionBorderColor : harmonyColors.has(color) ? primaryIndicatorColor : "transparent",
|
|
1065
|
-
borderWidth: color === selected ? 3 : harmonyColors.has(color) ? 1 : 0,
|
|
1066
|
-
disabled,
|
|
1067
|
-
height: cell,
|
|
1068
|
-
onPress: () => onSelect(color),
|
|
1069
|
-
radius: "s",
|
|
1070
|
-
width: cell
|
|
1071
|
-
}, color))
|
|
1072
|
-
});
|
|
1073
|
-
}
|
|
1074
|
-
function resolvePalette(tone, primaryColor, harmony) {
|
|
1075
|
-
const target = tone?.accentTarget;
|
|
1076
|
-
const candidates = Array.from({ length: 64 }, (_, index) => resolveOklchColor({
|
|
1077
|
-
chroma: target?.chroma ?? 0.08 + index % 8 * 0.018,
|
|
1078
|
-
lightness: target?.lightness ?? 0.35 + Math.floor(index / 8) * 0.065
|
|
1079
|
-
}, index * 137.508 % 360));
|
|
1080
|
-
const roleColors = harmony ? generateHarmonyRoleColors(primaryColor, harmony).colors.map((role) => role.hex) : [];
|
|
1081
|
-
return Array.from(new Set([primaryColor, ...roleColors, ...candidates])).slice(0, 64);
|
|
1082
|
-
}
|
|
1083
|
-
function resolveToneOptions(tones) {
|
|
1084
|
-
const accentCounts = new Map;
|
|
1085
|
-
for (const tone of tones) {
|
|
1086
|
-
const accent = tone.accent.trim().toLocaleLowerCase();
|
|
1087
|
-
accentCounts.set(accent, (accentCounts.get(accent) ?? 0) + 1);
|
|
1088
|
-
}
|
|
1089
|
-
return tones.map((tone) => ({
|
|
1090
|
-
label: (accentCounts.get(tone.accent.trim().toLocaleLowerCase()) ?? 0) > 1 ? `${tone.accent} · ${resolveToneQualifier(tone)}` : tone.accent,
|
|
1091
|
-
value: tone.id
|
|
1092
|
-
}));
|
|
1093
|
-
}
|
|
1094
|
-
function resolveToneQualifier(tone) {
|
|
1095
|
-
const normalizedAccent = tone.accent.trim().toLocaleLowerCase().replaceAll(" ", "-");
|
|
1096
|
-
const qualifier = tone.id.replace(new RegExp(`^${escapeRegExp(normalizedAccent)}-on-`, "i"), "").replaceAll("-", " ");
|
|
1097
|
-
return qualifier.replace(/\b\w/g, (character) => character.toLocaleUpperCase());
|
|
1098
|
-
}
|
|
1099
|
-
function escapeRegExp(value) {
|
|
1100
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1101
|
-
}
|
|
1102
|
-
function resolveEnabledTabs(tabs) {
|
|
1103
|
-
if (tabs.length === 0)
|
|
1104
|
-
throw new Error("ColorPicker requires at least one tab.");
|
|
1105
|
-
if (tabs.some((tab) => !isColorPickerTab(tab)))
|
|
1106
|
-
throw new Error("ColorPicker supports only Grid and Wheel tabs.");
|
|
1107
|
-
return tabs;
|
|
1108
|
-
}
|
|
1109
|
-
function isColorPickerTab(value) {
|
|
1110
|
-
return value === "grid" || value === "wheel";
|
|
1111
|
-
}
|
|
1112
|
-
// src/features/color/ColorTone.tsx
|
|
1113
|
-
import React7 from "react";
|
|
1114
|
-
import { jsx as jsx9, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
|
|
1115
|
-
var MAX_TONE_COLORS = 4;
|
|
1116
|
-
var TONE_MAP_WIDTH = 280;
|
|
1117
|
-
var TONE_MAP_HEIGHT = 220;
|
|
1118
|
-
var TONE_MAX_CHROMA = 0.2;
|
|
1119
|
-
var ColorTone2 = withZoraThemeScope(ColorToneInner);
|
|
1120
|
-
function ColorToneInner({
|
|
1121
|
-
themeId: _themeId,
|
|
1122
|
-
mode: _mode,
|
|
1123
|
-
inverted: _inverted,
|
|
1124
|
-
interactionPolicy,
|
|
1125
|
-
tones,
|
|
1126
|
-
selectionMode = "single",
|
|
1127
|
-
value,
|
|
1128
|
-
onChange,
|
|
1129
|
-
testID
|
|
1130
|
-
}) {
|
|
1131
|
-
const { theme } = useZoraTheme2();
|
|
1132
|
-
const [editingColorIndex, setEditingColorIndex] = React7.useState(0);
|
|
1133
|
-
const selectedTone = tones.find((tone) => tone.id === value?.toneId);
|
|
1134
|
-
const colors = value ? selectionMode === "single" ? value.colors.slice(0, 1) : value.colors.slice(0, MAX_TONE_COLORS) : [];
|
|
1135
|
-
const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
|
|
1136
|
-
const selectedColor = colors.at(currentEditingColorIndex);
|
|
1137
|
-
const selectTone = (tone) => {
|
|
1138
|
-
const hue = selectedColor ? resolveColorHue(selectedColor) : 0;
|
|
1139
|
-
setEditingColorIndex(0);
|
|
1140
|
-
onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
|
|
1141
|
-
};
|
|
1142
|
-
return /* @__PURE__ */ jsxs6(View2, {
|
|
1143
|
-
gap: "m",
|
|
1144
|
-
testID,
|
|
1145
|
-
children: [
|
|
1146
|
-
/* @__PURE__ */ jsxs6(View2, {
|
|
1147
|
-
gap: "xs",
|
|
1148
|
-
children: [
|
|
1149
|
-
/* @__PURE__ */ jsx9(Text3, {
|
|
1150
|
-
variant: "label",
|
|
1151
|
-
children: "Tone"
|
|
1152
|
-
}),
|
|
1153
|
-
/* @__PURE__ */ jsx9(Text3, {
|
|
1154
|
-
emphasis: "muted",
|
|
1155
|
-
variant: "caption",
|
|
1156
|
-
children: "Choose a catalog tone"
|
|
1157
|
-
})
|
|
1158
|
-
]
|
|
1159
|
-
}),
|
|
1160
|
-
/* @__PURE__ */ jsx9(View2, {
|
|
1161
|
-
direction: "row",
|
|
1162
|
-
gap: "s",
|
|
1163
|
-
wrap: "wrap",
|
|
1164
|
-
children: tones.map((tone) => {
|
|
1165
|
-
const selected = value?.toneId === tone.id;
|
|
1166
|
-
const color = selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
|
|
1167
|
-
return /* @__PURE__ */ jsx9(Pressable, {
|
|
1168
|
-
accessibilityLabel: tone.accent,
|
|
1169
|
-
accessibilityRole: "radio",
|
|
1170
|
-
accessibilityState: { checked: selected },
|
|
1171
|
-
bg: color,
|
|
1172
|
-
borderColor: theme.semantics.border.default,
|
|
1173
|
-
borderWidth: selected ? 3 : 1,
|
|
1174
|
-
disabled: interactionPolicy === "passive",
|
|
1175
|
-
height: 56,
|
|
1176
|
-
onPress: () => selectTone(tone),
|
|
1177
|
-
radius: "m",
|
|
1178
|
-
width: 56,
|
|
1179
|
-
children: /* @__PURE__ */ jsx9(Text3, {
|
|
1180
|
-
align: "center",
|
|
1181
|
-
variant: "caption",
|
|
1182
|
-
children: tone.accent
|
|
1183
|
-
})
|
|
1184
|
-
}, tone.id);
|
|
1185
|
-
})
|
|
1186
|
-
}),
|
|
1187
|
-
selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs6(Fragment, {
|
|
1188
|
-
children: [
|
|
1189
|
-
/* @__PURE__ */ jsx9(ColorToneMap, {
|
|
1190
|
-
color: selectedColor,
|
|
1191
|
-
disabled: interactionPolicy === "passive",
|
|
1192
|
-
onChange: (lightness, chroma) => onChange({
|
|
1193
|
-
toneId: selectedTone.id,
|
|
1194
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor({ chroma, lightness }, resolveColorHue(entry)) : entry)
|
|
1195
|
-
})
|
|
1196
|
-
}),
|
|
1197
|
-
/* @__PURE__ */ jsxs6(View2, {
|
|
1198
|
-
direction: "row",
|
|
1199
|
-
gap: "xs",
|
|
1200
|
-
wrap: "wrap",
|
|
1201
|
-
children: [
|
|
1202
|
-
colors.map((color, index) => /* @__PURE__ */ jsx9(Pressable, {
|
|
1203
|
-
accessibilityLabel: `Selected ${selectedTone.accent} color ${index + 1}: ${color}`,
|
|
1204
|
-
accessibilityRole: "radio",
|
|
1205
|
-
accessibilityState: { checked: currentEditingColorIndex === index },
|
|
1206
|
-
bg: color,
|
|
1207
|
-
borderColor: theme.semantics.border.default,
|
|
1208
|
-
borderWidth: currentEditingColorIndex === index ? 3 : 1,
|
|
1209
|
-
disabled: interactionPolicy === "passive",
|
|
1210
|
-
height: 44,
|
|
1211
|
-
onPress: () => setEditingColorIndex(index),
|
|
1212
|
-
radius: "m",
|
|
1213
|
-
width: 44
|
|
1214
|
-
}, `${color}-${index}`)),
|
|
1215
|
-
selectionMode === "multiple" ? /* @__PURE__ */ jsx9(Button2, {
|
|
1216
|
-
disabled: interactionPolicy === "passive" || colors.length >= MAX_TONE_COLORS,
|
|
1217
|
-
onPress: () => {
|
|
1218
|
-
setEditingColorIndex(colors.length);
|
|
1219
|
-
onChange({
|
|
1220
|
-
toneId: selectedTone.id,
|
|
1221
|
-
colors: [...colors, resolveOklchColor(selectedTone.accentTarget, 0)]
|
|
1222
|
-
});
|
|
1223
|
-
},
|
|
1224
|
-
children: "Add color"
|
|
1225
|
-
}) : null,
|
|
1226
|
-
selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx9(Button2, {
|
|
1227
|
-
disabled: interactionPolicy === "passive",
|
|
1228
|
-
onPress: () => {
|
|
1229
|
-
const nextColors = colors.filter((_, index) => index !== currentEditingColorIndex);
|
|
1230
|
-
setEditingColorIndex(Math.min(currentEditingColorIndex, nextColors.length - 1));
|
|
1231
|
-
onChange({ toneId: selectedTone.id, colors: nextColors });
|
|
1232
|
-
},
|
|
1233
|
-
children: "Remove color"
|
|
1234
|
-
}) : null
|
|
1235
|
-
]
|
|
1236
|
-
}),
|
|
1237
|
-
/* @__PURE__ */ jsx9(ColorSpectrumSlider, {
|
|
1238
|
-
disabled: interactionPolicy === "passive",
|
|
1239
|
-
hue: resolveColorHue(selectedColor),
|
|
1240
|
-
onChange: (nextHue) => onChange({
|
|
1241
|
-
toneId: selectedTone.id,
|
|
1242
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor(selectedTone.accentTarget, nextHue) : entry)
|
|
1243
|
-
})
|
|
1244
|
-
}),
|
|
1245
|
-
/* @__PURE__ */ jsx9(ColorHexField, {
|
|
1246
|
-
disabled: interactionPolicy === "passive",
|
|
1247
|
-
onChange: (color) => onChange({
|
|
1248
|
-
toneId: selectedTone.id,
|
|
1249
|
-
colors: colors.map((entry, index) => index === currentEditingColorIndex ? color : entry)
|
|
1250
|
-
}),
|
|
1251
|
-
value: selectedColor
|
|
1252
|
-
}, selectedColor)
|
|
1253
|
-
]
|
|
1254
|
-
}) : null
|
|
1255
|
-
]
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
function ColorToneMap({
|
|
1259
|
-
color,
|
|
1260
|
-
disabled,
|
|
1261
|
-
onChange
|
|
1262
|
-
}) {
|
|
1263
|
-
const hue = resolveColorHue(color);
|
|
1264
|
-
const { chroma, lightness } = resolveWheelColorComponents(color);
|
|
1265
|
-
const gradientId = `color-tone-${React7.useId().replaceAll(":", "")}`;
|
|
1266
|
-
const changeAt = (x, y) => {
|
|
1267
|
-
if (disabled)
|
|
1268
|
-
return;
|
|
1269
|
-
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)));
|
|
1270
|
-
};
|
|
1271
|
-
return /* @__PURE__ */ jsx9(ColorWheelPointerProxy, {
|
|
1272
|
-
disabled,
|
|
1273
|
-
height: TONE_MAP_HEIGHT,
|
|
1274
|
-
onChange: changeAt,
|
|
1275
|
-
width: TONE_MAP_WIDTH,
|
|
1276
|
-
children: /* @__PURE__ */ jsxs6(Svg, {
|
|
1277
|
-
accessibilityLabel: "Tone color plane",
|
|
1278
|
-
height: TONE_MAP_HEIGHT,
|
|
1279
|
-
width: TONE_MAP_WIDTH,
|
|
1280
|
-
children: [
|
|
1281
|
-
/* @__PURE__ */ jsxs6(Defs, {
|
|
1282
|
-
children: [
|
|
1283
|
-
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
1284
|
-
id: `${gradientId}-white`,
|
|
1285
|
-
x1: "0",
|
|
1286
|
-
x2: "1",
|
|
1287
|
-
y1: "0",
|
|
1288
|
-
y2: "0",
|
|
1289
|
-
children: [
|
|
1290
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
1291
|
-
offset: "0",
|
|
1292
|
-
stopColor: "white"
|
|
1293
|
-
}),
|
|
1294
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
1295
|
-
offset: "1",
|
|
1296
|
-
stopColor: resolveOklchColor({ chroma: TONE_MAX_CHROMA, lightness: 0.65 }, hue)
|
|
1297
|
-
})
|
|
1298
|
-
]
|
|
1299
|
-
}),
|
|
1300
|
-
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
1301
|
-
id: `${gradientId}-black`,
|
|
1302
|
-
x1: "0",
|
|
1303
|
-
x2: "0",
|
|
1304
|
-
y1: "0",
|
|
1305
|
-
y2: "1",
|
|
1306
|
-
children: [
|
|
1307
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
1308
|
-
offset: "0",
|
|
1309
|
-
stopColor: "transparent"
|
|
1310
|
-
}),
|
|
1311
|
-
/* @__PURE__ */ jsx9(Stop, {
|
|
1312
|
-
offset: "1",
|
|
1313
|
-
stopColor: "black"
|
|
1314
|
-
})
|
|
1315
|
-
]
|
|
1316
|
-
})
|
|
1317
|
-
]
|
|
1318
|
-
}),
|
|
1319
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
1320
|
-
fill: `url(#${gradientId}-white)`,
|
|
1321
|
-
height: TONE_MAP_HEIGHT,
|
|
1322
|
-
width: TONE_MAP_WIDTH
|
|
1323
|
-
}),
|
|
1324
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
1325
|
-
fill: `url(#${gradientId}-black)`,
|
|
1326
|
-
height: TONE_MAP_HEIGHT,
|
|
1327
|
-
width: TONE_MAP_WIDTH
|
|
1328
|
-
}),
|
|
1329
|
-
/* @__PURE__ */ jsx9(Circle, {
|
|
1330
|
-
cx: chroma / TONE_MAX_CHROMA * TONE_MAP_WIDTH,
|
|
1331
|
-
cy: (1 - lightness) * TONE_MAP_HEIGHT,
|
|
1332
|
-
fill: "none",
|
|
1333
|
-
r: 10,
|
|
1334
|
-
stroke: "white",
|
|
1335
|
-
strokeWidth: 3
|
|
1336
|
-
}),
|
|
1337
|
-
/* @__PURE__ */ jsx9(Rect, {
|
|
1338
|
-
fill: "transparent",
|
|
1339
|
-
height: TONE_MAP_HEIGHT,
|
|
1340
|
-
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
1341
|
-
onResponderMove: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
1342
|
-
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
1343
|
-
onStartShouldSetResponder: () => !disabled,
|
|
1344
|
-
width: TONE_MAP_WIDTH
|
|
1345
|
-
})
|
|
1346
|
-
]
|
|
1347
|
-
})
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
export { ColorHueScale2, ColorWheel2, ColorPicker2, ColorTone2 };
|