@ankhorage/zora 28.7.2 → 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 +7 -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 +1 -1
- 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,21 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return HEX6_CASE_INSENSITIVE_REGEX.test(value);
|
|
6
|
-
}
|
|
7
|
-
function parseHexColor(value) {
|
|
8
|
-
if (!HEX6_CASE_INSENSITIVE_REGEX.test(value))
|
|
9
|
-
return null;
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
function parseHexColorOrThrow(value) {
|
|
13
|
-
const parsed = parseHexColor(value);
|
|
14
|
-
if (!parsed) {
|
|
15
|
-
throw new Error(`Invalid hex color (expected #RRGGBB or #rrggbb): ${JSON.stringify(value)}`);
|
|
16
|
-
}
|
|
17
|
-
return parsed;
|
|
18
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
parseHexColorOrThrow
|
|
4
|
+
} from "./Accordion-fsdgssfq.js";
|
|
19
5
|
|
|
20
6
|
// node_modules/culori/src/rgb/parseNumber.js
|
|
21
7
|
var parseNumber = (color, len) => {
|
|
@@ -3778,1412 +3764,4 @@ function contrastRatio(colorA, colorB) {
|
|
|
3778
3764
|
return contrast(colorA, colorB);
|
|
3779
3765
|
}
|
|
3780
3766
|
|
|
3781
|
-
|
|
3782
|
-
var BLACK = parseHexColorOrThrow("#000000");
|
|
3783
|
-
var WHITE = parseHexColorOrThrow("#FFFFFF");
|
|
3784
|
-
function getContrastRatio(colorA, colorB) {
|
|
3785
|
-
return contrastRatio(colorA, colorB);
|
|
3786
|
-
}
|
|
3787
|
-
function selectReadableForeground(background, foregrounds, minimumContrast, tiePolicy) {
|
|
3788
|
-
assertMinimumContrast(minimumContrast);
|
|
3789
|
-
if (foregrounds.length === 0) {
|
|
3790
|
-
throw new Error("[color-theory] Foreground candidates must not be empty.");
|
|
3791
|
-
}
|
|
3792
|
-
const normalizedBackground = parseHexColorOrThrow(background);
|
|
3793
|
-
const measured = foregrounds.map((foreground, index) => {
|
|
3794
|
-
const normalizedForeground = parseHexColorOrThrow(foreground);
|
|
3795
|
-
return {
|
|
3796
|
-
foreground: normalizedForeground,
|
|
3797
|
-
contrast: getContrastRatio(normalizedBackground, normalizedForeground),
|
|
3798
|
-
index
|
|
3799
|
-
};
|
|
3800
|
-
});
|
|
3801
|
-
const passing = measured.filter(({ contrast }) => contrast >= minimumContrast);
|
|
3802
|
-
const strongestContrast = Math.max(...passing.map(({ contrast }) => contrast));
|
|
3803
|
-
const strongest = passing.filter(({ contrast }) => contrast === strongestContrast);
|
|
3804
|
-
const selectedMeasured = tiePolicy === "first" ? strongest.at(0) : strongest.at(-1);
|
|
3805
|
-
const tieBreakApplied = strongest.length > 1;
|
|
3806
|
-
const candidates = measured.map(({ foreground, contrast, index }) => {
|
|
3807
|
-
const selected = selectedMeasured?.index === index;
|
|
3808
|
-
return {
|
|
3809
|
-
foreground,
|
|
3810
|
-
contrast,
|
|
3811
|
-
passesMinimum: contrast >= minimumContrast,
|
|
3812
|
-
selected,
|
|
3813
|
-
...!selected ? {
|
|
3814
|
-
rejectionReason: getForegroundRejectionReason(contrast, minimumContrast, strongestContrast)
|
|
3815
|
-
} : {}
|
|
3816
|
-
};
|
|
3817
|
-
});
|
|
3818
|
-
return {
|
|
3819
|
-
selected: candidates.find(({ selected }) => selected) ?? null,
|
|
3820
|
-
candidates,
|
|
3821
|
-
minimumContrast,
|
|
3822
|
-
tieBreak: { policy: tiePolicy, applied: tieBreakApplied }
|
|
3823
|
-
};
|
|
3824
|
-
}
|
|
3825
|
-
function getReadableForeground(background) {
|
|
3826
|
-
const result = selectReadableForeground(background, [BLACK, WHITE], 1, "first");
|
|
3827
|
-
if (!result.selected) {
|
|
3828
|
-
throw new Error("[color-theory] Expected black or white to be a readable foreground.");
|
|
3829
|
-
}
|
|
3830
|
-
return {
|
|
3831
|
-
foreground: result.selected.foreground,
|
|
3832
|
-
contrast: result.selected.contrast
|
|
3833
|
-
};
|
|
3834
|
-
}
|
|
3835
|
-
function assertMinimumContrast(minimumContrast) {
|
|
3836
|
-
if (!Number.isFinite(minimumContrast) || minimumContrast < 1 || minimumContrast > 21) {
|
|
3837
|
-
throw new Error(`[color-theory] Minimum contrast must be a finite ratio from 1 through 21: ${minimumContrast}.`);
|
|
3838
|
-
}
|
|
3839
|
-
}
|
|
3840
|
-
function getForegroundRejectionReason(contrast, minimumContrast, strongestContrast) {
|
|
3841
|
-
if (contrast < minimumContrast)
|
|
3842
|
-
return "minimum-contrast";
|
|
3843
|
-
if (contrast < strongestContrast)
|
|
3844
|
-
return "weaker-contrast";
|
|
3845
|
-
return "tie-break";
|
|
3846
|
-
}
|
|
3847
|
-
|
|
3848
|
-
// node_modules/@ankhorage/color-theory/dist/harmony.js
|
|
3849
|
-
var COLOR_HARMONY_CATALOG = [
|
|
3850
|
-
{
|
|
3851
|
-
id: "monochromatic",
|
|
3852
|
-
label: "Monochromatic",
|
|
3853
|
-
description: "Uses one hue with ramp variation.",
|
|
3854
|
-
offsets: [0],
|
|
3855
|
-
roles: ["primary"],
|
|
3856
|
-
roleCount: 1
|
|
3857
|
-
},
|
|
3858
|
-
{
|
|
3859
|
-
id: "analogous",
|
|
3860
|
-
label: "Analogous",
|
|
3861
|
-
description: "Uses the primary hue and its two neighboring hues at minus and plus 30 degrees.",
|
|
3862
|
-
offsets: [0, -30, 30],
|
|
3863
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
3864
|
-
roleCount: 3
|
|
3865
|
-
},
|
|
3866
|
-
{
|
|
3867
|
-
id: "complementary",
|
|
3868
|
-
label: "Complementary",
|
|
3869
|
-
description: "Pairs the primary hue with its opposite hue at 180 degrees.",
|
|
3870
|
-
offsets: [0, 180],
|
|
3871
|
-
roles: ["primary", "secondary"],
|
|
3872
|
-
roleCount: 2
|
|
3873
|
-
},
|
|
3874
|
-
{
|
|
3875
|
-
id: "splitComplementary",
|
|
3876
|
-
label: "Split complementary",
|
|
3877
|
-
description: "Uses the primary hue with hues at 150 and 210 degrees.",
|
|
3878
|
-
offsets: [0, 150, 210],
|
|
3879
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
3880
|
-
roleCount: 3
|
|
3881
|
-
},
|
|
3882
|
-
{
|
|
3883
|
-
id: "triadic",
|
|
3884
|
-
label: "Triadic",
|
|
3885
|
-
description: "Uses three evenly spaced hues at 120-degree intervals.",
|
|
3886
|
-
offsets: [0, 120, 240],
|
|
3887
|
-
roles: ["primary", "secondary", "tertiary"],
|
|
3888
|
-
roleCount: 3
|
|
3889
|
-
},
|
|
3890
|
-
{
|
|
3891
|
-
id: "tetradic",
|
|
3892
|
-
label: "Tetradic",
|
|
3893
|
-
description: "Uses a rectangular tetrad at 0, 60, 180, and 240 degrees.",
|
|
3894
|
-
offsets: [0, 60, 180, 240],
|
|
3895
|
-
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
3896
|
-
roleCount: 4
|
|
3897
|
-
},
|
|
3898
|
-
{
|
|
3899
|
-
id: "square",
|
|
3900
|
-
label: "Square",
|
|
3901
|
-
description: "Uses four evenly spaced hues at 90-degree intervals.",
|
|
3902
|
-
offsets: [0, 90, 180, 270],
|
|
3903
|
-
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
3904
|
-
roleCount: 4
|
|
3905
|
-
}
|
|
3906
|
-
];
|
|
3907
|
-
var COLOR_HARMONIES = COLOR_HARMONY_CATALOG.map(({ id }) => id);
|
|
3908
|
-
var MIN_HUEFUL_CHROMA = 0.015;
|
|
3909
|
-
function createHarmonyGenerationDiagnostics(primaryChroma) {
|
|
3910
|
-
const warnings = [];
|
|
3911
|
-
if (primaryChroma === 0) {
|
|
3912
|
-
warnings.push({
|
|
3913
|
-
code: "achromatic_primary",
|
|
3914
|
-
message: "The selected primary is achromatic, so generated hue relationships are not visible."
|
|
3915
|
-
});
|
|
3916
|
-
} else if (primaryChroma < MIN_HUEFUL_CHROMA) {
|
|
3917
|
-
warnings.push({
|
|
3918
|
-
code: "low_chroma_primary",
|
|
3919
|
-
message: "The selected primary has low chroma, so generated hue relationships may be weak."
|
|
3920
|
-
});
|
|
3921
|
-
}
|
|
3922
|
-
return {
|
|
3923
|
-
isHueReliable: primaryChroma >= MIN_HUEFUL_CHROMA,
|
|
3924
|
-
primaryChroma,
|
|
3925
|
-
warnings
|
|
3926
|
-
};
|
|
3927
|
-
}
|
|
3928
|
-
function getHarmonyDefinition(harmony) {
|
|
3929
|
-
const definition = COLOR_HARMONY_CATALOG.find(({ id }) => id === harmony);
|
|
3930
|
-
if (!definition) {
|
|
3931
|
-
throw new Error(`[color-theory] Missing definition for harmony ${harmony}.`);
|
|
3932
|
-
}
|
|
3933
|
-
return definition;
|
|
3934
|
-
}
|
|
3935
|
-
function generateHarmonyRoleColors(primaryColor, harmony) {
|
|
3936
|
-
const base = parseHexToOklch(primaryColor);
|
|
3937
|
-
const definition = getHarmonyDefinition(harmony);
|
|
3938
|
-
const baseHue = normalizeHueDegrees(base.h);
|
|
3939
|
-
const colors = definition.roles.map((role, index) => {
|
|
3940
|
-
const hueDegrees = normalizeHueDegrees(baseHue + (definition.offsets.at(index) ?? 0));
|
|
3941
|
-
return {
|
|
3942
|
-
role,
|
|
3943
|
-
hex: role === "primary" ? primaryColor : oklchToHex({ ...base, h: hueDegrees }),
|
|
3944
|
-
hueDegrees,
|
|
3945
|
-
source: role === "primary" ? "selected" : "generated"
|
|
3946
|
-
};
|
|
3947
|
-
});
|
|
3948
|
-
const primary = colors.find((color) => color.role === "primary");
|
|
3949
|
-
if (!primary) {
|
|
3950
|
-
throw new Error("[color-theory] Expected generated harmony role colors to include primary.");
|
|
3951
|
-
}
|
|
3952
|
-
const secondary = colors.find((color) => color.role === "secondary");
|
|
3953
|
-
const tertiary = colors.find((color) => color.role === "tertiary");
|
|
3954
|
-
const quaternary = colors.find((color) => color.role === "quaternary");
|
|
3955
|
-
return {
|
|
3956
|
-
harmony,
|
|
3957
|
-
colors,
|
|
3958
|
-
primary,
|
|
3959
|
-
...secondary ? { secondary } : {},
|
|
3960
|
-
...tertiary ? { tertiary } : {},
|
|
3961
|
-
...quaternary ? { quaternary } : {},
|
|
3962
|
-
diagnostics: createHarmonyGenerationDiagnostics(base.c)
|
|
3963
|
-
};
|
|
3964
|
-
}
|
|
3965
|
-
|
|
3966
|
-
// node_modules/@ankhorage/color-theory/dist/swatches.js
|
|
3967
|
-
var COLOR_SWATCH_STEPS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
3968
|
-
var COLOR_SWATCH_BASE_STEP = 500;
|
|
3969
|
-
var COLOR_SWATCH_BASE_LIGHTNESS = 0.551;
|
|
3970
|
-
var BASELINE_LIGHTNESS_BY_STEP = new Map([
|
|
3971
|
-
[50, 0.985],
|
|
3972
|
-
[100, 0.967],
|
|
3973
|
-
[200, 0.928],
|
|
3974
|
-
[300, 0.872],
|
|
3975
|
-
[400, 0.707],
|
|
3976
|
-
[COLOR_SWATCH_BASE_STEP, COLOR_SWATCH_BASE_LIGHTNESS],
|
|
3977
|
-
[600, 0.446],
|
|
3978
|
-
[700, 0.373],
|
|
3979
|
-
[800, 0.278],
|
|
3980
|
-
[900, 0.21],
|
|
3981
|
-
[950, 0.13]
|
|
3982
|
-
]);
|
|
3983
|
-
var MIN_USABLE_ADJACENT_DELTA = 0.012;
|
|
3984
|
-
var MIN_USABLE_LIGHTNESS_RANGE = 0.35;
|
|
3985
|
-
function clamp01(value) {
|
|
3986
|
-
if (!Number.isFinite(value))
|
|
3987
|
-
return 0;
|
|
3988
|
-
return Math.min(1, Math.max(0, value));
|
|
3989
|
-
}
|
|
3990
|
-
function chromaMultiplierForStep(step) {
|
|
3991
|
-
if (step <= 200)
|
|
3992
|
-
return 0.55;
|
|
3993
|
-
if (step <= 400)
|
|
3994
|
-
return 0.75;
|
|
3995
|
-
if (step === COLOR_SWATCH_BASE_STEP)
|
|
3996
|
-
return 1;
|
|
3997
|
-
if (step <= 700)
|
|
3998
|
-
return 0.9;
|
|
3999
|
-
return 0.8;
|
|
4000
|
-
}
|
|
4001
|
-
function getBaselineLightness(step) {
|
|
4002
|
-
const lightness = BASELINE_LIGHTNESS_BY_STEP.get(step);
|
|
4003
|
-
if (lightness === undefined) {
|
|
4004
|
-
throw new Error(`[color-theory] Missing baseline lightness for swatch step ${step}.`);
|
|
4005
|
-
}
|
|
4006
|
-
return lightness;
|
|
4007
|
-
}
|
|
4008
|
-
function createSwatchSample(baseColor, step, baseOffset) {
|
|
4009
|
-
const base = parseHexToOklch(baseColor);
|
|
4010
|
-
if (step === COLOR_SWATCH_BASE_STEP) {
|
|
4011
|
-
return { hex: baseColor, lightness: base.l, step };
|
|
4012
|
-
}
|
|
4013
|
-
const target = {
|
|
4014
|
-
...base,
|
|
4015
|
-
l: clamp01(getBaselineLightness(step) + baseOffset),
|
|
4016
|
-
c: clamp01(base.c * chromaMultiplierForStep(step))
|
|
4017
|
-
};
|
|
4018
|
-
const hex = oklchToHex(target);
|
|
4019
|
-
return { hex, lightness: parseHexToOklch(hex).l, step };
|
|
4020
|
-
}
|
|
4021
|
-
function createWeakStepWarning(baseColor, sample) {
|
|
4022
|
-
if (sample.step === COLOR_SWATCH_BASE_STEP)
|
|
4023
|
-
return;
|
|
4024
|
-
const deltaEFromBase = deltaEoklch(parseHexToOklch(baseColor), parseHexToOklch(sample.hex));
|
|
4025
|
-
if (deltaEFromBase >= 0.02)
|
|
4026
|
-
return;
|
|
4027
|
-
return {
|
|
4028
|
-
code: "weak_step",
|
|
4029
|
-
step: sample.step,
|
|
4030
|
-
deltaEFromBase,
|
|
4031
|
-
message: `Swatch step ${sample.step} is visually close to the base color.`
|
|
4032
|
-
};
|
|
4033
|
-
}
|
|
4034
|
-
function generateSwatchSamples(baseColor) {
|
|
4035
|
-
const baseOffset = parseHexToOklch(baseColor).l - COLOR_SWATCH_BASE_LIGHTNESS;
|
|
4036
|
-
const samples = COLOR_SWATCH_STEPS.map((step) => createSwatchSample(baseColor, step, baseOffset));
|
|
4037
|
-
const warnings = samples.map((sample) => createWeakStepWarning(baseColor, sample)).filter((warning) => warning !== undefined);
|
|
4038
|
-
return { samples, warnings };
|
|
4039
|
-
}
|
|
4040
|
-
function measureAdjacentSamples(samples) {
|
|
4041
|
-
const pairs = samples.slice(1).map((current, index) => ({ current, previous: samples.at(index) }));
|
|
4042
|
-
const measured = pairs.flatMap(({ current, previous }) => {
|
|
4043
|
-
if (!previous)
|
|
4044
|
-
return [];
|
|
4045
|
-
const delta = deltaEoklch(parseHexToOklch(previous.hex), parseHexToOklch(current.hex));
|
|
4046
|
-
const warning = delta < MIN_USABLE_ADJACENT_DELTA ? {
|
|
4047
|
-
code: "weak_adjacent_delta",
|
|
4048
|
-
step: current.step,
|
|
4049
|
-
deltaEFromBase: delta,
|
|
4050
|
-
message: `Swatch step ${current.step} is visually close to adjacent step ${previous.step}.`
|
|
4051
|
-
} : undefined;
|
|
4052
|
-
return [{ delta, warning }];
|
|
4053
|
-
});
|
|
4054
|
-
return {
|
|
4055
|
-
deltas: measured.map(({ delta }) => delta),
|
|
4056
|
-
warnings: measured.map(({ warning }) => warning).filter((warning) => warning !== undefined)
|
|
4057
|
-
};
|
|
4058
|
-
}
|
|
4059
|
-
function createSwatchDiagnostics(samples, adjacentDeltas, warnings) {
|
|
4060
|
-
const minAdjacentDelta = Math.min(...adjacentDeltas);
|
|
4061
|
-
const maxAdjacentDelta = Math.max(...adjacentDeltas);
|
|
4062
|
-
const lightnessEntries = samples.map(({ lightness }) => lightness);
|
|
4063
|
-
const minLightness = Math.min(...lightnessEntries);
|
|
4064
|
-
const maxLightness = Math.max(...lightnessEntries);
|
|
4065
|
-
const lightnessRange = maxLightness - minLightness;
|
|
4066
|
-
const rangeWarnings = lightnessRange < MIN_USABLE_LIGHTNESS_RANGE ? [
|
|
4067
|
-
{
|
|
4068
|
-
code: "limited_lightness_range",
|
|
4069
|
-
message: "Generated swatch has a limited lightness range."
|
|
4070
|
-
}
|
|
4071
|
-
] : [];
|
|
4072
|
-
return {
|
|
4073
|
-
isUsable: minAdjacentDelta >= MIN_USABLE_ADJACENT_DELTA && lightnessRange >= MIN_USABLE_LIGHTNESS_RANGE,
|
|
4074
|
-
warnings: [...warnings, ...rangeWarnings],
|
|
4075
|
-
minAdjacentDelta,
|
|
4076
|
-
maxAdjacentDelta,
|
|
4077
|
-
lightnessRange: { min: minLightness, max: maxLightness }
|
|
4078
|
-
};
|
|
4079
|
-
}
|
|
4080
|
-
function generateColorSwatch(baseColor) {
|
|
4081
|
-
const generated = generateSwatchSamples(baseColor);
|
|
4082
|
-
const adjacent = measureAdjacentSamples(generated.samples);
|
|
4083
|
-
const swatch = Object.fromEntries(generated.samples.map(({ hex, step }) => [step, hex]));
|
|
4084
|
-
return {
|
|
4085
|
-
swatch,
|
|
4086
|
-
diagnostics: createSwatchDiagnostics(generated.samples, adjacent.deltas, [
|
|
4087
|
-
...generated.warnings,
|
|
4088
|
-
...adjacent.warnings
|
|
4089
|
-
])
|
|
4090
|
-
};
|
|
4091
|
-
}
|
|
4092
|
-
|
|
4093
|
-
// node_modules/@ankhorage/color-theory/dist/neutral.js
|
|
4094
|
-
function pickTintSourceHex(roleColors, harmony) {
|
|
4095
|
-
if (harmony === "monochromatic")
|
|
4096
|
-
return roleColors.primary.hex;
|
|
4097
|
-
if (harmony === "complementary") {
|
|
4098
|
-
return roleColors.secondary?.hex ?? roleColors.primary.hex;
|
|
4099
|
-
}
|
|
4100
|
-
return roleColors.tertiary?.hex ?? roleColors.secondary?.hex ?? roleColors.primary.hex;
|
|
4101
|
-
}
|
|
4102
|
-
function clampNumber2(value, min, max) {
|
|
4103
|
-
if (!Number.isFinite(value))
|
|
4104
|
-
return min;
|
|
4105
|
-
return Math.min(max, Math.max(min, value));
|
|
4106
|
-
}
|
|
4107
|
-
function generateNeutralSwatch(roleColors) {
|
|
4108
|
-
const tintSourceHex = pickTintSourceHex(roleColors, roleColors.harmony);
|
|
4109
|
-
const tintSource = parseHexToOklch(tintSourceHex);
|
|
4110
|
-
const primary = parseHexToOklch(roleColors.primary.hex);
|
|
4111
|
-
const preferGray = tintSource.c < MIN_HUEFUL_CHROMA;
|
|
4112
|
-
const hue = roleColors.harmony === "monochromatic" ? primary.h : tintSource.h;
|
|
4113
|
-
const sourceChroma = roleColors.harmony === "monochromatic" ? primary.c : tintSource.c;
|
|
4114
|
-
const neutralHue = preferGray ? 0 : normalizeHueDegrees(hue);
|
|
4115
|
-
const neutralChroma = preferGray ? 0 : clampNumber2(sourceChroma * 0.06, 0.004, 0.012);
|
|
4116
|
-
const neutralKeyColor = oklchToHex({
|
|
4117
|
-
mode: "oklch",
|
|
4118
|
-
l: COLOR_SWATCH_BASE_LIGHTNESS,
|
|
4119
|
-
c: neutralChroma,
|
|
4120
|
-
h: neutralHue
|
|
4121
|
-
});
|
|
4122
|
-
const { swatch, diagnostics } = generateColorSwatch(neutralKeyColor);
|
|
4123
|
-
return { neutralKeyColor, neutral: swatch, diagnostics };
|
|
4124
|
-
}
|
|
4125
|
-
|
|
4126
|
-
// node_modules/@ankhorage/color-theory/dist/selection.js
|
|
4127
|
-
var DISTANCE_TIE_TOLERANCE = Number.EPSILON * 16;
|
|
4128
|
-
function selectColorSwatchStep(swatch, target, contexts, tiePolicy) {
|
|
4129
|
-
const normalizedTarget = normalizeTarget(target);
|
|
4130
|
-
const normalizedContexts = normalizeContexts(contexts);
|
|
4131
|
-
const measured = COLOR_SWATCH_STEPS.map((step) => measureCandidate(swatch, step, normalizedTarget, normalizedContexts));
|
|
4132
|
-
const eligible = measured.filter(({ passesContrast }) => passesContrast);
|
|
4133
|
-
const nearestDistance = Math.min(...eligible.map(({ targetDistance }) => targetDistance));
|
|
4134
|
-
const nearest = eligible.filter(({ targetDistance }) => Math.abs(targetDistance - nearestDistance) <= DISTANCE_TIE_TOLERANCE);
|
|
4135
|
-
const selectedMeasured = tiePolicy === "lower-step" ? nearest.at(0) : nearest.at(-1);
|
|
4136
|
-
const tieCandidateSteps = nearest.map(({ step }) => step);
|
|
4137
|
-
const candidates = measured.map((candidate) => createSelectionCandidate(candidate, selectedMeasured, nearestDistance, tieCandidateSteps));
|
|
4138
|
-
const selected = candidates.find((candidate) => candidate.selected) ?? null;
|
|
4139
|
-
return {
|
|
4140
|
-
selected,
|
|
4141
|
-
candidates,
|
|
4142
|
-
rejectedCandidates: candidates.filter((candidate) => !candidate.selected),
|
|
4143
|
-
target: normalizedTarget,
|
|
4144
|
-
tieBreak: {
|
|
4145
|
-
policy: tiePolicy,
|
|
4146
|
-
applied: nearest.length > 1,
|
|
4147
|
-
candidateSteps: tieCandidateSteps
|
|
4148
|
-
}
|
|
4149
|
-
};
|
|
4150
|
-
}
|
|
4151
|
-
function createSelectionCandidate(candidate, selected, nearestDistance, tieCandidateSteps) {
|
|
4152
|
-
const isSelected = selected?.step === candidate.step;
|
|
4153
|
-
return {
|
|
4154
|
-
step: candidate.step,
|
|
4155
|
-
hex: candidate.hex,
|
|
4156
|
-
targetDistance: candidate.targetDistance,
|
|
4157
|
-
contrasts: candidate.contrasts,
|
|
4158
|
-
selected: isSelected,
|
|
4159
|
-
rejectionReasons: getCandidateRejectionReasons(candidate, isSelected, nearestDistance, tieCandidateSteps)
|
|
4160
|
-
};
|
|
4161
|
-
}
|
|
4162
|
-
function getCandidateRejectionReasons(candidate, selected, nearestDistance, tieCandidateSteps) {
|
|
4163
|
-
if (selected)
|
|
4164
|
-
return [];
|
|
4165
|
-
if (!candidate.passesContrast)
|
|
4166
|
-
return ["contrast"];
|
|
4167
|
-
if (candidate.targetDistance > nearestDistance + DISTANCE_TIE_TOLERANCE) {
|
|
4168
|
-
return ["target-distance"];
|
|
4169
|
-
}
|
|
4170
|
-
if (tieCandidateSteps.includes(candidate.step))
|
|
4171
|
-
return ["tie-break"];
|
|
4172
|
-
return ["target-distance"];
|
|
4173
|
-
}
|
|
4174
|
-
function measureCandidate(swatch, step, target, contexts) {
|
|
4175
|
-
const value = Reflect.get(swatch, step);
|
|
4176
|
-
if (typeof value !== "string") {
|
|
4177
|
-
throw new Error(`[color-theory] Missing color swatch step: ${step}.`);
|
|
4178
|
-
}
|
|
4179
|
-
const hex = parseHexColorOrThrow(value);
|
|
4180
|
-
const contrasts = contexts.map((context) => {
|
|
4181
|
-
const contrast = getContrastRatio(hex, context.against);
|
|
4182
|
-
return { ...context, contrast, passes: contrast >= context.minimumContrast };
|
|
4183
|
-
});
|
|
4184
|
-
return {
|
|
4185
|
-
step,
|
|
4186
|
-
hex,
|
|
4187
|
-
targetDistance: measureTargetDistance(hex, target),
|
|
4188
|
-
contrasts,
|
|
4189
|
-
passesContrast: contrasts.every(({ passes }) => passes)
|
|
4190
|
-
};
|
|
4191
|
-
}
|
|
4192
|
-
function measureTargetDistance(hex, target) {
|
|
4193
|
-
const candidate = parseHexToOklch(hex);
|
|
4194
|
-
if (target.hueDegrees === undefined) {
|
|
4195
|
-
return Math.hypot(candidate.l - target.lightness, candidate.c - target.chroma);
|
|
4196
|
-
}
|
|
4197
|
-
return deltaEoklch(candidate, {
|
|
4198
|
-
mode: "oklch",
|
|
4199
|
-
l: target.lightness,
|
|
4200
|
-
c: target.chroma,
|
|
4201
|
-
h: target.hueDegrees
|
|
4202
|
-
});
|
|
4203
|
-
}
|
|
4204
|
-
function normalizeContexts(contexts) {
|
|
4205
|
-
if (contexts.length === 0) {
|
|
4206
|
-
throw new Error("[color-theory] Color contrast contexts must not be empty.");
|
|
4207
|
-
}
|
|
4208
|
-
const ids = new Set;
|
|
4209
|
-
return contexts.map((context) => {
|
|
4210
|
-
const id = context.id.trim();
|
|
4211
|
-
if (!id)
|
|
4212
|
-
throw new Error("[color-theory] Color contrast context id must not be empty.");
|
|
4213
|
-
if (ids.has(id)) {
|
|
4214
|
-
throw new Error(`[color-theory] Duplicate color contrast context id: ${JSON.stringify(id)}.`);
|
|
4215
|
-
}
|
|
4216
|
-
ids.add(id);
|
|
4217
|
-
if (!Number.isFinite(context.minimumContrast) || context.minimumContrast < 1 || context.minimumContrast > 21) {
|
|
4218
|
-
throw new Error(`[color-theory] Minimum contrast must be a finite ratio from 1 through 21: ${context.minimumContrast}.`);
|
|
4219
|
-
}
|
|
4220
|
-
return {
|
|
4221
|
-
id,
|
|
4222
|
-
against: parseHexColorOrThrow(context.against),
|
|
4223
|
-
minimumContrast: context.minimumContrast
|
|
4224
|
-
};
|
|
4225
|
-
});
|
|
4226
|
-
}
|
|
4227
|
-
function normalizeTarget(target) {
|
|
4228
|
-
if (!Number.isFinite(target.lightness) || target.lightness < 0 || target.lightness > 1) {
|
|
4229
|
-
throw new Error(`[color-theory] Target lightness must be finite and within 0 through 1: ${target.lightness}.`);
|
|
4230
|
-
}
|
|
4231
|
-
if (!Number.isFinite(target.chroma) || target.chroma < 0 || target.chroma > 0.4) {
|
|
4232
|
-
throw new Error(`[color-theory] Target chroma must be finite and within 0 through 0.4: ${target.chroma}.`);
|
|
4233
|
-
}
|
|
4234
|
-
if (target.hueDegrees !== undefined && !Number.isFinite(target.hueDegrees)) {
|
|
4235
|
-
throw new Error(`[color-theory] Target hue must be finite: ${target.hueDegrees}.`);
|
|
4236
|
-
}
|
|
4237
|
-
return {
|
|
4238
|
-
lightness: target.lightness,
|
|
4239
|
-
chroma: target.chroma,
|
|
4240
|
-
...target.hueDegrees !== undefined ? { hueDegrees: normalizeHueDegrees(target.hueDegrees) } : {}
|
|
4241
|
-
};
|
|
4242
|
-
}
|
|
4243
|
-
|
|
4244
|
-
// node_modules/@ankhorage/color-theory/dist/semantic-status.js
|
|
4245
|
-
var DEFAULT_SEMANTIC_STATUS_COLOR_SEEDS = {
|
|
4246
|
-
danger: "#ef4444",
|
|
4247
|
-
info: "#3b82f6",
|
|
4248
|
-
success: "#22c55e",
|
|
4249
|
-
warning: "#f59e0b"
|
|
4250
|
-
};
|
|
4251
|
-
function createRoleRecord(entries) {
|
|
4252
|
-
return Object.fromEntries(entries);
|
|
4253
|
-
}
|
|
4254
|
-
function generateSemanticStatus(role, seed) {
|
|
4255
|
-
const seedHex = typeof seed === "string" ? parseHexColorOrThrow(seed) : seed;
|
|
4256
|
-
const generated = generateColorSwatch(seedHex);
|
|
4257
|
-
return {
|
|
4258
|
-
role,
|
|
4259
|
-
seed: seedHex,
|
|
4260
|
-
swatch: generated.swatch,
|
|
4261
|
-
diagnostics: generated.diagnostics
|
|
4262
|
-
};
|
|
4263
|
-
}
|
|
4264
|
-
function createSemanticStatusSwatches(seeds) {
|
|
4265
|
-
const generated = Object.entries(seeds).map(([role, seed]) => generateSemanticStatus(role, seed));
|
|
4266
|
-
return {
|
|
4267
|
-
seeds: createRoleRecord(generated.map(({ role, seed }) => [role, seed])),
|
|
4268
|
-
swatches: createRoleRecord(generated.map(({ role, swatch }) => [role, swatch])),
|
|
4269
|
-
diagnostics: createRoleRecord(generated.map(({ diagnostics, role }) => [role, diagnostics]))
|
|
4270
|
-
};
|
|
4271
|
-
}
|
|
4272
|
-
function createDefaultSemanticStatusSwatches() {
|
|
4273
|
-
return createSemanticStatusSwatches(DEFAULT_SEMANTIC_STATUS_COLOR_SEEDS);
|
|
4274
|
-
}
|
|
4275
|
-
|
|
4276
|
-
// node_modules/@ankhorage/color-theory/dist/semantics.js
|
|
4277
|
-
var LIGHT_SEMANTIC_COLOR_REFERENCES = {
|
|
4278
|
-
background: { role: "neutral", step: 50 },
|
|
4279
|
-
surface: { role: "neutral", step: 100 },
|
|
4280
|
-
surfaceRaised: { role: "neutral", step: 50 },
|
|
4281
|
-
border: { role: "neutral", step: 200 },
|
|
4282
|
-
divider: { role: "neutral", step: 200 },
|
|
4283
|
-
text: { role: "neutral", step: 900 },
|
|
4284
|
-
textMuted: { role: "neutral", step: 700 },
|
|
4285
|
-
disabledBg: { role: "neutral", step: 200 },
|
|
4286
|
-
disabledText: { role: "neutral", step: 500 },
|
|
4287
|
-
brand: { role: "primary", step: 600 },
|
|
4288
|
-
brandEmphasis: { role: "primary", step: 700 },
|
|
4289
|
-
action: { role: "primary", step: 600 },
|
|
4290
|
-
actionEmphasis: { role: "primary", step: 700 }
|
|
4291
|
-
};
|
|
4292
|
-
var DARK_SEMANTIC_COLOR_REFERENCES = {
|
|
4293
|
-
background: { role: "neutral", step: 950 },
|
|
4294
|
-
surface: { role: "neutral", step: 900 },
|
|
4295
|
-
surfaceRaised: { role: "neutral", step: 900 },
|
|
4296
|
-
border: { role: "neutral", step: 800 },
|
|
4297
|
-
divider: { role: "neutral", step: 800 },
|
|
4298
|
-
text: { role: "neutral", step: 50 },
|
|
4299
|
-
textMuted: { role: "neutral", step: 200 },
|
|
4300
|
-
disabledBg: { role: "neutral", step: 800 },
|
|
4301
|
-
disabledText: { role: "neutral", step: 500 },
|
|
4302
|
-
brand: { role: "primary", step: 400 },
|
|
4303
|
-
brandEmphasis: { role: "primary", step: 300 },
|
|
4304
|
-
action: { role: "primary", step: 400 },
|
|
4305
|
-
actionEmphasis: { role: "primary", step: 300 }
|
|
4306
|
-
};
|
|
4307
|
-
|
|
4308
|
-
// node_modules/@ankhorage/color-theory/dist/theme-colors.js
|
|
4309
|
-
function getThemeModePrimaryHex(mode) {
|
|
4310
|
-
return parseHexColorOrThrow(mode.primaryColor);
|
|
4311
|
-
}
|
|
4312
|
-
function generateThemeModeColors(mode) {
|
|
4313
|
-
const primaryHex = getThemeModePrimaryHex(mode);
|
|
4314
|
-
const harmonyRoleColors = generateHarmonyRoleColors(primaryHex, mode.harmony);
|
|
4315
|
-
const primarySwatch = generateColorSwatch(harmonyRoleColors.primary.hex).swatch;
|
|
4316
|
-
const secondarySwatch = harmonyRoleColors.secondary ? generateColorSwatch(harmonyRoleColors.secondary.hex).swatch : undefined;
|
|
4317
|
-
const tertiarySwatch = harmonyRoleColors.tertiary ? generateColorSwatch(harmonyRoleColors.tertiary.hex).swatch : undefined;
|
|
4318
|
-
const quaternarySwatch = harmonyRoleColors.quaternary ? generateColorSwatch(harmonyRoleColors.quaternary.hex).swatch : undefined;
|
|
4319
|
-
const neutral = generateNeutralSwatch(harmonyRoleColors);
|
|
4320
|
-
const swatches = {
|
|
4321
|
-
primary: primarySwatch,
|
|
4322
|
-
neutral: neutral.neutral,
|
|
4323
|
-
...secondarySwatch ? { secondary: secondarySwatch } : {},
|
|
4324
|
-
...tertiarySwatch ? { tertiary: tertiarySwatch } : {},
|
|
4325
|
-
...quaternarySwatch ? { quaternary: quaternarySwatch } : {}
|
|
4326
|
-
};
|
|
4327
|
-
return {
|
|
4328
|
-
harmonyRoleColors,
|
|
4329
|
-
swatches,
|
|
4330
|
-
neutral: {
|
|
4331
|
-
neutralKeyColor: neutral.neutralKeyColor,
|
|
4332
|
-
diagnostics: neutral.diagnostics
|
|
4333
|
-
}
|
|
4334
|
-
};
|
|
4335
|
-
}
|
|
4336
|
-
|
|
4337
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/resolveSemanticColors.ts
|
|
4338
|
-
function resolveSemanticColors(generated, references) {
|
|
4339
|
-
return Object.fromEntries(Object.entries(references).map(([token, ref]) => {
|
|
4340
|
-
const swatch = generated.swatches[ref.role];
|
|
4341
|
-
if (!swatch) {
|
|
4342
|
-
throw new Error(`Missing swatch for role '${ref.role}' (token: '${token}')`);
|
|
4343
|
-
}
|
|
4344
|
-
return [token, swatch[ref.step]];
|
|
4345
|
-
}));
|
|
4346
|
-
}
|
|
4347
|
-
|
|
4348
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/createSurfaceColorDiagnosticCollector.ts
|
|
4349
|
-
function createSurfaceColorDiagnosticCollector() {
|
|
4350
|
-
return new SurfaceColorDiagnosticCollector;
|
|
4351
|
-
}
|
|
4352
|
-
|
|
4353
|
-
class SurfaceColorDiagnosticCollector {
|
|
4354
|
-
selections = [];
|
|
4355
|
-
contrasts = [];
|
|
4356
|
-
measureForeground = (id, foreground, background, minimumContrast) => {
|
|
4357
|
-
const contrast = getContrastRatio(foreground, background);
|
|
4358
|
-
this.contrasts.push({
|
|
4359
|
-
id,
|
|
4360
|
-
foreground,
|
|
4361
|
-
background,
|
|
4362
|
-
contrast,
|
|
4363
|
-
minimumContrast,
|
|
4364
|
-
passes: contrast >= minimumContrast
|
|
4365
|
-
});
|
|
4366
|
-
return foreground;
|
|
4367
|
-
};
|
|
4368
|
-
measureSurface = (id, foreground, background, minimumContrast) => {
|
|
4369
|
-
const contrast = getContrastRatio(foreground, background);
|
|
4370
|
-
return {
|
|
4371
|
-
id,
|
|
4372
|
-
foreground,
|
|
4373
|
-
background,
|
|
4374
|
-
contrast,
|
|
4375
|
-
minimumContrast,
|
|
4376
|
-
passes: contrast >= minimumContrast
|
|
4377
|
-
};
|
|
4378
|
-
};
|
|
4379
|
-
selectColor = (id, swatch, target, contexts, tiePolicy) => {
|
|
4380
|
-
const result = selectColorSwatchStep(swatch, target, contexts, tiePolicy);
|
|
4381
|
-
this.selections.push({ id, result });
|
|
4382
|
-
if (!result.selected) {
|
|
4383
|
-
throw new Error(`[surface] No '${id}' swatch step satisfies the required contrast.`);
|
|
4384
|
-
}
|
|
4385
|
-
return result.selected.hex;
|
|
4386
|
-
};
|
|
4387
|
-
selectForeground = (id, background, minimumContrast) => {
|
|
4388
|
-
const selected = getReadableForeground(background);
|
|
4389
|
-
this.contrasts.push({
|
|
4390
|
-
id,
|
|
4391
|
-
foreground: selected.foreground,
|
|
4392
|
-
background,
|
|
4393
|
-
contrast: selected.contrast,
|
|
4394
|
-
minimumContrast,
|
|
4395
|
-
passes: selected.contrast >= minimumContrast
|
|
4396
|
-
});
|
|
4397
|
-
return selected.foreground;
|
|
4398
|
-
};
|
|
4399
|
-
}
|
|
4400
|
-
|
|
4401
|
-
// node_modules/@ankhorage/surface/src/features/theme/constants.ts
|
|
4402
|
-
var EMPTY_FONT_MAP = {
|
|
4403
|
-
"100": undefined,
|
|
4404
|
-
"200": undefined,
|
|
4405
|
-
"300": undefined,
|
|
4406
|
-
"400": undefined,
|
|
4407
|
-
"500": undefined,
|
|
4408
|
-
"600": undefined,
|
|
4409
|
-
"700": undefined,
|
|
4410
|
-
"800": undefined,
|
|
4411
|
-
"900": undefined,
|
|
4412
|
-
bold: undefined,
|
|
4413
|
-
normal: undefined
|
|
4414
|
-
};
|
|
4415
|
-
var DEFAULT_TOKENS = {
|
|
4416
|
-
spacing: { none: 0, xs: 4, s: 8, m: 16, l: 24, xl: 32, xxl: 48 },
|
|
4417
|
-
radii: { none: 0, s: 4, m: 8, l: 16, full: 9999 },
|
|
4418
|
-
typography: {
|
|
4419
|
-
headings: {
|
|
4420
|
-
1: { size: 32, lineHeight: 40, weight: "bold" },
|
|
4421
|
-
2: { size: 24, lineHeight: 32, weight: "bold" },
|
|
4422
|
-
3: { size: 20, lineHeight: 28, weight: "bold" },
|
|
4423
|
-
4: { size: 18, lineHeight: 24, weight: "semiBold" },
|
|
4424
|
-
5: { size: 16, lineHeight: 22, weight: "semiBold" },
|
|
4425
|
-
6: { size: 14, lineHeight: 20, weight: "semiBold" }
|
|
4426
|
-
},
|
|
4427
|
-
sizes: {
|
|
4428
|
-
xs: 12,
|
|
4429
|
-
s: 14,
|
|
4430
|
-
m: 16,
|
|
4431
|
-
l: 18,
|
|
4432
|
-
xl: 20,
|
|
4433
|
-
xxl: 24,
|
|
4434
|
-
"3xl": 30,
|
|
4435
|
-
h1: 32,
|
|
4436
|
-
h2: 24,
|
|
4437
|
-
h3: 20,
|
|
4438
|
-
h4: 18,
|
|
4439
|
-
h5: 16,
|
|
4440
|
-
h6: 14
|
|
4441
|
-
},
|
|
4442
|
-
weights: {
|
|
4443
|
-
thin: "100",
|
|
4444
|
-
extraLight: "200",
|
|
4445
|
-
light: "300",
|
|
4446
|
-
regular: "400",
|
|
4447
|
-
medium: "500",
|
|
4448
|
-
semiBold: "600",
|
|
4449
|
-
bold: "700",
|
|
4450
|
-
extraBold: "800",
|
|
4451
|
-
black: "900"
|
|
4452
|
-
},
|
|
4453
|
-
fonts: { normal: { ...EMPTY_FONT_MAP }, italic: { ...EMPTY_FONT_MAP } }
|
|
4454
|
-
},
|
|
4455
|
-
shadows: { soft: 2, medium: 4, hard: 8 }
|
|
4456
|
-
};
|
|
4457
|
-
var SURFACE_COLOR_POLICY = {
|
|
4458
|
-
disabledContrast: 3,
|
|
4459
|
-
surfaceSeparation: 1.05,
|
|
4460
|
-
textContrast: 4.5,
|
|
4461
|
-
uiContrast: 3
|
|
4462
|
-
};
|
|
4463
|
-
|
|
4464
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/createSurfaceSemanticPolicy.ts
|
|
4465
|
-
function createSurfaceSemanticPolicy(resolved, isDark, measurements) {
|
|
4466
|
-
return new SurfaceSemanticPolicy(resolved, isDark, measurements);
|
|
4467
|
-
}
|
|
4468
|
-
|
|
4469
|
-
class SurfaceSemanticPolicy {
|
|
4470
|
-
resolved;
|
|
4471
|
-
isDark;
|
|
4472
|
-
measurements;
|
|
4473
|
-
adjacentSurfaceContexts;
|
|
4474
|
-
textSurfaceContexts;
|
|
4475
|
-
tiePolicy;
|
|
4476
|
-
constructor(resolved, isDark, measurements) {
|
|
4477
|
-
this.resolved = resolved;
|
|
4478
|
-
this.isDark = isDark;
|
|
4479
|
-
this.measurements = measurements;
|
|
4480
|
-
this.adjacentSurfaceContexts = this.createSurfaceContexts(SURFACE_COLOR_POLICY.uiContrast);
|
|
4481
|
-
this.textSurfaceContexts = this.createSurfaceContexts(SURFACE_COLOR_POLICY.textContrast);
|
|
4482
|
-
this.tiePolicy = isDark ? "lower-step" : "higher-step";
|
|
4483
|
-
}
|
|
4484
|
-
buildNeutral(neutralSwatch) {
|
|
4485
|
-
return {
|
|
4486
|
-
bg: this.resolved.background,
|
|
4487
|
-
bgSubtle: this.resolved.surface,
|
|
4488
|
-
surface: this.resolved.surface,
|
|
4489
|
-
surfaceHover: this.isDark ? neutralSwatch[800] : neutralSwatch[200],
|
|
4490
|
-
surfaceActive: this.isDark ? neutralSwatch[700] : neutralSwatch[300],
|
|
4491
|
-
border: this.resolved.border,
|
|
4492
|
-
borderStrong: this.isDark ? neutralSwatch[600] : neutralSwatch[300],
|
|
4493
|
-
divider: this.resolved.divider,
|
|
4494
|
-
text: this.resolved.text,
|
|
4495
|
-
textMuted: this.resolved.textMuted,
|
|
4496
|
-
textSubtle: this.isDark ? neutralSwatch[300] : neutralSwatch[600],
|
|
4497
|
-
disabledBg: this.resolved.disabledBg,
|
|
4498
|
-
disabledText: this.resolved.disabledText
|
|
4499
|
-
};
|
|
4500
|
-
}
|
|
4501
|
-
buildSurface(inverse) {
|
|
4502
|
-
return {
|
|
4503
|
-
default: this.resolved.surface,
|
|
4504
|
-
subtle: this.resolved.background,
|
|
4505
|
-
raised: this.resolved.surfaceRaised,
|
|
4506
|
-
sunken: this.resolved.background,
|
|
4507
|
-
overlay: this.resolved.surfaceRaised,
|
|
4508
|
-
scrim: "#0000008f",
|
|
4509
|
-
disabled: this.resolved.disabledBg,
|
|
4510
|
-
inverse
|
|
4511
|
-
};
|
|
4512
|
-
}
|
|
4513
|
-
measureContent(content, surface) {
|
|
4514
|
-
const pairs = [
|
|
4515
|
-
[
|
|
4516
|
-
"content.default/background",
|
|
4517
|
-
content.default,
|
|
4518
|
-
surface.sunken,
|
|
4519
|
-
SURFACE_COLOR_POLICY.textContrast
|
|
4520
|
-
],
|
|
4521
|
-
[
|
|
4522
|
-
"content.default/surface",
|
|
4523
|
-
content.default,
|
|
4524
|
-
surface.default,
|
|
4525
|
-
SURFACE_COLOR_POLICY.textContrast
|
|
4526
|
-
],
|
|
4527
|
-
["content.muted/surface", content.muted, surface.default, SURFACE_COLOR_POLICY.textContrast],
|
|
4528
|
-
[
|
|
4529
|
-
"content.subtle/surface",
|
|
4530
|
-
content.subtle,
|
|
4531
|
-
surface.default,
|
|
4532
|
-
SURFACE_COLOR_POLICY.textContrast
|
|
4533
|
-
],
|
|
4534
|
-
[
|
|
4535
|
-
"content.disabled/disabled",
|
|
4536
|
-
content.disabled,
|
|
4537
|
-
surface.disabled,
|
|
4538
|
-
SURFACE_COLOR_POLICY.disabledContrast
|
|
4539
|
-
],
|
|
4540
|
-
[
|
|
4541
|
-
"content.inverse/inverse",
|
|
4542
|
-
content.inverse,
|
|
4543
|
-
surface.inverse,
|
|
4544
|
-
SURFACE_COLOR_POLICY.textContrast
|
|
4545
|
-
]
|
|
4546
|
-
];
|
|
4547
|
-
for (const [id, foreground, background, minimumContrast] of pairs) {
|
|
4548
|
-
this.measurements.measureForeground(id, parseHexColorOrThrow(foreground), parseHexColorOrThrow(background), minimumContrast);
|
|
4549
|
-
}
|
|
4550
|
-
}
|
|
4551
|
-
measureSurfaceSeparation(surface) {
|
|
4552
|
-
return [
|
|
4553
|
-
this.measureSurface("surface.default", surface.default),
|
|
4554
|
-
this.measureSurface("surface.raised", surface.raised),
|
|
4555
|
-
this.measureSurface("surface.disabled", surface.disabled)
|
|
4556
|
-
];
|
|
4557
|
-
}
|
|
4558
|
-
neutralTarget() {
|
|
4559
|
-
return { lightness: this.isDark ? 0.65 : 0.55, chroma: 0.02 };
|
|
4560
|
-
}
|
|
4561
|
-
roleTarget() {
|
|
4562
|
-
return { lightness: this.isDark ? 0.65 : 0.5, chroma: 0.15 };
|
|
4563
|
-
}
|
|
4564
|
-
strongNeutralTarget() {
|
|
4565
|
-
return { lightness: this.isDark ? 0.8 : 0.4, chroma: 0.02 };
|
|
4566
|
-
}
|
|
4567
|
-
textTarget() {
|
|
4568
|
-
return { lightness: this.isDark ? 0.75 : 0.45, chroma: 0.15 };
|
|
4569
|
-
}
|
|
4570
|
-
createSurfaceContexts(minimumContrast) {
|
|
4571
|
-
return [
|
|
4572
|
-
{ id: "background", against: this.resolved.background, minimumContrast },
|
|
4573
|
-
{ id: "surface", against: this.resolved.surface, minimumContrast }
|
|
4574
|
-
];
|
|
4575
|
-
}
|
|
4576
|
-
measureSurface(id, foreground) {
|
|
4577
|
-
return this.measurements.measureSurface(id, parseHexColorOrThrow(foreground), this.resolved.background, SURFACE_COLOR_POLICY.surfaceSeparation);
|
|
4578
|
-
}
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/resolveRoleSemantics.ts
|
|
4582
|
-
function resolveRoleSemantics({
|
|
4583
|
-
base,
|
|
4584
|
-
disabledBg,
|
|
4585
|
-
disabledText,
|
|
4586
|
-
hover,
|
|
4587
|
-
id,
|
|
4588
|
-
isDark,
|
|
4589
|
-
measureForeground,
|
|
4590
|
-
onSurfaceText,
|
|
4591
|
-
outline,
|
|
4592
|
-
selectForeground,
|
|
4593
|
-
swatch
|
|
4594
|
-
}) {
|
|
4595
|
-
const states = resolveRoleStateColors(swatch, isDark, base, hover);
|
|
4596
|
-
return {
|
|
4597
|
-
...states,
|
|
4598
|
-
outline,
|
|
4599
|
-
onSurfaceText,
|
|
4600
|
-
onSolidText: selectForeground(`${id}.base`, states.base, SURFACE_COLOR_POLICY.textContrast),
|
|
4601
|
-
onHoverText: selectForeground(`${id}.hover`, states.hover, SURFACE_COLOR_POLICY.textContrast),
|
|
4602
|
-
onStrongText: selectForeground(`${id}.strong`, states.strong, SURFACE_COLOR_POLICY.textContrast),
|
|
4603
|
-
onSoftText: selectForeground(`${id}.soft`, states.softBg, SURFACE_COLOR_POLICY.textContrast),
|
|
4604
|
-
onSoftHoverText: selectForeground(`${id}.softHover`, states.softHover, SURFACE_COLOR_POLICY.textContrast),
|
|
4605
|
-
onSoftActiveText: selectForeground(`${id}.softActive`, states.softActive, SURFACE_COLOR_POLICY.textContrast),
|
|
4606
|
-
disabledBg,
|
|
4607
|
-
onDisabledText: measureForeground(`${id}.disabled`, disabledText, disabledBg, SURFACE_COLOR_POLICY.disabledContrast)
|
|
4608
|
-
};
|
|
4609
|
-
}
|
|
4610
|
-
function resolveRoleStateColors(swatch, isDark, base, hover) {
|
|
4611
|
-
return {
|
|
4612
|
-
base: base ?? swatch[500],
|
|
4613
|
-
hover: hover ?? (isDark ? swatch[400] : swatch[600]),
|
|
4614
|
-
strong: isDark ? swatch[300] : swatch[700],
|
|
4615
|
-
softBg: isDark ? swatch[900] : swatch[100],
|
|
4616
|
-
softHover: isDark ? swatch[800] : swatch[200],
|
|
4617
|
-
softActive: isDark ? swatch[700] : swatch[300]
|
|
4618
|
-
};
|
|
4619
|
-
}
|
|
4620
|
-
|
|
4621
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/resolveSurfaceSemanticModel.ts
|
|
4622
|
-
function resolveSurfaceSemanticModel(input) {
|
|
4623
|
-
const context = createResolutionContext(input);
|
|
4624
|
-
const roles = resolveSemanticRoles(context);
|
|
4625
|
-
const inverseSurface = context.isDark ? context.neutralSwatch[50] : context.neutralSwatch[900];
|
|
4626
|
-
const inverseContent = context.isDark ? context.neutralSwatch[900] : context.neutralSwatch[50];
|
|
4627
|
-
const neutral = context.policy.buildNeutral(context.neutralSwatch);
|
|
4628
|
-
const surface = context.policy.buildSurface(inverseSurface);
|
|
4629
|
-
const content = resolveContentSemantics(context, neutral.textSubtle, inverseContent);
|
|
4630
|
-
const border = resolveBorderSemantics(context, roles.brand.outline);
|
|
4631
|
-
context.policy.measureContent(content, surface);
|
|
4632
|
-
return {
|
|
4633
|
-
semantics: {
|
|
4634
|
-
neutral,
|
|
4635
|
-
brand: roles.brand,
|
|
4636
|
-
secondary: roles.secondary,
|
|
4637
|
-
accent: roles.accent,
|
|
4638
|
-
highlight: roles.highlight,
|
|
4639
|
-
danger: roles.danger,
|
|
4640
|
-
success: roles.success,
|
|
4641
|
-
warning: roles.warning,
|
|
4642
|
-
error: roles.danger,
|
|
4643
|
-
info: roles.info,
|
|
4644
|
-
surface,
|
|
4645
|
-
content,
|
|
4646
|
-
border,
|
|
4647
|
-
selection: {
|
|
4648
|
-
background: roles.brand.softBg,
|
|
4649
|
-
content: roles.brand.onSoftText,
|
|
4650
|
-
border: border.focus
|
|
4651
|
-
},
|
|
4652
|
-
action: { primary: roles.brand, neutral: roles.neutralAction, danger: roles.danger }
|
|
4653
|
-
},
|
|
4654
|
-
colorDiagnostics: {
|
|
4655
|
-
mode: context.mode,
|
|
4656
|
-
generated: context.generated,
|
|
4657
|
-
semanticReferences: context.references,
|
|
4658
|
-
statusSwatches: context.statusSwatches.diagnostics,
|
|
4659
|
-
selections: context.collector.selections,
|
|
4660
|
-
contrasts: context.collector.contrasts,
|
|
4661
|
-
surfaceSeparation: context.policy.measureSurfaceSeparation(surface)
|
|
4662
|
-
}
|
|
4663
|
-
};
|
|
4664
|
-
}
|
|
4665
|
-
function createResolutionContext(input) {
|
|
4666
|
-
const { generated, mode, references, resolved } = input;
|
|
4667
|
-
const { swatches } = generated;
|
|
4668
|
-
const collector = createSurfaceColorDiagnosticCollector();
|
|
4669
|
-
const isDark = mode === "dark";
|
|
4670
|
-
return {
|
|
4671
|
-
collector,
|
|
4672
|
-
generated,
|
|
4673
|
-
isDark,
|
|
4674
|
-
mode,
|
|
4675
|
-
neutralSwatch: swatches.neutral,
|
|
4676
|
-
policy: createSurfaceSemanticPolicy(resolved, isDark, collector),
|
|
4677
|
-
quaternarySwatch: swatches.quaternary ?? swatches.primary,
|
|
4678
|
-
references,
|
|
4679
|
-
resolved,
|
|
4680
|
-
secondarySwatch: swatches.secondary ?? swatches.primary,
|
|
4681
|
-
statusSwatches: createDefaultSemanticStatusSwatches(),
|
|
4682
|
-
swatches,
|
|
4683
|
-
tertiarySwatch: swatches.tertiary ?? swatches.primary
|
|
4684
|
-
};
|
|
4685
|
-
}
|
|
4686
|
-
function resolveBorderSemantics(context, focus) {
|
|
4687
|
-
const { collector, neutralSwatch, policy, resolved } = context;
|
|
4688
|
-
return {
|
|
4689
|
-
default: collector.selectColor("border.default", neutralSwatch, policy.neutralTarget(), policy.adjacentSurfaceContexts, policy.tiePolicy),
|
|
4690
|
-
subtle: resolved.border,
|
|
4691
|
-
strong: collector.selectColor("border.strong", neutralSwatch, policy.strongNeutralTarget(), policy.adjacentSurfaceContexts, policy.tiePolicy),
|
|
4692
|
-
divider: resolved.divider,
|
|
4693
|
-
focus
|
|
4694
|
-
};
|
|
4695
|
-
}
|
|
4696
|
-
function resolveContentSemantics(context, subtle, inverse) {
|
|
4697
|
-
const { collector, policy, resolved, secondarySwatch, swatches } = context;
|
|
4698
|
-
return {
|
|
4699
|
-
default: resolved.text,
|
|
4700
|
-
muted: resolved.textMuted,
|
|
4701
|
-
subtle,
|
|
4702
|
-
disabled: resolved.disabledText,
|
|
4703
|
-
icon: resolved.text,
|
|
4704
|
-
link: collector.selectColor("content.link", swatches.primary, policy.textTarget(), policy.textSurfaceContexts, policy.tiePolicy),
|
|
4705
|
-
visited: collector.selectColor("content.visited", secondarySwatch, policy.textTarget(), policy.textSurfaceContexts, policy.tiePolicy),
|
|
4706
|
-
inverse
|
|
4707
|
-
};
|
|
4708
|
-
}
|
|
4709
|
-
function resolveRole(context, id, swatch, options = {}) {
|
|
4710
|
-
const { collector, isDark, policy, resolved } = context;
|
|
4711
|
-
return resolveRoleSemantics({
|
|
4712
|
-
base: options.base,
|
|
4713
|
-
disabledBg: resolved.disabledBg,
|
|
4714
|
-
disabledText: resolved.disabledText,
|
|
4715
|
-
hover: options.hover,
|
|
4716
|
-
id,
|
|
4717
|
-
isDark,
|
|
4718
|
-
measureForeground: collector.measureForeground,
|
|
4719
|
-
onSurfaceText: collector.selectColor(`${id}.content`, swatch, policy.textTarget(), policy.textSurfaceContexts, policy.tiePolicy),
|
|
4720
|
-
outline: collector.selectColor(`${id}.outline`, swatch, options.target ?? policy.roleTarget(), policy.adjacentSurfaceContexts, policy.tiePolicy),
|
|
4721
|
-
selectForeground: collector.selectForeground,
|
|
4722
|
-
swatch
|
|
4723
|
-
});
|
|
4724
|
-
}
|
|
4725
|
-
function resolveSemanticRoles(context) {
|
|
4726
|
-
const { neutralSwatch, resolved, secondarySwatch, statusSwatches, swatches } = context;
|
|
4727
|
-
return {
|
|
4728
|
-
brand: resolveRole(context, "brand", swatches.primary, {
|
|
4729
|
-
base: resolved.action,
|
|
4730
|
-
hover: resolved.actionEmphasis
|
|
4731
|
-
}),
|
|
4732
|
-
secondary: resolveRole(context, "secondary", secondarySwatch),
|
|
4733
|
-
accent: resolveRole(context, "accent", context.tertiarySwatch),
|
|
4734
|
-
highlight: resolveRole(context, "highlight", context.quaternarySwatch),
|
|
4735
|
-
danger: resolveRole(context, "danger", statusSwatches.swatches.danger),
|
|
4736
|
-
success: resolveRole(context, "success", statusSwatches.swatches.success),
|
|
4737
|
-
warning: resolveRole(context, "warning", statusSwatches.swatches.warning),
|
|
4738
|
-
info: resolveRole(context, "info", statusSwatches.swatches.info),
|
|
4739
|
-
neutralAction: resolveRole(context, "neutral", neutralSwatch, {
|
|
4740
|
-
target: context.policy.neutralTarget()
|
|
4741
|
-
})
|
|
4742
|
-
};
|
|
4743
|
-
}
|
|
4744
|
-
|
|
4745
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/generatePalette.ts
|
|
4746
|
-
function generatePalette(config, mode = "light") {
|
|
4747
|
-
const modeConfig = mode === "dark" ? config.dark : config.light;
|
|
4748
|
-
const isDark = mode === "dark";
|
|
4749
|
-
parseHexColorOrThrow(modeConfig.primaryColor);
|
|
4750
|
-
const generated = generateThemeModeColors(modeConfig);
|
|
4751
|
-
const { swatches } = generated;
|
|
4752
|
-
const references = isDark ? DARK_SEMANTIC_COLOR_REFERENCES : LIGHT_SEMANTIC_COLOR_REFERENCES;
|
|
4753
|
-
const resolved = resolveSemanticColors(generated, references);
|
|
4754
|
-
const { semantics, colorDiagnostics } = resolveSurfaceSemanticModel({
|
|
4755
|
-
generated,
|
|
4756
|
-
mode,
|
|
4757
|
-
references,
|
|
4758
|
-
resolved
|
|
4759
|
-
});
|
|
4760
|
-
const { border, content, error, info, neutral, success, surface, warning } = semantics;
|
|
4761
|
-
const colors = {
|
|
4762
|
-
primary: swatches.primary[500],
|
|
4763
|
-
secondary: (swatches.secondary ?? swatches.primary)[500],
|
|
4764
|
-
accent: (swatches.tertiary ?? swatches.primary)[500],
|
|
4765
|
-
highlight: (swatches.quaternary ?? swatches.primary)[500],
|
|
4766
|
-
tertiary: (swatches.tertiary ?? swatches.primary)[500],
|
|
4767
|
-
quaternary: (swatches.quaternary ?? swatches.primary)[500],
|
|
4768
|
-
background: neutral.bg,
|
|
4769
|
-
surface: surface.default,
|
|
4770
|
-
text: content.default,
|
|
4771
|
-
textSecondary: content.muted,
|
|
4772
|
-
border: border.default,
|
|
4773
|
-
error: error.base,
|
|
4774
|
-
success: success.base,
|
|
4775
|
-
warning: warning.base,
|
|
4776
|
-
info: info.base
|
|
4777
|
-
};
|
|
4778
|
-
return {
|
|
4779
|
-
colors,
|
|
4780
|
-
swatches,
|
|
4781
|
-
semantics,
|
|
4782
|
-
colorDiagnostics
|
|
4783
|
-
};
|
|
4784
|
-
}
|
|
4785
|
-
|
|
4786
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/resolveInverseSurface.ts
|
|
4787
|
-
function resolveInverseSurface(theme, lightSurface, collector) {
|
|
4788
|
-
const { neutral } = theme.swatches;
|
|
4789
|
-
const base = theme.semantics.surface.inverse;
|
|
4790
|
-
const adjacent = lightSurface ? neutral[100] : neutral[800];
|
|
4791
|
-
const sunken = lightSurface ? neutral[200] : neutral[950];
|
|
4792
|
-
const surface = {
|
|
4793
|
-
...theme.semantics.surface,
|
|
4794
|
-
default: base,
|
|
4795
|
-
subtle: adjacent,
|
|
4796
|
-
raised: adjacent,
|
|
4797
|
-
sunken,
|
|
4798
|
-
overlay: adjacent,
|
|
4799
|
-
disabled: adjacent,
|
|
4800
|
-
inverse: theme.semantics.surface.default
|
|
4801
|
-
};
|
|
4802
|
-
return { surface, surfaceSeparation: measureInverseSurfaceSeparation(surface, collector) };
|
|
4803
|
-
}
|
|
4804
|
-
function measureInverseSurfaceSeparation(surface, collector) {
|
|
4805
|
-
const background = parseHexColorOrThrow(surface.sunken);
|
|
4806
|
-
const surfaces = [
|
|
4807
|
-
["surface.default", surface.default],
|
|
4808
|
-
["surface.raised", surface.raised],
|
|
4809
|
-
["surface.disabled", surface.disabled]
|
|
4810
|
-
];
|
|
4811
|
-
return surfaces.map(([id, foreground]) => collector.measureSurface(id, parseHexColorOrThrow(foreground), background, SURFACE_COLOR_POLICY.surfaceSeparation));
|
|
4812
|
-
}
|
|
4813
|
-
|
|
4814
|
-
// node_modules/@ankhorage/surface/src/features/theme/domain/projectInvertedTheme.ts
|
|
4815
|
-
function projectInvertedTheme(theme) {
|
|
4816
|
-
const collector = createSurfaceColorDiagnosticCollector();
|
|
4817
|
-
const lightSurface = theme.colorDiagnostics.mode === "dark";
|
|
4818
|
-
const { neutral } = theme.swatches;
|
|
4819
|
-
const { surface, surfaceSeparation } = resolveInverseSurface(theme, lightSurface, collector);
|
|
4820
|
-
const selection = createInverseSelection(collector, surface, neutral, lightSurface);
|
|
4821
|
-
const content = resolveInverseContent(theme, selection);
|
|
4822
|
-
const border = resolveInverseBorder(theme, selection);
|
|
4823
|
-
const roles = resolveInverseRoles(theme, selection);
|
|
4824
|
-
const { neutralAction, ...semanticRoles } = roles;
|
|
4825
|
-
const semantics = {
|
|
4826
|
-
...theme.semantics,
|
|
4827
|
-
neutral: resolveInverseNeutral(theme, surface, content, border, neutral, lightSurface),
|
|
4828
|
-
surface,
|
|
4829
|
-
content,
|
|
4830
|
-
border,
|
|
4831
|
-
...semanticRoles,
|
|
4832
|
-
error: roles.danger,
|
|
4833
|
-
selection: {
|
|
4834
|
-
background: roles.brand.softBg,
|
|
4835
|
-
content: roles.brand.onSoftText,
|
|
4836
|
-
border: border.focus
|
|
4837
|
-
},
|
|
4838
|
-
action: { primary: roles.brand, neutral: neutralAction, danger: roles.danger }
|
|
4839
|
-
};
|
|
4840
|
-
return {
|
|
4841
|
-
...theme,
|
|
4842
|
-
inverted: true,
|
|
4843
|
-
semantics,
|
|
4844
|
-
colors: {
|
|
4845
|
-
...theme.colors,
|
|
4846
|
-
background: surface.sunken,
|
|
4847
|
-
surface: surface.default,
|
|
4848
|
-
text: content.default,
|
|
4849
|
-
textSecondary: content.muted,
|
|
4850
|
-
border: border.default
|
|
4851
|
-
},
|
|
4852
|
-
colorDiagnostics: {
|
|
4853
|
-
...theme.colorDiagnostics,
|
|
4854
|
-
selections: [...theme.colorDiagnostics.selections, ...collector.selections],
|
|
4855
|
-
contrasts: [...theme.colorDiagnostics.contrasts, ...collector.contrasts],
|
|
4856
|
-
surfaceSeparation
|
|
4857
|
-
}
|
|
4858
|
-
};
|
|
4859
|
-
}
|
|
4860
|
-
function createInverseSelection(collector, surface, neutral, lightSurface) {
|
|
4861
|
-
return {
|
|
4862
|
-
collector,
|
|
4863
|
-
neutral,
|
|
4864
|
-
contexts: [
|
|
4865
|
-
{
|
|
4866
|
-
id: "inverse-surface",
|
|
4867
|
-
against: parseHexColorOrThrow(surface.default),
|
|
4868
|
-
minimumContrast: SURFACE_COLOR_POLICY.textContrast
|
|
4869
|
-
},
|
|
4870
|
-
{
|
|
4871
|
-
id: "inverse-subtle",
|
|
4872
|
-
against: parseHexColorOrThrow(surface.subtle),
|
|
4873
|
-
minimumContrast: SURFACE_COLOR_POLICY.textContrast
|
|
4874
|
-
},
|
|
4875
|
-
{
|
|
4876
|
-
id: "inverse-sunken",
|
|
4877
|
-
against: parseHexColorOrThrow(surface.sunken),
|
|
4878
|
-
minimumContrast: SURFACE_COLOR_POLICY.textContrast
|
|
4879
|
-
}
|
|
4880
|
-
],
|
|
4881
|
-
tiePolicy: lightSurface ? "higher-step" : "lower-step",
|
|
4882
|
-
textTarget: { lightness: lightSurface ? 0.2 : 0.9, chroma: 0.02 },
|
|
4883
|
-
mutedTarget: { lightness: lightSurface ? 0.35 : 0.75, chroma: 0.02 },
|
|
4884
|
-
subtleTarget: { lightness: lightSurface ? 0.4 : 0.7, chroma: 0.02 },
|
|
4885
|
-
borderTarget: { lightness: lightSurface ? 0.45 : 0.65, chroma: 0.02 }
|
|
4886
|
-
};
|
|
4887
|
-
}
|
|
4888
|
-
function resolveInverseContent(theme, selection) {
|
|
4889
|
-
const { neutral, primary } = theme.swatches;
|
|
4890
|
-
const secondary = theme.swatches.secondary ?? primary;
|
|
4891
|
-
return {
|
|
4892
|
-
default: selectText("content.default", neutral, selection.textTarget, selection),
|
|
4893
|
-
muted: selectText("content.muted", neutral, selection.mutedTarget, selection),
|
|
4894
|
-
subtle: selectText("content.subtle", neutral, selection.subtleTarget, selection),
|
|
4895
|
-
disabled: selectText("content.disabled", neutral, selection.subtleTarget, selection, SURFACE_COLOR_POLICY.disabledContrast),
|
|
4896
|
-
icon: selectText("content.icon", neutral, selection.textTarget, selection),
|
|
4897
|
-
link: selectText("content.link", primary, selection.textTarget, selection),
|
|
4898
|
-
visited: selectText("content.visited", secondary, selection.textTarget, selection),
|
|
4899
|
-
inverse: theme.semantics.content.default
|
|
4900
|
-
};
|
|
4901
|
-
}
|
|
4902
|
-
function resolveInverseBorder(theme, selection) {
|
|
4903
|
-
const { neutral } = theme.swatches;
|
|
4904
|
-
const outline = selection.borderTarget;
|
|
4905
|
-
return {
|
|
4906
|
-
default: selectOutline("border.default", neutral, outline, selection),
|
|
4907
|
-
subtle: selectOutline("border.subtle", neutral, outline, selection),
|
|
4908
|
-
strong: selectOutline("border.strong", neutral, outline, selection),
|
|
4909
|
-
divider: selectOutline("border.divider", neutral, outline, selection),
|
|
4910
|
-
focus: selectOutline("border.focus", theme.swatches.primary, selection.textTarget, selection)
|
|
4911
|
-
};
|
|
4912
|
-
}
|
|
4913
|
-
function resolveInverseRoles(theme, selection) {
|
|
4914
|
-
const status = createDefaultSemanticStatusSwatches().swatches;
|
|
4915
|
-
const { semantics } = theme;
|
|
4916
|
-
return {
|
|
4917
|
-
brand: projectRole("brand", semantics.brand, theme.swatches.primary, selection),
|
|
4918
|
-
secondary: projectRole("secondary", semantics.secondary, theme.swatches.secondary ?? theme.swatches.primary, selection),
|
|
4919
|
-
accent: projectRole("accent", semantics.accent, theme.swatches.tertiary ?? theme.swatches.primary, selection),
|
|
4920
|
-
highlight: projectRole("highlight", semantics.highlight, theme.swatches.quaternary ?? theme.swatches.primary, selection),
|
|
4921
|
-
danger: projectRole("danger", semantics.danger, status.danger, selection),
|
|
4922
|
-
success: projectRole("success", semantics.success, status.success, selection),
|
|
4923
|
-
warning: projectRole("warning", semantics.warning, status.warning, selection),
|
|
4924
|
-
info: projectRole("info", semantics.info, status.info, selection),
|
|
4925
|
-
neutralAction: projectRole("neutral", semantics.action.neutral, theme.swatches.neutral, selection)
|
|
4926
|
-
};
|
|
4927
|
-
}
|
|
4928
|
-
function projectRole(id, role, swatch, selection) {
|
|
4929
|
-
return {
|
|
4930
|
-
...role,
|
|
4931
|
-
onSurfaceText: selectText(`${id}.onSurfaceText`, swatch, selection.textTarget, selection),
|
|
4932
|
-
outline: selectOutline(`${id}.outline`, swatch, selection.borderTarget, selection)
|
|
4933
|
-
};
|
|
4934
|
-
}
|
|
4935
|
-
function resolveInverseNeutral(theme, surface, content, border, swatch, lightSurface) {
|
|
4936
|
-
return {
|
|
4937
|
-
...theme.semantics.neutral,
|
|
4938
|
-
bg: surface.sunken,
|
|
4939
|
-
bgSubtle: surface.subtle,
|
|
4940
|
-
surface: surface.default,
|
|
4941
|
-
surfaceHover: lightSurface ? swatch[200] : swatch[700],
|
|
4942
|
-
surfaceActive: lightSurface ? swatch[300] : swatch[600],
|
|
4943
|
-
border: border.default,
|
|
4944
|
-
borderStrong: border.strong,
|
|
4945
|
-
divider: border.divider,
|
|
4946
|
-
text: content.default,
|
|
4947
|
-
textMuted: content.muted,
|
|
4948
|
-
textSubtle: content.subtle,
|
|
4949
|
-
disabledBg: surface.disabled,
|
|
4950
|
-
disabledText: content.disabled
|
|
4951
|
-
};
|
|
4952
|
-
}
|
|
4953
|
-
function selectText(id, swatch, target, selection, minimumContrast = SURFACE_COLOR_POLICY.textContrast) {
|
|
4954
|
-
const contexts = selection.contexts.map((context) => ({ ...context, minimumContrast }));
|
|
4955
|
-
const color = selectInverseColor(id, swatch, target, contexts, selection);
|
|
4956
|
-
for (const context of contexts) {
|
|
4957
|
-
selection.collector.measureForeground(`inverse.${id}/${context.id}`, color, context.against, minimumContrast);
|
|
4958
|
-
}
|
|
4959
|
-
return color;
|
|
4960
|
-
}
|
|
4961
|
-
function selectOutline(id, swatch, target, selection) {
|
|
4962
|
-
const contexts = selection.contexts.map((context) => ({
|
|
4963
|
-
...context,
|
|
4964
|
-
minimumContrast: SURFACE_COLOR_POLICY.uiContrast
|
|
4965
|
-
}));
|
|
4966
|
-
const color = selectInverseColor(id, swatch, target, contexts, selection);
|
|
4967
|
-
for (const context of contexts) {
|
|
4968
|
-
selection.collector.measureForeground(`inverse.${id}/${context.id}`, color, context.against, SURFACE_COLOR_POLICY.uiContrast);
|
|
4969
|
-
}
|
|
4970
|
-
return color;
|
|
4971
|
-
}
|
|
4972
|
-
function selectInverseColor(id, swatch, target, contexts, selection) {
|
|
4973
|
-
const result = selectColorSwatchStep(swatch, target, contexts, selection.tiePolicy);
|
|
4974
|
-
selection.collector.selections.push({ id: `inverse.${id}`, result });
|
|
4975
|
-
return result.selected?.hex ?? selection.collector.selectColor(`inverse.${id}.neutralFallback`, selection.neutral, target, contexts, selection.tiePolicy);
|
|
4976
|
-
}
|
|
4977
|
-
|
|
4978
|
-
// node_modules/@ankhorage/surface/src/features/theme/utils/resolveHeadingTokenOverrides.ts
|
|
4979
|
-
var HEADING_KEYS = new Set(["1", "2", "3", "4", "5", "6"]);
|
|
4980
|
-
var HEADING_WEIGHTS = new Set(["regular", "medium", "semiBold", "bold"]);
|
|
4981
|
-
function resolveHeadingTokenOverrides(defaults, overrides) {
|
|
4982
|
-
validateHeadingKeys(overrides);
|
|
4983
|
-
return {
|
|
4984
|
-
1: resolveHeading("1", defaults[1], overrides?.["1"]),
|
|
4985
|
-
2: resolveHeading("2", defaults[2], overrides?.["2"]),
|
|
4986
|
-
3: resolveHeading("3", defaults[3], overrides?.["3"]),
|
|
4987
|
-
4: resolveHeading("4", defaults[4], overrides?.["4"]),
|
|
4988
|
-
5: resolveHeading("5", defaults[5], overrides?.["5"]),
|
|
4989
|
-
6: resolveHeading("6", defaults[6], overrides?.["6"])
|
|
4990
|
-
};
|
|
4991
|
-
}
|
|
4992
|
-
function validateHeadingKeys(overrides) {
|
|
4993
|
-
for (const key of Object.keys(overrides ?? {})) {
|
|
4994
|
-
if (!HEADING_KEYS.has(key))
|
|
4995
|
-
throw new RangeError(`Unknown typography heading token: ${key}.`);
|
|
4996
|
-
}
|
|
4997
|
-
}
|
|
4998
|
-
function resolveHeading(key, fallback, override) {
|
|
4999
|
-
const size = override?.size ?? fallback.size;
|
|
5000
|
-
const lineHeight = override?.lineHeight ?? fallback.lineHeight;
|
|
5001
|
-
const weight = override?.weight ?? fallback.weight;
|
|
5002
|
-
if (!Number.isFinite(size) || size <= 0) {
|
|
5003
|
-
throw new RangeError(`Theme token typography.headings.${key}.size must be a finite positive number.`);
|
|
5004
|
-
}
|
|
5005
|
-
if (!Number.isFinite(lineHeight) || lineHeight <= 0) {
|
|
5006
|
-
throw new RangeError(`Theme token typography.headings.${key}.lineHeight must be a finite positive number.`);
|
|
5007
|
-
}
|
|
5008
|
-
if (!isHeadingWeight(weight)) {
|
|
5009
|
-
throw new RangeError(`Invalid heading weight for typography.headings.${key}: ${weight}.`);
|
|
5010
|
-
}
|
|
5011
|
-
return { size, lineHeight, weight };
|
|
5012
|
-
}
|
|
5013
|
-
function isHeadingWeight(value) {
|
|
5014
|
-
return HEADING_WEIGHTS.has(value);
|
|
5015
|
-
}
|
|
5016
|
-
|
|
5017
|
-
// node_modules/@ankhorage/surface/src/features/theme/utils/resolveNumericTokenOverrides.ts
|
|
5018
|
-
function resolveNumericTokenOverrides(family, overrides, requirePositive = false) {
|
|
5019
|
-
if (overrides === undefined)
|
|
5020
|
-
return {};
|
|
5021
|
-
for (const [token, value] of Object.entries(overrides)) {
|
|
5022
|
-
const invalid = !Number.isFinite(value) || (requirePositive ? value <= 0 : value < 0);
|
|
5023
|
-
if (invalid) {
|
|
5024
|
-
const expectation = requirePositive ? "a finite positive number" : "a finite non-negative number";
|
|
5025
|
-
throw new RangeError(`Theme token ${family}.${token} must be ${expectation}.`);
|
|
5026
|
-
}
|
|
5027
|
-
}
|
|
5028
|
-
return { ...overrides };
|
|
5029
|
-
}
|
|
5030
|
-
|
|
5031
|
-
// node_modules/@ankhorage/surface/src/features/theme/utils/resolveWeightTokenOverrides.ts
|
|
5032
|
-
var WEIGHT_TOKEN_KEYS = new Set([
|
|
5033
|
-
"thin",
|
|
5034
|
-
"extraLight",
|
|
5035
|
-
"light",
|
|
5036
|
-
"regular",
|
|
5037
|
-
"medium",
|
|
5038
|
-
"semiBold",
|
|
5039
|
-
"bold",
|
|
5040
|
-
"extraBold",
|
|
5041
|
-
"black"
|
|
5042
|
-
]);
|
|
5043
|
-
var FONT_WEIGHT_VALUES = new Set([
|
|
5044
|
-
"100",
|
|
5045
|
-
"200",
|
|
5046
|
-
"300",
|
|
5047
|
-
"400",
|
|
5048
|
-
"500",
|
|
5049
|
-
"600",
|
|
5050
|
-
"700",
|
|
5051
|
-
"800",
|
|
5052
|
-
"900",
|
|
5053
|
-
"bold",
|
|
5054
|
-
"normal"
|
|
5055
|
-
]);
|
|
5056
|
-
function resolveWeightTokenOverrides(overrides) {
|
|
5057
|
-
if (overrides === undefined)
|
|
5058
|
-
return {};
|
|
5059
|
-
return Object.fromEntries(Object.entries(overrides).map(([token, value]) => {
|
|
5060
|
-
if (!WEIGHT_TOKEN_KEYS.has(token)) {
|
|
5061
|
-
throw new RangeError(`Unknown typography weight token: ${token}.`);
|
|
5062
|
-
}
|
|
5063
|
-
if (!isFontWeight(value)) {
|
|
5064
|
-
throw new RangeError(`Invalid font weight for typography.weights.${token}: ${value}.`);
|
|
5065
|
-
}
|
|
5066
|
-
return [token, value];
|
|
5067
|
-
}));
|
|
5068
|
-
}
|
|
5069
|
-
function isFontWeight(value) {
|
|
5070
|
-
return FONT_WEIGHT_VALUES.has(value);
|
|
5071
|
-
}
|
|
5072
|
-
|
|
5073
|
-
// node_modules/@ankhorage/surface/src/features/theme/utils/resolveGlobalTokens.ts
|
|
5074
|
-
function resolveGlobalTokens(overrides) {
|
|
5075
|
-
validateZeroTokens(overrides);
|
|
5076
|
-
const typography = overrides?.typography;
|
|
5077
|
-
return {
|
|
5078
|
-
spacing: {
|
|
5079
|
-
...DEFAULT_TOKENS.spacing,
|
|
5080
|
-
...resolveNumericTokenOverrides("spacing", overrides?.spacing)
|
|
5081
|
-
},
|
|
5082
|
-
radii: {
|
|
5083
|
-
...DEFAULT_TOKENS.radii,
|
|
5084
|
-
...resolveNumericTokenOverrides("radii", overrides?.radii)
|
|
5085
|
-
},
|
|
5086
|
-
typography: {
|
|
5087
|
-
headings: resolveHeadingTokenOverrides(DEFAULT_TOKENS.typography.headings, typography?.headings),
|
|
5088
|
-
sizes: {
|
|
5089
|
-
...DEFAULT_TOKENS.typography.sizes,
|
|
5090
|
-
...resolveNumericTokenOverrides("typography.sizes", typography?.sizes, true)
|
|
5091
|
-
},
|
|
5092
|
-
weights: {
|
|
5093
|
-
...DEFAULT_TOKENS.typography.weights,
|
|
5094
|
-
...resolveWeightTokenOverrides(typography?.weights)
|
|
5095
|
-
},
|
|
5096
|
-
fonts: {
|
|
5097
|
-
normal: { ...DEFAULT_TOKENS.typography.fonts.normal },
|
|
5098
|
-
italic: { ...DEFAULT_TOKENS.typography.fonts.italic }
|
|
5099
|
-
}
|
|
5100
|
-
},
|
|
5101
|
-
shadows: {
|
|
5102
|
-
...DEFAULT_TOKENS.shadows,
|
|
5103
|
-
...resolveNumericTokenOverrides("shadows", overrides?.shadows)
|
|
5104
|
-
}
|
|
5105
|
-
};
|
|
5106
|
-
}
|
|
5107
|
-
function validateZeroTokens(overrides) {
|
|
5108
|
-
if (overrides?.spacing?.none !== undefined && overrides.spacing.none !== 0) {
|
|
5109
|
-
throw new RangeError("Theme token spacing.none must remain 0.");
|
|
5110
|
-
}
|
|
5111
|
-
if (overrides?.radii?.none !== undefined && overrides.radii.none !== 0) {
|
|
5112
|
-
throw new RangeError("Theme token radii.none must remain 0.");
|
|
5113
|
-
}
|
|
5114
|
-
}
|
|
5115
|
-
|
|
5116
|
-
// node_modules/@ankhorage/surface/src/features/theme/application/use-cases/createTheme.ts
|
|
5117
|
-
var DEFAULT_CONFIG = {
|
|
5118
|
-
id: "default",
|
|
5119
|
-
name: "Default",
|
|
5120
|
-
light: { primaryColor: "#3B82F6", harmony: "monochromatic" },
|
|
5121
|
-
dark: { primaryColor: "#3B82F6", harmony: "monochromatic" }
|
|
5122
|
-
};
|
|
5123
|
-
function createTheme(config = DEFAULT_CONFIG, mode = "light", activeFontId, inverted = false) {
|
|
5124
|
-
const { colors, swatches, semantics, colorDiagnostics } = generatePalette(config, mode);
|
|
5125
|
-
const baseTheme = {
|
|
5126
|
-
...resolveGlobalTokens(config.tokens),
|
|
5127
|
-
colors,
|
|
5128
|
-
swatches,
|
|
5129
|
-
semantics,
|
|
5130
|
-
colorDiagnostics,
|
|
5131
|
-
config,
|
|
5132
|
-
inverted: false
|
|
5133
|
-
};
|
|
5134
|
-
const themed = activeFontId ? withActiveFont(baseTheme, activeFontId) : baseTheme;
|
|
5135
|
-
return inverted ? projectInvertedTheme(themed) : themed;
|
|
5136
|
-
}
|
|
5137
|
-
function withActiveFont(theme, activeFontId) {
|
|
5138
|
-
const familyName = toPascalCase(activeFontId);
|
|
5139
|
-
return {
|
|
5140
|
-
...theme,
|
|
5141
|
-
typography: {
|
|
5142
|
-
...theme.typography,
|
|
5143
|
-
fonts: {
|
|
5144
|
-
normal: createFontMap(theme.typography.fonts.normal, familyName, "Regular"),
|
|
5145
|
-
italic: createFontMap(theme.typography.fonts.italic, familyName, "Italic")
|
|
5146
|
-
}
|
|
5147
|
-
}
|
|
5148
|
-
};
|
|
5149
|
-
}
|
|
5150
|
-
function createFontMap(fallback, familyName, style) {
|
|
5151
|
-
return {
|
|
5152
|
-
...fallback,
|
|
5153
|
-
"100": `${familyName}_100${style}`,
|
|
5154
|
-
"200": `${familyName}_200${style}`,
|
|
5155
|
-
"300": `${familyName}_300${style}`,
|
|
5156
|
-
"400": `${familyName}_400${style}`,
|
|
5157
|
-
"500": `${familyName}_500${style}`,
|
|
5158
|
-
"600": `${familyName}_600${style}`,
|
|
5159
|
-
"700": `${familyName}_700${style}`,
|
|
5160
|
-
"800": `${familyName}_800${style}`,
|
|
5161
|
-
"900": `${familyName}_900${style}`
|
|
5162
|
-
};
|
|
5163
|
-
}
|
|
5164
|
-
function toPascalCase(value) {
|
|
5165
|
-
return value.split(/[- ]+/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
5166
|
-
}
|
|
5167
|
-
|
|
5168
|
-
// node_modules/@ankhorage/surface/src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx
|
|
5169
|
-
import { createContext } from "react";
|
|
5170
|
-
var defaultTheme = createTheme();
|
|
5171
|
-
var ThemeRuntimeContext = createContext({
|
|
5172
|
-
theme: defaultTheme,
|
|
5173
|
-
mode: "light",
|
|
5174
|
-
inverted: false,
|
|
5175
|
-
setThemeConfig: () => {
|
|
5176
|
-
return;
|
|
5177
|
-
},
|
|
5178
|
-
setMode: () => {
|
|
5179
|
-
return;
|
|
5180
|
-
}
|
|
5181
|
-
});
|
|
5182
|
-
|
|
5183
|
-
// node_modules/@ankhorage/surface/src/features/theme/adapters/inbound/useTheme.ts
|
|
5184
|
-
import { use } from "react";
|
|
5185
|
-
function useTheme() {
|
|
5186
|
-
return use(ThemeRuntimeContext);
|
|
5187
|
-
}
|
|
5188
|
-
|
|
5189
|
-
export { isHexColor, parseHexColor, parseHexColorOrThrow, converter_default, formatHex, getContrastRatio, getReadableForeground, COLOR_HARMONY_CATALOG, generateHarmonyRoleColors, generateColorSwatch, selectColorSwatchStep, createDefaultSemanticStatusSwatches, LIGHT_SEMANTIC_COLOR_REFERENCES, DARK_SEMANTIC_COLOR_REFERENCES, generateThemeModeColors, createTheme, ThemeRuntimeContext, useTheme };
|
|
3767
|
+
export { converter_default, formatHex, normalizeHueDegrees, parseHexToOklch, oklchToHex, deltaEoklch, contrastRatio };
|