reactive-bulma 1.15.0 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -31,7 +31,7 @@ Component library based on React, Bulma, Typescript and Rollup
31
31
 
32
32
  ![Npm Version][badge-npm-version]
33
33
  ![Npm Bundle Size][badge-npm-size]
34
- ![Npm Downloads][badge-npm-downloads]
34
+ [![Npm Downloads][badge-npm-downloads]][link-npm-downloads]
35
35
  [![Netlify Status][badge-netlify-status]][link-netlify-status]
36
36
  [![Code Coverage][badge-code-coverage]][link-code-coverage]
37
37
  [![Quality Gate Status][badge-soundcloud-quality]][link-soundcloud-status]
@@ -47,6 +47,7 @@ Component library based on React, Bulma, Typescript and Rollup
47
47
  [badge-npm-version]: https://img.shields.io/github/package-json/v/nicolasomar/reactive-bulma?label=npm%20version&logo=npm&labelColor=535353&color=success&style=flat
48
48
  [badge-npm-size]: https://img.shields.io/bundlephobia/min/reactive-bulma?label=bundle%20size&labelColor=535353&logo=npm&style=flat
49
49
  [badge-npm-downloads]: https://img.shields.io/npm/dm/reactive-bulma?label=downloads&labelColor=535353&style=flat&logo=npm
50
+ [link-npm-downloads]: https://www.npmjs.com/package/reactive-bulma?activeTab=versions
50
51
  [badge-netlify-status]: https://api.netlify.com/api/v1/badges/3101f2b5-0e28-4734-b749-ebb0e3e413c6/deploy-status
51
52
  [link-netlify-status]: https://app.netlify.com/sites/reactivebulma/deploys
52
53
  [badge-code-coverage]: https://img.shields.io/codecov/c/github/nicolasomar/reactive-bulma?label=coverage&labelColor=535353&logo=codecov&style=flat
@@ -123,6 +124,7 @@ Reactive bulma's documentation, included in this repo in the root directory, is
123
124
  - Run `npm install` to install the Node.js dependencies, including Storybook (the site builder).
124
125
  - Run `npm start`.
125
126
  - Wait until a new tab opens with url <http://localhost:6006/> in your browser.
127
+ - In case you want to initiate it on the background, you can run `npm run start:off`.
126
128
 
127
129
  Learn more about using `Storybook` by reading its [documentation](https://storybook.js.org/docs/react/get-started/install).
128
130
 
package/dist/cjs/index.js CHANGED
@@ -2923,21 +2923,21 @@ const Tag = ({ text, testId = null, style = null, color = null, isLight = null,
2923
2923
  });
2924
2924
  return withAddon ? (React.createElement("section", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: tagsWrapperClasses },
2925
2925
  React.createElement("span", { className: tagClasses }, text),
2926
- withDelete ? (React.createElement("a", { "data-testid": `${_testId}-delete`, className: 'tag is-delete', onClick: onDeleteClick || undefined })) : (React.createElement("span", { className: addonTagClasses }, addonText)))) : (React.createElement("span", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: tagClasses },
2926
+ withDelete ? (React.createElement("a", { "data-testid": `${_testId}-delete`, className: 'tag is-delete', onClick: onDeleteClick !== null && onDeleteClick !== void 0 ? onDeleteClick : undefined })) : (React.createElement("span", { className: addonTagClasses }, addonText)))) : (React.createElement("span", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: tagClasses },
2927
2927
  text,
2928
- withDelete ? (React.createElement("button", { "data-testid": `${_testId}-delete`, className: 'delete', onClick: onDeleteClick || undefined })) : null));
2928
+ withDelete ? (React.createElement("button", { "data-testid": `${_testId}-delete`, className: 'delete', onClick: onDeleteClick !== null && onDeleteClick !== void 0 ? onDeleteClick : undefined })) : null));
2929
2929
  };
2930
2930
 
2931
2931
  const Box = ({ testId = 'test-box', style = null, children = null }) => children ? (React.createElement("section", { "data-testid": testId, className: 'box', style: style !== null && style !== void 0 ? style : undefined }, children)) : null;
2932
2932
 
