@ankhorage/zora 23.2.4 → 23.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -6
- package/dist/constants/authoring.d.ts +8 -0
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +6 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/app-bar/appBarMeta.d.ts +10 -1
- package/dist/features/app-bar/appBarMeta.d.ts.map +1 -1
- package/dist/features/app-bar/appBarMeta.js +2 -1
- package/dist/features/app-bar/appBarMeta.js.map +1 -1
- package/dist/features/app-header/adapters/inbound/AppHeader.d.ts +5 -0
- package/dist/features/app-header/adapters/inbound/AppHeader.d.ts.map +1 -0
- package/dist/features/app-header/adapters/inbound/AppHeader.js +7 -0
- package/dist/features/app-header/adapters/inbound/AppHeader.js.map +1 -0
- package/dist/features/app-header/appHeaderMeta.d.ts +18 -0
- package/dist/features/app-header/appHeaderMeta.d.ts.map +1 -0
- package/dist/features/app-header/appHeaderMeta.js +12 -0
- package/dist/features/app-header/appHeaderMeta.js.map +1 -0
- package/dist/features/app-header/public.d.ts +3 -0
- package/dist/features/app-header/public.d.ts.map +1 -0
- package/dist/features/app-header/public.js +2 -0
- package/dist/features/app-header/public.js.map +1 -0
- package/dist/features/game/adapters/inbound/Game.d.ts +1 -1
- package/dist/features/game/adapters/inbound/Game.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/Game.js +4 -1
- package/dist/features/game/adapters/inbound/Game.js.map +1 -1
- package/dist/features/game/adapters/inbound/GameEntity.d.ts +1 -1
- package/dist/features/game/adapters/inbound/GameEntity.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/GameEntity.js +4 -1
- package/dist/features/game/adapters/inbound/GameEntity.js.map +1 -1
- package/dist/features/game/adapters/inbound/GameField.d.ts +1 -1
- package/dist/features/game/adapters/inbound/GameField.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/GameField.js +4 -1
- package/dist/features/game/adapters/inbound/GameField.js.map +1 -1
- package/dist/features/game/adapters/inbound/GameInputZone.d.ts +1 -1
- package/dist/features/game/adapters/inbound/GameInputZone.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/GameInputZone.js +4 -1
- package/dist/features/game/adapters/inbound/GameInputZone.js.map +1 -1
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts +2 -1
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.js +4 -1
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.js.map +1 -1
- package/dist/features/game/adapters/inbound/GameOverlay.d.ts +1 -1
- package/dist/features/game/adapters/inbound/GameOverlay.d.ts.map +1 -1
- package/dist/features/game/adapters/inbound/GameOverlay.js +4 -1
- package/dist/features/game/adapters/inbound/GameOverlay.js.map +1 -1
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +2 -0
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +415 -327
- package/dist/features/registry/bindableComponentMeta.d.ts.map +1 -1
- package/dist/features/registry/bindableComponentMeta.js +12 -0
- package/dist/features/registry/bindableComponentMeta.js.map +1 -1
- package/dist/features/registry/componentMeta.d.ts.map +1 -1
- package/dist/features/registry/componentMeta.js +2 -0
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/registry/finalizeFeatureMetadata.d.ts.map +1 -1
- package/dist/features/registry/finalizeFeatureMetadata.js +5 -4
- package/dist/features/registry/finalizeFeatureMetadata.js.map +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.d.ts +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.d.ts.map +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.js +4 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.js.map +1 -1
- package/dist/features/theme/adapters/inbound/ThemeModeToggle.d.ts +2 -1
- package/dist/features/theme/adapters/inbound/ThemeModeToggle.d.ts.map +1 -1
- package/dist/features/theme/adapters/inbound/ThemeModeToggle.js +5 -1
- package/dist/features/theme/adapters/inbound/ThemeModeToggle.js.map +1 -1
- package/dist/features/theme/adapters/inbound/ZoraThemeScope.d.ts +2 -1
- package/dist/features/theme/adapters/inbound/ZoraThemeScope.d.ts.map +1 -1
- package/dist/features/theme/adapters/inbound/ZoraThemeScope.js +7 -5
- package/dist/features/theme/adapters/inbound/ZoraThemeScope.js.map +1 -1
- package/dist/features/theme/adapters/inbound/withZoraThemeScope.d.ts +1 -0
- package/dist/features/theme/adapters/inbound/withZoraThemeScope.d.ts.map +1 -1
- package/dist/features/theme/adapters/inbound/withZoraThemeScope.js +9 -4
- package/dist/features/theme/adapters/inbound/withZoraThemeScope.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/app-header.d.ts +3 -0
- package/dist/types/app-header.d.ts.map +1 -0
- package/dist/types/app-header.js +2 -0
- package/dist/types/app-header.js.map +1 -0
- package/dist/types/base.d.ts +2 -0
- package/dist/types/base.d.ts.map +1 -1
- package/dist/types/base.js.map +1 -1
- package/dist/types/gamePresentation.d.ts +6 -6
- package/dist/types/gamePresentation.d.ts.map +1 -1
- package/dist/types/gamePresentation.js.map +1 -1
- package/dist/types/selection.d.ts +2 -1
- package/dist/types/selection.d.ts.map +1 -1
- package/dist/types/selection.js.map +1 -1
- package/dist/types/theme-mode-toggle.d.ts +2 -1
- package/dist/types/theme-mode-toggle.d.ts.map +1 -1
- package/dist/types/theme-mode-toggle.js.map +1 -1
- package/package.json +5 -5
- package/src/constants/authoring.ts +7 -0
- package/src/features/app-bar/appBarMeta.ts +2 -1
- package/src/features/app-header/adapters/inbound/AppHeader.tsx +9 -0
- package/src/features/app-header/appHeaderMeta.ts +13 -0
- package/src/features/app-header/public.ts +2 -0
- package/src/features/game/adapters/inbound/Game.tsx +5 -1
- package/src/features/game/adapters/inbound/GameEntity.tsx +5 -1
- package/src/features/game/adapters/inbound/GameField.tsx +5 -1
- package/src/features/game/adapters/inbound/GameInputZone.tsx +5 -1
- package/src/features/game/adapters/inbound/GameMeasurementProbe.tsx +5 -1
- package/src/features/game/adapters/inbound/GameOverlay.tsx +5 -1
- package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +2 -0
- package/src/features/registry/authoringMeta.test.ts +11 -0
- package/src/features/registry/bindableComponentMeta.ts +12 -0
- package/src/features/registry/componentMeta.ts +2 -0
- package/src/features/registry/finalizeFeatureMetadata.ts +7 -6
- package/src/features/registry/registry.test.ts +1 -0
- package/src/features/selection/adapters/inbound/SelectableItem.tsx +5 -1
- package/src/features/theme/adapters/inbound/ThemeModeToggle.tsx +6 -1
- package/src/features/theme/adapters/inbound/ZoraThemeScope.tsx +12 -5
- package/src/features/theme/adapters/inbound/withZoraThemeScope.tsx +9 -4
- package/src/features/theme/themeConfigScope.test.ts +1 -1
- package/src/features/theme/themeScopeStructure.test.ts +6 -1
- package/src/index.ts +1 -0
- package/src/invertedThemeAcceptance.test.tsx +177 -0
- package/src/types/app-header.ts +3 -0
- package/src/types/base.ts +3 -0
- package/src/types/gamePresentation.ts +7 -6
- package/src/types/selection.ts +3 -1
- package/src/types/theme-mode-toggle.ts +3 -4
- package/web-dist/chunks/{Accordion-5pskbqss.js → Accordion-0047zyx7.js} +4 -4
- package/web-dist/chunks/{Accordion-99cj85ez.js → Accordion-0gfsj9qh.js} +1 -1
- package/web-dist/chunks/{Accordion-8xdet564.js → Accordion-0yhkg017.js} +10 -10
- package/web-dist/chunks/{Accordion-01e56hb5.js → Accordion-0yvepteg.js} +5 -5
- package/web-dist/chunks/{Accordion-nggjwm07.js → Accordion-1e1nfhtc.js} +5 -5
- package/web-dist/chunks/{Accordion-4r9a9qny.js → Accordion-1xpq9bxk.js} +9 -9
- package/web-dist/chunks/{Accordion-mm4kx13n.js → Accordion-2dqpjya2.js} +8 -8
- package/web-dist/chunks/{Accordion-x4rjd7yn.js → Accordion-37n4bt3g.js} +2 -2
- package/web-dist/chunks/{Accordion-w6n8e1ff.js → Accordion-3m6de80j.js} +1 -1
- package/web-dist/chunks/{Accordion-rjgdrn7y.js → Accordion-693gvpde.js} +3 -3
- package/web-dist/chunks/Accordion-6a2hscrx.js +50 -0
- package/web-dist/chunks/{Accordion-7zfskq1s.js → Accordion-6xrse5my.js} +1 -1
- package/web-dist/chunks/{Accordion-17pht8jd.js → Accordion-6ytrt7xj.js} +5 -5
- package/web-dist/chunks/{Accordion-2ak69ntj.js → Accordion-70g7n6tk.js} +8 -8
- package/web-dist/chunks/{Accordion-jksn8783.js → Accordion-73x0gt11.js} +6 -6
- package/web-dist/chunks/{Accordion-8xk2zmr5.js → Accordion-7y9wt946.js} +2 -2
- package/web-dist/chunks/{Accordion-cdppbyad.js → Accordion-8bxy3g7a.js} +4 -4
- package/web-dist/chunks/{Accordion-z8h1hn96.js → Accordion-8fne0gf9.js} +6 -6
- package/web-dist/chunks/{Accordion-13y3zx87.js → Accordion-8z7naxj2.js} +22 -16
- package/web-dist/chunks/{Accordion-z1trs7s1.js → Accordion-a1ervhyg.js} +13 -13
- package/web-dist/chunks/{Accordion-v166qr59.js → Accordion-a61amgk4.js} +4 -4
- package/web-dist/chunks/{Accordion-m9hjta5k.js → Accordion-ancjf7q8.js} +7 -3
- package/web-dist/chunks/{Accordion-f2mfgcx6.js → Accordion-axxgq453.js} +7 -7
- package/web-dist/chunks/{Accordion-cydzrpk2.js → Accordion-basd2gyf.js} +2 -2
- package/web-dist/chunks/Accordion-bfzeab9x.js +18 -0
- package/web-dist/chunks/{Accordion-rnjt5z4y.js → Accordion-bz2dzbad.js} +9 -9
- package/web-dist/chunks/{Accordion-r23sx4gf.js → Accordion-ct805sm7.js} +2 -2
- package/web-dist/chunks/{Accordion-cqgbx1pw.js → Accordion-d24n7srd.js} +6 -7
- package/web-dist/chunks/{Accordion-14p7zanv.js → Accordion-dbxpv5eq.js} +3 -3
- package/web-dist/chunks/{Accordion-46vwm9xv.js → Accordion-e2kr1z3g.js} +5 -5
- package/web-dist/chunks/{Accordion-78mj69zp.js → Accordion-ebw6xj6x.js} +5 -7
- package/web-dist/chunks/{Accordion-kpnwdpb5.js → Accordion-ekjwm5dw.js} +17 -8
- package/web-dist/chunks/{Accordion-13b6y37e.js → Accordion-g2d4fskg.js} +2 -2
- package/web-dist/chunks/{Accordion-x5ny2aax.js → Accordion-gkx1kszz.js} +1 -1
- package/web-dist/chunks/{Accordion-tyqds4zr.js → Accordion-k6dg8zd2.js} +3 -3
- package/web-dist/chunks/{Accordion-e1nn8m46.js → Accordion-kxa15n19.js} +5 -17
- package/web-dist/chunks/{Accordion-rev0zb75.js → Accordion-m4brcz8v.js} +5 -5
- package/web-dist/chunks/{Accordion-vq462y0x.js → Accordion-mbqtk7y0.js} +11 -2
- package/web-dist/chunks/{Accordion-2d8xn32m.js → Accordion-n7y08rz5.js} +14 -49
- package/web-dist/chunks/{Accordion-ejy7gr0a.js → Accordion-nkd7nhyx.js} +5 -5
- package/web-dist/chunks/{Accordion-xw1gkpfk.js → Accordion-p0fh69qq.js} +6 -6
- package/web-dist/chunks/{Accordion-kmv2fp6m.js → Accordion-ph15h010.js} +10 -10
- package/web-dist/chunks/{Accordion-7hn324r1.js → Accordion-pvz3r99n.js} +236 -4
- package/web-dist/chunks/{Accordion-qb8ppq9t.js → Accordion-q9zge7kd.js} +3 -3
- package/web-dist/chunks/{Accordion-kemavggr.js → Accordion-qyssgtwe.js} +2 -2
- package/web-dist/chunks/{Accordion-ff583p4q.js → Accordion-rmp9sfra.js} +9 -5
- package/web-dist/chunks/{Accordion-yms7x22j.js → Accordion-snyacfyh.js} +10 -12
- package/web-dist/chunks/{Accordion-ejns5mga.js → Accordion-tdjh81ax.js} +6 -6
- package/web-dist/chunks/{Accordion-rgyg9bw8.js → Accordion-v4n4ygwn.js} +1 -1
- package/web-dist/chunks/{Accordion-ew71mmkm.js → Accordion-vjgk1sz7.js} +2 -2
- package/web-dist/chunks/{Accordion-bmp1ab7m.js → Accordion-wgesygtk.js} +10 -10
- package/web-dist/chunks/{Accordion-9n7h9hag.js → Accordion-wxbh98kp.js} +8 -8
- package/web-dist/chunks/{Accordion-r1epjp5y.js → Accordion-wytj5wwc.js} +3 -3
- package/web-dist/chunks/{Accordion-jnwa02s7.js → Accordion-yae3m7g7.js} +4 -4
- package/web-dist/chunks/{Accordion-b9myvfep.js → Accordion-zgzrah0a.js} +6 -6
- package/web-dist/components/accordion/Accordion.js +13 -13
- package/web-dist/components/accordion-item/AccordionItem.js +13 -13
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -4
- package/web-dist/components/app-bar/AppBar.js +21 -21
- package/web-dist/components/app-header/AppHeader.d.ts +3 -0
- package/web-dist/components/app-header/AppHeader.js +41 -0
- package/web-dist/components/app-header/index.d.ts +1 -0
- package/web-dist/components/app-header/index.js +2 -0
- package/web-dist/components/app-shell/AppShell.js +6 -7
- package/web-dist/components/auth-screen/AuthScreen.js +22 -22
- package/web-dist/components/avatar/Avatar.js +13 -13
- package/web-dist/components/avatar-group/AvatarGroup.js +13 -13
- package/web-dist/components/badge/Badge.js +7 -8
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +21 -21
- package/web-dist/components/bottom-sheet/BottomSheet.js +8 -9
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +8 -9
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +8 -9
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +8 -9
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +8 -9
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +8 -9
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -15
- package/web-dist/components/button/Button.js +13 -13
- package/web-dist/components/button-group/ButtonGroup.js +13 -13
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +21 -21
- package/web-dist/components/card/Card.js +20 -20
- package/web-dist/components/card-back/CardBack.js +4 -5
- package/web-dist/components/card-hand/CardHand.js +4 -5
- package/web-dist/components/chat-list-item/ChatListItem.js +17 -17
- package/web-dist/components/checkbox/Checkbox.js +13 -13
- package/web-dist/components/checkbox-group/CheckboxGroup.js +13 -13
- package/web-dist/components/chess-board/ChessBoard.js +4 -5
- package/web-dist/components/chip/Chip.js +14 -14
- package/web-dist/components/chip-group/ChipGroup.js +14 -14
- package/web-dist/components/collection-editor/CollectionEditor.js +20 -20
- package/web-dist/components/content-rail/ContentRail.js +14 -14
- package/web-dist/components/data-table/DataTable.js +28 -28
- package/web-dist/components/date-picker/DatePicker.js +19 -19
- package/web-dist/components/dialog/Dialog.js +14 -14
- package/web-dist/components/divider/Divider.js +6 -7
- package/web-dist/components/empty-state/EmptyState.js +21 -21
- package/web-dist/components/field/Field.js +13 -13
- package/web-dist/components/flat-list/FlatList.js +14 -14
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +22 -22
- package/web-dist/components/form/Form.js +17 -17
- package/web-dist/components/form-actions/FormActions.js +17 -17
- package/web-dist/components/form-error/FormError.js +17 -17
- package/web-dist/components/game/Game.js +7 -8
- package/web-dist/components/game-entity/GameEntity.js +7 -8
- package/web-dist/components/game-field/GameField.js +7 -8
- package/web-dist/components/game-input-zone/GameInputZone.js +7 -8
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +7 -8
- package/web-dist/components/game-overlay/GameOverlay.js +7 -8
- package/web-dist/components/gradient/Gradient.js +7 -8
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +7 -8
- package/web-dist/components/grid/Grid.js +6 -7
- package/web-dist/components/heading/Heading.js +7 -7
- package/web-dist/components/hero/Hero.js +20 -20
- package/web-dist/components/icon/Icon.js +5 -5
- package/web-dist/components/icon-button/IconButton.js +13 -13
- package/web-dist/components/image/Image.js +11 -11
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -4
- package/web-dist/components/list/List.js +14 -14
- package/web-dist/components/list-item/ListItem.js +14 -14
- package/web-dist/components/list-section/ListSection.js +14 -14
- package/web-dist/components/media-card/MediaCard.js +20 -20
- package/web-dist/components/message-bubble/MessageBubble.js +17 -17
- package/web-dist/components/metric-card/MetricCard.js +20 -20
- package/web-dist/components/missing-element/MissingElement.js +12 -12
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +22 -22
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +22 -22
- package/web-dist/components/opening-book/OpeningBook.js +4 -5
- package/web-dist/components/otp-form/OtpForm.js +22 -22
- package/web-dist/components/pagination/Pagination.js +14 -14
- package/web-dist/components/palette-item/PaletteItem.js +20 -20
- package/web-dist/components/playing-card/PlayingCard.js +4 -5
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -5
- package/web-dist/components/popover-menu/PopoverMenu.js +16 -16
- package/web-dist/components/post-card/PostCard.js +20 -20
- package/web-dist/components/product-card/ProductCard.js +20 -20
- package/web-dist/components/progress/Progress.js +11 -11
- package/web-dist/components/progress-ring/ProgressRing.js +11 -11
- package/web-dist/components/radio/Radio.js +15 -15
- package/web-dist/components/radio-group/RadioGroup.js +15 -15
- package/web-dist/components/rating/Rating.js +10 -10
- package/web-dist/components/reader-surface/ReaderSurface.js +23 -23
- package/web-dist/components/scan-overlay/ScanOverlay.js +21 -21
- package/web-dist/components/screen/Screen.js +6 -7
- package/web-dist/components/screen-section/ScreenSection.js +11 -11
- package/web-dist/components/scroll-view/ScrollView.js +6 -7
- package/web-dist/components/search-input/SearchInput.js +14 -14
- package/web-dist/components/section-header/SectionHeader.js +11 -11
- package/web-dist/components/section-list/SectionList.js +14 -14
- package/web-dist/components/select/Select.js +18 -18
- package/web-dist/components/selectable-item/SelectableItem.js +6 -5
- package/web-dist/components/selection-provider/SelectionProvider.js +6 -5
- package/web-dist/components/sign-in-form/SignInForm.js +22 -22
- package/web-dist/components/sign-up-form/SignUpForm.js +22 -22
- package/web-dist/components/skeleton/Skeleton.js +23 -23
- package/web-dist/components/skeleton-card/SkeletonCard.js +23 -23
- package/web-dist/components/skeleton-list/SkeletonList.js +23 -23
- package/web-dist/components/skeleton-text/SkeletonText.js +23 -23
- package/web-dist/components/surface/Surface.js +7 -8
- package/web-dist/components/switch/Switch.js +8 -9
- package/web-dist/components/tab/Tab.js +7 -8
- package/web-dist/components/tab-list/TabList.js +7 -8
- package/web-dist/components/tab-panel/TabPanel.js +7 -8
- package/web-dist/components/tabletop-table/TabletopTable.js +4 -5
- package/web-dist/components/tabs/Tabs.js +7 -8
- package/web-dist/components/text/Text.js +7 -7
- package/web-dist/components/text-input/TextInput.js +14 -14
- package/web-dist/components/time-picker/TimePicker.js +19 -19
- package/web-dist/components/timeline/Timeline.js +12 -12
- package/web-dist/components/toast/Toast.js +10 -11
- package/web-dist/components/toast-provider/ToastProvider.js +10 -11
- package/web-dist/components/toolbar/Toolbar.js +20 -20
- package/web-dist/components/tree-item/TreeItem.js +18 -18
- package/web-dist/components/uploader/Uploader.js +24 -24
- package/web-dist/components/view/View.js +6 -7
- package/web-dist/manifest.json +1779 -1693
- package/web-dist/runtime/ZoraProvider.js +14 -15
- package/web-dist/chunks/Accordion-kcx57mk5.js +0 -39
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
|
+
import { INVERTED_POLARITY_PROP } from '../../constants/authoring';
|
|
3
4
|
import { ZORA_COMPONENT_META, type ZoraComponentPropAuthoring } from '.';
|
|
4
5
|
|
|
5
6
|
const componentMetaByName = new Map(Object.entries(ZORA_COMPONENT_META));
|
|
@@ -43,4 +44,14 @@ describe('ZORA component prop authoring authority', () => {
|
|
|
43
44
|
test('does not introduce a system authority', () => {
|
|
44
45
|
expect(JSON.stringify(ZORA_COMPONENT_META)).not.toContain('"authority":"system"');
|
|
45
46
|
});
|
|
47
|
+
|
|
48
|
+
test('describes inherited surface polarity for every direct manifest component', () => {
|
|
49
|
+
for (const [name, meta] of componentMetaByName) {
|
|
50
|
+
if (!meta.directManifestNode) continue;
|
|
51
|
+
expect(meta.props.inverted, name).toEqual(INVERTED_POLARITY_PROP);
|
|
52
|
+
expect(meta.bindings?.props?.inverted?.value.type, name).toBe('boolean');
|
|
53
|
+
}
|
|
54
|
+
expect(ZORA_COMPONENT_META.AppBar.props.inverted).toEqual(INVERTED_POLARITY_PROP);
|
|
55
|
+
expect(ZORA_COMPONENT_META.AppHeader.props.inverted).toEqual(INVERTED_POLARITY_PROP);
|
|
56
|
+
});
|
|
46
57
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { UiComponentMetaRegistry } from '@ankhorage/contracts';
|
|
2
2
|
|
|
3
|
+
import { INVERTED_POLARITY_PROP } from '../../constants/authoring';
|
|
3
4
|
import { imageMeta } from '../image/imageMeta';
|
|
4
5
|
import { readerSurfaceMeta } from '../reader/meta';
|
|
5
6
|
|
|
@@ -22,6 +23,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
25
|
props: {
|
|
26
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
25
27
|
text: {
|
|
26
28
|
type: 'string',
|
|
27
29
|
category: 'Content',
|
|
@@ -47,6 +49,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
47
49
|
},
|
|
48
50
|
},
|
|
49
51
|
props: {
|
|
52
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
50
53
|
text: {
|
|
51
54
|
type: 'string',
|
|
52
55
|
category: 'Content',
|
|
@@ -97,6 +100,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
props: {
|
|
103
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
100
104
|
children: {
|
|
101
105
|
type: 'string',
|
|
102
106
|
category: 'Content',
|
|
@@ -111,6 +115,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
111
115
|
},
|
|
112
116
|
Image: {
|
|
113
117
|
...imageMeta,
|
|
118
|
+
props: { ...imageMeta.props, inverted: INVERTED_POLARITY_PROP },
|
|
114
119
|
bindings: {
|
|
115
120
|
props: {
|
|
116
121
|
source: {
|
|
@@ -174,6 +179,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
174
179
|
},
|
|
175
180
|
},
|
|
176
181
|
props: {
|
|
182
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
177
183
|
value: {
|
|
178
184
|
type: 'string',
|
|
179
185
|
category: 'Content',
|
|
@@ -229,6 +235,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
229
235
|
},
|
|
230
236
|
},
|
|
231
237
|
props: {
|
|
238
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
232
239
|
value: {
|
|
233
240
|
type: 'string',
|
|
234
241
|
category: 'Content',
|
|
@@ -284,6 +291,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
284
291
|
},
|
|
285
292
|
},
|
|
286
293
|
props: {
|
|
294
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
287
295
|
checked: {
|
|
288
296
|
type: 'boolean',
|
|
289
297
|
category: 'State',
|
|
@@ -339,6 +347,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
339
347
|
},
|
|
340
348
|
},
|
|
341
349
|
props: {
|
|
350
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
342
351
|
checked: { type: 'boolean', category: 'State', label: 'Checked' },
|
|
343
352
|
disabled: { type: 'boolean', category: 'State', label: 'Disabled' },
|
|
344
353
|
},
|
|
@@ -364,6 +373,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
364
373
|
},
|
|
365
374
|
},
|
|
366
375
|
props: {
|
|
376
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
367
377
|
items: {
|
|
368
378
|
type: 'array',
|
|
369
379
|
category: 'Data',
|
|
@@ -392,6 +402,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
392
402
|
},
|
|
393
403
|
},
|
|
394
404
|
props: {
|
|
405
|
+
inverted: INVERTED_POLARITY_PROP,
|
|
395
406
|
rows: {
|
|
396
407
|
type: 'array',
|
|
397
408
|
category: 'Data',
|
|
@@ -401,6 +412,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
401
412
|
},
|
|
402
413
|
ReaderSurface: {
|
|
403
414
|
...readerSurfaceMeta,
|
|
415
|
+
props: { ...readerSurfaceMeta.props, inverted: INVERTED_POLARITY_PROP },
|
|
404
416
|
bindings: {
|
|
405
417
|
props: {
|
|
406
418
|
location: {
|
|
@@ -3,6 +3,7 @@ import { accordionItemMeta } from '../accordion/accordionItemMeta';
|
|
|
3
3
|
import { accordionMeta } from '../accordion/accordionMeta';
|
|
4
4
|
import { activityIndicatorMeta } from '../activity-indicator/activityIndicatorMeta';
|
|
5
5
|
import { appBarMeta } from '../app-bar/appBarMeta';
|
|
6
|
+
import { appHeaderMeta } from '../app-header/appHeaderMeta';
|
|
6
7
|
import { authScreenMeta } from '../auth/authScreenMeta';
|
|
7
8
|
import { forgotPasswordFormMeta } from '../auth/forgotPasswordFormMeta';
|
|
8
9
|
import { oauthProviderButtonMeta } from '../auth/oauthProviderButtonMeta';
|
|
@@ -115,6 +116,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
115
116
|
Divider: dividerMeta,
|
|
116
117
|
Surface: surfaceMeta,
|
|
117
118
|
AppBar: appBarMeta,
|
|
119
|
+
AppHeader: appHeaderMeta,
|
|
118
120
|
Avatar: avatarMeta,
|
|
119
121
|
AvatarGroup: avatarGroupMeta,
|
|
120
122
|
Badge: badgeMeta,
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ZoraComponentMetaRegistry } from '../../types/authoring';
|
|
1
|
+
import { INVERTED_POLARITY_PROP } from '../../constants/authoring';
|
|
2
|
+
import type { ZoraComponentMeta, ZoraComponentMetaRegistry } from '../../types/authoring';
|
|
3
3
|
import { createManifestBindings } from './createManifestBindings';
|
|
4
4
|
|
|
5
5
|
/*** Completes feature bindings while preserving each component's explicit value contracts. */
|
|
6
6
|
export function finalizeFeatureMetadata(
|
|
7
7
|
registry: ZoraComponentMetaRegistry,
|
|
8
8
|
): ZoraComponentMetaRegistry {
|
|
9
|
-
const names: ReadonlySet<string> = new Set(Object.values(FEATURE_MANIFEST_ELEMENTS).flat());
|
|
10
9
|
return Object.fromEntries(
|
|
11
|
-
Object.entries(registry).map(([name, meta]) => {
|
|
12
|
-
if (!
|
|
13
|
-
const
|
|
10
|
+
Object.entries(registry).map(([name, meta]): [string, ZoraComponentMeta] => {
|
|
11
|
+
if (!meta.directManifestNode) return [name, meta];
|
|
12
|
+
const props = { ...meta.props, inverted: INVERTED_POLARITY_PROP };
|
|
13
|
+
const bindings = createManifestBindings(props, meta.events);
|
|
14
14
|
return [
|
|
15
15
|
name,
|
|
16
16
|
{
|
|
17
17
|
...meta,
|
|
18
|
+
props,
|
|
18
19
|
bindings: {
|
|
19
20
|
props: { ...bindings.props, ...meta.bindings?.props },
|
|
20
21
|
events: { ...bindings.events, ...meta.bindings?.events },
|
|
@@ -76,6 +76,7 @@ describe('ZORA_COMPONENT_REGISTRY', () => {
|
|
|
76
76
|
expect(registry).toEqual({});
|
|
77
77
|
expect(registryEntries).toContain('Screen');
|
|
78
78
|
expect(registryEntries).toContain('View');
|
|
79
|
+
expect(registryEntries).toContain('AppHeader');
|
|
79
80
|
expect(source).toContain("export type { ZoraComponentRegistry } from './types/registry';");
|
|
80
81
|
expect(source).toContain(
|
|
81
82
|
"export { ZORA_COMPONENT_REGISTRY } from './features/registry/public';",
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
SelectableItemState,
|
|
9
9
|
SelectionTrigger,
|
|
10
10
|
} from '../../../../types/selection';
|
|
11
|
+
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
11
12
|
import { resolveSelectionEventIntent } from '../../application/resolveSelectionEventIntent';
|
|
12
13
|
import { useSelection } from './SelectionProvider';
|
|
13
14
|
|
|
@@ -24,7 +25,10 @@ function isRenderProp(
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
/*** Adds selection behavior to arbitrary child content via render props. */
|
|
27
|
-
export
|
|
28
|
+
export const SelectableItem = withZoraThemeScope(SelectableItemInner);
|
|
29
|
+
|
|
30
|
+
/*** Render a selectable item inside the inherited ZORA theme scope. */
|
|
31
|
+
function SelectableItemInner({
|
|
28
32
|
id,
|
|
29
33
|
trigger,
|
|
30
34
|
disabled = false,
|
|
@@ -2,8 +2,13 @@ import type { ThemeModeToggleProps } from '../../../../types/theme-mode-toggle';
|
|
|
2
2
|
import { IconButton } from '../../../button/public';
|
|
3
3
|
import { useZoraTheme } from '../../composition/useZoraTheme';
|
|
4
4
|
import { resolveThemeModeToggleState } from '../../utils/resolveThemeModeToggleState';
|
|
5
|
+
import { withZoraThemeScope } from './withZoraThemeScope';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
/*** Provide a theme mode control with inherited surface polarity. */
|
|
8
|
+
export const ThemeModeToggle = withZoraThemeScope(ThemeModeToggleInner);
|
|
9
|
+
|
|
10
|
+
/*** Render the control from the active theme mode. */
|
|
11
|
+
function ThemeModeToggleInner({
|
|
7
12
|
disabled,
|
|
8
13
|
interactionPolicy,
|
|
9
14
|
size = 'm',
|
|
@@ -12,20 +12,21 @@ export interface ZoraThemeScopeProps {
|
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
themeId?: ZoraThemeId;
|
|
14
14
|
mode?: ZoraThemeMode;
|
|
15
|
+
inverted?: boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
/*** Applies nested ZORA theme overrides through the public Surface theme scope. */
|
|
18
|
-
export function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
19
|
-
if (mode === undefined && themeId === undefined) return children;
|
|
19
|
+
export function ZoraThemeScope({ children, themeId, mode, inverted }: ZoraThemeScopeProps) {
|
|
20
|
+
if (mode === undefined && themeId === undefined && inverted === undefined) return children;
|
|
20
21
|
return (
|
|
21
|
-
<ZoraThemeScopeInner mode={mode} themeId={themeId}>
|
|
22
|
+
<ZoraThemeScopeInner mode={mode} themeId={themeId} inverted={inverted}>
|
|
22
23
|
{children}
|
|
23
24
|
</ZoraThemeScopeInner>
|
|
24
25
|
);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
/*** Resolves and provides the scoped Surface and ZORA theme runtime values. */
|
|
28
|
-
function ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
29
|
+
function ZoraThemeScopeInner({ children, themeId, mode, inverted }: ZoraThemeScopeProps) {
|
|
29
30
|
const parentRuntime = useZoraThemeRuntime();
|
|
30
31
|
const scopedThemeId = resolveZoraScopedThemeId({
|
|
31
32
|
desiredThemeId: themeId,
|
|
@@ -33,7 +34,13 @@ function ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
|
33
34
|
});
|
|
34
35
|
const scopedRuntimeValue = useMemo(() => ({ themeId: scopedThemeId }), [scopedThemeId]);
|
|
35
36
|
const scopedChildren =
|
|
36
|
-
mode === undefined
|
|
37
|
+
mode === undefined && inverted === undefined ? (
|
|
38
|
+
children
|
|
39
|
+
) : (
|
|
40
|
+
<ThemeScope mode={mode} inverted={inverted}>
|
|
41
|
+
{children}
|
|
42
|
+
</ThemeScope>
|
|
43
|
+
);
|
|
37
44
|
|
|
38
45
|
return (
|
|
39
46
|
<ZoraThemeRuntimeContext value={scopedRuntimeValue}>{scopedChildren}</ZoraThemeRuntimeContext>
|
|
@@ -3,17 +3,22 @@ import React from 'react';
|
|
|
3
3
|
import type { ZoraBaseProps } from '../../../../types/base';
|
|
4
4
|
import { ZoraThemeScope } from './ZoraThemeScope';
|
|
5
5
|
|
|
6
|
+
/*** Applies optional theme and polarity overrides to any ZORA component. */
|
|
6
7
|
export function withZoraThemeScope<P extends ZoraBaseProps>(
|
|
7
8
|
Component: (props: P) => React.ReactElement | null,
|
|
8
9
|
): (props: P) => React.ReactElement | null {
|
|
9
10
|
const Wrapped = (props: P) => {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const componentProps = { ...props };
|
|
12
|
+
delete componentProps.themeId;
|
|
13
|
+
delete componentProps.mode;
|
|
14
|
+
delete componentProps.inverted;
|
|
15
|
+
if (props.mode === undefined && props.themeId === undefined && props.inverted === undefined) {
|
|
16
|
+
return React.createElement(Component, componentProps);
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
return (
|
|
15
|
-
<ZoraThemeScope mode={props.mode} themeId={props.themeId}>
|
|
16
|
-
{React.createElement(Component,
|
|
20
|
+
<ZoraThemeScope mode={props.mode} themeId={props.themeId} inverted={props.inverted}>
|
|
21
|
+
{React.createElement(Component, componentProps)}
|
|
17
22
|
</ZoraThemeScope>
|
|
18
23
|
);
|
|
19
24
|
};
|
|
@@ -27,7 +27,7 @@ describe('canonical ThemeConfig scope propagation', () => {
|
|
|
27
27
|
test('nested scopes delegate Surface config and mode ownership to ThemeScope', () => {
|
|
28
28
|
const scope = readFileSync(join(themeDir, 'adapters', 'inbound', 'ZoraThemeScope.tsx'), 'utf8');
|
|
29
29
|
expect(scope).toContain("import { ThemeScope } from '@ankhorage/surface';");
|
|
30
|
-
expect(scope).toContain('<ThemeScope mode={mode}>');
|
|
30
|
+
expect(scope).toContain('<ThemeScope mode={mode} inverted={inverted}>');
|
|
31
31
|
expect(scope).not.toContain('parentSurface');
|
|
32
32
|
expect(scope).not.toContain('sourceConfig');
|
|
33
33
|
expect(scope).not.toContain('createTheme');
|
|
@@ -178,6 +178,7 @@ describe('theme scope structure', () => {
|
|
|
178
178
|
it('delegates nested Surface runtime ownership to the public ThemeScope boundary', () => {
|
|
179
179
|
expect(themeScopeSource).toMatch(/import \{ ThemeScope \} from '@ankhorage\/surface'/u);
|
|
180
180
|
expect(themeScopeSource).toMatch(/<ThemeScope\s+mode=/u);
|
|
181
|
+
expect(themeScopeSource).toMatch(/inverted=\{inverted\}/u);
|
|
181
182
|
expect(themeScopeSource).not.toMatch(/ThemeContext/u);
|
|
182
183
|
expect(themeScopeSource).not.toMatch(/useFontContext/u);
|
|
183
184
|
expect(themeScopeSource).not.toMatch(/createTheme\(/u);
|
|
@@ -185,9 +186,13 @@ describe('theme scope structure', () => {
|
|
|
185
186
|
expect(themeScopeSource).not.toMatch(/<ThemeProvider\b/u);
|
|
186
187
|
});
|
|
187
188
|
|
|
188
|
-
it('wraps components only when mode/themeId overrides are present', () => {
|
|
189
|
+
it('wraps components only when mode/themeId/inverted overrides are present', () => {
|
|
189
190
|
expect(hocSource).toMatch(/props\.mode === undefined/u);
|
|
190
191
|
expect(hocSource).toMatch(/props\.themeId === undefined/u);
|
|
192
|
+
expect(hocSource).toMatch(/props\.inverted === undefined/u);
|
|
193
|
+
expect(hocSource).toMatch(/delete componentProps\.themeId/u);
|
|
194
|
+
expect(hocSource).toMatch(/delete componentProps\.mode/u);
|
|
195
|
+
expect(hocSource).toMatch(/delete componentProps\.inverted/u);
|
|
191
196
|
expect(hocSource).toMatch(/<ZoraThemeScope/u);
|
|
192
197
|
});
|
|
193
198
|
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
} from './features/activity-indicator/public';
|
|
14
14
|
export type { AppBarMode, AppBarOverflowMenu, AppBarProps } from './features/app-bar/public';
|
|
15
15
|
export { AppBar } from './features/app-bar/public';
|
|
16
|
+
export { AppHeader, type AppHeaderProps } from './features/app-header/public';
|
|
16
17
|
export type {
|
|
17
18
|
AuthFormBaseProps,
|
|
18
19
|
AuthIdentifierKind,
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { getContrastRatio, parseHexColorOrThrow } from '@ankhorage/color-theory';
|
|
5
|
+
import type { SurfaceTheme, ThemeMode } from '@ankhorage/surface';
|
|
6
|
+
import { expect, test } from 'bun:test';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
9
|
+
|
|
10
|
+
import type { AppHeader as AppHeaderComponent } from './features/app-header/public';
|
|
11
|
+
import type { Breadcrumbs as BreadcrumbsComponent } from './features/breadcrumbs/public';
|
|
12
|
+
import type {
|
|
13
|
+
Button as ButtonComponent,
|
|
14
|
+
IconButton as IconButtonComponent,
|
|
15
|
+
} from './features/button/public';
|
|
16
|
+
import type { GameField as GameFieldComponent } from './features/game/public';
|
|
17
|
+
import type { View as ViewComponent } from './features/layout/public';
|
|
18
|
+
import type { useZoraTheme as useZoraThemeHook } from './features/theme/composition/useZoraTheme';
|
|
19
|
+
import type { ZoraProvider as ZoraProviderComponent } from './features/theme/runtime';
|
|
20
|
+
import type { Text as TextComponent } from './features/typography/public';
|
|
21
|
+
|
|
22
|
+
const webDist = join(import.meta.dir, '..', 'web-dist');
|
|
23
|
+
|
|
24
|
+
test('web materialization exposes the public AppHeader component', async () => {
|
|
25
|
+
const manifest = (await Bun.file(join(webDist, 'manifest.json')).json()) as {
|
|
26
|
+
artifacts: readonly { component: string; exportName: string; files: readonly string[] }[];
|
|
27
|
+
};
|
|
28
|
+
const appHeader = manifest.artifacts.find((entry) => entry.component === 'app-header');
|
|
29
|
+
expect(appHeader?.exportName).toBe('AppHeader');
|
|
30
|
+
expect(appHeader?.files).toContain('components/app-header/index.js');
|
|
31
|
+
expect(appHeader?.files).toContain('components/app-header/AppHeader.d.ts');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test.each(['light', 'dark'] as const)(
|
|
35
|
+
'%s mode composes inherited inversion, reset, and AppHeader without changing mode',
|
|
36
|
+
async (mode) => {
|
|
37
|
+
const { ZoraProvider, useZoraTheme } = (await import(
|
|
38
|
+
pathToFileURL(join(webDist, 'runtime/ZoraProvider.js')).href
|
|
39
|
+
)) as { ZoraProvider: typeof ZoraProviderComponent; useZoraTheme: typeof useZoraThemeHook };
|
|
40
|
+
const { View } = (await import(
|
|
41
|
+
pathToFileURL(join(webDist, 'components/view/index.js')).href
|
|
42
|
+
)) as {
|
|
43
|
+
View: typeof ViewComponent;
|
|
44
|
+
};
|
|
45
|
+
const { Text } = (await import(
|
|
46
|
+
pathToFileURL(join(webDist, 'components/text/index.js')).href
|
|
47
|
+
)) as {
|
|
48
|
+
Text: typeof TextComponent;
|
|
49
|
+
};
|
|
50
|
+
const { Breadcrumbs } = (await import(
|
|
51
|
+
pathToFileURL(join(webDist, 'components/breadcrumbs/index.js')).href
|
|
52
|
+
)) as { Breadcrumbs: typeof BreadcrumbsComponent };
|
|
53
|
+
const { Button } = (await import(
|
|
54
|
+
pathToFileURL(join(webDist, 'components/button/index.js')).href
|
|
55
|
+
)) as { Button: typeof ButtonComponent };
|
|
56
|
+
const { IconButton } = (await import(
|
|
57
|
+
pathToFileURL(join(webDist, 'components/icon-button/index.js')).href
|
|
58
|
+
)) as { IconButton: typeof IconButtonComponent };
|
|
59
|
+
const { GameField } = (await import(
|
|
60
|
+
pathToFileURL(join(webDist, 'components/game-field/index.js')).href
|
|
61
|
+
)) as { GameField: typeof GameFieldComponent };
|
|
62
|
+
const { AppHeader } = (await import(
|
|
63
|
+
pathToFileURL(join(webDist, 'components/app-header/index.js')).href
|
|
64
|
+
)) as { AppHeader: typeof AppHeaderComponent };
|
|
65
|
+
const observed = new Map<
|
|
66
|
+
string,
|
|
67
|
+
{ mode: ThemeMode; inverted: boolean | undefined; theme: SurfaceTheme }
|
|
68
|
+
>();
|
|
69
|
+
|
|
70
|
+
function Probe({ id }: { id: string }) {
|
|
71
|
+
const { mode: activeMode, inverted, theme } = useZoraTheme();
|
|
72
|
+
observed.set(id, { mode: activeMode, inverted, theme });
|
|
73
|
+
return <span data-probe={id} />;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const markup = renderToStaticMarkup(
|
|
77
|
+
<ZoraProvider initialMode={mode}>
|
|
78
|
+
<Probe id="root" />
|
|
79
|
+
<View inverted>
|
|
80
|
+
<Probe id="outer" />
|
|
81
|
+
<Text>Inherited text</Text>
|
|
82
|
+
<Breadcrumbs items={[{ id: 'home', label: 'Home', icon: { name: 'home-outline' } }]} />
|
|
83
|
+
<IconButton iconName="add-outline" label="Add" variant="ghost" />
|
|
84
|
+
<Button color="primary" variant="solid">
|
|
85
|
+
Save
|
|
86
|
+
</Button>
|
|
87
|
+
<GameField inverted={false}>
|
|
88
|
+
<Probe id="gameReset" />
|
|
89
|
+
</GameField>
|
|
90
|
+
<View inverted={false}>
|
|
91
|
+
<Probe id="reset" />
|
|
92
|
+
<Text>Reset text</Text>
|
|
93
|
+
<IconButton iconName="close-outline" label="Reset action" variant="ghost" />
|
|
94
|
+
<View inverted>
|
|
95
|
+
<Probe id="reinverted" />
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
</View>
|
|
99
|
+
<AppHeader
|
|
100
|
+
inverted
|
|
101
|
+
title="Workspace"
|
|
102
|
+
actions={
|
|
103
|
+
<>
|
|
104
|
+
<IconButton iconName="add-outline" label="Header action" variant="ghost" />
|
|
105
|
+
<Button color="primary" variant="solid">
|
|
106
|
+
Header save
|
|
107
|
+
</Button>
|
|
108
|
+
</>
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<Probe id="header" />
|
|
112
|
+
<Breadcrumbs
|
|
113
|
+
items={[{ id: 'header-home', label: 'Header home', icon: { name: 'home-outline' } }]}
|
|
114
|
+
/>
|
|
115
|
+
<IconButton
|
|
116
|
+
inverted={false}
|
|
117
|
+
iconName="close-outline"
|
|
118
|
+
label="Header reset"
|
|
119
|
+
variant="ghost"
|
|
120
|
+
/>
|
|
121
|
+
</AppHeader>
|
|
122
|
+
<AppHeader>
|
|
123
|
+
<Probe id="normalHeader" />
|
|
124
|
+
</AppHeader>
|
|
125
|
+
<AppHeader title="Workspace title" />
|
|
126
|
+
</ZoraProvider>,
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
expect([...observed.keys()].sort()).toEqual([
|
|
130
|
+
'gameReset',
|
|
131
|
+
'header',
|
|
132
|
+
'normalHeader',
|
|
133
|
+
'outer',
|
|
134
|
+
'reinverted',
|
|
135
|
+
'reset',
|
|
136
|
+
'root',
|
|
137
|
+
]);
|
|
138
|
+
expect([...observed.values()].every((entry) => entry.mode === mode)).toBe(true);
|
|
139
|
+
expect(observed.get('root')?.inverted).toBe(false);
|
|
140
|
+
expect(observed.get('outer')?.inverted).toBe(true);
|
|
141
|
+
expect(observed.get('reset')?.inverted).toBe(false);
|
|
142
|
+
expect(observed.get('gameReset')?.inverted).toBe(false);
|
|
143
|
+
expect(observed.get('reinverted')?.inverted).toBe(true);
|
|
144
|
+
expect(observed.get('header')?.inverted).toBe(true);
|
|
145
|
+
expect(observed.get('normalHeader')?.inverted).toBe(false);
|
|
146
|
+
expect(observed.get('outer')?.theme.semantics.surface.default).toBe(
|
|
147
|
+
observed.get('header')?.theme.semantics.surface.default,
|
|
148
|
+
);
|
|
149
|
+
expect(observed.get('reset')?.theme.semantics.surface.default).toBe(
|
|
150
|
+
observed.get('root')?.theme.semantics.surface.default,
|
|
151
|
+
);
|
|
152
|
+
expect(observed.get('outer')?.theme.semantics.surface.default).not.toBe(
|
|
153
|
+
observed.get('root')?.theme.semantics.surface.default,
|
|
154
|
+
);
|
|
155
|
+
const theme = observed.get('outer')?.theme;
|
|
156
|
+
expect(theme).toBeDefined();
|
|
157
|
+
if (theme === undefined) return;
|
|
158
|
+
expect(
|
|
159
|
+
getContrastRatio(
|
|
160
|
+
parseHexColorOrThrow(theme.semantics.content.muted),
|
|
161
|
+
parseHexColorOrThrow(theme.semantics.surface.default),
|
|
162
|
+
),
|
|
163
|
+
).toBeGreaterThanOrEqual(4.5);
|
|
164
|
+
expect(theme.semantics.action.primary.onSolidText).toBe(
|
|
165
|
+
observed.get('root')?.theme.semantics.action.primary.onSolidText,
|
|
166
|
+
);
|
|
167
|
+
expect(markup).toContain('Inherited text');
|
|
168
|
+
expect(markup).toContain('Reset text');
|
|
169
|
+
expect(markup).toContain('Home');
|
|
170
|
+
expect(markup).toContain('Save');
|
|
171
|
+
expect(markup).toContain('Workspace title');
|
|
172
|
+
expect(markup).toContain('Header home');
|
|
173
|
+
expect(markup).toContain('Header save');
|
|
174
|
+
expect(markup).toContain('data-probe="header"');
|
|
175
|
+
expect(markup).not.toContain('inverted=');
|
|
176
|
+
},
|
|
177
|
+
);
|
package/src/types/base.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { GameDefinition, GameInput, GameOutput } from '@ankhorage/game';
|
|
2
|
-
import type { InteractionPolicyProps } from '@ankhorage/surface';
|
|
3
2
|
import type React from 'react';
|
|
4
3
|
|
|
4
|
+
import type { ZoraBaseProps } from './base';
|
|
5
|
+
|
|
5
6
|
type GameOverlayCornerPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
6
7
|
|
|
7
8
|
export type GamePointerEvents = 'auto' | 'box-none' | 'box-only' | 'none';
|
|
@@ -26,7 +27,7 @@ export interface GameEntityMotionProps {
|
|
|
26
27
|
export type GameOverlayPlacement =
|
|
27
28
|
'fill' | 'center' | 'top' | 'bottom' | GameOverlayCornerPlacement;
|
|
28
29
|
|
|
29
|
-
export interface GameFieldProps extends
|
|
30
|
+
export interface GameFieldProps extends ZoraBaseProps {
|
|
30
31
|
readonly children?: React.ReactNode;
|
|
31
32
|
readonly aspectRatio?: number;
|
|
32
33
|
readonly minHeight?: number;
|
|
@@ -36,7 +37,7 @@ export interface GameFieldProps extends InteractionPolicyProps {
|
|
|
36
37
|
readonly testID?: string;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export interface GameEntityProps extends GameEntityMotionProps,
|
|
40
|
+
export interface GameEntityProps extends GameEntityMotionProps, ZoraBaseProps {
|
|
40
41
|
readonly children?: React.ReactNode;
|
|
41
42
|
readonly x?: number;
|
|
42
43
|
readonly y?: number;
|
|
@@ -60,7 +61,7 @@ export interface GameKeyboardBinding {
|
|
|
60
61
|
readonly preventDefault?: boolean;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
export interface GameInputZoneProps extends
|
|
64
|
+
export interface GameInputZoneProps extends ZoraBaseProps {
|
|
64
65
|
readonly eventType: string;
|
|
65
66
|
readonly entityId?: string;
|
|
66
67
|
readonly x?: number;
|
|
@@ -75,7 +76,7 @@ export interface GameInputZoneProps extends InteractionPolicyProps {
|
|
|
75
76
|
readonly testID?: string;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
export interface GameMeasurementProbeProps extends
|
|
79
|
+
export interface GameMeasurementProbeProps extends ZoraBaseProps {
|
|
79
80
|
readonly sourceId: string;
|
|
80
81
|
readonly targetId: string;
|
|
81
82
|
readonly eventType?: string;
|
|
@@ -84,7 +85,7 @@ export interface GameMeasurementProbeProps extends InteractionPolicyProps {
|
|
|
84
85
|
readonly enabled?: boolean;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
export interface GameOverlayProps extends
|
|
88
|
+
export interface GameOverlayProps extends ZoraBaseProps {
|
|
88
89
|
readonly children?: React.ReactNode;
|
|
89
90
|
readonly placement?: GameOverlayPlacement;
|
|
90
91
|
readonly blocking?: boolean;
|
package/src/types/selection.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { InteractionPolicy } from '@ankhorage/surface';
|
|
|
2
2
|
import type { SelectionIntent } from '@ankhorage/utility/selection';
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
|
|
5
|
+
import type { ZoraBaseProps } from './base';
|
|
6
|
+
|
|
5
7
|
export type SelectionMode = 'single' | 'multi';
|
|
6
8
|
|
|
7
9
|
export type SelectionTrigger = 'press' | 'longPress' | 'manual';
|
|
@@ -40,7 +42,7 @@ export interface SelectableItemState {
|
|
|
40
42
|
clear: () => void;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
export interface SelectableItemProps {
|
|
45
|
+
export interface SelectableItemProps extends ZoraBaseProps {
|
|
44
46
|
id: string;
|
|
45
47
|
trigger?: SelectionTrigger;
|
|
46
48
|
disabled?: boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import type { ZoraBaseProps } from './base';
|
|
1
2
|
import type { IconButtonProps } from './icon-button';
|
|
2
3
|
|
|
3
|
-
export type ThemeModeToggleProps =
|
|
4
|
-
IconButtonProps,
|
|
5
|
-
'disabled' | 'interactionPolicy' | 'size' | 'testID'
|
|
6
|
-
>;
|
|
4
|
+
export type ThemeModeToggleProps = ZoraBaseProps &
|
|
5
|
+
Pick<IconButtonProps, 'disabled' | 'interactionPolicy' | 'size' | 'testID'>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Field3
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-q9zge7kd.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-8z7naxj2.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-0yvepteg.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-e2kr1z3g.js";
|
|
14
14
|
|
|
15
15
|
// src/features/form/field/adapters/inbound/Field.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|