@haaretz/htz-components
Shared UI components for Haaretz React apps
Last updated 4 months ago by eranm6 .
UNLICENSED · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @haaretz/htz-components 
SYNC missed versions from official npm registry.

htz-components

Base components for use in any Haaretz app.

This package contains a set of reusable UI component for Haaretz apps, as well as some generic utilities and consumable prop-types.

Table of Contents

This package provides the core UI framework for Haaretz Apps through a set of themeable React components using Fela as its styling layer.

In addition to the consumable UI components, this package also makes available some helper utils for use within Haaretz apps.

For a list of all components and utils offered by this package, either visit the published styleguide, or run yarn run styleguide within this directory, to fire up a live-server containing all components in the current state of development.

Components source files reside in ./src/components/ and utils are in ./src/utils/.

Development

Reusable PropTypes

PropTypes that may be reused in different components should be placed in their own file under src/propTypes and imported into the different components that use theme. PropTypes that are meant to be used at a base to expand on can be stored in an object, which can then be spread inside the consumer component:

// src/propTypes/myPropType.js
export const myPropType = {
  key1: PropTypes.string,
  key2: PropTypes.number,
}

// src/components/MyComponent.js
import { myPropType, } from '../../propTypes/myPropType';

class MyComponent extends React.Component {
  static propTypes = {
    ...myPropType,
    key2: PropTypes.arrayOf(PropTypes.number), // <- overrides `key2` in `myPropType`
    key3: PropTypes.bool // <- augments `myPropType`
  }

  // ...
}

Testing Fela Components

The src/test-helpers/ dir contains pre-configured helpers for testing Fela components.

Use the felaSnapshotter util generate a JSON snapshot of Fela compnents. In addition, the felaEnzymeRenderer util exports two methods:

  1. felaMount - for mounting a Fela-styled component with Enzyme
  2. felaShallow - for shallow rendering a Fela-styled component with Enzyme.

See Enzyme's APIs for fully rendered (mounted) components and shallow-rendered components.

Icons

Icon components are automatically generated from svg files by a script. See here for instructions on how to create new icons or edit existing ones.

Current Tags

  • 2.48.0                                ...           latest (4 months ago)

65 Versions

  • 2.48.0                                ...           4 months ago
  • 2.47.0                                ...           4 months ago
  • 2.46.0                                ...           4 months ago
  • 2.45.0                                ...           6 months ago
  • 2.43.0                                ...           6 months ago
  • 2.42.1                                ...           7 months ago
  • 2.39.3                                ...           7 months ago
  • 2.39.2                                ...           7 months ago
  • 2.39.1                                ...           7 months ago
  • 2.38.0                                ...           7 months ago
  • 2.37.0                                ...           7 months ago
  • 2.36.1                                ...           7 months ago
  • 2.36.0                                ...           7 months ago
  • 2.35.0                                ...           7 months ago
  • 2.34.0                                ...           7 months ago
  • 2.33.0                                ...           7 months ago
  • 2.32.1                                ...           7 months ago
  • 2.31.0                                ...           7 months ago
  • 2.29.1                                ...           7 months ago
  • 2.29.0                                ...           7 months ago
  • 2.28.3                                ...           7 months ago
  • 2.28.2                                ...           7 months ago
  • 2.28.1                                ...           7 months ago
  • 2.28.0                                ...           7 months ago
  • 2.27.0                                ...           7 months ago
  • 2.26.0                                ...           7 months ago
  • 2.24.1                                ...           7 months ago
  • 2.24.0                                ...           7 months ago
  • 2.23.3                                ...           7 months ago
  • 2.23.2                                ...           7 months ago
  • 2.23.1                                ...           7 months ago
  • 2.22.0                                ...           7 months ago
  • 2.21.0                                ...           7 months ago
  • 2.20.1                                ...           7 months ago
  • 2.20.0                                ...           7 months ago
  • 2.17.0                                ...           10 months ago
  • 2.16.2                                ...           10 months ago
  • 2.16.1                                ...           10 months ago
  • 2.16.0                                ...           10 months ago
  • 2.15.5                                ...           10 months ago
  • 2.15.4                                ...           10 months ago
  • 2.15.3                                ...           10 months ago
  • 2.15.2                                ...           10 months ago
  • 2.15.1                                ...           10 months ago
  • 2.15.0                                ...           10 months ago
  • 2.14.0                                ...           10 months ago
  • 2.13.0                                ...           10 months ago
  • 2.12.2                                ...           10 months ago
  • 2.12.1                                ...           10 months ago
  • 2.12.0                                ...           10 months ago
  • 2.11.0                                ...           10 months ago
  • 2.10.0                                ...           10 months ago
  • 2.9.3                                ...           10 months ago
  • 2.9.2                                ...           10 months ago
  • 2.9.1                                ...           10 months ago
  • 2.8.0                                ...           10 months ago
  • 2.7.2                                ...           10 months ago
  • 2.7.1                                ...           a year ago
  • 2.7.0                                ...           a year ago
  • 2.6.0                                ...           a year ago
  • 2.5.3                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 65
Last Month 67
Dev Dependencies (23)

Copyright 2014 - 2016 © taobao.org |