diff --git a/packages/web-react/src/hooks/styleProps.ts b/packages/web-react/src/hooks/styleProps.ts index a0b8b95909..11b316b9da 100644 --- a/packages/web-react/src/hooks/styleProps.ts +++ b/packages/web-react/src/hooks/styleProps.ts @@ -22,7 +22,7 @@ export function useStyleProps( additionalUtilities?: Record, ): StylePropsResult { const classNamePrefix = useContext(ClassNamePrefixContext); - const { UNSAFE_className, UNSAFE_style, ElementTag, customClassName, ...otherProps } = props; + const { UNSAFE_className, UNSAFE_style, ElementTag, transferClassName, ...otherProps } = props; const { styleUtilities, props: modifiedProps } = useStyleUtilities(otherProps, classNamePrefix, additionalUtilities); const style: CSSProperties = { ...UNSAFE_style }; @@ -58,7 +58,7 @@ export function useStyleProps( const styleProps = { style: Object.keys(style).length > 0 ? style : undefined, - className: classNames(UNSAFE_className, ...styleUtilities, customClassName) || undefined, + className: classNames(UNSAFE_className, ...styleUtilities, transferClassName) || undefined, }; return { @@ -71,7 +71,7 @@ export function useStyleProps( styleProps: { ...(UNSAFE_style !== undefined && { UNSAFE_style }), ...((UNSAFE_className !== undefined || styleUtilities !== undefined) && { - UNSAFE_className: classNames(UNSAFE_className, ...styleUtilities, customClassName), + UNSAFE_className: classNames(UNSAFE_className, ...styleUtilities, transferClassName), }), }, props: modifiedProps as HTMLAttributes, diff --git a/packages/web-react/src/types/shared/style.ts b/packages/web-react/src/types/shared/style.ts index 9c8bef256a..74854e7eb7 100644 --- a/packages/web-react/src/types/shared/style.ts +++ b/packages/web-react/src/types/shared/style.ts @@ -20,11 +20,11 @@ export interface SpacingCSSProperties extends CSSProperties { [index: `--${string}`]: string | undefined | number; } -type ElementTagType = string | ElementType; +export type ElementTypeProp = string | ElementType; export interface StyleProps extends SpacingProps { - customClassName?: string; - ElementTag?: ElementTagType; + ElementTag?: ElementTypeProp; + transferClassName?: string; // For backward compatibility! /** Sets the CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. Only use as a **last resort**. Use style props instead. */ UNSAFE_className?: string; diff --git a/packages/web-react/src/types/tooltip.ts b/packages/web-react/src/types/tooltip.ts index 519db1fe8b..f0ecd61511 100644 --- a/packages/web-react/src/types/tooltip.ts +++ b/packages/web-react/src/types/tooltip.ts @@ -1,6 +1,6 @@ import { Placement, Strategy } from '@floating-ui/react'; -import { ElementType, ReactNode } from 'react'; -import { ChildrenProps, ClickEvent, StyleProps, TransferProps } from './shared'; +import { ReactNode } from 'react'; +import { ChildrenProps, ClickEvent, ElementTypeProp, StyleProps, TransferProps } from './shared'; export const TOOLTIP_TRIGGER = { CLICK: 'click', @@ -13,7 +13,7 @@ export const TOOLTIP_TRIGGER = { export type TooltipTriggerType = 'click' | 'hover' | 'manual'; export interface TooltipTriggerProps extends StyleProps, TransferProps { - elementType?: ElementType | string; + elementType?: ElementTypeProp; children?: string | ReactNode | ((props: { isOpen: boolean }) => ReactNode); }