reactive-bulma 2.2.0 → 2.3.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 { NotificationProps } from '../../../interfaces/moleculeProps';
3
+ declare const Notification: React.FC<NotificationProps>;
4
+ export default Notification;
@@ -1,2 +1,3 @@
1
1
  export { default as ButtonGroup } from './ButtonGroup';
2
2
  export { default as ColumnGroup } from './ColumnGroup';
3
+ export { default as Notification } from './Notification';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { BasicProps } from './commonProps';
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 BasicProps, React.ComponentPropsWithoutRef<'section'> {
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 BasicProps, React.ComponentPropsWithoutRef<'button'> {
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 BasicProps, React.ComponentPropsWithoutRef<'progress'> {
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 BasicProps, React.ComponentPropsWithoutRef<'section'> {
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 BasicProps, React.ComponentPropsWithoutRef<'span'> {
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 BasicProps, React.ComponentPropsWithoutRef<'figure'> {
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 BasicProps, React.ComponentPropsWithoutRef<'section'> {
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 BasicProps, React.ComponentPropsWithoutRef<'p'> {
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 BasicProps {
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 BasicProps {
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 BasicProps {
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 BasicProps {
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 BasicProps {
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 BasicProps {
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<BasicProps, 'testId' | 'style'> {
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 BasicProps {
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 */
@@ -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 ComponentProps extends BasicProps, ElementProps {
18
+ export interface ComposedElementProps extends ElementProps, ContainerProps {
33
19
  }
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import { ElementProps } from './commonProps';
2
- import { ButtonProps, ColumnProps } from './atomProps';
3
- import { columnGapType } from '../types/styleTypes';
3
+ import { ButtonProps, ColumnProps, DeleteProps } from './atomProps';
4
+ import { basicColorType, 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,13 @@ 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
+ }
package/dist/esm/index.js CHANGED
@@ -3228,5 +3228,21 @@ const ColumnGroup = ({ testId = null, cssClasses = null, style = null, listOfCol
3228
3228
  return (React.createElement("section", { "data-testid": columnGroupTestId, className: columnGroupClasses, style: style !== null && style !== void 0 ? style : undefined }, listOfColumns.map((_columnItem, i) => (React.createElement(Column, Object.assign({ key: `column-group-item-${i}` }, _columnItem))))));
3229
3229
  };
3230
3230
 
3231
- export { Block, Box, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
3231
+ const Notification = ({ testId = null, cssClasses = null, style = null, children = null, deleteButton = null, color = null, isLightColor = null }) => {
3232
+ const notificationClasses = parseClasses([
3233
+ 'notification',
3234
+ color,
3235
+ isLightColor ? 'is-light' : null,
3236
+ cssClasses
3237
+ ]);
3238
+ const notificationTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
3239
+ tag: 'notification',
3240
+ parsedClasses: notificationClasses
3241
+ });
3242
+ return (React.createElement("section", { "data-testid": notificationTestId, className: notificationClasses, style: style !== null && style !== void 0 ? style : undefined },
3243
+ deleteButton ? React.createElement(Delete, Object.assign({}, deleteButton)) : null,
3244
+ children));
3245
+ };
3246
+
3247
+ export { Block, Box, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, File, Icon, Input, Notification, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
3232
3248
  //# sourceMappingURL=index.js.map