Skip to content

Commit 9aef870

Browse files
authored
Merge branch 'master' into feat/ci_dry_run
2 parents 4fe335a + 1c7b0ad commit 9aef870

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4838
-83
lines changed

.github/workflows/pr-vrt-comment.yml

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
workflows: ['VRT CI']
55
types:
66
- completed
7-
branches:
8-
- master
9-
# remove following once CRT testing is done
10-
- vrt-gha-testing
117

128
concurrency:
139
# see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { Meta } from '@storybook/addon-docs';
2+
3+
<Meta title="Concepts/Developer/Accessibility/Truncation" />
4+
5+
## Truncation
6+
7+
Fluent has moved away from building in CSS truncation in components in v9 due to the accessibility concerns that accompany it. There are some ways to handle truncation in an accessible way, though it is important to be aware of the potential pitfalls when doing so.
8+
9+
Our top recommendation is to use character count-based javascript truncation over CSS truncation, ensuring that strings are never truncated past a reasonable and readable number of characters shown, and also to prefer truncating in the middle of the string instead of at the end. This page goes over a full explanation of why we recommend that approach, and a few potential alternatives.
10+
11+
### Accessibility traps
12+
13+
Truncating text based on available width primarily causes problems for people using static page zoom, zoom software, smaller-screen devices, and alternative input methods. These can often combine with eachother to create increasingly difficult barriers to access. Most of those barriers boil down to two specific problems:
14+
15+
1. Truncation based on width at small screen sizes can quickly render the control useless by showing so few characters that the information cannot be parsed.
16+
2. The full text is often exposed in tooltips which are inaccessable to many users, and often specifically the users who most need it.
17+
18+
The most common scenarios where a user would experience truncation past the point of understandability are:
19+
20+
- Small-screen devices
21+
- Static zoom or text size increases, sometimes paired with a zooming software like ZoomText
22+
- Zoom or text size increases on a small-screen device
23+
24+
All of these cases also increase the likelihood that tooltips will not be accessible. Small-screen devices are usually touchscreens, which do not allow the user to access tooltips on most controls.
25+
26+
Additionally, static zoom is often paired with screen magnification software, which makes tooltip access much more difficult. The WCAG criterion [1.4.13 Content on Hover or Focus](https://www.w3.org/WAI/WCAG22/Understanding/content-on-hover-or-focus.html) is intended to help make tooltips and other hover content more accessible to magnification users, but it still falls far short in terms of real-world usability. In user studies on tooltips that meet all WCAG requirements as well as keyboard, screen reader, and touch access, one zoom + macOS magnification user had the following to say about our tooltips:
27+
28+
> "There’s something popping up here, but it’s blending in with the background, and I can’t tell where it starts or begins. I’m so visually confused by all of this, that I would not interact with any of this body text."
29+
30+
and:
31+
32+
> "I haaaate hover and things I need to hover over"
33+
34+
This is why tooltips should generally be short optional hints that are not necessary to the understanding and operation of the UI. If a UI uses width-based truncation for a set of items in e.g. a list, menu, or table that requires some users to hover over every entry to read it, that would drastically slow down those users in the best case scenario, and fully block them in the worst-case scenario.
35+
36+
There are ways to truncate while avoiding these pitfalls, but they must ensure that users do not lose meaningful information when zooming, and that tooltips are not the primary method of making truncated text available.
37+
38+
### Accessible truncation approaches
39+
40+
**1. Truncate the string with javascript based on character count, optionally in the middle rather than end of the string**
41+
42+
This approach makes it possible to prevent truncation below a minimum number of characters, which can be chosen to ensure the string never shortens past the point of understandability. The other benefit is that javascript truncation enables truncating in the middle of the string in cases where the end contains relevant information as in the case of file names or emails.
43+
44+
**2. Set a reasonable `min-width` paired with CSS truncation to prevent truncating past usability**
45+
46+
This approach works best when the truncation is occuring in a table or grid, where the user might expect to need to scroll horizontally to consume all the information.
47+
48+
The potential pitfall of this approach is that in some places, setting a `min-width` may cause [WCAG Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html) failures if it causes the page to scroll horizontally when zoomed.
49+
50+
**3. Only truncate text that is not necessary for the understanding or operation of the UI**
51+
52+
This is a rare case, since most of the time content that is irrelevant to users should not be displayed. This would need to be evaluated on a case-by-case basis, but a couple examples include:
53+
54+
- `id` or hash data that is not really intended to be read as text by humans
55+
- Supplementary content, such as a post summary following a post title, where reading the title alone is a reasonable user experience.
56+
57+
**4. Only truncate based on user actions or settings**
58+
59+
If truncation occurs as the result of the user resizing UI or choosing a compact view setting (e.g. in an email application), it is fine to truncate purely based on available space.

apps/vr-tests-react-components/src/stories/Slider/Slider.stories.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Meta } from '@storybook/react';
33
import { Steps } from 'storywright';
44
import { Slider } from '@fluentui/react-slider';
55
import { getStoryVariant, RTL, TestWrapperDecorator, withStoryWrightSteps } from '../../utilities';
6+
import { SampleCustomizedSlider } from './utils';
67

78
export default {
89
title: 'Slider Converged',
@@ -31,3 +32,5 @@ export const Vertical100 = () => <Slider vertical defaultValue={100} />;
3132
Vertical100.storyName = 'Vertical - 100%';
3233

3334
export const Vertical100RTL = getStoryVariant(Vertical100, RTL);
35+
36+
export const CustomizedSlider = <SampleCustomizedSlider />;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import * as React from 'react';
2+
import { Slider, sliderCSSVars } from '@fluentui/react-slider';
3+
import { makeStyles } from '@griffel/react';
4+
const { sliderProgressColorVar, sliderRailColorVar, sliderThumbColorVar, sliderThumbSizeVar } = sliderCSSVars;
5+
6+
const useStyles = makeStyles({
7+
enabled: {
8+
[sliderProgressColorVar]: '#ff0764',
9+
[sliderRailColorVar]: '##242424',
10+
[sliderThumbColorVar]: '#ff0764',
11+
':hover': {
12+
[sliderThumbColorVar]: '#d60d58',
13+
[sliderProgressColorVar]: '#d60d58',
14+
':active': {
15+
[sliderThumbColorVar]: '#b91150',
16+
[sliderProgressColorVar]: '#b91150',
17+
},
18+
},
19+
},
20+
thumb: {
21+
[sliderThumbSizeVar]: '16px',
22+
boxShadow: `0 0 0 calc(var(${sliderThumbSizeVar}) * .2) transparent inset`,
23+
'::before': {
24+
content: 'unset',
25+
},
26+
},
27+
});
28+
29+
export const SampleCustomizedSlider = () => {
30+
const styles = useStyles();
31+
32+
return <Slider className={styles.enabled} thumb={{ className: styles.thumb }} defaultValue={20} size="small" />;
33+
};

apps/vr-tests-web-components/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "../../tsconfig.base.wc.json",
33
"compilerOptions": {
4-
"target": "ES2019",
54
"module": "NodeNext",
65
"noEmit": true,
76
"experimentalDecorators": true,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: Button sets correct disabledFocusable icon color",
4+
"packageName": "@fluentui/react-button",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: exported internal CSS variables",
4+
"packageName": "@fluentui/react-slider",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/charts/chart-web-components/CHANGELOG.json

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"name": "@fluentui/chart-web-components",
33
"entries": [
4+
{
5+
"date": "Tue, 04 Feb 2025 04:07:18 GMT",
6+
"tag": "@fluentui/chart-web-components_v0.0.1",
7+
"version": "0.0.1",
8+
"comments": {
9+
"patch": [
10+
{
11+
"author": "beachball",
12+
"package": "@fluentui/chart-web-components",
13+
"comment": "Bump @fluentui/web-components to v3.0.0-beta.78",
14+
"commit": "da62e83423063b6ab3ed62e62bcb965f37cf5700"
15+
}
16+
]
17+
}
18+
},
419
{
520
"date": "Fri, 17 Jan 2025 04:07:40 GMT",
621
"tag": "@fluentui/chart-web-components_v0.0.0",

packages/charts/chart-web-components/CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# Change Log - @fluentui/chart-web-components
22

3-
This log was last generated on Fri, 17 Jan 2025 04:07:40 GMT and should not be manually modified.
3+
This log was last generated on Tue, 04 Feb 2025 04:07:18 GMT and should not be manually modified.
44

55
<!-- Start content -->
66

7+
## [0.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.1)
8+
9+
Tue, 04 Feb 2025 04:07:18 GMT
10+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/chart-web-components_v0.0.0..@fluentui/chart-web-components_v0.0.1)
11+
12+
### Patches
13+
14+
- Bump @fluentui/web-components to v3.0.0-beta.78 ([PR #33756](https://github.com/microsoft/fluentui/pull/33756) by beachball)
15+
716
## [0.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.0)
817

918
Fri, 17 Jan 2025 04:07:40 GMT

packages/charts/chart-web-components/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@fluentui/chart-web-components",
33
"description": "A library of Fluent Chart Web Components",
4-
"version": "0.0.0",
4+
"version": "0.0.1",
55
"author": {
66
"name": "Microsoft"
77
},
@@ -98,7 +98,7 @@
9898
"dependencies": {
9999
"@microsoft/fast-web-utilities": "^6.0.0",
100100
"@fluentui/tokens": "^1.0.0-alpha.21",
101-
"@fluentui/web-components": "^3.0.0-beta.77",
101+
"@fluentui/web-components": "^3.0.0-beta.78",
102102
"@types/d3-selection": "^3.0.0",
103103
"@types/d3-shape": "^3.0.0",
104104
"d3-selection": "^3.0.0",

packages/react-components/react-avatar/stories/src/AvatarGroup/index.stories.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AvatarGroup } from '@fluentui/react-components';
1+
import { AvatarGroup, AvatarGroupItem, Avatar, AvatarGroupPopover } from '@fluentui/react-components';
22

33
import bestPracticesMd from './AvatarGroupBestPractices.md';
44
import descriptionMd from './AvatarGroupDescription.md';
@@ -14,6 +14,11 @@ export { Tooltip } from './AvatarGroupTooltip.stories';
1414
export default {
1515
title: 'Components/AvatarGroup',
1616
component: AvatarGroup,
17+
subcomponents: {
18+
AvatarGroupItem,
19+
Avatar,
20+
AvatarGroupPopover,
21+
},
1722
parameters: {
1823
docs: {
1924
description: {

packages/react-components/react-button/library/src/components/Button/useButtonStyles.styles.ts

+12
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ const useRootDisabledStyles = makeStyles({
373373
...shorthands.borderColor('GrayText'),
374374
color: 'GrayText',
375375

376+
[`& .${buttonClassNames.icon}`]: {
377+
color: 'GrayText',
378+
},
379+
376380
':focus': {
377381
...shorthands.borderColor('GrayText'),
378382
},
@@ -381,12 +385,20 @@ const useRootDisabledStyles = makeStyles({
381385
backgroundColor: 'ButtonFace',
382386
...shorthands.borderColor('GrayText'),
383387
color: 'GrayText',
388+
389+
[`& .${buttonClassNames.icon}`]: {
390+
color: 'GrayText',
391+
},
384392
},
385393

386394
':hover:active': {
387395
backgroundColor: 'ButtonFace',
388396
...shorthands.borderColor('GrayText'),
389397
color: 'GrayText',
398+
399+
[`& .${buttonClassNames.icon}`]: {
400+
color: 'GrayText',
401+
},
390402
},
391403
},
392404
},

packages/react-components/react-slider/library/etc/react-slider.api.md

+6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ export const sliderClassNames: SlotClassNames<SliderSlots>;
2525
// @public (undocumented)
2626
export const sliderCSSVars: {
2727
sliderDirectionVar: string;
28+
sliderInnerThumbRadiusVar: string;
2829
sliderProgressVar: string;
30+
sliderProgressColorVar: string;
31+
sliderRailSizeVar: string;
32+
sliderRailColorVar: string;
2933
sliderStepsPercentVar: string;
34+
sliderThumbColorVar: string;
35+
sliderThumbSizeVar: string;
3036
};
3137

3238
// @public (undocumented)

0 commit comments

Comments
 (0)