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

@tritonse/tse-constellation

v0.0.2

Published

TSE Constellation is a unified set of components aiming to give TSE projects a cohesive look and feel.

Downloads

3

Readme

TSE Constellation

TSE Constellation is a unified set of components aiming to give TSE projects a cohesive look and feel.

It is implemented as a React component library written using TypeScript and built using Vite.

Documentation and Demo

For easy-to-navigate and fully interactive documentation, please visit the Constellation Storybook.

Examples and prop configurations are provided for each component exported by Constellation.

Using in a Project

To add Constellation to a new or existing React project, first install it via:

$ npm install --save-dev @tritonse/tse-constellation

Then in a top-level component (e.g. App.tsx), wrap the entire app in a ThemeProvider via:

// ...

import { ThemeProvider } from '@tritonse/tse-constellation';

// ...

function App() {
    return (
        <ThemeProvider>
            <MyReactApp />
        </ThemeProvider>
    );
}

At this point, any components displayed on the Constellation Storybook can be imported and used.

Development

To develop components for TSE Constellation, first install development dependencies with:

$ npm install

Start the development server with:

$ npm run dev

This will automatically rebuild the library upon changes to the lib/ directory.

Open localhost:5173 to view the development site.

Start Storybook with:

$ npm run storybook

Open localhost:6006 to view Storybook.

Changes to stories will be automatically reflected in Storybook.

Development Approach and Style Considerations

Components are split up into atoms, molecules, and organisms. When adding a new component, create a subdirectory under the relevant classification (i.e. /lib/atoms/MyAtom/, /lib/molecules/MyMolecule/, etc.). Within this directory, put (at minimum):

  • index.tsx: Component entry point
  • styles.module.css: Component styles, imported in index.tsx via import styles from './styles.module.css';

To access theme data from within a component, do the following:

import { useTheme } from "../../assets/ThemeProvider";

export function MyAtom() {
  const { colors, fonts } = useTheme();

  // colors.primary_dark
  // fonts.primary
  // ...
}

This may be necessary for styling, but basics such as fonts should be set globally and do not need to be manually specified for each component.

To access theme configuration from styles.module.css, use CSS variables:

span.my_custom_atom {
  background-color: var(--tse-constellation-color-primary-dark);
  font-family: var(--tse-constellation-font-primary);
}

To use assets such as images or icons, place them into a subdirectory (e.g. /lib/atoms/MyAtom/assets/) and import them with:

import myImage from "./assets/myImage.svg";

Publishing

For those with write access to the @tritonse NPM account, a new version can be published via:

$ npm publish --access public