reactive-bulma 1.20.1 → 2.0.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 { RadioButtonProps } from '../../../interfaces/atomProps';
3
+ declare const RadioButton: React.FC<RadioButtonProps>;
4
+ export default RadioButton;
@@ -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. Array of classNames on `string` (or `null`) values
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
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. 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 { { usedRegExp?: RegExp, regExpReplacer?: 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.
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;
@@ -220,14 +220,24 @@ export interface CheckBoxProps extends BasicProps {
220
220
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
221
221
  onChange?: () => void;
222
222
  }
223
- interface RadioButtonItemProps {
223
+ export interface RadioButtonItemProps extends Pick<BasicProps, 'testId' | 'style'> {
224
+ /** `Attribute` `Required` Sets checkbox's text*/
224
225
  label: string;
225
- name: 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 */
226
229
  isChecked?: boolean;
230
+ /** `Attribute` Will disable the checkbox */
227
231
  isDisabled?: boolean;
232
+ /** `Function` Click function, alone does not nothing, but can be reused for other components */
233
+ onChange?: () => void;
228
234
  }
229
235
  export interface RadioButtonProps extends BasicProps {
236
+ /** `Attribute` `Required` Indicates the options contained to be selected */
230
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 */
231
241
  onChange?: () => void;
232
242
  }
233
243
  export {};
@@ -1,6 +1,6 @@
1
1
  interface RegExpRule {
2
- usedRegExp?: RegExp;
3
- regExpReplacer?: string;
2
+ regExp?: RegExp;
3
+ replacer?: string;
4
4
  }
5
5
  export interface ParseTestIdProps {
6
6
  tag: string;
package/dist/index.d.ts CHANGED
@@ -213,6 +213,34 @@ interface FileProps extends BasicProps {
213
213
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
214
214
  onClick?: () => void;
215
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
+ }
216
244
 
217
245
  declare const Button: React.FC<ButtonProps>;
218
246
 
@@ -240,4 +268,8 @@ declare const Select: React.FC<SelectProps>;
240
268
 
241
269
  declare const File: React.FC<FileProps>;
242
270
 
243
- export { Block, Box, Button, Column, Delete, File, Icon, Input, ProgressBar, Select, Tag, TextArea, Title };
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.20.1",
4
- "description": "A typescript-react-based component library based on bulma",
3
+ "version": "2.0.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://github.com/NicolasOmar/reactive-bulma#readme",
19
+ "homepage": "https://reactivebulma.netlify.app",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "https://github.com/NicolasOmar/reactive-bulma.git"
@@ -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,56 +47,56 @@
45
47
  "semantic-release": "semantic-release"
46
48
  },
47
49
  "devDependencies": {
48
- "@babel/core": "^7.22.8",
49
- "@babel/preset-env": "^7.22.7",
50
+ "@babel/core": "^7.22.9",
51
+ "@babel/preset-env": "^7.22.9",
50
52
  "@babel/preset-react": "^7.22.5",
51
53
  "@babel/preset-typescript": "^7.22.5",
52
54
  "@mdi/font": "^7.2.96",
53
- "@rollup/plugin-commonjs": "^25.0.2",
55
+ "@rollup/plugin-commonjs": "^25.0.3",
54
56
  "@rollup/plugin-node-resolve": "^15.1.0",
55
57
  "@rollup/plugin-typescript": "^11.1.2",
56
58
  "@semantic-release/changelog": "^6.0.3",
57
59
  "@semantic-release/commit-analyzer": "^10.0.1",
58
60
  "@semantic-release/exec": "^6.0.3",
59
61
  "@semantic-release/git": "^10.0.1",
60
- "@semantic-release/github": "^9.0.3",
62
+ "@semantic-release/github": "^9.0.4",
61
63
  "@semantic-release/npm": "^10.0.4",
62
64
  "@semantic-release/release-notes-generator": "^11.0.4",
63
- "@storybook/addon-actions": "^7.0.26",
64
- "@storybook/addon-essentials": "^7.0.26",
65
- "@storybook/addon-interactions": "^7.0.26",
66
- "@storybook/addon-links": "^7.0.26",
67
- "@storybook/addon-mdx-gfm": "^7.0.26",
68
- "@storybook/cli": "^7.0.26",
69
- "@storybook/react": "^7.0.26",
70
- "@storybook/react-webpack5": "^7.0.26",
65
+ "@storybook/addon-actions": "^7.2.1",
66
+ "@storybook/addon-essentials": "^7.2.1",
67
+ "@storybook/addon-interactions": "^7.2.1",
68
+ "@storybook/addon-links": "^7.2.1",
69
+ "@storybook/addon-mdx-gfm": "^7.2.1",
70
+ "@storybook/cli": "^7.2.1",
71
+ "@storybook/react": "^7.2.1",
72
+ "@storybook/react-webpack5": "^7.2.1",
71
73
  "@storybook/testing-library": "^0.2.0",
72
- "@testing-library/jest-dom": "^5.16.5",
74
+ "@testing-library/jest-dom": "^5.17.0",
73
75
  "@testing-library/react": "^14.0.0",
74
- "@types/jest": "^29.5.2",
75
- "@types/react": "^18.2.14",
76
- "@typescript-eslint/eslint-plugin": "^5.61.0",
77
- "@typescript-eslint/parser": "^5.61.0",
78
- "babel-jest": "^29.6.1",
76
+ "@types/jest": "^29.5.3",
77
+ "@types/react": "^18.2.18",
78
+ "@typescript-eslint/eslint-plugin": "^6.2.1",
79
+ "@typescript-eslint/parser": "^6.2.1",
80
+ "babel-jest": "^29.6.2",
79
81
  "babel-loader": "^9.1.3",
80
82
  "bulma": "^0.9.4",
81
- "eslint": "^8.44.0",
82
- "eslint-config-prettier": "^8.8.0",
83
- "eslint-plugin-react": "^7.32.2",
83
+ "eslint": "^8.46.0",
84
+ "eslint-config-prettier": "^8.10.0",
85
+ "eslint-plugin-react": "^7.33.1",
84
86
  "husky": "^8.0.3",
85
- "jest": "^29.6.1",
86
- "jest-environment-jsdom": "^29.6.1",
87
+ "jest": "^29.6.2",
88
+ "jest-environment-jsdom": "^29.6.2",
87
89
  "lint-staged": "^13.2.3",
88
- "postcss": "^8.4.25",
89
- "prettier": "^3.0.0",
90
+ "postcss": "^8.4.27",
91
+ "prettier": "^3.0.1",
90
92
  "react": "^18.2.0",
91
93
  "react-dom": "^18.2.0",
92
- "rollup": "^3.26.2",
93
- "rollup-plugin-dts": "^5.3.0",
94
+ "rollup": "^3.27.1",
95
+ "rollup-plugin-dts": "^5.3.1",
94
96
  "rollup-plugin-postcss": "^4.0.2",
95
97
  "semantic-release": "^21.0.7",
96
- "storybook": "^7.0.26",
97
- "tslib": "^2.6.0",
98
+ "storybook": "^7.2.1",
99
+ "tslib": "^2.6.1",
98
100
  "typescript": "^5.1.6"
99
101
  },
100
102
  "lint-staged": {