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

Update V9 ComponentCommons type to ComponentCommonsUnstable #21607

Closed
wants to merge 12 commits into from
Closed
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
19 changes: 12 additions & 7 deletions apps/vr-tests/src/stories/Badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { Badge, BadgeCommons } from '@fluentui/react-badge';
import { Badge, BadgeCommonsUnstable } from '@fluentui/react-badge';
import { CircleRegular } from '@fluentui/react-icons';
import { mergeClasses, makeStyles, shorthands } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';

const badgeColors: BadgeCommons['color'][] = [
const badgeColors: BadgeCommonsUnstable['color'][] = [
'brand',
'danger',
'important',
Expand All @@ -16,7 +16,12 @@ const badgeColors: BadgeCommons['color'][] = [
'warning',
];

const badgeAppearances: BadgeCommons['appearance'][] = ['filled', 'outline', 'tint', 'ghost'];
const badgeAppearances: BadgeCommonsUnstable['appearance'][] = [
'filled',
'outline',
'tint',
'ghost',
];

const useStyles = makeStyles({
container: {
Expand All @@ -40,12 +45,12 @@ const useStyles = makeStyles({
},
});

const BadgeAppearanceTemplate: React.FC<{ appearance: BadgeCommons['appearance'] }> = ({
const BadgeAppearanceTemplate: React.FC<{ appearance: BadgeCommonsUnstable['appearance'] }> = ({
appearance,
}) => {
const styles = useStyles();

const badges = new Map<BadgeCommons['color'], JSX.Element[]>();
const badges = new Map<BadgeCommonsUnstable['color'], JSX.Element[]>();
badges.set('brand', []);
badges.set('danger', []);
badges.set('severe', []);
Expand Down Expand Up @@ -109,7 +114,7 @@ const BadgeAppearanceTemplate: React.FC<{ appearance: BadgeCommons['appearance']

return (
<div>
{Array.from(badges.keys()).map((color: BadgeCommons['color'], i) => (
{Array.from(badges.keys()).map((color: BadgeCommonsUnstable['color'], i) => (
<div key={i} className={styles.container}>
<div
className={mergeClasses(
Expand Down Expand Up @@ -148,7 +153,7 @@ storiesOf('Badge Converged - sizes', module).addStory(
'medium',
'large',
'extra-large',
] as BadgeCommons['size'][]).map(size => (
] as BadgeCommonsUnstable['size'][]).map(size => (
<Badge key={size} size={size} />
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-accordion",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-avatar",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-badge",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-button",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-checkbox",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-divider",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-image",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-label",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-link",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-menu",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-popover",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-portal",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-provider",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-slider",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-switch",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-text",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "change commons type to be unstable",
"packageName": "@fluentui/react-tooltip",
"email": "mgodbolt@microsoft.com",
"dependentChangeType": "patch"
}
22 changes: 11 additions & 11 deletions packages/react-accordion/etc/react-accordion.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Accordion: ForwardRefComponent<AccordionProps>;
export const accordionClassName = "fui-Accordion";

// @public (undocumented)
export type AccordionCommons = {
export type AccordionCommonsUnstable = {
navigable: boolean;
multiple: boolean;
collapsible: boolean;
Expand All @@ -29,7 +29,7 @@ export type AccordionCommons = {
export const AccordionContext: Context<AccordionContextValue>;

// @public (undocumented)
export type AccordionContextValue = Omit<AccordionCommons, 'multiple'> & {
export type AccordionContextValue = Omit<AccordionCommonsUnstable, 'multiple'> & {
openItems: AccordionItemValue[];
requestToggle: (event: AccordionToggleEvent, data: AccordionToggleData) => void;
};
Expand All @@ -46,7 +46,7 @@ export const AccordionHeader: ForwardRefComponent<AccordionHeaderProps>;
export const accordionHeaderClassName = "fui-AccordionHeader";

// @public (undocumented)
export type AccordionHeaderCommons = {
export type AccordionHeaderCommonsUnstable = {
size: AccordionHeaderSize;
expandIconPosition: AccordionHeaderExpandIconPosition;
inline: boolean;
Expand All @@ -69,7 +69,7 @@ export type AccordionHeaderContextValues = {
export type AccordionHeaderExpandIconPosition = 'start' | 'end';

// @public (undocumented)
export type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & Partial<AccordionHeaderCommons>;
export type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & Partial<AccordionHeaderCommonsUnstable>;

// @public (undocumented)
export type AccordionHeaderSize = 'small' | 'medium' | 'large' | 'extra-large';
Expand All @@ -83,7 +83,7 @@ export type AccordionHeaderSlots = {
};

// @public (undocumented)
export type AccordionHeaderState = ComponentState<AccordionHeaderSlots> & AccordionHeaderCommons & AccordionHeaderContextValue;
export type AccordionHeaderState = ComponentState<AccordionHeaderSlots> & AccordionHeaderCommonsUnstable & AccordionHeaderContextValue;

// @public (undocumented)
export type AccordionIndex = number | number[];
Expand All @@ -95,7 +95,7 @@ export const AccordionItem: ForwardRefComponent<AccordionItemProps>;
export const accordionItemClassName = "fui-AccordionItem";

// @public (undocumented)
export type AccordionItemCommons = {
export type AccordionItemCommonsUnstable = {
disabled: boolean;
value: AccordionItemValue;
};
Expand All @@ -104,7 +104,7 @@ export type AccordionItemCommons = {
export const AccordionItemContext: React_2.Context<AccordionItemContextValue>;

// @public (undocumented)
export type AccordionItemContextValue = Omit<AccordionItemCommons, 'value'> & {
export type AccordionItemContextValue = Omit<AccordionItemCommonsUnstable, 'value'> & {
open: boolean;
onHeaderClick(ev: React_2.MouseEvent | React_2.KeyboardEvent): void;
};
Expand All @@ -115,15 +115,15 @@ export type AccordionItemContextValues = {
};

// @public (undocumented)
export type AccordionItemProps = ComponentProps<AccordionItemSlots> & Partial<AccordionItemCommons> & Pick<AccordionItemCommons, 'value'>;
export type AccordionItemProps = ComponentProps<AccordionItemSlots> & Partial<AccordionItemCommonsUnstable> & Pick<AccordionItemCommonsUnstable, 'value'>;

// @public (undocumented)
export type AccordionItemSlots = {
root: Slot<'div'>;
};

// @public (undocumented)
export type AccordionItemState = ComponentState<AccordionItemSlots> & AccordionItemCommons & AccordionItemContextValue;
export type AccordionItemState = ComponentState<AccordionItemSlots> & AccordionItemCommonsUnstable & AccordionItemContextValue;

// @public (undocumented)
export type AccordionItemValue = unknown;
Expand All @@ -148,7 +148,7 @@ export type AccordionPanelState = ComponentState<AccordionPanelSlots> & {
};

// @public (undocumented)
export type AccordionProps = ComponentProps<AccordionSlots> & Partial<AccordionCommons> & {
export type AccordionProps = ComponentProps<AccordionSlots> & Partial<AccordionCommonsUnstable> & {
openItems?: AccordionItemValue | AccordionItemValue[];
defaultOpenItems?: AccordionItemValue | AccordionItemValue[];
onToggle?: AccordionToggleEventHandler;
Expand All @@ -160,7 +160,7 @@ export type AccordionSlots = {
};

// @public (undocumented)
export type AccordionState = ComponentState<AccordionSlots> & AccordionCommons & AccordionContextValue;
export type AccordionState = ComponentState<AccordionSlots> & AccordionCommonsUnstable & AccordionContextValue;

// @public (undocumented)
export type AccordionToggleData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type AccordionToggleEvent<E = HTMLElement> = React.MouseEvent<E> | React.

export type AccordionToggleEventHandler = (event: AccordionToggleEvent, data: AccordionToggleData) => void;

export type AccordionCommons = {
export type AccordionCommonsUnstable = {
/**
* Indicates if keyboard navigation is available
*/
Expand All @@ -23,7 +23,7 @@ export type AccordionCommons = {
collapsible: boolean;
};

export type AccordionContextValue = Omit<AccordionCommons, 'multiple'> & {
export type AccordionContextValue = Omit<AccordionCommonsUnstable, 'multiple'> & {
/**
* The list of opened panels by index
*/
Expand All @@ -48,7 +48,7 @@ export type AccordionToggleData = {
};

export type AccordionProps = ComponentProps<AccordionSlots> &
Partial<AccordionCommons> & {
Partial<AccordionCommonsUnstable> & {
/**
* Controls the state of the panel
*/
Expand All @@ -60,4 +60,4 @@ export type AccordionProps = ComponentProps<AccordionSlots> &
onToggle?: AccordionToggleEventHandler;
};

export type AccordionState = ComponentState<AccordionSlots> & AccordionCommons & AccordionContextValue;
export type AccordionState = ComponentState<AccordionSlots> & AccordionCommonsUnstable & AccordionContextValue;
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type AccordionHeaderSlots = {
icon?: Slot<'div'>;
};

export type AccordionHeaderCommons = {
export type AccordionHeaderCommonsUnstable = {
/**
* Size of spacing in the heading
*/
Expand All @@ -49,8 +49,9 @@ export type AccordionHeaderCommons = {
inline: boolean;
};

export type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & Partial<AccordionHeaderCommons>;
export type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> &
Partial<AccordionHeaderCommonsUnstable>;

export type AccordionHeaderState = ComponentState<AccordionHeaderSlots> &
AccordionHeaderCommons &
AccordionHeaderCommonsUnstable &
AccordionHeaderContextValue;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';

export type AccordionItemContextValue = Omit<AccordionItemCommons, 'value'> & {
export type AccordionItemContextValue = Omit<AccordionItemCommonsUnstable, 'value'> & {
open: boolean;
onHeaderClick(ev: React.MouseEvent | React.KeyboardEvent): void;
};
Expand All @@ -14,7 +14,7 @@ export type AccordionItemSlots = {
root: Slot<'div'>;
};

export type AccordionItemCommons = {
export type AccordionItemCommonsUnstable = {
/**
* Disables opening/closing of panel
*/
Expand All @@ -26,9 +26,11 @@ export type AccordionItemCommons = {
};

export type AccordionItemProps = ComponentProps<AccordionItemSlots> &
Partial<AccordionItemCommons> &
Pick<AccordionItemCommons, 'value'>;
Partial<AccordionItemCommonsUnstable> &
Pick<AccordionItemCommonsUnstable, 'value'>;

export type AccordionItemValue = unknown;

export type AccordionItemState = ComponentState<AccordionItemSlots> & AccordionItemCommons & AccordionItemContextValue;
export type AccordionItemState = ComponentState<AccordionItemSlots> &
AccordionItemCommonsUnstable &
AccordionItemContextValue;
Loading