diff --git a/change/@fluentui-api-docs-7e266cc5-ae8b-46da-b22b-e985218f53b8.json b/change/@fluentui-api-docs-7e266cc5-ae8b-46da-b22b-e985218f53b8.json new file mode 100644 index 00000000000000..9630248cf8d039 --- /dev/null +++ b/change/@fluentui-api-docs-7e266cc5-ae8b-46da-b22b-e985218f53b8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: bump api-extractor-model to support typescript 4.7", + "packageName": "@fluentui/api-docs", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-date-time-utilities-4c4aa9e9-90bb-41a0-bf9a-2dfb71e7225d.json b/change/@fluentui-date-time-utilities-4c4aa9e9-90bb-41a0-bf9a-2dfb71e7225d.json new file mode 100644 index 00000000000000..11def202e52d2a --- /dev/null +++ b/change/@fluentui-date-time-utilities-4c4aa9e9-90bb-41a0-bf9a-2dfb71e7225d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/date-time-utilities", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-c7a29270-edda-4443-ac6b-3e6726f93ee6.json b/change/@fluentui-react-c7a29270-edda-4443-ac6b-3e6726f93ee6.json new file mode 100644 index 00000000000000..d99896e89ff13b --- /dev/null +++ b/change/@fluentui-react-c7a29270-edda-4443-ac6b-3e6726f93ee6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/react", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-experiments-86254b1a-bb55-4f56-8958-c6c3ae1e1ae7.json b/change/@fluentui-react-experiments-86254b1a-bb55-4f56-8958-c6c3ae1e1ae7.json new file mode 100644 index 00000000000000..e5560530f673bb --- /dev/null +++ b/change/@fluentui-react-experiments-86254b1a-bb55-4f56-8958-c6c3ae1e1ae7.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: resolve FloatingSuggestion if conditions to mitigate ts 4.7 always true violation\"", + "packageName": "@fluentui/react-experiments", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-migration-v8-v9-88a794f5-92e2-49f3-a5ff-cef44b75db12.json b/change/@fluentui-react-migration-v8-v9-88a794f5-92e2-49f3-a5ff-cef44b75db12.json new file mode 100644 index 00000000000000..8b3adcbb7bc492 --- /dev/null +++ b/change/@fluentui-react-migration-v8-v9-88a794f5-92e2-49f3-a5ff-cef44b75db12.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/react-migration-v8-v9", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-positioning-51a66b94-7733-4fb6-a73f-7aa47f67f21d.json b/change/@fluentui-react-positioning-51a66b94-7733-4fb6-a73f-7aa47f67f21d.json new file mode 100644 index 00000000000000..1892d0f46c4a18 --- /dev/null +++ b/change/@fluentui-react-positioning-51a66b94-7733-4fb6-a73f-7aa47f67f21d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/react-positioning", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-shared-contexts-6abfa676-0116-42b0-90ce-1c3b3050084d.json b/change/@fluentui-react-shared-contexts-6abfa676-0116-42b0-90ce-1c3b3050084d.json new file mode 100644 index 00000000000000..5cbc3dd7f70435 --- /dev/null +++ b/change/@fluentui-react-shared-contexts-6abfa676-0116-42b0-90ce-1c3b3050084d.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: re-generate api.md", + "packageName": "@fluentui/react-shared-contexts", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-tabster-822660c5-1fae-47bd-8a8f-673d210610a5.json b/change/@fluentui-react-tabster-822660c5-1fae-47bd-8a8f-673d210610a5.json new file mode 100644 index 00000000000000..0da85281ee8e05 --- /dev/null +++ b/change/@fluentui-react-tabster-822660c5-1fae-47bd-8a8f-673d210610a5.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/react-tabster", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-virtualizer-a2abc531-b693-4972-8dd3-0f6351663f49.json b/change/@fluentui-react-virtualizer-a2abc531-b693-4972-8dd3-0f6351663f49.json new file mode 100644 index 00000000000000..292673c2d65523 --- /dev/null +++ b/change/@fluentui-react-virtualizer-a2abc531-b693-4972-8dd3-0f6351663f49.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "chore: migrate to ts 4.7 which wont emit undefined anymore for optional arguments", + "packageName": "@fluentui/react-virtualizer", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-tokens-6d7634ab-d750-45b2-94f8-71cf02182dae.json b/change/@fluentui-tokens-6d7634ab-d750-45b2-94f8-71cf02182dae.json new file mode 100644 index 00000000000000..e4f1c8be695d6e --- /dev/null +++ b/change/@fluentui-tokens-6d7634ab-d750-45b2-94f8-71cf02182dae.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix: cast to String keys interpolated within string literals", + "packageName": "@fluentui/tokens", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-utilities-6c590fec-07b4-4e45-855c-5f71bf154b05.json b/change/@fluentui-utilities-6c590fec-07b4-4e45-855c-5f71bf154b05.json new file mode 100644 index 00000000000000..b56a385c7cc97f --- /dev/null +++ b/change/@fluentui-utilities-6c590fec-07b4-4e45-855c-5f71bf154b05.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: cast to String keys interpolated within string literals", + "packageName": "@fluentui/utilities", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/package.json b/package.json index 292308a8bd2960..350c8b50eb7098 100644 --- a/package.json +++ b/package.json @@ -95,9 +95,9 @@ "@griffel/webpack-loader": "2.1.13", "@jest/reporters": "29.5.0", "@mdx-js/loader": "1.6.22", - "@microsoft/api-extractor": "7.28.7", - "@microsoft/api-extractor-model": "7.22.2", - "@microsoft/tsdoc": "0.14.2", + "@microsoft/api-extractor": "7.31.2", + "@microsoft/api-extractor-model": "7.24.2", + "@microsoft/tsdoc": "0.14.1", "@microsoft/eslint-plugin-sdl": "0.1.9", "@microsoft/load-themed-styles": "1.10.26", "@microsoft/loader-load-themed-styles": "2.0.17", @@ -344,7 +344,7 @@ "tsconfig-paths": "4.1.0", "tsconfig-paths-webpack-plugin": "4.0.0", "tslib": "2.4.1", - "typescript": "4.6.4", + "typescript": "4.7.4", "vinyl": "2.2.0", "vrscreenshotdiff": "0.0.17", "webpack": "5.83.1", diff --git a/packages/api-docs/package.json b/packages/api-docs/package.json index 8412a41cac6272..cd7bdddc2378b4 100644 --- a/packages/api-docs/package.json +++ b/packages/api-docs/package.json @@ -21,7 +21,7 @@ "@fluentui/scripts-tasks": "*" }, "dependencies": { - "@microsoft/api-extractor-model": "7.17.1", + "@microsoft/api-extractor-model": "7.24.2", "@microsoft/tsdoc": "0.14.1", "fs-extra": "^8.1.0" } diff --git a/packages/date-time-utilities/etc/date-time-utilities.api.md b/packages/date-time-utilities/etc/date-time-utilities.api.md index 0da93885a90d41..af45071f1a4442 100644 --- a/packages/date-time-utilities/etc/date-time-utilities.api.md +++ b/packages/date-time-utilities/etc/date-time-utilities.api.md @@ -96,13 +96,13 @@ export const formatMonthDayYear: (date: Date, strings: IDateGridStrings) => stri export const formatMonthYear: (date: Date, strings: IDateGridStrings) => string; // @public -export const formatTimeString: (date: Date, showSeconds?: boolean | undefined, useHour12?: boolean | undefined) => string; +export const formatTimeString: (date: Date, showSeconds?: boolean, useHour12?: boolean) => string; // @public export const formatYear: (date: Date) => string; // @public -export const getBoundedDateRange: (dateRange: Date[], minDate?: Date | undefined, maxDate?: Date | undefined) => Date[]; +export const getBoundedDateRange: (dateRange: Date[], minDate?: Date, maxDate?: Date) => Date[]; // @public export const getDateFromTimeSelection: (useHour12: boolean, dateStartAnchor: Date, selectedTime: string) => Date; diff --git a/packages/fluentui/react-northstar/src/components/Portal/Portal.tsx b/packages/fluentui/react-northstar/src/components/Portal/Portal.tsx index f3aee1fa8c450e..05015b944fb9ce 100644 --- a/packages/fluentui/react-northstar/src/components/Portal/Portal.tsx +++ b/packages/fluentui/react-northstar/src/components/Portal/Portal.tsx @@ -99,7 +99,7 @@ export const Portal: React.FC & FluentComponentStaticProps { const contentToRender = childrenExist(children) ? children : content; - const focusTrapZoneProps = (_.keys(trapFocus).length && trapFocus) || {}; + const focusTrapZoneProps = typeof trapFocus === 'boolean' ? {} : trapFocus; return ( open && ( diff --git a/packages/react-components/react-breadcrumb/etc/react-breadcrumb.api.md b/packages/react-components/react-breadcrumb/etc/react-breadcrumb.api.md index a6169e5317cced..0fd42469bdb0c0 100644 --- a/packages/react-components/react-breadcrumb/etc/react-breadcrumb.api.md +++ b/packages/react-components/react-breadcrumb/etc/react-breadcrumb.api.md @@ -153,10 +153,10 @@ export const renderBreadcrumbItem_unstable: (state: BreadcrumbItemState) => JSX. export const renderBreadcrumbLink_unstable: (state: BreadcrumbLinkState) => JSX.Element; // @public (undocumented) -export const truncateBreadcrumbLongName: (content: string, maxLength?: number | undefined) => string; +export const truncateBreadcrumbLongName: (content: string, maxLength?: number) => string; // @public (undocumented) -export const truncateBreadcrumLongTooltip: (content: string, maxLength?: number | undefined) => string; +export const truncateBreadcrumLongTooltip: (content: string, maxLength?: number) => string; // @public export const useBreadcrumb_unstable: (props: BreadcrumbProps, ref: React_2.Ref) => BreadcrumbState; diff --git a/packages/react-components/react-migration-v8-v9/etc/react-migration-v8-v9.api.md b/packages/react-components/react-migration-v8-v9/etc/react-migration-v8-v9.api.md index 9ab032796c3502..67f9a350db22a0 100644 --- a/packages/react-components/react-migration-v8-v9/etc/react-migration-v8-v9.api.md +++ b/packages/react-components/react-migration-v8-v9/etc/react-migration-v8-v9.api.md @@ -63,10 +63,10 @@ export const CompoundButtonShim: React_2.ForwardRefExoticComponent BrandVariants; // @public -export const createV8Theme: (brandColors: BrandVariants, themeV9: Theme, isDarkTheme?: boolean, themeV8?: Theme_2 | undefined) => Theme_2; +export const createV8Theme: (brandColors: BrandVariants, themeV9: Theme, isDarkTheme?: boolean, themeV8?: Theme_2) => Theme_2; // @public -export const createV9Theme: (themeV8: Theme_2, baseThemeV9?: Theme | undefined) => Theme; +export const createV9Theme: (themeV8: Theme_2, baseThemeV9?: Theme) => Theme; // @public export const DefaultButtonShim: React_2.ForwardRefExoticComponent>; diff --git a/packages/react-components/react-positioning/etc/react-positioning.api.md b/packages/react-components/react-positioning/etc/react-positioning.api.md index 9455e814d73d2e..64ea1e3f13ebef 100644 --- a/packages/react-components/react-positioning/etc/react-positioning.api.md +++ b/packages/react-components/react-positioning/etc/react-positioning.api.md @@ -111,7 +111,7 @@ export type SetVirtualMouseTarget = (event: React_2.MouseEvent | MouseEvent | un export function usePositioning(options: UsePositioningOptions): UsePositioningReturn; // @internal -export const usePositioningMouseTarget: (initialState?: PositioningVirtualElement | (() => PositioningVirtualElement) | undefined) => readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget]; +export const usePositioningMouseTarget: (initialState?: PositioningVirtualElement | (() => PositioningVirtualElement)) => readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget]; // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-shared-contexts/etc/react-shared-contexts.api.md b/packages/react-components/react-shared-contexts/etc/react-shared-contexts.api.md index ec1af62ae00e65..692f39f433a054 100644 --- a/packages/react-components/react-shared-contexts/etc/react-shared-contexts.api.md +++ b/packages/react-components/react-shared-contexts/etc/react-shared-contexts.api.md @@ -331,7 +331,7 @@ export const useCustomStyleHook_unstable: (hook: keyof CustomStyleHooksContextVa // @public (undocumented) export function useFluent_unstable(): ProviderContextValue_unstable; -// Warning: (ae-incompatible-release-tags) The symbol "useOverrides" is marked as @public, but its signature references "OverridesContextValue" which is marked as @internal +// Warning: (ae-incompatible-release-tags) The symbol "useOverrides" is marked as @public, but its signature references "OverridesContextValue_unstable" which is marked as @internal // // @public (undocumented) export function useOverrides_unstable(): OverridesContextValue_unstable; diff --git a/packages/react-components/react-tabster/etc/react-tabster.api.md b/packages/react-components/react-tabster/etc/react-tabster.api.md index c8ce15a06184a1..e2a7ba8fd51cf2 100644 --- a/packages/react-components/react-tabster/etc/react-tabster.api.md +++ b/packages/react-components/react-tabster/etc/react-tabster.api.md @@ -58,7 +58,7 @@ export interface UseArrowNavigationGroupOptions { } // @public -export const useFocusableGroup: (options?: UseFocusableGroupOptions | undefined) => Types.TabsterDOMAttribute; +export const useFocusableGroup: (options?: UseFocusableGroupOptions) => Types.TabsterDOMAttribute; // @public (undocumented) export interface UseFocusableGroupOptions { diff --git a/packages/react-components/react-toast/etc/react-toast.api.md b/packages/react-components/react-toast/etc/react-toast.api.md index daef50bbcddee1..4dc2014c3f33da 100644 --- a/packages/react-components/react-toast/etc/react-toast.api.md +++ b/packages/react-components/react-toast/etc/react-toast.api.md @@ -170,7 +170,7 @@ export const useToastBodyStyles_unstable: (state: ToastBodyState) => ToastBodySt // @public (undocumented) export function useToastController(toasterId?: ToasterId): { - dispatchToast: (content: React_2.ReactNode, options?: DispatchToastOptions | undefined) => void; + dispatchToast: (content: React_2.ReactNode, options?: DispatchToastOptions) => void; dismissToast: (toastId: ToastId) => void; dismissAllToasts: () => void; updateToast: (options: UpdateToastOptions) => void; diff --git a/packages/react-components/react-virtualizer/etc/react-virtualizer.api.md b/packages/react-components/react-virtualizer/etc/react-virtualizer.api.md index 069fc45c7692df..abbcc63f6a8e2d 100644 --- a/packages/react-components/react-virtualizer/etc/react-virtualizer.api.md +++ b/packages/react-components/react-virtualizer/etc/react-virtualizer.api.md @@ -72,7 +72,7 @@ export const useDynamicVirtualizerMeasure: (virtua }; // @public -export const useIntersectionObserver: (callback: IntersectionObserverCallback, options?: IntersectionObserverInit | undefined) => { +export const useIntersectionObserver: (callback: IntersectionObserverCallback, options?: IntersectionObserverInit) => { setObserverList: Dispatch>; setObserverInit: Dispatch>; observer: MutableRefObject; diff --git a/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx b/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx index 1f8cf76a6ce70e..29a92564a8b4f8 100644 --- a/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx +++ b/packages/react-experiments/src/components/FloatingSuggestions/FloatingSuggestions.tsx @@ -70,7 +70,7 @@ export class FloatingSuggestions public onQueryStringChanged = (queryString: string): void => { if (queryString !== this.state.queryString) { this.setState({ - queryString: queryString, + queryString, }); if (this.props.onInputChanged) { @@ -278,9 +278,8 @@ export class FloatingSuggestions case KeyCodes.del: if ( this.props.onRemoveSuggestion && - this.suggestionsControl.current && - this.suggestionsControl.current.hasSuggestionSelected && - this.suggestionsControl.current.currentSuggestion && + this.suggestionsControl.current?.hasSuggestionSelected && + this.suggestionsControl.current?.currentSuggestion && ev.shiftKey ) { this.props.onRemoveSuggestion(this.suggestionsControl.current.currentSuggestion!.item); diff --git a/packages/react/etc/react.api.md b/packages/react/etc/react.api.md index 24aec2dc818851..705811e613ba98 100644 --- a/packages/react/etc/react.api.md +++ b/packages/react/etc/react.api.md @@ -561,7 +561,7 @@ export class BaseExtendedPicker> extend // (undocumented) protected onCopy: (ev: React_2.ClipboardEvent) => void; // (undocumented) - protected onInputChange: (value: string, composing?: boolean | undefined) => void; + protected onInputChange: (value: string, composing?: boolean) => void; // (undocumented) protected onInputClick: (ev: React_2.MouseEvent) => void; // (undocumented) @@ -1068,7 +1068,7 @@ export const CompactPeoplePicker: React_2.FunctionComponent; export class CompactPeoplePickerBase extends BasePeoplePicker { static defaultProps: { onRenderItem: (props: IPeoplePickerItemSelectedProps) => JSX.Element; - onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps | undefined) => JSX.Element; + onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps) => JSX.Element; createGenericItem: typeof createGenericItem; }; } @@ -1117,7 +1117,7 @@ export const ContextualMenuItem: React_2.FunctionComponent { constructor(props: IContextualMenuItemProps); // (undocumented) - dismissMenu: (dismissAll?: boolean | undefined) => void; + dismissMenu: (dismissAll?: boolean) => void; // (undocumented) dismissSubMenu: () => void; // (undocumented) @@ -1322,7 +1322,7 @@ export class DetailsListBase extends React_2.Component | undefined) => JSX.Element; + protected _onRenderRow: (props: IDetailsRowProps, defaultRender?: IRenderFunction) => JSX.Element; // (undocumented) render(): JSX.Element; // (undocumented) @@ -1712,7 +1712,7 @@ export { formProperties } export const getActivityItemClassNames: (styles: IActivityItemStyles, className: string, activityPersonas: Array, isCompact: boolean) => IActivityItemClassNames; // @public (undocumented) -export const getActivityItemStyles: (theme?: ITheme, customStyles?: IActivityItemStyles | undefined, animateBeaconSignal?: IActivityItemProps['animateBeaconSignal'], beaconColorOne?: IActivityItemProps['beaconColorOne'], beaconColorTwo?: IActivityItemProps['beaconColorTwo'], isCompact?: IActivityItemProps['isCompact']) => IActivityItemStyles; +export const getActivityItemStyles: (theme?: ITheme, customStyles?: IActivityItemStyles, animateBeaconSignal?: IActivityItemProps['animateBeaconSignal'], beaconColorOne?: IActivityItemProps['beaconColorOne'], beaconColorTwo?: IActivityItemProps['beaconColorTwo'], isCompact?: IActivityItemProps['isCompact']) => IActivityItemStyles; // @public (undocumented) export function getAllSelectedOptions(options: ISelectableOption[], selectedIndices: number[]): ISelectableOption[]; @@ -1755,7 +1755,7 @@ export const getCommandButtonStyles: (customStyles: IButtonStyles | undefined) = // Warning: (ae-internal-missing-underscore) The name "getContextualMenuItemClassNames" should be prefixed with an underscore because the declaration is marked as @internal // // @internal @deprecated (undocumented) -export const getContextualMenuItemClassNames: (theme: ITheme, disabled: boolean, expanded: boolean, checked: boolean, isAnchorLink: boolean, knownIcon: boolean, itemClassName?: string | undefined, dividerClassName?: string | undefined, iconClassName?: string | undefined, subMenuClassName?: string | undefined, primaryDisabled?: boolean | undefined, className?: string | undefined) => IContextualMenuItemStyles; +export const getContextualMenuItemClassNames: (theme: ITheme, disabled: boolean, expanded: boolean, checked: boolean, isAnchorLink: boolean, knownIcon: boolean, itemClassName?: string, dividerClassName?: string, iconClassName?: string, subMenuClassName?: string, primaryDisabled?: boolean, className?: string) => IContextualMenuItemStyles; // @public export const getContextualMenuItemStyles: (props: IContextualMenuItemStyleProps) => IContextualMenuItemStyles; @@ -1807,7 +1807,7 @@ export { getFocusOutlineStyle } export { getFocusStyle } // @public -export const getFontIcon: (iconName: string, className?: string | undefined, ariaLabel?: string | undefined) => React_2.ReactElement | null; +export const getFontIcon: (iconName: string, className?: string, ariaLabel?: string) => React_2.ReactElement | null; // @public export function getFullColorString(color: IColor): string; @@ -1824,7 +1824,7 @@ export { getIcon } export { getIconClassName } // @public (undocumented) -export const getIconContent: (iconName?: string | undefined) => IIconContent | null; +export const getIconContent: (iconName?: string) => IIconContent | null; export { getId } @@ -1880,7 +1880,7 @@ export const getNextResizeGroupStateProvider: (measurementCache?: { getCachedMeasurement: (data: any) => number | undefined; addMeasurementToCache: (data: any, measurement: number) => void; }) => { - getNextState: (props: IResizeGroupProps, currentState: IResizeGroupState, getElementToMeasureDimension: () => number, newContainerDimension?: number | undefined) => IResizeGroupState | undefined; + getNextState: (props: IResizeGroupProps, currentState: IResizeGroupState, getElementToMeasureDimension: () => number, newContainerDimension?: number) => IResizeGroupState | undefined; shouldRenderDataForMeasurement: (dataToMeasure: any | undefined) => boolean; getInitialResizeGroupState: (data: any) => IResizeGroupState; }; @@ -1927,7 +1927,7 @@ export function getShade(color: IColor, shade: Shade, isInverted?: boolean): ICo export const getShimmeredDetailsListStyles: (props: IShimmeredDetailsListStyleProps) => IShimmeredDetailsListStyles; // @public (undocumented) -export const getSplitButtonClassNames: (styles: IButtonStyles, disabled: boolean, expanded: boolean, checked: boolean, primaryDisabled?: boolean | undefined) => ISplitButtonClassNames; +export const getSplitButtonClassNames: (styles: IButtonStyles, disabled: boolean, expanded: boolean, checked: boolean, primaryDisabled?: boolean) => ISplitButtonClassNames; export { getStartDateOfWeek } @@ -2079,7 +2079,7 @@ export class HoverCardBase extends React_2.Component void; + dismiss: (withTimeOut?: boolean) => void; // (undocumented) render(): JSX.Element; } @@ -9860,7 +9860,7 @@ export const ListPeoplePicker: React_2.FunctionComponent; export class ListPeoplePickerBase extends MemberListPeoplePicker { static defaultProps: { onRenderItem: (props: IPeoplePickerItemSelectedProps) => JSX.Element; - onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps | undefined) => JSX.Element; + onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps) => JSX.Element; createGenericItem: typeof createGenericItem; }; } @@ -10012,7 +10012,7 @@ export const NormalPeoplePicker: React_2.FunctionComponent; export class NormalPeoplePickerBase extends BasePeoplePicker { static defaultProps: { onRenderItem: (props: IPeoplePickerItemSelectedProps) => JSX.Element; - onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps | undefined) => JSX.Element; + onRenderSuggestionsItem: (personaProps: IPersonaProps, suggestionsProps?: IBasePickerSuggestionsProps) => JSX.Element; createGenericItem: typeof createGenericItem; }; } @@ -10087,7 +10087,7 @@ export class PanelBase extends React_2.Component imple // (undocumented) static defaultProps: IPanelProps; // (undocumented) - dismiss: (ev?: KeyboardEvent | React_2.SyntheticEvent | undefined) => void; + dismiss: (ev?: React_2.SyntheticEvent | KeyboardEvent) => void; // (undocumented) static getDerivedStateFromProps(nextProps: Readonly, prevState: Readonly): Partial | null; get isActive(): boolean; @@ -10551,7 +10551,7 @@ export class ScrollablePaneBase extends React_2.Component void; + sortSticky: (sticky: Sticky, sortAgain?: boolean) => void; // (undocumented) get stickyAbove(): HTMLDivElement | null; // (undocumented) @@ -11364,7 +11364,7 @@ export function useHeightOffset({ finalHeight }: IPositioningContainerProps, con export function useKeytipRef(options: KeytipDataOptions): React_2.Ref; // @public -export const useResponsiveMode: (elementRef: React_2.RefObject, overrideResponsiveMode?: ResponsiveMode | undefined) => ResponsiveMode; +export const useResponsiveMode: (elementRef: React_2.RefObject, overrideResponsiveMode?: ResponsiveMode) => ResponsiveMode; // @public @deprecated export type UseStylesOptions = { diff --git a/packages/tokens/src/themeToTokensObject.ts b/packages/tokens/src/themeToTokensObject.ts index 25189f147d8742..f6c6473a46698b 100644 --- a/packages/tokens/src/themeToTokensObject.ts +++ b/packages/tokens/src/themeToTokensObject.ts @@ -12,7 +12,7 @@ export function themeToTokensObject(theme: TTheme): Record const tokens = {} as Record; const keys = Object.keys(theme) as (keyof TTheme)[]; for (const key of keys) { - tokens[key] = `var(--${key})`; + tokens[key] = `var(--${String(key)})`; } return tokens; } diff --git a/packages/utilities/src/warn/warnControlledUsage.ts b/packages/utilities/src/warn/warnControlledUsage.ts index 0ce94b86f31767..faf98d8f8221d3 100644 --- a/packages/utilities/src/warn/warnControlledUsage.ts +++ b/packages/utilities/src/warn/warnControlledUsage.ts @@ -74,9 +74,11 @@ export function warnControlledUsage

