Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-aria): exposes internal leaking typings #25403

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "exposes internal typings: ARIAButtonAlteredProps and ARIAButtonElement",
"packageName": "@fluentui/react-aria",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import * as React_2 from 'react';
import type { ResolveShorthandFunction } from '@fluentui/react-utilities';
import type { Slot } from '@fluentui/react-utilities';

// @internal (undocumented)
// @public
export type ARIAButtonAlteredProps<Type extends ARIAButtonType> = (Type extends 'button' ? Pick<JSX.IntrinsicElements['button'], 'onClick' | 'onKeyDown' | 'onKeyUp' | 'disabled' | 'aria-disabled' | 'tabIndex'> : never) | (Type extends 'a' ? Pick<JSX.IntrinsicElements['a'], 'onClick' | 'onKeyDown' | 'onKeyUp' | 'aria-disabled' | 'tabIndex' | 'role' | 'href'> : never) | (Type extends 'div' ? Pick<JSX.IntrinsicElements['div'], 'onClick' | 'onKeyDown' | 'onKeyUp' | 'aria-disabled' | 'tabIndex' | 'role'> : never);

// @public (undocumented)
export type ARIAButtonElement<AlternateAs extends 'a' | 'div' = 'a' | 'div'> = HTMLButtonElement | (AlternateAs extends 'a' ? HTMLAnchorElement : never) | (AlternateAs extends 'div' ? HTMLDivElement : never);

// @internal (undocumented)
Expand Down
4 changes: 0 additions & 4 deletions packages/react-components/react-aria/src/button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends

export type ARIAButtonType = 'button' | 'a' | 'div';

/**
* @internal
*/
export type ARIAButtonElement<AlternateAs extends 'a' | 'div' = 'a' | 'div'> =
| HTMLButtonElement
| (AlternateAs extends 'a' ? HTMLAnchorElement : never)
Expand Down Expand Up @@ -44,7 +41,6 @@ export type ARIAButtonSlotProps<AlternateAs extends 'a' | 'div' = 'a' | 'div'> =
Pick<ARIAButtonProps<ARIAButtonType>, 'disabled' | 'disabledFocusable'>;

/**
* @internal
* Props that will be modified internally by `useARIAButtonProps` by each case.
* This typing is to ensure a well specified return value for `useARIAbButtonProps`
*/
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/react-aria/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type {
ARIAButtonType,
ARIAButtonElement,
ARIAButtonElementIntersection,
ARIAButtonAlteredProps,
} from './button/index';