@ankhorage/zora 27.8.0 → 27.10.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 +24 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +65 -1
- package/dist/capabilities/index.js.map +7 -6
- package/dist/constants/authoring.d.ts +4 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +2 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -1
- package/dist/features/form/select/composition/SelectTrigger.js +1 -1
- package/dist/features/form/select/composition/SelectTrigger.js.map +1 -1
- package/dist/features/form/select/selectMeta.d.ts +19 -0
- package/dist/features/form/select/selectMeta.d.ts.map +1 -1
- package/dist/features/form/select/selectMeta.js +15 -0
- package/dist/features/form/select/selectMeta.js.map +1 -1
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/adapters/inbound/Screen.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/Screen.js +1 -1
- package/dist/features/layout/adapters/inbound/Screen.js.map +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/adapters/inbound/MasterDetail.d.ts +5 -0
- package/dist/features/master-detail/adapters/inbound/MasterDetail.d.ts.map +1 -0
- package/dist/features/master-detail/adapters/inbound/MasterDetail.js +39 -0
- package/dist/features/master-detail/adapters/inbound/MasterDetail.js.map +1 -0
- package/dist/features/master-detail/application/resolveMasterDetailPresentation.d.ts +6 -0
- package/dist/features/master-detail/application/resolveMasterDetailPresentation.d.ts.map +1 -0
- package/dist/features/master-detail/application/resolveMasterDetailPresentation.js +7 -0
- package/dist/features/master-detail/application/resolveMasterDetailPresentation.js.map +1 -0
- package/dist/features/master-detail/masterDetailMeta.d.ts +52 -0
- package/dist/features/master-detail/masterDetailMeta.d.ts.map +1 -0
- package/dist/features/master-detail/masterDetailMeta.js +47 -0
- package/dist/features/master-detail/masterDetailMeta.js.map +1 -0
- package/dist/features/master-detail/public.d.ts +3 -0
- package/dist/features/master-detail/public.d.ts.map +1 -0
- package/dist/features/master-detail/public.js +2 -0
- package/dist/features/master-detail/public.js.map +1 -0
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- 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/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.d.ts +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.d.ts.map +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.js.map +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.d.ts +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.d.ts.map +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.js +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.js.map +1 -1
- package/dist/features/theme/public.d.ts +4 -4
- package/dist/features/theme/public.d.ts.map +1 -1
- package/dist/features/theme/public.js +3 -3
- package/dist/features/theme/public.js.map +1 -1
- package/dist/features/theme/zoraDefaultTheme.d.ts +1 -1
- package/dist/features/theme/zoraDefaultTheme.d.ts.map +1 -1
- package/dist/features/theme/zoraDefaultTheme.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/readerFree.d.ts +2 -0
- package/dist/readerFree.d.ts.map +1 -1
- package/dist/readerFree.js +1 -0
- package/dist/readerFree.js.map +1 -1
- package/dist/types/master-detail.d.ts +21 -0
- package/dist/types/master-detail.d.ts.map +1 -0
- package/dist/types/master-detail.js +2 -0
- package/dist/types/master-detail.js.map +1 -0
- package/dist/types/select.d.ts +5 -0
- package/dist/types/select.d.ts.map +1 -1
- package/dist/types/select.js.map +1 -1
- package/package.json +19 -5
- package/src/constants/authoring.ts +2 -0
- package/src/features/form/select/composition/SelectTrigger.tsx +2 -0
- package/src/features/form/select/public.test.ts +54 -0
- package/src/features/form/select/selectMeta.ts +15 -0
- package/src/features/layout/adapters/inbound/Screen.tsx +3 -0
- package/src/features/master-detail/adapters/inbound/MasterDetail.runtime.test.tsx +121 -0
- package/src/features/master-detail/adapters/inbound/MasterDetail.tsx +75 -0
- package/src/features/master-detail/application/resolveMasterDetailPresentation.test.ts +18 -0
- package/src/features/master-detail/application/resolveMasterDetailPresentation.ts +15 -0
- package/src/features/master-detail/masterDetailMeta.ts +49 -0
- package/src/features/master-detail/public.ts +7 -0
- package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
- package/src/features/registry/componentMeta.test.ts +16 -0
- package/src/features/registry/componentMeta.ts +2 -0
- package/src/features/registry/featureManifest.test.ts +2 -0
- package/src/features/theme/application/use-cases/compileZoraTheme.ts +1 -1
- package/src/features/theme/application/use-cases/createZoraThemeConfig.ts +2 -2
- package/src/features/theme/public.ts +4 -4
- package/src/features/theme/themeModuleResolution.test.ts +26 -21
- package/src/features/theme/zoraDefaultTheme.ts +1 -1
- package/src/index.ts +7 -0
- package/src/readerFree.ts +7 -0
- package/src/types/master-detail.ts +25 -0
- package/src/types/select.ts +6 -0
- package/web-dist/chunks/{Accordion-3dk0s8hz.js → Accordion-0bgzetnd.js} +4 -4
- package/web-dist/chunks/{Accordion-h4928ex8.js → Accordion-0jkpvxwd.js} +1 -1
- package/web-dist/chunks/{Accordion-54417vp7.js → Accordion-0pbcs0xf.js} +3 -3
- package/web-dist/chunks/{Accordion-396cm5m0.js → Accordion-1andv7gg.js} +5 -5
- package/web-dist/chunks/{Accordion-rxc2p9md.js → Accordion-1mjn0atk.js} +1 -1
- package/web-dist/chunks/{Accordion-psxc0zjs.js → Accordion-27rxpbvf.js} +3 -3
- package/web-dist/chunks/{Accordion-waxb6x73.js → Accordion-3s7zeagv.js} +18 -2
- package/web-dist/chunks/{Accordion-ytvjnaz3.js → Accordion-45tbe5v0.js} +5 -5
- package/web-dist/chunks/{Accordion-c1btejmf.js → Accordion-6qesggn9.js} +1 -1
- package/web-dist/chunks/{Accordion-jqjnzjmt.js → Accordion-7e0mb55z.js} +4 -4
- package/web-dist/chunks/{Accordion-q3wk945k.js → Accordion-8rkwd0wx.js} +3 -1
- package/web-dist/chunks/{Accordion-6tfr02mw.js → Accordion-8vw4k0s6.js} +1 -1
- package/web-dist/chunks/{Accordion-xjxam647.js → Accordion-8wq38d9b.js} +2 -2
- package/web-dist/chunks/{Accordion-fcpadcrg.js → Accordion-91v243pz.js} +1 -1
- package/web-dist/chunks/{Accordion-dr8k9txz.js → Accordion-9kkfz7s8.js} +2 -2
- package/web-dist/chunks/{Accordion-wdby2v5r.js → Accordion-b991pn6e.js} +5 -1
- package/web-dist/chunks/{Accordion-xkewtxac.js → Accordion-ctcxh9pk.js} +2 -2
- package/web-dist/chunks/{Accordion-1ty4zrzd.js → Accordion-dnfrzbpb.js} +4 -4
- package/web-dist/chunks/{Accordion-rbtgfrn4.js → Accordion-f6k281sv.js} +5 -5
- package/web-dist/chunks/{Accordion-7j05jjqn.js → Accordion-fjnb7anx.js} +5 -5
- package/web-dist/chunks/{Accordion-qjp8bp5y.js → Accordion-ga82tcs9.js} +5 -5
- package/web-dist/chunks/{Accordion-wswm0zxe.js → Accordion-grtf75xt.js} +3 -3
- package/web-dist/chunks/{Accordion-kn52vs02.js → Accordion-hha54x4c.js} +3 -3
- package/web-dist/chunks/{Accordion-ephzqa3t.js → Accordion-hrxdchkq.js} +3 -3
- package/web-dist/chunks/{Accordion-vayww2ec.js → Accordion-jr0201qc.js} +9 -9
- package/web-dist/chunks/{Accordion-7tg3cabd.js → Accordion-jsapannb.js} +1 -1
- package/web-dist/chunks/{Accordion-rqh7264g.js → Accordion-m7jt3c87.js} +2 -2
- package/web-dist/chunks/{Accordion-yrs9sd97.js → Accordion-mxad79vq.js} +13 -7
- package/web-dist/chunks/{Accordion-y7z4v31b.js → Accordion-nbje2ywp.js} +2 -2
- package/web-dist/chunks/{Accordion-scvx38z0.js → Accordion-pkbvsn5y.js} +4 -4
- package/web-dist/chunks/{Accordion-jj6sg99e.js → Accordion-q6xnm1k4.js} +7 -7
- package/web-dist/chunks/{Accordion-291hyjee.js → Accordion-r6mc7qtj.js} +3 -3
- package/web-dist/chunks/{Accordion-zmee9h36.js → Accordion-rt4jfq2r.js} +1 -1
- package/web-dist/chunks/{Accordion-e8r2qt0n.js → Accordion-th8pkeqc.js} +2 -2
- package/web-dist/chunks/{Accordion-67a2a09x.js → Accordion-tnq8bt8v.js} +1 -1
- package/web-dist/chunks/{Accordion-n8dksapd.js → Accordion-ttjyk97v.js} +1 -1
- package/web-dist/chunks/{Accordion-gwq0xkp9.js → Accordion-v21vz0cg.js} +5 -2
- package/web-dist/chunks/{Accordion-gaevp89v.js → Accordion-vdqc8rxv.js} +3 -3
- package/web-dist/chunks/{Accordion-qyf0e72g.js → Accordion-w1ag7sr4.js} +1 -1
- package/web-dist/chunks/{Accordion-dmkygw9c.js → Accordion-w9vbdg9r.js} +5 -5
- package/web-dist/chunks/{Accordion-zj4wnm3e.js → Accordion-wgc67k1g.js} +1 -1
- package/web-dist/chunks/{Accordion-zx1qd2tf.js → Accordion-x3em7tpd.js} +5 -5
- package/web-dist/chunks/{Accordion-kmbw4fe7.js → Accordion-xb2nj0q6.js} +1 -1
- package/web-dist/chunks/{Accordion-db40jsp6.js → Accordion-xp2t3pkj.js} +3 -3
- package/web-dist/chunks/{Accordion-1j50tne9.js → Accordion-ztcmb44y.js} +7 -4
- package/web-dist/components/accordion/Accordion.js +7 -7
- package/web-dist/components/accordion-item/AccordionItem.js +7 -7
- package/web-dist/components/app-bar/AppBar.js +13 -13
- package/web-dist/components/app-header/AppHeader.js +13 -13
- package/web-dist/components/app-shell/AppShell.js +3 -3
- package/web-dist/components/auth-screen/AuthScreen.js +15 -15
- package/web-dist/components/avatar/Avatar.js +7 -7
- package/web-dist/components/avatar-group/AvatarGroup.js +7 -7
- package/web-dist/components/badge/Badge.js +3 -3
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +15 -15
- package/web-dist/components/bottom-sheet/BottomSheet.js +4 -4
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -4
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -4
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -4
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -4
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -4
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +9 -9
- package/web-dist/components/button/Button.js +7 -7
- package/web-dist/components/button-group/ButtonGroup.js +7 -7
- package/web-dist/components/calendar/Calendar.js +9 -9
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +15 -15
- package/web-dist/components/card/Card.js +14 -14
- package/web-dist/components/chat-list-item/ChatListItem.js +10 -10
- package/web-dist/components/checkbox/Checkbox.js +6 -6
- package/web-dist/components/checkbox-group/CheckboxGroup.js +6 -6
- package/web-dist/components/chip/Chip.js +8 -8
- package/web-dist/components/chip-group/ChipGroup.js +8 -8
- package/web-dist/components/collection-editor/CollectionEditor.js +14 -14
- package/web-dist/components/color-hue-scale/ColorHueScale.js +9 -9
- package/web-dist/components/color-picker/ColorPicker.js +9 -9
- package/web-dist/components/color-tone/ColorTone.js +9 -9
- package/web-dist/components/color-wheel/ColorWheel.js +9 -9
- package/web-dist/components/content-rail/ContentRail.js +8 -8
- package/web-dist/components/data-table/DataTable.js +21 -21
- package/web-dist/components/date-picker/DatePicker.js +14 -14
- package/web-dist/components/dialog/Dialog.js +6 -6
- package/web-dist/components/divider/Divider.js +3 -3
- package/web-dist/components/empty-state/EmptyState.js +15 -15
- package/web-dist/components/explorer/Explorer.js +8 -8
- package/web-dist/components/field/Field.js +6 -6
- package/web-dist/components/file-explorer/FileExplorer.js +8 -8
- package/web-dist/components/flat-list/FlatList.js +7 -7
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +15 -15
- package/web-dist/components/form/Form.js +11 -11
- package/web-dist/components/form-actions/FormActions.js +11 -11
- package/web-dist/components/form-error/FormError.js +11 -11
- package/web-dist/components/game/Game.js +4 -4
- package/web-dist/components/game-entity/GameEntity.js +4 -4
- package/web-dist/components/game-field/GameField.js +4 -4
- package/web-dist/components/game-input-zone/GameInputZone.js +4 -4
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -4
- package/web-dist/components/game-overlay/GameOverlay.js +4 -4
- package/web-dist/components/gradient/Gradient.js +4 -4
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -4
- package/web-dist/components/grid/Grid.js +3 -3
- package/web-dist/components/heading/Heading.js +2 -2
- package/web-dist/components/hero/Hero.js +14 -14
- package/web-dist/components/icon/Icon.js +2 -2
- package/web-dist/components/icon-button/IconButton.js +7 -7
- package/web-dist/components/image/Image.js +6 -6
- package/web-dist/components/list/List.js +7 -7
- package/web-dist/components/list-item/ListItem.js +7 -7
- package/web-dist/components/list-section/ListSection.js +7 -7
- package/web-dist/components/master-detail/MasterDetail.d.ts +7 -0
- package/web-dist/components/master-detail/MasterDetail.dependency-0.d.ts +27 -0
- package/web-dist/components/master-detail/MasterDetail.dependency-1.d.ts +3 -0
- package/web-dist/components/master-detail/MasterDetail.js +110 -0
- package/web-dist/components/master-detail/MasterDetail.types-0.d.ts +25 -0
- package/web-dist/components/master-detail/index.d.ts +2 -0
- package/web-dist/components/master-detail/index.js +2 -0
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +14 -14
- package/web-dist/components/media-explorer/MediaExplorer.js +8 -8
- package/web-dist/components/message-bubble/MessageBubble.js +10 -10
- package/web-dist/components/metric-card/MetricCard.js +14 -14
- package/web-dist/components/missing-element/MissingElement.js +5 -5
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +15 -15
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +15 -15
- package/web-dist/components/otp-form/OtpForm.js +15 -15
- package/web-dist/components/pagination/Pagination.js +8 -8
- package/web-dist/components/palette-item/PaletteItem.js +14 -14
- package/web-dist/components/popover-menu/PopoverMenu.js +8 -8
- package/web-dist/components/post-card/PostCard.js +14 -14
- package/web-dist/components/product-card/ProductCard.js +14 -14
- package/web-dist/components/progress/Progress.js +5 -5
- package/web-dist/components/progress-ring/ProgressRing.js +5 -5
- package/web-dist/components/radio/Radio.js +8 -8
- package/web-dist/components/radio-group/RadioGroup.js +8 -8
- package/web-dist/components/rating/Rating.js +5 -5
- package/web-dist/components/reader/Reader.js +16 -16
- package/web-dist/components/scan-overlay/ScanOverlay.js +15 -15
- package/web-dist/components/screen/Screen.js +3 -3
- package/web-dist/components/screen-section/ScreenSection.js +5 -5
- package/web-dist/components/scroll-view/ScrollView.js +3 -3
- package/web-dist/components/search-input/SearchInput.js +8 -8
- package/web-dist/components/section-header/SectionHeader.js +5 -5
- package/web-dist/components/section-list/SectionList.js +7 -7
- package/web-dist/components/select/Select.js +13 -11
- package/web-dist/components/select/Select.types-0.d.ts +6 -0
- package/web-dist/components/selectable-item/SelectableItem.js +1 -1
- package/web-dist/components/selection-provider/SelectionProvider.js +1 -1
- package/web-dist/components/sign-in-form/SignInForm.js +15 -15
- package/web-dist/components/sign-up-form/SignUpForm.js +15 -15
- package/web-dist/components/skeleton/Skeleton.js +17 -17
- package/web-dist/components/skeleton-card/SkeletonCard.js +17 -17
- package/web-dist/components/skeleton-list/SkeletonList.js +17 -17
- package/web-dist/components/skeleton-text/SkeletonText.js +17 -17
- package/web-dist/components/surface/Surface.js +4 -4
- package/web-dist/components/switch/Switch.js +3 -3
- package/web-dist/components/tab/Tab.js +3 -3
- package/web-dist/components/tab-list/TabList.js +3 -3
- package/web-dist/components/tab-panel/TabPanel.js +3 -3
- package/web-dist/components/tabs/Tabs.js +3 -3
- package/web-dist/components/text/Text.js +2 -2
- package/web-dist/components/text-input/TextInput.js +8 -8
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +7 -7
- package/web-dist/components/time-picker/TimePicker.js +13 -13
- package/web-dist/components/timeline/Timeline.js +7 -7
- package/web-dist/components/toast/Toast.js +5 -5
- package/web-dist/components/toast-provider/ToastProvider.js +5 -5
- package/web-dist/components/toolbar/Toolbar.js +14 -14
- package/web-dist/components/tree-item/TreeItem.js +12 -12
- package/web-dist/components/uploader/Uploader.js +17 -17
- package/web-dist/components/view/View.js +3 -3
- package/web-dist/manifest.json +1055 -1030
- package/web-dist/runtime/ZoraProvider.js +4 -4
- /package/web-dist/chunks/{Accordion-6y42ws4p.js → Accordion-yskcfahv.js} +0 -0
|
@@ -122,6 +122,21 @@ export const selectMeta = {
|
|
|
122
122
|
default: 'Select',
|
|
123
123
|
authoring: { authority: 'instance' },
|
|
124
124
|
},
|
|
125
|
+
leadingIcon: {
|
|
126
|
+
type: 'media',
|
|
127
|
+
category: 'Content',
|
|
128
|
+
label: 'Leading SVG icon',
|
|
129
|
+
mediaKinds: ['image'],
|
|
130
|
+
authoring: { authority: 'instance' },
|
|
131
|
+
},
|
|
132
|
+
labelWeight: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
category: 'Style',
|
|
135
|
+
label: 'Label weight',
|
|
136
|
+
enum: ['semiBold', 'bold'],
|
|
137
|
+
default: 'semiBold',
|
|
138
|
+
authoring: { authority: 'instance' },
|
|
139
|
+
},
|
|
125
140
|
required: {
|
|
126
141
|
type: 'boolean',
|
|
127
142
|
category: 'State',
|
|
@@ -19,8 +19,11 @@ function ScreenInner({
|
|
|
19
19
|
const content = (
|
|
20
20
|
<View
|
|
21
21
|
alignSelf="center"
|
|
22
|
+
flex={scroll ? undefined : 1}
|
|
22
23
|
gap="l"
|
|
23
24
|
maxWidth={resolvePageMaxWidth(width)}
|
|
25
|
+
minHeight={scroll ? undefined : 0}
|
|
26
|
+
minWidth={scroll ? undefined : 0}
|
|
24
27
|
px={{ base: 16, md: 24, lg: 32 }}
|
|
25
28
|
py="xl"
|
|
26
29
|
testID={testID}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { UiNode } from '@ankhorage/contracts';
|
|
2
|
+
import { expect, mock, test } from 'bun:test';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
5
|
+
|
|
6
|
+
const runtimeEnvironment: { breakpoint: 'base' | 'md' } = { breakpoint: 'md' };
|
|
7
|
+
|
|
8
|
+
await mock.module('@ankhorage/surface', () => ({
|
|
9
|
+
Divider: () => <hr />,
|
|
10
|
+
Grid: ({ children }: React.PropsWithChildren) => <div>{children}</div>,
|
|
11
|
+
ScrollView: ({
|
|
12
|
+
children,
|
|
13
|
+
flex,
|
|
14
|
+
minHeight,
|
|
15
|
+
testID,
|
|
16
|
+
}: React.PropsWithChildren<{
|
|
17
|
+
readonly flex?: number;
|
|
18
|
+
readonly minHeight?: number;
|
|
19
|
+
readonly testID?: string;
|
|
20
|
+
}>) => (
|
|
21
|
+
<div data-flex={flex} data-min-height={minHeight} data-scroll={testID}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
),
|
|
25
|
+
ThemeScope: ({ children }: React.PropsWithChildren) => children,
|
|
26
|
+
View: ({
|
|
27
|
+
children,
|
|
28
|
+
flex,
|
|
29
|
+
minHeight,
|
|
30
|
+
minWidth,
|
|
31
|
+
testID,
|
|
32
|
+
}: React.PropsWithChildren<{
|
|
33
|
+
readonly flex?: number;
|
|
34
|
+
readonly minHeight?: number;
|
|
35
|
+
readonly minWidth?: number;
|
|
36
|
+
readonly testID?: string;
|
|
37
|
+
}>) => (
|
|
38
|
+
<div data-flex={flex} data-min-height={minHeight} data-min-width={minWidth} data-view={testID}>
|
|
39
|
+
{children}
|
|
40
|
+
</div>
|
|
41
|
+
),
|
|
42
|
+
useBreakpoint: () => runtimeEnvironment.breakpoint,
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
await mock.module('react-native', () => ({
|
|
46
|
+
StyleSheet: { create: <T,>(styles: T) => styles },
|
|
47
|
+
Text: ({ children }: React.PropsWithChildren) => <span>{children}</span>,
|
|
48
|
+
View: ({ children }: React.PropsWithChildren) => <div>{children}</div>,
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
const [{ RuntimeRenderer }, { MasterDetail }, { Screen }] = await Promise.all([
|
|
52
|
+
import('@ankhorage/runtime'),
|
|
53
|
+
import('./MasterDetail'),
|
|
54
|
+
import('../../../layout/adapters/inbound/Screen'),
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
const workspaceNode = {
|
|
58
|
+
id: 'screen',
|
|
59
|
+
type: 'Screen',
|
|
60
|
+
props: { scroll: false, testID: 'screen' },
|
|
61
|
+
children: [
|
|
62
|
+
{
|
|
63
|
+
id: 'workspace',
|
|
64
|
+
type: 'MasterDetail',
|
|
65
|
+
props: { activePane: 'master', masterWidth: 30, testID: 'workspace' },
|
|
66
|
+
children: [
|
|
67
|
+
{ id: 'master', type: 'Text', props: { children: 'Master content' } },
|
|
68
|
+
{ id: 'detail', type: 'Text', props: { children: 'Detail content' } },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
} as const satisfies UiNode;
|
|
73
|
+
|
|
74
|
+
/*** Renders the serializable Runtime UiNode through the ZORA presentation boundary. */
|
|
75
|
+
function renderWorkspace(node: UiNode): string {
|
|
76
|
+
return renderToStaticMarkup(
|
|
77
|
+
<RuntimeRenderer
|
|
78
|
+
isRoot
|
|
79
|
+
node={node}
|
|
80
|
+
registry={{
|
|
81
|
+
MasterDetail,
|
|
82
|
+
Screen,
|
|
83
|
+
Text: ({ children }: React.PropsWithChildren) => <span>{children}</span>,
|
|
84
|
+
}}
|
|
85
|
+
/>,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
test('renders both serializable MasterDetail children through RuntimeRenderer in a bounded 30/70 Screen', () => {
|
|
90
|
+
runtimeEnvironment.breakpoint = 'md';
|
|
91
|
+
const markup = renderWorkspace(workspaceNode);
|
|
92
|
+
|
|
93
|
+
expect(markup).toContain('Master content');
|
|
94
|
+
expect(markup).toContain('Detail content');
|
|
95
|
+
expect(markup).toContain('data-flex="30"');
|
|
96
|
+
expect(markup).toContain('data-flex="70"');
|
|
97
|
+
expect(markup).toContain('data-scroll="workspace-master"');
|
|
98
|
+
expect(markup).toContain('data-scroll="workspace-detail"');
|
|
99
|
+
expect(markup.match(/data-scroll=/gu)).toHaveLength(2);
|
|
100
|
+
expect(markup).toContain('data-min-height="0"');
|
|
101
|
+
expect(markup).toContain('data-view="screen"');
|
|
102
|
+
expect(markup).toContain('data-min-width="0"');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('projects the same Runtime children through host-owned compact pane state', () => {
|
|
106
|
+
runtimeEnvironment.breakpoint = 'base';
|
|
107
|
+
const markup = renderWorkspace({
|
|
108
|
+
...workspaceNode,
|
|
109
|
+
children: [
|
|
110
|
+
{
|
|
111
|
+
...workspaceNode.children[0],
|
|
112
|
+
props: { ...workspaceNode.children[0].props, activePane: 'detail' },
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
expect(markup).not.toContain('Master content');
|
|
118
|
+
expect(markup).toContain('Detail content');
|
|
119
|
+
expect(markup).toContain('data-scroll="workspace-detail"');
|
|
120
|
+
expect(markup).not.toContain('data-scroll="workspace-master"');
|
|
121
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useBreakpoint } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { MasterDetailProps } from '../../../../types/master-detail';
|
|
5
|
+
import { ScrollView, View } from '../../../layout/public';
|
|
6
|
+
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
7
|
+
import { resolveMasterDetailPresentation } from '../../application/resolveMasterDetailPresentation';
|
|
8
|
+
|
|
9
|
+
/** Renders responsive master and detail panes while leaving route transitions to the host. */
|
|
10
|
+
export const MasterDetail = withZoraThemeScope(MasterDetailInner);
|
|
11
|
+
|
|
12
|
+
/*** Projects the first two children into a desktop split or one compact route pane. */
|
|
13
|
+
function MasterDetailInner({
|
|
14
|
+
themeId: _themeId,
|
|
15
|
+
mode: _mode,
|
|
16
|
+
interactionPolicy: _interactionPolicy,
|
|
17
|
+
activePane = 'master',
|
|
18
|
+
desktopMode = 'split',
|
|
19
|
+
children,
|
|
20
|
+
masterWidth = 30,
|
|
21
|
+
testID,
|
|
22
|
+
}: MasterDetailProps) {
|
|
23
|
+
const presentation = resolveMasterDetailPresentation(useBreakpoint(), activePane, desktopMode);
|
|
24
|
+
const [master, detail] = React.Children.toArray(children);
|
|
25
|
+
const masterPane = <MasterPane master={master} testID={testID} />;
|
|
26
|
+
const detailPane = <DetailPane detail={detail} testID={testID} />;
|
|
27
|
+
|
|
28
|
+
if (presentation === 'master') return masterPane;
|
|
29
|
+
if (presentation === 'detail') return detailPane;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View direction="row" flex={1} minHeight={0} minWidth={0} testID={testID}>
|
|
33
|
+
<View flex={masterWidth} minHeight={0} minWidth={0}>
|
|
34
|
+
{masterPane}
|
|
35
|
+
</View>
|
|
36
|
+
<View flex={100 - masterWidth} minHeight={0} minWidth={0}>
|
|
37
|
+
{detailPane}
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/*** Provides the independently bounded master-list scroll region. */
|
|
44
|
+
function MasterPane({
|
|
45
|
+
master,
|
|
46
|
+
testID,
|
|
47
|
+
}: Pick<MasterDetailProps, 'testID'> & { master?: React.ReactNode }) {
|
|
48
|
+
return (
|
|
49
|
+
<ScrollView
|
|
50
|
+
flex={1}
|
|
51
|
+
minHeight={0}
|
|
52
|
+
minWidth={0}
|
|
53
|
+
testID={testID ? `${testID}-master` : undefined}
|
|
54
|
+
>
|
|
55
|
+
{master}
|
|
56
|
+
</ScrollView>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*** Provides the independently bounded detail scroll region. */
|
|
61
|
+
function DetailPane({
|
|
62
|
+
detail,
|
|
63
|
+
testID,
|
|
64
|
+
}: Pick<MasterDetailProps, 'testID'> & { detail?: React.ReactNode }) {
|
|
65
|
+
return (
|
|
66
|
+
<ScrollView
|
|
67
|
+
flex={1}
|
|
68
|
+
minHeight={0}
|
|
69
|
+
minWidth={0}
|
|
70
|
+
testID={testID ? `${testID}-detail` : undefined}
|
|
71
|
+
>
|
|
72
|
+
{detail}
|
|
73
|
+
</ScrollView>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { resolveMasterDetailPresentation } from './resolveMasterDetailPresentation';
|
|
4
|
+
|
|
5
|
+
test('projects host-owned compact route state below the desktop breakpoint', () => {
|
|
6
|
+
expect(resolveMasterDetailPresentation('base', 'master', 'split')).toBe('master');
|
|
7
|
+
expect(resolveMasterDetailPresentation('sm', 'detail', 'split')).toBe('detail');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('projects a 30/70 workspace at expanded breakpoints without changing compact route state', () => {
|
|
11
|
+
expect(resolveMasterDetailPresentation('md', 'detail', 'split')).toBe('split');
|
|
12
|
+
expect(resolveMasterDetailPresentation('lg', 'master', 'split')).toBe('split');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('permits a full-width master mode only at expanded breakpoints', () => {
|
|
16
|
+
expect(resolveMasterDetailPresentation('md', 'detail', 'master')).toBe('master');
|
|
17
|
+
expect(resolveMasterDetailPresentation('base', 'detail', 'master')).toBe('detail');
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Breakpoint } from '@ankhorage/surface';
|
|
2
|
+
|
|
3
|
+
import type { MasterDetailActivePane, MasterDetailDesktopMode } from '../../../types/master-detail';
|
|
4
|
+
|
|
5
|
+
export type MasterDetailPresentation = 'detail' | 'master' | 'split';
|
|
6
|
+
|
|
7
|
+
/*** Resolves the visual pane projection without changing host-owned route state. */
|
|
8
|
+
export function resolveMasterDetailPresentation(
|
|
9
|
+
breakpoint: Breakpoint,
|
|
10
|
+
activePane: MasterDetailActivePane,
|
|
11
|
+
desktopMode: MasterDetailDesktopMode,
|
|
12
|
+
): MasterDetailPresentation {
|
|
13
|
+
if (breakpoint === 'base' || breakpoint === 'sm') return activePane;
|
|
14
|
+
return desktopMode === 'master' ? 'master' : 'split';
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../constants/authoring';
|
|
2
|
+
import type { ZoraComponentMeta } from '../../types/authoring';
|
|
3
|
+
|
|
4
|
+
export const masterDetailMeta = {
|
|
5
|
+
name: 'MasterDetail',
|
|
6
|
+
category: 'layout',
|
|
7
|
+
directManifestNode: true,
|
|
8
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
9
|
+
description:
|
|
10
|
+
'Responsive visual projection for host-owned list and detail routes. Its first child is the master list and its second child is the detail pane. Place it as a direct child of a non-scrolling Screen. On expanded widths it displays both in independently scrolling panes; on compact widths it displays the pane selected by activePane.',
|
|
11
|
+
blueprint: {
|
|
12
|
+
label: 'Master detail',
|
|
13
|
+
defaultProps: { activePane: 'master', desktopMode: 'split', masterWidth: 30 },
|
|
14
|
+
},
|
|
15
|
+
bindings: {
|
|
16
|
+
props: {
|
|
17
|
+
activePane: {
|
|
18
|
+
label: 'Active compact pane',
|
|
19
|
+
description: 'Bind this to host-owned list or detail route state; ZORA does not navigate.',
|
|
20
|
+
value: { type: 'string' },
|
|
21
|
+
acceptsFallback: true,
|
|
22
|
+
acceptsTransforms: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
activePane: {
|
|
28
|
+
type: 'enum',
|
|
29
|
+
category: 'Navigation',
|
|
30
|
+
label: 'Active compact pane',
|
|
31
|
+
enum: ['master', 'detail'],
|
|
32
|
+
default: 'master',
|
|
33
|
+
},
|
|
34
|
+
desktopMode: {
|
|
35
|
+
type: 'enum',
|
|
36
|
+
category: 'Layout',
|
|
37
|
+
label: 'Desktop mode',
|
|
38
|
+
enum: ['split', 'master'],
|
|
39
|
+
default: 'split',
|
|
40
|
+
},
|
|
41
|
+
masterWidth: {
|
|
42
|
+
type: 'enum',
|
|
43
|
+
category: 'Layout',
|
|
44
|
+
label: 'Master width percent',
|
|
45
|
+
enum: [25, 30, 35, 40],
|
|
46
|
+
default: 30,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -57,6 +57,7 @@ import { Image } from '../image/public';
|
|
|
57
57
|
import { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';
|
|
58
58
|
import { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';
|
|
59
59
|
import { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';
|
|
60
|
+
import { MasterDetail } from '../master-detail/public';
|
|
60
61
|
import { MatrixGrid } from '../matrix-grid/public';
|
|
61
62
|
import { MissingElement } from '../missing-element/public';
|
|
62
63
|
import { Pagination } from '../pagination/public';
|
|
@@ -207,6 +208,7 @@ const _ZORA_BASE_COMPONENT_REGISTRY = {
|
|
|
207
208
|
TileGrid,
|
|
208
209
|
TimeGrid,
|
|
209
210
|
MatrixGrid,
|
|
211
|
+
MasterDetail,
|
|
210
212
|
MediaExplorer,
|
|
211
213
|
Hero,
|
|
212
214
|
List,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../constants/authoring';
|
|
3
4
|
import { ZORA_COLORS } from '../theme/colorModel';
|
|
4
5
|
import type { BarcodeScannerViewProps, ZoraComponentEventPayloadKind } from '.';
|
|
5
6
|
import { ZORA_COMPONENT_META } from '.';
|
|
@@ -301,6 +302,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
301
302
|
'GameOverlay',
|
|
302
303
|
'Surface',
|
|
303
304
|
'MediaCard',
|
|
305
|
+
'MasterDetail',
|
|
304
306
|
'FlatList',
|
|
305
307
|
'SectionList',
|
|
306
308
|
'BottomSheet',
|
|
@@ -524,6 +526,20 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
524
526
|
expect(keyboardAvoidingView.props.behavior?.enum).toEqual(['height', 'position', 'padding']);
|
|
525
527
|
});
|
|
526
528
|
|
|
529
|
+
test('MasterDetail uses RuntimeRenderer children for its serializable pane content', () => {
|
|
530
|
+
const masterDetail = ZORA_COMPONENT_META.MasterDetail;
|
|
531
|
+
expect(masterDetail.directManifestNode).toBe(true);
|
|
532
|
+
expect(masterDetail.allowedChildren).toEqual(CONTAINER_ALLOWED_CHILDREN);
|
|
533
|
+
expect(masterDetail.props.activePane?.enum).toEqual(['master', 'detail']);
|
|
534
|
+
expect(masterDetail.props.masterWidth?.enum).toEqual([25, 30, 35, 40]);
|
|
535
|
+
expect(masterDetail.slots).toBeUndefined();
|
|
536
|
+
expect(masterDetail.bindings?.props?.activePane).toMatchObject({
|
|
537
|
+
acceptsFallback: true,
|
|
538
|
+
acceptsTransforms: true,
|
|
539
|
+
value: { type: 'string' },
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
|
|
527
543
|
test('Progress is a direct manifest leaf with serializable defaults', () => {
|
|
528
544
|
expect(ZORA_COMPONENT_META.Progress.directManifestNode).toBe(true);
|
|
529
545
|
expect(ZORA_COMPONENT_META.Progress.allowedChildren).toEqual([]);
|
|
@@ -70,6 +70,7 @@ import { viewMeta } from '../layout/viewMeta';
|
|
|
70
70
|
import { flatListMeta } from '../list/flatListMeta';
|
|
71
71
|
import { listItemMeta, listMeta, listSectionMeta } from '../list/meta';
|
|
72
72
|
import { sectionListMeta } from '../list/sectionListMeta';
|
|
73
|
+
import { masterDetailMeta } from '../master-detail/masterDetailMeta';
|
|
73
74
|
import { matrixGridMeta } from '../matrix-grid/meta';
|
|
74
75
|
import { missingElementMeta } from '../missing-element/missingElementMeta';
|
|
75
76
|
import { paginationMeta } from '../pagination/paginationMeta';
|
|
@@ -156,6 +157,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
156
157
|
IconButton: iconButtonMeta,
|
|
157
158
|
Image: imageMeta,
|
|
158
159
|
KeyboardAvoidingView: keyboardAvoidingViewMeta,
|
|
160
|
+
MasterDetail: masterDetailMeta,
|
|
159
161
|
TextInput: textInputMeta,
|
|
160
162
|
MediaCard: mediaCardMeta,
|
|
161
163
|
MetricCard: metricCardMeta,
|
|
@@ -54,6 +54,8 @@ test('existing interactive authoring retains bindings in core metadata', () => {
|
|
|
54
54
|
type: 'object',
|
|
55
55
|
});
|
|
56
56
|
expect(meta.BottomSheet?.bindings?.props?.open?.value.type).toBe('boolean');
|
|
57
|
+
expect(meta.MasterDetail?.bindings?.props?.activePane?.value.type).toBe('string');
|
|
58
|
+
expect(meta.MasterDetail?.bindings?.props?.activePane?.acceptsTransforms).toBe(true);
|
|
57
59
|
});
|
|
58
60
|
|
|
59
61
|
test('final ownership data components retain bindings in core metadata', () => {
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ZoraThemeProvenanceEntry,
|
|
13
13
|
ZoraThemeSelectionResult,
|
|
14
14
|
ZoraThemeSelectionTarget,
|
|
15
|
-
} from '
|
|
15
|
+
} from '#zora/types/theme';
|
|
16
16
|
|
|
17
17
|
const CONTRACTS_OWNER = '@ankhorage/contracts';
|
|
18
18
|
const COLOR_THEORY_OWNER = '@ankhorage/color-theory';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseHexColorOrThrow } from '@ankhorage/color-theory';
|
|
2
2
|
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
5
|
+
import type { ZoraTheme } from '#zora/types/theme';
|
|
6
6
|
|
|
7
7
|
/*** Convert the concise ZORA design seed into canonical persisted theme source. */
|
|
8
8
|
export function createZoraThemeConfig(theme: ZoraTheme = zoraDefaultTheme): ThemeConfig {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { compileZoraTheme } from '#zora/theme/application/use-cases/compileZoraTheme';
|
|
2
|
+
export { createZoraThemeConfig } from '#zora/theme/application/use-cases/createZoraThemeConfig';
|
|
3
|
+
export { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
1
4
|
export type {
|
|
2
5
|
ZoraComputedTheme,
|
|
3
6
|
ZoraComputedThemeMode,
|
|
@@ -12,7 +15,4 @@ export type {
|
|
|
12
15
|
ZoraThemeSelectionTarget,
|
|
13
16
|
ZoraThemeSwatchRole,
|
|
14
17
|
ZoraThemeValueOrigin,
|
|
15
|
-
} from '
|
|
16
|
-
export { compileZoraTheme } from './application/use-cases/compileZoraTheme.ts';
|
|
17
|
-
export { createZoraThemeConfig } from './application/use-cases/createZoraThemeConfig.ts';
|
|
18
|
-
export { zoraDefaultTheme } from './zoraDefaultTheme.ts';
|
|
18
|
+
} from '#zora/types/theme';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
3
|
|
|
4
4
|
import { expect, test } from 'bun:test';
|
|
5
|
-
import * as ts from 'typescript';
|
|
6
5
|
|
|
7
6
|
const themeRoot = import.meta.dir;
|
|
8
7
|
const sourceModules = [
|
|
@@ -12,30 +11,36 @@ const sourceModules = [
|
|
|
12
11
|
'zoraDefaultTheme.ts',
|
|
13
12
|
] as const;
|
|
14
13
|
|
|
15
|
-
test('keeps theme source imports resolvable
|
|
16
|
-
const
|
|
17
|
-
readonly
|
|
14
|
+
test('keeps theme source imports resolvable through package-owned conditional targets', () => {
|
|
15
|
+
const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) as {
|
|
16
|
+
readonly imports?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
const themeTargets = packageJson.imports?.['#zora/theme/*'];
|
|
19
|
+
const typeTargets = packageJson.imports?.['#zora/types/*'];
|
|
20
|
+
|
|
21
|
+
expect(themeTargets).toEqual({
|
|
22
|
+
types: './dist/features/theme/*.d.ts',
|
|
23
|
+
'react-native': './src/features/theme/*.ts',
|
|
24
|
+
browser: './src/features/theme/*.ts',
|
|
25
|
+
import: './dist/features/theme/*.js',
|
|
26
|
+
default: './dist/features/theme/*.js',
|
|
27
|
+
});
|
|
28
|
+
expect(typeTargets).toEqual({
|
|
29
|
+
types: './dist/types/*.d.ts',
|
|
30
|
+
import: './dist/types/*.js',
|
|
31
|
+
default: './dist/types/*.js',
|
|
32
|
+
});
|
|
20
33
|
|
|
21
34
|
for (const modulePath of sourceModules) {
|
|
22
35
|
const filename = resolve(themeRoot, modulePath);
|
|
23
36
|
const source = readFileSync(filename, 'utf8');
|
|
24
|
-
const
|
|
37
|
+
const sourceImports = [
|
|
38
|
+
...source.matchAll(/\bfrom\s+['"](#zora\/(?:theme|types)\/[^'"]+)['"]/gu),
|
|
39
|
+
];
|
|
25
40
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
expect(
|
|
41
|
+
expect(sourceImports.length, modulePath).toBeGreaterThan(0);
|
|
42
|
+
for (const [, specifier] of sourceImports) {
|
|
43
|
+
expect(specifier, modulePath).toMatch(/^#zora\/(?:theme|types)\//u);
|
|
29
44
|
}
|
|
30
|
-
|
|
31
|
-
const emitted = ts.transpileModule(source, {
|
|
32
|
-
fileName: filename,
|
|
33
|
-
compilerOptions: {
|
|
34
|
-
module: ts.ModuleKind.ESNext,
|
|
35
|
-
rewriteRelativeImportExtensions: true,
|
|
36
|
-
target: ts.ScriptTarget.ES2022,
|
|
37
|
-
},
|
|
38
|
-
}).outputText;
|
|
39
|
-
expect(emitted).not.toMatch(/\bfrom\s+['"][^'"]+\.ts['"]/u);
|
|
40
45
|
}
|
|
41
46
|
});
|
package/src/index.ts
CHANGED
|
@@ -30,6 +30,13 @@ export type {
|
|
|
30
30
|
ColorWheelSelection,
|
|
31
31
|
} from './features/color/public';
|
|
32
32
|
export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
|
|
33
|
+
export type {
|
|
34
|
+
MasterDetailActivePane,
|
|
35
|
+
MasterDetailDesktopMode,
|
|
36
|
+
MasterDetailMasterWidth,
|
|
37
|
+
MasterDetailProps,
|
|
38
|
+
} from './features/master-detail/public';
|
|
39
|
+
export { MasterDetail } from './features/master-detail/public';
|
|
33
40
|
export type {
|
|
34
41
|
ReaderColorScheme,
|
|
35
42
|
ReaderDocumentFormat,
|
package/src/readerFree.ts
CHANGED
|
@@ -346,6 +346,13 @@ export type {
|
|
|
346
346
|
} from './features/list/public';
|
|
347
347
|
export { FlatList, SectionList } from './features/list/public';
|
|
348
348
|
export { List, ListItem, ListSection } from './features/list/public';
|
|
349
|
+
export type {
|
|
350
|
+
MasterDetailActivePane,
|
|
351
|
+
MasterDetailDesktopMode,
|
|
352
|
+
MasterDetailMasterWidth,
|
|
353
|
+
MasterDetailProps,
|
|
354
|
+
} from './features/master-detail/public';
|
|
355
|
+
export { MasterDetail } from './features/master-detail/public';
|
|
349
356
|
export type { MatrixGridProps } from './features/matrix-grid/public';
|
|
350
357
|
export { MatrixGrid } from './features/matrix-grid/public';
|
|
351
358
|
export { MissingElement, type MissingElementProps } from './features/missing-element/public';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ZoraBaseProps } from './base';
|
|
4
|
+
|
|
5
|
+
/** Identifies the compact pane selected by host-owned route state. */
|
|
6
|
+
export type MasterDetailActivePane = 'master' | 'detail';
|
|
7
|
+
|
|
8
|
+
/** Controls the expanded-width presentation without changing route state. */
|
|
9
|
+
export type MasterDetailDesktopMode = 'split' | 'master';
|
|
10
|
+
|
|
11
|
+
/** Limits the master column to readable workspace proportions. */
|
|
12
|
+
export type MasterDetailMasterWidth = 25 | 30 | 35 | 40;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Presentation-only workspace composition. Place it as a direct child of a non-scrolling Screen
|
|
16
|
+
* so its panes own bounded scrolling. The host supplies activePane from its route state; ZORA
|
|
17
|
+
* never creates routes or handles back navigation.
|
|
18
|
+
*/
|
|
19
|
+
export interface MasterDetailProps extends ZoraBaseProps {
|
|
20
|
+
/** The first child is the master pane and the second child is the detail pane. */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
activePane?: MasterDetailActivePane;
|
|
23
|
+
desktopMode?: MasterDetailDesktopMode;
|
|
24
|
+
masterWidth?: MasterDetailMasterWidth;
|
|
25
|
+
}
|
package/src/types/select.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';
|
|
2
|
+
|
|
1
3
|
import type { ZoraBaseProps } from './base';
|
|
2
4
|
|
|
3
5
|
export interface SelectOption<TValue extends string = string> {
|
|
@@ -15,6 +17,10 @@ export interface SelectProps<TValue extends string = string> extends ZoraBasePro
|
|
|
15
17
|
helperText?: string;
|
|
16
18
|
errorText?: string;
|
|
17
19
|
placeholder?: string;
|
|
20
|
+
/** Optional Surface icon source rendered before the trigger label. */
|
|
21
|
+
leadingIcon?: ButtonIconSpec;
|
|
22
|
+
/** Optional Surface Button label emphasis; defaults to semiBold. */
|
|
23
|
+
labelWeight?: ButtonLabelWeight;
|
|
18
24
|
required?: boolean;
|
|
19
25
|
disabled?: boolean;
|
|
20
26
|
readOnly?: boolean;
|
|
@@ -8,23 +8,23 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
resolvePointerEvents,
|
|
10
10
|
View3
|
|
11
|
-
} from "./Accordion-
|
|
11
|
+
} from "./Accordion-w1ag7sr4.js";
|
|
12
12
|
import {
|
|
13
13
|
useTheme
|
|
14
14
|
} from "./Accordion-ng79nxzz.js";
|
|
15
15
|
import {
|
|
16
16
|
Surface3
|
|
17
|
-
} from "./Accordion-
|
|
17
|
+
} from "./Accordion-rt4jfq2r.js";
|
|
18
18
|
import {
|
|
19
19
|
withZoraThemeScope
|
|
20
20
|
} from "./Accordion-hqg1zbxk.js";
|
|
21
21
|
import {
|
|
22
22
|
View2
|
|
23
|
-
} from "./Accordion-
|
|
23
|
+
} from "./Accordion-v21vz0cg.js";
|
|
24
24
|
import {
|
|
25
25
|
Heading2,
|
|
26
26
|
Text3
|
|
27
|
-
} from "./Accordion-
|
|
27
|
+
} from "./Accordion-1mjn0atk.js";
|
|
28
28
|
import {
|
|
29
29
|
resolveOverlayAnimation
|
|
30
30
|
} from "./Accordion-6ec4gxv2.js";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./Accordion-hqg1zbxk.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon2
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-0jkpvxwd.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-v21vz0cg.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-1mjn0atk.js";
|
|
14
14
|
import {
|
|
15
15
|
useZoraTheme2
|
|
16
16
|
} from "./Accordion-j5wsx41j.js";
|