(params: IWarnControlledUsageParams

): v if (!(hasOnChange || isReadOnly) && !warningsMap.valueOnChange[componentId]) { warningsMap.valueOnChange[componentId] = true; warn( - `Warning: You provided a '${valueProp}' prop to a ${componentName} without an '${onChangeProp}' handler. ` + - `This will render a read-only field. If the field should be mutable use '${defaultValueProp}'. ` + - `Otherwise, set '${onChangeProp}'${readOnlyProp ? ` or '${readOnlyProp}'` : ''}.`, + `Warning: You provided a '${String(valueProp)}' prop to a ${String(componentName)} without an '${String( + onChangeProp, + )}' handler. ` + + `This will render a read-only field. If the field should be mutable use '${String(defaultValueProp)}'. ` + + `Otherwise, set '${String(onChangeProp)}'${readOnlyProp ? ` or '${String(readOnlyProp)}'` : ''}.`, ); } @@ -85,9 +87,13 @@ export function warnControlledUsage

(params: IWarnControlledUsageParams

): v if (defaultValue !== undefined && defaultValue !== null && !warningsMap.valueDefaultValue[componentId]) { warningsMap.valueDefaultValue[componentId] = true; warn( - `Warning: You provided both '${valueProp}' and '${defaultValueProp}' to a ${componentName}. ` + - `Form fields must be either controlled or uncontrolled (specify either the '${valueProp}' prop, ` + - `or the '${defaultValueProp}' prop, but not both). Decide between using a controlled or uncontrolled ` + + `Warning: You provided both '${String(valueProp)}' and '${String( + defaultValueProp, + )}' to a ${componentName}. ` + + `Form fields must be either controlled or uncontrolled (specify either the '${String(valueProp)}' prop, ` + + `or the '${String( + defaultValueProp, + )}' prop, but not both). Decide between using a controlled or uncontrolled ` + `${componentName} and remove one of these props. More info: https://fb.me/react-controlled-components`, ); } diff --git a/scripts/storybook/src/utils.js b/scripts/storybook/src/utils.js index f38cdf5e6efbf2..d7c29658287631 100644 --- a/scripts/storybook/src/utils.js +++ b/scripts/storybook/src/utils.js @@ -208,16 +208,15 @@ function _createCodesandboxRule(allPackageInfo = getAllPackageInfo()) { function getPackageStoriesGlob(options) { const projectMetadata = getProjectMetadata({ name: options.packageName }); - /** @type {Record} */ + /** @type {{name:string;version:string;dependencies?:Record}} */ const packageJson = JSON.parse( fs.readFileSync(path.resolve(workspaceRoot, projectMetadata.root, 'package.json'), 'utf-8'), ); - const dependencies = /** @type {Record} */ ( - Object.assign(packageJson.dependencies, { - [options.packageName]: '*', - }) - ); + packageJson.dependencies = packageJson.dependencies ?? {}; + const dependencies = Object.assign(packageJson.dependencies, { + [options.packageName]: '*', + }); const rootOffset = offsetFromRoot(options.callerPath.replace(workspaceRoot, '')); return Object.keys(dependencies) diff --git a/tools/generators/migrate-converged-pkg/index.ts b/tools/generators/migrate-converged-pkg/index.ts index 779cce54762dcb..5086e159c02442 100644 --- a/tools/generators/migrate-converged-pkg/index.ts +++ b/tools/generators/migrate-converged-pkg/index.ts @@ -671,6 +671,8 @@ function setupUnstableApi(tree: Tree, options: NormalizedSchemaWithTsConfigs) { }, }; + stableJson.exports = stableJson.exports ?? {}; + Object.assign(stableJson.exports, { './unstable': { types: unstableJson.typings?.replace(/\.\.\//g, ''), @@ -758,6 +760,7 @@ function updateApiExtractor(tree: Tree, options: NormalizedSchemaWithTsConfigs) writeJson(tree, joinPathFragments(options.paths.configRoot, 'api-extractor.json'), apiExtractor.main); updateJson(tree, options.paths.packageJson, (json: PackageJson) => { + json.scripts = json.scripts ?? {}; Object.assign(json.scripts, scripts); return json; @@ -821,6 +824,7 @@ function setupStorybook(tree: Tree, options: NormalizedSchema) { storybook: `start-storybook`, start: 'yarn storybook', }; + json.scripts = json.scripts ?? {}; Object.assign(json.scripts, scripts); return json; diff --git a/yarn.lock b/yarn.lock index 8f46ae50b0514f..b9fe0b851598ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3051,41 +3051,32 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@microsoft/api-extractor-model@7.17.1": - version "7.17.1" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.17.1.tgz#2a6b7d8eec510ba1c7713c682d2a0c730074b29c" - integrity sha512-DCDtD8TdEpNk2lW4JvXgwwpxKy70P0JLad55iahwO8A+C63KYsrHIpAzo0FUauh5pwJ0v5QVNIJ+OBgKGteemg== +"@microsoft/api-extractor-model@7.24.2": + version "7.24.2" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.24.2.tgz#759b09f2360fe761ff40bcf7e5a57b9b86284235" + integrity sha512-uUvjqTCY7hYERWGks+joTioN1QYHIucCDy7I/JqLxFxLbFXE5dpc1X7L+FG4PN/s8QYL24DKt0fqJkgcrFKLTw== dependencies: "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.45.3" + "@rushstack/node-core-library" "3.52.0" -"@microsoft/api-extractor-model@7.22.2": - version "7.22.2" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.22.2.tgz#9d49c22ae713d8662c995d844e29c59200ebe72f" - integrity sha512-fqb7std1sRfg7tvXkJwB7zrgIyzty7iIJXxpqA2/bEdct36jhkgIhKpgYr2yoi+Jhqbinjmhyf9tPKJ2E3TdwA== +"@microsoft/api-extractor@7.31.2": + version "7.31.2" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.31.2.tgz#8312fe2519deaed8f81d60efe9e54b99fc5a19a0" + integrity sha512-ZODCU9ckTS9brXiZpUW2iDrnAg7jLxeLBM1AkPpSZFcbG/8HGLvfKOKrd71VIJHjc52x2lB8xj7ZWksnP7AOBA== dependencies: + "@microsoft/api-extractor-model" "7.24.2" "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.50.0" - -"@microsoft/api-extractor@7.28.7": - version "7.28.7" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.28.7.tgz#3c2745499b38d1ae3b8e0488c3f5aaeb6edc3e60" - integrity sha512-hDVYSbqGsY4gioHMi/NkIarAJ2qoE5cKEZ6V5HqLcUl0+hNV0Auk/5VbBmU2UO2le6MFgO69EJsrfszwzC6QBA== - dependencies: - "@microsoft/api-extractor-model" "7.22.2" - "@microsoft/tsdoc" "0.14.1" - "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.50.0" - "@rushstack/rig-package" "0.3.13" - "@rushstack/ts-command-line" "4.12.1" + "@rushstack/node-core-library" "3.52.0" + "@rushstack/rig-package" "0.3.15" + "@rushstack/ts-command-line" "4.12.3" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" semver "~7.3.0" source-map "~0.6.1" - typescript "~4.6.3" + typescript "~4.7.4" "@microsoft/eslint-plugin-sdl@0.1.9": version "0.1.9" @@ -3830,25 +3821,10 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@rushstack/node-core-library@3.45.3": - version "3.45.3" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.45.3.tgz#8db2befbbf23969e08d2bc69d5d91ba812c01640" - integrity sha512-Rn0mxqC3MPb+YbvaeFcRWfcYHLwyZ99/ffYA8chpq5OpqoY+Mr1ycTbMvzl5AxWf1pYmi/2+Eo3iTOsQdYR8xw== - dependencies: - "@types/node" "12.20.24" - colors "~1.2.1" - fs-extra "~7.0.1" - import-lazy "~4.0.0" - jju "~1.4.0" - resolve "~1.17.0" - semver "~7.3.0" - timsort "~0.3.0" - z-schema "~5.0.2" - -"@rushstack/node-core-library@3.50.0": - version "3.50.0" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.50.0.tgz#8b628247f16e5719c39ed1890c11959f8d303559" - integrity sha512-FFEZhgu6iN1MVjpQWmLcz46pSa4r2Oe2JYPo7mtnl3uYfwDaSXUSZuRN3JQgKkXu10TBcffJ7AGKcIt/k+qE/Q== +"@rushstack/node-core-library@3.50.1": + version "3.50.1" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.50.1.tgz#d4aa4602460f29bbf0662052969b65129384da23" + integrity sha512-9d2xE7E9yQEBS6brTptdP8cslt6iL5+UnkY2lRxQQ4Q/jlXtsrWCCJCxwr56W/eJEe9YT/yHR4mMn5QY64Ps2w== dependencies: "@types/node" "12.20.24" colors "~1.2.1" @@ -3860,10 +3836,10 @@ timsort "~0.3.0" z-schema "~5.0.2" -"@rushstack/node-core-library@3.50.1": - version "3.50.1" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.50.1.tgz#d4aa4602460f29bbf0662052969b65129384da23" - integrity sha512-9d2xE7E9yQEBS6brTptdP8cslt6iL5+UnkY2lRxQQ4Q/jlXtsrWCCJCxwr56W/eJEe9YT/yHR4mMn5QY64Ps2w== +"@rushstack/node-core-library@3.52.0": + version "3.52.0" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.52.0.tgz#ee45e52b4b5fc038ce59bf59b1534311884e63fb" + integrity sha512-Z+MAP//G3rEGZd3JxJcBGcPYJlh8pvPoLMTLa5Sy6FTE6hRPzN+5J8DT7BbTmlqZaL6SZpXF30heRUbnYOvujw== dependencies: "@types/node" "12.20.24" colors "~1.2.1" @@ -3872,7 +3848,6 @@ jju "~1.4.0" resolve "~1.17.0" semver "~7.3.0" - timsort "~0.3.0" z-schema "~5.0.2" "@rushstack/package-deps-hash@^3.2.4", "@rushstack/package-deps-hash@^3.2.5": @@ -3882,18 +3857,18 @@ dependencies: "@rushstack/node-core-library" "3.50.1" -"@rushstack/rig-package@0.3.13": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.13.tgz#80d7b34bc9b7a7feeba133f317df8dbd1f65a822" - integrity sha512-4/2+yyA/uDl7LQvtYtFs1AkhSWuaIGEKhP9/KK2nNARqOVc5eCXmu1vyOqr5mPvNq7sHoIR+sG84vFbaKYGaDA== +"@rushstack/rig-package@0.3.15": + version "0.3.15" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.15.tgz#8a870880cbeb8de82b951e628f6a37d428b4c5ce" + integrity sha512-jxVfvO5OnkRlYRhcVDZWvwiI2l4pv37HDJRtyg5HbD8Z/I8Xj32RICgrxS5xMeGGytobrg5S6OfPOHskg7Nw+A== dependencies: resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.12.1.tgz#4437ffae6459eb88791625ad9e89b2f0ba254476" - integrity sha512-S1Nev6h/kNnamhHeGdp30WgxZTA+B76SJ/P721ctP7DrnC+rrjAc6h/R80I4V0cA2QuEEcMdVOQCtK2BTjsOiQ== +"@rushstack/ts-command-line@4.12.3": + version "4.12.3" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.12.3.tgz#3c5e4b381dcd780aab6efe42c7faa2018248cbb1" + integrity sha512-Pdij22RotMXzI+HWHyYCvw0RMZhiP5a6Za/96XamZ1+mxmpSm4ujf8TROKxGAHySmR5A8iNVSlzhNMnUlFQE6g== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" @@ -25768,10 +25743,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.6.4, "typescript@^3 || ^4", typescript@~4.6.3: - version "4.6.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" - integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== +typescript@4.7.4, "typescript@^3 || ^4", typescript@~4.7.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== typical@^4.0.0: version "4.0.0"