reactive-bulma 1.18.0 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -21
- package/README.md +196 -192
- package/dist/cjs/index.js +35 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Checkbox/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/File/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +1 -0
- package/dist/cjs/types/interfaces/atomProps.d.ts +16 -0
- package/dist/esm/index.js +35 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Checkbox/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/File/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +1 -0
- package/dist/esm/types/interfaces/atomProps.d.ts +16 -0
- package/dist/index.d.ts +14 -1
- package/package.json +106 -106
- package/dist/cjs/types/components/atoms/Button/Button.d.ts +0 -4
- package/dist/cjs/types/enums/styleEnums.d.ts +0 -38
- package/dist/cjs/types/functions/persers.d.ts +0 -3
- package/dist/esm/types/components/atoms/Button/Button.d.ts +0 -4
- package/dist/esm/types/enums/styleEnums.d.ts +0 -38
- package/dist/esm/types/functions/persers.d.ts +0 -3
@@ -110,4 +110,20 @@ export interface SelectProps extends BasicProps {
|
|
110
110
|
isFocused?: boolean;
|
111
111
|
onClick?: () => void;
|
112
112
|
}
|
113
|
+
export interface FileProps extends BasicProps {
|
114
|
+
fileName?: string;
|
115
|
+
uploadIcon?: IconProps;
|
116
|
+
uploadText?: string;
|
117
|
+
buttonOnRight?: boolean;
|
118
|
+
isFullWidth?: boolean;
|
119
|
+
isBoxed?: boolean;
|
120
|
+
color?: basicColorType;
|
121
|
+
size?: basicSizeType;
|
122
|
+
onClick?: () => void;
|
123
|
+
}
|
124
|
+
export interface CheckboxProps extends BasicProps {
|
125
|
+
content?: string | React.ReactElement;
|
126
|
+
isDisabled?: boolean;
|
127
|
+
onChange?: () => void;
|
128
|
+
}
|
113
129
|
export {};
|
package/dist/esm/index.js
CHANGED
@@ -3063,5 +3063,39 @@ const Select = ({ testId = null, showOptions = 1, options = [], isMultiple = fal
|
|
3063
3063
|
React.createElement("select", { multiple: isMultiple, size: showOptions, "data-testid": selectTestId }, options.map(({ id, name, selected }, i) => (React.createElement("option", { "data-testid": `${selectTestId}-option-${i}`, key: id.toString(), selected: selected !== null && selected !== void 0 ? selected : false, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined }, name))))));
|
3064
3064
|
};
|
3065
3065
|
|
3066
|
-
|
3066
|
+
const File = ({ testId = null, fileName = null, uploadIcon = { iconLabel: 'upload' }, uploadText = 'Choose a file…', style = null, buttonOnRight = false, isFullWidth = false, isBoxed = false, color = null, size = null, onClick = null }) => {
|
3067
|
+
const fileClasses = parseClasses([
|
3068
|
+
'file',
|
3069
|
+
fileName ? 'has-name' : null,
|
3070
|
+
buttonOnRight ? 'is-right' : null,
|
3071
|
+
isFullWidth ? 'is-fullwidth' : null,
|
3072
|
+
isBoxed ? 'is-boxed' : null,
|
3073
|
+
color,
|
3074
|
+
size
|
3075
|
+
]);
|
3076
|
+
const fileTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3077
|
+
tag: 'file',
|
3078
|
+
parsedClasses: fileClasses,
|
3079
|
+
rules: [
|
3080
|
+
{
|
3081
|
+
usedRegExp: /has/gm,
|
3082
|
+
regExpReplacer: '-has'
|
3083
|
+
},
|
3084
|
+
{
|
3085
|
+
usedRegExp: /is|file/gm,
|
3086
|
+
regExpReplacer: ''
|
3087
|
+
}
|
3088
|
+
]
|
3089
|
+
});
|
3090
|
+
const fileInputTestId = `${fileTestId}-input`;
|
3091
|
+
return (React.createElement("section", { "data-testid": fileTestId, className: fileClasses, style: style !== null && style !== void 0 ? style : undefined },
|
3092
|
+
React.createElement("label", { className: 'file-label' },
|
3093
|
+
React.createElement("input", { "data-testid": fileInputTestId, className: 'file-input', type: 'file', name: 'resume', onClick: onClick !== null && onClick !== void 0 ? onClick : undefined }),
|
3094
|
+
React.createElement("span", { className: 'file-cta' },
|
3095
|
+
uploadIcon ? React.createElement(Icon, Object.assign({}, uploadIcon)) : null,
|
3096
|
+
React.createElement("span", { className: 'file-label' }, uploadText)),
|
3097
|
+
fileName ? React.createElement("span", { className: 'file-name' }, fileName) : null)));
|
3098
|
+
};
|
3099
|
+
|
3100
|
+
export { Block, Box, Button, Column, Delete, File, Icon, Input, ProgressBar, Select, Tag, TextArea, Title };
|
3067
3101
|
//# sourceMappingURL=index.js.map
|