-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Toast] Progressbar, closeEasing, Bugfixing, message support #139
Conversation
Thanks for the pull request. Could you change the base branch to |
Done ;) |
@lubber-de Great PR 👍, I will take a look and do some testing when I get some time. |
Wow, this is a great PR ! Actually you did a lot of enhancements and fixes I was willing to do the next week 😄 As there's some big changes, I'll take the time to heavily test it, and I will take some time to do so. But from what I can see now, you seem to have done a great job ! |
…oast_enhancements
dist/components/toast.css
Outdated
} | ||
|
||
.floating.toast { | ||
box-shadow: 0 0 0 1px #a3c293 inset, 0 2px 4px 0 rgba(34,36,38,.12), 0 2px 10px 0 rgba(34,36,38,.15); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this ! Since we got rid of opacity, what do you think about display it (or a variant) on mouse over ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest implementing this as an additional class, so the user can decide how it should behave
Will only show the box-shadow on hover
className: {
toast: 'ui hoverfloating toast'
}
Will still show the box shadow any time
className: {
toast: 'ui floating toast'
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed / added accordingly by commit f49a63c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this looks good to me now !
Thank you for beeing comprehensive and patient. The toast is my first FUI module and I want it to be evolutive and perfect 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't get the css to build after applying the patch:
'variable @floatingBoxShadow is undefined in file toast.less
after fixing that:
'variable @activePulseDuration is undefined in file toast.less
Sadly you can't use variables from other modules/elements that easily.
Rendering different sized toasts results in a progress bar outside of the the smaller toasts:
I just executed all three examples (from the description) at the same time.
…attached, made compact an option, fixed alignments, fixed responsiveness margins, removed unused variables
Meanwhile, while you are testing my latest commit 😉 : |
@lubber-de I totally agree with this. I think it should be |
@lubber-de would make sense. Definitely one thing I didn't really like of the original commit. |
@etshy Good point. I said to add the boolean values so it would break any changes but we haven't released this yet so what is there to break 🤔 so we could just have |
@etshy |
Options should @lubber-de I didn't take a look to the code or event the toast features yet so I don't really know what is IMO, top or bottom should always be here so the Let me know if I misunderstood something here. |
@lubber-de @etshy I can see where you both are coming from but I think we should only have default: available: |
Alright, but if somebody sets this to true we should raise an exception on the console then? |
I think, I simply add the string value of showProgress to the div and if it's any boolean value, the progress won't be rendered completely. This way the user would also be able to add more classes to the progress if needed |
@hammy2899 that's how I thought it would be better, just I was just asking, IF there is a I guees you could raise an exception if true or any others value is set, and not show anything ? Thanks a lot to work so much on this 👍 |
…oast_enhancements
@lubber-de is this ready for review now, or do you have more changes planned? |
@ColinFrick It's ready now. I have more additions in progress, but this can be a separate PR then. I won't touch this branch anymore unless you'll need more fixes/changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If someone has some time and could do the docs this could be in our next release. |
Toast Enhancements
Added
showProgress
(default false), which displays a SUI attached progressbar increasing until displayTime is reached (ignored, if displayTime = 0) Values:'bottom'
,'top'
,false
progressUp
(default true). If set to false the progress is decreasing instead of increasingclassName: {toast: 'ui message'}
is used (all message color options are supported to display a progressbar with the same color)'easeOutBounce'
) to animate the stacking when a toast closes. Set empty for old behaviouronBeforeHide
(will be called given a callback parameter) functionality to transition.js to make the above closeEasing animation possibleclassName: {toast:'ui floating toast'}
just like in message to display a box-shadow underneath/around the toast. (className: {toast:'ui hoverfloating toast'}
will show the box-shadow only on hovering)closeIcon
(default false). This will make the toast closable by the top right corner icon instead of clicking anywhere on the toastshowIcon
to be able to use individual iconsChanged
compact
(default true) which does the same but does this independ of the classNameopacity
(default 1) instead as discussed belowFixed
Examples
Progressbar
showProgress: 'bottom'
Progressbar decreasing
progressUp: false
Animated stacking on close
transition: closeEasing = 'easeOutBounce'
Top Progressbar
showProgress: 'top'
Close Icon
closeIcon: true
Difference to usual toast: It's only closable by close-icon instead of clicking anywhere in the toast. cursor changed accordingly
Individual Icon
showIcon: 'your icon name'
Using a string instead of true for showIcon will use that string for the icon display. Using
true
remains the old behaviour (displaying the appropriate icon which matches the class)