reactive-bulma 2.9.0 → 2.11.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.
Files changed (30) hide show
  1. package/dist/cjs/index.js +118 -6
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/atoms/TabItem/index.d.ts +4 -0
  4. package/dist/cjs/types/components/atoms/index.d.ts +1 -0
  5. package/dist/cjs/types/components/molecules/FormField/index.d.ts +4 -0
  6. package/dist/cjs/types/components/molecules/InputControl/index.d.ts +4 -0
  7. package/dist/cjs/types/components/molecules/Tabs/index.d.ts +4 -0
  8. package/dist/cjs/types/components/molecules/index.d.ts +3 -0
  9. package/dist/cjs/types/functions/parsers.d.ts +3 -1
  10. package/dist/cjs/types/interfaces/atomProps.d.ts +27 -13
  11. package/dist/cjs/types/interfaces/commonProps.d.ts +3 -0
  12. package/dist/cjs/types/interfaces/functionProps.d.ts +5 -0
  13. package/dist/cjs/types/interfaces/moleculeProps.d.ts +51 -7
  14. package/dist/cjs/types/types/styleTypes.d.ts +6 -3
  15. package/dist/esm/index.js +115 -7
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/components/atoms/TabItem/index.d.ts +4 -0
  18. package/dist/esm/types/components/atoms/index.d.ts +1 -0
  19. package/dist/esm/types/components/molecules/FormField/index.d.ts +4 -0
  20. package/dist/esm/types/components/molecules/InputControl/index.d.ts +4 -0
  21. package/dist/esm/types/components/molecules/Tabs/index.d.ts +4 -0
  22. package/dist/esm/types/components/molecules/index.d.ts +3 -0
  23. package/dist/esm/types/functions/parsers.d.ts +3 -1
  24. package/dist/esm/types/interfaces/atomProps.d.ts +27 -13
  25. package/dist/esm/types/interfaces/commonProps.d.ts +3 -0
  26. package/dist/esm/types/interfaces/functionProps.d.ts +5 -0
  27. package/dist/esm/types/interfaces/moleculeProps.d.ts +51 -7
  28. package/dist/esm/types/types/styleTypes.d.ts +6 -3
  29. package/dist/index.d.ts +90 -21
  30. package/package.json +26 -26
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TabItemProps } from '../../../interfaces/atomProps';
3
+ declare const TabItem: React.FC<TabItemProps>;
4
+ export default TabItem;
@@ -19,3 +19,4 @@ export { default as DropdownItem } from './DropdownItem';
19
19
  export { default as MenuItem } from './MenuItem';
20
20
  export { default as Image } from './Image';
21
21
  export { default as PaginationItem } from './PaginationItem';
22
+ export { default as TabItem } from './TabItem';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FormFieldProps } from '../../../interfaces/moleculeProps';
3
+ declare const FormField: React.FC<FormFieldProps>;
4
+ export default FormField;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { InputControlProps } from '../../../interfaces/moleculeProps';
3
+ declare const InputControl: React.FC<InputControlProps>;
4
+ export default InputControl;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TabsProps } from '../../../interfaces/moleculeProps';
3
+ declare const Tabs: React.FC<TabsProps>;
4
+ export default Tabs;
@@ -8,3 +8,6 @@ export { default as Menu } from './Menu';
8
8
  export { default as MenuList } from './MenuList';
9
9
  export { default as Pagination } from './Pagination';
10
10
  export { default as Modal } from './Modal';
11
+ export { default as Tabs } from './Tabs';
12
+ export { default as InputControl } from './InputControl';
13
+ export { default as FormField } from './FormField';
@@ -1,4 +1,5 @@
1
- import { ParseTestIdProps } from '../interfaces/functionProps';
1
+ import { GenericObjectProps } from '../interfaces/commonProps';
2
+ import { CreateObjArrayProps, ParseTestIdProps } from '../interfaces/functionProps';
2
3
  /**
3
4
  * @param { Array<string | null> } _classes `Required`. Array of classNames on `string` (or `null`) values
4
5
  * @returns { string } A single string product of merge all classNames, separated by spaces
@@ -13,3 +14,4 @@ export declare const parseClasses: (_classes: Array<string | null | undefined>)
13
14
  */
