-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Form elements - error message documentation (#582)
* Move error message component to own page. Add properties and example.njks. Update error message use case (input). * Delete error message page. * Remove Error message example and properties. * Maintain error message inside form-elements folder. * Update default error message for text input. Co-authored-by: Houston Blyden <[email protected]> Co-authored-by: Houston Blyden <[email protected]>
- Loading branch information
1 parent
c01f434
commit 1ee82f0
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
src/wmnds/components/form-elements/error-message/_error-message.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{% macro wmndsFeErrorMessage(params) %} | ||
|
||
{# Params #} | ||
<span class="wmnds-fe-error-message">This is an example error message</span> | ||
{% set contentText = params.contentText if params.contentText else "This is an example error message" %} | ||
{% set contentHTML = params.contentHTML if params.contentHTML else null %} | ||
{% set _content = contentHTML | safe if contentHTML else contentText %} {# change content based on what user has input #} | ||
{% set id = params.id if params.id else null %} | ||
{% set classes = " " + params.classes if params.classes else null %} | ||
|
||
<span class="wmnds-fe-error-message{{classes}}" {% if id %} id="{{id}}" {% endif %}>{{_content}}</span> | ||
|
||
{% endmacro %}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters