Skip to content

Commit

Permalink
Componente Label #86 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
link2755 authored Nov 16, 2023
1 parent 9f157c1 commit 4338e7b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/plataforma_digital/assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ footer {
@import "./toast.scss";
@import "./textarea.scss";
@import "./tabela.scss";
@import "./label.scss";

// Páginas
// Sem autenticação
Expand Down
25 changes: 25 additions & 0 deletions apps/plataforma_digital/assets/css/label.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.label_component {
@apply inline-block;

justify-content: center;
border-radius: 0.25rem;
gap: 0.5rem;
padding: 0.5rem 0.75rem;
margin: 0.5rem;
}

.label_component:nth-child(4n+2) {
@apply bg-blue-100
}

.label_component:nth-child(4n+3) {
@apply bg-orange-100
}

.label_component:nth-child(4n+4) {
@apply bg-green-100
}

.label_component:nth-child(4n+5) {
@apply bg-red-100
}
21 changes: 21 additions & 0 deletions apps/plataforma_digital/lib/plataforma_digital/design_system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -603,4 +603,25 @@ defmodule PlataformaDigital.DesignSystem do
</div>
"""
end

@doc """
Componente de etiqueta, pode ser usado como marcador de imagens, de palavras chave
ou mesmo para visualização de dados diferentes dentro de um mesmo contexto.
Recebe os atributos:
- `message`: texto a ser exibido na label
"""

attr(:id, :string, default: nil)
attr(:name, :string, default: nil)
attr(:message, :string, default: nil)

def label(assigns) do
~H"""
<div class="label_component">
<.text size="base" color="text-white-100"><%= @message %></.text>
</div>
"""
end
end

0 comments on commit 4338e7b

Please sign in to comment.