14
15
  export declare const parseTestId: (config: ParseTestIdProps) => string;
15
16
  export declare const parseKey: (max?: number, min?: number) => string;
17
+ export declare const createObjArray: <ImportedProps>({ numberOfItems, externalParser }?: CreateObjArrayProps) => ImportedProps[] | GenericObjectProps[];
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ElementProps, ComposedElementProps, ClickeableProps } from './commonProps';
3
- import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, basicSizeType, textColorType, titleSizeType, reducedSizeType } from '../types/styleTypes';
3
+ import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, elementSizeType, sizeWithoutNormalType, textColorType, titleSizeType, rightLeftAlignType } from '../types/styleTypes';
4
4
  import { DropdownItemType, inputTypes } from '../types/domTypes';
5
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 */
@@ -27,14 +27,14 @@ export interface ButtonProps extends ElementProps, React.ComponentPropsWithoutRe
27
27
  isOutlined?: boolean;
28
28
  /** `Styling` Will add round borders to button's shape */
29
29
  isRounded?: boolean;
30
- /** `Styling` Will change `text` for a animated spinner, but will remain clickeable */
30
+ /** `Styling` Will change `text` for an animated spinner, but will remain clickeable */
31
31
  isLoading?: boolean;
32
32
  /** `Styling` Similar to `isDisabled`, but will remove any color style */
33
33
  isStatic?: boolean;
34
34
  /** `Styling` Sets the button style when a User selects it (useful for an attached `ButtonGroup`) */
35
35
  isSelected?: boolean;
36
36
  /** `Styling` Set button's size on bulma's size tokens */
37
- size?: basicSizeType;
37
+ size?: elementSizeType;
38
38
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
39
39
  onClick?: () => void;
40
40
  }
@@ -46,8 +46,8 @@ export interface ProgressBarProps extends ElementProps, React.ComponentPropsWith
46
46
  /** `Styling` Color based on bulma's color tokens */
47
47
  color?: basicColorType;
48
48
  /** `Styling` Set progress bar's size */
49
- size?: basicSizeType;
50
- /** `Styling` Will change `value` for a animated loading */
49
+ size?: elementSizeType;
50
+ /** `Styling` Will change `value` for an animated loading */
51
51
  isLoading?: boolean;
52
52
  }
