8.7.1 • Published 3 years ago

@xtreamr/spark-components v8.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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
  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
  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: incoName.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.

8.7.1

3 years ago

8.5.1

3 years ago

8.5.0

3 years ago

8.4.0

3 years ago

7.1.3

3 years ago

8.3.1

4 years ago

8.3.0

4 years ago

8.2.0

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.0.0

4 years ago

7.1.2

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.4

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.18.13

4 years ago

6.18.12

4 years ago

6.18.11

4 years ago

6.18.10

4 years ago

6.18.9

4 years ago

6.18.7

4 years ago

6.18.6

4 years ago

6.18.5

4 years ago

6.18.4

4 years ago

6.18.3

4 years ago

6.18.2

4 years ago

6.18.1

4 years ago

6.18.0

4 years ago

6.17.0

4 years ago

6.16.0

4 years ago

6.15.1

4 years ago

6.15.0

4 years ago

6.14.0

4 years ago

6.13.0

4 years ago

6.12.8

4 years ago

6.12.7

4 years ago

6.12.6

4 years ago

6.12.4

4 years ago

6.12.3

4 years ago

6.12.2

4 years ago

6.12.1

4 years ago

6.12.0

4 years ago

6.11.0

4 years ago

6.10.1

4 years ago

6.9.0

4 years ago

6.8.0

4 years ago

6.7.1

4 years ago

6.6.0

4 years ago

6.5.1

4 years ago

6.5.0

4 years ago

6.4.1

4 years ago

6.3.0

4 years ago

6.2.0

4 years ago

6.1.2

4 years ago

6.1.1

4 years ago

6.1.0

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

2.17.0

4 years ago

2.16.0

4 years ago

2.15.0

4 years ago

2.14.0

4 years ago

2.13.1

4 years ago

2.13.0

4 years ago

2.12.0

4 years ago

2.11.0

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.1

4 years ago

2.5.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

2.0.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.1

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.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.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.0

5 years ago