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
Showing
42 changed files
with
1,609 additions
and
619 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Toast } from '@lmc-eu/spirit-web/src/js/index.esm'; | ||
|
||
const addDynamicToast = (event, containerId) => { | ||
const formElement = event.target.closest('form'); | ||
const config = { | ||
color: formElement.querySelector('#toast-color').value, | ||
containerId, | ||
content: formElement.querySelector('#toast-content').value, | ||
hasIcon: formElement.querySelector('#toast-has-icon').checked, | ||
id: `my-dynamic-toast-${Date.now()}`, | ||
isDismissible: formElement.querySelector('#toast-is-dismissible').checked, | ||
}; | ||
|
||
const toast = new Toast(null, config); | ||
toast.show(); | ||
console.log('Created dynamic toast with config:', config); | ||
}; | ||
|
||
// Make it available in the global scope | ||
window.addDynamicToast = addDynamicToast; | ||
|
||
export default addDynamicToast; |
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
19 changes: 19 additions & 0 deletions
19
packages/web-twig/src/Resources/components/Icon/__tests__/__fixtures__/icon.twig
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,19 @@ | ||
<Icon name="warning" /> | ||
|
||
<!-- Render with title --> | ||
<Icon name="warning" title="This is warning!" /> | ||
|
||
<!-- Render with boxSize --> | ||
<Icon name="warning" boxSize="32" /> | ||
|
||
<!-- Render as symbol --> | ||
<Icon name="info" isSymbol /> | ||
|
||
<!-- Render with all props --> | ||
<Icon | ||
ariaHidden={ false } | ||
boxSize="48" | ||
isReusable={ false } | ||
name="info" | ||
title="This is info!" | ||
/> |
3 changes: 0 additions & 3 deletions
3
packages/web-twig/src/Resources/components/Icon/__tests__/__fixtures__/iconDefault.twig
This file was deleted.
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
Oops, something went wrong.