53
53
  export interface BlockProps extends ElementProps, React.ComponentPropsWithoutRef<'section'> {
@@ -70,7 +70,7 @@ export interface TagProps extends ComposedElementProps, React.ComponentPropsWith
70
70
  /** `Styling` Will add round borders to tag's shape */
71
71
  isRounded?: boolean;
72
72
  /** `Styling` Set tag's size */
73
- size?: reducedSizeType;
73
+ size?: sizeWithoutNormalType;
74
74
  /** `Styling` Color on tag's addon based on bulma's color tokens */
75
75
  addonColor?: basicColorType;
76
76
  /** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
@@ -79,6 +79,8 @@ export interface TagProps extends ComposedElementProps, React.ComponentPropsWith
79
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
+ /** `Attribute` A description text for the image, useful for accessibility purposes */
83
+ alt?: string;
82
84
  /** `Styling` Will add round borders to image's shape */
83
85
  fixedSize?: fixedImageSizeType;
84
86
  /** `Styling` Sets image size based on one of fixed ratios/fixed sizes */
@@ -112,17 +114,21 @@ export interface IconProps extends ComposedElementProps {
112
114
  /** `Styling` Color based on bulma's text color tokens */
113
115
  color?: textColorType;
114
116
  /** `Styling` Set icons's size */
115
- size?: reducedSizeType;
117
+ size?: sizeWithoutNormalType;
116
118
  /** `Styling` Special usage in case you want to set as dark or light mode */
117
119
  colorMode?: iconColorModeType;
118
120
  /** `Styling` Animates the icon spinning 360° */
119
121
  isSpinning?: boolean;
122
+ /** `Styling` Used for `InputControl` styling purpose only. Will move the Icon itself to control's Input side */
123
+ position?: rightLeftAlignType;
120
124
  }
121
125
  export interface InputProps extends ElementProps, ClickeableProps {
122
126
  /** `Attribute` `Required` What type of input will be used */
123
127
  type: inputTypes;
124
128
  /** `Attribute` The value that will be shown on the input */
125
129
  text?: string;
130
+ /** `Attribute` The text that will be shown if the user does not type any value */
131
+ placeholder?: string;
126
132
  /** `Attribute` Will disable the input */
127
133
  isDisabled?: boolean;
128
134
  /** `Attribute` Will show the input as a normal one, but is not editable and has no shadow */
@@ -130,7 +136,7 @@ export interface InputProps extends ElementProps, ClickeableProps {
130
136
  /** `Styling` Color based on bulma's text color tokens */
131
137
  color?: basicColorType;
132
138
  /** `Styling` Set input's size */
133
- size?: basicSizeType;
139
+ size?: sizeWithoutNormalType;
134
140
  /** `Styling` Will add round borders to input's shape */
135
141
  isRounded?: boolean;
136
142
  /** `Styling` Will add a specific border when the input is hovered by the user */
@@ -150,7 +156,7 @@ export interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
150
156
  }
151
157
  export interface DeleteProps extends ElementProps, ClickeableProps {
152
158
  /** `Styling` Set icons's size */
153
- size?: reducedSizeType;
159
+ size?: sizeWithoutNormalType;
154
160
  }
155
161
  export interface SelectOption {
156
162
  id: string | number;
@@ -167,7 +173,7 @@ export interface SelectProps extends ComposedElementProps, ClickeableProps {
167
173
  /** `Styling` Color based on bulma's color tokens */
168
174
  color?: basicColorType;
169
175
  /** `Styling` Set select's size */
170
- size?: basicSizeType;
176
+ size?: elementSizeType;
171
177
  /** `Styling`Will add round borders to input's shape */
172
178
  isRounded?: boolean;
173
179
  /** `Styling`Will add a specific border when the input is hovered by the user */
@@ -191,7 +197,7 @@ export interface FileProps extends ComposedElementProps, ClickeableProps {
191
197
  /** `Styling` Color based on bulma's color tokens */
192
198
  color?: basicColorType;
193
199
  /** `Styling` Set button's size */
194
- size?: basicSizeType;
200
+ size?: elementSizeType;
195
201
  }
196
202
  export interface CheckBoxProps extends ComposedElementProps {
197
203
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
@@ -250,10 +256,18 @@ export interface MenuItemProps extends ElementProps, ClickeableProps {
250
256
  export interface PaginationItemProps extends ElementProps, ClickeableProps {
251
257
  /** `Attribute` `Required` Sets the number string that will be shown in the item and in its title when user hovers it */
252
258
  text: string | number;
253
- /** `Attribute` Sets the custom text before the `text` when user hovers the item */
259
+ /** `Attribute` Sets a custom text before the `text` when user hovers the item */
254
260
  labelText?: string;
255
- /** `Attribute` Sets the custom text before the `text` when user hovers the item if is the current one */
261
+ /** `Attribute` Sets a custom text before the `text` when user hovers the item if is the current one */
256
262
  currentLabelText?: string;
257
263
  /** `Styling` Makes the item the selected one, changing its background to blue */
258
264
  isSelected?: boolean;
259
265
  }
266
+ export interface TabItemProps extends ComposedElementProps, ClickeableProps {
267
+ /** `Attribute` `Required` The text will be shown in the `TabItem` */
268
+ text: string;
269
+ /** `Attribute` Adds an `Icon` component before the text */
270
+ icon?: IconProps;
271
+ /** `Styling` Used for `Tabs` styling purpose only. Will mark the tab as the one selected among its group */
272
+ isActive?: boolean;
273
+ }
@@ -21,3 +21,6 @@ export interface ClickeableProps {
21
21
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
22
22
  onClick?: () => void;
23
23
  }
24
+ export interface GenericObjectProps {
25
+ [key: string]: string | number | boolean | object;
26
+ }
@@ -1,3 +1,4 @@
1
+ import { GenericObjectProps } from './commonProps';
1
2
  interface RegExpRule {
2
3
  regExp?: RegExp;
3
4
  replacer?: string;
@@ -8,4 +9,8 @@ export interface ParseTestIdProps {
8
9
  rules?: RegExpRule[];
9
10
  separator?: string;
10
11
  }
12
+ export interface CreateObjArrayProps {
13
+ numberOfItems?: number;
14
+ externalParser?: (i: number) => GenericObjectProps;
15
+ }
11
16
  export {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ClickeableProps, ComposedElementProps, ElementProps } from './commonProps';
3
- import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps, DropdownItemProps, MenuItemProps, PaginationItemProps } from './atomProps';
4
- import { basicColorType, elementAlignType, breadcrumbSeparatorType, columnGapType, reducedSizeType } from '../types/styleTypes';
3
+ import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps, DropdownItemProps, IconProps, InputProps, MenuItemProps, PaginationItemProps, TabItemProps } from './atomProps';
4
+ import { basicColorType, rightCenteredAlignType, breadcrumbSeparatorType, columnGapType, sizeWithoutNormalType, tabsFormatType } from '../types/styleTypes';
5
5
  export interface ButtonGroupProps extends ElementProps {
6
6
  /** `Atribute` `Required` Array of `Button` objects that will be shown */
7
7
  buttonList: ButtonProps[];
@@ -38,11 +38,11 @@ export interface BreadcrumbsProps extends ComposedElementProps {
38
38
  /** `Atribute` `Required` Array of `BreadcrumbItems` objects that will be shown */
39
39
  items: BreadcrumbItemProps[];
40
40
  /** `Styling` Will adjust element position on screen */
41
- alignment?: elementAlignType | null;
41
+ alignment?: rightCenteredAlignType | null;
42
42
  /** `Styling` Will adjust element position on screen */
43
43
  separator?: breadcrumbSeparatorType | null;
44
44
  /** `Styling` Set button's size on bulma's size tokens */
45
- size?: reducedSizeType;
45
+ size?: sizeWithoutNormalType;
46
46
  }
47
47
  export interface DropdownProps extends ElementProps {
48
48
  /** `Atribute` `Required` Sets the name will be shown on the dropdown input */
@@ -62,7 +62,7 @@ export interface MessageProps extends ElementProps {
62
62
  /** `Styling` Color based on bulma's color tokens */
63
63
  color?: basicColorType;
64
64
  /** `Styling` Set button's size on bulma's size tokens */
65
- size?: reducedSizeType;
65
+ size?: sizeWithoutNormalType;
66
66
  }
67
67
  interface MenuSubListProps {
68
68
  subListTitle: MenuItemProps;
@@ -105,9 +105,9 @@ export interface PaginationProps extends ComposedElementProps {
105
105
  /** `Styling` Will add round borders to each page's shape */
106
106
  isRounded?: boolean;
107
107
  /** `Styling` Set button's size on bulma's size tokens */
108
- size?: reducedSizeType;
108
+ size?: sizeWithoutNormalType;
109
109
  /** `Styling` Will adjust the pages position on screen */
110
- alignment?: elementAlignType | null;
110
+ alignment?: rightCenteredAlignType | null;
111
111
  }
112
112
  export interface ModalProps extends ComposedElementProps {
113
113
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
@@ -115,4 +115,48 @@ export interface ModalProps extends ComposedElementProps {
115
115
  /** `Function` Custom function related to the modal's close button to inject custom code if needed */
116
116
  onCloseClick?: () => void;
117
117
  }
118
+ export interface TabsProps extends ElementProps {
119
+ /** `Attribute` `Required` List of tabs that will be shown in order */
120
+ tabs: TabItemProps[];
121
+ /** `Styling` Will adjust the tabs position on screen */
122
+ alignment?: rightCenteredAlignType;
123
+ /** `Styling` Set tab's size on bulma's size tokens */
124
+ size?: sizeWithoutNormalType;
125
+ /** `Styling` Set tab's size on bulma's size tokens */
126
+ format?: tabsFormatType;
127
+ /** `Styling` Will add round tabs borders. Only visible if `format` is set to `is-toggle` */
128
+ isRounded?: boolean;
129
+ /** `Styling` The whole container will occupy its parent container width */
130
+ isFullWidth?: boolean;
131
+ }
132
+ export interface InputControlProps extends ElementProps {
133
+ /** `Attribute` `Required` control's input configuration which will be wrapped */
134
+ inputConfig: InputProps;
135
+ /** `Attribute` `Icon` configuration that will be shown in Input's left side */
136
+ leftIcon?: IconProps;
137
+ /** `Attribute` `Icon` configuration that will be shown in Input's right side */
138
+ rightIcon?: IconProps;
139
+ /** `Styling` Set control and its input size on bulma's size tokens */
140
+ size?: sizeWithoutNormalType;
141
+ /** `Styling` Will add an animated spinner on input's right side */
142
+ isLoading?: boolean;
143
+ /** `Styling` Used for `FormField` styling purpose only. Will strech the input and its container in full-width */
144
+ isExpanded?: boolean;
145
+ }
146
+ export interface FormFieldHelperProps {
147
+ text?: string;
148
+ color?: basicColorType;
149
+ }
150
+ export interface FormFieldProps extends ElementProps {
151
+ /** `Attribute` Sets a custom text before the wrapped input to indicate its usage */
152
+ labelText?: string;
153
+ /** `Attribute` `Required` Single or multiple `InputControlProps` config objects which will be wrapped around the `FormField` */
154
+ inputControlConfig: InputControlProps | InputControlProps[];
155
+ /** `Attribute` Adds a helper text below the wrapped paragraph to provide context information */
156
+ helperConfig?: FormFieldHelperProps;
157
+ /** `Styling` Will adjust field's sections (label, input/s and helper) in horizontal position */
158
+ isHorizontal?: boolean;
159
+ /** `Styling` Will group the list of inputs in a same wrapper (useful for several inputs with same usage, as a complex address) */
160
+ isGrouped?: boolean;
161
+ }
118
162
  export {};
@@ -4,9 +4,12 @@ export type columnOffsetType = 'is-offset-1' | 'is-offset-2' | 'is-offset-3' | '
4
4
  export type basicColorType = 'is-white' | 'is-light' | 'is-dark' | 'is-black' | 'is-text' | 'is-ghost' | 'is-primary' | 'is-link' | 'is-info' | 'is-success' | 'is-warning' | 'is-danger';
5
5
  export type textColorType = 'has-text-white' | 'has-text-black' | 'has-text-light' | 'has-text-dark' | 'has-text-primary' | 'has-text-link' | 'has-text-info' | 'has-text-success' | 'has-text-warning' | 'has-text-danger';
6
6
  export type fixedImageSizeType = 'is-16x16' | 'is-24x24' | 'is-32x32' | 'is-48x48' | 'is-64x64' | 'is-96x96' | 'is-128x128' | 'is-square' | 'is-1by1' | 'is-5by4' | 'is-4by3' | 'is-3by2' | 'is-5by3' | 'is-16by9' | 'is-2by1' | 'is-3by1' | 'is-4by5' | 'is-3by4' | 'is-2by3' | 'is-3by5' | 'is-9by16' | 'is-1by2' | 'is-1by3';
7
- export type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
8
- export type reducedSizeType = Exclude<basicSizeType, 'is-normal'>;
7
+ export type elementSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
8
+ export type sizeWithoutNormalType = Exclude<elementSizeType, 'is-normal'>;
9
9
  export type iconColorModeType = 'light' | 'dark';
10
10
  export type columnGapType = 'is-0' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8';
11
- export type elementAlignType = 'is-centered' | 'is-right';
11
+ export type elementAlignType = 'is-centered' | 'is-right' | 'is-left';
12
+ export type rightCenteredAlignType = Exclude<elementAlignType, 'is-left'>;
13
+ export type rightLeftAlignType = Exclude<elementAlignType, 'is-centered'>;
12
14
  export type breadcrumbSeparatorType = 'has-arrow-separator' | 'has-bullet-separator' | 'has-dot-separator' | 'has-succeeds-separator';
15
+ export type tabsFormatType = 'is-boxed' | 'is-toggle';