-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notice): add component tokens (#11042)
**Related Issue:** #7180 ## Summary Adds the following subcomponent tokens (CSS props): - `--calcite-notice-background-color` - `--calcite-notice-close-background-color-focus` - `--calcite-notice-close-background-color-press` - `--calcite-notice-close-text-color-hover` - `--calcite-notice-close-text-color` - `--calcite-notice-content-text-color`
- Loading branch information
Showing
4 changed files
with
91 additions
and
27 deletions.
There are no files selected for viewing
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
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
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
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,19 +1,15 @@ | ||
import { html } from "../../support/formatting"; | ||
|
||
export const notice = ({ kind, message, title }: { kind: string; message: string; title: string }): string => | ||
html`<calcite-notice kind=${kind} scale="s" open closable> | ||
<div slot="title">${title}</div> | ||
<div slot="message">${message}</div> | ||
${kind === "danger" ? html`<calcite-link slot="link" title="my action">Retry</calcite-link>` : null} | ||
</calcite-notice>`; | ||
export const noticeTokens = { | ||
calciteNoticeBackgroundColor: "", | ||
calciteNoticeCloseBackgroundColorFocus: "", | ||
calciteNoticeCloseBackgroundColorPress: "", | ||
calciteNoticeCloseTextColorHover: "", | ||
calciteNoticeCloseTextColor: "", | ||
calciteNoticeContentTextColor: "", | ||
}; | ||
|
||
export const notices = html`${notice({ | ||
kind: "danger", | ||
message: "There was an error while performing the task.", | ||
title: "Something failed", | ||
})} | ||
${notice({ | ||
kind: "success", | ||
message: "That thing you wanted to do worked as expected", | ||
title: "Something worked", | ||
})}`; | ||
export const notice = html`<calcite-notice kind="success" scale="s" open closable> | ||
<div slot="title">Something worked</div> | ||
<div slot="message">That thing you wanted to do worked as expected</div> | ||
</calcite-notice>`; |