Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable7] Add info NoteCard #4228

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/components/NcNoteCard/NcNoteCard.vue
Original file line number Diff line number Diff line change
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