Skip to content

Commit e48528b

Browse files
susnuxbackportbot[bot]
authored andcommitted
refactor: Use variant instead of type when using NcButton
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> [skip ci]
1 parent 781ac2f commit e48528b

File tree

20 files changed

+57
-55
lines changed

20 files changed

+57
-55
lines changed

src/components/NcAppContent/NcAppDetailsToggle.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
<template>
77
<NcButton v-tooltip="title"
8-
type="tertiary"
9-
:aria-label="title"
108
class="app-details-toggle"
11-
:class="{ 'app-details-toggle--mobile': isMobile }">
9+
:class="{ 'app-details-toggle--mobile': isMobile }"
10+
:aria-label="title"
11+
variant="tertiary">
1212
<template #icon>
1313
<ArrowLeft v-if="isRtl" :size="20" />
1414
<ArrowRight v-else :size="20" />

src/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<!-- Button to expand or collapse children -->
88
<NcButton class="icon-collapse"
99
:class="{'icon-collapse--open':open}"
10-
type="tertiary"
1110
:aria-label="labelButton"
11+
variant="tertiary"
1212
@click="onClick">
1313
<template #icon>
1414
<ChevronUp v-if="open"

src/components/NcAppNavigationItem/NcInputConfirmCancel.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
class="app-navigation-input-confirm__input"
2222
:placeholder="placeholder">
2323

24-
<NcButton native-type="submit"
25-
type="primary"
26-
:aria-label="labelConfirm"
24+
<NcButton :aria-label="labelConfirm"
25+
type="submit"
26+
variant="primary"
2727
@click.stop.prevent="confirm">
2828
<template #icon>
2929
<ArrowRight :size="20" />
3030
</template>
3131
</NcButton>
3232

