Skip to content

Commit 8eea70a

Browse files
committed
refactor: rename variant props
- rename variant props to color, - rename borderColor props to borderColor, - rename textVariant props to textColor
1 parent e68a722 commit 8eea70a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+216
-217
lines changed

src/components/Alert/CAlert.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
name: 'CAlert',
2323
components: { CButtonClose },
2424
props: {
25-
variant: String,
25+
color: String,
2626
closeButton: Boolean,
2727
show: {
2828
type: [Boolean, Number],
@@ -42,7 +42,7 @@ export default {
4242
'alert',
4343
{
4444
'alert-dismissible': this.closeButton,
45-
[`alert-${this.variant}`]: this.variant
45+
[`alert-${this.color}`]: this.color
4646
}
4747
]
4848
}

src/components/Alert/tests/CAlert.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const customWrapper = mount(Component, {
2121
show: true,
2222
fade: true,
2323
closeButton: true,
24-
variant: 'success'
24+
color: 'success'
2525
},
2626
slots: {
2727
default: 'Dismissible Alert!'

src/components/Badge/CBadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const props = Object.assign(linkProps, {
77
type: String,
88
default: 'span'
99
},
10-
variant: String,
10+
color: String,
1111
pill: Boolean,
1212
textHtml: String
1313
})
@@ -22,7 +22,7 @@ export default {
2222
const componentData = {
2323
staticClass: 'badge',
2424
class: {
25-
[`badge-${props.variant}`]: props.variant,
25+
[`badge-${props.color}`]: props.color,
2626
'badge-pill': props.pill,
2727
'active': props.active,
2828
'disabled': props.disabled

src/components/Badge/tests/CBadge.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const wrapper = mount(Component)
66
const customWrapper = mount(Component, {
77
propsData: {
88
textHtml: 'Badge text',
9-
variant: 'success',
9+
color: 'success',
1010
active: true,
1111
pill: true,
1212
disabled: true,

src/components/Button/CButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const btnProps = {
1313
type: String,
1414
validator: value => ['', 'sm', 'lg'].includes(value)
1515
},
16-
variant: String,
16+
color: String,
1717
type: {
1818
type: String,
1919
default: 'button'
@@ -36,9 +36,9 @@ function isToggle (props) {
3636
3737
function computeClasses (props) {
3838
return {
39-
[`btn-${props.outline ? 'outline-' : ''}${props.variant}`]: props.variant,
39+
[`btn-${props.outline ? 'outline-' : ''}${props.color}`]: props.color,
4040
[`btn-${props.size}`]: Boolean(props.size),
41-
[`btn-ghost-${props.variant}`]: props.ghost,
41+
[`btn-ghost-${props.color}`]: props.ghost,
4242
'btn-block': props.block,
4343
'btn-pill': props.pill,
4444
'btn-square': props.square && !props.pill,

src/components/Button/tests/CButton.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const toggleWrapper = mount(Component, {
1111
pressed: true,
1212
type: 'input',
1313
size: 'lg',
14-
variant: 'info',
14+
color: 'info',
1515
outline: true,
1616
ghost: true,
1717
block: true,
@@ -31,7 +31,7 @@ const routerLinkWrapper = mount(Component, {
3131
props: {
3232
to: '/dashboard',
3333
size: 'sm',
34-
variant: 'success',
34+
color: 'success',
3535
ghost: true,
3636
pill: true
3737
}

src/components/Callout/CCallout.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template functional>
2-
<div :class="`callout ${props.variant ? 'callout-' + props.variant : ''}`">
2+
<div :class="`callout ${props.color ? 'callout-' + props.color : ''}`">
33
<slot></slot>
44
</div>
55
</template>
@@ -8,7 +8,7 @@
88
export default {
99
name: 'CCallout',
1010
props: {
11-
variant: String
11+
color: String
1212
}
1313
}
1414
</script>

src/components/Callout/tests/CCallout.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const ComponentName = 'CCallout'
55
const defaultWrapper = mount(Component)
66
const customWrapper = mount(Component, {
77
propsData: {
8-
variant: 'success',
8+
color: 'success',
99
},
1010
slots: {
1111
default: 'Callout'

src/components/Card/CCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default {
4343
staticClass: 'card',
4444
class: {
4545
[`text-${props.align}`]: Boolean(props.align),
46-
[`bg-${props.variant}`]: Boolean(props.variant),
47-
[`border-${props.borderVariant}`]: Boolean(props.borderVariant),
48-
[`text-${props.textVariant}`]: Boolean(props.textVariant)
46+
[`bg-${props.color}`]: Boolean(props.color),
47+
[`border-${props.borderColor}`]: Boolean(props.borderColor),
48+
[`text-${props.textColor}`]: Boolean(props.textColor)
4949
}
5050
}),
5151
[ header, main, footer ]

src/components/Card/CCardBody.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export default {
1313
staticClass: 'card-body',
1414
class: [
1515
{
16-
[`bg-${props.variant}`]: Boolean(props.variant),
17-
[`border-${props.borderVariant}`]: Boolean(props.borderVariant),
18-
[`text-${props.textVariant}`]: Boolean(props.textVariant),
16+
[`bg-${props.color}`]: Boolean(props.color),
17+
[`border-${props.borderColor}`]: Boolean(props.borderColor),
18+
[`text-${props.textColor}`]: Boolean(props.textColor),
1919
[`text-${props.align}`]: Boolean(props.align)
2020
}
2121
]

0 commit comments

Comments
 (0)