reactive-bulma 5.0.1 → 5.0.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.
|
@@ -1,92 +1,114 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsxs as i, Fragment as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l } from "react";
|
|
3
3
|
import d from "../../atoms/Button/index.js";
|
|
4
4
|
import T from "../../atoms/TextArea/index.js";
|
|
5
5
|
import h from "../../atoms/Select/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { FormFieldType as
|
|
10
|
-
const
|
|
6
|
+
import N from "../../atoms/Checkbox/index.js";
|
|
7
|
+
import g from "../../atoms/RadioButton/index.js";
|
|
8
|
+
import b from "../InputControl/index.js";
|
|
9
|
+
import { FormFieldType as n } from "../../../interfaces/moleculeProps.js";
|
|
10
|
+
const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
11
11
|
if (o === null) return null;
|
|
12
|
-
const
|
|
12
|
+
const e = {
|
|
13
13
|
testId: o.config?.testId ?? c ?? `test-form-field-${o.type}`,
|
|
14
14
|
containerTestId: c ?? `test-form-field-container-${o.type}`
|
|
15
|
-
}
|
|
15
|
+
}, r = o.fieldLabel ? /* @__PURE__ */ t(
|
|
16
|
+
"label",
|
|
17
|
+
{
|
|
18
|
+
"data-testid": `test-form-field-${o.type}-label`,
|
|
19
|
+
className: "label",
|
|
20
|
+
children: o.fieldLabel
|
|
21
|
+
}
|
|
22
|
+
) : null;
|
|
16
23
|
switch (o.type) {
|
|
17
|
-
case
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
24
|
+
case n.INPUT:
|
|
25
|
+
return /* @__PURE__ */ t(
|
|
26
|
+
b,
|
|
20
27
|
{
|
|
21
28
|
...o.config,
|
|
22
|
-
...
|
|
23
|
-
isHorizontal:
|
|
29
|
+
...e,
|
|
30
|
+
isHorizontal: s
|
|
24
31
|
}
|
|
25
32
|
);
|
|
26
|
-
case
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
case n.SELECT:
|
|
34
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
35
|
+
r,
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
h,
|
|
38
|
+
{
|
|
39
|
+
...o.config,
|
|
40
|
+
...e
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
case n.CHECKBOX:
|
|
45
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
46
|
+
r,
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
N,
|
|
49
|
+
{
|
|
50
|
+
...o.config,
|
|
51
|
+
...e
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
case n.RADIOBUTTON:
|
|
56
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
57
|
+
r,
|
|
58
|
+
/* @__PURE__ */ t(
|
|
59
|
+
g,
|
|
60
|
+
{
|
|
61
|
+
...o.config,
|
|
62
|
+
...e
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
66
|
+
case n.TEXTAREA:
|
|
67
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
68
|
+
r,
|
|
69
|
+
/* @__PURE__ */ t(
|
|
70
|
+
T,
|
|
71
|
+
{
|
|
72
|
+
...o.config,
|
|
73
|
+
...e
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
77
|
+
case n.BUTTON:
|
|
78
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
79
|
+
r,
|
|
80
|
+
/* @__PURE__ */ t(
|
|
81
|
+
d,
|
|
82
|
+
{
|
|
83
|
+
...o.config,
|
|
84
|
+
...e
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
66
88
|
}
|
|
67
|
-
},
|
|
89
|
+
}, R = ({
|
|
68
90
|
testId: c,
|
|
69
91
|
mainInput: o,
|
|
70
|
-
leftInput:
|
|
71
|
-
rightInput:
|
|
72
|
-
isHorizontal:
|
|
92
|
+
leftInput: s = null,
|
|
93
|
+
rightInput: e = null,
|
|
94
|
+
isHorizontal: r = !1
|
|
73
95
|
}) => {
|
|
74
|
-
const f =
|
|
75
|
-
() =>
|
|
76
|
-
[c, o,
|
|
77
|
-
),
|
|
78
|
-
() =>
|
|
79
|
-
[c,
|
|
80
|
-
),
|
|
81
|
-
() =>
|
|
82
|
-
[c,
|
|
96
|
+
const f = l(
|
|
97
|
+
() => a({ testId: c, element: o, isHorizontal: r }),
|
|
98
|
+
[c, o, r]
|
|
99
|
+
), m = l(
|
|
100
|
+
() => a({ testId: c, element: s, isHorizontal: r }),
|
|
101
|
+
[c, s, r]
|
|
102
|
+
), u = l(
|
|
103
|
+
() => a({ testId: c, element: e, isHorizontal: r }),
|
|
104
|
+
[c, e, r]
|
|
83
105
|
);
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
106
|
+
return /* @__PURE__ */ i(p, { children: [
|
|
107
|
+
m,
|
|
86
108
|
f,
|
|
87
|
-
|
|
109
|
+
u
|
|
88
110
|
] });
|
|
89
111
|
};
|
|
90
112
|
export {
|
|
91
|
-
|
|
113
|
+
R as default
|
|
92
114
|
};
|
|
@@ -5,7 +5,11 @@ declare const _default: Meta<typeof FormFieldInput>;
|
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const BasicExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
7
7
|
export declare const SelectCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
8
|
+
export declare const SelectWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
8
9
|
export declare const CheckboxCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
10
|
+
export declare const CheckboxWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
9
11
|
export declare const RadiobuttonCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
12
|
+
export declare const RadiobuttonWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
10
13
|
export declare const TextareaCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
14
|
+
export declare const TextareaWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
11
15
|
export declare const LeftAddonSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
@@ -255,6 +255,7 @@ export declare enum FormFieldType {
|
|
|
255
255
|
export type FormFieldConfig = InputControlProps | SelectProps | CheckBoxProps | RadioButtonProps | TextAreaProps | ButtonProps;
|
|
256
256
|
export interface FormFieldElement {
|
|
257
257
|
type: FormFieldType;
|
|
258
|
+
fieldLabel?: string;
|
|
258
259
|
config: FormFieldConfig;
|
|
259
260
|
}
|
|
260
261
|
export interface FormFieldInputProps extends ElementProps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactive-bulma",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A component library based on React, Bulma, Typescript and Vite",
|
|
6
6
|
"keywords": [
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"@semantic-release/github": "^12.0.2",
|
|
69
69
|
"@semantic-release/npm": "^13.1.2",
|
|
70
70
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
71
|
-
"@storybook/addon-docs": "^10.1.
|
|
72
|
-
"@storybook/addon-links": "^10.1.
|
|
73
|
-
"@storybook/addon-onboarding": "^10.1.
|
|
74
|
-
"@storybook/addon-themes": "^10.1.
|
|
75
|
-
"@storybook/react-vite": "^10.1.
|
|
71
|
+
"@storybook/addon-docs": "^10.1.4",
|
|
72
|
+
"@storybook/addon-links": "^10.1.4",
|
|
73
|
+
"@storybook/addon-onboarding": "^10.1.4",
|
|
74
|
+
"@storybook/addon-themes": "^10.1.4",
|
|
75
|
+
"@storybook/react-vite": "^10.1.4",
|
|
76
76
|
"@testing-library/jest-dom": "^6.9.1",
|
|
77
77
|
"@testing-library/react": "^16.3.0",
|
|
78
78
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@types/node": "^24.10.1",
|
|
82
82
|
"@types/react": "^19.2.7",
|
|
83
83
|
"@types/react-dom": "^19.2.3",
|
|
84
|
-
"@typescript-eslint/eslint-plugin": "^8.48.
|
|
85
|
-
"@typescript-eslint/parser": "^8.48.
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^8.48.1",
|
|
85
|
+
"@typescript-eslint/parser": "^8.48.1",
|
|
86
86
|
"@vitejs/plugin-react": "^5.1.1",
|
|
87
87
|
"babel-jest": "^30.2.0",
|
|
88
88
|
"babel-loader": "^10.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"eslint-plugin-react": "^7.37.5",
|
|
93
93
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
94
94
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
95
|
-
"eslint-plugin-storybook": "^10.1.
|
|
95
|
+
"eslint-plugin-storybook": "^10.1.4",
|
|
96
96
|
"glob": "^13.0.0",
|
|
97
97
|
"globals": "^16.5.0",
|
|
98
98
|
"husky": "^9.1.7",
|
|
@@ -101,15 +101,15 @@
|
|
|
101
101
|
"jest-environment-jsdom": "^30.2.0",
|
|
102
102
|
"lint-staged": "^16.2.7",
|
|
103
103
|
"npm-check-updates": "^19.1.2",
|
|
104
|
-
"prettier": "^3.7.
|
|
105
|
-
"react": "^19.2.
|
|
106
|
-
"react-dom": "^19.2.
|
|
104
|
+
"prettier": "^3.7.4",
|
|
105
|
+
"react": "^19.2.1",
|
|
106
|
+
"react-dom": "^19.2.1",
|
|
107
107
|
"semantic-release": "^25.0.2",
|
|
108
|
-
"storybook": "^10.1.
|
|
108
|
+
"storybook": "^10.1.4",
|
|
109
109
|
"tslib": "^2.8.1",
|
|
110
110
|
"typescript": "~5.9.3",
|
|
111
|
-
"typescript-eslint": "^8.48.
|
|
112
|
-
"vite": "^7.2.
|
|
111
|
+
"typescript-eslint": "^8.48.1",
|
|
112
|
+
"vite": "^7.2.6",
|
|
113
113
|
"vite-plugin-dts": "^4.5.4"
|
|
114
114
|
},
|
|
115
115
|
"lint-staged": {
|