Skip to content

Commit

Permalink
fix(UIShell): Export prop types for components (#14657)
Browse files Browse the repository at this point in the history
* fix(UIShell): Export prop types for components

* fix(ui-shell): fix build issues flagged by CI

---------

Co-authored-by: Taylor Jones <[email protected]>
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2023
1 parent 13333a2 commit c939468
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React, {
} from 'react';
import { usePrefix } from '../../internal/usePrefix';

interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
/**
* @description Indicates the element that represents the
* current item within a container or set of related
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import Link from './Link';
import Link, { type LinkProps } from './Link';

export default Link;
export { Link };
export { Link, type LinkProps };
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/HeaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface HeaderContainerRenderProps {
onClickSideNavExpand: () => void;
}

interface HeaderContainerProps {
export interface HeaderContainerProps {
isSideNavExpanded?: boolean;
render: React.ComponentType<HeaderContainerRenderProps>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/HeaderMenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type HeaderMenuButtonBaseProps = Omit<
'title' | 'type'
>;

interface HeaderMenuButtonProps extends HeaderMenuButtonBaseProps {
export interface HeaderMenuButtonProps extends HeaderMenuButtonBaseProps {
'aria-label'?: string;
'aria-labelledby'?: string;
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/HeaderMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Link, { LinkProps, LinkPropTypes } from './Link';
import { usePrefix } from '../../internal/usePrefix';
import deprecate from '../../prop-types/deprecate';

type HeaderMenuItemProps<E extends ElementType> = LinkProps<E> & {
export type HeaderMenuItemProps<E extends ElementType> = LinkProps<E> & {
className?: string | undefined;
isActive?: boolean | undefined;
isCurrentPage?: boolean | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/HeaderName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
import Link, { type LinkProps, LinkPropTypes } from './Link';
import { usePrefix } from '../../internal/usePrefix';

type HeaderNameProps<E extends ElementType> = LinkProps<E> & {
export type HeaderNameProps<E extends ElementType> = LinkProps<E> & {
prefix?: string | undefined;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/HeaderNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes';
import { usePrefix } from '../../internal/usePrefix';

type HeaderNavigationProps = ComponentProps<'nav'>;
export type HeaderNavigationProps = ComponentProps<'nav'>;

export default function HeaderNavigation({
'aria-label': ariaLabel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { type ReactNode } from 'react';
import PropTypes from 'prop-types';
import { usePrefix } from '../../internal/usePrefix';

interface HeaderSideNavItemsProps {
export interface HeaderSideNavItemsProps {
className?: string | undefined;
children?: ReactNode;
hasDivider?: boolean | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { useMatchMedia } from '../../internal/useMatchMedia';
// TO-DO: comment back in when footer is added for rails
// import SideNavFooter from './SideNavFooter';

interface SideNavProps extends ComponentProps<'nav'> {
export interface SideNavProps extends ComponentProps<'nav'> {
expanded?: boolean | undefined;
defaultExpanded?: boolean | undefined;
isChildOfHeader?: boolean | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/UIShell/SkipToContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { ComponentProps } from 'react';
import PropTypes from 'prop-types';
import { usePrefix } from '../../internal/usePrefix';

type SkipToContentProps = Omit<ComponentProps<'a'>, 'children'> & {
export type SkipToContentProps = Omit<ComponentProps<'a'>, 'children'> & {
children?: string | undefined;
};

Expand Down
34 changes: 26 additions & 8 deletions packages/react/src/components/UIShell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,41 @@
export { default as Content } from './Content';

export { default as Header } from './Header';
export { default as HeaderContainer } from './HeaderContainer';
export {
default as HeaderContainer,
type HeaderContainerProps,
} from './HeaderContainer';
export { default as HeaderGlobalAction } from './HeaderGlobalAction';
export { default as HeaderGlobalBar } from './HeaderGlobalBar';
export { default as HeaderMenu } from './HeaderMenu';
export { default as HeaderMenuButton } from './HeaderMenuButton';
export { default as HeaderMenuItem } from './HeaderMenuItem';
export { default as HeaderName } from './HeaderName';
export { default as HeaderNavigation } from './HeaderNavigation';
export {
default as HeaderMenuButton,
type HeaderMenuButtonProps,
} from './HeaderMenuButton';
export {
default as HeaderMenuItem,
type HeaderMenuItemProps,
} from './HeaderMenuItem';
export { default as HeaderName, type HeaderNameProps } from './HeaderName';
export {
default as HeaderNavigation,
type HeaderNavigationProps,
} from './HeaderNavigation';
export { default as HeaderPanel } from './HeaderPanel';
export { default as HeaderSideNavItems } from './HeaderSideNavItems';
export {
default as HeaderSideNavItems,
type HeaderSideNavItemsProps,
} from './HeaderSideNavItems';
export { default as Switcher } from './Switcher';
export { default as SwitcherItem } from './SwitcherItem';
export { default as SwitcherDivider } from './SwitcherDivider';

export { default as SkipToContent } from './SkipToContent';
export {
default as SkipToContent,
type SkipToContentProps,
} from './SkipToContent';

export { default as SideNav } from './SideNav';
export { default as SideNav, type SideNavProps } from './SideNav';
export { default as SideNavDetails } from './SideNavDetails';
export { default as SideNavDivider } from './SideNavDivider';
export { default as SideNavFooter } from './SideNavFooter';
Expand Down

0 comments on commit c939468

Please sign in to comment.