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

@eccenca/gui-elements

v24.0.0-rc.4

Published

GUI elements based on other libraries, usable in React application, written in Typescript.

Downloads

310

Readme

eccenca GUI elements

Collection of React elements based on Palantir BlueprintJS and IBM Carbon, used for eccenca Corporate Memory applications.

Usage

Installation

We provide a package via npmjs registry, install it by:

yarn add @eccenca/gui-elements

It could be also included as Git submodule to your projects and used via yarn link or yarn workspaces.

As long as IBM Carbon does not support TypeScript it is necessary to install @types/carbon-components-react as development dependency:

yarn add --dev @types/carbon-components-react

Inclusion

  • To include SCSS styles for all basic components add @import "~@eccenca/gui-elements/index"; into your main SCSS file.
  • To use extensions and special Corporate Memory components the include of @eccenca/gui-elements/extensions and @eccenca/gui-elements/cmem is necessary
  • To include only the default configuration add @import "~@eccenca/gui-elements/src/configuration/variables; into your SCSS file.

Configuration

All configuration variables can be set before importing the full library or the default configuration but for the main changes you should need to change only a few parameters:

  • Basic colors
    • $eccgui-color-primary: color for very important buttons and switches
    • $eccgui-color-primary-contrast: readable text color used on primary color areas
    • $eccgui-color-accent: color for most conformation buttons, links, etc
    • $eccgui-color-accent-contrast: readable text color used on accent color areas
    • $eccgui-color-applicationheader-text
    • $eccgui-color-applicationheader-background
    • $eccgui-color-workspace-text
    • $eccgui-color-workspace-background
  • Basic sizes
    • $eccgui-size-typo-base: size including absolute unit, currently only px is supported
    • $eccgui-size-typo-base-lineheight: only ratio to font size, no unit!
    • $eccgui-size-type-levelratio: ratio without unit! used to calculate different text sizes based on $eccgui-size-typo-base
    • $eccgui-size-block-whitespace: white space between block level elements, currently only px is supported

Development

Branch management

We have 4 types of major branches representing the current state:

  • main: contains the latest official release, only release/* branches will be merged into this branch
  • develop: contains the latest state of development, feature/*, bugfix/* and next branches will be merged into develop
  • next: development tree for an upcoming new major version, it will be merged into develop at some point, feature/*, bugfix/* and release/* branches will be merged into it
  • legacy: development tree for the predecessor of the current major version, only bugfix/* and hotfix/* branches will be merged into it

We allow a few more prefixes for valid branchnames:

  • feature/*: extend functionality, maintain dependencies
  • fix/*, bugfix/*, hotfix/*: fix functionality
  • release/*: branches to finalize releases, also used to publish release candidate packages
  • change/*, temp/*

next and legacy only exist if necessary, otherwise we do not maintain those branches. Merges into main, develop, next and legacy are always managed by pull requests.

Running tests

Run the Jest tests with yarn test, for test coverage information run yarn test:coverage. You can check easily code for code errors by yarn compile (JS/Typescript) and yarn compile-scss (SASS).

If you run Jest tests in your app using our library you need to install @babel/plugin-transform-runtime as development dependeny and add it to your Babel plugins configuration.

Running Storybook

All story source files are kept in the respective components, extensions and cmem folders, using *.stories.tsx file name pattern. Run the storybook by

yarn install
yarn storybook

If you want to include Jest test results into the Storybook, run yarn test:generate-output before yarn storybook. If the stories and the tests share exactly the compononent name in the file names, e.g. Button.stories.tsx and Button., then tests are included automazically when the test output is available. In case the file names cannot match by pattern then test file names need to be configured in the stories:

Default.parameters = {
    jest: "MyTestFile.test.tsx",
};

Naming conventions

  • Use a *Props suffix for component interfaces.
  • Use a *Utils suffix for objects providing helper functions to compoents. Name should start with a lowercase letter.

Don't forget to export them. They need to be available via simple import from @eccenca/gui-elements.

Example: if you have your SimpleComponent then provide at least SimpleComponentProps, maybe simpleComponentUtils.

Use via yalc

If necessary you can use yalc to develop gui elements and your application side by side.

  1. Install yalc globally via npm or yarn
  2. Checkout @eccenca/gui-elements
  3. Inside gui elements folder: yarn build:all && yalc publish --push
  4. Inside your applications folder: yalc add @eccenca/gui-elements
  5. After updates to the gui elements rebuild and update the applications yalc folder: yarn build:all && yalc publish --push (you usually are not required to fire another yalc add in your applications folder)

After you tested the GUI elements package locally you can Clean up your applications folder by yalc remove --all && git checkout -- pakage.json yarn.lock.

Process for pull requests and publishing releases

  1. feature/* and bugfix/* branches are merged into develop via pull request
  2. release/*branch is created from develop via GitHub interface, there will be created a pull request automatically
  3. PR from release branch into main need to be approved
    • this will lead to a published package of the release

License

Apache License, Version 2.0, January 2004