33-
<NcButton native-type="reset"
34-
:type="primary ? 'primary' : 'tertiary'"
35-
:aria-label="labelCancel"
33+
<NcButton :aria-label="labelCancel"
34+
type="reset"
35+
:variant="primary ? 'primary' : 'tertiary'"
3636
@click.stop.prevent="cancel">
3737
<template #icon>
3838
<Close :size="20" />
@@ -47,6 +47,7 @@ import { t } from '../../l10n.js'
4747
4848
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
4949
import Close from 'vue-material-design-icons/Close.vue'
50+
import NcButton from '../NcButton/index.js'
5051
5152
export default {
5253
name: 'NcInputConfirmCancel',

src/components/NcAppNavigationSearch/NcAppNavigationSearch.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Filter by year
3232
</NcActionButton>
3333
</NcActions>
34-
<NcButton aria-label="Search globally" type="tertiary">
34+
<NcButton aria-label="Search globally" variant="tertiary">
3535
<template #icon>
3636
<IconSearchGlobal :size="20" />
3737
</template>

src/components/NcAppNavigationToggle/NcAppNavigationToggle.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
<template>
77
<div class="app-navigation-toggle-wrapper">
88
<NcButton class="app-navigation-toggle"
9-
type="tertiary"
9+
aria-controls="app-navigation-vue"
1010
:aria-expanded="open ? 'true' : 'false'"
11+
:aria-keyshortcuts="disableKeyboardShortcuts ? '' : 'n'"
1112
:aria-label="label"
1213
:title="label"
1314
aria-controls="app-navigation-vue"

src/components/NcAppSidebar/NcAppSidebar.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ Note: the built-in toggle button is only available then NcAppSidebar is used in
386386
<NcContent app-name="styleguidist" class="content-styleguidist">
387387
<NcAppContent>
388388
<div class="top-bar">
389-
<NcButton type="primary">Start a call</NcButton>
389+
<NcButton variant="primary">Start a call</NcButton>
390390
</div>
391391
</NcAppContent>
392392
<!-- The sidebar -->
@@ -553,7 +553,7 @@ export default {
553553
<NcButton :aria-label="t('Open sidebar')"
554554
class="app-sidebar__toggle"
555555
:class="toggleClasses"
556-
type="tertiary"
556+
variant="tertiary"
557557
v-bind="toggleAttrs"
558558
@click="$emit('update:open', true)">
559559
<template #icon>
@@ -603,7 +603,7 @@ export default {
603603
:aria-label="favoriteTranslated"
604604
:pressed="isStarred"
605605
class="app-sidebar-header__star"
606-
type="secondary"
606+
variant="secondary"
607607
@click.prevent="toggleStarred">
608608
<template #icon>
609609
<NcLoadingIcon v-if="starLoading" />
@@ -641,9 +641,9 @@ export default {
641641
:value="name"
642642
@keydown.esc.stop="onDismissEditing"
643643
@input="onNameInput">
644-
<NcButton type="tertiary-no-background"
645-
:aria-label="changeNameTranslated"
646-
native-type="submit">
644+
<NcButton :aria-label="changeNameTranslated"
645+
type="submit"
646+
variant="tertiary-no-background">
647647
<template #icon>
648648
<IconArrowRight :size="20" />
649649
</template>
@@ -671,10 +671,10 @@ export default {
671671
</div>
672672

673673
<NcButton ref="closeButton"
674-
:title="closeTranslated"
675674
:aria-label="closeTranslated"
676-
type="tertiary"
675+
:title="closeTranslated"
677676
class="app-sidebar__close"
677+
variant="tertiary"
678678
@click.prevent="closeSidebar">
679679
<template #icon>
680680
<IconClose :size="20" />
@@ -709,6 +709,7 @@ import NcActions from '../NcActions/index.js'
709709
import NcLoadingIcon from '../NcLoadingIcon/index.js'
710710
import NcButton from '../NcButton/index.ts'
711711
import NcEmptyContent from '../NcEmptyContent/index.js'
712+
import NcLoadingIcon from '../NcLoadingIcon/index.js'
712713
import Focus from '../../directives/Focus/index.js'
713714
import Linkify from '../../directives/Linkify/index.js'
714715
import { vOnClickOutside as ClickOutside } from '@vueuse/components'

src/components/NcAvatar/NcAvatar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ export default {
182182
<!-- Contact menu -->
183183
<!-- We show a button if the menu is not loaded yet. -->
184184
<NcButton v-if="hasMenu && menu.length === 0"
185-
type="tertiary-no-background"
186-
class="action-item action-item__menutoggle"
187185
:aria-label="avatarAriaLabel"
186+
class="action-item action-item__menutoggle"
187+
variant="tertiary-no-background"
188188
@click="toggleMenu">
189189
<template #icon>
190190
<NcLoadingIcon v-if="contactsMenuLoading" />

src/components/NcBreadcrumb/NcBreadcrumb.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Renders a button element when given no redirection props, otherwise, renders <a/
2424
@dragenter="dragEnter"
2525
@dragleave="dragLeave">
2626
<NcButton v-if="(name || icon || $slots.icon) && !$slots.default"
27-
:title="title"
2827
:aria-label="icon ? name : undefined"
2928
type="tertiary"
3029
v-bind="linkAttributes">
@@ -40,13 +39,13 @@ Renders a button element when given no redirection props, otherwise, renders <a/
4039
</NcButton>
4140
<NcActions v-if="$slots.default"
4241
ref="actions"
43-
type="tertiary"
4442
:force-menu="forceMenu"
4543
:open="open"
4644
:menu-name="name"
4745
:title="title"
4846
:force-name="true"
4947
:container="`.vue-crumb[${crumbId}]`"
48+
variant="tertiary"
5049
@update:open="onOpenChange">
5150
<template #icon>
5251
<!-- @slot Slot for the custom menu icon -->

src/components/NcColorPicker/NcColorPicker.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,22 @@ export default {
174174
</Transition>
175175
<div v-if="!paletteOnly" class="color-picker__navigation">
176176
<NcButton v-if="advanced"
177-
type="tertiary"
178177
:aria-label="ariaBack"
178+
variant="tertiary"
179179
@click="handleBack">
180180
<template #icon>
181181
<ArrowLeft :size="20" />
182182
</template>
183183
</NcButton>
184184
<NcButton v-else
185-
type="tertiary"
186185
:aria-label="ariaMore"
186+
variant="tertiary"
187187
@click="handleMoreSettings">
188188
<template #icon>
189189
<DotsHorizontal :size="20" />
190190
</template>
191191
</NcButton>
192-
<NcButton type="primary"
192+
<NcButton variant="primary"
193193
@click="handleConfirm(slotProps.hide)">
194194
{{ t('Choose') }}
195195
</NcButton>

src/components/NcContent/NcContent.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ It also will set the skip content buttons needed for accessibility.
7272
</div>
7373
<div class="vue-skip-actions__buttons">
7474
<NcButton v-show="hasAppNavigation"
75-
type="tertiary"
7675
href="#app-navigation-vue"
76+
variant="tertiary"
7777
@click.prevent="openAppNavigation"
7878
@focusin="currentFocus = 'navigation'"
7979
@mouseover="currentFocus = 'navigation'">
8080
{{ t('Skip to app navigation') }}
8181
</NcButton>
82-
<NcButton type="tertiary"
83-
href="#app-content-vue"
82+
<NcButton href="#app-content-vue"
83+
variant="tertiary"
8484
@focusin="currentFocus = 'content'"
8585
@mouseover="currentFocus = 'content'">
8686
{{ t('Skip to main content') }}

0 commit comments

Comments
 (0)