Skip to content

Commit

Permalink
fix(react-aria): exposes internal leaking types (#25403)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus authored Oct 28, 2022
1 parent 81f33ef commit f76f56f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
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"
}
5 changes: 4 additions & 1 deletion packages/react-components/react-aria/etc/react-aria.api.md
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';

0 comments on commit f76f56f

Please sign in to comment.