Skip to content

Commit 781ac2f

Browse files
susnuxbackportbot[bot]
authored andcommitted
feat(NcDialogButton): Provide variant as a alternative for the type prop
To align with `NcButton`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 73335bf commit 781ac2f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/components/NcDialogButton/NcDialogButton.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ Dialog button component used by NcDialog in the actions slot to display the butt
1010
<template>
1111
<NcButton :aria-label="label"
1212
:disabled="disabled"
13-
:native-type="nativeType"
1413
:type="type"
14+
:native-type="nativeType"
15+
:variant="variant"
1516
@click="handleClick">
1617
{{ label }}
1718
<template #icon>
@@ -66,8 +67,10 @@ const props = defineProps({
6667
},
6768
6869
/**
69-
* The button type, see NcButton
70-
* @type {'primary'|'secondary'|'error'|'warning'|'success'}
70+
* The button type, see NcButton.
71+
*
72+
* @deprecated The usage for setting the color variant is deprecated and will be removed with v9.
73+
* @type {'button'|'submit'|'reset'|'primary'|'secondary'|'error'|'warning'|'success'}
7174
*/
7275
type: {
7376
type: String as PropType<ButtonType>,
@@ -100,6 +103,19 @@ const props = defineProps({
100103
type: Boolean,
101104
default: false,
102105
},
106+
107+
/**
108+
* The button variant, see NcButton.
109+
*
110+
* @type {'primary'|'secondary'|'tertiary'|'error'|'warning'|'success'}
111+
* @since 8.23.0
112+
*/
113+
variant: {
114+
type: String,
115+
required: false,
116+
default: 'secondary',
117+
validator: (type) => typeof type === 'string' && ['primary', 'secondary', 'tertiary', 'error', 'warning', 'success'].includes(type),
118+
},
103119
})
104120
105121
const emit = defineEmits<{

0 commit comments

Comments
 (0)