npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@unio/components

v2.1.6

Published

Biblioteca Angular Unio.

Downloads

698

Readme

Unio SDK

Biblioteca da Unio para projetos frontend que utilizam Angular.

1.a - Modo preferencial

Primeiro, instale o Yeoman e o gerador da unio (generator-unio) usando npm (assumindo que o Node já está instalado node.js).

npm install -g yo
npm install -g generator-unio

Para gerar diretamente um projeto frontend, execute o seguinte comando:

yo unio:front --force

Observação importante

Para utilizar o gerador sem ser solicitada a atenção do usuário por várias vezes, é necessário executá-lo com a opção --force .

Feito isso, basta seguir as instruções do gerador e aguardar sua finalização. Após a finalização, execute o comando npm start na raiz do projeto recém-criado e o site estará pronto para uso. Utilizando este caminho, pode-se pular todos os próximos passos.

1.b - Instalando os componentes da Unio SDK

Basta executar npm install @unio/components .

2 - Usando a biblioteca

Para usar a biblioteca, é necessário adicionar a referência no arquivo app.module.ts da sua aplicação cliente:

import { UnioComponentsModule, UnioComponentsConfig } from "@unio/components";

Precisamos configurar a biblioteca:

const sdkConfig: UnioComponentsConfig = {
    baseUrl: "https://azurewebsites.net/sdk-samples",
};

Também é necessário adicionar a referência no array imports do seu módulo:

imports: [
    BrowserModule,
    UnioComponentsModule.forRoot(sdkConfig)
],

Esta etapa é necessária em todos os módulos que utilizem a biblioteca.

3 - Usando os componentes

Para usar um componente, é necessário importar e utilizar o módulo dele:

import { TextareaModule } from '@unio/components';

...
imports: [
    CommonModule,
    TextareaModule
],

Depois, adicione sua respectiva tag em seu código HTML:

<unio-textarea></unio-textarea>

4 - SCSS imports

  • Adicione @import "~@unio/components/themes/default"; , caso esteja usando tema padrão ou mude o tema.

4.1 - Temas personalizados

Para criar e utilizar um tema personalizado (não existente na biblioteca), basta seguir o procedimento abaixo:

1 - Crie um novo arquivo scss e o personalize de acordo com o exemplo:

@import "~@unio/components/themes/index";

// Define o tema
$primary: unio-palette($unio-green-dark-2);
$alternative-primary: unio-palette($unio-default-green);

$secondary: unio-palette($unio-grey-dark-1);
$alternative-secondary: unio-palette($unio-grey-dark-1);

$theme-dark: unio-dark-theme(
    $primary,
    $secondary,
    $alternative-primary,
    $alternative-secondary
);
$theme-light: unio-light-theme(
    $primary,
    $secondary,
    $alternative-primary,
    $alternative-secondary
);

$foreground: map-get($theme-dark, foreground);
$background: map-get($theme-dark, background);

2 - Importe esse arquivo no seu arquivo de estilos padrão (ex: styles.scss , ver item 4 - SCSS imports).

5 - Scaffoldings disponíveis

Scaffoldings são ferramentas que agilizam o desenvolvimento de tarefas repetitivas, como a criação de componentes.

5.1 - Resource

Para gerar um resource, use o seguinte comando ng generate @unio/components:resource ou ng g @unio/components:resource .

5.2 - Tela com formulário

Para gerar uma tela com um formulário dinâmico, use o seguinte comando ng generate @unio/components:form ou ng g @unio/components:form .