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

@xtreamr/spark-components

v8.7.1

Published

spark-components React component

Downloads

136

Readme

Xtreamr-components

examples: https://xtreamr.github.io/xtreamr_components/

Package commands

Start Storybook components guide in local

yarn start

This command first make a build for publish to npm. Then, make a new tag in repo and publish to npm. And also publsih the examples in ghpages.

yarn release
yarn release:minor
yarn release:major 

There are other commands (in order) for make storybook release folder, make a gh pages and make a new tag release

yarn build-storybook
yarn ghpages
yarn release

NPM

https://www.npmjs.com/package/@xtreamr/xtreamr-components

Folder structure

  • src
    • index.js (to expose the components library)
    • settings
      • variables.css
      • themes.css
    • components
      • name
        • name.js
        • name.css
        • name.stories.md
    • enhancers
      • withVerb.js
    • services
      • Service
        • ServiceActions.js
        • ServiceReducer.js
        • ServiceSelectors.js
        • ServiceService.js
        • ServiceSignals.js
        • index.js (to export the above files)  

How to write components

  1. We export all components in src/index to then expose the component for npm
  • if a component ins't exported here is not possible to use from '@xtreamr/xtreamr-components' dependency
  • Importing components: import { ComponentName, ... } form '@xtreamr/xtreamr-components'
  1. Create a folder with the name of the component and into should have
  • Component.js
  • Component.css
  • Component.stories.js
  1. At least all components should define this props:
  • id (should be placed in the wrapper element and also in all elements with events)
  • className (overwrite the default className)
  • extraClass (this add a extra class but not delete the default class of the component)
  1. Context class
  • Context class should be placed in the wrapper element
  • Should have the same name of the component but with "-" instead camelcase
  • Should have the prefix "xt-"
  • xt-[context-class-name]
  1. Elements that are into the component
  • Should be a class with the same name of the context class + their name
  • xt-[context-class-name]-[element-name]
  • Same if a element contains elements
  • xt-[context-class-name]-[element-name]-[element-name-deep]
  1. Modificators or status classes
  • No context and no prefix
  • In the css file should be ever defined toguether with a context class o element class
  • .xt-context-class.positive or xt-context-class-element.hover
  1. All css variables are defined into: settings/variables
  • We use role name variables https://fixate.it/blog/make-your-css-variable-names-suck-less/
  • Into components you can define local variables for overwrite the globals.
  • .button { --clrMinButton: var(--clrMin, #fafafb); }
  1. Components position rules
  • Components never define their position into the dom
  • Avoid use of: margin, position, flex...
  • Should be flexible for fit into all contexts
  • Components define the position and margin of their children elements

Icons

  • The icons are autogenerated using the script:
  • Use svgo for compress the svg and svgr for make the IconComponent

How to add icons

  1. Place into assets/icons the svg file
  2. Name svg file: inco[Name].sg
  3. Expose the new icons generated on src/index.js
  • Use this command for make the magic
yarn icons
  • The svg name is use for name the component icon generated
  • Icons are generated inton icons/
  • Svgr use the file icon.template.js to create the icons

Services

Usually we make services with redux or tokbox. The cicle of redux is ever the same:

  • UI event -> dispatch action -> reducer change the state -> render with new state

But, tokbox use signals and our applicatios are listening that signals and in some cases the signals are dispatching actions. Then, exist this alternative flow:

  • Signal received -> dispatch action -> reducer change the state -> render with new state

Then we have to kind of event to start the redux flow: ui events or signals.

To know

  • Avoid circular dependency between services
  • Avoid ciruclar dependency between service and actions. The service can dispatch actions but action can't use the service.
  • Domain for actions: DOMAIN/ACTION_NAME
  • All API calls should dispatch simple actions: REQUEST action, SUCCESS action and FAIL action describing the request/response flow.

Travis npm package Coveralls

Describe Xtreamr-components here.