@@ -444,12 +444,12 @@ export default {
444
444
</script>
445
445
```
446
446
447
- ### Type variants
447
+ ### Design variants
448
448
449
449
```vue
450
450
<template>
451
451
<div>
452
- <NcActions :type ="current">
452
+ <NcActions :variant ="current">
453
453
<template #icon>
454
454
<SelectColor :size="20" />
455
455
</template>
@@ -461,7 +461,7 @@ export default {
461
461
Remove
462
462
</NcActionButton>
463
463
464
- <NcActionButton v-for="row in types " close-after-click @click="define(row)" :key="`type-icon--${row}`">
464
+ <NcActionButton v-for="row in variants " close-after-click @click="define(row)" :key="`type-icon--${row}`">
465
465
<template #icon>
466
466
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
467
467
<SelectColor v-else :size="20" />
@@ -470,15 +470,15 @@ export default {
470
470
</NcActionButton>
471
471
</NcActions>
472
472
473
- <NcActions :type ="current" menu-name="Choose a type ">
473
+ <NcActions :variant ="current" menu-name="Choose a variant ">
474
474
<NcActionButton v-if="current" close-after-click @click="define()">
475
475
<template #icon>
476
476
<Delete :size="20" />
477
477
</template>
478
478
Remove
479
479
</NcActionButton>
480
480
481
- <NcActionButton v-for="row in types " close-after-click @click="define(row)" :key="`type-text--${row}`">
481
+ <NcActionButton v-for="row in variants " close-after-click @click="define(row)" :key="`type-text--${row}`">
482
482
<template #icon>
483
483
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
484
484
<SelectColor v-else :size="20" />
@@ -487,7 +487,7 @@ export default {
487
487
</NcActionButton>
488
488
</NcActions>
489
489
490
- <NcActions :type ="current" menu-name="Choose a type ">
490
+ <NcActions :variant ="current" menu-name="Choose a variant ">
491
491
<template #icon>
492
492
<SelectColor :size="20" />
493
493
</template>
@@ -499,7 +499,7 @@ export default {
499
499
Remove
500
500
</NcActionButton>
501
501
502
- <NcActionButton v-for="row in types " close-after-click @click="define(row)" :key="`type-icon-text--${row}`">
502
+ <NcActionButton v-for="row in variants " close-after-click @click="define(row)" :key="`type-icon-text--${row}`">
503
503
<template #icon>
504
504
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
505
505
<SelectColor v-else :size="20" />
@@ -526,7 +526,7 @@ export default {
526
526
data() {
527
527
return {
528
528
current: 'primary',
529
- types : [
529
+ variants : [
530
530
'primary',
531
531
'secondary',
532
532
'tertiary',
@@ -554,7 +554,7 @@ export default {
554
554
<p>Has buttons, button groups, links and router links, separators, texts. May have checkboxes and radio buttons. Separator can be used to make groups of radio buttons as well.</p>
555
555
<p><kbd>Arrows</kbd> are used to navigate between items, <kbd>Tab</kbd> is used to navigate to the next UI element on the page.</p>
556
556
<p>
557
- <NcActions aria-label="Email menu" type ="tertiary">
557
+ <NcActions aria-label="Email menu" variant ="tertiary">
558
558
<NcActionButtonGroup>
559
559
<NcActionButton>
560
560
<template #icon>
@@ -606,11 +606,11 @@ export default {
606
606
</NcActions>
607
607
</p>
608
608
<p>
609
- <NcActions aria-label="Text settings" type ="tertiary">
609
+ <NcActions aria-label="Text settings" variant ="tertiary">
610
610
<template #icon>
611
611
<FormatTitle :size="20" />
612
612
</template>
613
- <NcActionButtonGroup name="Allignment ">
613
+ <NcActionButtonGroup name="Alignment ">
614
614
<NcActionButton aria-label="Left">
615
615
<template #icon>
616
616
<FormatAlignLeft :size="20" />
@@ -658,7 +658,7 @@ export default {
658
658
<p>Has links or router links. May use text elements, captions and separators.</p>
659
659
<p>Uses classic <kbd>Tab</kbd> navigation.</p>
660
660
<p>
661
- <NcActions aria-label="Applications navigation" :inline="2" type ="tertiary">
661
+ <NcActions aria-label="Applications navigation" :inline="2" variant ="tertiary">
662
662
<NcActionLink href="/apps/dashboard" icon="icon-category-dashboard-white">
663
663
Dashboard
664
664
</NcActionLink>
@@ -697,7 +697,7 @@ export default {
697
697
</p>
698
698
699
699
<h2>Tooltip</h2>
700
- Has only text and not interactive elements
700
+ <p> Has only text and no interactive elements.</p>
701
701
<p>
702
702
<NcActions aria-label="Contact" :inline="1">
703
703
<NcActionLink aria-label="View profile" href="/u/alice" icon="icon-user-white">
@@ -726,7 +726,7 @@ import CheckIcon from 'vue-material-design-icons/Check.vue'
726
726
import OpenInNewIcon from 'vue-material-design-icons/OpenInNew.vue'
727
727
import DownloadIcon from 'vue-material-design-icons/Download.vue'
728
728
729
- // Formating icons
729
+ // Formatting icons
730
730
import FormatTitle from 'vue-material-design-icons/FormatTitle.vue'
731
731
import FormatAlignLeft from 'vue-material-design-icons/FormatAlignLeft.vue'
732
732
import FormatAlignCenter from 'vue-material-design-icons/FormatAlignCenter.vue'
@@ -751,7 +751,7 @@ export default {
751
751
OpenInNewIcon,
752
752
DownloadIcon,
753
753
754
- // Formating icons
754
+ // Formatting icons
755
755
FormatTitle,
756
756
FormatAlignLeft,
757
757
FormatAlignCenter,
@@ -764,7 +764,7 @@ export default {
764
764
data() {
765
765
return {
766
766
selected: false,
767
- // Formating
767
+ // Formatting
768
768
checked: {
769
769
bold: true,
770
770
italic: false,
@@ -934,7 +934,7 @@ const focusableSelector = '.focusable'
934
934
/**
935
935
* The Actions component can be used to display one ore more actions.
936
936
* If only a single action is provided, it will be rendered as an inline icon.
937
- * For more, a menu indicator will be shown and a popovermenu containing the
937
+ * For more, a menu indicator will be shown and a popover menu containing the
938
938
* actions will be opened on click.
939
939
*
940
940
* @since 0.10.0
@@ -1014,19 +1014,6 @@ export default {
1014
1014
default: false,
1015
1015
},
1016
1016
1017
- /**
1018
- * Specifies the button type used for trigger and single actions buttons
1019
- * Accepted values: primary, secondary, tertiary, tertiary-no-background, tertiary-on-primary, error, warning, success. If left empty,
1020
- * the default button style will be applied.
1021
- */
1022
- type: {
1023
- type: String,
1024
- validator(value) {
1025
- return ['primary', 'secondary', 'tertiary', 'tertiary-no-background', 'tertiary-on-primary', 'error', 'warning', 'success'].indexOf(value) !== -1
1026
- },
1027
- default: null,
1028
- },
1029
-
1030
1017
/**
1031
1018
* Icon to show for the toggle menu button
1032
1019
* when more than one action is inside the actions component.
@@ -1099,6 +1086,22 @@ export default {
1099
1086
type: Number,
1100
1087
default: 0,
1101
1088
},
1089
+
1090
+ /**
1091
+ * Specifies the button variant used for trigger and single actions buttons.
1092
+ *
1093
+ * Accepted values: primary, secondary, tertiary, tertiary-no-background, tertiary-on-primary, error, warning, success.
1094
+ * If left empty, the default button style will be applied.
1095
+ *
1096
+ * @since 8.23.0
1097
+ */
1098
+ variant: {
1099
+ type: String,
1100
+ validator(value) {
1101
+ return ['primary', 'secondary', 'tertiary', 'tertiary-no-background', 'tertiary-on-primary', 'error', 'warning', 'success'].includes(value)
1102
+ },
1103
+ default: null,
1104
+ },
1102
1105
},
1103
1106
1104
1107
emits: [
@@ -1157,9 +1160,9 @@ export default {
1157
1160
},
1158
1161
1159
1162
computed: {
1160
- triggerBtnType () {
1163
+ triggerButtonVariant () {
1161
1164
// If requested, we use a primary button
1162
- return this.type || (this.primary
1165
+ return this.variant || (this.primary
1163
1166
? 'primary'
1164
1167
// If it has a name, we use a secondary button
1165
1168
: this.menuName ? 'secondary' : 'tertiary')
@@ -1558,7 +1561,7 @@ export default {
1558
1561
this.$emit('blur', event)
1559
1562
1560
1563
// When there is no focusable elements to handle Tab press from actions menu
1561
- // It requries manual closing
1564
+ // It requires manual closing
1562
1565
if (this.actionsMenuSemanticType === 'tooltip') {
1563
1566
// Tooltip is supposed to have no focusable element.
1564
1567
// However, if there is a custom focusable element, it will be auto-focused and cause the menu to be closed on open.
@@ -1688,7 +1691,7 @@ export default {
1688
1691
}
1689
1692
1690
1693
const propsToForward = { ...(action?.props ?? {}) }
1691
- const nativeType = ['submit', 'reset'].includes(propsToForward.type) ? propsToForward.modelValue : 'button'
1694
+ const type = ['submit', 'reset'].includes(propsToForward.type) ? propsToForward.modelValue : 'button'
1692
1695
// not available on NcButton or with different meaning
1693
1696
delete propsToForward.modelValue
1694
1697
delete propsToForward.type
@@ -1700,11 +1703,11 @@ export default {
1700
1703
class: 'action-item action-item--single',
1701
1704
'aria-label': action?.props?.['aria-label'] || text,
1702
1705
title,
1703
- // If it has a menuName, we use a secondary button
1704
- type: this.type || (buttonText ? 'secondary' : 'tertiary'),
1705
1706
disabled: this.disabled || action?.props?.disabled,
1706
1707
pressed: action?.props?.modelValue,
1707
- nativeType,
1708
+ type,
1709
+ // If it has a menuName, we use a secondary button
1710
+ variant: this.variant || (buttonText ? 'secondary' : 'tertiary'),
1708
1711
onFocus: this.onFocus,
1709
1712
onBlur: this.onBlur,
1710
1713
// forward any pressed state from NcButton just like NcActionButton does
@@ -1754,9 +1757,8 @@ export default {
1754
1757
trigger: () => h(NcButton, {
1755
1758
id: triggerRandomId,
1756
1759
class: 'action-item__menutoggle',
1757
- type: this.triggerBtnType,
1758
1760
disabled: this.disabled,
1759
- ariaHidden : this.ariaHidden ,
1761
+ variant : this.triggerButtonVariant ,
1760
1762
ref: 'triggerButton',
1761
1763
'aria-label': this.menuName ? null : this.ariaLabel,
1762
1764
// 'aria-controls' should only present together with a valid aria-haspopup
@@ -1823,7 +1825,7 @@ export default {
1823
1825
{
1824
1826
class: [
1825
1827
'action-items',
1826
- `action-item--${this.triggerBtnType }`,
1828
+ `action-item--${this.triggerButtonVariant }`,
1827
1829
],
1828
1830
},
1829
1831
[
@@ -1854,7 +1856,7 @@ export default {
1854
1856
{
1855
1857
class: [
1856
1858
'action-item action-item--default-popover',
1857
- `action-item--${this.triggerBtnType }`,
1859
+ `action-item--${this.triggerButtonVariant }`,
1858
1860
{
1859
1861
'action-item--open': this.opened,
1860
1862
},
0 commit comments