Skip to content

Commit

Permalink
Merge pull request #1 from betha-plataforma/feature-outlines
Browse files Browse the repository at this point in the history
Outline padrão em elementos focáveis
  • Loading branch information
gdfreitas authored Nov 26, 2020
2 parents 0f37252 + 8dd8053 commit cdf0883
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 32 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull Request

on:
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "12.17"

- name: Install
run: yarn install --frozen-lockfile

- name: Test
run: yarn test

- name: Build
run: yarn build
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@betha-plataforma/estrutura-componentes",
"version": "1.0.3",
"version": "1.0.4",
"description": "Coleção de Web Components para compor a estrutura de uma aplicação front-end da Betha Sistemas.",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -46,8 +46,8 @@
"lint": "eslint --ext .js,.ts,.tsx src/"
},
"keywords": [
"estrutura componentes",
"web components",
"estrutura componentes",
"web components",
"stenciljs",
"plataforma",
"betha cloud"
Expand Down
7 changes: 7 additions & 0 deletions src/components/ajuda/ajuda.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../styles/normalize.scss';

.empty-ajuda {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -32,3 +34,8 @@
}
}
}

.descricao-mobile {
text-decoration: none;
padding: 0 16px;
}
11 changes: 5 additions & 6 deletions src/components/ajuda/ajuda.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Component, h, Prop, ComponentInterface } from '@stencil/core';

import { getCssVariableValue, isNill } from '../../utils/functions';
import { isNill } from '../../utils/functions';

@Component({
tag: 'bth-ajuda',
styleUrl: 'ajuda.scss',
shadow: true
shadow: true,
})
export class Ajuda implements ComponentInterface {

Expand All @@ -29,10 +29,10 @@ export class Ajuda implements ComponentInterface {
render() {
return (
<bth-menu-ferramenta descricao="Ajuda" tituloPainelLateral="Ajuda">
<bth-icone slot="menu_item_desktop" icone="help-circle" cor={getCssVariableValue('--bth-app-gray-light-40')}></bth-icone>
<bth-menu-ferramenta-icone slot="menu_item_desktop" icone="help-circle"></bth-menu-ferramenta-icone>

<bth-icone slot="menu_item_mobile" icone="help-circle" cor={getCssVariableValue('--bth-app-gray-dark-20')}></bth-icone>
<span slot="menu_descricao_mobile">Ajuda</span>
<bth-menu-ferramenta-icone slot="menu_item_mobile" icone="help-circle" mobile ></bth-menu-ferramenta-icone>
<span slot="menu_descricao_mobile" class="descricao-mobile">Ajuda</span>

<div slot="conteudo_painel_lateral" class="empty-ajuda">
<div class="empty-ajuda__img"></div>
Expand All @@ -43,5 +43,4 @@ export class Ajuda implements ComponentInterface {
</bth-menu-ferramenta>
);
}

}
3 changes: 3 additions & 0 deletions src/components/ajuda/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@ A configuração é necessária somente caso haja necessidade de informar a url
### Depends on

- [bth-menu-ferramenta](../app/menu-ferramenta)
- [bth-menu-ferramenta-icone](../app/menu-ferramenta-icone)
- [bth-icone](../comuns/icone)

### Graph
```mermaid
graph TD;
bth-ajuda --> bth-menu-ferramenta
bth-ajuda --> bth-menu-ferramenta-icone
bth-ajuda --> bth-icone
bth-menu-ferramenta --> bth-menu-painel-lateral
bth-menu-painel-lateral --> bth-icone
bth-menu-ferramenta-icone --> bth-icone
style bth-ajuda fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
18 changes: 16 additions & 2 deletions src/components/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ slot[name="container_contexto"] {

.menu-vertical__toggle {
text-decoration: none;
padding: 15px 15px 9px 15px;
padding: 13px 15px 9px 15px;
&:before {
content: "\f035C";
font-size: 20px;
Expand All @@ -168,6 +168,11 @@ slot[name="container_contexto"] {
background-color: rgba(255, 255, 255, 0.15);
text-decoration: none;
}

&:focus {
outline: 1px dotted var(--bth-app-gray-light-10);
outline-offset: -2px;
}
}

.menu-ferramentas {
Expand Down Expand Up @@ -198,13 +203,17 @@ slot[name="container_contexto"] {
right: 5px;
top: 5px;
}

}
&:hover,
&:focus {
background-color: rgba(255, 255, 255, 0.15);
text-decoration: none;
}

&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
outline-offset: -1px;
}
}
}
}
Expand Down Expand Up @@ -280,6 +289,11 @@ slot[name="container_contexto"] {
overflow: hidden;
padding: 0px 9px 0px 0px;

&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
outline-offset: -1px;
}

&:hover,
&:focus {
background-color: rgba(225, 227, 230, 1);
Expand Down
2 changes: 2 additions & 0 deletions src/components/app/menu-ferramenta-icone/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Também implementa a possibilidade de exibição de um `badge` ao lado do ícone

### Used by

- [bth-ajuda](../../ajuda)
- [bth-notificacoes](../../notificacoes)
- [bth-novidades](../../novidades)
- [bth-utilitarios](../../utilitarios)
Expand All @@ -43,6 +44,7 @@ Também implementa a possibilidade de exibição de um `badge` ao lado do ícone
```mermaid
graph TD;
bth-menu-ferramenta-icone --> bth-icone
bth-ajuda --> bth-menu-ferramenta-icone
bth-notificacoes --> bth-menu-ferramenta-icone
bth-novidades --> bth-menu-ferramenta-icone
bth-utilitarios --> bth-menu-ferramenta-icone
Expand Down
26 changes: 21 additions & 5 deletions src/components/app/menu-ferramenta/menu-ferramenta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
background-color: rgba(255, 255, 255, 0.2);
}

::slotted(i), ::slotted(bth-icone) {
::slotted(i),
::slotted(bth-icone) {
font-size: 18px;
}

::slotted(bth-avatar), ::slotted(img), ::slotted(svg) {
::slotted(img),
::slotted(svg) {
vertical-align: middle;
box-sizing: border-box;
margin: 7px 14px;
Expand All @@ -24,15 +26,28 @@
height: 24px;
}

::slotted(bth-avatar) {
vertical-align: middle;
box-sizing: border-box;
margin: 8px 14px;
display: unset;
border-radius: 100%;
width: 24px;
height: 24px;
}

a {
color: var(--bth-app-gray-light-40);
text-decoration: none;
padding: 7px 11px 9px 11px;
padding: 7px 11px 8px 11px;
&:hover {
background-color: rgba(255, 255, 255, 0.15);
}
&:focus {
outline: 1px dotted var(--bth-app-gray-light-10);
outline-offset: -2px;
}
}

}

.ferramenta-menu__mobile-toggler {
Expand All @@ -52,7 +67,8 @@
background-color: var(--bth-app-gray-light-30);
}

::slotted(i), ::slotted(bth-icone) {
::slotted(i),
::slotted(bth-icone) {
color: var(--bth-app-gray-dark-20);
font-size: 20px;
}
Expand Down
17 changes: 15 additions & 2 deletions src/components/app/menu-vertical-item/menu-vertical-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}

&--collapsed > .menu-vertical__list {
max-height: 0!important;
max-height: 0 !important;
}

&--floating {
Expand All @@ -62,6 +62,10 @@
transition: opacity var(--bth-app-transition-delay) cubic-bezier(0.5, 0, 0.1, 1);
}
}
&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
outline-offset: -1px;
}
}
}

Expand All @@ -83,6 +87,11 @@
color: var(--bth-app-gray-dark-30);
}

&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
outline-offset: -1px;
}

bth-icone {
&:first-child,
&:last-child {
Expand Down Expand Up @@ -121,6 +130,11 @@
height: 36px;
padding: 12px 10px 12px 53px;
cursor: pointer;

&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
outline-offset: -1px;
}
}
}

Expand Down Expand Up @@ -158,4 +172,3 @@
}
}
}

5 changes: 4 additions & 1 deletion src/components/conta-usuario/conta-usuario.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
}
}

[slot='menu_item_desktop'] {
margin: 2px 0px 1px 0px;
}

.avatar-mobile {
box-sizing: content-box;
margin: 0 12px 0 0;
Expand All @@ -49,7 +53,6 @@
}

.painel-usuario {

.perfil-usuario {
display: flex;
flex-direction: column;
Expand Down
25 changes: 13 additions & 12 deletions src/components/conta-usuario/conta-usuario.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,19 @@ export class ContaUsuario implements ComponentInterface {

private renderMenuItemDesktop() {
return (
<bth-avatar
slot="menu_item_desktop"
class="avatar-desktop"
src={this.getUrlImagemPerfil()}
title={`Foto de ${this.nome}`}
tamanho="menor"
borda
bordaTamanho="2px"
bordaCor={getCssVariableValue('--bth-app-gray-light-10')}
bordaRaio="50%"
onImageLoadError={this.onImageLoadError}>
</bth-avatar>
<section slot="menu_item_desktop">
<bth-avatar
class="avatar-desktop"
src={this.getUrlImagemPerfil()}
title={`Foto de ${this.nome}`}
tamanho="menor"
borda
bordaTamanho="2px"
bordaCor={getCssVariableValue('--bth-app-gray-light-10')}
bordaRaio="50%"
onImageLoadError={this.onImageLoadError}
></bth-avatar>
</section>
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/utilitarios/utilitarios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
border: 1px solid var(--bth-app-blue);
cursor: pointer;
}
&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
}
}

&--disabled {
Expand Down
10 changes: 9 additions & 1 deletion src/styles/normalize.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*, *:after, *:before {
*,
*:after,
*:before {
padding: 0;
margin: 0;
box-sizing: border-box;
Expand All @@ -9,6 +11,12 @@
font-family: var(--bth-app-font-family-primary);
}

a {
&:focus {
outline: 1px dotted var(--bth-app-gray-dark-30);
}
}

::-webkit-scrollbar {
-webkit-appearance: none;
height: 6px;
Expand Down

0 comments on commit cdf0883

Please sign in to comment.