DevactionUI.EmailTag (devaction_ui v0.4.0)

Copy Markdown View Source

The small labels of an e-mail: the mono tag that says risk, warning, suggestion or ok, a row of them with counts, and the larger chip that names what the e-mail is about (a repository, a week, a role).

Five tones carry the meaning: :risk, :warn, :info, :ok and :neutral. The tone never stands alone: the label is always text, and you write it in capitals because a mail client does not always honor text-transform. Border, background and text come from one private map, in literal hex, because an e-mail has no CSS variables.

Summary

Functions

The chip above the heading that names the subject: a repository and a number, a week, a role.

A mono label with a tinted border and background.

Several tags in a line, each a little larger: the counts under a heading.

Functions

chip(assigns)

@spec chip(map()) :: Phoenix.LiveView.Rendered.t()

The chip above the heading that names the subject: a repository and a number, a week, a role.

Example

<.chip>sge-api · #142</.chip>
<.chip tone={:warn}>RENEWS IN 30 DAYS</.chip>

Attributes

  • tone (:atom) - Defaults to :neutral. Must be one of :risk, :warn, :ok, :info, or :neutral.
  • Global attributes are accepted.

Slots

  • inner_block (required) - what the e-mail is about, in mono.

tag(assigns)

@spec tag(map()) :: Phoenix.LiveView.Rendered.t()

A mono label with a tinted border and background.

Example

<.tag tone={:risk}>RISK</.tag>
<.tag tone={:ok} size={:md}>TESTS OK</.tag>

Attributes

  • tone (:atom) - what the tag means. Defaults to :neutral. Must be one of :risk, :warn, :ok, :info, or :neutral.
  • size (:atom) - :sm 10 px for a row of a list, :md 11 px for a count. Defaults to :sm. Must be one of :sm, or :md.
  • Global attributes are accepted.

Slots

  • inner_block (required) - the label, in capitals.

tag_row(assigns)

@spec tag_row(map()) :: Phoenix.LiveView.Rendered.t()

Several tags in a line, each a little larger: the counts under a heading.

Example

<.tag_row>
  <:tag tone={:risk}>2 RISKS</:tag>
  <:tag tone={:info}>1 SUGGESTION</:tag>
</.tag_row>

Attributes

  • Global attributes are accepted.

Slots

  • tag (required) - a tag of the row. Accepts attributes:
    • tone (:atom) - Must be one of :risk, :warn, :ok, :info, or :neutral.