diff --git a/addon/components/pix-toast-container.hbs b/addon/components/pix-toast-container.hbs new file mode 100644 index 000000000..11c2f818e --- /dev/null +++ b/addon/components/pix-toast-container.hbs @@ -0,0 +1,9 @@ +
+ {{#if this.pixToast.content}} + + {{/if}} +
\ No newline at end of file diff --git a/addon/components/pix-toast-container.js b/addon/components/pix-toast-container.js new file mode 100644 index 000000000..6ea4a5490 --- /dev/null +++ b/addon/components/pix-toast-container.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import { service } from '@ember/service'; + +export default class PixToastContainer extends Component { + @service pixToast; +} diff --git a/addon/components/pix-toast.hbs b/addon/components/pix-toast.hbs index fc094eecf..ac01771f6 100644 --- a/addon/components/pix-toast.hbs +++ b/addon/components/pix-toast.hbs @@ -1,12 +1,9 @@ -
+

- {{yield}} + {{@message}}

({ template: hbs` - ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, - totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae - dicta sunt explicabo. -`, +/>`, context: args, }), argTypes: { @@ -21,16 +16,6 @@ export default { description: 'Type de la notification : success, error, information, warning', type: { name: 'string', required: true }, }, - onCloseButtonClick: { - name: 'onCloseButtonClick', - description: 'Fonction à exécuter à la fermeture de la notification', - type: { name: 'function', required: true }, - }, - showToast: { - name: 'showToast', - description: "Gérer l'affichage de la notification", - type: { name: 'boolean', required: true }, - }, ariaLabelForCloseButton: { name: 'ariaLabelForCloseButton', description: 'Aria-label pour le bouton de fermeture de la notification', @@ -42,34 +27,30 @@ export default { export const success = { args: { type: 'success', - showToast: true, + message: "ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\n totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\n dicta sunt explicabo.", ariaLabelForCloseButton: 'Fermer', - onCloseButtonClick: () => {}, }, }; export const error = { args: { type: 'error', - showToast: true, + message: "ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\n totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\n dicta sunt explicabo.", ariaLabelForCloseButton: 'Fermer', - onCloseButtonClick: () => {}, }, }; export const information = { args: { type: 'information', - showToast: true, + message: "ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\n totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\n dicta sunt explicabo.", ariaLabelForCloseButton: 'Fermer', - onCloseButtonClick: () => {}, }, }; export const warning = { args: { type: 'warning', - showToast: true, + message: "ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\n totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\n dicta sunt explicabo.", ariaLabelForCloseButton: 'Fermer', - onCloseButtonClick: () => {}, }, };