Skip to content

Commit 90d9da8

Browse files
committed
refactor: Use variant instead of type when using NcButton
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 111f895 commit 90d9da8

File tree

21 files changed

+70
-73
lines changed

21 files changed

+70
-73
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: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,40 @@
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>
29-
<ArrowRight :size="20" />
29+
<IconArrowRight :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>
38-
<Close :size="20" />
38+
<IconClose :size="20" />
3939
</template>
4040
</NcButton>
4141
</form>
4242
</div>
4343
</template>
4444
<script>
45-
import NcButton from '../NcButton/index.ts'
4645
import { t } from '../../l10n.js'
4746
48-
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
49-
import Close from 'vue-material-design-icons/Close.vue'
47+
import IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'
48+
import IconClose from 'vue-material-design-icons/Close.vue'
49+
import NcButton from '../NcButton/index.js'
5050
5151
export default {
5252
name: 'NcInputConfirmCancel',
5353
5454
components: {
55+
IconArrowRight,
56+
IconClose,
5557
NcButton,
56-
ArrowRight,
57-
Close,
5858
},
5959
6060
props: {

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
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"
13-
aria-controls="app-navigation-vue"
1414
@click="toggleNavigation">
1515
<template #icon>
1616
<MenuOpenIcon v-if="open" :size="20" />

src/components/NcAppSidebar/NcAppSidebar.vue

Lines changed: 9 additions & 9 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" />
@@ -706,9 +706,9 @@ export default {
706706
<script>
707707
import NcAppSidebarTabs from './NcAppSidebarTabs.vue'
708708
import NcActions from '../NcActions/index.js'
709-
import NcLoadingIcon from '../NcLoadingIcon/index.js'
710709
import NcButton from '../NcButton/index.ts'
711710
import NcEmptyContent from '../NcEmptyContent/index.js'
711+
import NcLoadingIcon from '../NcLoadingIcon/index.js'
712712
import Focus from '../../directives/Focus/index.js'
713713
import Linkify from '../../directives/Linkify/index.js'
714714
import { vOnClickOutside as ClickOutside } from '@vueuse/components'

src/components/NcAvatar/NcAvatar.vue

Lines changed: 5 additions & 5 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" />
@@ -193,11 +193,11 @@ export default {
193193
</NcButton>
194194
<NcActions v-else-if="hasMenu"
195195
v-model:open="contactsMenuOpenState"
196+
:aria-label="avatarAriaLabel"
197+
:container="menuContainer"
196198
force-menu
197199
manual-open
198-
type="tertiary-no-background"
199-
:container="menuContainer"
200-
:aria-label="avatarAriaLabel"
200+
variant="tertiary-no-background"
201201
@click="toggleMenu">
202202
<component :is="item.ncActionComponent"
203203
v-for="(item, key) in menu"

src/components/NcBreadcrumb/NcBreadcrumb.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ 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"
29-
type="tertiary"
28+
variant="tertiary"
3029
v-bind="linkAttributes">
3130
<template v-if="$slots.icon || icon" #icon>
3231
<!-- @slot Slot for passing a material design icon. Precedes the icon and name prop. -->
@@ -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)