reactive-bulma 4.3.1 → 4.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,51 +1,53 @@
1
- import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
- import { parseClasses as y, parseTestId as t } from "../../../functions/parsers.js";
3
- const a = (e) => e ? "-with-component" : "", g = ({
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import { parseClasses as f, parseTestId as c } from "../../../functions/parsers.js";
3
+ const l = (e) => e ? "-with-component" : "", v = ({
4
4
  testId: e = null,
5
- containerTestId: c = null,
6
- cssClasses: o = null,
5
+ containerTestId: o = null,
6
+ cssClasses: a = null,
7
7
  containerCssClasses: n = null,
8
8
  style: d = null,
9
9
  containerStyle: i = null,
10
- content: s = null,
11
- name: r,
12
- isDisabled: p = null,
10
+ label: s = null,
11
+ isChecked: r,
12
+ name: h,
13
+ isDisabled: p = !1,
13
14
  onClick: x,
14
- onChange: b,
15
- onBlur: h
15
+ onChange: k,
16
+ onBlur: b
16
17
  }) => {
17
- const k = y([
18
+ const u = f([
18
19
  "checkbox",
19
20
  n
20
- ]), u = c ?? t({
21
+ ]), C = o ?? c({
21
22
  tag: "checkbox-container",
22
- parsedClasses: a(s)
23
- }), m = e ?? t({
23
+ parsedClasses: l(s)
24
+ }), m = e ?? c({
24
25
  tag: "checkbox",
25
- parsedClasses: a(s)
26
+ parsedClasses: l(s)
26
27
  });
27
- return /* @__PURE__ */ C(
28
+ return /* @__PURE__ */ y(
28
29
  "label",
29
30
  {
30
- "data-testid": u,
31
- className: k,
31
+ "data-testid": C,
32
+ className: u,
32
33
  style: i ?? void 0,
33
34
  children: [
34
- /* @__PURE__ */ l(
35
+ /* @__PURE__ */ t(
35
36
  "input",
36
37
  {
37
38
  "data-testid": m,
38
39
  type: "checkbox",
39
- name: r,
40
- className: o ?? void 0,
40
+ name: h,
41
+ className: a ?? void 0,
41
42
  style: d ?? void 0,
42
- disabled: p ?? !1,
43
+ defaultChecked: r,
44
+ disabled: p,
43
45
  onClick: x,
44
- onChange: b,
45
- onBlur: h
46
+ onChange: k,
47
+ onBlur: b
46
48
  }
47
49
  ),
48
- /* @__PURE__ */ l("p", { style: {
50
+ /* @__PURE__ */ t("p", { style: {
49
51
  display: "inline-block",
50
52
  marginLeft: "5px"
51
53
  }, children: s })
@@ -54,5 +56,5 @@ const a = (e) => e ? "-with-component" : "", g = ({
54
56
  );
55
57
  };
56
58
  export {
57
- g as default
59
+ v as default
58
60
  };
@@ -3,4 +3,5 @@ import { default as Checkbox } from '.';
3
3
  declare const _default: Meta<typeof Checkbox>;
4
4
  export default _default;
5
5
  export declare const BasicExample: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').CheckBoxProps>;
6
+ export declare const Checked: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').CheckBoxProps>;
6
7
  export declare const Disabled: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').CheckBoxProps>;
@@ -1,7 +1,7 @@
1
- import { jsx as m, jsxs as f } from "react/jsx-runtime";
2
- import { useMemo as C } from "react";
3
- import { parseClasses as B, parseTestId as b } from "../../../functions/parsers.js";
4
- const h = (d, t) => {
1
+ import { jsx as m, jsxs as B } from "react/jsx-runtime";
2
+ import { useMemo as f } from "react";
3
+ import { parseClasses as y, parseTestId as C } from "../../../functions/parsers.js";
4
+ const b = (d, t) => {
5
5
  const {
6
6
  testId: r = null,
7
7
  label: e,
@@ -13,7 +13,7 @@ const h = (d, t) => {
13
13
  onChange: i,
14
14
  onBlur: u
15
15
  } = d, c = r ?? `test-radio-button-item-${t}`;
16
- return /* @__PURE__ */ f(
16
+ return /* @__PURE__ */ B(
17
17
  "label",
18
18
  {
19
19
  className: "radio",
@@ -32,12 +32,15 @@ const h = (d, t) => {
32
32
  onBlur: u
33
33
  }
34
34
  ),
35
- e
35
+ /* @__PURE__ */ m("p", { style: {
36
+ display: "inline-block",
37
+ marginLeft: "5px"
38
+ }, children: e })
36
39
  ]
37
40
  },
38
41
  t
39
42
  );
40
- }, T = ({
43
+ }, x = ({
41
44
  containerTestId: d = null,
42
45
  containerCssClasses: t = null,
43
46
  containerStyle: r = null,
@@ -47,15 +50,15 @@ const h = (d, t) => {
47
50
  onChange: o,
48
51
  onBlur: n
49
52
  }) => {
50
- const l = B([
53
+ const l = y([
51
54
  "control",
52
55
  t
53
- ]), i = d ?? b({
56
+ ]), i = d ?? C({
54
57
  tag: "container-",
55
58
  parsedClasses: l
56
- }), u = C(
59
+ }), u = f(
57
60
  () => e.map(
58
- (c, p) => h(
61
+ (c, p) => b(
59
62
  {
60
63
  ...c,
61
64
  name: s,
@@ -79,5 +82,5 @@ const h = (d, t) => {
79
82
  );
80
83
  };
81
84
  export {
82
- T as default
85
+ x as default
83
86
  };
@@ -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
3
  const q = ({
4
- testId: n = null,
5
- containerTestId: a = null,
6
- cssClasses: o = null,
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,
13
- 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,
10
+ isDisabled: r,
11
+ options: p = [],
12
+ selectedValues: m,
13
+ name: f,
14
+ showOptions: v = 1,
15
+ isMultiple: t = !1,
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
- const t = j([
25
+ const s = j([
24
26
  "select",
25
- p,
26
- f,
27
- s ? "is-multiple" : null,
28
- h ? "is-rounded" : null,
29
- v ? "is-hovered" : null,
30
- C ? "is-focused" : null,
27
+ S,
28
+ h,
29
+ t ? "is-multiple" : 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
- parsedClasses: t
35
- }), $ = a ?? `${l}-container`;
36
+ parsedClasses: s
37
+ }), x = o ?? `${l}-container`;
36
38
  return /* @__PURE__ */ e(
37
39
  "section",
38
40
  {
39
- "data-testid": $,
40
- className: t,
41
+ "data-testid": x,
42
+ className: s,
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,
49
- multiple: s,
50
- size: m,
51
- children: u.map(({ id: g, name: x, selected: y }, N) => /* @__PURE__ */ e(
48
+ className: i ?? void 0,
49
+ style: u ?? void 0,
50
+ defaultValue: m,
51
+ name: f,
52
+ disabled: r ?? !1,
53
+ multiple: t,
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
  )
@@ -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>;
@@ -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 */
@@ -198,15 +201,17 @@ export interface FileProps extends ComposedElementProps, InteractiveProps, Named
198
201
  size?: ElementSizeType;
199
202
  }
200
203
  export interface CheckBoxProps extends ComposedElementProps, InteractiveOnChangeProps, NamedInputProps {
204
+ /** `Attribute` Shows the checkbox as checked or unchecked */
205
+ isChecked?: boolean;
201
206
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
202
- content?: string;
207
+ label?: string;
203
208
  /** `Attribute` Will disable the checkbox */
204
209
  isDisabled?: boolean;
205
210
  }
206
211
  export interface RadioButtonItemProps extends Pick<ElementProps, 'testId' | 'style'>, InteractiveOnChangeProps, NamedInputProps {
207
- /** `Attribute` `Required` Sets checkbox's text*/
212
+ /** `Attribute` `Required` Sets radiobutton's text*/
208
213
  label: string;
209
- /** `Attribute` Shows the checkbox as checked or unchecked */
214
+ /** `Attribute` Shows the radiobutton as checked or unchecked */
210
215
  isChecked?: boolean;
211
216
  /** `Attribute` Will disable the checkbox */
212
217
  isDisabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-bulma",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "type": "module",
5
5
  "description": "A component library based on React, Bulma, Typescript and Vite",
6
6
  "keywords": [
@@ -102,7 +102,6 @@
102
102
  "eslint-plugin-storybook": "^0.11.1",
103
103
  "glob": "^11.0.0",
104
104
  "globals": "^15.14.0",
105
- "husky": "^9.1.7",
106
105
  "hygen": "^6.2.11",
107
106
  "jest": "^29.7.0",
108
107
  "jest-environment-jsdom": "^29.7.0",