reactive-bulma 4.3.2 → 4.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,8 @@ const j = ({
12
12
  isReadonly: o = !1,
13
13
  color: r = null,
14
14
  size: p = null,
15
- isRounded: f = null,
16
- isHovered: c = null,
15
+ isRounded: c = null,
16
+ isHovered: f = null,
17
17
  isFocused: m = null,
18
18
  onClick: v,
19
19
  onChange: C,
@@ -23,8 +23,8 @@ const j = ({
23
23
  "input",
24
24
  r,
25
25
  p,
26
- f ? "is-rounded" : null,
27
- c ? "is-hovered" : null,
26
+ c ? "is-rounded" : null,
27
+ f ? "is-hovered" : null,
28
28
  m ? "is-focused" : null,
29
29
  e
30
30
  ]), h = s ?? T({
@@ -37,7 +37,7 @@ const j = ({
37
37
  "data-testid": h,
38
38
  type: u,
39
39
  placeholder: d ?? void 0,
40
- defaultValue: t ?? void 0,
40
+ value: t ?? void 0,
41
41
  name: a,
42
42
  disabled: i,
43
43
  readOnly: o,
@@ -1,64 +1,68 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { parseClasses as j, parseTestId as k } from "../../../functions/parsers.js";
3
- const q = ({
4
- testId: n = null,
5
- containerTestId: a = null,
6
- cssClasses: o = null,
3
+ const w = ({
4
+ testId: a = null,
5
+ containerTestId: o = null,
6
+ cssClasses: i = null,
7
7
  containerCssClasses: d = null,
8
- style: i = null,
8
+ style: u = null,
9
9
  containerStyle: c = null,
10
- options: u = [],
11
- name: r,
12
- showOptions: m = 1,
10
+ isDisabled: r,
11
+ options: p = [],
12
+ selectedValues: m,
13
+ name: f,
14
+ showOptions: v = 1,
13
15
  isMultiple: s = !1,
14
- color: p = null,
15
- size: f = null,
16
- isRounded: h = null,
17
- isHovered: v = null,
18
- isFocused: C = null,
19
- onClick: S,
16
+ color: S = null,
17
+ size: h = null,
18
+ isRounded: $ = null,
19
+ isHovered: g = null,
20
+ isFocused: y = null,
21
+ onClick: C,
20
22
  onChange: I,
21
23
  onBlur: T
22
24
  }) => {
23
25
  const t = j([
24
26
  "select",
25
- p,
26
- f,
27
+ S,
28
+ h,
27
29
  s ? "is-multiple" : null,
28
- h ? "is-rounded" : null,
29
- v ? "is-hovered" : null,
30
- C ? "is-focused" : null,
30
+ $ ? "is-rounded" : null,
31
+ g ? "is-hovered" : null,
32
+ y ? "is-focused" : null,
31
33
  d
32
- ]), l = n ?? k({
34
+ ]), l = a ?? k({
33
35
  tag: "select",
34
36
  parsedClasses: t
35
- }), $ = a ?? `${l}-container`;
37
+ }), x = o ?? `${l}-container`;
36
38
  return /* @__PURE__ */ e(
37
39
  "section",
38
40
  {
39
- "data-testid": $,
41
+ "data-testid": x,
40
42
  className: t,
41
43
  style: c ?? void 0,
42
44
  children: /* @__PURE__ */ e(
43
45
  "select",
44
46
  {
45
47
  "data-testid": l,
46
- className: o ?? void 0,
47
- style: i ?? void 0,
48
- name: r,
48
+ className: i ?? void 0,
49
+ style: u ?? void 0,
50
+ value: m,
51
+ name: f,
52
+ disabled: r ?? !1,
49
53
  multiple: s,
50
- size: m,
51
- children: u.map(({ id: g, name: x, selected: y }, N) => /* @__PURE__ */ e(
54
+ size: v,
55
+ onClick: C,
56
+ onChange: I,
57
+ onBlur: T,
58
+ children: p.map(({ id: n, name: N }, b) => /* @__PURE__ */ e(
52
59
  "option",
53
60
  {
54
- "data-testid": `${l}-option-${N}`,
55
- defaultChecked: y ?? !1,
56
- onClick: S,
57
- onChange: I,
58
- onBlur: T,
59
- children: x
61
+ "data-testid": `${l}-option-${b}`,
62
+ value: n.toString(),
63
+ children: N
60
64
  },
61
- g.toString()
65
+ `key-option-${n.toString()}`
62
66
  ))
63
67
  }
64
68
  )
@@ -66,5 +70,5 @@ const q = ({
66
70
  );
67
71
  };
68
72
  export {
69
- q as default
73
+ w as default
70
74
  };
@@ -5,5 +5,6 @@ export default _default;
5
5
  export declare const OnlyRequiredProps: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
6
6
  export declare const WithOneOption: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
7
7
  export declare const WithSeveralOptions: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
8
+ export declare const Disabled: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
8
9
  export declare const ShowsThreeOptions: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
9
10
  export declare const FirstOptionsSelected: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
@@ -7,16 +7,16 @@ const E = ({
7
7
  value: t = null,
8
8
  name: r,
9
9
  cols: n = null,
10
- rows: u = null,
11
- isDisabled: o = !1,
10
+ rows: o = null,
11
+ isDisabled: u = !1,
12
12
  isReadonly: d = !1,
13
13
  isFixedSize: i = !1,
14
14
  color: x = null,
15
15
  size: p = null,
16
16
  isHovered: c = null,
17
17
  isFocused: f = null,
18
- onClick: m = null,
19
- onChange: v = null
18
+ onClick: v = null,
19
+ onChange: m = null
20
20
  }) => {
21
21
  const e = h([
22
22
  "textarea",
@@ -44,16 +44,16 @@ const E = ({
44
44
  "textarea",
45
45
  {
46
46
  "data-testid": g,
47
- defaultValue: t ?? void 0,
47
+ value: t ?? void 0,
48
48
  name: r,
49
49
  cols: n ?? void 0,
50
- rows: u ?? void 0,
51
- disabled: o,
50
+ rows: o ?? void 0,
51
+ disabled: u,
52
52
  readOnly: d,
53
53
  className: e,
54
54
  style: a ?? void 0,
55
- onClick: m ?? void 0,
56
- onChange: v ?? void 0
55
+ onClick: v ?? void 0,
56
+ onChange: m ?? void 0
57
57
  }
58
58
  );
59
59
  };
@@ -1,36 +1,35 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
2
  import { parseClasses as n, parseTestId as t } from "../../../functions/parsers.js";
3
3
  import "react";
4
- import b from "../../atoms/Image/index.js";
5
- import B from "../../atoms/NavBarItem/index.js";
6
- const x = ({
4
+ import b from "../../atoms/NavBarItem/index.js";
5
+ const C = ({
7
6
  testId: d = null,
8
7
  cssClasses: l = null,
9
8
  style: i = null,
10
9
  brandConfig: o,
11
- isBurgerActive: m = !1
10
+ isBurgerActive: u = !1
12
11
  }) => {
13
- const r = n(["navbar-brand", l]), u = d ?? t({ tag: "navbar-brand", parsedClasses: r }), e = n([
12
+ const r = n(["navbar-brand", l]), c = d ?? t({ tag: "navbar-brand", parsedClasses: r }), s = n([
14
13
  "navbar-burger",
15
- m ? "is-active" : null
16
- ]), c = t({
14
+ u ? "is-active" : null
15
+ ]), p = t({
17
16
  tag: "navbar-burger",
18
- parsedClasses: e
19
- }), { children: p, ...v } = o;
20
- return /* @__PURE__ */ s(
17
+ parsedClasses: s
18
+ }), { children: m, ...v } = o;
19
+ return /* @__PURE__ */ e(
21
20
  "section",
22
21
  {
23
- "data-testid": u,
22
+ "data-testid": c,
24
23
  className: r,
25
24
  style: i ?? void 0,
26
25
  children: [
27
- /* @__PURE__ */ a(B, { ...v, children: /* @__PURE__ */ a(b, { ...p }) }),
28
- /* @__PURE__ */ s(
26
+ /* @__PURE__ */ a(b, { ...v, children: m }),
27
+ /* @__PURE__ */ e(
29
28
  "a",
30
29
  {
31
30
  role: "button",
32
- "data-testid": c,
33
- className: e,
31
+ "data-testid": p,
32
+ className: s,
34
33
  "aria-label": "menu",
35
34
  "aria-expanded": "false",
36
35
  children: [
@@ -45,5 +44,5 @@ const x = ({
45
44
  );
46
45
  };
47
46
  export {
48
- x as default
47
+ C as default
49
48
  };
@@ -159,11 +159,14 @@ export interface DeleteProps extends ElementProps, ClickeableProps {
159
159
  export interface SelectOption {
160
160
  id: string | number;
161
161
  name: string;
162
- selected?: boolean;
163
162
  }
164
163
  export interface SelectProps extends ComposedElementProps, InteractiveOnChangeProps, NamedInputProps {
165
- /** `Attribute` Indicates the options contained on the select */
164
+ /** `Attribute` Will disable the input */
165
+ isDisabled?: boolean;
166
+ /** `Attribute` Indicates the select contained on the select */
166
167
  options?: SelectOption[];
168
+ /** `Attribute` Will select a different default option if the user provides it. It can be an multiple selection if `isMultiple` is true */
169
+ selectedValues?: string | string[];
167
170
  /** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
168
171
  showOptions?: number;
169
172
  /** `Attribute` Will allow multiple selection */
@@ -16,17 +16,17 @@ export interface ElementProps {
16
16
  }
17
17
  export interface ComposedElementProps extends ElementProps, ContainerProps {
18
18
  }
19
- export interface ClickeableProps {
19
+ export interface ClickeableProps<ElementType = Element, EventType = MouseEvent> {
20
20
  /** `Function` Reffers to each time the user click the element. Alone does not nothing, but can be reused for other components */
21
- onClick?: (event: React.MouseEvent) => void;
21
+ onClick?: (event: React.MouseEvent<ElementType, EventType>) => void;
22
22
  }
23
- export interface ChangeableProps {
23
+ export interface ChangeableProps<ElementType = Element> {
24
24
  /** `Function` Reffers to each time the user press a key. Alone does not nothing, but can be reused for other components */
25
- onChange?: (event: React.ChangeEvent) => void;
25
+ onChange?: (event: React.ChangeEvent<ElementType>) => void;
26
26
  }
27
- export interface BlureableProps {
27
+ export interface BlureableProps<ElementType = Element, RelatedTargetType = Element> {
28
28
  /** `Function` Reffers to each time the user focus out the element. Alone does not nothing, but can be reused for other components */
29
- onBlur?: (event: React.FocusEvent) => void;
29
+ onBlur?: (event: React.FocusEvent<ElementType, RelatedTargetType>) => void;
30
30
  }
31
31
  export interface InteractiveProps extends ClickeableProps, ChangeableProps, BlureableProps {
32
32
  }
@@ -1,5 +1,5 @@
1
1
  import { ClickeableProps, ComposedElementProps, ElementProps } from './commonProps';
2
- import { BreadcrumbItemProps, ButtonProps, CheckBoxProps, ColumnProps, DeleteProps, DropdownItemProps, IconProps, ImageProps, InputProps, MenuItemProps, NavBarItemProps, PaginationItemProps, RadioButtonProps, SelectProps, TabItemProps, TableCellProps, TableHeadCellProps, TextAreaProps } from './atomProps';
2
+ import { BreadcrumbItemProps, ButtonProps, CheckBoxProps, ColumnProps, DeleteProps, DropdownItemProps, IconProps, InputProps, MenuItemProps, NavBarItemProps, PaginationItemProps, RadioButtonProps, SelectProps, TabItemProps, TableCellProps, TableHeadCellProps, TextAreaProps } from './atomProps';
3
3
  import { BasicColorType, RightCenteredAlignType, BreadcrumbSeparatorType, ColumnGapType, SizeWithoutNormalType, TabsFormatType, MediumAndLargeSizeType, RightLeftAlignType } from '../types/styleTypes';
4
4
  import { ChildrenType, SingleChildType, PanelBlockItemType } from '../types/domTypes';
5
5
  export interface ButtonGroupProps extends ElementProps {
@@ -210,7 +210,7 @@ export interface NavBarDropdownProps extends ComposedElementProps {
210
210
  hasBoxedMenu?: boolean;
211
211
  }
212
212
  interface BrandConfigProps extends Omit<NavBarItemProps, 'children'> {
213
- children: ImageProps;
213
+ children: SingleChildType;
214
214
  }
215
215
  export interface NavBarBrandProps extends ElementProps {
216
216
  /** `Attribute` `Required` Configuration object to inject a `NavBarItem` with a Image configuration as its children */
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ButtonType = 'submit' | 'reset' | 'button';
3
- export type InputType = 'text' | 'password' | 'email' | 'tel' | 'number';
3
+ export type InputType = 'text' | 'password' | 'email' | 'tel' | 'number' | 'date';
4
4
  export type DropdownItemType = 'item' | 'link' | 'divider';
5
5
  export type PanelBlockItemType = 'icon' | 'control' | 'button';
6
6
  export type ChildrenType = string | React.ReactElement | React.ReactElement[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-bulma",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "type": "module",
5
5
  "description": "A component library based on React, Bulma, Typescript and Vite",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  "prettier": "prettier src/**/*.{tsx,ts} --write",
42
42
  "prettier:ci": "prettier src/**/*.{tsx,ts} --check",
43
43
  "lint-staged": "lint-staged -v",
44
- "setup": "npm ci",
44
+ "setup": "npm ci && husky",
45
45
  "compile": "tsc -b",
46
46
  "build": "npm run compile && vite build",
47
47
  "build:storybook": "storybook build",
@@ -88,15 +88,15 @@
88
88
  "@types/node": "^22.10.2",
89
89
  "@types/react": "^19.0.2",
90
90
  "@types/react-dom": "^19.0.2",
91
- "@typescript-eslint/eslint-plugin": "^8.18.1",
92
- "@typescript-eslint/parser": "^8.18.1",
91
+ "@typescript-eslint/eslint-plugin": "^8.18.2",
92
+ "@typescript-eslint/parser": "^8.18.2",
93
93
  "@vitejs/plugin-react": "^4.3.4",
94
94
  "babel-jest": "^29.7.0",
95
95
  "babel-loader": "^9.2.1",
96
96
  "bulma": "^0.9.4",
97
97
  "eslint": "^9.17.0",
98
98
  "eslint-config-prettier": "^9.1.0",
99
- "eslint-plugin-react": "^7.37.2",
99
+ "eslint-plugin-react": "^7.37.3",
100
100
  "eslint-plugin-react-hooks": "^5.1.0",
101
101
  "eslint-plugin-react-refresh": "^0.4.16",
102
102
  "eslint-plugin-storybook": "^0.11.1",
@@ -105,8 +105,8 @@
105
105
  "hygen": "^6.2.11",
106
106
  "jest": "^29.7.0",
107
107
  "jest-environment-jsdom": "^29.7.0",
108
- "lint-staged": "^15.2.11",
109
- "npm-check-updates": "^17.1.12",
108
+ "lint-staged": "^15.3.0",
109
+ "npm-check-updates": "^17.1.13",
110
110
  "prettier": "^3.4.2",
111
111
  "react": "^18.3.1",
112
112
  "react-dom": "^18.3.1",
@@ -114,8 +114,8 @@
114
114
  "storybook": "^8.4.7",
115
115
  "tslib": "^2.8.1",
116
116
  "typescript": "~5.7.2",
117
- "typescript-eslint": "^8.18.1",
118
- "vite": "^6.0.5",
117
+ "typescript-eslint": "^8.18.2",
118
+ "vite": "^6.0.6",
119
119
  "vite-plugin-dts": "^4.4.0"
120
120
  },
121
121
  "lint-staged": {