2933
2933
  const renderTitleSection = (section) => {
2934
- var _a, _b;
2934
+ var _a, _b, _c;
2935
2935
  const sectionClasses = parseClasses([
2936
2936
  section === null || section === void 0 ? void 0 : section.prop,
2937
2937
  (_a = section === null || section === void 0 ? void 0 : section.size) !== null && _a !== void 0 ? _a : 'is-6',
2938
2938
  (section === null || section === void 0 ? void 0 : section.prop) === 'title' && (section === null || section === void 0 ? void 0 : section.isSpaced) ? 'is-spaced' : null
2939
2939
  ]);
2940
- return section ? (React.createElement("p", { "data-testid": (_b = section === null || section === void 0 ? void 0 : section.testId) !== null && _b !== void 0 ? _b : `${section === null || section === void 0 ? void 0 : section.prop}-test`, className: sectionClasses, style: section.style || undefined }, section === null || section === void 0 ? void 0 : section.text)) : null;
2940
+ return section ? (React.createElement("p", { "data-testid": (_b = section === null || section === void 0 ? void 0 : section.testId) !== null && _b !== void 0 ? _b : `${section === null || section === void 0 ? void 0 : section.prop}-test`, className: sectionClasses, style: (_c = section.style) !== null && _c !== void 0 ? _c : undefined }, section === null || section === void 0 ? void 0 : section.text)) : null;
2941
2941
  };
2942
2942
  const Title = ({ main, secondary }) => (React.createElement(React.Fragment, null,
2943
2943
  renderTitleSection(main),
@@ -3009,16 +3009,53 @@ const Input = ({ testId = null, type, text = null, isDisabled = false, isReadonl
3009
3009
  tag: 'input',
3010
3010
  parsedClasses: inputClasses
3011
3011
  });
3012
- return (React.createElement("input", { "data-testid": _testId, type: type, value: text !== null && text !== void 0 ? text : undefined, disabled: isDisabled, readOnly: isReadonly, style: style !== null && style !== void 0 ? style : undefined, className: inputClasses, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined, onChange: onChange !== null && onChange !== void 0 ? onChange : undefined }));
3012
+ return (React.createElement("input", { "data-testid": _testId, type: type, defaultValue: text !== null && text !== void 0 ? text : undefined, disabled: isDisabled, readOnly: isReadonly, style: style !== null && style !== void 0 ? style : undefined, className: inputClasses, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined, onChange: onChange !== null && onChange !== void 0 ? onChange : undefined }));
3013
+ };
3014
+
3015
+ const TextArea = ({ testId = null, text = null, cols = null, rows = null, isDisabled = false, isReadonly = false, isFixedSize = false, style = null, color = null, size = null, isHovered = null, isFocused = null, onClick = null, onChange = null }) => {
3016
+ const textAreaClasses = parseClasses([
3017
+ 'textarea',
3018
+ color,
3019
+ size,
3020
+ isHovered ? 'is-hovered' : null,
3021
+ isFocused ? 'is-focused' : null,
3022
+ isFixedSize ? 'has-fixed-size' : null
3023
+ ]);
3024
+ const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({
3025
+ tag: 'textarea',
3026
+ parsedClasses: textAreaClasses,
3027
+ rules: [
3028
+ {
3029
+ usedRegExp: /textarea/gm,
3030
+ regExpReplacer: ''
3031
+ },
3032
+ {
3033
+ usedRegExp: /is-|has-/gm,
3034
+ regExpReplacer: '-'
3035
+ }
3036
+ ]
3037
+ });
3038
+ return (React.createElement("textarea", { "data-testid": _testId, defaultValue: text !== null && text !== void 0 ? text : undefined, cols: cols !== null && cols !== void 0 ? cols : undefined, rows: rows !== null && rows !== void 0 ? rows : undefined, disabled: isDisabled, readOnly: isReadonly, style: style !== null && style !== void 0 ? style : undefined, className: textAreaClasses, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined, onChange: onChange !== null && onChange !== void 0 ? onChange : undefined }));
3039
+ };
3040
+
3041
+ const Delete = ({ testId = null, style = null, size = null, onClick = null }) => {
3042
+ const deleteClasses = parseClasses(['delete', size]);
3043
+ const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({
3044
+ tag: 'delete',
3045
+ parsedClasses: deleteClasses
3046
+ });
3047
+ return (React.createElement("button", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: deleteClasses, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined }));
3013
3048
  };
3014
3049
 
3015
3050
  exports.Block = Block;
3016
3051
  exports.Box = Box;
3017
3052
  exports.Button = Button;
3018
3053
  exports.Column = Column;
3054
+ exports.Delete = Delete;
3019
3055
  exports.Icon = Icon;
3020
3056
  exports.Input = Input;
3021
3057
  exports.ProgressBar = ProgressBar;
3022
3058
  exports.Tag = Tag;
3059
+ exports.TextArea = TextArea;
3023
3060
  exports.Title = Title;
3024
3061
  //# sourceMappingURL=index.js.map