Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(textarea): novo componente (#22)
* Novo componente * feat: correção da versão do typescript Tem uma issue no typescript porque está travando o build. microsoft/TypeScript#45642 rollup/rollup#4213
- Loading branch information
1 parent
08ce1fc
commit 50cd241
Showing
17 changed files
with
909 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from '../../button/src/index'; | ||
export * from '../../textarea/src/index'; | ||
export * from '../../link/src/index'; | ||
export * from '../../radio/src/index'; | ||
export * from '../../checkbox/src/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# `<ani-textarea>` | ||
|
||
Componente de textarea desenvolvido com [Web Components](https://developer.mozilla.org/pt-BR/docs/Web/Web_Components). | ||
|
||
## Instalação | ||
|
||
``` | ||
npm i @animaliads/ani-textarea | ||
``` | ||
|
||
## Utilização | ||
|
||
``` | ||
<ani-textarea></ani-textarea> | ||
``` | ||
|
||
## Propriedades | ||
|
||
[EM BREVE] | ||
|
||
## Eventos | ||
|
||
[EM BREVE] | ||
|
||
## Customização | ||
|
||
[EM BREVE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@animaliads/ani-textarea", | ||
"version": "0.0.0-PLACEHOLDER", | ||
"description": "Textarea do Animalia DS", | ||
"tag": "dev", | ||
"keywords": [ | ||
"javascript", | ||
"design system", | ||
"web components", | ||
"textarea" | ||
], | ||
"main": "textarea/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/animaliads/animalia-web-components.git", | ||
"directory": "packages/textarea" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@animaliads/animalia-brand": "^1.0.0", | ||
"@animaliads/css-tokens": "^1.0.0", | ||
"tslib": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.16.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface Field { | ||
readonly placeholder: string; | ||
|
||
readonly value: string; | ||
|
||
readonly disabled: string; | ||
|
||
readonly readonly: string; | ||
|
||
readonly maxlength: string; | ||
|
||
readonly minlength: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './textarea'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
## Boas práticas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import LiveDemoComponent from './../../../../stories/helpers/components/live-demo.tsx'; | ||
|
||
## Desenvolvimento | ||
|
||
### Instalação do pacote | ||
|
||
Caso você já tenha feito o passo-a-passo descrito em [Começando](?path=/docs/começando--page), | ||
você pode pular esta instalação e ir direto para o tópico [Como utilizar](#como-utilizar). | ||
|
||
Você pode instalar o componente de forma isolada, conforme o exemplo abaixo: | ||
|
||
``` | ||
npm install @animaliads/ani-textarea | ||
``` | ||
|
||
### Como utilizar | ||
|
||
Para utilizar este componente na sua aplicação você precisa importar o arquivo principal. | ||
Essa importação irá variar conforme o tipo de aplicação que você está utilizando, por exemplo: angular, react ou | ||
somente javascript. | ||
|
||
Depois de importar o arquivo principal, basta adicionar a tag `ani-textarea` no seu código: | ||
|
||
```html | ||
<ani-textarea>exemplo de label</ani-textarea> | ||
``` | ||
|
||
> Para utilizar com o tema padrão, é necessário instalar e utilizar os pacotes `@animaliads/animalia-brand` | ||
> e `@animaliads/css-tokens`. Você pode ver um exemplo de utilização no [Live Demo](#live-demo). | ||
Para customizar o tema do componente, você pode estar utilizando as propriedades customizáveis | ||
da seguinte forma: | ||
|
||
```css | ||
ani-textarea { | ||
--color: green; | ||
} | ||
``` | ||
|
||
Para saber quais são as propriedades disponíveis, consulte [propriedades customizáveis](#propriedades-customizáveis). | ||
|
||
### Live Demo | ||
|
||
<LiveDemoComponent react="https://stackblitz.com/edit/react-ani-textarea?embed=1&file=src/App.js" /> | ||
|
||
Para saber a lista de propriedades e eventos, acesse o [guia de referencia de API](/docs/api-textarea--sample). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Propriedades customizáveis | ||
|
||
O componente de textarea possui propriedades customizáveis, que possibilitam fazer alterações, de acordo com a marca ou o tema a ser utilizado. Com isso, garantimos uma consistência ao Design System, sem perder a identidade de cada marca. | ||
|
||
Possui cinco estados, que se modificam de acordo com a interação do usuário, sendo eles: _Normal_, _Hover_, _Focused_, _Disabled_ e _Read-only_. | ||
|
||
| Propriedade | Descrição | Valor padrão | | ||
| -------------------------- | -------------------------------------------------------- | ------------------------ | | ||
| `--font-family` | família tipográfica | $font-family-text | | ||
| `--font-size` | tamanho da fonte | $font-size-default | | ||
| `--text-color-placeholder` | cor de texto do placeholder | $color-neutral-light-30 | | ||
| `--color` | cor predominante (borda) | $color-neutral-dark-70 | | ||
| `--background` | cor do background | $color-neutral-light-05 | | ||
| `--text-color` | cor do texto | $color-neutral-dark-90 | | ||
| `--color-hover` | cor predominante (borda) no estado hover | $color-action-hover | | ||
| `--background-hover` | cor do background no estado hover | $color-brand-01-lightest | | ||
| `--color-focused` | cor predominante (borda) no estado focus | $color-action-default | | ||
| `--outline-color-focused` | cor do outline do focus | $color-action-focus | | ||
| `--color-disabled` | cor predominante (borda) no estado desabilitado | $color-action-disabled | | ||
| `--background-disabled` | cor do background no estado hover no estado desabilitado | $color-neutral-light-20 | | ||
| `--text-color-disabled` | cor do texto no estado desabilitado | $color-neutral-dark-70 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Text Area | ||
|
||
## Visão geral |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Meta, Story } from '@storybook/addon-docs/blocks'; | ||
import { html } from 'lit-html'; | ||
|
||
import '../textarea'; | ||
|
||
import Code from './code.mdx'; | ||
import BestPractices from './best-practices.mdx'; | ||
import General from './general.mdx'; | ||
import CustomProperties from './custom-properties.mdx'; | ||
|
||
<Meta | ||
title="Componentes/Textarea" | ||
parameters={{ previewTabs: { canvas: { hidden: true } } }} | ||
/> | ||
|
||
<Story name="Visão geral" height="0"> | ||
{html``} | ||
</Story> | ||
|
||
<General /> | ||
|
||
<Story name="Boas práticas" height="0"> | ||
{html``} | ||
</Story> | ||
|
||
<BestPractices /> | ||
|
||
<Story name="Desenvolvimento" height="0"> | ||
{html``} | ||
</Story> | ||
|
||
<Code /> | ||
|
||
<Story name="Propriedades customizáveis" height="0"> | ||
{html``} | ||
</Story> | ||
|
||
<CustomProperties /> |
Oops, something went wrong.