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

glints-aries

v4.1.13

Published

Glints ui-kit for frontend

Downloads

1,534

Readme

Introduction

We proudly present to you Glints Aries created by the front-end engineers of Glints. It is a front-end framework to simplify and speed up your development. This project is built with React and Styled Components. We are still actively developing this project day by day and there are still a ton of amazing components to be built.

Installation

npm install -S glints-aries

Basic usage

Before you start implementing the component, it's always a good idea to wrap your root component with <GlintsContainer />. We created that Container to adapt with every screen size, so users will always have the best experience regardless of the device they use. For more details, you can read this at Utilities, then GlintsContainer section.

import { GlintsContainer } from 'glints-aries';

<GlintsContainer>
  <Component />
</GlintsContainer>;

Demo

http://aries.glints.design/

Development

Before that, make sure you already have git, node (version >= 14), and yarn installed.

  1. Clone the repository
git clone [email protected]:glints-dev/glints-aries.git
  1. Install the project dependencies (preferably use yarn here), then build the project
yarn
yarn build
  1. Start the application
yarn storybook
  1. Open your browser on (port 6006)[http://localhost:6006].

Note: For Windows user, please use WSL2 Linux to execute all the commands above. Make sure that the repository is cloned on the linux folder, not on your C drive.

How to test local changes in glints-aries in your project

yalc

install yalc globally

yarn global add yalc

in your local glints-aries directory:

yarn build
yalc publish

in your dependent project:

yalc add glints-aries
yarn start:dev

unlink local glints-aries in dependent project:

yalc remove glints-aries
yarn install

yarn link (might not work)

  1. Open terminal in glints-aries.
  2. Run yarn link.
  3. Open terminal in your project.
  4. Run yarn link glints-aries.
  5. Run yarn build in glints-aries when finish changes and want to test locally in your project.

Run yarn unlink glints-aries and re-install glints-aries when you want to stop using local glints-aries

Currently there is an issue where the above leads to react complaining about multiple instances of react being found. The error message says Uncaught Invariant Violation: Invalid hook call [...]. If you encounter this, you can link your project's react into your local Glints Aries:

  1. Open terminal in your project.
  2. Run cd node_modules/react.
  3. Run yarn link.
  4. Open terminal in glints-aries.
  5. Run yarn link react.

Adding visual test

We use playwright visual comparison test for components to check for regressions, since images in every browser and machine can be rendered differently we'll use docker image to generate and compare the screenshots.

All visual test and screenshots can be found in test/e2e directory

To generate new screenshots locally:

Create docker image with docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.29.0-focal /bin/bash

Run following commands in that image:

  1. Install the dependencies yarn install or npm install
  2. Run storybook yarn storybook
  3. Generate screenshot of your tests with npx playwright test --update-snapshots
  4. Commit and push your test screenshots

Code structure in glints-aries

  1. Always do alphabetically when importing file.
  2. Put file on proper folder based on each respective uses.
  3. Use 2 Indent Spaces and Tab on the code.
  4. Follow this import structure for your code
    • First: always import React library at first.
    • Second: third-party.
    • Third: glints-aries component.
    • Fourth: glints-aries utilities.
    • Fifth: styling.
import * as React from 'react'; // React

import classNames from 'classnames'; // Third-party
import PropTypes from 'prop-types'; // Third-party

import Modal from '../../Display/Modal'; // Glints Aries component

import { escEvent } from '../../Utils/DomUtils'; // Glints Aries utilities

import { Container, ModalBackground, ModalArea } from '../../Style/ModalStyle'; // Styling

Always give line break between different section when importing.

  1. Follow this code structure for your code
    • First: Constructor / State
    • Second: Local Function
    • Third: React life cycle
    • Forth: Render
  2. Always do line break whenever your import or variable is so long. You can do it like this but you can do it in another format as long as it can be legible and not long.
const { type, children, className, ...defaultProps } = this.props;

Code Procedure

  1. Use Color library instead of writing hex codes.
background-color: #EC272B; // Wrong
background-color: ${PrimaryColor.glintsred}; // Right
  1. Use ScreenSize instead of writing pixel size number.
@media (min-width: 640px) { ... } // Wrong
@media (min-width: ${ScreenSize.mobileL}px) { ... } //Right
  1. Naming convention for styled-components.

Use the component name followed by the role of that style.

CheckboxContainer
1. Name: Checkbox
2. Role: Container

JobcardImageWrapper
1. Name: Jobcard
2. Role: ImageWrapper
  1. Avoid offering styling props on a component.
<Collapsible onHoverColor="#FAFAFA" /> // Wrong
  1. Minimize the number of elements inside a Component
// Wrong
<div className="container">
  <div className="wrapper">
    <div>
      <h1>This is Heading</h1>
    </div>
  </div>
</div>
  1. Fix eslint/react warnings before pushing your code.

What is Component?

A standalone piece of software that has a clear boundary that is accessible via an API and contains all of the application dependencies.

Why we need a component-based design system?

  1. Create consistent experience throughout our UI.
  2. Component accelerates development.

What we need to prepare for constructing a design system?

  1. Identify company culture/ mission
  2. Base Color
  3. Type scale
  4. Border radius (rounding corner or sharp corner)
  5. Spacing scale (line-height)
  6. Letter spacing
  7. Shadow (how our shadow look like on every component)

Creating and maintaining a consistent UI and UX across every part of our product. It helps users intuitively navigate and successfully interact with different sections of your applications without confusion. It also creates sense of branding.

If you design a component, you should pay attention to

  1. Functional Consistency
  2. Visual Consistency

What defines a great component?

  1. Interface defines the component so component should respect the context. It means that Interface should be able to work in any possible context.
  2. Interface should have clear usability.
  3. Component should be flexible but still consistent.
  4. Only support functional interaction, not style.
  5. Great component supports accessibility.

How can we improve glints-aries?

  1. Always leave room for component to be flexible but still consistent.
  2. Component size should be flexible in every environment.
  3. Glints Aries’s interface should be able handle any possibilities.
  4. The name of the component must be easy to understand and clear based on the usage.
  5. Differentiate between component that should have children and self-closing tag.
  6. Improve accessibility.
  7. Always checking your code whether it's having clash with existing code.
    • Do manual test.
    • Remove all warnings and errors before push it to Github.

More about Glints Aries

Find out more about the following topics in our wiki: