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": "patch",
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps",
"packageName": "@fluentui/react-accordion",
"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-avatar",
"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-badge",
"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-button",
"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-combobox",
"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-divider",
"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-field",
"email": "[email protected]",
"dependentChangeType": "patch"
}
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-infobutton",
"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-label",
"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-link",
"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-persona",
"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-progress",
"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-radio",
"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-skeleton",
"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-spinner",
"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-tabs",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
import type { AccordionProps, AccordionState } from './Accordion.types';
import type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
Expand Down Expand Up @@ -49,10 +49,13 @@ export const useAccordion_unstable = <Value = AccordionItemValue>(
root: 'div',
},
root: slot.always(
getNativeElementProps('div', {
getIntrinsicElementProps('div', {
...props,
...(navigation ? arrowNavigationProps : undefined),
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, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, isResolvedShorthand, useEventCallback, slot } from '@fluentui/react-utilities';
import { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';
import type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';
import { useAccordionContext_unstable } from '../../contexts/accordion';
Expand All @@ -16,7 +16,7 @@ export const useAccordionHeader_unstable = (
props: AccordionHeaderProps,
ref: React.Ref<HTMLElement>,
): AccordionHeaderState => {
const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
const { icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;
const { value, disabled, open } = useAccordionItemContext_unstable();
const requestToggle = useAccordionContext_unstable(ctx => ctx.requestToggle);

Expand Down Expand Up @@ -51,8 +51,11 @@ export const useAccordionHeader_unstable = (
icon: 'div',
},
root: slot.always(
getNativeElementProps(as || '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, useEventCallback } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';
import type { AccordionItemProps, AccordionItemState } from './AccordionItem.types';
import type { AccordionToggleEvent } from '../Accordion/Accordion.types';
import { useAccordionContext_unstable } from '../../contexts/accordion';
Expand Down Expand Up @@ -27,6 +27,15 @@ export const useAccordionItem_unstable = (
components: {
root: 'div',
},
root: slot.always(getNativeElementProps('div', { ref, ...props }), { elementType: 'div' }),
root: slot.always(
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' },
),
};
};
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 { useTabsterAttributes } from '@fluentui/react-tabster';
import { useAccordionContext_unstable } from '../../contexts/accordion';
import type { AccordionPanelProps, AccordionPanelState } from './AccordionPanel.types';
Expand All @@ -24,8 +24,11 @@ export const useAccordionPanel_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,
...(navigation && focusableProps),
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';
import { getInitials } from '../../utils/index';
import type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';
import { PersonRegular } from '@fluentui/react-icons';
Expand Down Expand Up @@ -33,7 +33,7 @@ export const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElemen
const baseId = useId('avatar-');

const root: AvatarState['root'] = slot.always(
getNativeElementProps(
getIntrinsicElementProps(
'span',
{
role: 'img',
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 { AvatarGroupProps, AvatarGroupState } from './AvatarGroup.types';

/**
Expand All @@ -15,12 +15,15 @@ export const useAvatarGroup_unstable = (props: AvatarGroupProps, ref: React.Ref<
const { layout = 'spread', size = defaultAvatarGroupSize } = props;

const root = slot.always(
getNativeElementProps(
getIntrinsicElementProps(
'div',
{
role: 'group',
...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>,
},
['size'],
),
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 { BadgeProps, BadgeState } from './Badge.types';

/**
Expand All @@ -25,8 +25,11 @@ export const useBadge_unstable = (props: BadgeProps, ref: React.Ref<HTMLElement>
icon: 'span',
},
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
Expand Up @@ -106,7 +106,7 @@ export const SplitButton: ForwardRefComponent<SplitButtonProps>;
export const splitButtonClassNames: SlotClassNames<SplitButtonSlots>;

// @public (undocumented)
export type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
export type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root' | 'as'> & Omit<MenuButtonProps, 'root' | 'as'>;

// @public (undocumented)
export type SplitButtonSlots = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { useButtonContext } from '../../contexts/ButtonContext';
import type { ButtonProps, ButtonState } from './Button.types';

Expand Down Expand Up @@ -36,7 +36,7 @@ export const useButton_unstable = (
iconOnly: Boolean(iconShorthand?.children && !props.children), // Slots definition
components: { root: 'button', icon: 'span' },
root: slot.always(
getNativeElementProps(
getIntrinsicElementProps(
as,
useARIAButtonShorthand<ARIAButtonSlotProps<'a'>>(props, {
required: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export type SplitButtonSlots = {
};

export type SplitButtonProps = ComponentProps<SplitButtonSlots> &
Omit<ButtonProps, 'root'> &
Omit<MenuButtonProps, 'root'>;
Omit<ButtonProps, 'root' | 'as'> &
Omit<MenuButtonProps, 'root' | 'as'>;

export type SplitButtonState = ComponentState<SplitButtonSlots> &
Omit<ButtonState, 'components' | 'iconOnly' | 'root'> &
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 { Button } from '../Button/Button';
import { MenuButton } from '../MenuButton/MenuButton';
import type { SplitButtonProps, SplitButtonState } from './SplitButton.types';
Expand All @@ -26,7 +26,6 @@ export const useSplitButton_unstable = (
shape = 'rounded',
size = 'medium',
} = props;

const baseId = useId('splitButton-');

const menuButtonShorthand = slot.optional(menuButton, {
Expand Down Expand Up @@ -77,7 +76,7 @@ export const useSplitButton_unstable = (
shape,
size, // Slots definition
components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button },
root: slot.always(getNativeElementProps('div', { ref, ...props }), { elementType: 'div' }),
root: slot.always(getIntrinsicElementProps('div', { ref, ...props }), { elementType: 'div' }),
menuButton: menuButtonShorthand,
primaryActionButton: primaryActionButtonShorthand,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import {
getNativeElementProps,
getIntrinsicElementProps,
mergeCallbacks,
useEventCallback,
useMergedRefs,
Expand Down Expand Up @@ -94,8 +94,11 @@ export const useListbox_unstable = (props: ListboxProps, ref: React.Ref<HTMLElem
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>,
role: multiselect ? 'menu' : 'listbox',
'aria-activedescendant': hasComboboxContext ? undefined : activeOption?.id,
'aria-multiselectable': multiselect,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { getNativeElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';
import { getIntrinsicElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';
import { useContextSelector } from '@fluentui/react-context-selector';
import { CheckmarkFilled, Checkmark12Filled } from '@fluentui/react-icons';
import { ComboboxContext } from '../../contexts/ComboboxContext';
Expand Down Expand Up @@ -116,9 +116,12 @@ export const useOption_unstable = (props: OptionProps, ref: React.Ref<HTMLElemen
checkIcon: 'span',
},
root: slot.always(
getNativeElementProps('div', {
ref: useMergedRefs(ref, optionRef),
'aria-disabled': disabled ? 'true' : undefined,
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, optionRef) as React.Ref<HTMLDivElement>,
'aria-disabled': disabled ? ('true' as const) : undefined,
id,
...semanticProps,
...props,
Expand Down
Loading