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

@digital-ai/dot-components

v4.4.2

Published

A component library the follows the Dot Design System

Downloads

2,412

Readme

@digital-ai/dot-components

npm version npm (prod) dependency version

Welcome! 👋

So you've decided to use dot-components in your application, that's fantastic. Be sure to come say "hi" in the #dot-components channel in Slack and let us know how you're using our library.

Installation

# with npm
npm install @digital-ai/dot-components

# with yarn
yarn add @digital-ai/dot-components

Theme Provider

The DotThemeProvider provides the theme for the components in this library. When using this library you will need to wrap your application with it like this:

<DotThemeProvider>
  <App />
</DotThemeProvider>

Once your application is wrapped with DotThemeProvider, your styled components can use colors and spacings from the theme:

import styled, { css } from 'styled-components';

const StyledWidget = styled.div`
  ${({ theme }) => css`
    background-color: ${theme.palette.secondary[300]};
    border: 1px solid ${theme.palette.primary.main};
    .my-widget-text {
      margin-left: ${theme.spacing(2)};
    }
  `}
`;

export interface MyWidgetProps {
  text: string;
}

export const MyWidget = ({ text }: MyWidgetProps) => {
  return (
    <StyledWidget>
      <div className="my-widget-text">{text}</div>
    </StyledWidget>
  );
};

Note: If you would like to create a custom theme, you can do so by following these directions.

Configuring Jest

We are utilizing @digital-ai/dot-icons which uses @font-face. If you are using Jest then you'll need to update the following files. The location of the files may be different based on the structure of your application

jest.config.js

moduleNameMapper: {
  '@digital-ai/dot-icons': '<rootDir>/testing-utils/style-mock.ts',
  '@digital-ai/dot-illustrations': '<rootDir>/testing-utils/style-mock.ts',
}

style-mock.ts

module.exports = {};

Targeting CSS ClassNames

There are three different types of CSS class names that are used: dot- classes, Mui classes, and styled-components classes. You are encouraged to use the dot- classes in your application styles, but you can also use the Mui classes if you prefer. It is important to note that the Mui classes are subject to change and are not guaranteed to be stable across releases.

Note: The styled-components classes are generated by the library and should NOT be used, they will look like random letters, ex: kMprfx

Resolving Style Conflicts

It is possible that existing application styles might target native elements in ways that will conflict with styles from dot-components.

Because dot- classes are applied to native elements that are part of dot-components, such conflicts can be resolved by making minor changes to the application styles.

For example, suppose the application includes global styling like this:

input {
  background-color: red;
}

To override this styling for dot-components, this could be changed to:

input:not(.dot-input) {
  background-color: red;
}

Updating

When you're ready to pull in the latest version of the dot-components package run the following command.

# with npm
npm update @digital-ai/dot-components@latest

# with yarn
yarn upgrade @digital-ai/dot-components@latest

Font Icons

Find which icon you would like to use by going to .dot design system

Follow the code example shown here

Note: You can use search in the upper right corner to search for an icon if you know its name.

If you're using the DotIcon component then you do not need to pass in the icon- prefix of the icon name.

Contributing

Learn about how to contribute

Code Style Guide

Learn about our code style guide

Change Log

Learn about the latest improvements.

Security Policy

Learn about our security policy