reactive-bulma 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
- # Reactive bulma ![reactive-bulma version](https://img.shields.io/github/package-json/v/nicolasomar/reactive-bulma?label=npm&logo=npm&labelColor=535353&color=success&style=flat-square) ![reactive-bulma Coverage](https://img.shields.io/codecov/c/github/nicolasomar/reactive-bulma?label=coverage&labelColor=535353&logo=codecov&style=flat-square) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma)
2
- Component library based on React, typescript and bulma
1
+ # Reactive bulma ![reactive-bulma | npm version](https://img.shields.io/github/package-json/v/nicolasomar/reactive-bulma?label=npm&logo=npm&labelColor=535353&color=success&style=flat)
2
+
3
+ ## ![reactive-bulma | code coverage](https://img.shields.io/codecov/c/github/nicolasomar/reactive-bulma?label=coverage&labelColor=535353&logo=codecov&style=flat) [![reactive-bulma | Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma) [![reactive-bulma | Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma) [![reactive-bulma | Security Rating](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma) [![reactive-bulma | Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=NicolasOmar_reactive-bulma&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=NicolasOmar_reactive-bulma)
4
+ Component library based on React, Typescript, Bulma and Rollup
3
5
 
4
6
  ## What do I need?
5
7
  Before cloning this repo, I recommend installing the following software:
@@ -26,8 +28,8 @@ npm run build
26
28
  ## Folder structure
27
29
  Once you have cloned the repo, it will show you the following folders:
28
30
  - `.github:` [Github Actions](https://github.com/features/actions/) files used to run post-merge.commits like unit test coverage collection.
29
- - `.husky:` Dedicated to [Husky](https://typicode.github.io/husky/) git-hook files.
30
- - `.storybook:` Dedicated to [Storybook](https://storybook.js.org/) configuration.
31
+ - `.husky:` Dedicated to [Husky](https://typicode.github.io/husky/) configuration files.
32
+ - `.storybook:` Dedicated to [Storybook](https://storybook.js.org/) configuration files.
31
33
  - `src:`
32
34
  - `components:` Location of all used components, using [Atomic Design hierarchy structure](https://atomicdesign.bradfrost.com/chapter-2/) (`atoms` -> `molecules` -> `organisms`).
33
35
 
@@ -43,7 +45,7 @@ To know more about actual roadmap, please go to section `Find out more` -> `Road
43
45
  I will maintain only one deployable site based on [Storybook](https://storybook.js.org/) with automated [Netlify](https://netlify.com/) deployments with each push to `main` branch. The mentioned site is on section `Find out more` -> `Storybook site`.
44
46
 
45
47
  ## Find out more
46
- | [Roadmap](https://docs.google.com/document/d/1kWX-dDTD-cQUeB_Vbu0K6xRvtHaSA38h76yQnhiCe9U) | [Project Status](https://github.com/users/NicolasOmar/projects/3) | [Storybook site](https://my-pets-storybook.netlify.app/) | [Npm Package](https://www.npmjs.com/package/reactive-bulma)
48
+ | [Roadmap](https://docs.google.com/document/d/1kWX-dDTD-cQUeB_Vbu0K6xRvtHaSA38h76yQnhiCe9U) | [Project Status](https://github.com/users/NicolasOmar/projects/3) | [Storybook site](https://reactivebulma.netlify.app/) | [Npm Package](https://www.npmjs.com/package/reactive-bulma)
47
49
  | :--- | :--- | :--- | :--- |
48
50
  | Document with entire list of stories, splitted by versions | Project board for project status tracking | Site dedicated to show and test all the created components | Public package site in npm
49
51
 
package/dist/cjs/index.js CHANGED
@@ -2840,15 +2840,40 @@ function requireReact_development () {
2840
2840
 
2841
2841
  var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2842
2842
 
2843
- const Button = ({ text = '' }) => (React.createElement("button", { "data-testid": 'test-button', className: 'button' }, text));
2843
+ const parseClasses = (_classes) => _classes.filter(_class => _class).join(' ');
2844
+
2845
+ const Button = ({ text = null, type = 'button', style = null, color = 'is-primary', isLightColor = false, isInvertedColor = false, isOutlined = false, isRounded = false, isLoading = false, isDisabled = false, isStatic = false, size = null, onClick = null }) => {
2846
+ const buttonClasses = parseClasses([
2847
+ 'button',
2848
+ color,
2849
+ isLightColor ? 'is-light' : null,
2850
+ isInvertedColor ? 'is-inverted' : null,
2851
+ isOutlined ? 'is-outlined' : null,
2852
+ isRounded ? 'is-rounded' : null,
2853
+ isLoading ? 'is-loading' : null,
2854
+ isStatic ? 'is-static' : null,
2855
+ size
2856
+ ]);
2857
+ return (React.createElement("button", { "data-testid": 'test-button', type: type, className: buttonClasses, style: style !== null && style !== void 0 ? style : undefined, disabled: isDisabled !== null && isDisabled !== void 0 ? isDisabled : false, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined }, text));
2858
+ };
2844
2859
 
2845
2860
  const Column = ({ size = null, offset = null, isNarrow = false, children = null }) => {
2846
- const classes = ['column', size, offset, isNarrow ? 'is-narrow' : null]
2847
- .filter(_class => _class)
2848
- .join(' ');
2861
+ const classes = parseClasses([
2862
+ 'column',
2863
+ size,
2864
+ offset,
2865
+ isNarrow ? 'is-narrow' : null
2866
+ ]);
2849
2867
  return (React.createElement("section", { "data-testid": 'test-column', className: classes }, children));
2850
2868
  };
2851
2869
 
2870
+ const ProgressBar = ({ value = 0, max = 100, style = null, color = 'is-primary', size = null, isLoading = false }) => {
2871
+ const progressClasses = parseClasses(['progress', color, size]);
2872
+ const fixedValue = value > max || value < 0 ? 0 : value;
2873
+ return (React.createElement("progress", { "data-testid": 'test-progress-bar', className: progressClasses, style: style !== null && style !== void 0 ? style : undefined, value: isLoading ? undefined : value, max: max }, `${isLoading ? 0 : fixedValue}%`));
2874
+ };
2875
+
2852
2876
  exports.Button = Button;
2853
2877
  exports.Column = Column;
2878
+ exports.ProgressBar = ProgressBar;
2854
2879
  //# sourceMappingURL=index.js.map