@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { DropdownMenu } from './DropdownMenu';\nexport { Menu } from './Menu';\nexport type { DropdownMenuProps, MenuAction, MenuActionIntent, MenuProps } from './types';\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const menuMeta: {
|
|
2
|
-
readonly name: "Menu";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Surface-backed action menu; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
export declare const dropdownMenuMeta: {
|
|
10
|
-
readonly name: "DropdownMenu";
|
|
11
|
-
readonly category: "component";
|
|
12
|
-
readonly directManifestNode: false;
|
|
13
|
-
readonly allowedChildren: readonly [];
|
|
14
|
-
readonly note: "Product-facing alias for Menu trigger/action composition; not represented as a manifest node in v1.";
|
|
15
|
-
readonly props: {};
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/menu/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;CAOiB,CAAC;AAEvC,eAAO,MAAM,gBAAgB;;;;;;;CAOS,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const menuMeta = {
|
|
2
|
-
name: 'Menu',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Surface-backed action menu; not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
export const dropdownMenuMeta = {
|
|
10
|
-
name: 'DropdownMenu',
|
|
11
|
-
category: 'component',
|
|
12
|
-
directManifestNode: false,
|
|
13
|
-
allowedChildren: [],
|
|
14
|
-
note: 'Product-facing alias for Menu trigger/action composition; not represented as a manifest node in v1.',
|
|
15
|
-
props: {},
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/menu/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,uEAAuE;IAC7E,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,qGAAqG;IAC3G,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const menuMeta = {\n name: 'Menu',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Surface-backed action menu; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const dropdownMenuMeta = {\n name: 'DropdownMenu',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Product-facing alias for Menu trigger/action composition; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ButtonIconSpec, MenuActionIntent as SurfaceMenuActionIntent, MenuProps as SurfaceMenuProps } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
-
export type MenuActionIntent = SurfaceMenuActionIntent;
|
|
5
|
-
export interface MenuAction {
|
|
6
|
-
id: string;
|
|
7
|
-
title: React.ReactNode;
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
icon?: ButtonIconSpec;
|
|
10
|
-
leading?: React.ReactNode;
|
|
11
|
-
trailing?: React.ReactNode;
|
|
12
|
-
intent?: MenuActionIntent;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
onPress?: () => void;
|
|
16
|
-
}
|
|
17
|
-
export interface MenuProps extends ZoraBaseProps, Omit<SurfaceMenuProps, 'actions' | 'dismiss' | 'mode' | 'themeId'> {
|
|
18
|
-
actions: readonly MenuAction[];
|
|
19
|
-
onDismiss?: () => void;
|
|
20
|
-
}
|
|
21
|
-
export type DropdownMenuProps = MenuProps;
|
|
22
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,IAAI,uBAAuB,EAC3C,SAAS,IAAI,gBAAgB,EAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,SACf,SAAQ,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACzF,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonIconSpec,\n MenuActionIntent as SurfaceMenuActionIntent,\n MenuProps as SurfaceMenuProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type MenuActionIntent = SurfaceMenuActionIntent;\n\nexport interface MenuAction {\n id: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n icon?: ButtonIconSpec;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n intent?: MenuActionIntent;\n disabled?: boolean;\n selected?: boolean;\n onPress?: () => void;\n}\n\nexport interface MenuProps\n extends ZoraBaseProps, Omit<SurfaceMenuProps, 'actions' | 'dismiss' | 'mode' | 'themeId'> {\n actions: readonly MenuAction[];\n onDismiss?: () => void;\n}\n\nexport type DropdownMenuProps = MenuProps;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmD1C;;GAEG;AACH,eAAO,MAAM,KAAK,kDAAiC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Modal as SurfaceModal } from '@ankhorage/surface';
|
|
2
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { Box, Stack } from '../../features/layout/public';
|
|
4
|
-
import { Heading } from '../../features/typography/public';
|
|
5
|
-
import { Text } from '../../features/typography/public';
|
|
6
|
-
import { resolveDialogWidth } from '../../internal/recipes';
|
|
7
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
|
-
function useStableCallback(callback) {
|
|
9
|
-
const callbackRef = useRef(callback);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
callbackRef.current = callback;
|
|
12
|
-
}, [callback]);
|
|
13
|
-
return useCallback(() => {
|
|
14
|
-
callbackRef.current?.();
|
|
15
|
-
}, []);
|
|
16
|
-
}
|
|
17
|
-
function ModalInner({ themeId: _themeId, mode: _mode, children, title, description, footer, width = 'default', onDismiss, interactionPolicy, ...props }) {
|
|
18
|
-
const hasHeader = title != null || description != null;
|
|
19
|
-
const stableOnDismiss = useStableCallback(onDismiss);
|
|
20
|
-
return (<SurfaceModal {...props} onDismiss={stableOnDismiss} interactionPolicy={interactionPolicy}>
|
|
21
|
-
<Box maxWidth={resolveDialogWidth(width)} style={{ alignSelf: 'center', width: '100%' }}>
|
|
22
|
-
<Stack gap="m">
|
|
23
|
-
{hasHeader ? (<Stack gap="xs">
|
|
24
|
-
{title ? <Heading level={3}>{title}</Heading> : null}
|
|
25
|
-
{description ? (<Text emphasis="muted" variant="bodySmall">
|
|
26
|
-
{description}
|
|
27
|
-
</Text>) : null}
|
|
28
|
-
</Stack>) : null}
|
|
29
|
-
{children ? <Box>{children}</Box> : null}
|
|
30
|
-
{footer ? <Box pt="xs">{footer}</Box> : null}
|
|
31
|
-
</Stack>
|
|
32
|
-
</Box>
|
|
33
|
-
</SurfaceModal>);
|
|
34
|
-
}
|
|
35
|
-
/***
|
|
36
|
-
* Modal dialog surface with header/content/footer slots.
|
|
37
|
-
*/
|
|
38
|
-
export const Modal = withZoraThemeScope(ModalInner);
|
|
39
|
-
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,iBAAiB,CAAC,QAAkC;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAErC,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,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,WAAW,CACd;gBAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;YAAA,EAAE,KAAK,CAAC,CACT,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACxC;UAAA,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC9C;QAAA,EAAE,KAAK,CACT;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,YAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { Modal as SurfaceModal } from '@ankhorage/surface';\nimport React, { useCallback, useEffect, useRef } from 'react';\n\nimport { Box, Stack } from '../../features/layout/public';\nimport { Heading } from '../../features/typography/public';\nimport { Text } from '../../features/typography/public';\nimport { resolveDialogWidth } from '../../internal/recipes';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ModalProps } from './types';\n\nfunction useStableCallback(callback: (() => void) | undefined): (() => void) | undefined {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n return useCallback(() => {\n callbackRef.current?.();\n }, []);\n}\n\nfunction ModalInner({\n themeId: _themeId,\n mode: _mode,\n children,\n title,\n description,\n footer,\n width = 'default',\n onDismiss,\n interactionPolicy,\n ...props\n}: ModalProps) {\n const hasHeader = title != null || description != null;\n const stableOnDismiss = useStableCallback(onDismiss);\n\n return (\n <SurfaceModal {...props} onDismiss={stableOnDismiss} interactionPolicy={interactionPolicy}>\n <Box maxWidth={resolveDialogWidth(width)} style={{ alignSelf: 'center', width: '100%' }}>\n <Stack gap=\"m\">\n {hasHeader ? (\n <Stack gap=\"xs\">\n {title ? <Heading level={3}>{title}</Heading> : null}\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n ) : null}\n {children ? <Box>{children}</Box> : null}\n {footer ? <Box pt=\"xs\">{footer}</Box> : null}\n </Stack>\n </Box>\n </SurfaceModal>\n );\n}\n\n/***\n * Modal dialog surface with header/content/footer slots.\n */\nexport const Modal = withZoraThemeScope(ModalInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Modal } from './Modal';\nexport type { ModalProps } from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const modalMeta: {
|
|
2
|
-
readonly name: "Modal";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Overlay component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/modal/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;CAOgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/modal/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,8DAA8D;IACpE,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const modalMeta = {\n name: 'Modal',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Overlay component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ModalProps as SurfaceModalProps } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ZoraContentWidth } from '../../internal/recipes';
|
|
4
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
-
export interface ModalProps extends ZoraBaseProps, Pick<Omit<SurfaceModalProps, 'mode' | 'themeId'>, 'closeOnBackdrop' | 'onDismiss' | 'visible'> {
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
title?: React.ReactNode;
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
footer?: React.ReactNode;
|
|
10
|
-
width?: ZoraContentWidth;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,UACf,SACE,aAAa,EACb,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,iBAAiB,GAAG,WAAW,GAAG,SAAS,CAAC;IAChG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/modal/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModalProps as SurfaceModalProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraContentWidth } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface ModalProps\n extends\n ZoraBaseProps,\n Pick<Omit<SurfaceModalProps, 'mode' | 'themeId'>, 'closeOnBackdrop' | 'onDismiss' | 'visible'> {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n footer?: React.ReactNode;\n width?: ZoraContentWidth;\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PaginationProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Pagination control for navigating between pages of results.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Pagination: (props: PaginationProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA6L/C;;GAEG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '../../features/button/public';
|
|
3
|
-
import { Stack } from '../../features/layout/public';
|
|
4
|
-
import { Text } from '../../features/typography/public';
|
|
5
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
function clampInteger(value, min, max) {
|
|
7
|
-
if (!Number.isFinite(value)) {
|
|
8
|
-
return min;
|
|
9
|
-
}
|
|
10
|
-
return Math.min(Math.max(Math.trunc(value), min), max);
|
|
11
|
-
}
|
|
12
|
-
function createRange(start, end) {
|
|
13
|
-
if (end < start) {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
return Array.from({ length: end - start + 1 }, (_, index) => start + index);
|
|
17
|
-
}
|
|
18
|
-
function normalizeCount(value, fallback) {
|
|
19
|
-
if (value === undefined || !Number.isFinite(value)) {
|
|
20
|
-
return fallback;
|
|
21
|
-
}
|
|
22
|
-
return Math.max(0, Math.trunc(value));
|
|
23
|
-
}
|
|
24
|
-
function createPaginationItems({ page, pageCount, siblingCount, boundaryCount, compact, }) {
|
|
25
|
-
if (pageCount <= 0) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
if (compact) {
|
|
29
|
-
return [page];
|
|
30
|
-
}
|
|
31
|
-
const boundaries = createRange(1, Math.min(boundaryCount, pageCount));
|
|
32
|
-
const trailingBoundaries = createRange(Math.max(pageCount - boundaryCount + 1, 1), pageCount);
|
|
33
|
-
const siblings = createRange(Math.max(page - siblingCount, 1), Math.min(page + siblingCount, pageCount));
|
|
34
|
-
const pages = [...new Set([...boundaries, ...siblings, ...trailingBoundaries])].sort((left, right) => left - right);
|
|
35
|
-
const items = [];
|
|
36
|
-
pages.forEach((nextPage, index) => {
|
|
37
|
-
const previousPage = pages[index - 1];
|
|
38
|
-
if (previousPage !== undefined && nextPage - previousPage > 1) {
|
|
39
|
-
items.push('ellipsis');
|
|
40
|
-
}
|
|
41
|
-
items.push(nextPage);
|
|
42
|
-
});
|
|
43
|
-
return items;
|
|
44
|
-
}
|
|
45
|
-
function PaginationInner({ themeId: _themeId, mode: _mode, page, pageCount, onPageChange, disabled = false, siblingCount = 1, boundaryCount = 1, showFirstLast = false, previousLabel = 'Previous', nextLabel = 'Next', firstLabel = 'First', lastLabel = 'Last', compact = false, testID, interactionPolicy, }) {
|
|
46
|
-
const passive = interactionPolicy === 'passive';
|
|
47
|
-
const normalizedPageCount = Math.max(0, Math.trunc(Number.isFinite(pageCount) ? pageCount : 0));
|
|
48
|
-
const currentPage = clampInteger(page, 1, Math.max(normalizedPageCount, 1));
|
|
49
|
-
const safeSiblingCount = normalizeCount(siblingCount, 1);
|
|
50
|
-
const safeBoundaryCount = normalizeCount(boundaryCount, 1);
|
|
51
|
-
const items = createPaginationItems({
|
|
52
|
-
boundaryCount: safeBoundaryCount,
|
|
53
|
-
compact,
|
|
54
|
-
page: currentPage,
|
|
55
|
-
pageCount: normalizedPageCount,
|
|
56
|
-
siblingCount: safeSiblingCount,
|
|
57
|
-
});
|
|
58
|
-
const canGoPrevious = currentPage > 1;
|
|
59
|
-
const canGoNext = currentPage < normalizedPageCount;
|
|
60
|
-
const navigationDisabled = disabled || normalizedPageCount <= 1;
|
|
61
|
-
const changePage = (nextPage) => {
|
|
62
|
-
const clampedPage = clampInteger(nextPage, 1, Math.max(normalizedPageCount, 1));
|
|
63
|
-
if (passive || disabled || clampedPage === currentPage) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
onPageChange?.(clampedPage);
|
|
67
|
-
};
|
|
68
|
-
return (<Stack align="center" direction="row" gap="xs" testID={testID}>
|
|
69
|
-
{showFirstLast ? (<Button disabled={navigationDisabled || currentPage === 1} interactionPolicy={interactionPolicy} onPress={() => changePage(1)} size="s" testID={testID ? `${testID}-first` : undefined} variant="ghost">
|
|
70
|
-
{firstLabel}
|
|
71
|
-
</Button>) : null}
|
|
72
|
-
|
|
73
|
-
<Button disabled={navigationDisabled || !canGoPrevious} interactionPolicy={interactionPolicy} onPress={() => changePage(currentPage - 1)} size="s" testID={testID ? `${testID}-previous` : undefined} variant="ghost">
|
|
74
|
-
{previousLabel}
|
|
75
|
-
</Button>
|
|
76
|
-
|
|
77
|
-
{items.map((item, index) => item === 'ellipsis' ? (<Text key={`ellipsis-${index}`} emphasis="muted" variant="bodySmall">
|
|
78
|
-
…
|
|
79
|
-
</Text>) : (<Button color={item === currentPage ? 'primary' : 'neutral'} disabled={disabled} interactionPolicy={interactionPolicy} key={item} onPress={() => changePage(item)} size="s" testID={testID ? `${testID}-page-${item}` : undefined} variant={item === currentPage ? 'solid' : 'ghost'}>
|
|
80
|
-
{item}
|
|
81
|
-
</Button>))}
|
|
82
|
-
|
|
83
|
-
<Button disabled={navigationDisabled || !canGoNext} interactionPolicy={interactionPolicy} onPress={() => changePage(currentPage + 1)} size="s" testID={testID ? `${testID}-next` : undefined} variant="ghost">
|
|
84
|
-
{nextLabel}
|
|
85
|
-
</Button>
|
|
86
|
-
|
|
87
|
-
{showFirstLast ? (<Button disabled={navigationDisabled || currentPage === normalizedPageCount} interactionPolicy={interactionPolicy} onPress={() => changePage(normalizedPageCount)} size="s" testID={testID ? `${testID}-last` : undefined} variant="ghost">
|
|
88
|
-
{lastLabel}
|
|
89
|
-
</Button>) : null}
|
|
90
|
-
</Stack>);
|
|
91
|
-
}
|
|
92
|
-
/***
|
|
93
|
-
* Pagination control for navigating between pages of results.
|
|
94
|
-
*/
|
|
95
|
-
export const Pagination = withZoraThemeScope(PaginationInner);
|
|
96
|
-
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../src/components/pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,O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AS,CACZ;MAAA,EAAE,MAAM,CAER;;MAAA,CAAC,aAAa,CAAC,CAAC,CAAC,CACf,CAAC,MAAM,CACL,QAAQ,CAAC,CAAC,kBAAkB,IAAI,WAAW,KAAK,mBAAmB,CAAC,CACpE,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAC/C,IAAI,CAAC,GAAG,CACR,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAC9C,OAAO,CAAC,OAAO,CAEf;UAAA,CAAC,SAAS,CACZ;QAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Button } from '../../features/button/public';\nimport { Stack } from '../../features/layout/public';\nimport { Text } from '../../features/typography/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PaginationProps } from './types';\n\ntype PaginationItem = number | 'ellipsis';\n\nfunction clampInteger(value: number, min: number, max: number): number {\n if (!Number.isFinite(value)) {\n return min;\n }\n\n return Math.min(Math.max(Math.trunc(value), min), max);\n}\n\nfunction createRange(start: number, end: number): number[] {\n if (end < start) {\n return [];\n }\n\n return Array.from({ length: end - start + 1 }, (_, index) => start + index);\n}\n\nfunction normalizeCount(value: number | undefined, fallback: number): number {\n if (value === undefined || !Number.isFinite(value)) {\n return fallback;\n }\n\n return Math.max(0, Math.trunc(value));\n}\n\nfunction createPaginationItems({\n page,\n pageCount,\n siblingCount,\n boundaryCount,\n compact,\n}: {\n page: number;\n pageCount: number;\n siblingCount: number;\n boundaryCount: number;\n compact: boolean;\n}): readonly PaginationItem[] {\n if (pageCount <= 0) {\n return [];\n }\n\n if (compact) {\n return [page];\n }\n\n const boundaries = createRange(1, Math.min(boundaryCount, pageCount));\n const trailingBoundaries = createRange(Math.max(pageCount - boundaryCount + 1, 1), pageCount);\n const siblings = createRange(\n Math.max(page - siblingCount, 1),\n Math.min(page + siblingCount, pageCount),\n );\n const pages = [...new Set([...boundaries, ...siblings, ...trailingBoundaries])].sort(\n (left, right) => left - right,\n );\n const items: PaginationItem[] = [];\n\n pages.forEach((nextPage, index) => {\n const previousPage = pages[index - 1];\n if (previousPage !== undefined && nextPage - previousPage > 1) {\n items.push('ellipsis');\n }\n\n items.push(nextPage);\n });\n\n return items;\n}\n\nfunction PaginationInner({\n themeId: _themeId,\n mode: _mode,\n page,\n pageCount,\n onPageChange,\n disabled = false,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstLast = false,\n previousLabel = 'Previous',\n nextLabel = 'Next',\n firstLabel = 'First',\n lastLabel = 'Last',\n compact = false,\n testID,\n interactionPolicy,\n}: PaginationProps) {\n const passive = interactionPolicy === 'passive';\n const normalizedPageCount = Math.max(0, Math.trunc(Number.isFinite(pageCount) ? pageCount : 0));\n const currentPage = clampInteger(page, 1, Math.max(normalizedPageCount, 1));\n const safeSiblingCount = normalizeCount(siblingCount, 1);\n const safeBoundaryCount = normalizeCount(boundaryCount, 1);\n const items = createPaginationItems({\n boundaryCount: safeBoundaryCount,\n compact,\n page: currentPage,\n pageCount: normalizedPageCount,\n siblingCount: safeSiblingCount,\n });\n const canGoPrevious = currentPage > 1;\n const canGoNext = currentPage < normalizedPageCount;\n const navigationDisabled = disabled || normalizedPageCount <= 1;\n\n const changePage = (nextPage: number) => {\n const clampedPage = clampInteger(nextPage, 1, Math.max(normalizedPageCount, 1));\n if (passive || disabled || clampedPage === currentPage) {\n return;\n }\n\n onPageChange?.(clampedPage);\n };\n\n return (\n <Stack align=\"center\" direction=\"row\" gap=\"xs\" testID={testID}>\n {showFirstLast ? (\n <Button\n disabled={navigationDisabled || currentPage === 1}\n interactionPolicy={interactionPolicy}\n onPress={() => changePage(1)}\n size=\"s\"\n testID={testID ? `${testID}-first` : undefined}\n variant=\"ghost\"\n >\n {firstLabel}\n </Button>\n ) : null}\n\n <Button\n disabled={navigationDisabled || !canGoPrevious}\n interactionPolicy={interactionPolicy}\n onPress={() => changePage(currentPage - 1)}\n size=\"s\"\n testID={testID ? `${testID}-previous` : undefined}\n variant=\"ghost\"\n >\n {previousLabel}\n </Button>\n\n {items.map((item, index) =>\n item === 'ellipsis' ? (\n <Text key={`ellipsis-${index}`} emphasis=\"muted\" variant=\"bodySmall\">\n …\n </Text>\n ) : (\n <Button\n color={item === currentPage ? 'primary' : 'neutral'}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n key={item}\n onPress={() => changePage(item)}\n size=\"s\"\n testID={testID ? `${testID}-page-${item}` : undefined}\n variant={item === currentPage ? 'solid' : 'ghost'}\n >\n {item}\n </Button>\n ),\n )}\n\n <Button\n disabled={navigationDisabled || !canGoNext}\n interactionPolicy={interactionPolicy}\n onPress={() => changePage(currentPage + 1)}\n size=\"s\"\n testID={testID ? `${testID}-next` : undefined}\n variant=\"ghost\"\n >\n {nextLabel}\n </Button>\n\n {showFirstLast ? (\n <Button\n disabled={navigationDisabled || currentPage === normalizedPageCount}\n interactionPolicy={interactionPolicy}\n onPress={() => changePage(normalizedPageCount)}\n size=\"s\"\n testID={testID ? `${testID}-last` : undefined}\n variant=\"ghost\"\n >\n {lastLabel}\n </Button>\n ) : null}\n </Stack>\n );\n}\n\n/***\n * Pagination control for navigating between pages of results.\n */\nexport const Pagination = withZoraThemeScope(PaginationInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Pagination } from './Pagination';\nexport type { PaginationProps } from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const paginationMeta: {
|
|
2
|
-
readonly name: "Pagination";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Code-facing controlled pagination component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;CAOW,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const paginationMeta = {
|
|
2
|
-
name: 'Pagination',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Code-facing controlled pagination component; not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/pagination/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,wFAAwF;IAC9F,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const paginationMeta = {\n name: 'Pagination',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Code-facing controlled pagination component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
-
export interface PaginationProps extends ZoraBaseProps {
|
|
4
|
-
page: number;
|
|
5
|
-
pageCount: number;
|
|
6
|
-
onPageChange?: (page: number) => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
siblingCount?: number;
|
|
9
|
-
boundaryCount?: number;
|
|
10
|
-
showFirstLast?: boolean;
|
|
11
|
-
previousLabel?: React.ReactNode;
|
|
12
|
-
nextLabel?: React.ReactNode;
|
|
13
|
-
firstLabel?: React.ReactNode;
|
|
14
|
-
lastLabel?: React.ReactNode;
|
|
15
|
-
compact?: boolean;
|
|
16
|
-
testID?: string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/pagination/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface PaginationProps extends ZoraBaseProps {\n page: number;\n pageCount: number;\n onPageChange?: (page: number) => void;\n disabled?: boolean;\n siblingCount?: number;\n boundaryCount?: number;\n showFirstLast?: boolean;\n previousLabel?: React.ReactNode;\n nextLabel?: React.ReactNode;\n firstLabel?: React.ReactNode;\n lastLabel?: React.ReactNode;\n compact?: boolean;\n testID?: string;\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type RatingProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Displays a star-based rating value with optional half steps.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Rating: (props: RatingProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=Rating.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/components/rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,SAAS,CAAC;AA8B9D;;GAEG;AACH,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Icon } from '../../features/icon/public';
|
|
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 { resolveRatingSegments } from './resolveRatingSegments';
|
|
8
|
-
import { resolveRatingRole } from './types';
|
|
9
|
-
function RatingInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, testID, value, max = 5, color = 'warning', size = 'm', }) {
|
|
10
|
-
const { theme } = useZoraTheme();
|
|
11
|
-
const role = resolveRatingRole(theme, color);
|
|
12
|
-
const segments = resolveRatingSegments({ value, max });
|
|
13
|
-
const iconSize = resolveIconSize(size);
|
|
14
|
-
return (<Inline align="center" gap="xxs" testID={testID} wrap="nowrap">
|
|
15
|
-
{segments.map((segment, index) => {
|
|
16
|
-
const name = segment === 'full' ? 'star' : segment === 'half' ? 'star-half' : 'star-outline';
|
|
17
|
-
const color = segment === 'empty' ? theme.semantics.content.muted : role.base;
|
|
18
|
-
return <Icon key={index} color={color} name={name} size={iconSize}/>;
|
|
19
|
-
})}
|
|
20
|
-
</Inline>);
|
|
21
|
-
}
|
|
22
|
-
/***
|
|
23
|
-
* Displays a star-based rating value with optional half steps.
|
|
24
|
-
*/
|
|
25
|
-
export const Rating = withZoraThemeScope(RatingInner);
|
|
26
|
-
//# sourceMappingURL=Rating.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rating.js","sourceRoot":"","sources":["../../../src/components/rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,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CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC;QACxE,CAAC,CAAC,CACJ;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Icon } from '../../features/icon/public';\nimport { Inline } from '../../foundation';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { resolveRatingSegments } from './resolveRatingSegments';\nimport { type RatingProps, resolveRatingRole } from './types';\n\nfunction RatingInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n testID,\n value,\n max = 5,\n color = 'warning',\n size = 'm',\n}: RatingProps) {\n const { theme } = useZoraTheme();\n const role = resolveRatingRole(theme, color);\n const segments = resolveRatingSegments({ value, max });\n const iconSize = resolveIconSize(size);\n\n return (\n <Inline align=\"center\" gap=\"xxs\" testID={testID} wrap=\"nowrap\">\n {segments.map((segment, index) => {\n const name =\n segment === 'full' ? 'star' : segment === 'half' ? 'star-half' : 'star-outline';\n const color = segment === 'empty' ? theme.semantics.content.muted : role.base;\n\n return <Icon key={index} color={color} name={name} size={iconSize} />;\n })}\n </Inline>\n );\n}\n\n/***\n * Displays a star-based rating value with optional half steps.\n */\nexport const Rating = withZoraThemeScope(RatingInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/rating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { Rating } from './Rating';\nexport type { RatingProps } from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const ratingMeta: {
|
|
2
|
-
readonly name: "Rating";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Feedback component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/rating/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;CAOe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/rating/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,+DAA+D;IACrE,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const ratingMeta = {\n name: 'Rating',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Feedback component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRatingSegments.d.ts","sourceRoot":"","sources":["../../../src/components/rating/resolveRatingSegments.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,GAAG,GACJ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,aAAa,EAAE,CAyBlB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function resolveRatingSegments({ value, max, }) {
|
|
2
|
-
if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {
|
|
3
|
-
return [];
|
|
4
|
-
}
|
|
5
|
-
const clamped = Math.max(0, Math.min(value, max));
|
|
6
|
-
const halfSteps = Math.round(clamped * 2);
|
|
7
|
-
const segments = [];
|
|
8
|
-
for (let index = 0; index < max; index += 1) {
|
|
9
|
-
const threshold = (index + 1) * 2;
|
|
10
|
-
if (halfSteps >= threshold) {
|
|
11
|
-
segments.push('full');
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
if (halfSteps === threshold - 1) {
|
|
15
|
-
segments.push('half');
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
segments.push('empty');
|
|
19
|
-
}
|
|
20
|
-
return segments;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=resolveRatingSegments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRatingSegments.js","sourceRoot":"","sources":["../../../src/components/rating/resolveRatingSegments.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,EACpC,KAAK,EACL,GAAG,GAIJ;IACC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QACjE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAoB,EAAE,CAAC;IAErC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5C,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,GAAG,CAAC,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["type RatingSegment = 'full' | 'half' | 'empty';\n\nexport function resolveRatingSegments({\n value,\n max,\n}: {\n value: number;\n max: number;\n}): RatingSegment[] {\n if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {\n return [];\n }\n\n const clamped = Math.max(0, Math.min(value, max));\n const halfSteps = Math.round(clamped * 2);\n const segments: RatingSegment[] = [];\n\n for (let index = 0; index < max; index += 1) {\n const threshold = (index + 1) * 2;\n if (halfSteps >= threshold) {\n segments.push('full');\n continue;\n }\n\n if (halfSteps === threshold - 1) {\n segments.push('half');\n continue;\n }\n\n segments.push('empty');\n }\n\n return segments;\n}\n"]}
|