From 32d090ec92a5b3903ecae3eb9e28766d361cdef0 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 3 Jul 2025 17:28:40 +0100 Subject: [PATCH] Improve exports Signed-off-by: Charles de Dreuille --- packages/canon/report.api.md | 28 ------------------- .../src/components/Header/HeaderTabs.tsx | 4 +-- .../Header/HeaderTabsIndicators.tsx | 2 +- .../src/components/Header/HeaderToolbar.tsx | 2 +- .../canon/src/components/Header/index.tsx | 10 +++++-- packages/canon/src/components/Header/types.ts | 5 ---- .../canon/src/components/HeaderPage/index.tsx | 4 +-- 7 files changed, 13 insertions(+), 42 deletions(-) diff --git a/packages/canon/report.api.md b/packages/canon/report.api.md index 1fbc259a9e..1070193649 100644 --- a/packages/canon/report.api.md +++ b/packages/canon/report.api.md @@ -20,7 +20,6 @@ import { HTMLAttributes } from 'react'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { LinkProps as LinkProps_2 } from 'react-aria-components'; import { Menu as Menu_2 } from '@base-ui-components/react/menu'; -import { MutableRefObject } from 'react'; import type { RadioGroupProps as RadioGroupProps_2 } from 'react-aria-components'; import type { RadioProps as RadioProps_2 } from 'react-aria-components'; import { ReactElement } from 'react'; @@ -948,18 +947,6 @@ export interface HeaderBreadcrumb { label: string; } -// @public -export interface HeaderIndicatorsProps { - // (undocumented) - hoveredKey: string | null; - // (undocumented) - prevHoveredKey: MutableRefObject; - // (undocumented) - tabRefs: MutableRefObject>; - // (undocumented) - tabsRef: MutableRefObject; -} - // @public export interface HeaderOption { // (undocumented) @@ -1025,21 +1012,6 @@ export interface HeaderTab { label: string; } -// @public -export interface HeaderTabProps { - // (undocumented) - setHoveredKey: (key: string | null) => void; - // (undocumented) - setTabRef: (key: string, element: HTMLDivElement | null) => void; - // (undocumented) - tab: HeaderTab; -} - -// @public -export const HeaderTabsIndicators: ( - props: HeaderIndicatorsProps, -) => JSX_2.Element; - // @public (undocumented) export const Heading: ( props: HeadingProps & { diff --git a/packages/canon/src/components/Header/HeaderTabs.tsx b/packages/canon/src/components/Header/HeaderTabs.tsx index 90c2aab33e..b83e27e83d 100644 --- a/packages/canon/src/components/Header/HeaderTabs.tsx +++ b/packages/canon/src/components/Header/HeaderTabs.tsx @@ -23,7 +23,7 @@ import type { HeaderProps, HeaderTabProps } from './types'; /** * A component that renders header tabs. * - * @public + * @internal */ export const HeaderTabs = (props: HeaderProps) => { const { tabs } = props; @@ -70,7 +70,7 @@ export const HeaderTabs = (props: HeaderProps) => { /** * A component that renders a toolbar tab. * - * @public + * @internal */ const Tab = (props: HeaderTabProps) => { const { tab, setTabRef, setHoveredKey } = props; diff --git a/packages/canon/src/components/Header/HeaderTabsIndicators.tsx b/packages/canon/src/components/Header/HeaderTabsIndicators.tsx index 8018a72e98..41de56574e 100644 --- a/packages/canon/src/components/Header/HeaderTabsIndicators.tsx +++ b/packages/canon/src/components/Header/HeaderTabsIndicators.tsx @@ -22,7 +22,7 @@ import type { HeaderIndicatorsProps } from './types'; /** * A component that renders the indicators for the toolbar. * - * @public + * @internal */ export const HeaderTabsIndicators = (props: HeaderIndicatorsProps) => { const { tabRefs, tabsRef, hoveredKey, prevHoveredKey } = props; diff --git a/packages/canon/src/components/Header/HeaderToolbar.tsx b/packages/canon/src/components/Header/HeaderToolbar.tsx index 679c9ce489..95c01e1c88 100644 --- a/packages/canon/src/components/Header/HeaderToolbar.tsx +++ b/packages/canon/src/components/Header/HeaderToolbar.tsx @@ -26,7 +26,7 @@ import { motion, useScroll, useTransform } from 'motion/react'; /** * A component that renders a toolbar. * - * @public + * @internal */ export const HeaderToolbar = (props: HeaderProps) => { const { icon, title, options, breadcrumbs } = props; diff --git a/packages/canon/src/components/Header/index.tsx b/packages/canon/src/components/Header/index.tsx index 9d62b8eca0..ac55e27fa1 100644 --- a/packages/canon/src/components/Header/index.tsx +++ b/packages/canon/src/components/Header/index.tsx @@ -14,6 +14,10 @@ * limitations under the License. */ -export * from './Header'; -export * from './HeaderTabsIndicators'; -export * from './types'; +export { Header } from './Header'; +export type { + HeaderProps, + HeaderTab, + HeaderOption, + HeaderBreadcrumb, +} from './types'; diff --git a/packages/canon/src/components/Header/types.ts b/packages/canon/src/components/Header/types.ts index ade1c814db..6cdd51b7d6 100644 --- a/packages/canon/src/components/Header/types.ts +++ b/packages/canon/src/components/Header/types.ts @@ -71,11 +71,6 @@ export interface HeaderTabProps { setHoveredKey: (key: string | null) => void; } -/** - * Props for the header indicators component that handles tab highlighting and animation. - * - * @public - */ export interface HeaderIndicatorsProps { tabRefs: MutableRefObject>; tabsRef: MutableRefObject; diff --git a/packages/canon/src/components/HeaderPage/index.tsx b/packages/canon/src/components/HeaderPage/index.tsx index 3ce5e08d05..c90a0a93f4 100644 --- a/packages/canon/src/components/HeaderPage/index.tsx +++ b/packages/canon/src/components/HeaderPage/index.tsx @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './HeaderPage'; -export * from './types'; +export { HeaderPage } from './HeaderPage'; +export type { HeaderPageProps, HeaderPageTab, HeaderPageOption } from './types';