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 +3 -1
- package/dist/cjs/index.js +42 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Delete/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/TextArea/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +2 -0
- package/dist/cjs/types/interfaces/atomProps.d.ts +9 -0
- package/dist/esm/index.js +41 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Delete/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/TextArea/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +2 -0
- package/dist/esm/types/interfaces/atomProps.d.ts +9 -0
- package/dist/index.d.ts +14 -1
- package/package.json +27 -26
@@ -7,3 +7,5 @@ export { default as Box } from './Box';
|
|
7
7
|
export { default as Title } from './Title';
|
8
8
|
export { default as Icon } from './Icon';
|
9
9
|
export { default as Input } from './Input';
|
10
|
+
export { default as TextArea } from './TextArea';
|
11
|
+
export { default as Delete } from './Delete';
|
@@ -85,4 +85,13 @@ export interface InputProps extends BasicProps {
|
|
85
85
|
onClick?: () => void;
|
86
86
|
onChange?: () => void;
|
87
87
|
}
|
88
|
+
export interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
|
89
|
+
cols?: number;
|
90
|
+
rows?: number;
|
91
|
+
isFixedSize?: boolean;
|
92
|
+
}
|
93
|
+
export interface DeleteProps extends BasicProps {
|
94
|
+
size?: Exclude<basicSizeType, 'is-normal'>;
|
95
|
+
onClick?: () => void;
|
96
|
+
}
|
88
97
|
export {};
|
package/dist/esm/index.js
CHANGED
@@ -2921,21 +2921,21 @@ const Tag = ({ text, testId = null, style = null, color = null, isLight = null,
|
|
2921
2921
|
});
|
2922
2922
|
return withAddon ? (React.createElement("section", { "data-testid": _testId, style: style !== null && style !== void 0 ? style : undefined, className: tagsWrapperClasses },
|
2923
2923
|
React.createElement("span", { className: tagClasses }, text),
|
2924
|
-
withDelete ? (React.createElement("a", { "data-testid": `${_testId}-delete`, className: 'tag is-delete', onClick: onDeleteClick
|
2924
|
+
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 },
|
2925
2925
|
text,
|
2926
|
-
withDelete ? (React.createElement("button", { "data-testid": `${_testId}-delete`, className: 'delete', onClick: onDeleteClick
|
2926
|
+
withDelete ? (React.createElement("button", { "data-testid": `${_testId}-delete`, className: 'delete', onClick: onDeleteClick !== null && onDeleteClick !== void 0 ? onDeleteClick : undefined })) : null));
|
2927
2927
|
};
|
2928
2928
|
|
2929
2929
|
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;
|
2930
2930
|
|
2931
2931
|
const renderTitleSection = (section) => {
|
2932
|
-
var _a, _b;
|
2932
|
+
var _a, _b, _c;
|
2933
2933
|
const sectionClasses = parseClasses([
|
2934
2934
|
section === null || section === void 0 ? void 0 : section.prop,
|
2935
2935
|
(_a = section === null || section === void 0 ? void 0 : section.size) !== null && _a !== void 0 ? _a : 'is-6',
|
2936
2936
|
(section === null || section === void 0 ? void 0 : section.prop) === 'title' && (section === null || section === void 0 ? void 0 : section.isSpaced) ? 'is-spaced' : null
|
2937
2937
|
]);
|
2938
|
-
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
|
2938
|
+
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;
|
2939
2939
|
};
|
2940
2940
|
const Title = ({ main, secondary }) => (React.createElement(React.Fragment, null,
|
2941
2941
|
renderTitleSection(main),
|
@@ -3007,8 +3007,43 @@ const Input = ({ testId = null, type, text = null, isDisabled = false, isReadonl
|
|
3007
3007
|
tag: 'input',
|
3008
3008
|
parsedClasses: inputClasses
|
3009
3009
|
});
|
3010
|
-
return (React.createElement("input", { "data-testid": _testId, type: type,
|
3010
|
+
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 }));
|
3011
3011
|
};
|
3012
3012
|
|
3013
|
-
|
3013
|
+
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 }) => {
|
3014
|
+
const textAreaClasses = parseClasses([
|
3015
|
+
'textarea',
|
3016
|
+
color,
|
3017
|
+
size,
|
3018
|
+
isHovered ? 'is-hovered' : null,
|
3019
|
+
isFocused ? 'is-focused' : null,
|
3020
|
+
isFixedSize ? 'has-fixed-size' : null
|
3021
|
+
]);
|
3022
|
+
const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3023
|
+
tag: 'textarea',
|
3024
|
+
parsedClasses: textAreaClasses,
|
3025
|
+
rules: [
|
3026
|
+
{
|
3027
|
+
usedRegExp: /textarea/gm,
|
3028
|
+
regExpReplacer: ''
|
3029
|
+
},
|
3030
|
+
{
|
3031
|
+
usedRegExp: /is-|has-/gm,
|
3032
|
+
regExpReplacer: '-'
|
3033
|
+
}
|
3034
|
+
]
|
3035
|
+
});
|
3036
|
+
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 }));
|
3037
|
+
};
|
3038
|
+
|
3039
|
+
const Delete = ({ testId = null, style = null, size = null, onClick = null }) => {
|
3040
|
+
const deleteClasses = parseClasses(['delete', size]);
|
3041
|
+
const _testId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3042
|
+
tag: 'delete',
|
3043
|
+
parsedClasses: deleteClasses
|
3044
|
+
});
|
3045
|
+
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 }));
|
3046
|
+
};
|
3047
|
+
|
3048
|
+
export { Block, Box, Button, Column, Delete, Icon, Input, ProgressBar, Tag, TextArea, Title };
|
3014
3049
|
//# sourceMappingURL=index.js.map
|