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": "none",
"comment": "chore: adjust re-exports after direct re-exports workspace rule",
"packageName": "@fluentui/react-headless-components-preview",
"email": "vgenaev@gmail.com",
"dependentChangeType": "none"
}
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const __internal = {
'@nx/workspace-consistent-callback-type': 'error',
'@nx/workspace-base-hook-signature': 'error',
'@nx/workspace-base-hook-no-forbidden-runtime': 'error',
'@nx/workspace-prefer-direct-reexport': 'off',
'@nx/workspace-no-restricted-globals': restrictedGlobals.react,
'@nx/workspace-no-missing-jsx-pragma': ['error', { runtime: 'automatic' }],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ module.exports = [
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['**/src/**/*.{ts,tsx}'],
ignores: ['**/*.{test,cy,stories}.{ts,tsx}'],
rules: {
'@nx/workspace-prefer-direct-reexport': 'error',
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

```ts

import type { AccordionBaseProps } from '@fluentui/react-accordion';
import type { AccordionBaseState } from '@fluentui/react-accordion';
import { AccordionContextValues } from '@fluentui/react-accordion';
import type { AccordionHeaderBaseState } from '@fluentui/react-accordion';
Expand All @@ -17,6 +16,7 @@ import type { AccordionItemState as AccordionItemState_2 } from '@fluentui/react
import type { AccordionPanelBaseState } from '@fluentui/react-accordion';
import { AccordionPanelBaseProps as AccordionPanelProps } from '@fluentui/react-accordion';
import { AccordionPanelSlots } from '@fluentui/react-accordion';
import { AccordionBaseProps as AccordionProps } from '@fluentui/react-accordion';
import { AccordionSlots } from '@fluentui/react-accordion';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import type { JSXElement } from '@fluentui/react-utilities';
Expand Down Expand Up @@ -77,8 +77,7 @@ export type AccordionPanelState = AccordionPanelBaseState & {
};
};

// @public (undocumented)
export type AccordionProps = AccordionBaseProps;
export { AccordionProps }

export { AccordionSlots }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { MenuItemSwitchSlots } from '@fluentui/react-menu';
import { MenuItemSwitchState } from '@fluentui/react-menu';
import type { MenuListContextValues } from '@fluentui/react-menu';
import { MenuListProps } from '@fluentui/react-menu';
import type { MenuListSlots } from '@fluentui/react-menu';
import { MenuListSlots } from '@fluentui/react-menu';
import type { MenuListState as MenuListState_2 } from '@fluentui/react-menu';
import { MenuOpenChangeData } from '@fluentui/react-menu';
import { MenuOpenEvent } from '@fluentui/react-menu';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MessageBarBodyProps } from '@fluentui/react-message-bar';
import { MessageBarBodySlots } from '@fluentui/react-message-bar';
import { MessageBarBodyState } from '@fluentui/react-message-bar';
import { MessageBarContextValues } from '@fluentui/react-message-bar';
import type { MessageBarIntent } from '@fluentui/react-message-bar';
import { MessageBarIntent } from '@fluentui/react-message-bar';
import { MessageBarBaseProps as MessageBarProps } from '@fluentui/react-message-bar';
import { MessageBarSlots } from '@fluentui/react-message-bar';
import { MessageBarTitleProps } from '@fluentui/react-message-bar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ export type NavDividerProps = Omit<DividerBaseProps, 'vertical'>;

export { NavDividerSlots }

// @public
export type NavDividerState = DividerState;
// @public (undocumented)
export type NavDividerState = DividerBaseState & {
root: {
'data-orientation'?: 'vertical' | 'horizontal';
};
};

// @public
export const NavDrawer: ForwardRefComponent<NavDrawerProps>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { TagPickerControlInternalSlots } from '@fluentui/react-tag-picker';
import { TagPickerControlProps } from '@fluentui/react-tag-picker';
import { TagPickerControlSlots } from '@fluentui/react-tag-picker';
import type { TagPickerGroupBaseState } from '@fluentui/react-tag-picker';
import type { TagPickerGroupSlots as TagPickerGroupSlots_2 } from '@fluentui/react-tag-picker';
import { TagPickerGroupSlots } from '@fluentui/react-tag-picker';
import type { TagPickerInputBaseState } from '@fluentui/react-tag-picker';
import { TagPickerInputBaseProps as TagPickerInputProps } from '@fluentui/react-tag-picker';
import { TagPickerInputSlots } from '@fluentui/react-tag-picker';
Expand Down Expand Up @@ -113,8 +113,7 @@ export const TagPickerGroup: ForwardRefComponent<TagPickerGroupProps>;
// @public
export type TagPickerGroupProps = ComponentProps<TagPickerGroupSlots> & Pick<TagGroupBaseProps, 'dismissible' | 'onDismiss'>;

// @public (undocumented)
export type TagPickerGroupSlots = TagPickerGroupSlots_2;
export { TagPickerGroupSlots }

// @public
export type TagPickerGroupState = TagPickerGroupBaseState & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,40 @@ export { TeachingPopoverHeaderSlots }
export { TeachingPopoverHeaderState }

// @public
export type TeachingPopoverProps = PopoverProps;
export type TeachingPopoverProps = {
children: [JSXElement, JSXElement] | JSXElement;
open?: boolean;
defaultOpen?: boolean;
onOpenChange?: EventHandler<OnOpenChangeData>;
openOnHover?: boolean;
openOnContext?: boolean;
mouseLeaveDelay?: number;
positioning?: PositioningShorthand;
withArrow?: boolean;
id?: string;
trapFocus?: boolean;
};

// @public
export type TeachingPopoverState = PopoverState;
export type TeachingPopoverState = Required<Pick<TeachingPopoverProps, 'open' | 'trapFocus'>> & Pick<TeachingPopoverProps, 'onOpenChange' | 'openOnContext' | 'openOnHover' | 'withArrow'> & {
setOpen: (e: OpenPopoverEvents, open: boolean) => void;
toggleOpen: (e: OpenPopoverEvents) => void;
triggerRef: React_2.RefObject<HTMLElement | null>;
contentRef: React_2.RefObject<HTMLElement | null>;
arrowRef: React_2.RefObject<HTMLDivElement | null>;
popoverTrigger: React_2.ReactElement | undefined;
popoverSurface: React_2.ReactElement | undefined;
contextTarget: {
x: number;
y: number;
} | undefined;
setContextTarget: (target: {
x: number;
y: number;
} | undefined) => void;
positioning: PositioningReturn;
surfaceId: string;
};

// @public
export const TeachingPopoverSurface: ForwardRefComponent<TeachingPopoverSurfaceProps>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { AccordionBaseProps, AccordionBaseState } from '@fluentui/react-accordion';
import type { AccordionBaseState } from '@fluentui/react-accordion';

export type { AccordionSlots, AccordionContextValues } from '@fluentui/react-accordion';

export type AccordionProps = AccordionBaseProps;
export type {
AccordionSlots,
AccordionContextValues,
AccordionBaseProps as AccordionProps,
} from '@fluentui/react-accordion';

export type AccordionState = AccordionBaseState & {
root: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import type {
import type { MenuListState as MenuListBaseState } from '@fluentui/react-menu';

export type {
MenuListProps,
MenuListSlots,
MenuListState as MenuListBaseState,
MenuCheckedValueChangeData,
MenuCheckedValueChangeEvent,
} from '@fluentui/react-menu';

export type { MenuListProps } from '@fluentui/react-menu';

export type MenuListState = MenuListBaseState & {
root: {
focusgroup?: string;
};
};

export type { MenuListSlots, MenuCheckedValueChangeData, MenuCheckedValueChangeEvent };
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { MessageBarBaseState, MessageBarIntent } from '@fluentui/react-message-bar';
import type { MessageBarBaseState } from '@fluentui/react-message-bar';

export type {
MessageBarSlots,
MessageBarBaseProps as MessageBarProps,
MessageBarContextValues,
MessageBarIntent,
} from '@fluentui/react-message-bar';

export type MessageBarState = MessageBarBaseState & {
Expand All @@ -19,5 +20,3 @@ export type MessageBarState = MessageBarBaseState & {
'data-intent'?: string;
};
};

export type { MessageBarIntent };
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import type { DividerProps, DividerState } from '../../Divider';
import type { DividerProps } from '../../Divider';

export type { DividerSlots as NavDividerSlots } from '../../Divider';
export type { DividerSlots as NavDividerSlots, DividerState as NavDividerState } from '../../Divider';

/**
* NavDivider Props
*/
export type NavDividerProps = Omit<DividerProps, 'vertical'>;

/**
* State used in rendering NavDivider
*/
export type NavDividerState = DividerState;
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type {
TagPickerGroupSlots as TagPickerGroupBaseSlots,
} from '@fluentui/react-tag-picker';

export type TagPickerGroupSlots = TagPickerGroupBaseSlots;
export type { TagPickerGroupSlots } from '@fluentui/react-tag-picker';

/**
* TagPickerGroup Props
*/
export type TagPickerGroupProps = ComponentProps<TagPickerGroupSlots> &
export type TagPickerGroupProps = ComponentProps<TagPickerGroupBaseSlots> &
Pick<TagGroupBaseProps, 'dismissible' | 'onDismiss'>;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import type { PopoverContextValue as BasePopoverContextValue } from '@fluentui/react-popover';
import type { PopoverProps, PopoverState, PopoverContextValue } from '../Popover/Popover.types';
import type { PopoverContextValue } from '../Popover/Popover.types';

/**
* TeachingPopover Props
*/
export type TeachingPopoverProps = PopoverProps;

/**
* TeachingPopover State — identical to the headless Popover state. Styling
* concerns from `@fluentui/react-teaching-popover` (`appearance`, `trapFocus`,
* `inline`) are intentionally omitted; consumers control presentation.
*/
export type TeachingPopoverState = PopoverState;
export type {
PopoverProps as TeachingPopoverProps,
PopoverState as TeachingPopoverState,
} from '../Popover/Popover.types';

/**
* Subset of the `@fluentui/react-popover` `PopoverContextValue` that the
Expand Down
2 changes: 2 additions & 0 deletions tools/eslint-rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
RULE_NAME as baseHookNoForbiddenRuntimeName,
rule as baseHookNoForbiddenRuntime,
} from './rules/base-hook-no-forbidden-runtime';
import { RULE_NAME as preferDirectReexportName, rule as preferDirectReexport } from './rules/prefer-direct-reexport';

/**
* Import your custom workspace rules at the top of this file.
Expand Down Expand Up @@ -39,6 +40,7 @@ module.exports = {
[consistentCallbackTypeName]: consistentCallbackType,
[baseHookSignatureName]: baseHookSignature,
[baseHookNoForbiddenRuntimeName]: baseHookNoForbiddenRuntime,
[preferDirectReexportName]: preferDirectReexport,
[noRestrictedGlobalsName]: noRestrictedGlobals,
[noMissingJsxPragmaName]: noMissingJsxPragma,
},
Expand Down
Loading
Loading