reactive-bulma 1.18.0 → 1.20.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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CheckboxProps } from '../../../interfaces/atomProps';
3
+ declare const Checkbox: React.FC<CheckboxProps>;
4
+ export default Checkbox;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FileProps } from '../../../interfaces/atomProps';
3
+ declare const File: React.FC<FileProps>;
4
+ export default File;
@@ -10,3 +10,4 @@ export { default as Input } from './Input';
10
10
  export { default as TextArea } from './TextArea';
11
11
  export { default as Delete } from './Delete';
12
12
  export { default as Select } from './Select';
13
+ export { default as File } from './File';
@@ -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
- export { Block, Box, Button, Column, Delete, Icon, Input, ProgressBar, Select, Tag, TextArea, Title };
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