reactive-bulma 2.2.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +20 -3
- package/dist/cjs/index.js +99 -38
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/BreadcrumbItem/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +1 -0
- package/dist/cjs/types/components/molecules/Breadcrumbs/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/Notification/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/index.d.ts +2 -0
- package/dist/cjs/types/interfaces/atomProps.d.ts +26 -18
- package/dist/cjs/types/interfaces/commonProps.d.ts +1 -15
- package/dist/cjs/types/interfaces/moleculeProps.d.ts +24 -3
- package/dist/cjs/types/types/styleTypes.d.ts +2 -0
- package/dist/esm/index.js +97 -39
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/BreadcrumbItem/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +1 -0
- package/dist/esm/types/components/molecules/Breadcrumbs/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/Notification/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/index.d.ts +2 -0
- package/dist/esm/types/interfaces/atomProps.d.ts +26 -18
- package/dist/esm/types/interfaces/commonProps.d.ts +1 -15
- package/dist/esm/types/interfaces/moleculeProps.d.ts +24 -3
- package/dist/esm/types/types/styleTypes.d.ts +2 -0
- package/dist/index.d.ts +56 -24
- package/package.json +31 -29
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { ElementProps, ComposedElementProps } from './commonProps';
|
3
3
|
import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, basicSizeType, textColorType, titleSizeType } from '../types/styleTypes';
|
4
4
|
import { inputTypes } from '../types/domTypes';
|
5
|
-
export interface ColumnProps extends
|
5
|
+
export interface ColumnProps extends ElementProps, React.ComponentPropsWithoutRef<'section'> {
|
6
6
|
/** `Attribute` Reffers to the component or array of components that will be shown inside the column */
|
7
7
|
children?: string | React.ReactElement | React.ReactElement[];
|
8
8
|
/** `Styling` Set column's size */
|
@@ -12,7 +12,7 @@ export interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<
|
|
12
12
|
/** `Styling` Set if the column only will take the space it needs */
|
13
13
|
isNarrow?: boolean;
|
14
14
|
}
|
15
|
-
export interface ButtonProps extends
|
15
|
+
export interface ButtonProps extends ElementProps, React.ComponentPropsWithoutRef<'button'> {
|
16
16
|
/** `Attribute` The text will be shown in the `Button` */
|
17
17
|
text?: string;
|
18
18
|
/** `Attribute` Will disable the button */
|
@@ -38,7 +38,7 @@ export interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<
|
|
38
38
|
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
39
39
|
onClick?: () => void;
|
40
40
|
}
|
41
|
-
export interface ProgressBarProps extends
|
41
|
+
export interface ProgressBarProps extends ElementProps, React.ComponentPropsWithoutRef<'progress'> {
|
42
42
|
/** `Attribute` Sets colored bar at the level against `max` value (`100` by default) */
|
43
43
|
value?: number;
|
44
44
|
/** `Attribute` Sets the entire bar length comparing with current `value` */
|
@@ -50,11 +50,11 @@ export interface ProgressBarProps extends BasicProps, React.ComponentPropsWithou
|
|
50
50
|
/** `Styling` Will change `value` for a animated loading */
|
51
51
|
isLoading?: boolean;
|
52
52
|
}
|
53
|
-
export interface BlockProps extends
|
53
|
+
export interface BlockProps extends ElementProps, React.ComponentPropsWithoutRef<'section'> {
|
54
54
|
/** `Attribute` Reffers to the component or array of components that will be shown inside the block */
|
55
55
|
children?: string | React.ReactElement | React.ReactElement[];
|
56
56
|
}
|
57
|
-
export interface TagProps extends
|
57
|
+
export interface TagProps extends ComposedElementProps, React.ComponentPropsWithoutRef<'span'> {
|
58
58
|
/** `Attribute` `Required` The text will be shown in the `Tag` */
|
59
59
|
text: string;
|
60
60
|
/** `Attribute` Will add a delete button (for both single or addon cases) */
|
@@ -76,7 +76,7 @@ export interface TagProps extends BasicProps, React.ComponentPropsWithoutRef<'sp
|
|
76
76
|
/** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
|
77
77
|
onDeleteClick?: () => void;
|
78
78
|
}
|
79
|
-
export interface ImageProps extends
|
79
|
+
export interface ImageProps extends ComposedElementProps, React.ComponentPropsWithoutRef<'figure'> {
|
80
80
|
/** `Attribute` `Required` The image source that will be shown */
|
81
81
|
src: string;
|
82
82
|
/** `Styling` Will add round borders to image's shape */
|
@@ -84,11 +84,11 @@ export interface ImageProps extends BasicProps, React.ComponentPropsWithoutRef<'
|
|
84
84
|
/** `Styling` Sets image size based on one of fixed ratios/fixed sizes */
|
85
85
|
isRounded?: boolean;
|
86
86
|
}
|
87
|
-
export interface BoxProps extends
|
87
|
+
export interface BoxProps extends ElementProps, React.ComponentPropsWithoutRef<'section'> {
|
88
88
|
/** `Attribute` Reffers to the component or array of components that will be shown inside the box */
|
89
89
|
children?: string | React.ReactElement | React.ReactElement[];
|
90
90
|
}
|
91
|
-
export interface TitleSectionProps extends
|
91
|
+
export interface TitleSectionProps extends ElementProps, React.ComponentPropsWithoutRef<'p'> {
|
92
92
|
/** `Attribute` Sets the text you want to show */
|
93
93
|
text: string;
|
94
94
|
/** `Styling` Set text size */
|
@@ -104,7 +104,7 @@ export interface TitleProps {
|
|
104
104
|
/** `Attribute` Subtitle title configuration object */
|
105
105
|
secondary?: TitleSectionProps;
|
106
106
|
}
|
107
|
-
export interface IconProps extends
|
107
|
+
export interface IconProps extends ComposedElementProps {
|
108
108
|
/** `Attribute` `Required` Sets the icon key work based on [Material Design icon list](https://pictogrammers.com/library/mdi/) */
|
109
109
|
iconLabel: string;
|
110
110
|
/** `Attribute` Sets the text you want to show next to the icon */
|
@@ -118,7 +118,7 @@ export interface IconProps extends BasicProps {
|
|
118
118
|
/** `Styling` Animates the icon spinning 360° */
|
119
119
|
isSpinning?: boolean;
|
120
120
|
}
|
121
|
-
export interface InputProps extends
|
121
|
+
export interface InputProps extends ElementProps {
|
122
122
|
/** `Attribute` `Required` What type of input will be used */
|
123
123
|
type: inputTypes;
|
124
124
|
/** `Attribute` The value that will be shown on the input */
|
@@ -150,7 +150,7 @@ export interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
|
|
150
150
|
/** `Styling` Will disable characteristic sizable property by removing its control on bottom-right corner */
|
151
151
|
isFixedSize?: boolean;
|
152
152
|
}
|
153
|
-
export interface DeleteProps extends
|
153
|
+
export interface DeleteProps extends ElementProps {
|
154
154
|
/** `Styling` Set icons's size */
|
155
155
|
size?: Exclude<basicSizeType, 'is-normal'>;
|
156
156
|
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
@@ -161,7 +161,7 @@ export interface SelectOption {
|
|
161
161
|
name: string;
|
162
162
|
selected?: boolean;
|
163
163
|
}
|
164
|
-
export interface SelectProps extends
|
164
|
+
export interface SelectProps extends ComposedElementProps {
|
165
165
|
/** `Attribute` Indicates the options contained on the select */
|
166
166
|
options?: SelectOption[];
|
167
167
|
/** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
|
@@ -181,7 +181,7 @@ export interface SelectProps extends BasicProps {
|
|
181
181
|
/** `Function` Click function. Alone does not nothing, but can be reused for other components */
|
182
182
|
onClick?: () => void;
|
183
183
|
}
|
184
|
-
export interface FileProps extends
|
184
|
+
export interface FileProps extends ComposedElementProps {
|
185
185
|
/** `Attribute` The name of the file to be uploaded */
|
186
186
|
fileName?: string;
|
187
187
|
/** `Attribute` The icon displayed in file's button" */
|
@@ -201,15 +201,15 @@ export interface FileProps extends BasicProps {
|
|
201
201
|
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
202
202
|
onClick?: () => void;
|
203
203
|
}
|
204
|
-
export interface CheckBoxProps extends
|
204
|
+
export interface CheckBoxProps extends ComposedElementProps {
|
205
205
|
/** `Attribute` Sets checkbox's text that will be shown next to its control */
|
206
|
-
content?: string | React.ReactElement;
|
206
|
+
content?: string | React.ReactElement | React.ReactElement[];
|
207
207
|
/** `Attribute` Will disable the checkbox */
|
208
208
|
isDisabled?: boolean;
|
209
209
|
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
210
210
|
onChange?: () => void;
|
211
211
|
}
|
212
|
-
export interface RadioButtonItemProps extends Pick<
|
212
|
+
export interface RadioButtonItemProps extends Pick<ElementProps, 'testId' | 'style'> {
|
213
213
|
/** `Attribute` `Required` Sets checkbox's text*/
|
214
214
|
label: string;
|
215
215
|
/** `Attribute` Sets the name that will relate this checkbox with the others */
|
@@ -221,7 +221,7 @@ export interface RadioButtonItemProps extends Pick<BasicProps, 'testId' | 'style
|
|
221
221
|
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
222
222
|
onChange?: () => void;
|
223
223
|
}
|
224
|
-
export interface RadioButtonProps extends
|
224
|
+
export interface RadioButtonProps extends ComposedElementProps {
|
225
225
|
/** `Attribute` `Required` Indicates the options contained to be selected */
|
226
226
|
options: RadioButtonItemProps[];
|
227
227
|
/** `Attribute` `Required` Sets the name that will relate this checkbox with the others */
|
@@ -229,3 +229,11 @@ export interface RadioButtonProps extends BasicProps {
|
|
229
229
|
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
230
230
|
onChange?: () => void;
|
231
231
|
}
|
232
|
+
export interface BreadcrumbItemProps extends ComposedElementProps {
|
233
|
+
/** `Attribute` `Required` Indicates item text that will be shown */
|
234
|
+
text: string;
|
235
|
+
/** `Styling` Marks the item as the one where user is located (based on breadcrumb hierarchy) */
|
236
|
+
isActiveItem?: boolean;
|
237
|
+
/** `Function` Click function, alone does not nothing, but can be reused for other components */
|
238
|
+
onClick?: () => void;
|
239
|
+
}
|
@@ -1,18 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export interface BasicProps {
|
3
|
-
/** `Attribute` ID used to locate the element in unit test suites (like Jest) */
|
4
|
-
testId?: string;
|
5
|
-
/** `Attribute` *For container case*. ID used to locate the element in unit test suites (like Jest) */
|
6
|
-
containerTestId?: string;
|
7
|
-
/** `Attribute` Custom CSS classes, applicable for specific scenarios */
|
8
|
-
cssClasses?: string;
|
9
|
-
/** `Attribute` *For container case*. Custom CSS classes, applicable for specific scenarios */
|
10
|
-
containerCssClasses?: string;
|
11
|
-
/** `Attribute` Custom styling applicable for specific scenarios */
|
12
|
-
style?: React.CSSProperties;
|
13
|
-
/** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
|
14
|
-
containerStyle?: React.CSSProperties;
|
15
|
-
}
|
16
2
|
export interface ContainerProps {
|
17
3
|
/** `Attribute` *For container case*. ID used to locate the element in unit test suites (like Jest) */
|
18
4
|
containerTestId?: string;
|
@@ -29,5 +15,5 @@ export interface ElementProps {
|
|
29
15
|
/** `Attribute` Custom styling applicable for specific scenarios */
|
30
16
|
style?: React.CSSProperties;
|
31
17
|
}
|
32
|
-
export interface
|
18
|
+
export interface ComposedElementProps extends ElementProps, ContainerProps {
|
33
19
|
}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ComposedElementProps, ElementProps } from './commonProps';
|
3
|
+
import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps } from './atomProps';
|
4
|
+
import { basicColorType, basicSizeType, breadcrumbAlignType, breadcrumbSeparatorType, columnGapType } from '../types/styleTypes';
|
4
5
|
export interface ButtonGroupProps extends ElementProps {
|
5
6
|
/** `Atribute` `Required` Array of `Button` objects that will be shown */
|
6
7
|
buttonList: ButtonProps[];
|
@@ -23,3 +24,23 @@ export interface ColumnGroupProps extends ElementProps {
|
|
23
24
|
/** `Styling` Will adjust the space between the columns. In case to set null, it will remove those gaps */
|
24
25
|
gap?: columnGapType | null;
|
25
26
|
}
|
27
|
+
export interface NotificationProps extends ElementProps {
|
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
|
+
/** `Atribute` Includes a `Delete` config object that will be shown */
|
31
|
+
deleteButton?: DeleteProps;
|
32
|
+
/** `Styling` Color based on bulma's color tokens */
|
33
|
+
color?: basicColorType;
|
34
|
+
/** `Styling` Will adjust the selected color with a ligther style */
|
35
|
+
isLightColor?: boolean;
|
36
|
+
}
|
37
|
+
export interface BreadcrumbsProps extends ComposedElementProps {
|
38
|
+
/** `Atribute` `Required` Array of `BreadcrumbItems` objects that will be shown */
|
39
|
+
items: BreadcrumbItemProps[];
|
40
|
+
/** `Styling` Will adjust element position on screen */
|
41
|
+
alignment?: breadcrumbAlignType | null;
|
42
|
+
/** `Styling` Will adjust element position on screen */
|
43
|
+
separator?: breadcrumbSeparatorType | null;
|
44
|
+
/** `Styling` Set button's size on bulma's size tokens */
|
45
|
+
size?: Exclude<basicSizeType, 'is-normal'>;
|
46
|
+
}
|
@@ -7,3 +7,5 @@ export type fixedImageSizeType = 'is-16x16' | 'is-24x24' | 'is-32x32' | 'is-48x4
|
|
7
7
|
export type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
|
8
8
|
export type iconColorModeType = 'light' | 'dark';
|
9
9
|
export type columnGapType = 'is-0' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8';
|
10
|
+
export type breadcrumbAlignType = 'is-centered' | 'is-right';
|
11
|
+
export type breadcrumbSeparatorType = 'has-arrow-separator' | 'has-bullet-separator' | 'has-dot-separator' | 'has-succeeds-separator';
|