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

businessnextui

v1.0.5

Published

Crmnext UI is a library for creating themeable user interfaces based on constraint-based design principles. Build custom component libraries, design systems, web applications and more with a flexible API for best-in-class developer ergonomics.

Downloads

8

Readme

Crmnext Ui

Crmnext UI is a library for creating themeable user interfaces based on constraint-based design principles. Build custom component libraries, design systems, web applications and more with a flexible API for best-in-class developer ergonomics.

develop (prerelease) docs: https://dev.crmnextlab.com/styleguide


Built for design systems, white-labels, themes, and other applications where customizing colors, typography, and layout are treated as first-class citizens and based on a standard Theme Specification,

  • The next evolution of Styled System
  • From the creators of utility-based, atomic CSS methodologies
  • Theme-based styling with the sx prop
  • Compatible with virtually any UI component library
  • Works with existing [Styled System][] components
  • Quick mobile-first responsive styles
  • Primitive page layout components
  • Completely customizable with robust theming
  • Built with a standard [Theme Specification][] for interoperability
  • Built with [Emotion][] for scoped styles

Installation - Getting Started

Use the package manager pip to install foobar.

npm install @emotion/react @emotion/styled crmnext-ui

Usage

Any styles in your app can reference values from the global theme object. To provide the theme in context, wrap your application with the ThemeProvider component and pass in a custom theme object.

// basic usage
import { ThemeProvider } from 'crmnext-ui'
import theme from './theme'

export default (props) => (
  <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
)

The theme object follows the System UI [Theme Specification], which lets you define custom color palettes, typographic scales, fonts, and more.

// example theme.js
export default {
  fonts: {
    body: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',
    heading: '"Avenir Next", sans-serif',
    monospace: 'Menlo, monospace',
  },
  colors: {
    text: '#000',
    background: '#fff',
    primary: '#33e',
  },
  radii:{
      2:            '2px',
      4:            '4px',
      6:            '6px',
      8:            '8px',
      10:           '10px',
      12:           '12px',
      14:           '14px',
      16:           '16px',
      20:           '20px',
      30:           '30px',
      40:           '40px',
      circle:    '50%',
      square:       '4px',
  },
  borderStyles = {
      none: 'none',
      solid: 'solid',
      dotted: 'dotted',
      dashed: 'dashed',
      double: 'double'
  },
  borderWidths: [
      1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  ],

  scaleFontSize: (string | number)[] = [
      '2.027rem',
      '1.802rem',
      '1.602rem',
      '1.424rem',
      '1.266rem',
      '1.125rem',
      '1rem',
      '0.889rem',
      '0.79rem',
      '0.702rem',
      '0.624rem'
  ];
}

sx prop

The sx prop works similarly to Emotion's css prop, accepting style objects to add CSS directly to an element in JSX, but includes extra theme-aware functionality. Using the sx prop for styles means that certain properties can reference values defined in your theme object. This is intended to make keeping styles consistent throughout your app the easy thing to do.

The sx prop only works in modules that have defined a custom pragma at the top of the file, which replaces the default React JSX functions. This means you can control which modules in your application opt into this feature without the need for a Babel plugin or additional configuration.



export default (props) => (
  <div
    sx={{
      fontWeight: 'bold',
      fontSize: 4, // picks up value from `theme.fontSizes[4]`
      color: 'primary', // picks up value from `theme.colors.primary`
    }}
  >
    Hello
  </div>
)

Responsive styles

The sx prop also supports using arrays as values to change properties responsively with a mobile-first approach. This API originated in [Styled System][] and is intended as a terser syntax for applying responsive styles across a singular dimension.



export default (props) => (
  <div
    sx={{
      // applies width 100% to all viewport widths,
      // width 50% above the first breakpoint,
      // and 25% above the next breakpoint
      width: ['100%', '50%', '25%'],
    }}
  />
)

License

MIT