@ankhorage/zora 15.0.0 → 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 +6 -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/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/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/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/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 +6 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- 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 +2 -2
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +14 -9
- 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 +3 -3
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +11 -9
- package/dist/registry.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/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/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 +1 -1
- package/src/audit.test.ts +8 -47
- package/src/constants.ts +5 -0
- package/src/featureManifest.test.ts +31 -2
- 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/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/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 +15 -12
- package/src/metadata/allowedChildren.ts +6 -0
- package/src/metadata/componentMeta.test.ts +18 -1
- package/src/metadata/componentMeta.ts +14 -9
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +3 -3
- package/src/patterns/theme-composer/ThemeComposer.tsx +6 -7
- package/src/registry.ts +11 -9
- package/src/showcaseCoverage.test.ts +6 -3
- package/src/theme/themeScopeStructure.test.ts +16 -11
- package/src/types/dialog.ts +15 -0
- package/src/{components/pagination/types.ts → types/pagination.ts} +5 -8
- package/src/types/rating.ts +9 -0
- package/src/types/search-input.ts +14 -0
- package/src/types/tabs.ts +25 -0
- package/src/types/toolbar.ts +9 -0
- 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/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/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/meta.ts +0 -10
- 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/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,60 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
import { resolveRatingSegments } from './resolveRatingSegments';
|
|
4
|
-
|
|
5
|
-
describe('resolveRatingSegments', () => {
|
|
6
|
-
test('returns empty segments for invalid input', () => {
|
|
7
|
-
expect(resolveRatingSegments({ value: 3, max: 0 })).toEqual([]);
|
|
8
|
-
expect(resolveRatingSegments({ value: Number.NaN, max: 5 })).toEqual([]);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test('clamps and rounds to nearest half-step', () => {
|
|
12
|
-
expect(resolveRatingSegments({ value: -1, max: 5 })).toEqual([
|
|
13
|
-
'empty',
|
|
14
|
-
'empty',
|
|
15
|
-
'empty',
|
|
16
|
-
'empty',
|
|
17
|
-
'empty',
|
|
18
|
-
]);
|
|
19
|
-
|
|
20
|
-
expect(resolveRatingSegments({ value: 3, max: 5 })).toEqual([
|
|
21
|
-
'full',
|
|
22
|
-
'full',
|
|
23
|
-
'full',
|
|
24
|
-
'empty',
|
|
25
|
-
'empty',
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
expect(resolveRatingSegments({ value: 3.2, max: 5 })).toEqual([
|
|
29
|
-
'full',
|
|
30
|
-
'full',
|
|
31
|
-
'full',
|
|
32
|
-
'empty',
|
|
33
|
-
'empty',
|
|
34
|
-
]);
|
|
35
|
-
|
|
36
|
-
expect(resolveRatingSegments({ value: 3.25, max: 5 })).toEqual([
|
|
37
|
-
'full',
|
|
38
|
-
'full',
|
|
39
|
-
'full',
|
|
40
|
-
'half',
|
|
41
|
-
'empty',
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
expect(resolveRatingSegments({ value: 5, max: 5 })).toEqual([
|
|
45
|
-
'full',
|
|
46
|
-
'full',
|
|
47
|
-
'full',
|
|
48
|
-
'full',
|
|
49
|
-
'full',
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
|
-
expect(resolveRatingSegments({ value: 6, max: 5 })).toEqual([
|
|
53
|
-
'full',
|
|
54
|
-
'full',
|
|
55
|
-
'full',
|
|
56
|
-
'full',
|
|
57
|
-
'full',
|
|
58
|
-
]);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
type RatingSegment = 'full' | 'half' | 'empty';
|
|
2
|
-
|
|
3
|
-
export function resolveRatingSegments({
|
|
4
|
-
value,
|
|
5
|
-
max,
|
|
6
|
-
}: {
|
|
7
|
-
value: number;
|
|
8
|
-
max: number;
|
|
9
|
-
}): RatingSegment[] {
|
|
10
|
-
if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const clamped = Math.max(0, Math.min(value, max));
|
|
15
|
-
const halfSteps = Math.round(clamped * 2);
|
|
16
|
-
const segments: RatingSegment[] = [];
|
|
17
|
-
|
|
18
|
-
for (let index = 0; index < max; index += 1) {
|
|
19
|
-
const threshold = (index + 1) * 2;
|
|
20
|
-
if (halfSteps >= threshold) {
|
|
21
|
-
segments.push('full');
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (halfSteps === threshold - 1) {
|
|
26
|
-
segments.push('half');
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
segments.push('empty');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return segments;
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';
|
|
2
|
-
|
|
3
|
-
import type { ZoraColor, ZoraControlSize } from '../../internal/recipes';
|
|
4
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
-
|
|
6
|
-
export interface RatingProps extends ZoraBaseProps {
|
|
7
|
-
value: number;
|
|
8
|
-
max?: number;
|
|
9
|
-
color?: ZoraColor;
|
|
10
|
-
size?: ZoraControlSize;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function resolveRatingRole(theme: SurfaceTheme, color: ZoraColor): RoleSemantics {
|
|
14
|
-
switch (color) {
|
|
15
|
-
case 'secondary':
|
|
16
|
-
return theme.semantics.secondary;
|
|
17
|
-
case 'tertiary':
|
|
18
|
-
return theme.semantics.accent;
|
|
19
|
-
case 'quaternary':
|
|
20
|
-
return theme.semantics.highlight;
|
|
21
|
-
case 'error':
|
|
22
|
-
return theme.semantics.error;
|
|
23
|
-
case 'info':
|
|
24
|
-
return theme.semantics.info;
|
|
25
|
-
case 'primary':
|
|
26
|
-
return theme.semantics.action.primary;
|
|
27
|
-
case 'danger':
|
|
28
|
-
return theme.semantics.action.danger;
|
|
29
|
-
case 'success':
|
|
30
|
-
return theme.semantics.success;
|
|
31
|
-
case 'warning':
|
|
32
|
-
return theme.semantics.warning;
|
|
33
|
-
case 'neutral':
|
|
34
|
-
default:
|
|
35
|
-
return theme.semantics.action.neutral;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const searchBarMeta = {
|
|
4
|
-
name: 'SearchBar',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Composite input component; not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ZoraControlSize } from '../../internal/recipes';
|
|
2
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
-
|
|
4
|
-
export interface SearchBarProps extends ZoraBaseProps {
|
|
5
|
-
value: string;
|
|
6
|
-
onValueChange: (value: string) => void;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
onSubmit?: (value: string) => void;
|
|
9
|
-
onClear?: () => void;
|
|
10
|
-
clearable?: boolean;
|
|
11
|
-
size?: ZoraControlSize;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
readOnly?: boolean;
|
|
14
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button } from '../../features/button/public';
|
|
4
|
-
import { Box, Stack } from '../../features/layout/public';
|
|
5
|
-
import { Text } from '../../features/typography/public';
|
|
6
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
7
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
|
-
import type { TabItem, TabsProps } from './types';
|
|
9
|
-
|
|
10
|
-
function TabsInner<TValue extends string = string>({
|
|
11
|
-
themeId: _themeId,
|
|
12
|
-
mode: _mode,
|
|
13
|
-
value,
|
|
14
|
-
items,
|
|
15
|
-
onValueChange,
|
|
16
|
-
variant = 'underline',
|
|
17
|
-
size = 'm',
|
|
18
|
-
disabled: tabsDisabled,
|
|
19
|
-
testID,
|
|
20
|
-
interactionPolicy,
|
|
21
|
-
}: TabsProps<TValue>) {
|
|
22
|
-
const { theme } = useZoraTheme();
|
|
23
|
-
const passive = interactionPolicy === 'passive';
|
|
24
|
-
|
|
25
|
-
const renderTab = (item: TabItem<TValue>) => {
|
|
26
|
-
const isActive = item.value === value;
|
|
27
|
-
const isDisabled = tabsDisabled ?? item.disabled;
|
|
28
|
-
|
|
29
|
-
if (variant === 'segmented') {
|
|
30
|
-
return (
|
|
31
|
-
<Button
|
|
32
|
-
key={item.value}
|
|
33
|
-
variant={isActive ? 'solid' : 'ghost'}
|
|
34
|
-
color="neutral"
|
|
35
|
-
size={size}
|
|
36
|
-
disabled={isDisabled}
|
|
37
|
-
onPress={() => {
|
|
38
|
-
if (!passive) {
|
|
39
|
-
onValueChange(item.value);
|
|
40
|
-
}
|
|
41
|
-
}}
|
|
42
|
-
leadingIcon={item.icon}
|
|
43
|
-
testID={item.testID}
|
|
44
|
-
>
|
|
45
|
-
{item.label}
|
|
46
|
-
{item.badge}
|
|
47
|
-
</Button>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (variant === 'pill') {
|
|
52
|
-
return (
|
|
53
|
-
<Button
|
|
54
|
-
key={item.value}
|
|
55
|
-
variant={isActive ? 'soft' : 'ghost'}
|
|
56
|
-
color={isActive ? 'primary' : 'neutral'}
|
|
57
|
-
size={size}
|
|
58
|
-
disabled={isDisabled}
|
|
59
|
-
onPress={() => {
|
|
60
|
-
if (!passive) {
|
|
61
|
-
onValueChange(item.value);
|
|
62
|
-
}
|
|
63
|
-
}}
|
|
64
|
-
leadingIcon={item.icon}
|
|
65
|
-
testID={item.testID}
|
|
66
|
-
>
|
|
67
|
-
{item.label}
|
|
68
|
-
{item.badge}
|
|
69
|
-
</Button>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Default: 'underline'
|
|
74
|
-
return (
|
|
75
|
-
<Box
|
|
76
|
-
key={item.value}
|
|
77
|
-
borderColor={isActive ? theme.colors.primary : 'transparent'}
|
|
78
|
-
pb="xs"
|
|
79
|
-
style={{
|
|
80
|
-
borderBottomWidth: 2,
|
|
81
|
-
}}
|
|
82
|
-
>
|
|
83
|
-
<Button
|
|
84
|
-
variant="ghost"
|
|
85
|
-
color="neutral"
|
|
86
|
-
size={size}
|
|
87
|
-
disabled={isDisabled}
|
|
88
|
-
onPress={() => {
|
|
89
|
-
if (!passive) {
|
|
90
|
-
onValueChange(item.value);
|
|
91
|
-
}
|
|
92
|
-
}}
|
|
93
|
-
leadingIcon={item.icon}
|
|
94
|
-
testID={item.testID}
|
|
95
|
-
>
|
|
96
|
-
<Text
|
|
97
|
-
color={isActive ? 'primary' : undefined}
|
|
98
|
-
emphasis={isActive ? 'default' : 'muted'}
|
|
99
|
-
weight={isActive ? 'semiBold' : 'regular'}
|
|
100
|
-
>
|
|
101
|
-
{item.label}
|
|
102
|
-
</Text>
|
|
103
|
-
{item.badge}
|
|
104
|
-
</Button>
|
|
105
|
-
</Box>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<Stack
|
|
111
|
-
direction="row"
|
|
112
|
-
gap={variant === 'segmented' ? 'none' : 'm'}
|
|
113
|
-
align="center"
|
|
114
|
-
testID={testID}
|
|
115
|
-
p={variant === 'segmented' ? 'xxs' : 'none'}
|
|
116
|
-
bg={variant === 'segmented' ? 'subtle' : 'transparent'}
|
|
117
|
-
radius={variant === 'segmented' ? 'm' : 'none'}
|
|
118
|
-
>
|
|
119
|
-
{items.map(renderTab)}
|
|
120
|
-
</Stack>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/***
|
|
125
|
-
* Tab navigation for switching between views or content sections.
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
*/
|
|
129
|
-
export const Tabs = withZoraThemeScope(TabsInner);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const tabsMeta = {
|
|
4
|
-
name: 'Tabs',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Navigation component; not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
import type { ZoraControlSize } from '../../internal/recipes';
|
|
5
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
6
|
-
|
|
7
|
-
export interface TabItem<TValue extends string = string> {
|
|
8
|
-
value: TValue;
|
|
9
|
-
label: ReactNode;
|
|
10
|
-
icon?: ButtonIconSpec;
|
|
11
|
-
badge?: ReactNode;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
testID?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type TabsVariant = 'underline' | 'pill' | 'segmented';
|
|
17
|
-
|
|
18
|
-
export interface TabsProps<TValue extends string = string> extends ZoraBaseProps {
|
|
19
|
-
value: TValue;
|
|
20
|
-
items: readonly TabItem<TValue>[];
|
|
21
|
-
onValueChange: (value: TValue) => void;
|
|
22
|
-
variant?: TabsVariant;
|
|
23
|
-
size?: ZoraControlSize;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Card } from '../../features/card/public';
|
|
4
|
-
import { Stack } from '../../features/layout/public';
|
|
5
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
import type { ToolbarProps } from './types';
|
|
7
|
-
|
|
8
|
-
function ToolbarInner({
|
|
9
|
-
themeId: _themeId,
|
|
10
|
-
mode: _mode,
|
|
11
|
-
interactionPolicy: _interactionPolicy,
|
|
12
|
-
children,
|
|
13
|
-
position = 'inline',
|
|
14
|
-
floating = false,
|
|
15
|
-
compact = true,
|
|
16
|
-
testID,
|
|
17
|
-
}: ToolbarProps) {
|
|
18
|
-
const isFixed = position === 'top' || position === 'bottom';
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Card
|
|
22
|
-
compact={compact}
|
|
23
|
-
tone={floating ? 'default' : 'subtle'}
|
|
24
|
-
testID={testID}
|
|
25
|
-
style={
|
|
26
|
-
isFixed
|
|
27
|
-
? {
|
|
28
|
-
position: 'absolute',
|
|
29
|
-
[position]: 0,
|
|
30
|
-
zIndex: 10,
|
|
31
|
-
alignSelf: 'center',
|
|
32
|
-
}
|
|
33
|
-
: undefined
|
|
34
|
-
}
|
|
35
|
-
>
|
|
36
|
-
<Stack direction="row" gap="s" align="center">
|
|
37
|
-
{children}
|
|
38
|
-
</Stack>
|
|
39
|
-
</Card>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/***
|
|
44
|
-
* Horizontal toolbar surface for grouping actions and controls.
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
*/
|
|
48
|
-
export const Toolbar = withZoraThemeScope(ToolbarInner);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { IconButton } from '../../features/button/public';
|
|
4
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
-
import type { ToolbarActionProps } from './types';
|
|
6
|
-
|
|
7
|
-
function ToolbarActionInner({
|
|
8
|
-
themeId: _themeId,
|
|
9
|
-
mode: _mode,
|
|
10
|
-
active,
|
|
11
|
-
...props
|
|
12
|
-
}: ToolbarActionProps) {
|
|
13
|
-
return (
|
|
14
|
-
<IconButton
|
|
15
|
-
{...props}
|
|
16
|
-
variant={active ? 'soft' : 'ghost'}
|
|
17
|
-
color={active ? 'primary' : 'neutral'}
|
|
18
|
-
size="m"
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/***
|
|
24
|
-
* Convenience icon action for toolbars with active state styling.
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
|
-
export const ToolbarAction = withZoraThemeScope(ToolbarActionInner);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const toolbarMeta = {
|
|
4
|
-
name: 'Toolbar',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Action bar component; not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|
|
11
|
-
|
|
12
|
-
export const toolbarActionMeta = {
|
|
13
|
-
name: 'ToolbarAction',
|
|
14
|
-
category: 'component',
|
|
15
|
-
directManifestNode: false,
|
|
16
|
-
allowedChildren: [],
|
|
17
|
-
note: 'Action bar item; not represented as a manifest node in v1.',
|
|
18
|
-
props: {},
|
|
19
|
-
} as const satisfies ZoraComponentMeta;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
-
|
|
6
|
-
export type ToolbarPosition = 'top' | 'bottom' | 'inline';
|
|
7
|
-
|
|
8
|
-
export interface ToolbarProps extends ZoraBaseProps {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
position?: ToolbarPosition;
|
|
11
|
-
floating?: boolean;
|
|
12
|
-
compact?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ToolbarActionProps extends ZoraBaseProps {
|
|
16
|
-
label: string;
|
|
17
|
-
icon: ButtonIconSpec;
|
|
18
|
-
active?: boolean;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
onPress?: () => void;
|
|
21
|
-
}
|