@ankhorage/zora 14.0.1 → 16.0.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 -1
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js +28 -27
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -1
- package/dist/features/app-bar/public.d.ts +1 -1
- package/dist/features/app-bar/public.d.ts.map +1 -1
- package/dist/features/app-bar/public.js.map +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/public.d.ts +2 -2
- package/dist/features/bottom-sheet/public.d.ts.map +1 -1
- package/dist/features/bottom-sheet/public.js +1 -1
- package/dist/features/bottom-sheet/public.js.map +1 -1
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts +5 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts.map +1 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js +81 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts +119 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js +94 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js.map +1 -0
- package/dist/features/breadcrumbs/public.d.ts +3 -0
- package/dist/features/breadcrumbs/public.d.ts.map +1 -0
- package/dist/features/breadcrumbs/public.js +2 -0
- package/dist/features/breadcrumbs/public.js.map +1 -0
- 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/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +4 -2
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/dialog/adapters/inbound/Dialog.d.ts +5 -0
- package/dist/features/dialog/adapters/inbound/Dialog.d.ts.map +1 -0
- package/dist/features/dialog/adapters/inbound/Dialog.js +45 -0
- package/dist/features/dialog/adapters/inbound/Dialog.js.map +1 -0
- package/dist/features/dialog/dialogMeta.d.ts +87 -0
- package/dist/features/dialog/dialogMeta.d.ts.map +1 -0
- package/dist/features/dialog/dialogMeta.js +59 -0
- package/dist/features/dialog/dialogMeta.js.map +1 -0
- package/dist/features/dialog/public.d.ts +3 -0
- package/dist/features/dialog/public.d.ts.map +1 -0
- package/dist/features/dialog/public.js +2 -0
- package/dist/features/dialog/public.js.map +1 -0
- package/dist/features/form/formFieldMeta.d.ts +1 -1
- package/dist/features/form/formFieldMeta.d.ts.map +1 -1
- package/dist/features/form/formFieldMeta.js +8 -1
- package/dist/features/form/formFieldMeta.js.map +1 -1
- package/dist/features/form/radio/utils/resolveRadioGroupThemeRecipe.d.ts +1 -1
- package/dist/features/form/search-input/adapters/inbound/SearchInput.d.ts +4 -0
- package/dist/features/form/search-input/adapters/inbound/SearchInput.d.ts.map +1 -0
- package/dist/{components/search-bar/SearchBar.js → features/form/search-input/adapters/inbound/SearchInput.js} +8 -10
- package/dist/features/form/search-input/adapters/inbound/SearchInput.js.map +1 -0
- package/dist/features/form/search-input/public.d.ts +3 -0
- package/dist/features/form/search-input/public.d.ts.map +1 -0
- package/dist/features/form/search-input/public.js +2 -0
- package/dist/features/form/search-input/public.js.map +1 -0
- package/dist/features/form/search-input/searchInputMeta.d.ts +126 -0
- package/dist/features/form/search-input/searchInputMeta.d.ts.map +1 -0
- package/dist/features/form/search-input/searchInputMeta.js +67 -0
- package/dist/features/form/search-input/searchInputMeta.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.d.ts +2 -0
- package/dist/features/form/select/adapters/inbound/Select.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.js +2 -0
- package/dist/features/form/select/adapters/inbound/Select.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js +42 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js +31 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -0
- package/dist/features/form/select/composition/SelectField.d.ts +10 -0
- package/dist/features/form/select/composition/SelectField.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectField.js +8 -0
- package/dist/features/form/select/composition/SelectField.js.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts +12 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.js +9 -0
- package/dist/features/form/select/composition/SelectOptionRow.js.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts +10 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.js +9 -0
- package/dist/features/form/select/composition/SelectTrigger.js.map +1 -0
- package/dist/features/form/select/composition/useSelectController.d.ts +8 -0
- package/dist/features/form/select/composition/useSelectController.d.ts.map +1 -0
- package/dist/features/form/select/composition/useSelectController.js +15 -0
- package/dist/features/form/select/composition/useSelectController.js.map +1 -0
- package/dist/features/form/select/public.d.ts +3 -0
- package/dist/features/form/select/public.d.ts.map +1 -0
- package/dist/features/form/select/public.js +2 -0
- package/dist/features/form/select/public.js.map +1 -0
- package/dist/features/form/select/selectMeta.d.ts +195 -0
- package/dist/features/form/select/selectMeta.d.ts.map +1 -0
- package/dist/features/form/select/selectMeta.js +152 -0
- package/dist/features/form/select/selectMeta.js.map +1 -0
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/boxMeta.d.ts +1 -1
- package/dist/features/layout/containerMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/stackMeta.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/pagination/adapters/inbound/Pagination.d.ts +5 -0
- package/dist/features/pagination/adapters/inbound/Pagination.d.ts.map +1 -0
- package/dist/features/pagination/adapters/inbound/Pagination.js +43 -0
- package/dist/features/pagination/adapters/inbound/Pagination.js.map +1 -0
- package/dist/features/pagination/paginationMeta.d.ts +118 -0
- package/dist/features/pagination/paginationMeta.d.ts.map +1 -0
- package/dist/features/pagination/paginationMeta.js +53 -0
- package/dist/features/pagination/paginationMeta.js.map +1 -0
- package/dist/features/pagination/public.d.ts +3 -0
- package/dist/features/pagination/public.d.ts.map +1 -0
- package/dist/features/pagination/public.js +2 -0
- package/dist/features/pagination/public.js.map +1 -0
- package/dist/features/pagination/utils/resolvePaginationPage.d.ts +3 -0
- package/dist/features/pagination/utils/resolvePaginationPage.d.ts.map +1 -0
- package/dist/features/pagination/utils/resolvePaginationPage.js +7 -0
- package/dist/features/pagination/utils/resolvePaginationPage.js.map +1 -0
- package/dist/features/pagination/utils/resolvePaginationState.d.ts +17 -0
- package/dist/features/pagination/utils/resolvePaginationState.d.ts.map +1 -0
- package/dist/features/pagination/utils/resolvePaginationState.js +34 -0
- package/dist/features/pagination/utils/resolvePaginationState.js.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts +5 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +43 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.js +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.js.map +1 -0
- package/dist/features/popover-menu/public.d.ts +3 -0
- package/dist/features/popover-menu/public.d.ts.map +1 -0
- package/dist/features/popover-menu/public.js +2 -0
- package/dist/features/popover-menu/public.js.map +1 -0
- package/dist/features/rating/adapters/inbound/Rating.d.ts +4 -0
- package/dist/features/rating/adapters/inbound/Rating.d.ts.map +1 -0
- package/dist/features/rating/adapters/inbound/Rating.js +49 -0
- package/dist/features/rating/adapters/inbound/Rating.js.map +1 -0
- package/dist/features/rating/public.d.ts +3 -0
- package/dist/features/rating/public.d.ts.map +1 -0
- package/dist/features/rating/public.js +2 -0
- package/dist/features/rating/public.js.map +1 -0
- package/dist/features/rating/ratingMeta.d.ts +57 -0
- package/dist/features/rating/ratingMeta.d.ts.map +1 -0
- package/dist/features/rating/ratingMeta.js +43 -0
- package/dist/features/rating/ratingMeta.js.map +1 -0
- package/dist/features/rating/utils/resolveRatingSegments.d.ts +9 -0
- package/dist/features/rating/utils/resolveRatingSegments.d.ts.map +1 -0
- package/dist/features/rating/utils/resolveRatingSegments.js +14 -0
- package/dist/features/rating/utils/resolveRatingSegments.js.map +1 -0
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/adapters/inbound/Tab.d.ts +5 -0
- package/dist/features/tabs/adapters/inbound/Tab.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tab.js +14 -0
- package/dist/features/tabs/adapters/inbound/Tab.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabList.d.ts +4 -0
- package/dist/features/tabs/adapters/inbound/TabList.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabList.js +9 -0
- package/dist/features/tabs/adapters/inbound/TabList.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.d.ts +4 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.js +11 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tabs.d.ts +4 -0
- package/dist/features/tabs/adapters/inbound/Tabs.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tabs.js +12 -0
- package/dist/features/tabs/adapters/inbound/Tabs.js.map +1 -0
- package/dist/features/tabs/composition/TabsInteractionPolicyContext.d.ts +3 -0
- package/dist/features/tabs/composition/TabsInteractionPolicyContext.d.ts.map +1 -0
- package/dist/features/tabs/composition/TabsInteractionPolicyContext.js +3 -0
- package/dist/features/tabs/composition/TabsInteractionPolicyContext.js.map +1 -0
- package/dist/features/tabs/public.d.ts +6 -0
- package/dist/features/tabs/public.d.ts.map +1 -0
- package/dist/features/tabs/public.js +5 -0
- package/dist/features/tabs/public.js.map +1 -0
- package/dist/features/tabs/tabListMeta.d.ts +9 -0
- package/dist/features/tabs/tabListMeta.d.ts.map +1 -0
- package/dist/features/tabs/tabListMeta.js +9 -0
- package/dist/features/tabs/tabListMeta.js.map +1 -0
- package/dist/features/tabs/tabMeta.d.ts +32 -0
- package/dist/features/tabs/tabMeta.d.ts.map +1 -0
- package/dist/features/tabs/tabMeta.js +14 -0
- package/dist/features/tabs/tabMeta.js.map +1 -0
- package/dist/features/tabs/tabPanelMeta.d.ts +15 -0
- package/dist/features/tabs/tabPanelMeta.d.ts.map +1 -0
- package/dist/features/tabs/tabPanelMeta.js +12 -0
- package/dist/features/tabs/tabPanelMeta.js.map +1 -0
- package/dist/features/tabs/tabsMeta.d.ts +58 -0
- package/dist/features/tabs/tabsMeta.d.ts.map +1 -0
- package/dist/features/tabs/tabsMeta.js +40 -0
- package/dist/features/tabs/tabsMeta.js.map +1 -0
- package/dist/features/toolbar/adapters/inbound/Toolbar.d.ts +4 -0
- package/dist/features/toolbar/adapters/inbound/Toolbar.d.ts.map +1 -0
- package/dist/features/toolbar/adapters/inbound/Toolbar.js +14 -0
- package/dist/features/toolbar/adapters/inbound/Toolbar.js.map +1 -0
- package/dist/features/toolbar/public.d.ts +3 -0
- package/dist/features/toolbar/public.d.ts.map +1 -0
- package/dist/features/toolbar/public.js +2 -0
- package/dist/features/toolbar/public.js.map +1 -0
- package/dist/features/toolbar/toolbarMeta.d.ts +29 -0
- package/dist/features/toolbar/toolbarMeta.d.ts.map +1 -0
- package/dist/features/toolbar/toolbarMeta.js +22 -0
- package/dist/features/toolbar/toolbarMeta.js.map +1 -0
- package/dist/features/typography/utils/resolveHeadingThemeRecipe.d.ts +1 -1
- package/dist/features/typography/utils/resolveTextThemeRecipe.d.ts +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.d.ts.map +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.js +3 -3
- package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -1
- package/dist/index.d.ts +10 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/layout/screen/meta.d.ts +1 -1
- package/dist/layout/screen-section/meta.d.ts +1 -1
- package/dist/metadata/allowedChildren.d.ts +3 -3
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +6 -0
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +3 -4
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +1 -2
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +18 -14
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +3 -3
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/patterns/theme-composer/ThemeComposer.d.ts.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +4 -4
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +15 -14
- package/dist/registry.js.map +1 -1
- package/dist/types/app-bar.d.ts +6 -3
- package/dist/types/app-bar.d.ts.map +1 -1
- package/dist/types/app-bar.js.map +1 -1
- package/dist/{components/breadcrumbs/types.d.ts → types/breadcrumbs.d.ts} +8 -6
- package/dist/types/breadcrumbs.d.ts.map +1 -0
- package/dist/types/breadcrumbs.js +2 -0
- package/dist/types/breadcrumbs.js.map +1 -0
- package/dist/types/data-table.d.ts +2 -2
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/dialog.d.ts +14 -0
- package/dist/types/dialog.d.ts.map +1 -0
- package/dist/types/dialog.js +2 -0
- package/dist/types/dialog.js.map +1 -0
- package/dist/types/pagination.d.ts +16 -0
- package/dist/types/pagination.d.ts.map +1 -0
- package/dist/types/pagination.js +2 -0
- package/dist/types/pagination.js.map +1 -0
- package/dist/types/popover-menu.d.ts +24 -0
- package/dist/types/popover-menu.d.ts.map +1 -0
- package/dist/types/popover-menu.js +2 -0
- package/dist/types/popover-menu.js.map +1 -0
- package/dist/types/rating.d.ts +9 -0
- package/dist/types/rating.d.ts.map +1 -0
- package/dist/types/rating.js +2 -0
- package/dist/types/rating.js.map +1 -0
- package/dist/types/search-input.d.ts +14 -0
- package/dist/types/search-input.d.ts.map +1 -0
- package/dist/types/search-input.js +2 -0
- package/dist/types/search-input.js.map +1 -0
- package/dist/types/select.d.ts +22 -0
- package/dist/types/select.d.ts.map +1 -0
- package/dist/types/select.js +2 -0
- package/dist/types/select.js.map +1 -0
- package/dist/types/tabs.d.ts +21 -0
- package/dist/types/tabs.d.ts.map +1 -0
- package/dist/types/tabs.js +2 -0
- package/dist/types/tabs.js.map +1 -0
- package/dist/types/toolbar.d.ts +8 -0
- package/dist/types/toolbar.d.ts.map +1 -0
- package/dist/types/toolbar.js +2 -0
- package/dist/types/toolbar.js.map +1 -0
- package/package.json +2 -4
- package/src/audit.test.ts +8 -47
- package/src/constants.ts +5 -0
- package/src/featureManifest.test.ts +31 -2
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +50 -42
- package/src/features/app-bar/public.ts +1 -1
- package/src/features/bottom-sheet/public.test.ts +10 -1
- package/src/features/bottom-sheet/public.ts +9 -1
- package/src/features/breadcrumbs/adapters/inbound/Breadcrumbs.tsx +179 -0
- package/src/features/breadcrumbs/breadcrumbsMeta.ts +95 -0
- package/src/features/breadcrumbs/public.test.ts +22 -0
- package/src/features/breadcrumbs/public.ts +6 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +9 -5
- package/src/features/dialog/adapters/inbound/Dialog.tsx +70 -0
- package/src/features/dialog/dialogMeta.ts +60 -0
- package/src/features/dialog/public.ts +2 -0
- package/src/features/form/formFieldMeta.ts +8 -1
- package/src/{components/search-bar/SearchBar.tsx → features/form/search-input/adapters/inbound/SearchInput.tsx} +10 -15
- package/src/features/form/search-input/public.ts +2 -0
- package/src/features/form/search-input/searchInputMeta.ts +68 -0
- package/src/features/form/select/adapters/inbound/Select.native.tsx +78 -0
- package/src/features/form/select/adapters/inbound/Select.tsx +1 -0
- package/src/features/form/select/adapters/inbound/Select.web.tsx +63 -0
- package/src/features/form/select/composition/SelectField.tsx +27 -0
- package/src/features/form/select/composition/SelectOptionRow.tsx +36 -0
- package/src/features/form/select/composition/SelectTrigger.tsx +32 -0
- package/src/features/form/select/composition/useSelectController.ts +21 -0
- package/src/features/form/select/public.test.ts +25 -0
- package/src/features/form/select/public.ts +2 -0
- package/src/features/form/select/selectMeta.ts +154 -0
- package/src/features/pagination/adapters/inbound/Pagination.tsx +116 -0
- package/src/features/pagination/paginationMeta.ts +54 -0
- package/src/features/pagination/public.ts +2 -0
- package/src/features/pagination/utils/resolvePaginationPage.ts +6 -0
- package/src/features/pagination/utils/resolvePaginationState.test.ts +29 -0
- package/src/features/pagination/utils/resolvePaginationState.ts +70 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +60 -0
- package/src/{components/rating/meta.ts → features/popover-menu/popoverMenuMeta.ts} +3 -3
- package/src/features/popover-menu/public.test.ts +11 -0
- package/src/features/popover-menu/public.ts +6 -0
- package/src/features/rating/adapters/inbound/Rating.tsx +70 -0
- package/src/features/rating/public.ts +2 -0
- package/src/features/rating/ratingMeta.ts +44 -0
- package/src/features/rating/utils/resolveRatingSegments.test.ts +20 -0
- package/src/features/rating/utils/resolveRatingSegments.ts +19 -0
- package/src/features/tabs/adapters/inbound/Tab.tsx +26 -0
- package/src/features/tabs/adapters/inbound/TabList.tsx +18 -0
- package/src/features/tabs/adapters/inbound/TabPanel.tsx +23 -0
- package/src/features/tabs/adapters/inbound/Tabs.tsx +23 -0
- package/src/features/tabs/composition/TabsInteractionPolicyContext.ts +4 -0
- package/src/features/tabs/public.ts +5 -0
- package/src/features/tabs/tabListMeta.ts +10 -0
- package/src/features/tabs/tabMeta.ts +15 -0
- package/src/features/tabs/tabPanelMeta.ts +13 -0
- package/src/features/tabs/tabsMeta.ts +41 -0
- package/src/features/toolbar/adapters/inbound/Toolbar.tsx +31 -0
- package/src/features/toolbar/public.ts +2 -0
- package/src/features/toolbar/toolbarMeta.ts +24 -0
- package/src/{components → features/typography}/contentFallback.test.ts +2 -8
- package/src/features/uploader/adapters/inbound/Uploader.tsx +3 -3
- package/src/index.ts +29 -19
- package/src/interactionPolicy.test.ts +19 -21
- package/src/metadata/allowedChildren.ts +6 -0
- package/src/metadata/bindableComponentMeta.test.ts +8 -0
- package/src/metadata/bindableComponentMeta.ts +1 -2
- package/src/metadata/componentMeta.test.ts +21 -1
- package/src/metadata/componentMeta.ts +18 -14
- package/src/nativePeerContract.test.ts +5 -19
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +3 -3
- package/src/patterns/theme-composer/ThemeComposer.tsx +7 -8
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.ts +15 -14
- package/src/showcaseCoverage.test.ts +6 -3
- package/src/theme/themeScopeStructure.test.ts +24 -14
- package/src/types/app-bar.ts +6 -3
- package/src/{components/breadcrumbs/types.ts → types/breadcrumbs.ts} +8 -5
- package/src/types/data-table.ts +2 -2
- package/src/types/dialog.ts +15 -0
- package/src/{components/pagination/types.ts → types/pagination.ts} +5 -8
- package/src/types/popover-menu.ts +31 -0
- package/src/types/rating.ts +9 -0
- package/src/types/search-input.ts +14 -0
- package/src/{components/select/types.ts → types/select.ts} +11 -3
- package/src/types/tabs.ts +25 -0
- package/src/types/toolbar.ts +9 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +0 -7
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +0 -80
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/index.d.ts +0 -3
- package/dist/components/breadcrumbs/index.d.ts.map +0 -1
- package/dist/components/breadcrumbs/index.js +0 -2
- package/dist/components/breadcrumbs/index.js.map +0 -1
- package/dist/components/breadcrumbs/meta.d.ts +0 -9
- package/dist/components/breadcrumbs/meta.d.ts.map +0 -1
- package/dist/components/breadcrumbs/meta.js +0 -9
- package/dist/components/breadcrumbs/meta.js.map +0 -1
- package/dist/components/breadcrumbs/types.d.ts.map +0 -1
- package/dist/components/breadcrumbs/types.js +0 -2
- package/dist/components/breadcrumbs/types.js.map +0 -1
- package/dist/components/menu/DropdownMenu.d.ts +0 -7
- package/dist/components/menu/DropdownMenu.d.ts.map +0 -1
- package/dist/components/menu/DropdownMenu.js +0 -9
- package/dist/components/menu/DropdownMenu.js.map +0 -1
- package/dist/components/menu/Menu.d.ts +0 -7
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/Menu.js +0 -46
- package/dist/components/menu/Menu.js.map +0 -1
- package/dist/components/menu/index.d.ts +0 -4
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js +0 -3
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/menu/meta.d.ts +0 -17
- package/dist/components/menu/meta.d.ts.map +0 -1
- package/dist/components/menu/meta.js +0 -17
- package/dist/components/menu/meta.js.map +0 -1
- package/dist/components/menu/types.d.ts +0 -22
- package/dist/components/menu/types.d.ts.map +0 -1
- package/dist/components/menu/types.js +0 -2
- package/dist/components/menu/types.js.map +0 -1
- package/dist/components/modal/Modal.d.ts +0 -7
- package/dist/components/modal/Modal.d.ts.map +0 -1
- package/dist/components/modal/Modal.js +0 -39
- package/dist/components/modal/Modal.js.map +0 -1
- package/dist/components/modal/index.d.ts +0 -3
- package/dist/components/modal/index.d.ts.map +0 -1
- package/dist/components/modal/index.js +0 -2
- package/dist/components/modal/index.js.map +0 -1
- package/dist/components/modal/meta.d.ts +0 -9
- package/dist/components/modal/meta.d.ts.map +0 -1
- package/dist/components/modal/meta.js +0 -9
- package/dist/components/modal/meta.js.map +0 -1
- package/dist/components/modal/types.d.ts +0 -12
- package/dist/components/modal/types.d.ts.map +0 -1
- package/dist/components/modal/types.js +0 -2
- package/dist/components/modal/types.js.map +0 -1
- package/dist/components/pagination/Pagination.d.ts +0 -7
- package/dist/components/pagination/Pagination.d.ts.map +0 -1
- package/dist/components/pagination/Pagination.js +0 -96
- package/dist/components/pagination/Pagination.js.map +0 -1
- package/dist/components/pagination/index.d.ts +0 -3
- package/dist/components/pagination/index.d.ts.map +0 -1
- package/dist/components/pagination/index.js +0 -2
- package/dist/components/pagination/index.js.map +0 -1
- package/dist/components/pagination/meta.d.ts +0 -9
- package/dist/components/pagination/meta.d.ts.map +0 -1
- package/dist/components/pagination/meta.js +0 -9
- package/dist/components/pagination/meta.js.map +0 -1
- package/dist/components/pagination/types.d.ts +0 -18
- package/dist/components/pagination/types.d.ts.map +0 -1
- package/dist/components/pagination/types.js +0 -2
- package/dist/components/pagination/types.js.map +0 -1
- package/dist/components/rating/Rating.d.ts +0 -7
- package/dist/components/rating/Rating.d.ts.map +0 -1
- package/dist/components/rating/Rating.js +0 -26
- package/dist/components/rating/Rating.js.map +0 -1
- package/dist/components/rating/index.d.ts +0 -3
- package/dist/components/rating/index.d.ts.map +0 -1
- package/dist/components/rating/index.js +0 -2
- package/dist/components/rating/index.js.map +0 -1
- package/dist/components/rating/meta.d.ts +0 -9
- package/dist/components/rating/meta.d.ts.map +0 -1
- package/dist/components/rating/meta.js +0 -9
- package/dist/components/rating/meta.js.map +0 -1
- package/dist/components/rating/resolveRatingSegments.d.ts +0 -7
- package/dist/components/rating/resolveRatingSegments.d.ts.map +0 -1
- package/dist/components/rating/resolveRatingSegments.js +0 -22
- package/dist/components/rating/resolveRatingSegments.js.map +0 -1
- package/dist/components/rating/types.d.ts +0 -11
- package/dist/components/rating/types.d.ts.map +0 -1
- package/dist/components/rating/types.js +0 -26
- package/dist/components/rating/types.js.map +0 -1
- package/dist/components/search-bar/SearchBar.d.ts +0 -7
- package/dist/components/search-bar/SearchBar.d.ts.map +0 -1
- package/dist/components/search-bar/SearchBar.js.map +0 -1
- package/dist/components/search-bar/index.d.ts +0 -3
- package/dist/components/search-bar/index.d.ts.map +0 -1
- package/dist/components/search-bar/index.js +0 -2
- package/dist/components/search-bar/index.js.map +0 -1
- package/dist/components/search-bar/meta.d.ts +0 -9
- package/dist/components/search-bar/meta.d.ts.map +0 -1
- package/dist/components/search-bar/meta.js +0 -9
- package/dist/components/search-bar/meta.js.map +0 -1
- package/dist/components/search-bar/types.d.ts +0 -14
- package/dist/components/search-bar/types.d.ts.map +0 -1
- package/dist/components/search-bar/types.js +0 -2
- package/dist/components/search-bar/types.js.map +0 -1
- package/dist/components/select/Select.d.ts +0 -7
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/Select.js +0 -32
- package/dist/components/select/Select.js.map +0 -1
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/meta.d.ts +0 -9
- package/dist/components/select/meta.d.ts.map +0 -1
- package/dist/components/select/meta.js +0 -9
- package/dist/components/select/meta.js.map +0 -1
- package/dist/components/select/types.d.ts +0 -14
- package/dist/components/select/types.d.ts.map +0 -1
- package/dist/components/select/types.js +0 -2
- package/dist/components/select/types.js.map +0 -1
- package/dist/components/tabs/Tabs.d.ts +0 -9
- package/dist/components/tabs/Tabs.d.ts.map +0 -1
- package/dist/components/tabs/Tabs.js +0 -59
- package/dist/components/tabs/Tabs.js.map +0 -1
- package/dist/components/tabs/index.d.ts +0 -3
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js +0 -3
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/tabs/meta.d.ts +0 -9
- package/dist/components/tabs/meta.d.ts.map +0 -1
- package/dist/components/tabs/meta.js +0 -9
- package/dist/components/tabs/meta.js.map +0 -1
- package/dist/components/tabs/types.d.ts +0 -22
- package/dist/components/tabs/types.d.ts.map +0 -1
- package/dist/components/tabs/types.js +0 -2
- package/dist/components/tabs/types.js.map +0 -1
- package/dist/components/toolbar/Toolbar.d.ts +0 -9
- package/dist/components/toolbar/Toolbar.d.ts.map +0 -1
- package/dist/components/toolbar/Toolbar.js +0 -26
- package/dist/components/toolbar/Toolbar.js.map +0 -1
- package/dist/components/toolbar/ToolbarAction.d.ts +0 -9
- package/dist/components/toolbar/ToolbarAction.d.ts.map +0 -1
- package/dist/components/toolbar/ToolbarAction.js +0 -13
- package/dist/components/toolbar/ToolbarAction.js.map +0 -1
- package/dist/components/toolbar/index.d.ts +0 -4
- package/dist/components/toolbar/index.d.ts.map +0 -1
- package/dist/components/toolbar/index.js +0 -4
- package/dist/components/toolbar/index.js.map +0 -1
- package/dist/components/toolbar/meta.d.ts +0 -17
- package/dist/components/toolbar/meta.d.ts.map +0 -1
- package/dist/components/toolbar/meta.js +0 -17
- package/dist/components/toolbar/meta.js.map +0 -1
- package/dist/components/toolbar/types.d.ts +0 -18
- package/dist/components/toolbar/types.d.ts.map +0 -1
- package/dist/components/toolbar/types.js +0 -2
- package/dist/components/toolbar/types.js.map +0 -1
- package/src/components/breadcrumbs/Breadcrumbs.tsx +0 -147
- package/src/components/breadcrumbs/index.ts +0 -2
- package/src/components/breadcrumbs/meta.ts +0 -10
- package/src/components/menu/DropdownMenu.tsx +0 -11
- package/src/components/menu/Menu.tsx +0 -59
- package/src/components/menu/index.ts +0 -3
- package/src/components/menu/meta.ts +0 -19
- package/src/components/menu/types.ts +0 -31
- package/src/components/modal/Modal.tsx +0 -63
- package/src/components/modal/index.ts +0 -2
- package/src/components/modal/meta.ts +0 -10
- package/src/components/modal/types.ts +0 -16
- package/src/components/pagination/Pagination.tsx +0 -199
- package/src/components/pagination/index.ts +0 -2
- package/src/components/pagination/meta.ts +0 -10
- package/src/components/rating/Rating.tsx +0 -42
- package/src/components/rating/index.ts +0 -2
- package/src/components/rating/resolveRatingSegments.test.ts +0 -60
- package/src/components/rating/resolveRatingSegments.ts +0 -34
- package/src/components/rating/types.ts +0 -37
- package/src/components/search-bar/index.ts +0 -2
- package/src/components/search-bar/meta.ts +0 -10
- package/src/components/search-bar/types.ts +0 -14
- package/src/components/select/Select.tsx +0 -67
- package/src/components/select/index.ts +0 -2
- package/src/components/select/meta.ts +0 -10
- package/src/components/tabs/Tabs.tsx +0 -129
- package/src/components/tabs/index.ts +0 -2
- package/src/components/tabs/meta.ts +0 -10
- package/src/components/tabs/types.ts +0 -25
- package/src/components/toolbar/Toolbar.tsx +0 -48
- package/src/components/toolbar/ToolbarAction.tsx +0 -28
- package/src/components/toolbar/index.ts +0 -3
- package/src/components/toolbar/meta.ts +0 -19
- package/src/components/toolbar/types.ts +0 -21
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
3
|
+
export interface TabsProps extends ZoraBaseProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface TabListProps extends ZoraBaseProps {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface TabProps extends ZoraBaseProps {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TabPanelProps extends ZoraBaseProps {
|
|
18
|
+
value: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,QAAS,SAAQ,aAAa;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\n\nexport interface TabsProps extends ZoraBaseProps {\n children?: React.ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport interface TabListProps extends ZoraBaseProps {\n children?: React.ReactNode;\n}\n\nexport interface TabProps extends ZoraBaseProps {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface TabPanelProps extends ZoraBaseProps {\n value: string;\n children?: React.ReactNode;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
3
|
+
export interface ToolbarProps extends ZoraBaseProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
floating?: boolean;
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/types/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../src/types/toolbar.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../theme/ZoraBaseProps';\n\nexport interface ToolbarProps extends ZoraBaseProps {\n children?: React.ReactNode;\n floating?: boolean;\n compact?: boolean;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.0.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"components"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@react-native-picker/picker": "2.11.4",
|
|
29
28
|
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
30
29
|
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
31
30
|
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@ankhorage/color-theory": "^0.3.0",
|
|
44
43
|
"@ankhorage/contracts": "^12.0.1",
|
|
45
|
-
"@ankhorage/surface": "^
|
|
44
|
+
"@ankhorage/surface": "^5.0.0",
|
|
46
45
|
"@ankhorage/utility": "^0.8.0",
|
|
47
46
|
"expo-document-picker": "~57.0.1",
|
|
48
47
|
"expo-image-picker": "~57.0.16"
|
|
@@ -117,7 +116,6 @@
|
|
|
117
116
|
"devDependencies": {
|
|
118
117
|
"@ankhorage/devtools": "^1.13.0",
|
|
119
118
|
"@ankhorage/paradox": "^0.1.24",
|
|
120
|
-
"@react-native-picker/picker": "2.11.4",
|
|
121
119
|
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
122
120
|
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
123
121
|
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
package/src/audit.test.ts
CHANGED
|
@@ -120,62 +120,23 @@ describe('Plan 5 audit — no showcase bridge or direct Surface imports in examp
|
|
|
120
120
|
|
|
121
121
|
describe('Plan 5 audit — product-facing src imports ZORA foundation, not Surface directly', () => {
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
* foundation primitives from
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* Foundation wrappers, theme infrastructure, internal recipes, and explicit
|
|
128
|
-
* Surface-wrapping boundary components are exempt.
|
|
123
|
+
* Features, layouts, and patterns that compose ZORA primitives should import
|
|
124
|
+
* foundation primitives from ZORA, not directly from @ankhorage/surface.
|
|
125
|
+
* The feature-owned layout adapters are the deliberate Surface foundation boundary.
|
|
129
126
|
*/
|
|
130
|
-
const
|
|
131
|
-
// Foundation wrappers — they ARE the Surface abstraction layer.
|
|
132
|
-
join(SRC_ROOT, 'foundation'),
|
|
133
|
-
// Theme infrastructure legitimately integrates with Surface theme/runtime types.
|
|
134
|
-
join(SRC_ROOT, 'theme'),
|
|
135
|
-
// Internal recipes may consume SurfaceTheme types as the typed recipe boundary.
|
|
136
|
-
join(SRC_ROOT, 'internal'),
|
|
137
|
-
// Explicit Surface primitive wrappers.
|
|
138
|
-
join(SRC_ROOT, 'components', 'checkbox', 'Checkbox.tsx'),
|
|
139
|
-
join(SRC_ROOT, 'features', 'icon', 'adapters', 'inbound', 'Icon.tsx'),
|
|
140
|
-
join(SRC_ROOT, 'features', 'button', 'adapters', 'inbound', 'IconButton.tsx'),
|
|
141
|
-
join(SRC_ROOT, 'components', 'modal', 'Modal.tsx'),
|
|
142
|
-
join(SRC_ROOT, 'features', 'form', 'text-input', 'adapters', 'inbound', 'TextInput.tsx'),
|
|
143
|
-
join(SRC_ROOT, 'features', 'typography', 'adapters', 'inbound', 'Text.tsx'),
|
|
144
|
-
join(SRC_ROOT, 'features', 'form', 'adapters', 'inbound', 'FormField.tsx'),
|
|
145
|
-
// Type-only imports that intentionally expose Surface-compatible prop specs.
|
|
146
|
-
join(SRC_ROOT, 'components', 'checkbox', 'types.ts'),
|
|
147
|
-
join(SRC_ROOT, 'types', 'form.ts'),
|
|
148
|
-
join(SRC_ROOT, 'types', 'icon-button.ts'),
|
|
149
|
-
join(SRC_ROOT, 'components', 'tabs', 'types.ts'),
|
|
150
|
-
join(SRC_ROOT, 'types', 'text.ts'),
|
|
151
|
-
join(SRC_ROOT, 'components', 'textarea', 'types.ts'),
|
|
152
|
-
join(SRC_ROOT, 'components', 'toolbar', 'types.ts'),
|
|
153
|
-
join(SRC_ROOT, 'patterns', 'tile-grid', 'types.ts'),
|
|
154
|
-
]);
|
|
155
|
-
|
|
156
|
-
function isExempt(filePath: string): boolean {
|
|
157
|
-
for (const exemptPath of EXEMPT_PATHS) {
|
|
158
|
-
if (isPathWithin(filePath, exemptPath)) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
|
|
127
|
+
const SURFACE_FOUNDATION_BOUNDARY = join(SRC_ROOT, 'features', 'layout');
|
|
166
128
|
const PRODUCT_FACING_DIRS = [
|
|
167
|
-
join(SRC_ROOT, '
|
|
129
|
+
join(SRC_ROOT, 'features'),
|
|
168
130
|
join(SRC_ROOT, 'layout'),
|
|
169
131
|
join(SRC_ROOT, 'patterns'),
|
|
170
132
|
];
|
|
171
|
-
|
|
172
133
|
const FOUNDATION_PRIMITIVES_PATTERN =
|
|
173
134
|
/import \{[^}]*\b(Box|Stack|Center|Container|Grid|Inline|Spacer|Divider)\b[^}]*\} from '@ankhorage\/surface'/;
|
|
174
135
|
|
|
175
|
-
test('
|
|
136
|
+
test('feature, layout, and pattern files do not import foundation primitives directly from @ankhorage/surface', () => {
|
|
176
137
|
for (const dir of PRODUCT_FACING_DIRS) {
|
|
177
138
|
for (const filePath of listFiles(dir)) {
|
|
178
|
-
if (
|
|
139
|
+
if (isPathWithin(filePath, SURFACE_FOUNDATION_BOUNDARY)) continue;
|
|
179
140
|
|
|
180
141
|
const source = readFileSync(filePath, 'utf8');
|
|
181
142
|
const match = FOUNDATION_PRIMITIVES_PATTERN.exec(source);
|
|
@@ -183,7 +144,7 @@ describe('Plan 5 audit — product-facing src imports ZORA foundation, not Surfa
|
|
|
183
144
|
expect(
|
|
184
145
|
match,
|
|
185
146
|
`${filePath} imports Surface foundation primitive '${match?.[1]}' directly. ` +
|
|
186
|
-
|
|
147
|
+
'Use the feature-owned ZORA layout/foundation API instead.',
|
|
187
148
|
).toBeNull();
|
|
188
149
|
}
|
|
189
150
|
}
|
package/src/constants.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const FEATURE_MANIFEST_ELEMENTS = {
|
|
|
20
20
|
chip: ['Chip', 'ChipGroup'],
|
|
21
21
|
'data-table': ['DataTable'],
|
|
22
22
|
'date-picker': ['DatePicker'],
|
|
23
|
+
dialog: ['Dialog'],
|
|
23
24
|
form: ['Form', 'FormError', 'FormField'],
|
|
24
25
|
gradient: ['Gradient'],
|
|
25
26
|
button: ['Button', 'IconButton', 'ButtonGroup'],
|
|
@@ -28,7 +29,11 @@ export const FEATURE_MANIFEST_ELEMENTS = {
|
|
|
28
29
|
'keyboard-avoiding-view': ['KeyboardAvoidingView'],
|
|
29
30
|
layout: ['Box', 'Container', 'ContentRail', 'Divider', 'Grid', 'Stack'],
|
|
30
31
|
list: ['FlatList', 'SectionList'],
|
|
32
|
+
pagination: ['Pagination'],
|
|
33
|
+
rating: ['Rating'],
|
|
31
34
|
skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],
|
|
35
|
+
tabs: ['Tabs', 'TabList', 'Tab', 'TabPanel'],
|
|
36
|
+
toolbar: ['Toolbar'],
|
|
32
37
|
typography: ['Heading', 'Text'],
|
|
33
38
|
'time-picker': ['TimePicker'],
|
|
34
39
|
uploader: ['Uploader'],
|
|
@@ -12,13 +12,19 @@ test('every selected feature element is directly authorable through its canonica
|
|
|
12
12
|
const source = await Bun.file(`src/features/${family}/public.ts`).text();
|
|
13
13
|
for (const name of names) {
|
|
14
14
|
const meta = catalog.get(name);
|
|
15
|
+
const hasAuthorableShape =
|
|
16
|
+
Object.keys(meta?.props ?? {}).length > 0 || (meta?.allowedChildren.length ?? 0) > 0;
|
|
15
17
|
expect(meta?.directManifestNode, name).toBe(true);
|
|
16
|
-
expect(
|
|
18
|
+
expect(hasAuthorableShape, name).toBe(true);
|
|
17
19
|
expect(source, name).toContain(name);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
|
|
24
|
+
test('feature ownership has no remaining legacy components directory', () => {
|
|
25
|
+
expect(existsSync('src/components')).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
|
|
22
28
|
test('form composition has one canonical feature owner', () => {
|
|
23
29
|
expect(existsSync('src/components/form')).toBe(false);
|
|
24
30
|
expect(existsSync('src/patterns/form-field')).toBe(false);
|
|
@@ -38,7 +44,7 @@ test('migrated picker and presentation elements have one canonical feature owner
|
|
|
38
44
|
}
|
|
39
45
|
});
|
|
40
46
|
|
|
41
|
-
test('interactive authoring retains
|
|
47
|
+
test('existing interactive authoring retains bindings after plugin composition', () => {
|
|
42
48
|
const meta = ZORA_CORE_PLUGIN_METADATA.componentMeta;
|
|
43
49
|
expect(meta.DataTable?.bindings?.props?.sort?.value.type).toBe('object');
|
|
44
50
|
expect(meta.DataTable?.bindings?.props?.rows?.value.type).toBe('array');
|
|
@@ -48,6 +54,29 @@ test('interactive authoring retains state and event payload bindings after plugi
|
|
|
48
54
|
type: 'object',
|
|
49
55
|
});
|
|
50
56
|
expect(meta.BottomSheet?.bindings?.props?.open?.value.type).toBe('boolean');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('final ownership data components retain bindings after plugin composition', () => {
|
|
60
|
+
const meta = ZORA_CORE_PLUGIN_METADATA.componentMeta;
|
|
61
|
+
expect(meta.Dialog?.bindings?.props?.visible?.value.type).toBe('boolean');
|
|
62
|
+
expect(meta.Dialog?.bindings?.events?.dismiss?.payload?.eventType).toBe('dialog.dismiss');
|
|
63
|
+
expect(meta.Pagination?.bindings?.props?.page?.value.type).toBe('number');
|
|
64
|
+
expect(meta.Pagination?.bindings?.events?.pageChange?.payload?.eventType).toBe(
|
|
65
|
+
'pagination.pageChange',
|
|
66
|
+
);
|
|
67
|
+
expect(meta.Rating?.bindings?.props?.value?.value.type).toBe('number');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('final ownership form and tab components retain bindings after plugin composition', () => {
|
|
71
|
+
const meta = ZORA_CORE_PLUGIN_METADATA.componentMeta;
|
|
72
|
+
expect(meta.SearchInput?.bindings?.props?.value?.value.type).toBe('string');
|
|
73
|
+
expect(meta.SearchInput?.bindings?.events?.submit?.payload?.eventType).toBe('searchInput.submit');
|
|
74
|
+
expect(meta.Tabs?.bindings?.props?.value?.value.type).toBe('string');
|
|
75
|
+
expect(meta.Tabs?.bindings?.events?.valueChange?.payload?.eventType).toBe('tabs.valueChange');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('existing scalar authoring bindings remain available after plugin composition', () => {
|
|
79
|
+
const meta = ZORA_CORE_PLUGIN_METADATA.componentMeta;
|
|
51
80
|
expect(meta.Heading?.bindings?.props?.level?.value.type).toBe('number');
|
|
52
81
|
expect(meta.Image?.bindings?.props?.radius?.value.type).toBe('unknown');
|
|
53
82
|
});
|
|
@@ -4,35 +4,15 @@ import React from 'react';
|
|
|
4
4
|
import { Inline } from '../../../../foundation';
|
|
5
5
|
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
6
6
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
7
|
-
import type { AppBarMode,
|
|
7
|
+
import type { AppBarMode, AppBarOverflowMenu, AppBarProps } from '../../../../types/app-bar';
|
|
8
8
|
import { IconButton } from '../../../button/public';
|
|
9
9
|
import { Box, Stack } from '../../../layout/public';
|
|
10
|
+
import { PopoverMenu } from '../../../popover-menu/public';
|
|
10
11
|
import { Heading, Text } from '../../../typography/public';
|
|
11
12
|
|
|
12
13
|
const DEFAULT_CANCEL_ICON = { name: 'close-outline' } satisfies ButtonIconSpec;
|
|
13
14
|
const DEFAULT_OVERFLOW_ICON = { name: 'ellipsis-vertical' } satisfies ButtonIconSpec;
|
|
14
15
|
|
|
15
|
-
/*** Resolves the effective AppBar mode. */
|
|
16
|
-
function resolveMode(mode: AppBarMode | undefined): AppBarMode {
|
|
17
|
-
return mode ?? { type: 'default' };
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/*** Formats the active selection label with its optional count. */
|
|
21
|
-
function resolveSelectionLabel({ count, label }: { count?: number; label: string }): string {
|
|
22
|
-
if (count === undefined) return label;
|
|
23
|
-
return `${label} (${count})`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/*** Resolves the accessible label for the overflow action. */
|
|
27
|
-
function resolveOverflowLabel(overflow: AppBarOverflowAction): string {
|
|
28
|
-
return overflow.label ?? 'More options';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/*** Resolves the accessible label for leaving selection mode. */
|
|
32
|
-
function resolveCancelLabel(mode: Extract<AppBarMode, { type: 'selection' }>): string {
|
|
33
|
-
return mode.cancelLabel ?? 'Cancel selection';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
16
|
/*** Renders a top app bar with title/subtitle and optional leading/trailing actions. */
|
|
37
17
|
export const AppBar = withZoraThemeScope(AppBarInner);
|
|
38
18
|
|
|
@@ -56,8 +36,8 @@ function AppBarInner({
|
|
|
56
36
|
const resolvedMode = resolveMode(appMode);
|
|
57
37
|
const isSelectionMode = resolvedMode.type === 'selection';
|
|
58
38
|
const resolvedLeading = leading ?? resolveSelectionLeading(resolvedMode, interactionPolicy);
|
|
59
|
-
const
|
|
60
|
-
const resolvedTrailing = resolveTrailing(actions,
|
|
39
|
+
const overflowMenu = resolveOverflowMenu(overflow, interactionPolicy, testID);
|
|
40
|
+
const resolvedTrailing = resolveTrailing(actions, overflowMenu);
|
|
61
41
|
const resolvedCenter = resolveCenter({
|
|
62
42
|
children,
|
|
63
43
|
isSelectionMode,
|
|
@@ -80,6 +60,27 @@ function AppBarInner({
|
|
|
80
60
|
);
|
|
81
61
|
}
|
|
82
62
|
|
|
63
|
+
/*** Resolves the effective AppBar mode. */
|
|
64
|
+
function resolveMode(mode: AppBarMode | undefined): AppBarMode {
|
|
65
|
+
return mode ?? { type: 'default' };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*** Formats the active selection label with its optional count. */
|
|
69
|
+
function resolveSelectionLabel({ count, label }: { count?: number; label: string }): string {
|
|
70
|
+
if (count === undefined) return label;
|
|
71
|
+
return `${label} (${count})`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/*** Resolves the accessible label for the overflow menu trigger. */
|
|
75
|
+
function resolveOverflowLabel(overflow: AppBarOverflowMenu): string {
|
|
76
|
+
return overflow.label ?? 'More options';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*** Resolves the accessible label for leaving selection mode. */
|
|
80
|
+
function resolveCancelLabel(mode: Extract<AppBarMode, { type: 'selection' }>): string {
|
|
81
|
+
return mode.cancelLabel ?? 'Cancel selection';
|
|
82
|
+
}
|
|
83
|
+
|
|
83
84
|
/*** Resolves the selection action shown at the leading edge. */
|
|
84
85
|
function resolveSelectionLeading(
|
|
85
86
|
mode: AppBarMode,
|
|
@@ -100,37 +101,44 @@ function resolveSelectionLeading(
|
|
|
100
101
|
);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
/*** Resolves the optional overflow action. */
|
|
104
|
-
function
|
|
105
|
-
overflow:
|
|
104
|
+
/*** Resolves the optional AppBar overflow action menu. */
|
|
105
|
+
function resolveOverflowMenu(
|
|
106
|
+
overflow: AppBarOverflowMenu | undefined,
|
|
106
107
|
interactionPolicy: AppBarProps['interactionPolicy'],
|
|
108
|
+
testID: string | undefined,
|
|
107
109
|
): React.ReactNode {
|
|
108
|
-
if (
|
|
110
|
+
if (overflow === undefined || overflow.actions.length === 0) return null;
|
|
109
111
|
|
|
110
112
|
return (
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
icon={overflow.icon ?? DEFAULT_OVERFLOW_ICON}
|
|
113
|
+
<PopoverMenu
|
|
114
|
+
actions={overflow.actions}
|
|
115
|
+
closeOnSelect={overflow.closeOnSelect}
|
|
115
116
|
interactionPolicy={interactionPolicy}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
onDismiss={overflow.onDismiss}
|
|
118
|
+
testID={testID ? `${testID}-overflow` : undefined}
|
|
119
|
+
trigger={({ toggle }) => (
|
|
120
|
+
<IconButton
|
|
121
|
+
color="neutral"
|
|
122
|
+
disabled={overflow.disabled}
|
|
123
|
+
icon={overflow.icon ?? DEFAULT_OVERFLOW_ICON}
|
|
124
|
+
interactionPolicy={interactionPolicy}
|
|
125
|
+
label={resolveOverflowLabel(overflow)}
|
|
126
|
+
onPress={toggle}
|
|
127
|
+
size="m"
|
|
128
|
+
variant="ghost"
|
|
129
|
+
/>
|
|
130
|
+
)}
|
|
120
131
|
/>
|
|
121
132
|
);
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
/*** Composes trailing actions and overflow controls. */
|
|
125
|
-
function resolveTrailing(
|
|
126
|
-
actions
|
|
127
|
-
overflowButton: React.ReactNode,
|
|
128
|
-
): React.ReactNode {
|
|
129
|
-
if (!actions && !overflowButton) return undefined;
|
|
136
|
+
function resolveTrailing(actions: React.ReactNode, overflowMenu: React.ReactNode): React.ReactNode {
|
|
137
|
+
if (!actions && !overflowMenu) return undefined;
|
|
130
138
|
return (
|
|
131
139
|
<Inline align="center" gap="s" wrap="nowrap">
|
|
132
140
|
{actions}
|
|
133
|
-
{
|
|
141
|
+
{overflowMenu}
|
|
134
142
|
</Inline>
|
|
135
143
|
);
|
|
136
144
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AppBarMode,
|
|
1
|
+
export type { AppBarMode, AppBarOverflowMenu, AppBarProps } from '../../types/app-bar';
|
|
2
2
|
export { AppBar } from './adapters/inbound/AppBar';
|
|
@@ -10,8 +10,17 @@ describe('ZORA BottomSheet public contract', () => {
|
|
|
10
10
|
const source = await Bun.file('src/features/bottom-sheet/public.ts').text();
|
|
11
11
|
|
|
12
12
|
expect(packageJson.exports['./bottom-sheet']).toBeDefined();
|
|
13
|
-
expect(packageJson.dependencies['@ankhorage/surface']).toMatch(/^\^
|
|
13
|
+
expect(packageJson.dependencies['@ankhorage/surface']).toMatch(/^\^5\./u);
|
|
14
14
|
expect(source).toContain("from '@ankhorage/surface/bottom-sheet'");
|
|
15
|
+
for (const name of [
|
|
16
|
+
'BottomSheetFlatList',
|
|
17
|
+
'BottomSheetScrollView',
|
|
18
|
+
'BottomSheetSectionList',
|
|
19
|
+
'BottomSheetView',
|
|
20
|
+
'BottomSheetVirtualizedList',
|
|
21
|
+
]) {
|
|
22
|
+
expect(source).toContain(name);
|
|
23
|
+
}
|
|
15
24
|
const {
|
|
16
25
|
'react-native-gesture-handler': gestureHandlerPeer,
|
|
17
26
|
'react-native-reanimated': reanimatedPeer,
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export type { BottomSheetProps } from '../../types/manifest-bottom-sheet';
|
|
2
2
|
export { BottomSheet } from './adapters/inbound/BottomSheet';
|
|
3
3
|
export type {
|
|
4
|
+
BottomSheetContentMode,
|
|
4
5
|
BottomSheetController,
|
|
5
6
|
BottomSheetPresentOptions,
|
|
6
7
|
} from '@ankhorage/surface/bottom-sheet';
|
|
7
|
-
export {
|
|
8
|
+
export {
|
|
9
|
+
BottomSheetFlatList,
|
|
10
|
+
BottomSheetScrollView,
|
|
11
|
+
BottomSheetSectionList,
|
|
12
|
+
BottomSheetView,
|
|
13
|
+
BottomSheetVirtualizedList,
|
|
14
|
+
useBottomSheet,
|
|
15
|
+
} from '@ankhorage/surface/bottom-sheet';
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Inline } from '../../../../foundation';
|
|
4
|
+
import { resolveIconSize } from '../../../../internal/recipes';
|
|
5
|
+
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
6
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
7
|
+
import type {
|
|
8
|
+
BreadcrumbItem,
|
|
9
|
+
BreadcrumbPressEvent,
|
|
10
|
+
BreadcrumbsProps,
|
|
11
|
+
} from '../../../../types/breadcrumbs';
|
|
12
|
+
import { Button } from '../../../button/public';
|
|
13
|
+
import { Icon } from '../../../icon/public';
|
|
14
|
+
import { Text } from '../../../typography/public';
|
|
15
|
+
|
|
16
|
+
/*** Renders a breadcrumb trail whose final item represents the current location. */
|
|
17
|
+
export const Breadcrumbs = withZoraThemeScope(BreadcrumbsInner);
|
|
18
|
+
|
|
19
|
+
type BreadcrumbRenderItem =
|
|
20
|
+
| {
|
|
21
|
+
item: BreadcrumbItem;
|
|
22
|
+
type: 'item';
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
type: 'ellipsis';
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/*** Connects serializable breadcrumb items to the component-level item press event. */
|
|
29
|
+
function BreadcrumbsInner({
|
|
30
|
+
themeId: _themeId,
|
|
31
|
+
mode: _mode,
|
|
32
|
+
interactionPolicy,
|
|
33
|
+
items,
|
|
34
|
+
separator = '/',
|
|
35
|
+
maxItems,
|
|
36
|
+
compact = false,
|
|
37
|
+
disabled = false,
|
|
38
|
+
onItemPress,
|
|
39
|
+
testID,
|
|
40
|
+
}: BreadcrumbsProps) {
|
|
41
|
+
const normalizedMaxItems = normalizeMaxItems(maxItems);
|
|
42
|
+
const renderItems = createRenderItems(items, normalizedMaxItems);
|
|
43
|
+
const currentItemId = items.at(-1)?.id;
|
|
44
|
+
|
|
45
|
+
if (items.length === 0) return null;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Inline align="center" gap={compact ? 'xs' : 's'} testID={testID} wrap="wrap">
|
|
49
|
+
{renderItems.map((renderItem, index) => {
|
|
50
|
+
const showSeparator = index !== renderItems.length - 1;
|
|
51
|
+
|
|
52
|
+
if (renderItem.type === 'ellipsis') {
|
|
53
|
+
return (
|
|
54
|
+
<React.Fragment key="ellipsis">
|
|
55
|
+
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
56
|
+
…
|
|
57
|
+
</Text>
|
|
58
|
+
{showSeparator ? renderSeparator(separator) : null}
|
|
59
|
+
</React.Fragment>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<BreadcrumbItemView
|
|
65
|
+
compact={compact}
|
|
66
|
+
current={renderItem.item.id === currentItemId}
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
interactionPolicy={interactionPolicy}
|
|
69
|
+
item={renderItem.item}
|
|
70
|
+
key={renderItem.item.id}
|
|
71
|
+
onItemPress={onItemPress}
|
|
72
|
+
separator={showSeparator ? separator : undefined}
|
|
73
|
+
testID={testID}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
})}
|
|
77
|
+
</Inline>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*** Renders one breadcrumb item and its optional following separator. */
|
|
82
|
+
function BreadcrumbItemView({
|
|
83
|
+
compact,
|
|
84
|
+
current,
|
|
85
|
+
disabled,
|
|
86
|
+
interactionPolicy,
|
|
87
|
+
item,
|
|
88
|
+
onItemPress,
|
|
89
|
+
separator,
|
|
90
|
+
testID,
|
|
91
|
+
}: {
|
|
92
|
+
compact: boolean;
|
|
93
|
+
current: boolean;
|
|
94
|
+
disabled: boolean;
|
|
95
|
+
interactionPolicy: BreadcrumbsProps['interactionPolicy'];
|
|
96
|
+
item: BreadcrumbItem;
|
|
97
|
+
onItemPress: ((event: BreadcrumbPressEvent) => void) | undefined;
|
|
98
|
+
separator: string | undefined;
|
|
99
|
+
testID: string | undefined;
|
|
100
|
+
}) {
|
|
101
|
+
const interactive = !current && !disabled && !item.disabled && onItemPress !== undefined;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
{interactive ? (
|
|
106
|
+
<Button
|
|
107
|
+
color="neutral"
|
|
108
|
+
interactionPolicy={interactionPolicy}
|
|
109
|
+
leadingIcon={item.icon}
|
|
110
|
+
onPress={() => onItemPress({ id: item.id })}
|
|
111
|
+
size={compact ? 's' : 'm'}
|
|
112
|
+
testID={testID ? `${testID}-item-${item.id}` : undefined}
|
|
113
|
+
variant="ghost"
|
|
114
|
+
>
|
|
115
|
+
{item.label}
|
|
116
|
+
</Button>
|
|
117
|
+
) : (
|
|
118
|
+
<BreadcrumbLabel compact={compact} item={item} />
|
|
119
|
+
)}
|
|
120
|
+
{separator === undefined ? null : renderSeparator(separator)}
|
|
121
|
+
</>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/*** Renders one non-interactive breadcrumb label. */
|
|
126
|
+
function BreadcrumbLabel({ item, compact }: { item: BreadcrumbItem; compact: boolean }) {
|
|
127
|
+
const { theme } = useZoraTheme();
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Inline align="center" gap="xs" wrap="nowrap">
|
|
131
|
+
{item.icon ? (
|
|
132
|
+
<Icon
|
|
133
|
+
{...item.icon}
|
|
134
|
+
color={theme.semantics.content.muted}
|
|
135
|
+
size={resolveIconSize(compact ? 's' : 'm')}
|
|
136
|
+
/>
|
|
137
|
+
) : null}
|
|
138
|
+
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
139
|
+
{item.label}
|
|
140
|
+
</Text>
|
|
141
|
+
</Inline>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/*** Renders the configured separator with muted breadcrumb styling. */
|
|
146
|
+
function renderSeparator(separator: string): React.ReactNode {
|
|
147
|
+
return (
|
|
148
|
+
<Text emphasis="muted" variant="bodySmall">
|
|
149
|
+
{separator}
|
|
150
|
+
</Text>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/*** Normalizes an optional maximum breadcrumb item count. */
|
|
155
|
+
function normalizeMaxItems(value: number | undefined): number | undefined {
|
|
156
|
+
if (value === undefined || !Number.isFinite(value)) return undefined;
|
|
157
|
+
return Math.max(0, Math.trunc(value));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/*** Collapses middle breadcrumb items into one ellipsis when required. */
|
|
161
|
+
function createRenderItems(
|
|
162
|
+
items: readonly BreadcrumbItem[],
|
|
163
|
+
maxItems: number | undefined,
|
|
164
|
+
): readonly BreadcrumbRenderItem[] {
|
|
165
|
+
if (maxItems === undefined || maxItems === 0 || items.length <= maxItems || maxItems < 3) {
|
|
166
|
+
return items.map((item) => ({ item, type: 'item' }));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const firstItem = items.at(0);
|
|
170
|
+
if (firstItem === undefined) return [];
|
|
171
|
+
|
|
172
|
+
const trailingCount = maxItems - 2;
|
|
173
|
+
const trailingItems = items.slice(items.length - trailingCount);
|
|
174
|
+
return [
|
|
175
|
+
{ item: firstItem, type: 'item' },
|
|
176
|
+
{ type: 'ellipsis' },
|
|
177
|
+
...trailingItems.map((item) => ({ item, type: 'item' }) satisfies BreadcrumbRenderItem),
|
|
178
|
+
];
|
|
179
|
+
}
|