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

Partial rewrite of the slide tabs component #49103

Merged
merged 5 commits into from
Nov 26, 2024
Merged

Conversation

bl-nero
Copy link
Contributor

@bl-nero bl-nero commented Nov 15, 2024

This enables us to put icons there, make the layout tighter and fit to tab list contents. It also improves accessibility by adding keyboard handling, focus state, and changing the structure according to ARIA Authoring Practices Guide.

Screenshot 2024-11-16 at 00 17 50

The small size and icons will be required for implementing the new role editor.

This enables us to put icons there, make the layout tighter and fit to tab list
contents. It also improves accessibility by adding keyboard handling and
changing the structure according to ARIA Authoring Practices Guide.
@bl-nero bl-nero added the no-changelog Indicates that a PR does not require a changelog entry label Nov 15, 2024
@bl-nero bl-nero requested a review from gzdunek November 21, 2024 15:35
@bl-nero
Copy link
Contributor Author

bl-nero commented Nov 21, 2024

@gzdunek I applied your feedback. Also notice that I'm planning on removing the simplified string version of tab spec to keep the code simpler, but I need to remove these from the Enterprise code first.

Copy link
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

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

It's great that we now have keyboard navigation and better accessibility 👏

onChange={setActiveIndex}
activeIndex={activeIndex}
/>
</Flex>
);
};

export const Medium = () => {
const [activeIndex, setActiveIndex] = useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a separate state for each slider? They have a different number of steps, so you can visually simulate an 'index out of range' error :)

story.mov

| {
/** Title displayed on the tab. */
title: string;
ariaLabel?: never;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should allow ariaLabel when providing the title. However, I'm not sure how practical or useful this would be in real-world scenarios (probably no one would use it anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gzdunek IMO, ariaLabel doesn't make any sense when the title is here.

@bl-nero bl-nero added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit caf2694 Nov 26, 2024
40 checks passed
@bl-nero bl-nero deleted the bl-nero/slide-tabs branch November 26, 2024 13:21
@public-teleport-github-review-bot

@bl-nero See the table below for backport results.

Branch Result
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v17 no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants