Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates spec for fluent toolbar web component. #27703

Closed
wants to merge 6 commits into from
Closed

Creates spec for fluent toolbar web component. #27703

wants to merge 6 commits into from

Conversation

halerankin
Copy link
Contributor

@halerankin halerankin commented Apr 26, 2023

Create Spec for Toolbar Component

Toolbar

Component Description

A toolbar is a container for grouping a set of controls, such as buttons, menubuttons, or checkboxes.

When a set of controls is visually presented as a group, the toolbar role can be used to communicate the presence and purpose of the grouping to screen reader users. Grouping controls into toolbars can also be an effective way of reducing the number of tab stops in the keyboard interface.

Design Spec

Link to Design Spec in Figma

Link to Fluent 2 Storybook

Engineering Spec

Inputs

  • @attr orientation: "horizontal" "vertical" | "horizontal"
  • @attr size: "small" "medium" "large" | "medium"

Outputs

Slots

  • label: Content which appears as the label for the toolbar.
  • start: Content which appears at the start of the toolbar, before the default slotted items.
  • default: Content which appears in the default location of the toolbar, left-aligned.
  • end: Content which appears at the end of the toolbar, right aligned.

CSS Variables

None

Interactions

Interactions are inherited from FAST Toolbar component.

Name Description
clickHandler Sets the active index
focusinHandler Sets focus on element with active index
keydownHandler Handles keydown events on the toolbar

Accessibility

  • Find the matching component through WCAG's patterns: https://www.w3.org/WAI/ARIA/apg/patterns/
  • Are there any accessibility elements unique to this component?
  • List ARIA attributes
    • role="toolbar" in FAST
    • aria-orientation="vertical" in FAST
  • Does the component support 400% zoom?
  • What keyboard behaviors does the component support?
    • Tab : Moves focus to the next focusable element in the toolbar.
    • Shift + Tab : Moves focus to the previous focusable element in the toolbar.
    • Arrow keys : Moves focus to the next/previous focusable element in the toolbar.

Preparation

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 26, 2023

📊 Bundle size report

🤖 This report was generated against cad93648a2ce28e99935d4ab36089d770fa06a53

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 26, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 913efdb:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Apr 26, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: cad93648a2ce28e99935d4ab36089d770fa06a53 (build)

@halerankin halerankin marked this pull request as ready for review April 27, 2023 16:47
@halerankin halerankin requested a review from a team as a code owner April 27, 2023 16:47
@halerankin halerankin requested a review from eljefe223 May 3, 2023 20:33

- [x] Fluent UI React V9 Storybook for implementation differences and document:

- [Fluent React Toolbar](https://master--628d031b55e942004ac95df1.chromatic.com/?path=/docs/components-toolbar--default) has Overflow Items and corresponding More (ellipses) button. This aligns with the Fluent Toolbar spec. The FASTToolbar component however does not implement this. We could either work to include this feature or leave it up to the developer to implement.
Copy link
Member

@ling1726 ling1726 May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is already in the Fluent monorepo and is a vanilla JS package, there is no dependency on React at all, just simple DOM https://github.com/microsoft/fluentui/tree/master/packages/react-components/priority-overflow

That overflow feature already implements all the requirements for all Office and Teams

You can demo the feature set using the react docs, https://react.fluentui.dev/?path=/docs/components-overflow--default

Those examples are powered by the same vanilla js code, with react bindings on top https://github.com/microsoft/fluentui/tree/master/packages/react-components/react-overflow

From the feedback we have gotten from product, they see overflow as an integral feature of the toolbar component (and others) due to the fact that it is actually non-trivial to implement. We should cover this delta in the web component library, or users will see a noticeable difficulty if they ever want to move from React to web components

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ling1726 Thanks for the added context! I agree. I think this should be added as part of the component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After talking about this topic with my team, I think it should be added but in a separate task. This is non-trivial and I want to do it right.

@halerankin
Copy link
Contributor Author

@chrisdholt Is this comprehensive enough to get started on the component?

@halerankin halerankin closed this by deleting the head repository Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants