reactive-bulma 1.20.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +25 -20
- package/dist/cjs/index.js +161 -86
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Checkbox/index.d.ts +3 -3
- package/dist/cjs/types/components/atoms/RadioButton/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +2 -0
- package/dist/cjs/types/functions/parsers.d.ts +5 -5
- package/dist/cjs/types/interfaces/atomProps.d.ts +123 -9
- package/dist/cjs/types/interfaces/functionProps.d.ts +2 -2
- package/dist/esm/index.js +160 -87
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Checkbox/index.d.ts +3 -3
- package/dist/esm/types/components/atoms/RadioButton/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +2 -0
- package/dist/esm/types/functions/parsers.d.ts +5 -5
- package/dist/esm/types/interfaces/atomProps.d.ts +123 -9
- package/dist/esm/types/interfaces/functionProps.d.ts +2 -2
- package/dist/index.d.ts +129 -9
- package/package.json +25 -25
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
declare const
|
4
|
-
export default
|
2
|
+
import { CheckBoxProps } from '../../../interfaces/atomProps';
|
3
|
+
declare const CheckBox: React.FC<CheckBoxProps>;
|
4
|
+
export default CheckBox;
|
@@ -11,3 +11,5 @@ export { default as TextArea } from './TextArea';
|
|
11
11
|
export { default as Delete } from './Delete';
|
12
12
|
export { default as Select } from './Select';
|
13
13
|
export { default as File } from './File';
|
14
|
+
export { default as Checkbox } from './Checkbox';
|
15
|
+
export { default as RadioButton } from './RadioButton';
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { ParseTestIdProps } from '../interfaces/functionProps';
|
2
2
|
/**
|
3
|
-
* @param { Array<string | null> } _classes Required
|
3
|
+
* @param { Array<string | null> } _classes `Required`. Array of classNames on `string` (or `null`) values
|
4
4
|
* @returns { string } A single string product of merge all classNames, separated by spaces
|
5
5
|
*/
|
6
|
-
export declare const parseClasses: (_classes: Array<string | null>) => string;
|
6
|
+
export declare const parseClasses: (_classes: Array<string | null | undefined>) => string;
|
7
7
|
/**
|
8
8
|
* @param { ParseTestIdProps } config Configuration object
|
9
|
-
* @param { string } config.tag Required
|
10
|
-
* @param { string } config.parsedClasses Required
|
11
|
-
* @param { {
|
9
|
+
* @param { string } config.tag `Required`. Component tag used between to build the final testId string.
|
10
|
+
* @param { string } config.parsedClasses `Required`. A single string of previously parsed classes what will be joined with `tag` property.
|
11
|
+
* @param { { regExp?: RegExp, replacer?: string }[] } config.rules Optional. An array of objects used with a regular expression to check each case and a replacer for each one, giving oportunity to handle specific cases of component class names.
|
12
12
|
* @returns A single string product of merge all classNames, separated by `separator` value
|
13
13
|
*/
|
14
14
|
export declare const parseTestId: (config: ParseTestIdProps) => string;
|
@@ -2,96 +2,169 @@ import React from 'react';
|
|
2
2
|
import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, basicSizeType, textColorType, titleSizeType } from '../types/styleTypes';
|
3
3
|
import { inputTypes } from '../types/domTypes';
|
4
4
|
interface BasicProps {
|
5
|
+
/** `Attribute` ID used to locate the element in unit test suites (like Jest) */
|
5
6
|
testId?: string;
|
7
|
+
/** `Attribute` *For container case*. ID used to locate the element in unit test suites (like Jest) */
|
8
|
+
containerTestId?: string;
|
9
|
+
/** `Attribute` Custom CSS classes, applicable for specific scenarios */
|
10
|
+
cssClasses?: string;
|
11
|
+
/** `Attribute` *For container case*. Custom CSS classes, applicable for specific scenarios */
|
12
|
+
containerCssClasses?: string;
|
13
|
+
/** `Attribute` Custom styling applicable for specific scenarios */
|
6
14
|
style?: React.CSSProperties;
|
15
|
+
/** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
|
16
|
+
containerStyle?: React.CSSProperties;
|
7
17
|
}
|
8
18
|
export interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
19
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the column */
|
20
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
21
|
+
/** `Styling` Set column's size */
|
9
22
|
size?: columnSizeType;
|
23
|
+
/** `Styling` Set column's offset (moving it as you set its size */
|
10
24
|
offset?: columnOffsetType;
|
25
|
+
/** `Styling` Set if the column only will take the space it needs */
|
11
26
|
isNarrow?: boolean;
|
12
27
|
}
|
13
28
|
export interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<'button'> {
|
29
|
+
/** `Attribute` The text will be shown in the `Button` */
|
14
30
|
text?: string;
|
15
|
-
|
31
|
+
/** `Attribute` Will disable the button */
|
32
|
+
isDisabled?: boolean;
|
33
|
+
/** `Styling` Color based on bulma's color tokens */
|
16
34
|
color?: basicColorType;
|
35
|
+
/** `Styling` Will adjust the selected color with a ligther style */
|
17
36
|
isLightColor?: boolean;
|
37
|
+
/** `Styling` Will invert button's colors (typography in color and background in white or black) */
|
18
38
|
isInvertedColor?: boolean;
|
39
|
+
/** `Styling` Similar to `isInvertedColor`, but button's border will be colored */
|
19
40
|
isOutlined?: boolean;
|
41
|
+
/** `Styling` Will add round borders to button's shape */
|
20
42
|
isRounded?: boolean;
|
43
|
+
/** `Styling` Will change `text` for a animated spinner, but will remain clickeable */
|
21
44
|
isLoading?: boolean;
|
22
|
-
isDisabled
|
45
|
+
/** `Styling` Similar to `isDisabled`, but will remove any color style */
|
23
46
|
isStatic?: boolean;
|
47
|
+
/** `Styling` Set button's size on bulma's size tokens */
|
24
48
|
size?: basicSizeType;
|
49
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
25
50
|
onClick?: () => void;
|
26
51
|
}
|
27
52
|
export interface ProgressBarProps extends BasicProps, React.ComponentPropsWithoutRef<'progress'> {
|
53
|
+
/** `Attribute` Sets colored bar at the level against `max` value (`100` by default) */
|
28
54
|
value?: number;
|
55
|
+
/** `Attribute` Sets the entire bar length comparing with current `value` */
|
29
56
|
max?: number;
|
30
|
-
|
57
|
+
/** `Styling` Color based on bulma's color tokens */
|
31
58
|
color?: basicColorType;
|
59
|
+
/** `Styling` Set progress bar's size */
|
32
60
|
size?: basicSizeType;
|
61
|
+
/** `Styling` Will change `value` for a animated loading */
|
33
62
|
isLoading?: boolean;
|
34
63
|
}
|
35
64
|
export interface BlockProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
36
|
-
|
65
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the block */
|
66
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
37
67
|
}
|
38
68
|
export interface TagProps extends BasicProps, React.ComponentPropsWithoutRef<'span'> {
|
69
|
+
/** `Attribute` `Required` The text will be shown in the `Tag` */
|
39
70
|
text: string;
|
71
|
+
/** `Attribute` Will add a delete button (for both single or addon cases) */
|
72
|
+
withDelete?: boolean;
|
73
|
+
/** `Attribute` Will add a second tag element (that could have its own text, color and delete) */
|
74
|
+
withAddon?: boolean;
|
75
|
+
/** `Attribute` The text will be shown in the tag's addon */
|
76
|
+
addonText?: string;
|
77
|
+
/** `Styling` Color based on bulma's color tokens */
|
40
78
|
color?: basicColorType;
|
79
|
+
/** `Styling` Will adjust the selected color with a ligther style */
|
41
80
|
isLight?: boolean;
|
81
|
+
/** `Styling` Will add round borders to tag's shape */
|
42
82
|
isRounded?: boolean;
|
83
|
+
/** `Styling` Set tag's size */
|
43
84
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
44
|
-
|
45
|
-
withAddon?: boolean;
|
46
|
-
addonText?: string;
|
85
|
+
/** `Styling` Color on tag's addon based on bulma's color tokens */
|
47
86
|
addonColor?: basicColorType;
|
87
|
+
/** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
|
48
88
|
onDeleteClick?: () => void;
|
49
89
|
}
|
50
90
|
export interface ImageProps extends BasicProps, React.ComponentPropsWithoutRef<'figure'> {
|
91
|
+
/** `Attribute` `Required` The image source that will be shown */
|
51
92
|
src: string;
|
93
|
+
/** `Styling` Will add round borders to image's shape */
|
52
94
|
fixedSize?: fixedImageSizeType;
|
95
|
+
/** `Styling` Sets image size based on one of fixed ratios/fixed sizes */
|
53
96
|
isRounded?: boolean;
|
54
97
|
}
|
55
98
|
export interface BoxProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
99
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the box */
|
100
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
56
101
|
}
|
57
102
|
export interface TitleSectionProps extends BasicProps, React.ComponentPropsWithoutRef<'p'> {
|
103
|
+
/** `Attribute` Sets the text you want to show */
|
58
104
|
text: string;
|
105
|
+
/** `Styling` Set text size */
|
59
106
|
size?: titleSizeType;
|
60
|
-
|
107
|
+
/** `Styling` Set type of title (`title` at top, `subtitle` at below) */
|
108
|
+
type: 'title' | 'subtitle';
|
109
|
+
/** `Styling` Set text spacing at default or maximun length */
|
61
110
|
isSpaced?: boolean;
|
62
111
|
}
|
63
112
|
export interface TitleProps {
|
113
|
+
/** `Attribute` Main title configuration object */
|
64
114
|
main?: TitleSectionProps;
|
115
|
+
/** `Attribute` Subtitle title configuration object */
|
65
116
|
secondary?: TitleSectionProps;
|
66
117
|
}
|
67
118
|
export interface IconProps extends BasicProps {
|
119
|
+
/** `Attribute` `Required` Sets the icon key work based on [Material Design icon list](https://pictogrammers.com/library/mdi/) */
|
68
120
|
iconLabel: string;
|
121
|
+
/** `Attribute` Sets the text you want to show next to the icon */
|
69
122
|
text?: string;
|
123
|
+
/** `Styling` Color based on bulma's text color tokens */
|
70
124
|
color?: textColorType;
|
125
|
+
/** `Styling` Set icons's size */
|
71
126
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
127
|
+
/** `Styling` Special usage in case you want to set as dark or light mode */
|
72
128
|
colorMode?: iconColorModeType;
|
129
|
+
/** `Styling` Animates the icon spinning 360° */
|
73
130
|
isSpinning?: boolean;
|
74
131
|
}
|
75
132
|
export interface InputProps extends BasicProps {
|
133
|
+
/** `Attribute` `Required` What type of input will be used */
|
76
134
|
type: inputTypes;
|
135
|
+
/** `Attribute` The value that will be shown on the input */
|
77
136
|
text?: string;
|
137
|
+
/** `Attribute` Will disable the input */
|
78
138
|
isDisabled?: boolean;
|
139
|
+
/** `Attribute` Will show the input as a normal one, but is not editable and has no shadow */
|
79
140
|
isReadonly?: boolean;
|
141
|
+
/** `Styling` Color based on bulma's text color tokens */
|
80
142
|
color?: basicColorType;
|
143
|
+
/** `Styling` Set input's size */
|
81
144
|
size?: basicSizeType;
|
145
|
+
/** `Styling` Will add round borders to input's shape */
|
82
146
|
isRounded?: boolean;
|
147
|
+
/** `Styling` Will add a specific border when the input is hovered by the user */
|
83
148
|
isHovered?: boolean;
|
149
|
+
/** `Styling` Will add a specific border when the input is focused by the user */
|
84
150
|
isFocused?: boolean;
|
151
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
85
152
|
onClick?: () => void;
|
153
|
+
/** `Function` Reffers to each time the user press a key. Alone does not nothing, but can be reused for other components */
|
86
154
|
onChange?: () => void;
|
87
155
|
}
|
88
156
|
export interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
|
157
|
+
/** `Attribute` Text area's columns value that sets its width */
|
89
158
|
cols?: number;
|
159
|
+
/** `Attribute` Text area's rows value that sets its height */
|
90
160
|
rows?: number;
|
161
|
+
/** `Styling` Will disable characteristic sizable property by removing its control on bottom-right corner */
|
91
162
|
isFixedSize?: boolean;
|
92
163
|
}
|
93
164
|
export interface DeleteProps extends BasicProps {
|
165
|
+
/** `Styling` Set icons's size */
|
94
166
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
167
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
95
168
|
onClick?: () => void;
|
96
169
|
}
|
97
170
|
export interface SelectOption {
|
@@ -100,30 +173,71 @@ export interface SelectOption {
|
|
100
173
|
selected?: boolean;
|
101
174
|
}
|
102
175
|
export interface SelectProps extends BasicProps {
|
176
|
+
/** `Attribute` Indicates the options contained on the select */
|
103
177
|
options?: SelectOption[];
|
178
|
+
/** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
|
104
179
|
showOptions?: number;
|
180
|
+
/** `Attribute` Will allow multiple selection */
|
105
181
|
isMultiple?: boolean;
|
182
|
+
/** `Styling` Color based on bulma's color tokens */
|
106
183
|
color?: basicColorType;
|
184
|
+
/** `Styling` Set select's size */
|
107
185
|
size?: basicSizeType;
|
186
|
+
/** `Styling`Will add round borders to input's shape */
|
108
187
|
isRounded?: boolean;
|
188
|
+
/** `Styling`Will add a specific border when the input is hovered by the user */
|
109
189
|
isHovered?: boolean;
|
190
|
+
/** `Styling`Will add a specific border when the input is focused by the user */
|
110
191
|
isFocused?: boolean;
|
192
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
111
193
|
onClick?: () => void;
|
112
194
|
}
|
113
195
|
export interface FileProps extends BasicProps {
|
196
|
+
/** `Attribute` The name of the file to be uploaded */
|
114
197
|
fileName?: string;
|
198
|
+
/** `Attribute` The icon displayed in file's button" */
|
115
199
|
uploadIcon?: IconProps;
|
200
|
+
/** `Attribute` The text displayed in file's button */
|
116
201
|
uploadText?: string;
|
202
|
+
/** `Styling` Changes button's position to its right */
|
117
203
|
buttonOnRight?: boolean;
|
204
|
+
/** `Styling` The whole container (button and file name) will occupy its parent container width */
|
118
205
|
isFullWidth?: boolean;
|
206
|
+
/** `Styling` Changes styling to a box style, making the button bigger and file name's position below the button */
|
119
207
|
isBoxed?: boolean;
|
208
|
+
/** `Styling` Color based on bulma's color tokens */
|
120
209
|
color?: basicColorType;
|
210
|
+
/** `Styling` Set button's size */
|
121
211
|
size?: basicSizeType;
|
212
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
122
213
|
onClick?: () => void;
|
123
214
|
}
|
124
|
-
export interface
|
215
|
+
export interface CheckBoxProps extends BasicProps {
|
216
|
+
/** `Attribute` Sets checkbox's text that will be shown next to its control */
|
125
217
|
content?: string | React.ReactElement;
|
218
|
+
/** `Attribute` Will disable the checkbox */
|
219
|
+
isDisabled?: boolean;
|
220
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
221
|
+
onChange?: () => void;
|
222
|
+
}
|
223
|
+
export interface RadioButtonItemProps extends Pick<BasicProps, 'testId' | 'style'> {
|
224
|
+
/** `Attribute` `Required` Sets checkbox's text*/
|
225
|
+
label: string;
|
226
|
+
/** `Attribute` Sets the name that will relate this checkbox with the others */
|
227
|
+
name?: string;
|
228
|
+
/** `Attribute` Shows the checkbox as checked or unchecked */
|
229
|
+
isChecked?: boolean;
|
230
|
+
/** `Attribute` Will disable the checkbox */
|
126
231
|
isDisabled?: boolean;
|
232
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
233
|
+
onChange?: () => void;
|
234
|
+
}
|
235
|
+
export interface RadioButtonProps extends BasicProps {
|
236
|
+
/** `Attribute` `Required` Indicates the options contained to be selected */
|
237
|
+
options: RadioButtonItemProps[];
|
238
|
+
/** `Attribute` `Required` Sets the name that will relate this checkbox with the others */
|
239
|
+
name: string;
|
240
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
127
241
|
onChange?: () => void;
|
128
242
|
}
|
129
243
|
export {};
|
package/dist/index.d.ts
CHANGED
@@ -11,91 +11,161 @@ type iconColorModeType = 'light' | 'dark';
|
|
11
11
|
type inputTypes = 'text' | 'password' | 'email' | 'tel';
|
12
12
|
|
13
13
|
interface BasicProps {
|
14
|
+
/** `Attribute` ID used to locate the element in unit test suites (like Jest) */
|
14
15
|
testId?: string;
|
16
|
+
/** `Attribute` *For container case*. ID used to locate the element in unit test suites (like Jest) */
|
17
|
+
containerTestId?: string;
|
18
|
+
/** `Attribute` Custom CSS classes, applicable for specific scenarios */
|
19
|
+
cssClasses?: string;
|
20
|
+
/** `Attribute` *For container case*. Custom CSS classes, applicable for specific scenarios */
|
21
|
+
containerCssClasses?: string;
|
22
|
+
/** `Attribute` Custom styling applicable for specific scenarios */
|
15
23
|
style?: React.CSSProperties;
|
24
|
+
/** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
|
25
|
+
containerStyle?: React.CSSProperties;
|
16
26
|
}
|
17
27
|
interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
28
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the column */
|
29
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
30
|
+
/** `Styling` Set column's size */
|
18
31
|
size?: columnSizeType;
|
32
|
+
/** `Styling` Set column's offset (moving it as you set its size */
|
19
33
|
offset?: columnOffsetType;
|
34
|
+
/** `Styling` Set if the column only will take the space it needs */
|
20
35
|
isNarrow?: boolean;
|
21
36
|
}
|
22
37
|
interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<'button'> {
|
38
|
+
/** `Attribute` The text will be shown in the `Button` */
|
23
39
|
text?: string;
|
24
|
-
|
40
|
+
/** `Attribute` Will disable the button */
|
41
|
+
isDisabled?: boolean;
|
42
|
+
/** `Styling` Color based on bulma's color tokens */
|
25
43
|
color?: basicColorType;
|
44
|
+
/** `Styling` Will adjust the selected color with a ligther style */
|
26
45
|
isLightColor?: boolean;
|
46
|
+
/** `Styling` Will invert button's colors (typography in color and background in white or black) */
|
27
47
|
isInvertedColor?: boolean;
|
48
|
+
/** `Styling` Similar to `isInvertedColor`, but button's border will be colored */
|
28
49
|
isOutlined?: boolean;
|
50
|
+
/** `Styling` Will add round borders to button's shape */
|
29
51
|
isRounded?: boolean;
|
52
|
+
/** `Styling` Will change `text` for a animated spinner, but will remain clickeable */
|
30
53
|
isLoading?: boolean;
|
31
|
-
isDisabled
|
54
|
+
/** `Styling` Similar to `isDisabled`, but will remove any color style */
|
32
55
|
isStatic?: boolean;
|
56
|
+
/** `Styling` Set button's size on bulma's size tokens */
|
33
57
|
size?: basicSizeType;
|
58
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
34
59
|
onClick?: () => void;
|
35
60
|
}
|
36
61
|
interface ProgressBarProps extends BasicProps, React.ComponentPropsWithoutRef<'progress'> {
|
62
|
+
/** `Attribute` Sets colored bar at the level against `max` value (`100` by default) */
|
37
63
|
value?: number;
|
64
|
+
/** `Attribute` Sets the entire bar length comparing with current `value` */
|
38
65
|
max?: number;
|
39
|
-
|
66
|
+
/** `Styling` Color based on bulma's color tokens */
|
40
67
|
color?: basicColorType;
|
68
|
+
/** `Styling` Set progress bar's size */
|
41
69
|
size?: basicSizeType;
|
70
|
+
/** `Styling` Will change `value` for a animated loading */
|
42
71
|
isLoading?: boolean;
|
43
72
|
}
|
44
73
|
interface BlockProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
45
|
-
|
74
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the block */
|
75
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
46
76
|
}
|
47
77
|
interface TagProps extends BasicProps, React.ComponentPropsWithoutRef<'span'> {
|
78
|
+
/** `Attribute` `Required` The text will be shown in the `Tag` */
|
48
79
|
text: string;
|
80
|
+
/** `Attribute` Will add a delete button (for both single or addon cases) */
|
81
|
+
withDelete?: boolean;
|
82
|
+
/** `Attribute` Will add a second tag element (that could have its own text, color and delete) */
|
83
|
+
withAddon?: boolean;
|
84
|
+
/** `Attribute` The text will be shown in the tag's addon */
|
85
|
+
addonText?: string;
|
86
|
+
/** `Styling` Color based on bulma's color tokens */
|
49
87
|
color?: basicColorType;
|
88
|
+
/** `Styling` Will adjust the selected color with a ligther style */
|
50
89
|
isLight?: boolean;
|
90
|
+
/** `Styling` Will add round borders to tag's shape */
|
51
91
|
isRounded?: boolean;
|
92
|
+
/** `Styling` Set tag's size */
|
52
93
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
53
|
-
|
54
|
-
withAddon?: boolean;
|
55
|
-
addonText?: string;
|
94
|
+
/** `Styling` Color on tag's addon based on bulma's color tokens */
|
56
95
|
addonColor?: basicColorType;
|
96
|
+
/** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
|
57
97
|
onDeleteClick?: () => void;
|
58
98
|
}
|
59
99
|
interface BoxProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
|
100
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the box */
|
101
|
+
children?: string | React.ReactElement | React.ReactElement[];
|
60
102
|
}
|
61
103
|
interface TitleSectionProps extends BasicProps, React.ComponentPropsWithoutRef<'p'> {
|
104
|
+
/** `Attribute` Sets the text you want to show */
|
62
105
|
text: string;
|
106
|
+
/** `Styling` Set text size */
|
63
107
|
size?: titleSizeType;
|
64
|
-
|
108
|
+
/** `Styling` Set type of title (`title` at top, `subtitle` at below) */
|
109
|
+
type: 'title' | 'subtitle';
|
110
|
+
/** `Styling` Set text spacing at default or maximun length */
|
65
111
|
isSpaced?: boolean;
|
66
112
|
}
|
67
113
|
interface TitleProps {
|
114
|
+
/** `Attribute` Main title configuration object */
|
68
115
|
main?: TitleSectionProps;
|
116
|
+
/** `Attribute` Subtitle title configuration object */
|
69
117
|
secondary?: TitleSectionProps;
|
70
118
|
}
|
71
119
|
interface IconProps extends BasicProps {
|
120
|
+
/** `Attribute` `Required` Sets the icon key work based on [Material Design icon list](https://pictogrammers.com/library/mdi/) */
|
72
121
|
iconLabel: string;
|
122
|
+
/** `Attribute` Sets the text you want to show next to the icon */
|
73
123
|
text?: string;
|
124
|
+
/** `Styling` Color based on bulma's text color tokens */
|
74
125
|
color?: textColorType;
|
126
|
+
/** `Styling` Set icons's size */
|
75
127
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
128
|
+
/** `Styling` Special usage in case you want to set as dark or light mode */
|
76
129
|
colorMode?: iconColorModeType;
|
130
|
+
/** `Styling` Animates the icon spinning 360° */
|
77
131
|
isSpinning?: boolean;
|
78
132
|
}
|
79
133
|
interface InputProps extends BasicProps {
|
134
|
+
/** `Attribute` `Required` What type of input will be used */
|
80
135
|
type: inputTypes;
|
136
|
+
/** `Attribute` The value that will be shown on the input */
|
81
137
|
text?: string;
|
138
|
+
/** `Attribute` Will disable the input */
|
82
139
|
isDisabled?: boolean;
|
140
|
+
/** `Attribute` Will show the input as a normal one, but is not editable and has no shadow */
|
83
141
|
isReadonly?: boolean;
|
142
|
+
/** `Styling` Color based on bulma's text color tokens */
|
84
143
|
color?: basicColorType;
|
144
|
+
/** `Styling` Set input's size */
|
85
145
|
size?: basicSizeType;
|
146
|
+
/** `Styling` Will add round borders to input's shape */
|
86
147
|
isRounded?: boolean;
|
148
|
+
/** `Styling` Will add a specific border when the input is hovered by the user */
|
87
149
|
isHovered?: boolean;
|
150
|
+
/** `Styling` Will add a specific border when the input is focused by the user */
|
88
151
|
isFocused?: boolean;
|
152
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
89
153
|
onClick?: () => void;
|
154
|
+
/** `Function` Reffers to each time the user press a key. Alone does not nothing, but can be reused for other components */
|
90
155
|
onChange?: () => void;
|
91
156
|
}
|
92
157
|
interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
|
158
|
+
/** `Attribute` Text area's columns value that sets its width */
|
93
159
|
cols?: number;
|
160
|
+
/** `Attribute` Text area's rows value that sets its height */
|
94
161
|
rows?: number;
|
162
|
+
/** `Styling` Will disable characteristic sizable property by removing its control on bottom-right corner */
|
95
163
|
isFixedSize?: boolean;
|
96
164
|
}
|
97
165
|
interface DeleteProps extends BasicProps {
|
166
|
+
/** `Styling` Set icons's size */
|
98
167
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
168
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
99
169
|
onClick?: () => void;
|
100
170
|
}
|
101
171
|
interface SelectOption {
|
@@ -104,27 +174,73 @@ interface SelectOption {
|
|
104
174
|
selected?: boolean;
|
105
175
|
}
|
106
176
|
interface SelectProps extends BasicProps {
|
177
|
+
/** `Attribute` Indicates the options contained on the select */
|
107
178
|
options?: SelectOption[];
|
179
|
+
/** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
|
108
180
|
showOptions?: number;
|
181
|
+
/** `Attribute` Will allow multiple selection */
|
109
182
|
isMultiple?: boolean;
|
183
|
+
/** `Styling` Color based on bulma's color tokens */
|
110
184
|
color?: basicColorType;
|
185
|
+
/** `Styling` Set select's size */
|
111
186
|
size?: basicSizeType;
|
187
|
+
/** `Styling`Will add round borders to input's shape */
|
112
188
|
isRounded?: boolean;
|
189
|
+
/** `Styling`Will add a specific border when the input is hovered by the user */
|
113
190
|
isHovered?: boolean;
|
191
|
+
/** `Styling`Will add a specific border when the input is focused by the user */
|
114
192
|
isFocused?: boolean;
|
193
|
+
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
115
194
|
onClick?: () => void;
|
116
195
|
}
|
117
196
|
interface FileProps extends BasicProps {
|
197
|
+
/** `Attribute` The name of the file to be uploaded */
|
118
198
|
fileName?: string;
|
199
|
+
/** `Attribute` The icon displayed in file's button" */
|
119
200
|
uploadIcon?: IconProps;
|
201
|
+
/** `Attribute` The text displayed in file's button */
|
120
202
|
uploadText?: string;
|
203
|
+
/** `Styling` Changes button's position to its right */
|
121
204
|
buttonOnRight?: boolean;
|
205
|
+
/** `Styling` The whole container (button and file name) will occupy its parent container width */
|
122
206
|
isFullWidth?: boolean;
|
207
|
+
/** `Styling` Changes styling to a box style, making the button bigger and file name's position below the button */
|
123
208
|
isBoxed?: boolean;
|
209
|
+
/** `Styling` Color based on bulma's color tokens */
|
124
210
|
color?: basicColorType;
|
211
|
+
/** `Styling` Set button's size */
|
125
212
|
size?: basicSizeType;
|
213
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
126
214
|
onClick?: () => void;
|
127
215
|
}
|
216
|
+
interface CheckBoxProps extends BasicProps {
|
217
|
+
/** `Attribute` Sets checkbox's text that will be shown next to its control */
|
218
|
+
content?: string | React.ReactElement;
|
219
|
+
/** `Attribute` Will disable the checkbox */
|
220
|
+
isDisabled?: boolean;
|
221
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
222
|
+
onChange?: () => void;
|
223
|
+
}
|
224
|
+
interface RadioButtonItemProps extends Pick<BasicProps, 'testId' | 'style'> {
|
225
|
+
/** `Attribute` `Required` Sets checkbox's text*/
|
226
|
+
label: string;
|
227
|
+
/** `Attribute` Sets the name that will relate this checkbox with the others */
|
228
|
+
name?: string;
|
229
|
+
/** `Attribute` Shows the checkbox as checked or unchecked */
|
230
|
+
isChecked?: boolean;
|
231
|
+
/** `Attribute` Will disable the checkbox */
|
232
|
+
isDisabled?: boolean;
|
233
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
234
|
+
onChange?: () => void;
|
235
|
+
}
|
236
|
+
interface RadioButtonProps extends BasicProps {
|
237
|
+
/** `Attribute` `Required` Indicates the options contained to be selected */
|
238
|
+
options: RadioButtonItemProps[];
|
239
|
+
/** `Attribute` `Required` Sets the name that will relate this checkbox with the others */
|
240
|
+
name: string;
|
241
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
242
|
+
onChange?: () => void;
|
243
|
+
}
|
128
244
|
|
129
245
|
declare const Button: React.FC<ButtonProps>;
|
130
246
|
|
@@ -152,4 +268,8 @@ declare const Select: React.FC<SelectProps>;
|
|
152
268
|
|
153
269
|
declare const File: React.FC<FileProps>;
|
154
270
|
|
155
|
-
|
271
|
+
declare const CheckBox: React.FC<CheckBoxProps>;
|
272
|
+
|
273
|
+
declare const RadioButton: React.FC<RadioButtonProps>;
|
274
|
+
|
275
|
+
export { Block, Box, Button, CheckBox as Checkbox, Column, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "reactive-bulma",
|
3
|
-
"version": "1.
|
4
|
-
"description": "A
|
3
|
+
"version": "1.21.0",
|
4
|
+
"description": "A component library based on React, Bulma, Typescript and Rollup",
|
5
5
|
"keywords": [
|
6
6
|
"typescript",
|
7
7
|
"react",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
],
|
17
17
|
"author": "Nicolás Omar González Passerino",
|
18
18
|
"license": "MIT",
|
19
|
-
"homepage": "https://
|
19
|
+
"homepage": "https://reactivebulma.netlify.app",
|
20
20
|
"repository": {
|
21
21
|
"type": "git",
|
22
22
|
"url": "https://github.com/NicolasOmar/reactive-bulma.git"
|
@@ -45,55 +45,55 @@
|
|
45
45
|
"semantic-release": "semantic-release"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
|
-
"@babel/core": "^7.22.
|
49
|
-
"@babel/preset-env": "^7.22.
|
48
|
+
"@babel/core": "^7.22.9",
|
49
|
+
"@babel/preset-env": "^7.22.9",
|
50
50
|
"@babel/preset-react": "^7.22.5",
|
51
51
|
"@babel/preset-typescript": "^7.22.5",
|
52
52
|
"@mdi/font": "^7.2.96",
|
53
|
-
"@rollup/plugin-commonjs": "^25.0.
|
53
|
+
"@rollup/plugin-commonjs": "^25.0.3",
|
54
54
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
55
55
|
"@rollup/plugin-typescript": "^11.1.2",
|
56
56
|
"@semantic-release/changelog": "^6.0.3",
|
57
57
|
"@semantic-release/commit-analyzer": "^10.0.1",
|
58
58
|
"@semantic-release/exec": "^6.0.3",
|
59
59
|
"@semantic-release/git": "^10.0.1",
|
60
|
-
"@semantic-release/github": "^9.0.
|
60
|
+
"@semantic-release/github": "^9.0.4",
|
61
61
|
"@semantic-release/npm": "^10.0.4",
|
62
62
|
"@semantic-release/release-notes-generator": "^11.0.4",
|
63
|
-
"@storybook/addon-actions": "^7.0
|
64
|
-
"@storybook/addon-essentials": "^7.0
|
65
|
-
"@storybook/addon-interactions": "^7.0
|
66
|
-
"@storybook/addon-links": "^7.0
|
67
|
-
"@storybook/addon-mdx-gfm": "^7.0
|
68
|
-
"@storybook/cli": "^7.0
|
69
|
-
"@storybook/react": "^7.0
|
70
|
-
"@storybook/react-webpack5": "^7.0
|
63
|
+
"@storybook/addon-actions": "^7.1.0",
|
64
|
+
"@storybook/addon-essentials": "^7.1.0",
|
65
|
+
"@storybook/addon-interactions": "^7.1.0",
|
66
|
+
"@storybook/addon-links": "^7.1.0",
|
67
|
+
"@storybook/addon-mdx-gfm": "^7.1.0",
|
68
|
+
"@storybook/cli": "^7.1.0",
|
69
|
+
"@storybook/react": "^7.1.0",
|
70
|
+
"@storybook/react-webpack5": "^7.1.0",
|
71
71
|
"@storybook/testing-library": "^0.2.0",
|
72
|
-
"@testing-library/jest-dom": "^5.
|
72
|
+
"@testing-library/jest-dom": "^5.17.0",
|
73
73
|
"@testing-library/react": "^14.0.0",
|
74
|
-
"@types/jest": "^29.5.
|
75
|
-
"@types/react": "^18.2.
|
76
|
-
"@typescript-eslint/eslint-plugin": "^
|
77
|
-
"@typescript-eslint/parser": "^
|
74
|
+
"@types/jest": "^29.5.3",
|
75
|
+
"@types/react": "^18.2.15",
|
76
|
+
"@typescript-eslint/eslint-plugin": "^6.1.0",
|
77
|
+
"@typescript-eslint/parser": "^6.1.0",
|
78
78
|
"babel-jest": "^29.6.1",
|
79
79
|
"babel-loader": "^9.1.3",
|
80
80
|
"bulma": "^0.9.4",
|
81
|
-
"eslint": "^8.
|
81
|
+
"eslint": "^8.45.0",
|
82
82
|
"eslint-config-prettier": "^8.8.0",
|
83
|
-
"eslint-plugin-react": "^7.
|
83
|
+
"eslint-plugin-react": "^7.33.0",
|
84
84
|
"husky": "^8.0.3",
|
85
85
|
"jest": "^29.6.1",
|
86
86
|
"jest-environment-jsdom": "^29.6.1",
|
87
87
|
"lint-staged": "^13.2.3",
|
88
|
-
"postcss": "^8.4.
|
88
|
+
"postcss": "^8.4.26",
|
89
89
|
"prettier": "^3.0.0",
|
90
90
|
"react": "^18.2.0",
|
91
91
|
"react-dom": "^18.2.0",
|
92
|
-
"rollup": "^3.26.
|
92
|
+
"rollup": "^3.26.3",
|
93
93
|
"rollup-plugin-dts": "^5.3.0",
|
94
94
|
"rollup-plugin-postcss": "^4.0.2",
|
95
95
|
"semantic-release": "^21.0.7",
|
96
|
-
"storybook": "^7.0
|
96
|
+
"storybook": "^7.1.0",
|
97
97
|
"tslib": "^2.6.0",
|
98
98
|
"typescript": "^5.1.6"
|
99
99
|
},
|