2.48.0 • Published 5 years ago

@haaretz/htz-components v2.48.0

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
5 years ago

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.

2.48.0

5 years ago

2.47.0

5 years ago

2.46.0

5 years ago

2.45.0

5 years ago

2.43.0

5 years ago

2.42.1

5 years ago

2.39.3

5 years ago

2.39.2

5 years ago

2.39.1

5 years ago

2.38.0

5 years ago

2.37.0

5 years ago

2.36.1

5 years ago

2.36.0

5 years ago

2.35.0

5 years ago

2.34.0

5 years ago

2.33.0

5 years ago

2.32.1

5 years ago

2.31.0

5 years ago

2.29.1

5 years ago

2.29.0

5 years ago

2.28.3

5 years ago

2.28.2

5 years ago

2.28.1

5 years ago

2.28.0

5 years ago

2.27.0

5 years ago

2.26.0

5 years ago

2.24.1

5 years ago

2.24.0

5 years ago

2.23.3

5 years ago

2.23.2

5 years ago

2.23.1

5 years ago

2.22.0

5 years ago

2.21.0

5 years ago

2.20.1

5 years ago

2.20.0

5 years ago

2.17.0

5 years ago

2.16.2

5 years ago

2.16.1

5 years ago

2.16.0

5 years ago

2.15.5

5 years ago

2.15.4

5 years ago

2.15.3

5 years ago

2.15.2

5 years ago

2.15.1

5 years ago

2.15.0

5 years ago

2.14.0

5 years ago

2.13.0

5 years ago

2.12.2

5 years ago

2.12.1

5 years ago

2.12.0

5 years ago

2.11.0

5 years ago

2.10.0

5 years ago

2.9.3

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago

2.8.0

5 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.3

5 years ago

2.1.1

5 years ago

1.0.0

5 years ago

0.2.0

7 years ago

0.1.0

7 years ago