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

Rework tabs #426

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
25e5ea1
add toggle to popover
Haberkamp Nov 15, 2024
3e129eb
wip
Haberkamp Nov 15, 2024
8037aa2
trap focus in popover
Haberkamp Nov 15, 2024
e8e893a
make sure focus trap is turned of when closing the popover
Haberkamp Nov 15, 2024
6947190
wip
Haberkamp Nov 16, 2024
8ebb088
allow changing role of mt-bare-popover-item
Haberkamp Nov 16, 2024
196f959
fix: add correct type to trigger slot for mt-bare-popover
Haberkamp Nov 16, 2024
9b3c25c
rewrite tabs component
Haberkamp Nov 16, 2024
6c75819
allow changing the tab
Haberkamp Nov 16, 2024
7ccba7b
add slider
Haberkamp Nov 16, 2024
6fa27fd
add tablist role
Haberkamp Nov 16, 2024
264027b
refactor: rename nameOfActiveItem to nameOfActiveTab
Haberkamp Nov 16, 2024
45037bc
allow disabling individual tab items
Haberkamp Nov 16, 2024
ed1173c
remove default margin
Haberkamp Nov 16, 2024
ddce2e7
add small variant
Haberkamp Nov 16, 2024
bd5f5c2
do not animate slider on first render
Haberkamp Nov 16, 2024
7659b79
wip
Haberkamp Nov 16, 2024
a913061
only animate slider after first render
Haberkamp Nov 17, 2024
154b571
only calcualte slider values after font has loaded
Haberkamp Nov 17, 2024
372cb87
add error badge
Haberkamp Nov 17, 2024
809f915
mock document.fonts.ready
Haberkamp Nov 17, 2024
0fa8293
add aria-invalid to errored tab
Haberkamp Nov 17, 2024
b3033f8
add error style to tab text
Haberkamp Nov 17, 2024
5d6073c
make sure resolving errors does remove error styles
Haberkamp Nov 17, 2024
7582ef0
add vertical tabs
Haberkamp Nov 17, 2024
63969b7
add badge
Haberkamp Nov 17, 2024
6ecade2
increase space between error badge and text
Haberkamp Nov 17, 2024
d879703
wip
Haberkamp Nov 18, 2024
e3ab57c
style active item in more popover
Haberkamp Nov 20, 2024
09a15bd
increase font weight of more button when one of its children is active
Haberkamp Nov 20, 2024
dcd0e22
add error styles to more items
Haberkamp Nov 20, 2024
5deeae5
wip
Haberkamp Nov 20, 2024
07e88df
add badge to more items
Haberkamp Nov 20, 2024
1932165
only allow users to tab to active element
Haberkamp Nov 20, 2024
3cc1f6d
allow user to navigate the tab with the right arrow key
Haberkamp Nov 20, 2024
c034d5b
it is possible to navigate multiple tabs via the arrow key by pressin…
Haberkamp Nov 20, 2024
038c76c
move focus to previous item when pressing the left arrow key
Haberkamp Nov 20, 2024
de9b264
focuses the last item when pressing the left arrow key on the first item
Haberkamp Nov 20, 2024
37e3f0a
focus first tab when trying to navigate to the next tab when on the l…
Haberkamp Nov 21, 2024
7d55804
fix: do not focus previous element when pressing shift and tab
Haberkamp Nov 21, 2024
240ed33
fix: move focus out of tabs when tabbing and pressed the left arrow k…
Haberkamp Nov 21, 2024
82adbec
supress typescript error caused by priority plus navigation
Haberkamp Nov 21, 2024
db171ec
focuses the more tabs button when pressing the left arrow key on the …
Haberkamp Nov 21, 2024
f128dd0
allow users to move out of the more tabs button via the arrow keys
Haberkamp Nov 21, 2024
b3c2222
allow users to fully navigate the tabs component through the arrow keys
Haberkamp Nov 21, 2024
dec0b75
refactor(component-library): replace mt-proprity-plus with usePriorit…
Haberkamp Dec 10, 2024
714f740
chore(component-library): only show slider after calculation
Haberkamp Dec 10, 2024
08fa5cc
fix(component-library): re-calculate the slider when resizing and ite…
Haberkamp Dec 10, 2024
0b9b123
fix
Haberkamp Dec 10, 2024
c366da1
refactor(component-library): remove unused code
Haberkamp Dec 10, 2024
59b0886
refactor(component-library): delete mt-priority-plus-navigation
Haberkamp Dec 10, 2024
d514546
fix(component-library): fix type error for popover placement
Haberkamp Dec 10, 2024
a706bdc
fix(component-library): fix a11y issues of mt-tabs component
Haberkamp Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,12 @@ export const MinimalStory: StoryObj<MtCardMeta> = {
},
template: `
<mt-card v-bind="args" @update:inheritance="args.updateInheritance">
<div v-html="args.default"></div>
<mt-text>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</mt-text>
<br>
<mt-text>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</mt-text>
</mt-card>`,
}),
args: {
default: `
<mt-text>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</mt-text>
<br>
<mt-text>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</mt-text>
<br>
`,
title: "Title",
subtitle: "Subtitle",
toolbar: null,
Expand All @@ -123,7 +119,10 @@ export const ExtendedStory: StoryObj<MtCardMeta> = {
Active Tab: {{ activeTab }}
</mt-text>

<div v-html="args.default"></div>

<mt-text>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</mt-text>
<br>
<mt-text>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</mt-text>

<template #toolbar>
<template v-if="args.toolbar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,19 @@
</div>

<div v-if="!!$slots['context-actions']" class="mt-card__context-menu">
<mt-context-button>
<!-- @slot Slot for adding mt-context-menu-item components for rendering a context menu -->
<slot name="context-actions" />
</mt-context-button>
<mt-bare-popover placement="bottom-end" width="small">
<template #trigger="params">
<button v-bind="params" class="mt-card__context-button">
<mt-icon name="solid-ellipsis-h-s" />
</button>
</template>

<template #default>
<mt-bare-popover-item>Item A</mt-bare-popover-item>
<mt-bare-popover-item>Item B</mt-bare-popover-item>
<mt-bare-popover-item>Item C</mt-bare-popover-item>
</template>
</mt-bare-popover>
</div>
</header>

Expand Down Expand Up @@ -95,10 +104,11 @@

<script setup lang="ts">
import { computed } from "vue";
import MtContextButton from "../../context-menu/mt-context-button/mt-context-button.vue";
import MtLoader from "../../feedback-indicator/mt-loader/mt-loader.vue";
import MtIcon from "../../icons-media/mt-icon/mt-icon.vue";
import MtText from "../../content/mt-text/mt-text.vue";
import MtBarePopover from "@/components/overlay/mt-bare-popover/mt-bare-popover.vue";
import MtBarePopoverItem from "@/components/overlay/mt-bare-popover/sub-components/mt-bare-popover-item.vue";
import { useFutureFlags } from "@/composables/useFutureFlags";
import { useI18n } from "@/composables/useI18n";

Expand Down Expand Up @@ -380,4 +390,27 @@ const cardClasses = computed(() => ({
display: none;
}
}

.mt-card__context-button {
width: 2rem;
height: 2rem;
border: 1px solid var(--color-border-primary-default);
border-radius: var(--border-radius-button);
color: var(--color-text-primary-default);
background: var(--color-interaction-secondary-default);
display: grid;
place-items: center;
transition: all 0.15s ease-out;

&:hover,
&:focus-visible {
background-color: var(--color-interaction-secondary-hover);
}

&:focus-visible {
box-shadow: 0 0 4px 0 rgba(24, 158, 255, 0.3);
border-color: var(--color-border-brand-selected);
outline: 0;
}
}
</style>
Loading
Loading