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

@gitlab/ui

v79.4.1

Published

GitLab UI Components

Downloads

346,885

Readme

GitLab UI

GitLab UI is a UI component library that implements Pajamas, our design system. GitLab UI is written in Vue.js and its objectives are to:

  • Create reusable UI components to accelerate frontend development.
  • Create UI consistency for all components within GitLab.

See https://gitlab-org.gitlab.io/gitlab-ui/ for documentation.

Usage

To use GitLab UI in your project, add it as a dependency:

yarn add @gitlab/ui

Note: Make sure to also install GitLab UI's peer dependencies. Refer to the package.json for the list of peer dependencies and their expected versions.

In your main entrypoint before importing or using any component:

import setConfigs from '@gitlab/ui/dist/config'

setConfigs()

This will set the global configs used by GitLab UI.

Import the components as desired:

import { GlButton } from '@gitlab/ui';

GitLab UI is compatible with tree-shaking, you may enable this in your project to reduce bundle sizes.

GitLab UI CSS

GitLab UI provides component styles, a utility-class library, and SCSS utilities.

Quick start - development

Note: GitLab UI isn't designed to be built on Windows natively. Either WSL or GitPod can be used to set up a UNIX-like environment in which to build it.

Make sure you have Node 16.x (LTS) and Yarn 1.22 or newer.

# Clone the project
git clone [email protected]:gitlab-org/gitlab-ui.git

# Navigate to the root of the project
cd gitlab-ui

# Install all the dependencies of the project
yarn # or yarn install

# Build and launch storybook to see the components in the browser
yarn storybook

Go to http://localhost:9001/

Testing

Unit tests

Components’ unit tests live in the tests/components. The tests are organized following the same directory structure used to organize components.

  • yarn test:unit runs all unit tests.

  • yarn test:unit:watch runs all unit tests in watch mode.

  • yarn test:unit:debug runs all unit tests and allow to attach a debugger to the test runner process.

  • yarn jest [name_pattern] runs spec files that match the specified name pattern.

Examples

  • yarn jest datepicker will match all spec files with a name that contains the word datepicker.

  • yarn jest datepicker -t "when draw event is emitted" goes a step further and only runs the test with a description that matches the argument passed to the t flag.

SCSS tests

Even though we try to avoid writing complex SASS code to maintain CSS complexity low, we’ve implemented some functions that benefit from automated testing. SASS tests live in the tests/scss directory. GitLab UI uses sass-true to implement these tests, and jest run them.

yarn jest run_scss_tests runs all SCSS tests.

Visual regression tests

GitLab UI uses visual snapshot tests to prevent introducing regressions with CSS and layout changes on components. Read more on this in the visual testing documentation.

GitLab visual regression tests

GitLab UI components are a reference implementation of the Pajamas Design System components. These components should conform with the design system specs, and they should look correct in the pajamas website and the GitLab product. Please see Debugging GitLab UI issues with GitLab product CSS for information on how to debug issues with GitLab product CSS in GitLab UI.

End to end tests

Components’ end to end tests live in the cypress/e2e folder. See our end to end testing documentation for more details.

yarn run cypress open runs Cypress locally to run end to end tests.

Installation

Install with Yarn:

yarn add @gitlab/ui

Install with npm:

npm install @gitlab/ui

Styles

GitLab UI requires its styles to be imported to display components properly. We currently have 2 separate stylesheets that both need to be included in your project. The main stylesheet (gitlab_ui.scss) contains component-specific styles, while the other one (utilities.scss) contains the utility classes library on which some components rely. You might find the utility classes useful to layout components in your own project.

You have two options to include those stylesheets:

  • If you have a SCSS preprocessor setup, include the SCSS files in your own stylesheet:
@import '@gitlab/ui/src/scss/gitlab_ui.scss';
@import '@gitlab/ui/src/scss/utilities.scss';
  • If you don't have a SCSS preprocessor setup, you can import the compiled CSS files directly:
@import '@gitlab/ui/dist/index.css';
@import '@gitlab/ui/dist/utility_classes.css';

Releases

See Updating GitLab UI Packages for information on how the @gitlab/ui package is kept up to date in various projects.

Contributing guide

Please refer to CONTRIBUTING.md for details on how to add new components and contribute in general to GitLab UI.

FAQs

Any question? Have a look at our FAQ.md, you might find the answer there.