Skip to content

Commit

Permalink
refactor: update error message design (#592)
Browse files Browse the repository at this point in the history
* refactor: update error message design

* feat: update token package
  • Loading branch information
melaniebmn authored Jul 29, 2024
1 parent 4b8cadd commit 5f1b94e
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 15 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@cdssnc/gcds-tokens": "^1.13.2",
"@cdssnc/gcds-tokens": "^1.14.2",
"@fortawesome/fontawesome-free": "^6.3.0",
"@stencil/angular-output-target": "file:../../utils/angular-output-target",
"@stencil/postcss": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-checkbox/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ graph TD;
gcds-checkbox --> gcds-error-message
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-checkbox fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

@layer default {
:host .error-message {
margin: var(--gcds-error-message-margin);
padding: var(--gcds-error-message-padding);
background: var(--gcds-error-message-background);
border-inline-start: var(--gcds-error-message-border-width) solid
var(--gcds-error-message-border-color);
&::part(text),
gcds-icon {
color: var(--gcds-error-message-text-color);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ export class GcdsErrorMessage {
id={`error-message-${messageId}`}
class="gcds-error-message-wrapper"
>
<gcds-text class="error-message" role="alert" margin-bottom="0">
<slot></slot>
<gcds-text class="error-message" role="alert" margin-bottom="300">
<gcds-icon name="triangle-exclamation" margin-right="100"></gcds-icon>
<strong>
<slot></slot>
</strong>
</gcds-text>
</Host>
);
Expand Down
2 changes: 2 additions & 0 deletions packages/web/src/components/gcds-error-message/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
### Depends on

- [gcds-text](../gcds-text)
- [gcds-icon](../gcds-icon)

### Graph
```mermaid
graph TD;
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
gcds-checkbox --> gcds-error-message
gcds-fieldset --> gcds-error-message
gcds-file-uploader --> gcds-error-message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ describe('gcds-error-message', () => {
expect(root).toEqualHtml(`
<gcds-error-message message-id="input-renders" id="error-message-input-renders" class="gcds-error-message-wrapper">
<mock:shadow-root>
<gcds-text class="error-message" role="alert" margin-bottom="0">
<slot></slot>
<gcds-text class="error-message" role="alert" margin-bottom="300">
<gcds-icon name="triangle-exclamation" margin-right="100"></gcds-icon>
<strong>
<slot></slot>
</strong>
</gcds-text>
</mock:shadow-root>
This field is required
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-fieldset/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ graph TD;
gcds-fieldset --> gcds-error-message
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-fieldset fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-file-uploader/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ graph TD;
gcds-file-uploader --> gcds-icon
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-file-uploader fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
2 changes: 2 additions & 0 deletions packages/web/src/components/gcds-icon/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

- [gcds-alert](../gcds-alert)
- [gcds-button](../gcds-button)
- [gcds-error-message](../gcds-error-message)
- [gcds-file-uploader](../gcds-file-uploader)
- [gcds-link](../gcds-link)
- [gcds-nav-group](../gcds-nav-group)
Expand All @@ -36,6 +37,7 @@
graph TD;
gcds-alert --> gcds-icon
gcds-button --> gcds-icon
gcds-error-message --> gcds-icon
gcds-file-uploader --> gcds-icon
gcds-link --> gcds-icon
gcds-nav-group --> gcds-icon
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ graph TD;
gcds-input --> gcds-error-message
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-input fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-select/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ graph TD;
gcds-select --> gcds-error-message
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-select fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/gcds-textarea/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ graph TD;
gcds-textarea --> gcds-text
gcds-hint --> gcds-text
gcds-error-message --> gcds-text
gcds-error-message --> gcds-icon
style gcds-textarea fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down

0 comments on commit 5f1b94e

Please sign in to comment.