Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Export setAllComponentsTranslations function #13

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@squidit/react-css",
"version": "0.0.11",
"version": "0.0.12",
"scripts": {
"format": "prettier --write --parser typescript '**/*.{ts,tsx}'",
"lint": "eslint src --ext js,ts,tsx",
Expand Down
68 changes: 66 additions & 2 deletions src/assets/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
{
"required": "Required field"
}
"back": "back",
"loading": "Loading",
"required": "Required field",
"emptyField": "Fill this field",
"showPassword": "Show password",
"hidenPassword": "Hide password",
"nameSpecialChars": "Name cannot contain special characters",
"invalidName": "Invalid name",
"invalidEmail": "Invalid Email",
"invalidPhone": "Invalid Phone",
"invalidDate": "Invalid Date",
"invalidUrl": "Invalid URL",
"unexpected": "<strong>Everyone makes mistakes <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></strong><br />This time it was our servers, but we're already fixing it! Try again later.",
"selectedFiles": "Selected Files",
"fileSize": "File too large",
"resolution": "Recommended size: {{width}}px by {{height}}px",
"mediaLabel": "Add Media",
"fields": {
"password": {
"isEmpty": "Required field",
"lessThanEight": "Minimum 8 characters",
"noNumber": "Minimum 1 number",
"noUppercase": "Uppercase",
"noLowercase": "Lowercase"
},
"multiSelect": {
"maxOptionsSelected_one": "Maximum {{ count }} option",
"maxOptionsSelected_other": "Maximum {{ count }} options",
"qtdTags_one": "{{ count }} selected option",
"qtdTags_other": "{{ count }} selected options"
}
},
"search": "Search",
"placeholderState": "Fill in with state",
"endScroll": "No more data available",
"year_other": "{{ value }} years ago",
"year_one": "{{ value }} year ago",
"month_other": "{{ value }} months ago",
"month_one": "{{ value }} month ago",
"day_other": "{{ value }} days ago",
"day_one": "{{ value }} day ago",
"hour_other": "{{ value }} hours ago",
"hour_one": "{{ value }} hour ago",
"today": "Today",
"biggerThanMaxDate": "Date cannot be greater than {{ maxDate }}",
"errors": {
"default": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Everybody gets it wrong <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>This time it was our servers, but we're already fixing it! Please try again later.</span>",
"login": {
"contract_refused": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Contract not accepted <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>Accept the contract to access the platform !</span>",
"mail_verified": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Unverified email</h5> You have not yet confirmed your email address , go to your inbox and click 'Verify email'! If you have not yet received the confirmation message, <a>CLICK HERE</a></span>",
"unregistered_user": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>User not found <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> You entered an email that could not be found on our platform. If you have not yet registered, <a>Click here</a> to register.</span>",
"unregistered_user_mq": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>User not found on this platform <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> You entered an email that is not is linked to this platform. If you have not yet registered, <a>Click here</a> to register.</span>",
"too_many_attempts": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>We detected suspicious activity!</h5> This account is blocked due to the number of attempts. Try it again later.</span>",
"access_denied": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Invalid password <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> You entered the wrong password, please try again or in ' I forgot my password' to reset your password.</span>",
"unexpected": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Everyone makes mistakes <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>This time it was our servers, but we are already giving a way! Please try again later.</span>",
"unauthorized": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Unauthorized User</h5>Your user is not authorized to login to the platform, contact the support.</span>",
"not_allowed": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Unauthorized User</h5>You do not have permission to access the platform.</span>",
"resendEmail": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Confirmation email sent!</h5>Now access your e-mail and click on 'Verify E-mail' to be able to browse our portal!</span>"
},
"payments": {
"bankDocumentNotEqual": "The documents must be the same as the registration.",
"bankSaveError": "There was a problem saving your data. Try again later",
"blockedFields": "Temporarily this data cannot be edited."
}
}
}
68 changes: 66 additions & 2 deletions src/assets/locales/es.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
{
"required": "Campo requerido"
}
"back": "devolver",
"loading": "Cargando",
"required": "Campo requerido",
"emptyField": "Rellena este campo",
"showPassword": "Mostrar contraseña",
"hidenPassword": "Ocultar contraseña",
"nameSpecialChars": "El nombre no puede contener caracteres especiales",
"invalidName": "Nombre inválido",
"invalidEmail": "Correo electrónico no válido",
"invalidPhone": "Teléfono inválido",
"invalidDate": "Fecha Invalida",
"invalidUrl": "URL no válida",
"unexpected": "<strong>Todo el mundo comete errores <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></strong><br />Esta vez fueron nuestros servidores, ¡pero ya lo estamos arreglando! Vuelve a intentarlo más tarde.",
"selectedFiles": "Archivos seleccionados",
"fileSize": "Archivo demasiado grande",
"resolution": "Tamaño recomendado: {{width}}px por {{height}}px",
"mediaLabel": "Agregar medios",
"fields": {
"password": {
"isEmpty": "Campo obligatorio",
"lessThanEight": "Mínimo 8 caracteres",
"noNumber": "Mínimo 1 número",
"noUppercase": "Mayúsculas",
"noLowercase": "En minúsculas"
},
"multiSelect": {
"maxOptionsSelected_one": "Opción {{ count }} máxima",
"maxOptionsSelected_other": "{{ count }} opciones máximas",
"qtdTags_one": "{{ count }} opción seleccionada",
"qtdTags_other": "{{ count }} opciones seleccionadas"
}
},
"search": "Búsqueda",
"placeholderState": "Rellenar con el estado",
"endScroll": "No hay más datos disponibles",
"year_other": "hace {{ value }} años",
"year_one": "hace {{ value }} años",
"month_other": "hace {{ value }} meses",
"month_one": "hace {{ value }} meses",
"day_other": "hace {{ value }} días",
"day_one": "hace {{ value }} días",
"hour_other": "hace {{ value }} horas",
"hour_one": "hace {{ value }} horas",
"today": "Este Dia",
"biggerThanMaxDate": "La fecha no puede ser mayor que {{ maxDate }}",
"errors": {
"default": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Todos cometemos errores <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>Esta vez fueron nuestros servidores, pero nosotros ya está dando un paso! Vuelva a intentarlo más tarde.</span>",
"login": {
"contract_refused": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Contrato no aceptado <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>¡Acepta el contrato para acceder a la plataforma!</span>",
"mail_verified": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Correo electrónico no verificado</h5> Aún no ha confirmado su dirección de correo electrónico, vaya a su bandeja de entrada y haga clic en 'Verificar correo electrónico'. Si aún no ha recibido el mensaje de confirmación, <a>HAGA CLIC AQUÍ</a></span>",
"unregistered_user": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuario no encontrado <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Ingresó un correo electrónico que no se pudo encontrar en nuestra plataforma. Si aún no se ha registrado, <a>Haga clic aquí</a> para registrarse.</span>",
"unregistered_user_mq": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuario no encontrado en esta plataforma <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Ingresó un correo electrónico que no es está vinculado a esta plataforma. Si aún no se ha registrado, <a>Haga clic aquí</a> para registrarse.</span>",
"too_many_attempts": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>¡Detectamos actividad sospechosa!</h5> Esta cuenta está bloqueada debido a la cantidad de intentos . Vuelve a intentarlo más tarde.</span>",
"access_denied": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Contraseña no válida <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Ingresó una contraseña incorrecta, intente nuevamente o en 'Olvidé mi contraseña' para restablecer tu contraseña.</span>",
"unexpected": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Todos cometemos errores <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>Esta vez fueron nuestros servidores, pero nosotros ya está dando un paso! Vuelva a intentarlo más tarde.</span>",
"unauthorized": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuario no autorizado</h5>Su usuario no está autorizado para iniciar sesión en la plataforma, comuníquese con el apoyo.</span>",
"not_allowed": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuario no autorizado</h5>No tienes permiso para acceder a la plataforma.</span>",
"resendEmail": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>¡Correo electrónico de confirmación enviado!</h5>Ahora acceda a su correo electrónico y haga clic en 'Verificar E-mail' para poder navegar por nuestro portal!</span>"
},
"payments": {
"bankDocumentNotEqual": "Los documentos deben ser los mismos que el registro.",
"bankSaveError": "Hubo un problema al guardar tus datos. Vuelve a intentarlo más tarde!",
"blockedFields": "Temporalmente estos datos no se pueden editar."
}
}
}
67 changes: 65 additions & 2 deletions src/assets/locales/pt.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
{
"required": "Campo obrigatório"
}
"back": "voltar",
"loading": "Carregando",
"required": "Campo obrigatório",
"emptyField": "Preencha esse campo",
"showPassword": "Mostrar senha",
"hidenPassword": "Esconder senha",
"nameSpecialChars": "Nome não pode conter caracteres especiais",
"invalidName": "Nome inválido",
"invalidEmail": "E-mail inválido",
"invalidPhone": "Telefone inválido",
"invalidDate": "Data inválida",
"invalidUrl": "URL inválida",
"unexpected": "<strong>Todo mundo comete erros <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></strong><br />Desta vez foram nossos servidores, mas já estamos corrigindo! Tente novamente mais tarde.",
"selectedFiles": "Arquivo(s) selecionado(s)",
"fileSize": "Arquivo muito grande",
"resolution": "Tamanho recomendado: {{width}}px por {{height}}px",
"mediaLabel": "Adicionar Mídia",
"fields": {
"password": {
"lessThanEight": "Mínimo de 8 caracteres",
"noNumber": "Mínimo de 1 número",
"noUppercase": "Letra maiúscula",
"noLowercase": "Letra minúscula"
},
"multiSelect": {
"maxOptionsSelected_one": "No máximo {{ count }} opção",
"maxOptionsSelected_other": "No máximo {{ count }} opções",
"qtdTags_one": "{{ count }} opção selecionada",
"qtdTags_other": "{{ count }} opções selecionadas"
}
},
"search": "Buscar",
"placeholderState": "Preencha com o estado",
"endScroll": "Não há mais dados disponíveis",
"year_other": "há {{ value }} anos",
"year_one": "há {{ value }} ano",
"month_other": "há {{ value }} meses",
"month_one": "há {{ value }} mês",
"day_other": "há {{ value }} dias",
"day_one": "há {{ value }} dia",
"hour_other": "há {{ value }} horas",
"hour_one": "há {{ value }} hora",
"today": "Hoje",
"biggerThanMaxDate": "Data não pode ser maior que {{ maxDate }}",
"errors": {
"default": "<p class='text-bold'>Todo mundo erra. Desta vez foram nossos servidores, mas já estamos dando um jeito! Tente novamente mais tarde.</p>",
"login": {
"contract_refused": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Contrato não aceito <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>Aceite o contrato para poder acessar a plataforma!</span>",
"mail_verified": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>E-mail não confirmado</h5> Você ainda não confirmou seu endereço de e-mail, acesse sua caixa de entrada e clique em 'Verificar e-mail'! Se ainda não recebeu a mensagem de confirmação, <a>CLIQUE AQUI</a></span>",
"unregistered_user": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuário não encontrado <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Você digitou um e-mail que não foi encontrado na nossa plataforma. Se ainda não tem cadastro, <a>Clique aqui</a> para realizar o cadastro.</span>",
"unregistered_user_mq": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuário não encontrado nesta plataforma <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Você digitou um e-mail que não está vinculado a esta plataforma. Se ainda não tem cadastro, <a>Clique aqui</a> para realizar o cadastro.</span>",
"too_many_attempts": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Detectamos atividade suspeita!</h5> Esta conta está bloqueada devido ao numero de tentativas. Tente novamente mais tarde.</span>",
"access_denied": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Senha inválida <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5> Você digitou a senha incorreta, tente novamente ou em 'Esqueci minha senha' para redefinir a sua senha.</span>",
"unexpected": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Todo mundo erra <span style='font-size: 1.5rem; vertical-align: middle'>☹</span></h5>Desta vez foram nossos servidores, mas já estamos dando um jeito! Tente novamente mais tarde.</span>",
"unauthorized": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuário não autorizado</h5>Seu usuário não está autorizado a logar na plataforma, contate o suporte.</span>",
"not_allowed": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>Usuário não autorizado</h5>Você não tem permissão para acessar a plataforma.</span>",
"resendEmail": "<span class='text-medium'><h5 class='mb-1 text-black display-block'>E-mail de confirmação enviado!</h5>Agora acesse a caixa de entrada do seu e-mail e clique em 'Verificar E-mail' para poder navegar em nosso portal!</span>"
},
"payments": {
"bankDocumentNotEqual": "Os documentos CPF do titular deve ser igual ao do cadastro.",
"bankSaveError": "Ocorreu um problema ao salvar seus dados. Tente novamente mais tarde!",
"blockedFields": "Temporariamente esses dados não podem ser editados."
}
}
}
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export * from './sq-tab'
export * from './sq-tabs'
export * from './sq-infinity-scroll'
export * from './inputs/sq-input'
export * from './inputs/sq-input-date'
export * from './inputs/sq-input-file'
export * from './sq-banner'
export * from './sq-bar-chart'
export * from './sq-metric-chart'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import { Props } from '../../sq-input/sq-input.component'
import SqInputDateComponent, { DateProps } from '../sq-input-date.component'

const SqInputDateExample = ({ ...props }: Props & DateProps) => {
return (
<div className="display-flex justify-content-center align-items-center">
<SqInputDateComponent {...props} />
</div>
)
}

export default SqInputDateExample
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Meta, StoryObj } from '@storybook/react'
import SqInputDateExample from './sq-input-date.component.example'

const meta: Meta<typeof SqInputDateExample> = {
title: 'Components/Inputs/SqInputDate',
component: SqInputDateExample,
tags: ['autodocs'],
}

export default meta
type Story = StoryObj<typeof SqInputDateExample>

export const Default: Story = {}
1 change: 1 addition & 0 deletions src/components/inputs/sq-input-date/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as SqInputDate } from './sq-input-date.component'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
input::-webkit-calendar-picker-indicator {
background-color: var(--gray_light);
border-radius: 50%;
padding: 3px;
cursor: pointer;
width: 15px;
height: 15px;
transition: all 0.3s ease;
// border: 1px solid var(--black);
color: var(--black);
&:hover {
background-color: var(--white);
}
}

span.message-error {
font-size: 0.9rem;
}
Loading