Skip to content

Commit

Permalink
Merge pull request #4063 from moan0s/info-card
Browse files Browse the repository at this point in the history
Add info NoteCard
  • Loading branch information
szaimen committed May 19, 2023
2 parents 82385ce + ec87423 commit 4142020
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/components/NcNoteCard/NcNoteCard.vue
Expand Up @@ -20,9 +20,10 @@

<docs>
This component is made to display additional information to the user. It is
available in three versions:
available in four versions:

- success: Display a successful message
- info: Display an informational message
- warning: Display a warning to the user. This indicate that the action they want
- error: Display an error message. For example

Expand All @@ -41,6 +42,10 @@ When using an error type,
<NcNoteCard type="success">
<p>You won</p>
</NcNoteCard>

<NcNoteCard type="info">
<p>For your information</p>
</NcNoteCard>
</div>
```
</docs>
Expand All @@ -66,6 +71,7 @@ When using an error type,
import CheckboxMarkedCircle from 'vue-material-design-icons/CheckboxMarkedCircle.vue'
import AlertDecagram from 'vue-material-design-icons/AlertDecagram.vue'
import Alert from 'vue-material-design-icons/Alert.vue'
import Information from 'vue-material-design-icons/Information.vue'
export default {
name: 'NcNoteCard',
Expand All @@ -77,7 +83,7 @@ export default {
type: {
type: String,
default: 'warning',
validator: type => ['success', 'warning', 'error'].includes(type),
validator: type => ['success', 'info', 'warning', 'error'].includes(type),
},
showAlert: {
type: Boolean,
Expand All @@ -98,6 +104,8 @@ export default {
return AlertDecagram
case 'success':
return CheckboxMarkedCircle
case 'info':
return Information
case 'warning':
return Alert
default:
Expand All @@ -110,6 +118,8 @@ export default {
return 'var(--color-error)'
case 'success':
return 'var(--color-success)'
case 'info':
return 'var(--color-info)'
case 'warning':
return 'var(--color-warning)'
default:
Expand Down Expand Up @@ -143,6 +153,11 @@ export default {
--note-theme: var(--color-success);
}
&--info {
--note-background: rgba(var(--color-info-rgb), 0.1);
--note-theme: var(--color-info);
}
&--error {
--note-background: rgba(var(--color-error-rgb), 0.1);
--note-theme: var(--color-error);
Expand Down

0 comments on commit 4142020

Please sign in to comment.