reactive-bulma 1.21.0 → 2.1.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 { ButtonGroupProps } from '../../../interfaces/moleculeProps';
3
+ declare const ButtonGroup: React.FC<ButtonGroupProps>;
4
+ export default ButtonGroup;
@@ -0,0 +1 @@
1
+ export { default as ButtonGroup } from './ButtonGroup';
@@ -1,3 +1,4 @@
1
1
  import '../node_modules/bulma/css/bulma.min.css';
2
2
  import '../node_modules/@mdi/font/css/materialdesignicons.min.css';
3
3
  export * from './components/atoms';
4
+ export * from './components/molecules';
@@ -1,20 +1,7 @@
1
1
  import React from 'react';
2
+ import { BasicProps } from './commonProps';
2
3
  import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, basicSizeType, textColorType, titleSizeType } from '../types/styleTypes';
3
4
  import { inputTypes } from '../types/domTypes';
4
- interface BasicProps {
5
- /** `Attribute` ID used to locate the element in unit test suites (like Jest) */
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 */
14
- style?: React.CSSProperties;
15
- /** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
16
- containerStyle?: React.CSSProperties;
17
- }
18
5
  export interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
19
6
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
20
7
  children?: string | React.ReactElement | React.ReactElement[];
@@ -44,6 +31,8 @@ export interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<
44
31
  isLoading?: boolean;
45
32
  /** `Styling` Similar to `isDisabled`, but will remove any color style */
46
33
  isStatic?: boolean;
34
+ /** `Styling` Sets the button style when a User selects it (useful for an attached `ButtonGroup`) */
35
+ isSelected?: boolean;
47
36
  /** `Styling` Set button's size on bulma's size tokens */
48
37
  size?: basicSizeType;
49
38
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
@@ -240,4 +229,3 @@ export interface RadioButtonProps extends BasicProps {
240
229
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
241
230
  onChange?: () => void;
242
231
  }
243
- export {};
@@ -0,0 +1,33 @@
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
+ export interface ContainerProps {
17
+ /** `Attribute` *For container case*. ID used to locate the element in unit test suites (like Jest) */
18
+ containerTestId?: string;
19
+ /** `Attribute` *For container case*. Custom CSS classes, applicable for specific scenarios */
20
+ containerCssClasses?: string;
21
+ /** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
22
+ containerStyle?: React.CSSProperties;
23
+ }
24
+ export interface ElementProps {
25
+ /** `Attribute` ID used to locate the element in unit test suites (like Jest) */
26
+ testId?: string;
27
+ /** `Attribute` Custom CSS classes, applicable for specific scenarios */
28
+ cssClasses?: string;
29
+ /** `Attribute` Custom styling applicable for specific scenarios */
30
+ style?: React.CSSProperties;
31
+ }
32
+ export interface ComponentProps extends BasicProps, ElementProps {
33
+ }
@@ -0,0 +1,10 @@
1
+ import { ElementProps } from './commonProps';
2
+ import { ButtonProps } from './atomProps';
3
+ export interface ButtonGroupProps extends ElementProps {
4
+ /** `Atribute` Array of button objects that will be shown */
5
+ buttonList: ButtonProps[];
6
+ /** `Styling` Will group the list of buttonList in a single line */
7
+ isAttached?: boolean;
8
+ /** `Styling` Sets group position on the container */
9
+ position?: 'left' | 'centered' | 'right';
10
+ }
package/dist/index.d.ts CHANGED
@@ -1,14 +1,5 @@
1
- import React from 'react';
2
-
3
- type columnSizeType = 'is-three-quarters' | 'is-two-thirds' | 'is-half' | 'is-one-third' | 'is-one-quarter' | 'is-full' | 'is-four-fifths' | 'is-three-fifths' | 'is-two-fifths' | 'is-one-fifth' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8' | 'is-9' | 'is-10' | 'is-11' | 'is-12';
4
- type titleSizeType = 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6';
5
- type columnOffsetType = 'is-offset-1' | 'is-offset-2' | 'is-offset-3' | 'is-offset-4' | 'is-offset-5' | 'is-offset-6' | 'is-offset-7' | 'is-offset-8' | 'is-offset-9' | 'is-offset-10' | 'is-offset-11' | 'is-offset-12';
6
- 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';
7
- 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';
8
- type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
9
- type iconColorModeType = 'light' | 'dark';
10
-
11
- type inputTypes = 'text' | 'password' | 'email' | 'tel';
1
+ /// <reference types="react" />
2
+ import React$1 from 'react';
12
3
 
13
4
  interface BasicProps {
14
5
  /** `Attribute` ID used to locate the element in unit test suites (like Jest) */
@@ -24,9 +15,28 @@ interface BasicProps {
24
15
  /** `Attribute` *For container case*. Custom styling applicable for specific scenarios */
25
16
  containerStyle?: React.CSSProperties;
26
17
  }
27
- interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
18
+ interface ElementProps {
19
+ /** `Attribute` ID used to locate the element in unit test suites (like Jest) */
20
+ testId?: string;
21
+ /** `Attribute` Custom CSS classes, applicable for specific scenarios */
22
+ cssClasses?: string;
23
+ /** `Attribute` Custom styling applicable for specific scenarios */
24
+ style?: React.CSSProperties;
25
+ }
26
+
27
+ type columnSizeType = 'is-three-quarters' | 'is-two-thirds' | 'is-half' | 'is-one-third' | 'is-one-quarter' | 'is-full' | 'is-four-fifths' | 'is-three-fifths' | 'is-two-fifths' | 'is-one-fifth' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8' | 'is-9' | 'is-10' | 'is-11' | 'is-12';
28
+ type titleSizeType = 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6';
29
+ type columnOffsetType = 'is-offset-1' | 'is-offset-2' | 'is-offset-3' | 'is-offset-4' | 'is-offset-5' | 'is-offset-6' | 'is-offset-7' | 'is-offset-8' | 'is-offset-9' | 'is-offset-10' | 'is-offset-11' | 'is-offset-12';
30
+ 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';
31
+ 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';
32
+ type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
33
+ type iconColorModeType = 'light' | 'dark';
34
+
35
+ type inputTypes = 'text' | 'password' | 'email' | 'tel';
36
+
37
+ interface ColumnProps extends BasicProps, React$1.ComponentPropsWithoutRef<'section'> {
28
38
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
29
- children?: string | React.ReactElement | React.ReactElement[];
39
+ children?: string | React$1.ReactElement | React$1.ReactElement[];
30
40
  /** `Styling` Set column's size */
31
41
  size?: columnSizeType;
32
42
  /** `Styling` Set column's offset (moving it as you set its size */
@@ -34,7 +44,7 @@ interface ColumnProps extends BasicProps, React.ComponentPropsWithoutRef<'sectio
34
44
  /** `Styling` Set if the column only will take the space it needs */
35
45
  isNarrow?: boolean;
36
46
  }
37
- interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<'button'> {
47
+ interface ButtonProps extends BasicProps, React$1.ComponentPropsWithoutRef<'button'> {
38
48
  /** `Attribute` The text will be shown in the `Button` */
39
49
  text?: string;
40
50
  /** `Attribute` Will disable the button */
@@ -53,12 +63,14 @@ interface ButtonProps extends BasicProps, React.ComponentPropsWithoutRef<'button
53
63
  isLoading?: boolean;
54
64
  /** `Styling` Similar to `isDisabled`, but will remove any color style */
55
65
  isStatic?: boolean;
66
+ /** `Styling` Sets the button style when a User selects it (useful for an attached `ButtonGroup`) */
67
+ isSelected?: boolean;
56
68
  /** `Styling` Set button's size on bulma's size tokens */
57
69
  size?: basicSizeType;
58
70
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
59
71
  onClick?: () => void;
60
72
  }
61
- interface ProgressBarProps extends BasicProps, React.ComponentPropsWithoutRef<'progress'> {
73
+ interface ProgressBarProps extends BasicProps, React$1.ComponentPropsWithoutRef<'progress'> {
62
74
  /** `Attribute` Sets colored bar at the level against `max` value (`100` by default) */
63
75
  value?: number;
64
76
  /** `Attribute` Sets the entire bar length comparing with current `value` */
@@ -70,11 +82,11 @@ interface ProgressBarProps extends BasicProps, React.ComponentPropsWithoutRef<'p
70
82
  /** `Styling` Will change `value` for a animated loading */
71
83
  isLoading?: boolean;
72
84
  }
73
- interface BlockProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
85
+ interface BlockProps extends BasicProps, React$1.ComponentPropsWithoutRef<'section'> {
74
86
  /** `Attribute` Reffers to the component or array of components that will be shown inside the block */
75
- children?: string | React.ReactElement | React.ReactElement[];
87
+ children?: string | React$1.ReactElement | React$1.ReactElement[];
76
88
  }
77
- interface TagProps extends BasicProps, React.ComponentPropsWithoutRef<'span'> {
89
+ interface TagProps extends BasicProps, React$1.ComponentPropsWithoutRef<'span'> {
78
90
  /** `Attribute` `Required` The text will be shown in the `Tag` */
79
91
  text: string;
80
92
  /** `Attribute` Will add a delete button (for both single or addon cases) */
@@ -96,11 +108,11 @@ interface TagProps extends BasicProps, React.ComponentPropsWithoutRef<'span'> {
96
108
  /** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
97
109
  onDeleteClick?: () => void;
98
110
  }
99
- interface BoxProps extends BasicProps, React.ComponentPropsWithoutRef<'section'> {
111
+ interface BoxProps extends BasicProps, React$1.ComponentPropsWithoutRef<'section'> {
100
112
  /** `Attribute` Reffers to the component or array of components that will be shown inside the box */
101
- children?: string | React.ReactElement | React.ReactElement[];
113
+ children?: string | React$1.ReactElement | React$1.ReactElement[];
102
114
  }
103
- interface TitleSectionProps extends BasicProps, React.ComponentPropsWithoutRef<'p'> {
115
+ interface TitleSectionProps extends BasicProps, React$1.ComponentPropsWithoutRef<'p'> {
104
116
  /** `Attribute` Sets the text you want to show */
105
117
  text: string;
106
118
  /** `Styling` Set text size */
@@ -215,7 +227,7 @@ interface FileProps extends BasicProps {
215
227
  }
216
228
  interface CheckBoxProps extends BasicProps {
217
229
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
218
- content?: string | React.ReactElement;
230
+ content?: string | React$1.ReactElement;
219
231
  /** `Attribute` Will disable the checkbox */
220
232
  isDisabled?: boolean;
221
233
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
@@ -242,34 +254,45 @@ interface RadioButtonProps extends BasicProps {
242
254
  onChange?: () => void;
243
255
  }
244
256
 
245
- declare const Button: React.FC<ButtonProps>;
257
+ declare const Button: React$1.FC<ButtonProps>;
246
258
 
247
- declare const Column: React.FC<ColumnProps>;
259
+ declare const Column: React$1.FC<ColumnProps>;
248
260
 
249
- declare const ProgressBar: React.FC<ProgressBarProps>;
261
+ declare const ProgressBar: React$1.FC<ProgressBarProps>;
250
262
 
251
- declare const Block: React.FC<BlockProps>;
263
+ declare const Block: React$1.FC<BlockProps>;
252
264
 
253
- declare const Tag: React.FC<TagProps>;
265
+ declare const Tag: React$1.FC<TagProps>;
254
266
 
255
- declare const Box: React.FC<BoxProps>;
267
+ declare const Box: React$1.FC<BoxProps>;
256
268
 
257
- declare const Title: React.FC<TitleProps>;
269
+ declare const Title: React$1.FC<TitleProps>;
258
270
 
259
- declare const Icon: React.FC<IconProps>;
271
+ declare const Icon: React$1.FC<IconProps>;
260
272
 
261
- declare const Input: React.FC<InputProps>;
273
+ declare const Input: React$1.FC<InputProps>;
262
274
 
263
- declare const TextArea: React.FC<TextAreaProps>;
275
+ declare const TextArea: React$1.FC<TextAreaProps>;
264
276
 
265
- declare const Delete: React.FC<DeleteProps>;
277
+ declare const Delete: React$1.FC<DeleteProps>;
266
278
 
267
- declare const Select: React.FC<SelectProps>;
279
+ declare const Select: React$1.FC<SelectProps>;
268
280
 
269
- declare const File: React.FC<FileProps>;
281
+ declare const File: React$1.FC<FileProps>;
270
282
 
271
- declare const CheckBox: React.FC<CheckBoxProps>;
283
+ declare const CheckBox: React$1.FC<CheckBoxProps>;
284
+
285
+ declare const RadioButton: React$1.FC<RadioButtonProps>;
286
+
287
+ interface ButtonGroupProps extends ElementProps {
288
+ /** `Atribute` Array of button objects that will be shown */
289
+ buttonList: ButtonProps[];
290
+ /** `Styling` Will group the list of buttonList in a single line */
291
+ isAttached?: boolean;
292
+ /** `Styling` Sets group position on the container */
293
+ position?: 'left' | 'centered' | 'right';
294
+ }
272
295
 
273
- declare const RadioButton: React.FC<RadioButtonProps>;
296
+ declare const ButtonGroup: React$1.FC<ButtonGroupProps>;
274
297
 
275
- export { Block, Box, Button, CheckBox as Checkbox, Column, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
298
+ export { Block, Box, Button, ButtonGroup, CheckBox as Checkbox, Column, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-bulma",
3
- "version": "1.21.0",
3
+ "version": "2.1.0",
4
4
  "description": "A component library based on React, Bulma, Typescript and Rollup",
5
5
  "keywords": [
6
6
  "typescript",
@@ -35,8 +35,10 @@
35
35
  "start:cli": "npm start -- --no-open",
36
36
  "test": "jest --watchAll=false --verbose",
37
37
  "test:ci": "npm test -- --coverage",
38
+ "test:diff": "npm run test:ci -- -o",
38
39
  "lint": "eslint src/**/*.tsx",
39
40
  "prettier": "prettier src/**/*.{tsx,ts} --write",
41
+ "prettier:ci": "prettier src/**/*.{tsx,ts} --check",
40
42
  "lint-staged": "lint-staged -v",
41
43
  "setup": "npm i && husky install",
42
44
  "prepare": "npm run build",
@@ -45,57 +47,57 @@
45
47
  "semantic-release": "semantic-release"
46
48
  },
47
49
  "devDependencies": {
48
- "@babel/core": "^7.22.9",
49
- "@babel/preset-env": "^7.22.9",
50
- "@babel/preset-react": "^7.22.5",
51
- "@babel/preset-typescript": "^7.22.5",
50
+ "@babel/core": "^7.22.20",
51
+ "@babel/preset-env": "^7.22.20",
52
+ "@babel/preset-react": "^7.22.15",
53
+ "@babel/preset-typescript": "^7.22.15",
52
54
  "@mdi/font": "^7.2.96",
53
- "@rollup/plugin-commonjs": "^25.0.3",
54
- "@rollup/plugin-node-resolve": "^15.1.0",
55
- "@rollup/plugin-typescript": "^11.1.2",
55
+ "@rollup/plugin-commonjs": "^25.0.4",
56
+ "@rollup/plugin-node-resolve": "^15.2.1",
57
+ "@rollup/plugin-typescript": "^11.1.3",
56
58
  "@semantic-release/changelog": "^6.0.3",
57
- "@semantic-release/commit-analyzer": "^10.0.1",
59
+ "@semantic-release/commit-analyzer": "^11.0.0",
58
60
  "@semantic-release/exec": "^6.0.3",
59
61
  "@semantic-release/git": "^10.0.1",
60
- "@semantic-release/github": "^9.0.4",
61
- "@semantic-release/npm": "^10.0.4",
62
- "@semantic-release/release-notes-generator": "^11.0.4",
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
- "@storybook/testing-library": "^0.2.0",
72
- "@testing-library/jest-dom": "^5.17.0",
62
+ "@semantic-release/github": "^9.0.6",
63
+ "@semantic-release/npm": "^11.0.0",
64
+ "@semantic-release/release-notes-generator": "^12.0.0",
65
+ "@storybook/addon-actions": "^7.4.2",
66
+ "@storybook/addon-essentials": "^7.4.2",
67
+ "@storybook/addon-interactions": "^7.4.2",
68
+ "@storybook/addon-links": "^7.4.2",
69
+ "@storybook/addon-mdx-gfm": "^7.4.2",
70
+ "@storybook/cli": "^7.4.2",
71
+ "@storybook/react": "^7.4.2",
72
+ "@storybook/react-webpack5": "^7.4.2",
73
+ "@storybook/testing-library": "^0.2.1",
74
+ "@testing-library/jest-dom": "^6.1.3",
73
75
  "@testing-library/react": "^14.0.0",
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
- "babel-jest": "^29.6.1",
76
+ "@types/jest": "^29.5.5",
77
+ "@types/react": "^18.2.22",
78
+ "@typescript-eslint/eslint-plugin": "^6.7.2",
79
+ "@typescript-eslint/parser": "^6.7.2",
80
+ "babel-jest": "^29.7.0",
79
81
  "babel-loader": "^9.1.3",
80
82
  "bulma": "^0.9.4",
81
- "eslint": "^8.45.0",
82
- "eslint-config-prettier": "^8.8.0",
83
- "eslint-plugin-react": "^7.33.0",
83
+ "eslint": "^8.49.0",
84
+ "eslint-config-prettier": "^9.0.0",
85
+ "eslint-plugin-react": "^7.33.2",
84
86
  "husky": "^8.0.3",
85
- "jest": "^29.6.1",
86
- "jest-environment-jsdom": "^29.6.1",
87
- "lint-staged": "^13.2.3",
88
- "postcss": "^8.4.26",
89
- "prettier": "^3.0.0",
87
+ "jest": "^29.7.0",
88
+ "jest-environment-jsdom": "^29.7.0",
89
+ "lint-staged": "^14.0.1",
90
+ "postcss": "^8.4.29",
91
+ "prettier": "^3.0.3",
90
92
  "react": "^18.2.0",
91
93
  "react-dom": "^18.2.0",
92
- "rollup": "^3.26.3",
93
- "rollup-plugin-dts": "^5.3.0",
94
+ "rollup": "^3.29.2",
95
+ "rollup-plugin-dts": "^6.0.2",
94
96
  "rollup-plugin-postcss": "^4.0.2",
95
- "semantic-release": "^21.0.7",
96
- "storybook": "^7.1.0",
97
- "tslib": "^2.6.0",
98
- "typescript": "^5.1.6"
97
+ "semantic-release": "^22.0.0",
98
+ "storybook": "^7.4.2",
99
+ "tslib": "^2.6.2",
100
+ "typescript": "^5.2.2"
99
101
  },
100
102
  "lint-staged": {
101
103
  "src/**/*.(ts|tsx)": [