forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rfc/z-index-handling
* master: (90 commits) fix(react-drawer): do not create global header/footer roles (microsoft#31799) release: applying package updates - react v8 release: applying package updates - web-components Add 'allowParentArrowNavigation' prop to `ComboBox`. (microsoft#31805) Add drawer web component (microsoft#31521) fix: MenuButton is styled correctly when aria-expanded is a string (microsoft#31809) chore: Updating version of `@fluentui/react-icons` to `^2.0.245` (microsoft#31802) chore:(docs) Migrate e2e Cypress testing doc (microsoft#31796) chore:(docs) Update API Extractor file (microsoft#31651) chore: migrate to nx 18 (microsoft#31746) release: applying package updates - react v8 release: applying package updates - web-components feat: update text to use element internals for custom states (microsoft#31770) chore(web-components): Remove define imports from story modules (microsoft#31622) fix(`merge-styles`): Correctly processing selectors when value is a class name and they are not wrapped in `selectors` wrapper (microsoft#31798) style(react-combobox): turn off react-compiler lints for non compliant code (microsoft#31795) docs: Add AriaLiveAnnouncer to all examples (microsoft#31794) fix(public-docsite-v9): disable storybook keyboard shortcuts (microsoft#31762) feat: V0 Attachment compact component (microsoft#31634) release: applying package updates - react v8 ...
- Loading branch information
Showing
1,048 changed files
with
16,712 additions
and
3,273 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
The `@fluentui/react-icons` package provides [Fluent UI System Icons](https://github.com/microsoft/fluentui-system-icons) icon set. Each icon within this set is encapsulated within a React component, utilizing SVG-based graphics. Icons are available in two distinct styles: `Filled` and `Regular`. | ||
|
||
<details> | ||
<summary>Sized icons vs unsized icons?</summary> | ||
## Sized icons vs unsized icons | ||
|
||
- **Unsized** icons (e.g., `SendRegular`, `SendFilled`, etc.) are set to `1em` in size and can be adjusted proportionally using the `fontSize` property. | ||
- **Sized** icons (e.g., `Send24Regular`, `Send32Regular`) are fixed to predetermined sizes and do not scale. | ||
|
||
As a general guideline, it's recommended to utilize unsized icons since the same instance of an icon can be reused multiple times. However, there are instances where icons may not scale effectively. For example, icons containing logos and signs often have varied glyph sizes. In such cases, it's advisable to opt for sized icons. | ||
|
||
</details> | ||
--- | ||
|
||
You can preview <a href="#" data-sb-kind="icons-catalog--page">all icons in the catalog</a>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
apps/react-18-tests-v9/src/createPresenceComponent.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { createPresenceComponent, useEventCallback } from '@fluentui/react-components'; | ||
import { act, render } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
import * as React from 'react'; | ||
|
||
const keyframes = [{ opacity: 0 }, { opacity: 1 }]; | ||
const options = { duration: 500, fill: 'forwards' as const }; | ||
|
||
const TestAtom = createPresenceComponent({ | ||
enter: { keyframes, ...options }, | ||
exit: { keyframes: keyframes.slice().reverse(), ...options }, | ||
}); | ||
const TestComponent: React.FC<{ appear?: boolean; finish?: () => void }> = props => { | ||
const { appear, finish } = props; | ||
|
||
const [visible, setVisible] = React.useState(true); | ||
const onMotionFinish = useEventCallback(() => { | ||
finish?.(); | ||
}); | ||
|
||
return ( | ||
<> | ||
<button onClick={() => setVisible(v => !v)}>Click me</button> | ||
<TestAtom appear={appear} onMotionFinish={onMotionFinish} visible={visible} unmountOnExit> | ||
<div>Hello</div> | ||
</TestAtom> | ||
</> | ||
); | ||
}; | ||
|
||
// Heads up! | ||
// | ||
// Unfortunately, jsdom (the optional environment for Jest) does not support the Web Animations API, which is used by | ||
// createPresenceComponent() to animate elements. | ||
// | ||
// This test suite ensures that the component works correctly in tests using that environment. | ||
|
||
describe('createPresenceComponent', () => { | ||
it('does not support .animate()', () => { | ||
expect(Element.prototype.animate).toBeUndefined(); | ||
}); | ||
|
||
it('unmounts when state changes', async () => { | ||
const finish = jest.fn(); | ||
|
||
const { getByText, queryByText } = render(<TestComponent finish={finish} />); | ||
expect(queryByText('Hello')).toBeInTheDocument(); | ||
|
||
// --- | ||
|
||
await act(async () => { | ||
await userEvent.click(getByText('Click me')); | ||
}); | ||
|
||
expect(finish).toHaveBeenCalledTimes(1); | ||
expect(queryByText('Hello')).not.toBeInTheDocument(); | ||
|
||
// --- | ||
|
||
await act(async () => { | ||
await userEvent.click(getByText('Click me')); | ||
}); | ||
|
||
expect(finish).toHaveBeenCalledTimes(2); | ||
expect(queryByText('Hello')).toBeInTheDocument(); | ||
}); | ||
|
||
it('handles "appear"', async () => { | ||
const finish = jest.fn(); | ||
const { getByText, queryByText } = render(<TestComponent appear finish={finish} />); | ||
|
||
expect(finish).toHaveBeenCalledTimes(1); | ||
expect(queryByText('Hello')).toBeInTheDocument(); | ||
|
||
// --- | ||
|
||
await act(async () => { | ||
await userEvent.click(getByText('Click me')); | ||
}); | ||
|
||
expect(finish).toHaveBeenCalledTimes(2); | ||
expect(queryByText('Hello')).not.toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
apps/vr-tests-web-components/src/stories/link/link.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as React from 'react'; | ||
import { default as parse } from 'html-react-parser'; | ||
import { Steps, StoryWright } from 'storywright'; | ||
import { LinkDefinition, FluentDesignSystem } from '@fluentui/web-components'; | ||
|
||
LinkDefinition.define(FluentDesignSystem.registry); | ||
|
||
const linkId = 'link-id'; | ||
|
||
const steps = new Steps() | ||
.snapshot('default', { cropTo: '.testWrapper' }) | ||
.hover(`#${linkId}`) | ||
.snapshot('hover', { cropTo: '.testWrapper' }) | ||
.mouseDown(`#${linkId}`) | ||
.snapshot('pressed', { cropTo: '.testWrapper' }) | ||
.end(); | ||
|
||
export default { | ||
title: 'Link', | ||
decorators: [ | ||
(story: () => React.ReactElement) => { | ||
return ( | ||
<StoryWright steps={steps}> | ||
<div className="testWrapper" style={{ width: '300px' }}> | ||
{story()} | ||
</div> | ||
</StoryWright> | ||
); | ||
}, | ||
], | ||
}; | ||
|
||
export const Default = () => parse(`<fluent-link id="${linkId}">Default</fluent-link>`); | ||
|
||
export const Subtle = () => parse(`<fluent-link id="${linkId}" appearance="subtle">Primary</fluent-link>`); | ||
|
||
export const Inline = () => | ||
parse(`<p>This is an <fluent-link id="${linkId}" inline>inline link</fluent-link> used alongside text</p>.`); | ||
|
||
export const WithLongText = () => | ||
parse(` | ||
<style> | ||
.max-width { | ||
display: block; | ||
width: 250px; | ||
} | ||
</style> | ||
<p class="max-width"> | ||
This paragraph contains a link which is very long. | ||
<fluent-link href="#">Fluent links wrap correctly between lines when they are very long.</fluent-link> This is | ||
because they are inline elements. | ||
</p> | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-accordion-7c04c866-80b9-42c1-9332-1272b109bc22.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "chore: Update react-icons package to ^2.0.245", | ||
"packageName": "@fluentui/react-accordion", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 0 additions & 7 deletions
7
change/@fluentui-react-accordion-d1e7dc7f-a785-4885-988f-8bef076f940a.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
change/@fluentui-react-accordion-f6fc3afb-deba-42af-8493-b659a4d2b63c.json
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-accordion-fb735b51-0d39-4ec7-9891-0440b40eeb9b.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "chore: add eslint react-compiler", | ||
"packageName": "@fluentui/react-accordion", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-aria-98a2ae86-abde-4e51-888a-d17e8e7badba.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: add options to manually show/hide focus visibility on active descendants, and scroll the active item into view", | ||
"packageName": "@fluentui/react-aria", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Oops, something went wrong.