diff --git a/.agents/skills/dependabot-rollup/SKILL.md b/.agents/skills/dependabot-rollup/SKILL.md index a3537a50322f0f..0a0058629939f1 100644 --- a/.agents/skills/dependabot-rollup/SKILL.md +++ b/.agents/skills/dependabot-rollup/SKILL.md @@ -1,7 +1,7 @@ --- name: dependabot-rollup description: >- - Review and optionally combine open Dependabot patch and minor pull requests into a validated draft rollup PR. Use this skill to test Dependabot bundling locally or in a cloud agent without adding a scheduled GitHub Actions workflow. Always presents a dry-run plan and requires explicit approval before changing branches or GitHub pull requests. + Review and optionally combine at most 11 open Dependabot patch and minor pull requests into a validated draft rollup PR. Use this skill to test Dependabot bundling locally or in a cloud agent without adding a scheduled GitHub Actions workflow. Always presents a dry-run plan and requires explicit approval before changing branches or GitHub pull requests. disable-model-invocation: true argument-hint: '[--repo owner/repo] [--base branch] [--max count] [--push-remote remote]' allowed-tools: Bash Read Grep Glob @@ -17,10 +17,10 @@ Build a reviewable rollup of compatible Dependabot updates without scheduled aut | --------------- | ---------------------------------- | --------------------------------------------- | | `--repo` | `microsoft/fluentui` | Repository containing the Dependabot PRs | | `--base` | `master` | Base branch for discovery and the rollup | -| `--max` | `11` | Maximum eligible PRs in one proposed rollup | +| `--max` | `11` | Eligible PR limit, from 1 through 11 | | `--push-remote` | Current branch's configured remote | Writable fork remote used only after approval | -Parse overrides from `$ARGUMENTS`. Reject an invalid repository name, a non-positive integer for `--max`, an unknown Git remote, or unknown arguments instead of guessing. +Parse overrides from `$ARGUMENTS`. Reject an invalid repository name, a `--max` value that is not an integer from 1 through 11, an unknown Git remote, or unknown arguments instead of guessing. The value 11 is an absolute ceiling, not only the default. ## Workflow @@ -197,6 +197,7 @@ Report: - Never run on a schedule or add a GitHub Actions workflow. - Never request or print a GitHub token; use the user's existing `gh` authentication. - Never include semver-major, non-semver, downgrade, or unparseable updates. +- Never propose, merge, or publish a rollup containing more than 11 updates. - Never include more than one PR for the same dependency in a proposed rollup. - Never mutate the user's current working tree. - Never auto-resolve merge conflicts or bypass failed validation. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2f46c6076e59cd..c825be9fd12d94 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,7 +13,7 @@ updates: - 'minor' - 'patch' - # npm dependencies - weekly minor and patch updates grouped by dependency type + # npm dependencies - weekly minor and patch updates - package-ecosystem: 'npm' directory: '/' schedule: @@ -21,25 +21,6 @@ updates: open-pull-requests-limit: 6 versioning-strategy: increase ignore: - # Ignore major version bumps for all npm dependencies in weekly updates + # Ignore major version bumps for scheduled npm version updates - dependency-name: '*' update-types: ['version-update:semver-major'] - groups: - npm-security-updates: - applies-to: security-updates - patterns: - - '*' - npm-dev-minor-patch: - dependency-type: 'development' - patterns: - - '*' - update-types: - - 'minor' - - 'patch' - npm-prod-minor-patch: - dependency-type: 'production' - patterns: - - '*' - update-types: - - 'minor' - - 'patch' diff --git a/.github/instructions/dependabot-security-fixes.instructions.md b/.github/instructions/dependabot-security-fixes.instructions.md index 80e9b8cd89ebe1..66dc004285d146 100644 --- a/.github/instructions/dependabot-security-fixes.instructions.md +++ b/.github/instructions/dependabot-security-fixes.instructions.md @@ -10,24 +10,28 @@ This instruction guide explains how Dependabot automation works for security fix Dependabot is configured to automatically create pull requests for: -1. **Security updates** - Advisory-driven updates grouped into consolidated npm pull requests -2. **npm dependencies** - Weekly minor and patch updates grouped by dependency type +1. **Security updates** - Advisory-driven npm pull requests created independently for each update +2. **npm dependencies** - Weekly minor and patch version updates created as individual pull requests 3. **GitHub Actions** - Weekly updates for workflow dependencies ## Configuration The Dependabot configuration is defined in `.github/dependabot.yml`: -- **Production dependencies**: Weekly minor and patch version updates -- **Development dependencies**: Weekly minor and patch version updates +- **npm dependencies**: Weekly minor and patch version updates as individual pull requests - **GitHub Actions**: Weekly updates -- **Security updates**: Grouped separately and not limited by the version update schedule +- **Security updates**: Individual pull requests not limited by the version update schedule +- **Rollups**: Maintainers can use `/dependabot-rollup` to combine at most 11 eligible non-major updates + +The repository's Advanced Security **Grouped security updates** setting must remain disabled. Dependabot does not support a maximum dependency count for automatic groups, so enabling that setting would bypass the 11-update rollup limit. + +The npm `open-pull-requests-limit` controls the number of scheduled version-update pull requests. It does not limit the number of dependencies in a pull request or change Dependabot's separate security-update pull request limit. ## Security Vulnerability Resolution ### Automatic Security Updates -GitHub triggers automatic security updates independently of the configured version update schedule. The Dependabot configuration groups eligible npm security updates into consolidated pull requests, including fixes that require major version bumps. +GitHub triggers automatic security updates independently of the configured version update schedule. Each npm security update remains a separate pull request. Major security remediations are never included in `/dependabot-rollup`, so compatibility work stays isolated for focused review. ### Manual Resolution via Yarn Resolutions diff --git a/AGENTS.md b/AGENTS.md index 5f280a17cdf023..ba571e028485b6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -91,17 +91,17 @@ state.root.className = mergeClasses( ## Skills (Slash Commands) -| Skill | Command | Purpose | -| ------------------- | -------------------- | ---------------------------------------------------------- | -| `v9-component` | `/v9-component Name` | Scaffold a new v9 component with all required files | -| `change` | `/change` | Create beachball change file from current diff | -| `lint-check` | `/lint-check [pkg]` | Run lint, parse errors, and auto-fix common issues | -| `token-lookup` | `/token-lookup val` | Find the design token for a hardcoded CSS value | -| `package-info` | `/package-info pkg` | Quick lookup: path, deps, owner, tests, structure | -| `visual-test` | `/visual-test Name` | Visually verify a component via Storybook + playwright-cli | -| `review-pr` | `/review-pr #123` | Review a PR with confidence scoring and category checks | -| `triage-issues` | `/triage-issues` | Walk the Needs-Triage queue and recommend labels/assignee | -| `dependabot-rollup` | `/dependabot-rollup` | Dry-run and optionally roll up Dependabot patch/minor PRs | +| Skill | Command | Purpose | +| ------------------- | -------------------- | -------------------------------------------------------------------- | +| `v9-component` | `/v9-component Name` | Scaffold a new v9 component with all required files | +| `change` | `/change` | Create beachball change file from current diff | +| `lint-check` | `/lint-check [pkg]` | Run lint, parse errors, and auto-fix common issues | +| `token-lookup` | `/token-lookup val` | Find the design token for a hardcoded CSS value | +| `package-info` | `/package-info pkg` | Quick lookup: path, deps, owner, tests, structure | +| `visual-test` | `/visual-test Name` | Visually verify a component via Storybook + playwright-cli | +| `review-pr` | `/review-pr #123` | Review a PR with confidence scoring and category checks | +| `triage-issues` | `/triage-issues` | Walk the Needs-Triage queue and recommend labels/assignee | +| `dependabot-rollup` | `/dependabot-rollup` | Dry-run and optionally roll up at most 11 Dependabot patch/minor PRs | ## Package Layout diff --git a/apps/public-docsite-v9/src/Concepts/Positioning/PositioningListenToUpdates.stories.tsx b/apps/public-docsite-v9/src/Concepts/Positioning/PositioningListenToUpdates.stories.tsx index 763052c11c277a..b6e587c3e4e669 100644 --- a/apps/public-docsite-v9/src/Concepts/Positioning/PositioningListenToUpdates.stories.tsx +++ b/apps/public-docsite-v9/src/Concepts/Positioning/PositioningListenToUpdates.stories.tsx @@ -1,4 +1,6 @@ import * as React from 'react'; +import type { PositioningImperativeRef, PositioningProps } from '@fluentui/react-components'; + import { useId, Text, @@ -8,9 +10,11 @@ import { Button, PopoverTrigger, PopoverSurface, - PositioningImperativeRef, } from '@fluentui/react-components'; +// Derive the event type from PositioningProps instead of importing directly +type OnPositioningEndEvent = Parameters>[0]; + const useStyles = makeStyles({ root: { display: 'flex', @@ -49,7 +53,7 @@ const useStyles = makeStyles({ export const ListenToUpdates = () => { const styles = useStyles(); const labelId = useId(); - const [statusLog, setStatusLog] = React.useState([]); + const [statusLog, setStatusLog] = React.useState>([]); const positioningRef = React.useRef(null); const [open, setOpen] = React.useState(false); @@ -64,8 +68,17 @@ export const ListenToUpdates = () => { positioningRef.current?.updatePosition(); }, []); - const onPositioningEnd = React.useCallback(() => { - setStatusLog(s => [Date.now(), ...s]); + const onPositioningEnd = React.useCallback((e: OnPositioningEndEvent) => { + const { placement, escaped, referenceHidden } = e.detail; + const visibility = escaped || referenceHidden ? 'hidden' : 'visible'; + + setStatusLog(s => [ + { + timestamp: Date.now(), + message: `placement=${placement}, escaped=${escaped}, referenceHidden=${referenceHidden}, visibility=${visibility}`, + }, + ...s, + ]); }, []); return ( @@ -91,11 +104,11 @@ export const ListenToUpdates = () => { Status log
- {statusLog.map((time, i) => { - const date = new Date(time); + {statusLog.map((entry, i) => { + const date = new Date(entry.timestamp); return (
- {date.toLocaleTimeString()} Position updated [{i}] + {date.toLocaleTimeString()} {entry.message}
); })} @@ -117,6 +130,9 @@ ListenToUpdates.parameters = { 'This constraint makes it difficult to know exactly when an element has been positioned. In order to listen', 'to position updates you can use the `onPositioningEnd` callback.', '', + 'The callback now includes `placement`, `escaped`, and `referenceHidden` in `event.detail` so consumers can', + 'respond to visibility conditions without relying on CSS attribute selectors.', + '', '> ⚠️ _Very few use cases would actually require listening to position updates. Please remember that_', '_there is a difference between this and the **open/close state** which is normally handled in React_', ].join('\n'), diff --git a/change/@fluentui-react-headless-components-preview-78d9a769-948f-4241-add6-2555f911e203.json b/change/@fluentui-react-headless-components-preview-78d9a769-948f-4241-add6-2555f911e203.json new file mode 100644 index 00000000000000..0d8d077d992e52 --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-78d9a769-948f-4241-add6-2555f911e203.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: re-export headless render helpers", + "packageName": "@fluentui/react-headless-components-preview", + "email": "vgenaev@gmail.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-positioning-b3f8c0ae-1e74-4e7a-a79c-5e9f2e3f8c11.json b/change/@fluentui-react-positioning-b3f8c0ae-1e74-4e7a-a79c-5e9f2e3f8c11.json new file mode 100644 index 00000000000000..4ca4184efb9fd3 --- /dev/null +++ b/change/@fluentui-react-positioning-b3f8c0ae-1e74-4e7a-a79c-5e9f2e3f8c11.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat(react-positioning): add escaped/referenceHidden visibility flags to onPositioningEnd event detail", + "packageName": "@fluentui/react-positioning", + "email": "paulmardling@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-headless-components-preview/library/etc/avatar.api.md b/packages/react-components/react-headless-components-preview/library/etc/avatar.api.md index 90120ca27b109d..45aff931f87646 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/avatar.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/avatar.api.md @@ -5,11 +5,11 @@ ```ts import type { AvatarBaseProps } from '@fluentui/react-avatar'; -import { AvatarBaseState } from '@fluentui/react-avatar'; +import type { AvatarBaseState } from '@fluentui/react-avatar'; import type { AvatarSlots as AvatarSlots_2 } from '@fluentui/react-avatar'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderAvatar_unstable as renderAvatar } from '@fluentui/react-avatar'; // @public export const Avatar: ForwardRefComponent; @@ -23,8 +23,7 @@ export type AvatarSlots = AvatarSlots_2; // @public export type AvatarState = AvatarBaseState; -// @public -export const renderAvatar: (state: AvatarBaseState) => JSXElement; +export { renderAvatar } // @public export const useAvatar: (props: AvatarProps, ref: React_2.Ref) => AvatarState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/badge.api.md b/packages/react-components/react-headless-components-preview/library/etc/badge.api.md index 02c7b3ef2a25d6..393157a8dcff78 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/badge.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/badge.api.md @@ -5,11 +5,11 @@ ```ts import type { BadgeBaseProps } from '@fluentui/react-badge'; -import { BadgeBaseState } from '@fluentui/react-badge'; +import type { BadgeBaseState } from '@fluentui/react-badge'; import type { BadgeSlots as BadgeSlots_2 } from '@fluentui/react-badge'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderBadge_unstable as renderBadge } from '@fluentui/react-badge'; // @public export const Badge: ForwardRefComponent; @@ -27,8 +27,7 @@ export type BadgeState = BadgeBaseState & { }; }; -// @public -export const renderBadge: (state: BadgeBaseState) => JSXElement; +export { renderBadge } // @public export const useBadge: (props: BadgeProps, ref: React_2.Ref) => BadgeState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/breadcrumb.api.md b/packages/react-components/react-headless-components-preview/library/etc/breadcrumb.api.md index 4972b3f0401c74..448423a2981485 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/breadcrumb.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/breadcrumb.api.md @@ -5,7 +5,7 @@ ```ts import type { BreadcrumbBaseProps } from '@fluentui/react-breadcrumb'; -import { BreadcrumbBaseState } from '@fluentui/react-breadcrumb'; +import type { BreadcrumbBaseState } from '@fluentui/react-breadcrumb'; import type { BreadcrumbButtonBaseProps } from '@fluentui/react-breadcrumb'; import type { BreadcrumbButtonBaseState } from '@fluentui/react-breadcrumb'; import type { BreadcrumbButtonSlots as BreadcrumbButtonSlots_2 } from '@fluentui/react-breadcrumb'; @@ -20,6 +20,7 @@ import type { BreadcrumbSlots as BreadcrumbSlots_2 } from '@fluentui/react-bread import type { ForwardRefComponent } from '@fluentui/react-utilities'; import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderBreadcrumb_unstable as renderBreadcrumb } from '@fluentui/react-breadcrumb'; // @public export const Breadcrumb: ForwardRefComponent; @@ -76,8 +77,7 @@ export type BreadcrumbSlots = BreadcrumbSlots_2; // @public export type BreadcrumbState = BreadcrumbBaseState; -// @public -export const renderBreadcrumb: (state: BreadcrumbBaseState, contextValues: BreadcrumbContextValues_2) => JSXElement; +export { renderBreadcrumb } // @public export const renderBreadcrumbButton: (state: BreadcrumbButtonState) => JSXElement; diff --git a/packages/react-components/react-headless-components-preview/library/etc/card.api.md b/packages/react-components/react-headless-components-preview/library/etc/card.api.md index f11ee1c9ef5aa5..a5336b417936ea 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/card.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/card.api.md @@ -5,7 +5,7 @@ ```ts import type { CardBaseProps } from '@fluentui/react-card'; -import { CardBaseState } from '@fluentui/react-card'; +import type { CardBaseState } from '@fluentui/react-card'; import { CardContextValue as CardContextValue_2 } from '@fluentui/react-card'; import type { CardFooterBaseProps } from '@fluentui/react-card'; import { CardFooterBaseState } from '@fluentui/react-card'; @@ -21,6 +21,7 @@ import type { CardSlots as CardSlots_2 } from '@fluentui/react-card'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderCard_unstable as renderCard } from '@fluentui/react-card'; // @public export const Card: ForwardRefComponent; @@ -80,8 +81,7 @@ export type CardState = CardBaseState & { }; }; -// @public -export const renderCard: (state: CardBaseState, cardContextValue: CardContextValue_2) => JSXElement; +export { renderCard } // @public export const renderCardFooter: (state: CardFooterBaseState) => JSXElement; diff --git a/packages/react-components/react-headless-components-preview/library/etc/checkbox.api.md b/packages/react-components/react-headless-components-preview/library/etc/checkbox.api.md index e88005e950b2ed..eece743a9e8e80 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/checkbox.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/checkbox.api.md @@ -5,11 +5,11 @@ ```ts import type { CheckboxBaseProps } from '@fluentui/react-checkbox'; -import { CheckboxBaseState } from '@fluentui/react-checkbox'; +import type { CheckboxBaseState } from '@fluentui/react-checkbox'; import type { CheckboxSlots as CheckboxSlots_2 } from '@fluentui/react-checkbox'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderCheckbox_unstable as renderCheckbox } from '@fluentui/react-checkbox'; // @public export const Checkbox: ForwardRefComponent; @@ -28,8 +28,7 @@ export type CheckboxState = CheckboxBaseState & { }; }; -// @public -export const renderCheckbox: (state: CheckboxBaseState) => JSXElement; +export { renderCheckbox } // @public export const useCheckbox: (props: CheckboxProps, ref: React_2.Ref) => CheckboxState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/combobox.api.md b/packages/react-components/react-headless-components-preview/library/etc/combobox.api.md index 02476c07700aa2..0779a00228edbc 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/combobox.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/combobox.api.md @@ -9,18 +9,21 @@ import type { BaseComboboxState } from '@fluentui/react-combobox'; import { ComboboxContextValues } from '@fluentui/react-combobox'; import { ComboboxSlots } from '@fluentui/react-combobox'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; -import { ListboxContextValues as ListboxContextValues_2 } from '@fluentui/react-combobox'; +import type { JSXElement } from '@fluentui/react-utilities'; +import type { ListboxContextValues as ListboxContextValues_2 } from '@fluentui/react-combobox'; import type { ListboxProps as ListboxProps_2 } from '@fluentui/react-combobox'; import type { ListboxSlots as ListboxSlots_2 } from '@fluentui/react-combobox'; -import { ListboxState as ListboxState_2 } from '@fluentui/react-combobox'; +import type { ListboxState as ListboxState_2 } from '@fluentui/react-combobox'; import type { OptionGroupProps as OptionGroupProps_2 } from '@fluentui/react-combobox'; import type { OptionGroupSlots as OptionGroupSlots_2 } from '@fluentui/react-combobox'; -import { OptionGroupState as OptionGroupState_2 } from '@fluentui/react-combobox'; +import type { OptionGroupState as OptionGroupState_2 } from '@fluentui/react-combobox'; import type { OptionProps as OptionProps_2 } from '@fluentui/react-combobox'; import type { OptionSlots as OptionSlots_2 } from '@fluentui/react-combobox'; -import { OptionState as OptionState_2 } from '@fluentui/react-combobox'; +import type { OptionState as OptionState_2 } from '@fluentui/react-combobox'; import type * as React_2 from 'react'; +import { renderListbox_unstable as renderListbox } from '@fluentui/react-combobox'; +import { renderOption_unstable as renderOption } from '@fluentui/react-combobox'; +import { renderOptionGroup_unstable as renderOptionGroup } from '@fluentui/react-combobox'; // @public (undocumented) export const Combobox: ForwardRefComponent; @@ -87,14 +90,11 @@ export type OptionState = OptionState_2 & { // @public (undocumented) export const renderCombobox: (state: ComboboxState, contextValues: ComboboxContextValues) => JSXElement; -// @public -export const renderListbox: (state: ListboxState_2, contextValues: ListboxContextValues_2) => JSXElement; +export { renderListbox } -// @public -export const renderOption: (state: OptionState_2) => JSXElement; +export { renderOption } -// @public -export const renderOptionGroup: (state: OptionGroupState_2) => JSXElement; +export { renderOptionGroup } // @public (undocumented) export const useCombobox: (props: ComboboxProps, ref: React_2.Ref) => ComboboxState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/dropdown.api.md b/packages/react-components/react-headless-components-preview/library/etc/dropdown.api.md index 25aea04a2fa549..b3a68344f16cf3 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/dropdown.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/dropdown.api.md @@ -8,18 +8,21 @@ import type { DropdownBaseHookProps } from '@fluentui/react-combobox'; import type { DropdownBaseHookState } from '@fluentui/react-combobox'; import { DropdownContextValues } from '@fluentui/react-combobox'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; -import { ListboxContextValues as ListboxContextValues_2 } from '@fluentui/react-combobox'; +import type { JSXElement } from '@fluentui/react-utilities'; +import type { ListboxContextValues as ListboxContextValues_2 } from '@fluentui/react-combobox'; import type { ListboxProps as ListboxProps_2 } from '@fluentui/react-combobox'; import type { ListboxSlots as ListboxSlots_2 } from '@fluentui/react-combobox'; -import { ListboxState as ListboxState_2 } from '@fluentui/react-combobox'; +import type { ListboxState as ListboxState_2 } from '@fluentui/react-combobox'; import type { OptionGroupProps as OptionGroupProps_2 } from '@fluentui/react-combobox'; import type { OptionGroupSlots as OptionGroupSlots_2 } from '@fluentui/react-combobox'; -import { OptionGroupState as OptionGroupState_2 } from '@fluentui/react-combobox'; +import type { OptionGroupState as OptionGroupState_2 } from '@fluentui/react-combobox'; import type { OptionProps as OptionProps_2 } from '@fluentui/react-combobox'; import type { OptionSlots as OptionSlots_2 } from '@fluentui/react-combobox'; -import { OptionState as OptionState_2 } from '@fluentui/react-combobox'; +import type { OptionState as OptionState_2 } from '@fluentui/react-combobox'; import type * as React_2 from 'react'; +import { renderListbox_unstable as renderListbox } from '@fluentui/react-combobox'; +import { renderOption_unstable as renderOption } from '@fluentui/react-combobox'; +import { renderOptionGroup_unstable as renderOptionGroup } from '@fluentui/react-combobox'; // @public export const Dropdown: ForwardRefComponent; @@ -84,14 +87,11 @@ export type OptionState = OptionState_2 & { // @public export const renderDropdown: (state: DropdownState, contextValues: DropdownContextValues) => JSXElement; -// @public -export const renderListbox: (state: ListboxState_2, contextValues: ListboxContextValues_2) => JSXElement; +export { renderListbox } -// @public -export const renderOption: (state: OptionState_2) => JSXElement; +export { renderOption } -// @public -export const renderOptionGroup: (state: OptionGroupState_2) => JSXElement; +export { renderOptionGroup } // @public export const useDropdown: (props: DropdownProps, ref: React_2.Ref) => DropdownState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/field.api.md b/packages/react-components/react-headless-components-preview/library/etc/field.api.md index 2c7639e96a55d5..7d9c8574e5dcb6 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/field.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/field.api.md @@ -5,12 +5,12 @@ ```ts import type { FieldBaseProps } from '@fluentui/react-field'; -import { FieldBaseState } from '@fluentui/react-field'; -import { FieldContextValues } from '@fluentui/react-field'; +import type { FieldBaseState } from '@fluentui/react-field'; +import type { FieldContextValues as FieldContextValues_2 } from '@fluentui/react-field'; import type { FieldSlots as FieldSlots_2 } from '@fluentui/react-field'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderField_unstable as renderField } from '@fluentui/react-field'; // @public export const Field: ForwardRefComponent; @@ -28,14 +28,13 @@ export type FieldState = FieldBaseState & { }; }; -// @public -export const renderField: (state: FieldBaseState, contextValues: FieldContextValues) => JSXElement; +export { renderField } // @public export const useField: (props: FieldProps, ref: React_2.Ref) => FieldState; // @public -export const useFieldContextValues: (state: FieldState) => FieldContextValues_2; +export const useFieldContextValues: (state: FieldState) => FieldContextValues; // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-headless-components-preview/library/etc/input.api.md b/packages/react-components/react-headless-components-preview/library/etc/input.api.md index f85f1e26eada37..7bd9fccb68ca80 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/input.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/input.api.md @@ -6,10 +6,10 @@ import type { ForwardRefComponent } from '@fluentui/react-utilities'; import type { InputBaseProps } from '@fluentui/react-input'; -import { InputBaseState } from '@fluentui/react-input'; +import type { InputBaseState } from '@fluentui/react-input'; import type { InputSlots as InputSlots_2 } from '@fluentui/react-input'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderInput_unstable as renderInput } from '@fluentui/react-input'; // @public export const Input: ForwardRefComponent; @@ -27,8 +27,7 @@ export type InputState = InputBaseState & { }; }; -// @public -export const renderInput: (state: InputBaseState) => JSXElement; +export { renderInput } // @public export const useInput: (props: InputProps, ref: React_2.Ref) => InputState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/link.api.md b/packages/react-components/react-headless-components-preview/library/etc/link.api.md index f5e048ac8a0c63..b69e2937af6303 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/link.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/link.api.md @@ -5,11 +5,11 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type { LinkBaseProps } from '@fluentui/react-link'; -import { LinkBaseState } from '@fluentui/react-link'; +import type { LinkBaseState } from '@fluentui/react-link'; import type { LinkSlots as LinkSlots_2 } from '@fluentui/react-link'; import type * as React_2 from 'react'; +import { renderLink_unstable as renderLink } from '@fluentui/react-link'; // @public export const Link: ForwardRefComponent; @@ -28,8 +28,7 @@ export type LinkState = LinkBaseState & { }; }; -// @public -export const renderLink: (state: LinkBaseState) => JSXElement; +export { renderLink } // @public export const useLink: (props: LinkProps, ref: React_2.Ref) => LinkState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/radio-group.api.md b/packages/react-components/react-headless-components-preview/library/etc/radio-group.api.md index 773bf7dafdf312..24a690735d85e2 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/radio-group.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/radio-group.api.md @@ -6,16 +6,17 @@ import { ComponentProps } from '@fluentui/react-utilities'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type { RadioBaseProps } from '@fluentui/react-radio'; -import { RadioBaseState } from '@fluentui/react-radio'; +import type { RadioBaseState } from '@fluentui/react-radio'; import type { RadioGroupBaseProps } from '@fluentui/react-radio'; -import { RadioGroupBaseState } from '@fluentui/react-radio'; -import { RadioGroupContextValues } from '@fluentui/react-radio'; +import type { RadioGroupBaseState } from '@fluentui/react-radio'; +import type { RadioGroupContextValues as RadioGroupContextValues_2 } from '@fluentui/react-radio'; import type { RadioGroupSlots as RadioGroupSlots_2 } from '@fluentui/react-radio'; import { RadioOnChangeData } from '@fluentui/react-radio'; import { RadioSlots as RadioSlots_2 } from '@fluentui/react-radio'; import * as React_2 from 'react'; +import { renderRadio_unstable as renderRadio } from '@fluentui/react-radio'; +import { renderRadioGroup_unstable as renderRadioGroup } from '@fluentui/react-radio'; // @public export const Radio: React_2.ForwardRefExoticComponent, "input">, "onChange" | "size"> & { @@ -50,11 +51,9 @@ export type RadioState = RadioBaseState & { }; }; -// @public -export const renderRadio: (state: RadioBaseState) => JSXElement; +export { renderRadio } -// @public -export const renderRadioGroup: (state: RadioGroupBaseState, contextValues: RadioGroupContextValues) => JSXElement; +export { renderRadioGroup } // @public export const useRadio: (props: RadioProps, ref: React_2.Ref) => RadioState; @@ -63,7 +62,7 @@ export const useRadio: (props: RadioProps, ref: React_2.Ref) = export const useRadioGroup: (props: RadioGroupProps, ref: React_2.Ref) => RadioGroupState; // @public (undocumented) -export const useRadioGroupContextValues: (state: RadioGroupState) => RadioGroupContextValues_2; +export const useRadioGroupContextValues: (state: RadioGroupState) => RadioGroupContextValues; // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-headless-components-preview/library/etc/rating-display.api.md b/packages/react-components/react-headless-components-preview/library/etc/rating-display.api.md index 52541a46a1187b..5f52c18526abf1 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/rating-display.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/rating-display.api.md @@ -5,12 +5,12 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type { RatingDisplayBaseProps } from '@fluentui/react-rating'; -import { RatingDisplayBaseState } from '@fluentui/react-rating'; -import { RatingDisplayContextValues } from '@fluentui/react-rating'; +import type { RatingDisplayBaseState } from '@fluentui/react-rating'; +import type { RatingDisplayContextValues as RatingDisplayContextValues_2 } from '@fluentui/react-rating'; import type { RatingDisplaySlots as RatingDisplaySlots_2 } from '@fluentui/react-rating'; import * as React_2 from 'react'; +import { renderRatingDisplay_unstable as renderRatingDisplay } from '@fluentui/react-rating'; // @public export const RatingDisplay: ForwardRefComponent; @@ -24,14 +24,13 @@ export type RatingDisplaySlots = RatingDisplaySlots_2; // @public export type RatingDisplayState = RatingDisplayBaseState; -// @public -export const renderRatingDisplay: (state: RatingDisplayBaseState, contextValues: RatingDisplayContextValues) => JSXElement; +export { renderRatingDisplay } // @public export const useRatingDisplay: (props: RatingDisplayProps, ref: React_2.Ref) => RatingDisplayState; // @public (undocumented) -export const useRatingDisplayContextValues: (state: RatingDisplayState) => RatingDisplayContextValues_2; +export const useRatingDisplayContextValues: (state: RatingDisplayState) => RatingDisplayContextValues; // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-headless-components-preview/library/etc/rating.api.md b/packages/react-components/react-headless-components-preview/library/etc/rating.api.md index 48d6cfc591b9bf..d5dd4b184ec4f0 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/rating.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/rating.api.md @@ -5,15 +5,16 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type { RatingBaseProps } from '@fluentui/react-rating'; -import { RatingBaseState } from '@fluentui/react-rating'; -import { RatingContextValues } from '@fluentui/react-rating'; +import type { RatingBaseState } from '@fluentui/react-rating'; +import type { RatingContextValues as RatingContextValues_2 } from '@fluentui/react-rating'; import type { RatingItemBaseProps } from '@fluentui/react-rating'; -import { RatingItemBaseState } from '@fluentui/react-rating'; +import type { RatingItemBaseState } from '@fluentui/react-rating'; import { RatingItemSlots as RatingItemSlots_2 } from '@fluentui/react-rating'; import type { RatingSlots as RatingSlots_2 } from '@fluentui/react-rating'; import * as React_2 from 'react'; +import { renderRating_unstable as renderRating } from '@fluentui/react-rating'; +import { renderRatingItem_unstable as renderRatingItem } from '@fluentui/react-rating'; // @public export const Rating: ForwardRefComponent; @@ -49,17 +50,15 @@ export type RatingSlots = RatingSlots_2; // @public export type RatingState = RatingBaseState; -// @public -export const renderRating: (state: RatingBaseState, contextValues: RatingContextValues) => JSXElement; +export { renderRating } -// @public -export const renderRatingItem: (state: RatingItemBaseState) => JSXElement; +export { renderRatingItem } // @public export const useRating: (props: RatingProps, ref: React_2.Ref) => RatingState; // @public (undocumented) -export const useRatingContextValues: (state: RatingState) => RatingContextValues_2; +export const useRatingContextValues: (state: RatingState) => RatingContextValues; // @public export const useRatingItem: (props: RatingItemProps, ref: React_2.Ref) => RatingItemState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/search-box.api.md b/packages/react-components/react-headless-components-preview/library/etc/search-box.api.md index 31b674c5975104..f41e0cd0465b63 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/search-box.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/search-box.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSearchBox_unstable as renderSearchBox } from '@fluentui/react-search'; import type { SearchBoxBaseProps } from '@fluentui/react-search'; -import { SearchBoxBaseState } from '@fluentui/react-search'; +import type { SearchBoxBaseState } from '@fluentui/react-search'; import type { SearchBoxSlots as SearchBoxSlots_2 } from '@fluentui/react-search'; -// @public -export const renderSearchBox: (state: SearchBoxBaseState) => JSXElement; +export { renderSearchBox } // @public export const SearchBox: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/select.api.md b/packages/react-components/react-headless-components-preview/library/etc/select.api.md index bee7abb47e0796..b5a5db212b4785 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/select.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/select.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSelect_unstable as renderSelect } from '@fluentui/react-select'; import type { SelectBaseProps } from '@fluentui/react-select'; -import { SelectBaseState } from '@fluentui/react-select'; +import type { SelectBaseState } from '@fluentui/react-select'; import type { SelectSlots as SelectSlots_2 } from '@fluentui/react-select'; -// @public -export const renderSelect: (state: SelectBaseState) => JSXElement; +export { renderSelect } // @public export const Select: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/skeleton.api.md b/packages/react-components/react-headless-components-preview/library/etc/skeleton.api.md index 92b4c02d337402..8356e82f3d0304 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/skeleton.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/skeleton.api.md @@ -4,21 +4,20 @@ ```ts -import { JSXElement } from '@fluentui/react-utilities'; import * as React_2 from 'react'; +import { renderSkeleton_unstable as renderSkeleton } from '@fluentui/react-skeleton'; +import { renderSkeletonItem_unstable as renderSkeletonItem } from '@fluentui/react-skeleton'; import { SkeletonBaseProps } from '@fluentui/react-skeleton'; -import { SkeletonBaseState } from '@fluentui/react-skeleton'; -import { SkeletonContextValues } from '@fluentui/react-skeleton'; +import type { SkeletonBaseState } from '@fluentui/react-skeleton'; +import type { SkeletonContextValues as SkeletonContextValues_2 } from '@fluentui/react-skeleton'; import { SkeletonItemBaseProps } from '@fluentui/react-skeleton'; -import { SkeletonItemBaseState } from '@fluentui/react-skeleton'; +import type { SkeletonItemBaseState } from '@fluentui/react-skeleton'; import type { SkeletonItemSlots as SkeletonItemSlots_2 } from '@fluentui/react-skeleton'; import type { SkeletonSlots as SkeletonSlots_2 } from '@fluentui/react-skeleton'; -// @public -export const renderSkeleton: (state: SkeletonBaseState, contextValues: SkeletonContextValues) => JSXElement; +export { renderSkeleton } -// @public -export const renderSkeletonItem: (state: SkeletonItemBaseState) => JSXElement; +export { renderSkeletonItem } // @public export const Skeleton: React_2.ForwardRefExoticComponent>; @@ -48,7 +47,7 @@ export type SkeletonState = SkeletonBaseState; export const useSkeleton: (props: SkeletonProps, ref: React_2.Ref) => SkeletonState; // @public -export const useSkeletonContextValues: (state: SkeletonState) => SkeletonContextValues_2; +export const useSkeletonContextValues: (state: SkeletonState) => SkeletonContextValues; // @public export const useSkeletonItem: (props: SkeletonItemProps, ref: React_2.Ref) => SkeletonItemState; diff --git a/packages/react-components/react-headless-components-preview/library/etc/slider.api.md b/packages/react-components/react-headless-components-preview/library/etc/slider.api.md index 97e3838793940e..94c650fb5d863c 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/slider.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/slider.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSlider_unstable as renderSlider } from '@fluentui/react-slider'; import type { SliderBaseProps } from '@fluentui/react-slider'; -import { SliderBaseState } from '@fluentui/react-slider'; +import type { SliderBaseState } from '@fluentui/react-slider'; import type { SliderSlots as SliderSlots_2 } from '@fluentui/react-slider'; -// @public -export const renderSlider: (state: SliderBaseState) => JSXElement; +export { renderSlider } // @public export const Slider: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/spin-button.api.md b/packages/react-components/react-headless-components-preview/library/etc/spin-button.api.md index ffe240d2c15146..7b96afa2951616 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/spin-button.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/spin-button.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSpinButton_unstable as renderSpinButton } from '@fluentui/react-spinbutton'; import type { SpinButtonBaseProps } from '@fluentui/react-spinbutton'; -import { SpinButtonBaseState } from '@fluentui/react-spinbutton'; +import type { SpinButtonBaseState } from '@fluentui/react-spinbutton'; import type { SpinButtonSlots as SpinButtonSlots_2 } from '@fluentui/react-spinbutton'; -// @public -export const renderSpinButton: (state: SpinButtonBaseState) => JSXElement; +export { renderSpinButton } // @public export const SpinButton: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/spinner.api.md b/packages/react-components/react-headless-components-preview/library/etc/spinner.api.md index 4ea4a948dab2d8..eef01402a2635e 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/spinner.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/spinner.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSpinner_unstable as renderSpinner } from '@fluentui/react-spinner'; import type { SpinnerBaseProps } from '@fluentui/react-spinner'; -import { SpinnerBaseState } from '@fluentui/react-spinner'; +import type { SpinnerBaseState } from '@fluentui/react-spinner'; import type { SpinnerSlots as SpinnerSlots_2 } from '@fluentui/react-spinner'; -// @public -export const renderSpinner: (state: SpinnerBaseState) => JSXElement; +export { renderSpinner } // @public export const Spinner: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/switch.api.md b/packages/react-components/react-headless-components-preview/library/etc/switch.api.md index cbecaff845488d..3a2e29ce58f3a5 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/switch.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/switch.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderSwitch_unstable as renderSwitch } from '@fluentui/react-switch'; import type { SwitchBaseProps } from '@fluentui/react-switch'; -import { SwitchBaseState } from '@fluentui/react-switch'; +import type { SwitchBaseState } from '@fluentui/react-switch'; import type { SwitchSlots as SwitchSlots_2 } from '@fluentui/react-switch'; -// @public -export const renderSwitch: (state: SwitchBaseState) => JSXElement; +export { renderSwitch } // @public export const Switch: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/etc/tab-list.api.md b/packages/react-components/react-headless-components-preview/library/etc/tab-list.api.md index 8c96039cfea3f2..5307f28be8e0c7 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/tab-list.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/tab-list.api.md @@ -5,22 +5,21 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderTab_unstable as renderTab } from '@fluentui/react-tabs'; +import { renderTabList_unstable as renderTabList } from '@fluentui/react-tabs'; import type { TabBaseProps } from '@fluentui/react-tabs'; -import { TabBaseState } from '@fluentui/react-tabs'; +import type { TabBaseState } from '@fluentui/react-tabs'; import type { TabListBaseProps } from '@fluentui/react-tabs'; -import { TabListBaseState } from '@fluentui/react-tabs'; -import { TabListContextValues } from '@fluentui/react-tabs'; +import type { TabListBaseState } from '@fluentui/react-tabs'; +import type { TabListContextValues as TabListContextValues_2 } from '@fluentui/react-tabs'; import type { TabListSlots as TabListSlots_2 } from '@fluentui/react-tabs'; import { TabSlots } from '@fluentui/react-tabs'; import { TabValue } from '@fluentui/react-tabs'; -// @public -export const renderTab: (state: TabBaseState) => JSXElement; +export { renderTab } -// @public -export const renderTabList: (state: TabListBaseState, contextValues: TabListContextValues) => JSXElement; +export { renderTabList } // @public export const Tab: ForwardRefComponent; @@ -65,7 +64,7 @@ export const useTab: (props: TabProps, ref: React_2.Ref) => TabStat export const useTabList: (props: TabListProps, ref: React_2.Ref) => TabListState; // @public (undocumented) -export const useTabListContextValues: (state: TabListState) => TabListContextValues_2; +export const useTabListContextValues: (state: TabListState) => TabListContextValues; // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-headless-components-preview/library/etc/textarea.api.md b/packages/react-components/react-headless-components-preview/library/etc/textarea.api.md index 7b8971da281302..a9afe00471d9f3 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/textarea.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/textarea.api.md @@ -5,14 +5,13 @@ ```ts import type { ForwardRefComponent } from '@fluentui/react-utilities'; -import { JSXElement } from '@fluentui/react-utilities'; import type * as React_2 from 'react'; +import { renderTextarea_unstable as renderTextarea } from '@fluentui/react-textarea'; import type { TextareaBaseProps } from '@fluentui/react-textarea'; -import { TextareaBaseState } from '@fluentui/react-textarea'; +import type { TextareaBaseState } from '@fluentui/react-textarea'; import type { TextareaSlots as TextareaSlots_2 } from '@fluentui/react-textarea'; -// @public -export const renderTextarea: (state: TextareaBaseState) => JSXElement; +export { renderTextarea } // @public export const Textarea: ForwardRefComponent; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Avatar/renderAvatar.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Avatar/renderAvatar.tsx index a7dbd90ee6bce3..dd90cc9a7e6ebb 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Avatar/renderAvatar.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Avatar/renderAvatar.tsx @@ -1,6 +1 @@ -import { renderAvatar_unstable } from '@fluentui/react-avatar'; - -/** - * Renders the final JSX of the Avatar component, given the state. - */ -export const renderAvatar = renderAvatar_unstable; +export { renderAvatar_unstable as renderAvatar } from '@fluentui/react-avatar'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Badge/renderBadge.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Badge/renderBadge.tsx index e47c727459cce8..a54480935a7636 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Badge/renderBadge.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Badge/renderBadge.tsx @@ -1,6 +1 @@ -import { renderBadge_unstable } from '@fluentui/react-badge'; - -/** - * Renders the final JSX of the Badge component, given the state. - */ -export const renderBadge = renderBadge_unstable; +export { renderBadge_unstable as renderBadge } from '@fluentui/react-badge'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Breadcrumb/renderBreadcrumb.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Breadcrumb/renderBreadcrumb.tsx index 21372820fb7a9e..e2a85738587955 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Breadcrumb/renderBreadcrumb.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Breadcrumb/renderBreadcrumb.tsx @@ -1,6 +1 @@ -import { renderBreadcrumb_unstable } from '@fluentui/react-breadcrumb'; - -/** - * Renders the final JSX of the Breadcrumb component, given the state and context values. - */ -export const renderBreadcrumb = renderBreadcrumb_unstable; +export { renderBreadcrumb_unstable as renderBreadcrumb } from '@fluentui/react-breadcrumb'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Card/renderCard.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Card/renderCard.tsx index bfa9be7b3dab7c..80f5cd1319ce24 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Card/renderCard.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Card/renderCard.tsx @@ -1,6 +1 @@ -import { renderCard_unstable } from '@fluentui/react-card'; - -/** - * Renders the final JSX of the Card component, given the state and context value. - */ -export const renderCard = renderCard_unstable; +export { renderCard_unstable as renderCard } from '@fluentui/react-card'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Checkbox/renderCheckbox.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Checkbox/renderCheckbox.tsx index b24c9b2ed209d6..9b7abafe1df613 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Checkbox/renderCheckbox.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Checkbox/renderCheckbox.tsx @@ -1,6 +1 @@ -import { renderCheckbox_unstable } from '@fluentui/react-checkbox'; - -/** - * Render the final JSX of Checkbox - */ -export const renderCheckbox = renderCheckbox_unstable; +export { renderCheckbox_unstable as renderCheckbox } from '@fluentui/react-checkbox'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Listbox/renderListbox.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Listbox/renderListbox.tsx index 287c072b5814d7..8f202fdb790e91 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Listbox/renderListbox.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Listbox/renderListbox.tsx @@ -1,6 +1 @@ -import { renderListbox_unstable } from '@fluentui/react-combobox'; - -/** - * Renders the final JSX of the Listbox component, given the state and context values. - */ -export const renderListbox = renderListbox_unstable; +export { renderListbox_unstable as renderListbox } from '@fluentui/react-combobox'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Option/renderOption.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Option/renderOption.tsx index 22625c803dcd31..02ee5aacd72a6a 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Option/renderOption.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/Option/renderOption.tsx @@ -1,6 +1 @@ -import { renderOption_unstable } from '@fluentui/react-combobox'; - -/** - * Renders the final JSX of the Option component, given the state. - */ -export const renderOption = renderOption_unstable; +export { renderOption_unstable as renderOption } from '@fluentui/react-combobox'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/OptionGroup/renderOptionGroup.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/OptionGroup/renderOptionGroup.tsx index a75fb9a490e95c..806bd91eafc635 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/OptionGroup/renderOptionGroup.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Dropdown/OptionGroup/renderOptionGroup.tsx @@ -1,6 +1 @@ -import { renderOptionGroup_unstable } from '@fluentui/react-combobox'; - -/** - * Renders the final JSX of the OptionGroup component, given the state. - */ -export const renderOptionGroup = renderOptionGroup_unstable; +export { renderOptionGroup_unstable as renderOptionGroup } from '@fluentui/react-combobox'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Field/renderField.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Field/renderField.tsx index 5223ac169fe8ea..a6649265dccdfb 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Field/renderField.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Field/renderField.tsx @@ -1,6 +1 @@ -import { renderField_unstable } from '@fluentui/react-field'; - -/** - * Renders the final JSX of the Field component, given the state. - */ -export const renderField = renderField_unstable; +export { renderField_unstable as renderField } from '@fluentui/react-field'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Input/renderInput.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Input/renderInput.tsx index 7e1891f1a33a9c..de8420affbc9ca 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Input/renderInput.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Input/renderInput.tsx @@ -1,6 +1 @@ -import { renderInput_unstable } from '@fluentui/react-input'; - -/** - * Renders the final JSX of the Input component, given the state. - */ -export const renderInput = renderInput_unstable; +export { renderInput_unstable as renderInput } from '@fluentui/react-input'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Link/renderLink.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Link/renderLink.tsx index 0fda28a3a1366c..a26079d2a27fe2 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Link/renderLink.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Link/renderLink.tsx @@ -1,6 +1 @@ -import { renderLink_unstable } from '@fluentui/react-link'; - -/** - * Renders the final JSX of the Link component, given the state. - */ -export const renderLink = renderLink_unstable; +export { renderLink_unstable as renderLink } from '@fluentui/react-link'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/Radio/renderRadio.tsx b/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/Radio/renderRadio.tsx index 755b32abbb7d6c..918a405b43a586 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/Radio/renderRadio.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/Radio/renderRadio.tsx @@ -1,6 +1 @@ -import { renderRadio_unstable } from '@fluentui/react-radio'; - -/** - * Renders the final JSX of the Radio component, given the state. - */ -export const renderRadio = renderRadio_unstable; +export { renderRadio_unstable as renderRadio } from '@fluentui/react-radio'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/renderRadioGroup.tsx b/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/renderRadioGroup.tsx index 9a8edbf4653856..c43d02dd147525 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/renderRadioGroup.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/RadioGroup/renderRadioGroup.tsx @@ -1,6 +1 @@ -import { renderRadioGroup_unstable } from '@fluentui/react-radio'; - -/** - * Renders the final JSX of the RadioGroup component, given the state. - */ -export const renderRadioGroup = renderRadioGroup_unstable; +export { renderRadioGroup_unstable as renderRadioGroup } from '@fluentui/react-radio'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Rating/RatingItem/renderRatingItem.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Rating/RatingItem/renderRatingItem.tsx index c85d3c3fabc252..4c827f16a9b976 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Rating/RatingItem/renderRatingItem.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Rating/RatingItem/renderRatingItem.tsx @@ -1,6 +1 @@ -import { renderRatingItem_unstable } from '@fluentui/react-rating'; - -/** - * Renders the final JSX of the RatingItem component, given the state. - */ -export const renderRatingItem = renderRatingItem_unstable; +export { renderRatingItem_unstable as renderRatingItem } from '@fluentui/react-rating'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Rating/renderRating.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Rating/renderRating.tsx index 6fdd0e4ba9bf87..51a05e68d1dc55 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Rating/renderRating.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Rating/renderRating.tsx @@ -1,6 +1 @@ -import { renderRating_unstable } from '@fluentui/react-rating'; - -/** - * Renders the final JSX of the Rating component, given the state. - */ -export const renderRating = renderRating_unstable; +export { renderRating_unstable as renderRating } from '@fluentui/react-rating'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/RatingDisplay/renderRatingDisplay.tsx b/packages/react-components/react-headless-components-preview/library/src/components/RatingDisplay/renderRatingDisplay.tsx index c1962edd399ebc..f59968573d27f1 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/RatingDisplay/renderRatingDisplay.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/RatingDisplay/renderRatingDisplay.tsx @@ -1,6 +1 @@ -import { renderRatingDisplay_unstable } from '@fluentui/react-rating'; - -/** - * Renders the final JSX of the RatingDisplay component, given the state. - */ -export const renderRatingDisplay = renderRatingDisplay_unstable; +export { renderRatingDisplay_unstable as renderRatingDisplay } from '@fluentui/react-rating'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SearchBox/renderSearchBox.tsx b/packages/react-components/react-headless-components-preview/library/src/components/SearchBox/renderSearchBox.tsx index 6c17d54d4a6dde..ef80a2d5bc77ce 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/SearchBox/renderSearchBox.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/SearchBox/renderSearchBox.tsx @@ -1,6 +1 @@ -import { renderSearchBox_unstable } from '@fluentui/react-search'; - -/** - * Renders the final JSX of the SearchBox component, given the state. - */ -export const renderSearchBox = renderSearchBox_unstable; +export { renderSearchBox_unstable as renderSearchBox } from '@fluentui/react-search'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Select/renderSelect.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Select/renderSelect.tsx index b6de75286f3ec0..2e621bb04c98e6 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Select/renderSelect.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Select/renderSelect.tsx @@ -1,6 +1 @@ -import { renderSelect_unstable } from '@fluentui/react-select'; - -/** - * Render the final JSX of Select - */ -export const renderSelect = renderSelect_unstable; +export { renderSelect_unstable as renderSelect } from '@fluentui/react-select'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/SkeletonItem/renderSkeletonItem.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/SkeletonItem/renderSkeletonItem.tsx index f99403783efd2d..08edbfc2ea2f9e 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/SkeletonItem/renderSkeletonItem.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/SkeletonItem/renderSkeletonItem.tsx @@ -1,6 +1 @@ -import { renderSkeletonItem_unstable } from '@fluentui/react-skeleton'; - -/** - * Renders the final JSX of the SkeletonItem component, given the state. - */ -export const renderSkeletonItem = renderSkeletonItem_unstable; +export { renderSkeletonItem_unstable as renderSkeletonItem } from '@fluentui/react-skeleton'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/renderSkeleton.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/renderSkeleton.tsx index 2bc31745425dcb..0be8725fef2bbf 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/renderSkeleton.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Skeleton/renderSkeleton.tsx @@ -1,6 +1 @@ -import { renderSkeleton_unstable } from '@fluentui/react-skeleton'; - -/** - * Renders the final JSX of the Skeleton component, given the state. - */ -export const renderSkeleton = renderSkeleton_unstable; +export { renderSkeleton_unstable as renderSkeleton } from '@fluentui/react-skeleton'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Slider/renderSlider.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Slider/renderSlider.tsx index 93f9cf3a20971e..ef4564c7195dfd 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Slider/renderSlider.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Slider/renderSlider.tsx @@ -1,6 +1 @@ -import { renderSlider_unstable } from '@fluentui/react-slider'; - -/** - * Renders the final JSX of the Slider component, given the state. - */ -export const renderSlider = renderSlider_unstable; +export { renderSlider_unstable as renderSlider } from '@fluentui/react-slider'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/SpinButton/renderSpinButton.tsx b/packages/react-components/react-headless-components-preview/library/src/components/SpinButton/renderSpinButton.tsx index e20dc034670f9a..599aff7a349c76 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/SpinButton/renderSpinButton.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/SpinButton/renderSpinButton.tsx @@ -1,6 +1 @@ -import { renderSpinButton_unstable } from '@fluentui/react-spinbutton'; - -/** - * Renders the final JSX of the SpinButton component, given the state. - */ -export const renderSpinButton = renderSpinButton_unstable; +export { renderSpinButton_unstable as renderSpinButton } from '@fluentui/react-spinbutton'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Spinner/renderSpinner.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Spinner/renderSpinner.tsx index d0a7b1ecf8615f..3759d46a9c840f 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Spinner/renderSpinner.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Spinner/renderSpinner.tsx @@ -1,6 +1 @@ -import { renderSpinner_unstable } from '@fluentui/react-spinner'; - -/** - * Renders the final JSX of the Spinner component, given the state. - */ -export const renderSpinner = renderSpinner_unstable; +export { renderSpinner_unstable as renderSpinner } from '@fluentui/react-spinner'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Switch/renderSwitch.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Switch/renderSwitch.tsx index 9fd8c9e984fa84..b0ec2b66967604 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Switch/renderSwitch.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Switch/renderSwitch.tsx @@ -1,6 +1 @@ -import { renderSwitch_unstable } from '@fluentui/react-switch'; - -/** - * Renders the final JSX of the Switch component, given the state. - */ -export const renderSwitch = renderSwitch_unstable; +export { renderSwitch_unstable as renderSwitch } from '@fluentui/react-switch'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/TabList/Tab/renderTab.tsx b/packages/react-components/react-headless-components-preview/library/src/components/TabList/Tab/renderTab.tsx index 68322a8d4542e8..15713e7d1630bc 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/TabList/Tab/renderTab.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/TabList/Tab/renderTab.tsx @@ -1,6 +1 @@ -import { renderTab_unstable } from '@fluentui/react-tabs'; - -/** - * Renders the final JSX of the Tab component, given the state. - */ -export const renderTab = renderTab_unstable; +export { renderTab_unstable as renderTab } from '@fluentui/react-tabs'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/TabList/renderTabList.tsx b/packages/react-components/react-headless-components-preview/library/src/components/TabList/renderTabList.tsx index 9d601f590a86d0..4f22a3d2f11c41 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/TabList/renderTabList.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/TabList/renderTabList.tsx @@ -1,6 +1 @@ -import { renderTabList_unstable } from '@fluentui/react-tabs'; - -/** - * Renders the final JSX of the TabList component, given the state. - */ -export const renderTabList = renderTabList_unstable; +export { renderTabList_unstable as renderTabList } from '@fluentui/react-tabs'; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Textarea/renderTextarea.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Textarea/renderTextarea.tsx index a9639e72682d10..07784d344317b6 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Textarea/renderTextarea.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Textarea/renderTextarea.tsx @@ -1,6 +1 @@ -import { renderTextarea_unstable } from '@fluentui/react-textarea'; - -/** - * Renders the final JSX of the Textarea component, given the state. - */ -export const renderTextarea = renderTextarea_unstable; +export { renderTextarea_unstable as renderTextarea } from '@fluentui/react-textarea'; diff --git a/packages/react-components/react-positioning/library/src/createPositionManager.test.ts b/packages/react-components/react-positioning/library/src/createPositionManager.test.ts index 943c592c0d8a1f..2fec93d145e337 100644 --- a/packages/react-components/react-positioning/library/src/createPositionManager.test.ts +++ b/packages/react-components/react-positioning/library/src/createPositionManager.test.ts @@ -90,7 +90,7 @@ describe('createPositionManager', () => { expect(event).toBeInstanceOf(CustomEvent); expect(event.type).toBe(POSITIONING_END_EVENT); - expect(event.detail).toEqual({ placement }); + expect(event.detail).toEqual({ placement, escaped: false, referenceHidden: false }); }); it('dispatches event with computed placement when middleware changes it', async () => { @@ -124,6 +124,40 @@ describe('createPositionManager', () => { const event: OnPositioningEndEvent = listener.mock.calls[0][0]; expect(event.detail.placement).toBe('bottom'); + expect(event.detail.escaped).toBe(false); + expect(event.detail.referenceHidden).toBe(false); + }); + + it('dispatches event with hide middleware visibility flags', async () => { + computePositionMock.mockResolvedValue({ + x: 10, + y: 20, + placement: 'bottom', + strategy: 'absolute', + middlewareData: { + ...mockMiddlewareData, + hide: { escaped: true, referenceHidden: true }, + }, + }); + + const { container, target } = createTestElements(); + const listener = jest.fn(); + container.addEventListener(POSITIONING_END_EVENT, listener); + + createPositionManager({ + container, + target, + arrow: null, + strategy: 'absolute', + middleware: [], + placement: 'bottom', + disableUpdateOnResize: true, + }); + + await flushMicrotasks(); + + const event: OnPositioningEndEvent = listener.mock.calls[0][0]; + expect(event.detail).toEqual({ placement: 'bottom', escaped: true, referenceHidden: true }); }); it('does not dispatch event after dispose', async () => { diff --git a/packages/react-components/react-positioning/library/src/createPositionManager.ts b/packages/react-components/react-positioning/library/src/createPositionManager.ts index 3e5136cecf8312..56f5538f8c861f 100644 --- a/packages/react-components/react-positioning/library/src/createPositionManager.ts +++ b/packages/react-components/react-positioning/library/src/createPositionManager.ts @@ -142,6 +142,8 @@ export function createPositionManager(options: PositionManagerOptions): Position // These are equivalent string unions; the cast avoids leaking @floating-ui/dom // types into the public API surface. placement: computedPlacement satisfies PositioningPlacement, + escaped: middlewareData.hide?.escaped ?? false, + referenceHidden: middlewareData.hide?.referenceHidden ?? false, }, }), ); diff --git a/packages/react-components/react-positioning/library/src/types.test.ts b/packages/react-components/react-positioning/library/src/types.test.ts index d947da1d047c6d..1d74fd5116c473 100644 --- a/packages/react-components/react-positioning/library/src/types.test.ts +++ b/packages/react-components/react-positioning/library/src/types.test.ts @@ -39,9 +39,13 @@ describe('PositioningProps', () => { it('accepts (e: OnPositioningEndEvent) => void for onPositioningEnd', () => { const callback = (e: OnPositioningEndEvent) => { - // Access detail.placement to verify the type shape + // Access detail fields to verify the type shape const _placement: string = e.detail.placement; + const _escaped: boolean = e.detail.escaped; + const _referenceHidden: boolean = e.detail.referenceHidden; _placement; + _escaped; + _referenceHidden; }; const props: PositioningProps = { diff --git a/packages/react-components/react-positioning/library/src/types.ts b/packages/react-components/react-positioning/library/src/types.ts index a0e81a2370e622..762d3153be86f9 100644 --- a/packages/react-components/react-positioning/library/src/types.ts +++ b/packages/react-components/react-positioning/library/src/types.ts @@ -29,6 +29,18 @@ export type OnPositioningEndEventDetail = { * placement if flip or other middleware adjusted it. */ placement: PositioningPlacement; + + /** + * True when the floating element has escaped its clipping boundary, + * as reported by Floating UI's hide middleware. + */ + escaped: boolean; + + /** + * True when the reference element is clipped or out of view, + * as reported by Floating UI's hide middleware. + */ + referenceHidden: boolean; }; /** diff --git a/packages/react-components/react-positioning/library/src/usePositioning.test.tsx b/packages/react-components/react-positioning/library/src/usePositioning.test.tsx index f531f2532181f2..d92b4736def382 100644 --- a/packages/react-components/react-positioning/library/src/usePositioning.test.tsx +++ b/packages/react-components/react-positioning/library/src/usePositioning.test.tsx @@ -13,7 +13,11 @@ jest.mock('./createPositionManager', () => ({ Promise.resolve().then(() => { container.dispatchEvent( new CustomEvent(POSITIONING_END_EVENT, { - detail: { placement: 'bottom' }, + detail: { + placement: 'bottom', + escaped: false, + referenceHidden: false, + }, }), ); }); @@ -62,6 +66,8 @@ describe('usePositioning', () => { expect(event).toBeInstanceOf(CustomEvent); expect(event.type).toBe(POSITIONING_END_EVENT); expect(event.detail.placement).toBe('bottom'); + expect(event.detail.escaped).toBe(false); + expect(event.detail.referenceHidden).toBe(false); }); it('works when onPositioningEnd is not provided', async () => { diff --git a/packages/react-components/react-positioning/library/src/usePositioningSlideDirection.test.ts b/packages/react-components/react-positioning/library/src/usePositioningSlideDirection.test.ts index 65bd894ee7893f..a8491e8b62c5ec 100644 --- a/packages/react-components/react-positioning/library/src/usePositioningSlideDirection.test.ts +++ b/packages/react-components/react-positioning/library/src/usePositioningSlideDirection.test.ts @@ -53,7 +53,7 @@ describe('usePositioningSlideDirection', () => { act(() => { const event: OnPositioningEndEvent = new CustomEvent('positioningend', { - detail: { placement: 'bottom' }, + detail: { placement: 'bottom', escaped: false, referenceHidden: false }, }); Object.defineProperty(event, 'target', { value: element }); result.current(event); @@ -76,7 +76,7 @@ describe('usePositioningSlideDirection', () => { act(() => { const event: OnPositioningEndEvent = new CustomEvent('positioningend', { - detail: { placement: 'right-start' }, + detail: { placement: 'right-start', escaped: false, referenceHidden: false }, }); Object.defineProperty(event, 'target', { value: element }); result.current(event); @@ -101,7 +101,7 @@ describe('usePositioningSlideDirection', () => { act(() => { const event: OnPositioningEndEvent = new CustomEvent('positioningend', { - detail: { placement: 'top' }, + detail: { placement: 'top', escaped: false, referenceHidden: false }, }); // CustomEvent doesn't set target automatically, so we dispatch it from element Object.defineProperty(event, 'target', { value: element });