reactive-bulma 1.17.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from '../../../interfaces/atomProps';
3
+ declare const Button: React.FC<ButtonProps>;
4
+ export default Button;
@@ -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;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SelectProps } from '../../../interfaces/atomProps';
3
+ declare const Select: React.FC<SelectProps>;
4
+ export default Select;
@@ -9,3 +9,5 @@ export { default as Icon } from './Icon';
9
9
  export { default as Input } from './Input';
10
10
  export { default as TextArea } from './TextArea';
11
11
  export { default as Delete } from './Delete';
12
+ export { default as Select } from './Select';
13
+ export { default as File } from './File';
@@ -0,0 +1,38 @@
1
+ export declare enum columnSiteEnum {
2
+ 'is-three-quarters' = 0,
3
+ 'is-two-thirds' = 1,
4
+ 'is-half' = 2,
5
+ 'is-one-third' = 3,
6
+ 'is-one-quarter' = 4,
7
+ 'is-full' = 5,
8
+ 'is-four-fifths' = 6,
9
+ 'is-three-fifths' = 7,
10
+ 'is-two-fifths' = 8,
11
+ 'is-one-fifth' = 9,
12
+ 'is-1' = 10,
13
+ 'is-2' = 11,
14
+ 'is-3' = 12,
15
+ 'is-4' = 13,
16
+ 'is-5' = 14,
17
+ 'is-6' = 15,
18
+ 'is-7' = 16,
19
+ 'is-8' = 17,
20
+ 'is-9' = 18,
21
+ 'is-10' = 19,
22
+ 'is-11' = 20,
23
+ 'is-12' = 21
24
+ }
25
+ export declare enum columnOffsetEnum {
26
+ 'is-offset-1' = 0,
27
+ 'is-offset-2' = 1,
28
+ 'is-offset-3' = 2,
29
+ 'is-offset-4' = 3,
30
+ 'is-offset-5' = 4,
31
+ 'is-offset-6' = 5,
32
+ 'is-offset-7' = 6,
33
+ 'is-offset-8' = 7,
34
+ 'is-offset-9' = 8,
35
+ 'is-offset-10' = 9,
36
+ 'is-offset-11' = 10,
37
+ 'is-offset-12' = 11
38
+ }
@@ -0,0 +1,3 @@
1
+ import { ParseTestIdProps } from '../interfaces/functionProps';
2
+ export declare const parseClasses: (_classes: Array<string | null>) => string;
3
+ export declare const parseTestId: (config: ParseTestIdProps) => string;
@@ -94,4 +94,31 @@ export interface DeleteProps extends BasicProps {
94
94
  size?: Exclude<basicSizeType, 'is-normal'>;
95
95
  onClick?: () => void;
96
96
  }
97
+ export interface SelectOption {
98
+ id: string | number;
99
+ name: string;
100
+ selected?: boolean;
101
+ }
102
+ export interface SelectProps extends BasicProps {
103
+ options?: SelectOption[];
104
+ showOptions?: number;
105
+ isMultiple?: boolean;
106
+ color?: basicColorType;
107
+ size?: basicSizeType;
108
+ isRounded?: boolean;
109
+ isHovered?: boolean;
110
+ isFocused?: boolean;
111
+ onClick?: () => void;
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
+ }
97
124
  export {};
package/dist/esm/index.js CHANGED
@@ -3045,5 +3045,57 @@ const Delete = ({ testId = null, style = null, size = null, onClick = null }) =>
3045
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
3046
  };
3047
3047
 
3048
- export { Block, Box, Button, Column, Delete, Icon, Input, ProgressBar, Tag, TextArea, Title };
3048
+ const Select = ({ testId = null, showOptions = 1, options = [], isMultiple = false, color = null, size = null, isRounded = null, isHovered = null, isFocused = null, onClick = null }) => {
3049
+ const selectClasses = parseClasses([
3050
+ 'select',
3051
+ color,
3052
+ size,
3053
+ isMultiple ? 'is-multiple' : null,
3054
+ isRounded ? 'is-rounded' : null,
3055
+ isHovered ? 'is-hovered' : null,
3056
+ isFocused ? 'is-focused' : null
3057
+ ]);
3058
+ const selectTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
3059
+ tag: 'select',
3060
+ parsedClasses: selectClasses
3061
+ });
3062
+ return (React.createElement("section", { "data-testid": `${selectTestId}-container`, className: selectClasses },
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
+ };
3065
+
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 };
3049
3101
  //# sourceMappingURL=index.js.map