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

@logitech/ux-obsidian

v0.0.20

Published

React Component Library

Downloads

29

Readme

UX OBSIDIAN

A React component library for Logitech UI's and color variable sets.

How to get this package running locally

npm start

How to install it as part as your package

npm install @logitech/ux-obsidian --save

Component list:

  • LogitechLogo
  • Slider
  • CheckBox
  • StatusIcon
  • Toggle
  • ChevronCircle
  • InfoIcon

LogitechLogo

import {
  LogitechLogo,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <LogitechLogo
        color="pink"
        width={400}
      />
    );
  }
}

Props

  • color (optional) - string (default 'black')
  • width (optional) - number (default 146)

Slider

import {
  Slider,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
    sliderValue: 50,
  }

  render() {
    return (
      <Slider
        dark
        value={this.state.sliderValue}
        onChange={(evt) => {
          this.setState({ sliderValue: evt.target.value });
        }}
      />
    );
  }
}

Props

  • dark (optional) - boolean
  • leftColor (optional) - string
  • rightColor (optional) - string
  • thumbColor (optional) - string
  • value - string (0 > 100)
  • onChange - function

CheckBox

import {
  CheckBox,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
    selected: false,
  }

  render() {
    return (
      <CheckBox
        dark
        selected={this.state.selected}
        onClick={() => {
          this.setState({ selected: !this.state.selected });
        }}
      />
    );
  }
}

Props

  • selected - boolean
  • onClick - function
  • dark (optional) - boolean

StatusIcon

import {
  StatusIcon,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
    iconStatus: 'ok',
  }

  render() {
    return (
      <StatusIcon
        dark
        status={this.state.iconStatus}
      />
    );
  }
}

Props

  • status - string ('ok', 'error', 'update', 'updating')
  • dark (optional) - boolean
  • updateStatus - number (0 > 100)

Toggle

import {
  Toggle,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      toggleSelection: false,
    };
  }

  render() {
    return (
      <div>
        <Toggle
          dark
          selected={this.state.toggleSelection}
          onClick={() => {
            this.setState({ toggleSelection: !this.state.toggleSelection })
          }}
        />
      </div>
    );
  }
}

Props

  • selected - boolean
  • onClick - function
  • dark (optional) - boolean

ChevronCircle

import {
  ChevronCircle,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div>
        <ChevronCircle
          dark
          direction="right"
          onClick={() => {
            console.log('do something');
          }}
        />
      </div>
    );
  }
}

Props

  • onClick (optional) - function
  • dark (optional) - boolean
  • direction (optional) - string ('up', 'right', 'down', 'left') - default ('right')
  • dissabled (optional) - boolean
  • background (optional) - string
  • color (optional) - string

InfoIcon

import {
  InfoIcon,
} from '@logitech/ux-obsidian';

export default class YourComponent extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <InfoIcon
        color="pink"
        width={50}
      />
    );
  }
}

Props

  • color (optional) - string (default 'black')
  • width (optional) - number (default 146)

How to use color variables from the package

@import '~@logitech/ux-obsidian/src/styles/variables.scss';

Color variables

  • PRIMARY

  • azzuro: '#00B8FC',

  • ciano: '#00EAD0',

  • kirsche: '#FF2947',

  • lila: '#814EFA',

  • electrico: '#DCFD00',

  • helios: '#FF7F2C',

  • NEUTRALS

  • kohle: '#2F3132',

  • cemento: '#6F7678',

  • acier: '#C3C6C8',

  • grigio: '#E1E2E3',

  • marin: '#F4F4F4',

  • white: '#FFFFFF',

  • SYSTEM

  • success: '#55D464',

  • warning: '#FFA414',

  • error: '#DC4949',

  • scrim: '#000000',

Publishing to NPM

How to publish a new npm version

Add your commit, run the linter npm run lint, verify your code or better have someone verify your code, commit your code and then:

npm version patch
npm publish
git push origin master

Changelog

v0.0.20

  • 22/06/2018 - Added leftColor, rightColor, and thumbColor props to the Slider component.

v0.0.19

  • 22/06/2018 - NPM security audit.

v0.0.17

  • 22/06/2018 - Swapped prop order

v0.0.16

  • 21/06/2018 - Added style as props
  • 21/06/2018 - Updated color schemes to reflect dark and white
  • 21/06/2018 - Updated ChevronCircle to be able to pass style through
  • 21/06/2018 - Updated colors to reflect obsidian style guides

v0.0.15

  • 18/06/2018 - Updated the StatusIcon props and visuals.

v0.0.14

  • 18/06/2018 - Added InfoIcon Component.

v0.0.13

  • 13/06/2018 - Added to ChevronCircle Component a color, and background prop to change the desired colors.

v0.0.12

  • 13/06/2018 - Added to ChevronCircle Component a dissabled prop

v0.0.11

  • 13/06/2018 - Added LogitechLogo Component

v0.0.10

  • 4/06/2018 - Added Slider Component

v0.0.8

  • 1/06/2018 - Added CheckBox Component
  • 1/06/2018 - Added ChevronCircle Component

v0.0.2

  • 30/05/2018 - Created StatusIcon Component
  • 30/05/2018 - Added instruction for Toggle Component
  • 24/05/2018 - Added SASS for simpler variable exportation
  • 24/05/2018 - Switching to Webpack

v0.0.1

  • 23/05/2018 - Toggle element

Appendix

  • https://medium.com/@_alanbsmith/building-a-react-component-library-part-1-d8a1e248fe6c
  • https://docs.npmjs.com/private-modules/intro and retrofitted
  • https://medium.com/@BrodaNoel/how-to-create-a-react-component-and-publish-it-in-npm-668ad7d363ce