Migrating fly-alert
Elements (typically span or div) with class fly-alert.
A fly-alert predates the FlyBanner component - it's a simply container with a colored background and text.
A fly-alert doesn't have built-in support for a stylized title.
Typically, a bolded inline title is included by the developer by making part of the text bold.
If such an inline title exists, it should be made into the PlumaBanner's title argument, even though
the layout ends up being a bit different.
Source:
Target:
A fly-alert doesn't have built-in support for an icon. If a custom icon is embedded
in the alert, it should be ignored - PlumaBanner includes default icons for each variant.
Source:
Target:
If a fly-alert doesn't contain any icons, it is possible to disable the icon
on a PlumaBanner as well, by passing @icon={{null}}. However, this is not recommended,
and the default per-variant icons should be used instead.
A fly-alert may contain additional classes to color it. The equivalent PlumaBanner
args are as follows:
| Fly | Pluma |
|---|---|
fly-alert is-danger | @variant="error" |
fly-alert is-error | @variant="error" |
fly-alert is-info | @variant="information" |
fly-alert is-notice | (default variant, no argument) |
fly-alert is-system | (default variant, no argument) |
fly-alert is-success | @variant="success" |
fly-alert is-warning | @variant="caution" |
fly-alert is-beta | no direct equivalent, @variant="feature" may be used |
A fly-alert may contain a "close" button, typically a small X ("close") icon.
PlumaBanner supports rendering such a button by passing in a callback function
as the @onClose argument.
Source:
Target:
A fly-alert may contain a custom action button. PlumaBanner supports this
via an @action argument, which expects an object with a label string and onClick callback.
Source:
Target:
Source:
Target: