Skip to content
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": "prerelease",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-alert",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-dialog",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-menu",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-message-bar-preview",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-migration-v0-v9",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-popover",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-provider",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-table",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-tags",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-toast",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-toolbar",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-tree",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { Avatar } from '@fluentui/react-avatar';
import { Button } from '@fluentui/react-button';
import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';

import type { AlertProps, AlertState } from './Alert.types';

Expand Down Expand Up @@ -57,8 +57,11 @@ export const useAlert_unstable = (props: AlertProps, ref: React.Ref<HTMLElement>
icon,
intent,
root: slot.always(
getNativeElementProps('div', {
ref,
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
role: defaultRole,
children: props.children,
...props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import type { DialogActionsProps, DialogActionsState } from './DialogActions.types';

/**
Expand All @@ -21,8 +21,11 @@ export const useDialogActions_unstable = (
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
ref,
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
...props,
}),
{ elementType: 'div' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import type { DialogBodyProps, DialogBodyState } from './DialogBody.types';

/**
Expand All @@ -17,8 +17,11 @@ export const useDialogBody_unstable = (props: DialogBodyProps, ref: React.Ref<HT
root: 'div',
},
root: slot.always(
getNativeElementProps(props.as ?? 'div', {
ref,
getIntrinsicElementProps(props.as ?? 'div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
...props,
}),
{ elementType: 'div' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { DialogContentProps, DialogContentState } from './DialogContent.types';

/**
Expand All @@ -20,8 +20,11 @@ export const useDialogContent_unstable = (
root: 'div',
},
root: slot.always(
getNativeElementProps(props.as ?? 'div', {
ref,
getIntrinsicElementProps(props.as ?? 'div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
...props,
}),
{ elementType: 'div' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import {
getNativeElementProps,
useEventCallback,
useMergedRefs,
isResolvedShorthand,
slot,
getIntrinsicElementProps,
} from '@fluentui/react-utilities';
import type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';
import { useDialogContext_unstable } from '../../contexts';
Expand Down Expand Up @@ -73,15 +73,18 @@ export const useDialogSurface_unstable = (
backdrop,
mountNode: props.mountNode,
root: slot.always(
getNativeElementProps(props.as ?? 'div', {
getIntrinsicElementProps('div', {
tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150
'aria-modal': modalType !== 'non-modal',
role: modalType === 'alert' ? 'alertdialog' : 'dialog',
'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
...props,
...modalAttributes,
onKeyDown: handleKeyDown,
ref: useMergedRefs(ref, dialogRef),
// FIXME:
// `DialogSurfaceElement` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: useMergedRefs(ref, dialogRef) as React.Ref<HTMLDivElement>,
}),
{ elementType: 'div' },
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';
import { useDialogContext_unstable } from '../../contexts/dialogContext';
import { Dismiss20Regular } from '@fluentui/react-icons';
Expand All @@ -16,7 +16,7 @@ import { useDialogTitleInternalStyles } from './useDialogTitleStyles.styles';
* @param ref - reference to root HTMLElement of DialogTitle
*/
export const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLDivElement>): DialogTitleState => {
const { as, action } = props;
const { action } = props;
const modalType = useDialogContext_unstable(ctx => ctx.modalType);
const internalStyles = useDialogTitleInternalStyles();

Expand All @@ -26,7 +26,7 @@ export const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<
action: 'div',
},
root: slot.always(
getNativeElementProps(as ?? 'h2', {
getIntrinsicElementProps('h2', {
ref,
id: useDialogContext_unstable(ctx => ctx.dialogTitleId),
...props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import * as React from 'react';
import type { MenuDividerProps, MenuDividerState } from './MenuDivider.types';

Expand All @@ -11,11 +11,14 @@ export const useMenuDivider_unstable = (props: MenuDividerProps, ref: React.Ref<
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
getIntrinsicElementProps('div', {
role: 'presentation',
'aria-hidden': true,
...props,
ref,
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
}),
{ elementType: 'div' },
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, useId, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';
import { MenuGroupProps, MenuGroupState } from './MenuGroup.types';

/**
Expand All @@ -13,8 +13,11 @@ export function useMenuGroup_unstable(props: MenuGroupProps, ref: React.Ref<HTML
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
ref,
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
'aria-labelledby': headerId,
role: 'group',
...props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useMenuGroupContext_unstable } from '../../contexts/menuGroupContext';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { MenuGroupHeaderProps, MenuGroupHeaderState } from './MenuGroupHeader.types';

/**
Expand All @@ -17,8 +17,11 @@ export function useMenuGroupHeader_unstable(
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
ref,
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
id,
...props,
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { useEventCallback, useMergedRefs, getNativeElementProps, slot } from '@fluentui/react-utilities';
import { useEventCallback, useMergedRefs, getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
import { useCharacterSearch } from './useCharacterSearch';
import { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';
Expand All @@ -13,7 +13,12 @@ import {
import { useMenuListContext_unstable } from '../../contexts/menuListContext';
import { useMenuContext_unstable } from '../../contexts/menuContext';
import type { MenuItemProps, MenuItemState } from './MenuItem.types';
import { ARIAButtonElement, ARIAButtonElementIntersection, useARIAButtonProps } from '@fluentui/react-aria';
import {
ARIAButtonElement,
ARIAButtonElementIntersection,
ARIAButtonProps,
useARIAButtonProps,
} from '@fluentui/react-aria';
import { Enter, Space } from '@fluentui/keyboard-keys';

const ChevronRightIcon = bundleIcon(ChevronRightFilled, ChevronRightRegular);
Expand Down Expand Up @@ -47,9 +52,9 @@ export const useMenuItem_unstable = (props: MenuItemProps, ref: React.Ref<ARIABu
secondaryContent: 'span',
},
root: slot.always(
getNativeElementProps(
getIntrinsicElementProps(
as,
useARIAButtonProps(as, {
useARIAButtonProps<'div', ARIAButtonProps<'div'>>(as, {
role: 'menuitem',
...props,
disabled: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import type { MenuItemLinkProps, MenuItemLinkState } from './MenuItemLink.types';
import { useMenuItem_unstable } from '../MenuItem/useMenuItem';
import { MenuItemProps } from '../MenuItem/MenuItem.types';
Expand All @@ -26,7 +26,7 @@ export const useMenuItemLink_unstable = (
root: 'a',
},
root: slot.always(
getNativeElementProps('a', {
getIntrinsicElementProps('a', {
ref,
role: 'menuitem',
...props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
useMergedRefs,
useEventCallback,
useControllableState,
getNativeElementProps,
getIntrinsicElementProps,
slot,
} from '@fluentui/react-utilities';
import { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';
Expand Down Expand Up @@ -110,8 +110,11 @@ export const useMenuList_unstable = (props: MenuListProps, ref: React.Ref<HTMLEl
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
ref: useMergedRefs(ref, innerRef),
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,
role: 'menu',
'aria-labelledby': menuContext.triggerId,
...focusAttributes,
Expand Down
Loading