-
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.
- Loading branch information
1 parent
60865c5
commit cf72602
Showing
9 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
packages/design-system/src/elements/toniq-error-message/toniq-error-message.element.book.ts
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {defineBookPage} from 'element-book'; | ||
import {HtmlInterpolation, html} from 'element-vir'; | ||
import {elementsBookPage} from '../../element-book/book-pages/elements.book'; | ||
import {ToniqErrorMessage} from './toniq-error-message.element'; | ||
|
||
const examples: ReadonlyArray<Readonly<{title: string; content: HtmlInterpolation}>> = [ | ||
{ | ||
title: 'empty', | ||
content: '', | ||
}, | ||
{ | ||
title: 'with text', | ||
content: 'Error: there was an error', | ||
}, | ||
]; | ||
|
||
export const toniqErrorMessageBookPage = defineBookPage({ | ||
title: ToniqErrorMessage.tagName, | ||
parent: elementsBookPage, | ||
elementExamplesCallback({defineExample}) { | ||
examples.forEach((example) => { | ||
defineExample({ | ||
title: example.title, | ||
renderCallback() { | ||
return html` | ||
<${ToniqErrorMessage}>${example.content}</${ToniqErrorMessage}> | ||
`; | ||
}, | ||
}); | ||
}); | ||
}, | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/design-system/src/elements/toniq-error-message/toniq-error-message.element.ts
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {css, html} from 'element-vir'; | ||
import {defineToniqElementNoInputs} from '../define-toniq-element'; | ||
|
||
export const ToniqErrorMessage = defineToniqElementNoInputs({ | ||
tagName: 'toniq-error-message', | ||
styles: css` | ||
:host { | ||
display: block; | ||
color: red; | ||
} | ||
p { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
`, | ||
renderCallback() { | ||
return html` | ||
<p><slot></slot></p> | ||
`; | ||
}, | ||
}); |
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