reactive-bulma 4.3.1 → 4.3.3
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.
- package/dist/components/atoms/Checkbox/index.js +28 -26
- package/dist/components/atoms/Checkbox/index.stories.d.ts +1 -0
- package/dist/components/atoms/RadioButton/index.js +15 -12
- package/dist/components/atoms/Select/index.js +43 -39
- package/dist/components/atoms/Select/index.stories.d.ts +1 -0
- package/dist/interfaces/atomProps.d.ts +10 -5
- package/package.json +1 -2
@@ -1,51 +1,53 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { parseClasses as
|
3
|
-
const
|
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:
|
6
|
-
cssClasses:
|
5
|
+
containerTestId: o = null,
|
6
|
+
cssClasses: a = null,
|
7
7
|
containerCssClasses: n = null,
|
8
8
|
style: d = null,
|
9
9
|
containerStyle: i = null,
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
label: s = null,
|
11
|
+
isChecked: r,
|
12
|
+
name: h,
|
13
|
+
isDisabled: p = !1,
|
13
14
|
onClick: x,
|
14
|
-
onChange:
|
15
|
-
onBlur:
|
15
|
+
onChange: k,
|
16
|
+
onBlur: b
|
16
17
|
}) => {
|
17
|
-
const
|
18
|
+
const u = f([
|
18
19
|
"checkbox",
|
19
20
|
n
|
20
|
-
]),
|
21
|
+
]), C = o ?? c({
|
21
22
|
tag: "checkbox-container",
|
22
|
-
parsedClasses:
|
23
|
-
}), m = e ??
|
23
|
+
parsedClasses: l(s)
|
24
|
+
}), m = e ?? c({
|
24
25
|
tag: "checkbox",
|
25
|
-
parsedClasses:
|
26
|
+
parsedClasses: l(s)
|
26
27
|
});
|
27
|
-
return /* @__PURE__ */
|
28
|
+
return /* @__PURE__ */ y(
|
28
29
|
"label",
|
29
30
|
{
|
30
|
-
"data-testid":
|
31
|
-
className:
|
31
|
+
"data-testid": C,
|
32
|
+
className: u,
|
32
33
|
style: i ?? void 0,
|
33
34
|
children: [
|
34
|
-
/* @__PURE__ */
|
35
|
+
/* @__PURE__ */ t(
|
35
36
|
"input",
|
36
37
|
{
|
37
38
|
"data-testid": m,
|
38
39
|
type: "checkbox",
|
39
|
-
name:
|
40
|
-
className:
|
40
|
+
name: h,
|
41
|
+
className: a ?? void 0,
|
41
42
|
style: d ?? void 0,
|
42
|
-
|
43
|
+
defaultChecked: r,
|
44
|
+
disabled: p,
|
43
45
|
onClick: x,
|
44
|
-
onChange:
|
45
|
-
onBlur:
|
46
|
+
onChange: k,
|
47
|
+
onBlur: b
|
46
48
|
}
|
47
49
|
),
|
48
|
-
/* @__PURE__ */
|
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
|
-
|
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
|
2
|
-
import { useMemo as
|
3
|
-
import { parseClasses as
|
4
|
-
const
|
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__ */
|
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
|
-
|
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
|
-
},
|
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 =
|
53
|
+
const l = y([
|
51
54
|
"control",
|
52
55
|
t
|
53
|
-
]), i = d ??
|
56
|
+
]), i = d ?? C({
|
54
57
|
tag: "container-",
|
55
58
|
parsedClasses: l
|
56
|
-
}), u =
|
59
|
+
}), u = f(
|
57
60
|
() => e.map(
|
58
|
-
(c, p) =>
|
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
|
-
|
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:
|
5
|
-
containerTestId:
|
6
|
-
cssClasses:
|
4
|
+
testId: a = null,
|
5
|
+
containerTestId: o = null,
|
6
|
+
cssClasses: i = null,
|
7
7
|
containerCssClasses: d = null,
|
8
|
-
style:
|
8
|
+
style: u = null,
|
9
9
|
containerStyle: c = null,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
25
|
+
const s = j([
|
24
26
|
"select",
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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 =
|
34
|
+
]), l = a ?? k({
|
33
35
|
tag: "select",
|
34
|
-
parsedClasses:
|
35
|
-
}),
|
36
|
+
parsedClasses: s
|
37
|
+
}), x = o ?? `${l}-container`;
|
36
38
|
return /* @__PURE__ */ e(
|
37
39
|
"section",
|
38
40
|
{
|
39
|
-
"data-testid":
|
40
|
-
className:
|
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:
|
47
|
-
style:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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-${
|
55
|
-
|
56
|
-
|
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
|
-
|
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`
|
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
|
-
|
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
|
212
|
+
/** `Attribute` `Required` Sets radiobutton's text*/
|
208
213
|
label: string;
|
209
|
-
/** `Attribute` Shows the
|
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.
|
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",
|