reactive-bulma 1.14.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +22 -17
- package/dist/cjs/index.js +38 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Input/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +1 -0
- package/dist/cjs/types/interfaces/atomProps.d.ts +20 -6
- package/dist/cjs/types/types/domTypes.d.ts +1 -0
- package/dist/cjs/types/types/styleTypes.d.ts +2 -2
- package/dist/esm/index.js +38 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Input/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +1 -0
- package/dist/esm/types/interfaces/atomProps.d.ts +20 -6
- package/dist/esm/types/types/domTypes.d.ts +1 -0
- package/dist/esm/types/types/styleTypes.d.ts +2 -2
- package/dist/index.d.ts +25 -8
- package/package.json +2 -2
package/README.md
CHANGED
@@ -29,20 +29,20 @@ Component library based on React, Bulma, Typescript and Rollup
|
|
29
29
|
|
30
30
|
## Status
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
32
|
+
![Npm Version][badge-npm-version]
|
33
|
+
![Npm Bundle Size][badge-npm-size]
|
34
|
+
![Npm Downloads][badge-npm-downloads]
|
35
|
+
[![Netlify Status][badge-netlify-status]][link-netlify-status]
|
36
|
+
[![Code Coverage][badge-code-coverage]][link-code-coverage]
|
37
|
+
[![Quality Gate Status][badge-soundcloud-quality]][link-soundcloud-status]
|
38
|
+
[![Maintainability Rating][badge-soundcloud-maintanibility]][link-soundcloud-status]
|
39
|
+
[![Security Rating][badge-soundcloud-security]][link-soundcloud-status]
|
40
|
+
[![Technical Debt][badge-soundcloud-tech-debt]][link-soundcloud-status]
|
41
|
+
[![Known Vulnerabilities][badge-snyk-status]][link-snyk-status]
|
42
|
+
![GitHub Repo stars][badge-github-repo-stars]
|
43
|
+
![GitHub commit activity][badge-github-commits]
|
44
|
+
![GitHub last commit][badge-github-last-commit]
|
45
|
+
[![Semantic Commits][badge-semantic-commits]][link-semantic-commits]
|
46
46
|
|
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
|
@@ -68,10 +68,11 @@ Component library based on React, Bulma, Typescript and Rollup
|
|
68
68
|
|
69
69
|
![react dependency][badge-dependency-react]
|
70
70
|
![bulma dependency][badge-dependency-bulma]
|
71
|
+
![material design dependency][badge-dependency-material-design]
|
71
72
|
![typescript dependency][badge-dependency-typescript]
|
72
73
|
![rollup dependency][badge-dependency-rollup]
|
73
74
|
![storybook dependency][badge-dependency-storybook]
|
74
|
-
![semantic
|
75
|
+
![semantic release dependency][badge-dependency-semantic-release]
|
75
76
|
![babel dependency][badge-dependency-babel]
|
76
77
|
![jest dependency][badge-dependency-jest]
|
77
78
|
![react testing library dependency][badge-dependency-react-testing]
|
@@ -81,9 +82,10 @@ Component library based on React, Bulma, Typescript and Rollup
|
|
81
82
|
|
82
83
|
[badge-dependency-react]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/react/main?logo=react
|
83
84
|
[badge-dependency-bulma]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/bulma/main?logo=bulma
|
85
|
+
[badge-dependency-material-design]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/@mdi/font/main?logo=materialdesignicons
|
84
86
|
[badge-dependency-typescript]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/typescript/main?logo=typescript
|
85
87
|
[badge-dependency-rollup]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/rollup/main?logo=rollup.js
|
86
|
-
[badge-dependency-storybook]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev
|
88
|
+
[badge-dependency-storybook]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/storybook/main?logo=storybook
|
87
89
|
[badge-dependency-semantic-release]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/semantic-release/main?logo=semantic-release
|
88
90
|
[badge-dependency-babel]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/@babel/core/main?logo=babel
|
89
91
|
[badge-dependency-jest]: https://img.shields.io/github/package-json/dependency-version/nicolasomar/reactive-bulma/dev/jest/main?logo=jest
|
@@ -107,7 +109,10 @@ In case you have cloned the repo, it will show you the following folders:
|
|
107
109
|
- `.husky:` Dedicated to [Husky](https://typicode.github.io/husky/) configuration files.
|
108
110
|
- `.storybook:` Dedicated to [Storybook](https://storybook.js.org/) configuration files.
|
109
111
|
- `src:`
|
110
|
-
- `components:` Location of all used components, using [Atomic Design hierarchy structure](https://atomicdesign.bradfrost.com/chapter-2/)
|
112
|
+
- `components:` Location of all used components, using [Atomic Design hierarchy structure](https://atomicdesign.bradfrost.com/chapter-2/)
|
113
|
+
- `atoms` (from `v1.0.0`).
|
114
|
+
- `molecules` (from `v2.0.0`).
|
115
|
+
- `organisms` (from `v3.0.0`).
|
111
116
|
|
112
117
|
## Documentation
|
113
118
|
|
package/dist/cjs/index.js
CHANGED
@@ -2886,7 +2886,7 @@ const Column = ({ testId = null, style = null, size = null, offset = null, isNar
|
|
2886
2886
|
isNarrow ? 'is-narrow' : null
|
2887
2887
|
]);
|
2888
2888
|
const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'column', parsedClasses: columnClasses });
|
2889
|
-
return (React.createElement("section", { "data-testid": _testId, className: columnClasses, style: style
|
2889
|
+
return (React.createElement("section", { "data-testid": _testId, className: columnClasses, style: style !== null && style !== void 0 ? style : undefined }, children));
|
2890
2890
|
};
|
2891
2891
|
|
2892
2892
|
const ProgressBar = ({ value = 0, max = 100, testId = null, style = null, color = 'is-primary', size = null, isLoading = false }) => {
|
@@ -2899,7 +2899,7 @@ const ProgressBar = ({ value = 0, max = 100, testId = null, style = null, color
|
|
2899
2899
|
return (React.createElement("progress", { "data-testid": _testId, className: progressClasses, style: style !== null && style !== void 0 ? style : undefined, value: isLoading ? undefined : value, max: max }, `${isLoading ? 0 : fixedValue}%`));
|
2900
2900
|
};
|
2901
2901
|
|
2902
|
-
const Block = ({ testId = 'test-block', style = null, children = null }) => children ? (React.createElement("section", { "data-testid": testId, className: 'block', style: style
|
2902
|
+
const Block = ({ testId = 'test-block', style = null, children = null }) => children ? (React.createElement("section", { "data-testid": testId, className: 'block', style: style !== null && style !== void 0 ? style : undefined }, children)) : null;
|
2903
2903
|
|
2904
2904
|
const Tag = ({ text, testId = null, style = null, color = null, isLight = null, isRounded = null, size = null, withDelete = false, withAddon = false, addonText = null, addonColor = null, onDeleteClick = null }) => {
|
2905
2905
|
const tagLabel = withAddon ? 'tags' : 'tag';
|
@@ -2921,14 +2921,14 @@ const Tag = ({ text, testId = null, style = null, color = null, isLight = null,
|
|
2921
2921
|
parsedClasses: withAddon ? tagsWrapperClasses : tagClasses,
|
2922
2922
|
separator: withAddon ? '-' : ''
|
2923
2923
|
});
|
2924
|
-
return withAddon ? (React.createElement("section", { "data-testid": _testId, style: style
|
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
|
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 },
|
2927
2927
|
text,
|
2928
2928
|
withDelete ? (React.createElement("button", { "data-testid": `${_testId}-delete`, className: 'delete', onClick: onDeleteClick || undefined })) : null));
|
2929
2929
|
};
|
2930
2930
|
|
2931
|
-
const Box = ({ testId = 'test-box', style = null, children = null }) => children ? (React.createElement("section", { "data-testid": testId, className: 'box', style: style
|
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
2934
|
var _a, _b;
|
@@ -2950,7 +2950,21 @@ var IconSizeEnum;
|
|
2950
2950
|
IconSizeEnum[IconSizeEnum["is-large"] = 48] = "is-large";
|
2951
2951
|
})(IconSizeEnum || (IconSizeEnum = {}));
|
2952
2952
|
|
2953
|
-
const generateIconContainer = (icon, color) =>
|
2953
|
+
const generateIconContainer = (icon, color) => {
|
2954
|
+
var _a;
|
2955
|
+
const containerClasses = color ? `icon-text-${color}` : 'icon-text';
|
2956
|
+
const containerTestId = parseTestId({
|
2957
|
+
tag: 'icon-container',
|
2958
|
+
parsedClasses: (_a = color === null || color === void 0 ? void 0 : color.toString()) !== null && _a !== void 0 ? _a : '',
|
2959
|
+
rules: [
|
2960
|
+
{
|
2961
|
+
usedRegExp: /has-text/gm,
|
2962
|
+
regExpReplacer: ''
|
2963
|
+
}
|
2964
|
+
]
|
2965
|
+
});
|
2966
|
+
return (React.createElement("span", { "data-testid": containerTestId, className: containerClasses }, icon));
|
2967
|
+
};
|
2954
2968
|
const Icon = ({ iconLabel, testId = null, text = null, style = null, color = null, size = null, colorMode = null, isSpinning = false }) => {
|
2955
2969
|
const iconSpanClasses = parseClasses(['icon', color, size]);
|
2956
2970
|
const iconClasses = parseClasses([
|
@@ -2976,17 +2990,34 @@ const Icon = ({ iconLabel, testId = null, text = null, style = null, color = nul
|
|
2976
2990
|
separator: '-'
|
2977
2991
|
});
|
2978
2992
|
const _internalTestId = `${_testId}-i`;
|
2979
|
-
const iconComponent = (React.createElement("span", { "data-testid": _testId, style: style
|
2993
|
+
const iconComponent = (React.createElement("span", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: iconSpanClasses },
|
2980
2994
|
React.createElement("i", { "data-testid": _internalTestId, className: iconClasses }),
|
2981
2995
|
text ? React.createElement("span", null, text) : null));
|
2982
2996
|
return text ? generateIconContainer(iconComponent, color) : iconComponent;
|
2983
2997
|
};
|
2984
2998
|
|
2999
|
+
const Input = ({ testId = null, type, text = null, isDisabled = false, isReadonly = false, style = null, color = null, size = null, isRounded = null, isHovered = null, isFocused = null, onClick = null, onChange = null }) => {
|
3000
|
+
const inputClasses = parseClasses([
|
3001
|
+
'input',
|
3002
|
+
color,
|
3003
|
+
size,
|
3004
|
+
isRounded ? 'is-rounded' : null,
|
3005
|
+
isHovered ? 'is-hovered' : null,
|
3006
|
+
isFocused ? 'is-focused' : null
|
3007
|
+
]);
|
3008
|
+
const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3009
|
+
tag: 'input',
|
3010
|
+
parsedClasses: inputClasses
|
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 }));
|
3013
|
+
};
|
3014
|
+
|
2985
3015
|
exports.Block = Block;
|
2986
3016
|
exports.Box = Box;
|
2987
3017
|
exports.Button = Button;
|
2988
3018
|
exports.Column = Column;
|
2989
3019
|
exports.Icon = Icon;
|
3020
|
+
exports.Input = Input;
|
2990
3021
|
exports.ProgressBar = ProgressBar;
|
2991
3022
|
exports.Tag = Tag;
|
2992
3023
|
exports.Title = Title;
|