9.13.4 • Published 2 years ago

@meundies/loom v9.13.4

Weekly downloads
378
License
-
Repository
github
Last release
2 years ago

MeUndies Loom

Maintainability Test Coverage CircleCI Storybook npm (scoped)

https://meundies.github.io/loom https://loom.meundies.dev

Weaving MeUndies, one thread at a time.

Getting Started

To start, download and clone this repository, then install dependencies using yarn.

New components can be developed in storybook. Use yarn run storybook to start the storybook server. Each new component should contain stories and be properly tested using enzyme.

New sub-directories will need to be whitelisted in package.json under the files object, or they will be pruned during the build process.

Component Conventions

For component development, we use the following conventions:

  1. No default exports.
  2. Pass the className prop to components, so that style extensions and overrides work reliably on all components.
  3. For interactive components, include an interactive example.
  4. Interactive components should be keyboard accessible. Use the a11y tab to check for common issues.
  5. Tests should at a minimum contain the following three tests:
    1. no default export
    2. properly named export
    3. a "normal" render snapshot
  6. Use mount or render for snapshot testing, so that our tools recognize different prop combinations for code coverage.
  7. Connect the component to Zeplin by adding to .zeplin/components.json. zeplin connect is run in CI and pulls from our this json file to sync Zeplin and Storybook to our codebase whenever we merge to master. 1. Documentation: https://github.com/zeplin/connected-components-docs 1. path key maps the component to our codebase 1. zeplinNames key maps it to Zeplin ( ) 1. storybook key maps it to Storybook https://github.com/zeplin/connected-components-docs/blob/master/docs/link/STORYBOOK.md

Contributing

This project follows the angular commit message guidelines. For more information, see here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit

Using the package from npm

In your project, install using yarn add @meundies/loom. Components can be used as such:

import { Button } from '@meundies/loom/components'

Configuring Fonts

Next, configure your fonts by declaring your body and header font familys as css variables, following the examples below. You may also use ./storybook/preview-head.html as a reference as well.

` :root { --font-family-body: 'ProximaNova'; --font-family-header: 'SharpSansNo1'; }

@font-face { ...body font } @font-face { ...header font } `

Note: loom is configured to use bold over 600 for bold fonts. For best browser compatibility, define your bold fonts to use font-weight: bold instead of font-weight: 600. Doing the later can result in inconsistent font weights across Chrome and Firefox.

Consuming Loom components

The safest way to consume and modify Loom components is to use the props built in to the component. These are tested and work as intended.

However, there may be cases where you may need to style Loom components beyond what we have natively exposed. Loom components are made using styled-components and follow their best practices so that styled(LoomComponent) and other re-styling syntaxes are facilitated.

https://styled-components.com/docs/basics#styling-any-component https://styled-components.com/docs/advanced#styling-normal-react-components

Examples of CSS properties that you might commonly use to extend our components are: position, margin, padding, opacity.

Using the package locally

We recommend using yalc for local development. It accurately reproduces the build and package process used by NPM, and should also be able to share the package between different node versions you have installed locally.

Testing

To test changes, run yarn test. Components are tested using Jest and Enzyme. Snapshots will be generated when a new test is first run. When a component is changed, snapshots can be updated using yarn run test:jest -u.

A note on dependencies

All dependencies will likely fall into two buckets - peerDependencies or devDependencies.

peerDependencies

These are dependencies that the consumer must install, and are required for this package to work. Some examples are react and react-dom - both libraries are not included with loom, but are required for loom to run. When updating these packages, it also requires the client to update their version as well.

devDependencies

These are dependencies that are only used for development, which are not used by loom at run time. This includes libraries such as babel, storybook, and typescript.

9.13.4

2 years ago

9.13.3

2 years ago

9.13.2

2 years ago

9.13.0

2 years ago

9.13.1

2 years ago

9.12.0

3 years ago

9.11.1

3 years ago

9.11.0

3 years ago

9.10.2

3 years ago

9.8.1

3 years ago

9.8.0

3 years ago

9.9.0

3 years ago

9.9.1

3 years ago

9.10.0

3 years ago

9.10.1

3 years ago

9.7.1

3 years ago

9.5.0

3 years ago

9.6.0

3 years ago

9.7.0

3 years ago

9.3.1

4 years ago

9.3.0

4 years ago

9.2.0

4 years ago

9.1.0

4 years ago

9.0.0

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.0.0

4 years ago

7.2.3

4 years ago

7.2.2

4 years ago

7.2.1

4 years ago

7.2.0

4 years ago

7.0.0

4 years ago

7.1.0

4 years ago

6.0.0

4 years ago

5.33.0

4 years ago

5.32.0

4 years ago

5.31.0

4 years ago

5.30.2

4 years ago

5.29.0

4 years ago

5.28.0

4 years ago

5.27.0

4 years ago

5.26.0

4 years ago

5.25.0

4 years ago

5.24.0

4 years ago

5.23.0

4 years ago

5.22.0

4 years ago

5.21.0

5 years ago

5.20.0

5 years ago

5.19.0

5 years ago

5.18.0

5 years ago

5.17.0

5 years ago

5.16.4

5 years ago

5.16.3

5 years ago

5.16.2

5 years ago

5.16.1

5 years ago

5.16.0

5 years ago

5.15.2

5 years ago

5.15.1

5 years ago

5.15.0

5 years ago

5.14.0

5 years ago

5.13.0

5 years ago

5.12.0

5 years ago

5.11.0

5 years ago

5.10.0

5 years ago

5.9.1

5 years ago

5.9.0

5 years ago

5.8.0

5 years ago

5.7.0

5 years ago

5.6.0

5 years ago

5.5.0

5 years ago

5.4.0

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.0

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.19.0

5 years ago

3.17.0

5 years ago

3.18.0

5 years ago

3.15.0

5 years ago

3.16.0

5 years ago

3.14.0

5 years ago

3.13.0

5 years ago

3.12.0

5 years ago

3.11.1

5 years ago

3.11.0

5 years ago

3.10.0

5 years ago

3.9.0

5 years ago

3.8.0

5 years ago

3.7.1

5 years ago

3.7.0

5 years ago

3.6.2

5 years ago

3.6.1

5 years ago

3.6.0

5 years ago

3.5.2

5 years ago

3.5.1

5 years ago

3.4.0

5 years ago

3.5.0

5 years ago

3.3.0

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

1.19.1

5 years ago

2.0.0

5 years ago

1.19.0

5 years ago

1.18.1

5 years ago

1.18.0

5 years ago

1.17.0

5 years ago

1.15.0

5 years ago

1.16.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.9.0

5 years ago

1.10.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.2.0

6 years ago

1.3.0

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago