reactive-bulma 4.2.1 → 4.3.0
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.d.ts +2 -2
- package/dist/components/atoms/Checkbox/index.js +28 -28
- package/dist/components/atoms/Checkbox/index.stories.d.ts +4 -7
- package/dist/components/organisms/FormField/index.js +128 -54
- package/dist/components/organisms/FormField/index.stories.d.ts +4 -1
- package/dist/interfaces/atomProps.d.ts +1 -1
- package/dist/interfaces/organismProps.d.ts +17 -6
- package/dist/interfaces/organismProps.js +4 -1
- package/dist/types/domTypes.d.ts +1 -1
- package/package.json +10 -10
@@ -1,47 +1,47 @@
|
|
1
|
-
import { jsxs as C, jsx as
|
2
|
-
import { parseClasses as
|
3
|
-
const
|
1
|
+
import { jsxs as C, jsx as m } from "react/jsx-runtime";
|
2
|
+
import { parseClasses as f, parseTestId as l } from "../../../functions/parsers.js";
|
3
|
+
const t = (s) => s ? "-with-component" : "", v = ({
|
4
4
|
testId: s = null,
|
5
|
-
containerTestId:
|
6
|
-
cssClasses:
|
7
|
-
containerCssClasses:
|
8
|
-
style:
|
9
|
-
containerStyle:
|
5
|
+
containerTestId: a = null,
|
6
|
+
cssClasses: o = null,
|
7
|
+
containerCssClasses: c = null,
|
8
|
+
style: n = null,
|
9
|
+
containerStyle: d = null,
|
10
10
|
content: e = null,
|
11
|
-
name:
|
12
|
-
isDisabled:
|
13
|
-
onClick:
|
14
|
-
onChange:
|
11
|
+
name: r,
|
12
|
+
isDisabled: i = null,
|
13
|
+
onClick: p,
|
14
|
+
onChange: u,
|
15
15
|
onBlur: x
|
16
16
|
}) => {
|
17
|
-
const
|
17
|
+
const b = f([
|
18
18
|
"checkbox",
|
19
|
-
|
20
|
-
]),
|
19
|
+
c
|
20
|
+
]), h = a ?? l({
|
21
21
|
tag: "checkbox-container",
|
22
|
-
parsedClasses:
|
22
|
+
parsedClasses: t(e)
|
23
23
|
}), k = s ?? l({
|
24
24
|
tag: "checkbox",
|
25
|
-
parsedClasses:
|
25
|
+
parsedClasses: t(e)
|
26
26
|
});
|
27
27
|
return /* @__PURE__ */ C(
|
28
28
|
"label",
|
29
29
|
{
|
30
|
-
"data-testid":
|
31
|
-
className:
|
32
|
-
style:
|
30
|
+
"data-testid": h,
|
31
|
+
className: b,
|
32
|
+
style: d ?? void 0,
|
33
33
|
children: [
|
34
|
-
/* @__PURE__ */
|
34
|
+
/* @__PURE__ */ m(
|
35
35
|
"input",
|
36
36
|
{
|
37
37
|
"data-testid": k,
|
38
38
|
type: "checkbox",
|
39
|
-
name:
|
40
|
-
className:
|
41
|
-
style:
|
42
|
-
disabled:
|
43
|
-
onClick:
|
44
|
-
onChange:
|
39
|
+
name: r,
|
40
|
+
className: o ?? void 0,
|
41
|
+
style: n ?? void 0,
|
42
|
+
disabled: i ?? !1,
|
43
|
+
onClick: p,
|
44
|
+
onChange: u,
|
45
45
|
onBlur: x
|
46
46
|
}
|
47
47
|
),
|
@@ -51,5 +51,5 @@ const a = (s) => typeof s == "string" ? `-${s == null ? void 0 : s.toString()}`
|
|
51
51
|
);
|
52
52
|
};
|
53
53
|
export {
|
54
|
-
|
54
|
+
v as default
|
55
55
|
};
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import { Meta } from '@storybook/react';
|
2
|
-
import { default as
|
3
|
-
|
4
|
-
declare const _default: Meta<typeof CheckBox>;
|
2
|
+
import { default as Checkbox } from '.';
|
3
|
+
declare const _default: Meta<typeof Checkbox>;
|
5
4
|
export default _default;
|
6
|
-
export declare const BasicExample: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckBoxProps>;
|
7
|
-
export declare const
|
8
|
-
export declare const WithComponentContent: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckBoxProps>;
|
9
|
-
export declare const Disabled: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckBoxProps>;
|
5
|
+
export declare const BasicExample: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').CheckBoxProps>;
|
6
|
+
export declare const Disabled: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').CheckBoxProps>;
|
@@ -1,76 +1,150 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { parseClasses as
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
) : null, p = (e, l) => l ? Array.isArray(e) ? e.map((a, c) => /* @__PURE__ */ s(
|
14
|
-
m,
|
15
|
-
{
|
16
|
-
testId: `test-grouped-input-control-${c}`,
|
17
|
-
...a
|
18
|
-
},
|
19
|
-
`grouped-input-control-${n()}`
|
20
|
-
)) : /* @__PURE__ */ s(m, { ...e }) : Array.isArray(e) ? /* @__PURE__ */ s(m, { ...e[0] }) : /* @__PURE__ */ s(m, { ...e }), I = (e) => {
|
1
|
+
import { jsx as t, jsxs as c, Fragment as a } from "react/jsx-runtime";
|
2
|
+
import B, { useMemo as F } from "react";
|
3
|
+
import E from "../../molecules/InputControl/index.js";
|
4
|
+
import { parseClasses as T, parseTestId as I } from "../../../functions/parsers.js";
|
5
|
+
import $ from "../../atoms/TextArea/index.js";
|
6
|
+
import x from "../../atoms/Select/index.js";
|
7
|
+
import S from "../../atoms/Checkbox/index.js";
|
8
|
+
import K from "../../atoms/RadioButton/index.js";
|
9
|
+
import { FormFieldType as n } from "../../../interfaces/organismProps.js";
|
10
|
+
import { generateKey as h } from "../../../functions/generators.js";
|
11
|
+
const m = (e) => {
|
21
12
|
if (!e) return null;
|
22
|
-
const
|
13
|
+
const s = T(["help", e.color]), l = I({
|
23
14
|
tag: "form-field-help",
|
24
|
-
parsedClasses:
|
15
|
+
parsedClasses: s,
|
25
16
|
rules: [{ regExp: /help|is/gm, replacer: "" }]
|
26
17
|
});
|
27
|
-
return /* @__PURE__ */
|
18
|
+
return /* @__PURE__ */ t(
|
28
19
|
"p",
|
29
20
|
{
|
30
|
-
"data-testid":
|
31
|
-
className:
|
21
|
+
"data-testid": l,
|
22
|
+
className: s,
|
32
23
|
children: e.text
|
33
24
|
}
|
34
25
|
);
|
35
|
-
},
|
26
|
+
}, f = (e, s, l) => {
|
27
|
+
const r = {
|
28
|
+
key: s,
|
29
|
+
testId: l ?? `test-form-field-${e.type}`,
|
30
|
+
containerTestId: l ?? `test-form-field-container-${e.type}`
|
31
|
+
};
|
32
|
+
switch (e.type) {
|
33
|
+
case n.INPUT:
|
34
|
+
return /* @__PURE__ */ c(a, { children: [
|
35
|
+
/* @__PURE__ */ t(
|
36
|
+
E,
|
37
|
+
{
|
38
|
+
...e.config,
|
39
|
+
...r
|
40
|
+
}
|
41
|
+
),
|
42
|
+
m(e.helper)
|
43
|
+
] });
|
44
|
+
case n.SELECT:
|
45
|
+
return /* @__PURE__ */ c(a, { children: [
|
46
|
+
/* @__PURE__ */ t(
|
47
|
+
x,
|
48
|
+
{
|
49
|
+
...e.config,
|
50
|
+
...r
|
51
|
+
}
|
52
|
+
),
|
53
|
+
m(e.helper)
|
54
|
+
] });
|
55
|
+
case n.CHECKBOX:
|
56
|
+
return /* @__PURE__ */ c(a, { children: [
|
57
|
+
/* @__PURE__ */ t(
|
58
|
+
S,
|
59
|
+
{
|
60
|
+
...e.config,
|
61
|
+
...r
|
62
|
+
}
|
63
|
+
),
|
64
|
+
m(e.helper)
|
65
|
+
] });
|
66
|
+
case n.RADIOBUTTON:
|
67
|
+
return /* @__PURE__ */ c(a, { children: [
|
68
|
+
/* @__PURE__ */ t(
|
69
|
+
K,
|
70
|
+
{
|
71
|
+
...e.config,
|
72
|
+
...r
|
73
|
+
}
|
74
|
+
),
|
75
|
+
m(e.helper)
|
76
|
+
] });
|
77
|
+
case n.TEXTAREA:
|
78
|
+
return /* @__PURE__ */ c(a, { children: [
|
79
|
+
/* @__PURE__ */ t(
|
80
|
+
$,
|
81
|
+
{
|
82
|
+
...e.config,
|
83
|
+
...r
|
84
|
+
}
|
85
|
+
),
|
86
|
+
m(e.helper)
|
87
|
+
] });
|
88
|
+
default:
|
89
|
+
return null;
|
90
|
+
}
|
91
|
+
}, R = (e, s) => {
|
92
|
+
const l = s ? `grouped-input-control-body-${h()}` : `input-control-body-${h()}`;
|
93
|
+
return s ? Array.isArray(e) ? e.map(
|
94
|
+
(r, i) => f(
|
95
|
+
r,
|
96
|
+
l,
|
97
|
+
`test-grouped-input-control-${i}`
|
98
|
+
)
|
99
|
+
) : f(e) : Array.isArray(e) ? f(e[0], l) : f(e, l);
|
100
|
+
}, M = ({
|
36
101
|
testId: e = null,
|
37
|
-
cssClasses:
|
38
|
-
style:
|
39
|
-
labelText:
|
40
|
-
inputControlConfig:
|
41
|
-
|
42
|
-
|
43
|
-
isGrouped: t = !1
|
102
|
+
cssClasses: s = null,
|
103
|
+
style: l = null,
|
104
|
+
labelText: r = null,
|
105
|
+
inputControlConfig: i,
|
106
|
+
isHorizontal: o = !1,
|
107
|
+
isGrouped: p = !1
|
44
108
|
}) => {
|
45
|
-
|
46
|
-
const y = N([
|
109
|
+
const y = T([
|
47
110
|
"field",
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
]),
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
111
|
+
o ? "is-horizontal" : null,
|
112
|
+
p ? "is-grouped" : null,
|
113
|
+
s
|
114
|
+
]), b = e ?? I({ tag: "field", parsedClasses: y }), A = F(() => {
|
115
|
+
const d = r !== null ? /* @__PURE__ */ t(
|
116
|
+
"label",
|
117
|
+
{
|
118
|
+
"data-testid": "test-form-field-label",
|
119
|
+
className: "label",
|
120
|
+
children: r
|
121
|
+
}
|
122
|
+
) : null;
|
123
|
+
return o ? /* @__PURE__ */ t("section", { className: "field-label", children: d }) : d;
|
124
|
+
}, [o, r]), N = F(() => {
|
125
|
+
const d = R(i, p), u = `input-control-container-${h()}`;
|
126
|
+
return o ? /* @__PURE__ */ t(
|
127
|
+
"section",
|
128
|
+
{
|
129
|
+
className: "field-body",
|
130
|
+
children: d
|
131
|
+
},
|
132
|
+
u
|
133
|
+
) : /* @__PURE__ */ t(B.Fragment, { children: d }, u);
|
134
|
+
}, [o, i, p]);
|
135
|
+
return /* @__PURE__ */ c(
|
56
136
|
"section",
|
57
137
|
{
|
58
|
-
"data-testid":
|
138
|
+
"data-testid": b,
|
59
139
|
className: y,
|
60
|
-
style:
|
140
|
+
style: l ?? void 0,
|
61
141
|
children: [
|
62
|
-
|
63
|
-
|
64
|
-
p(r, t),
|
65
|
-
I(d)
|
66
|
-
] }) : /* @__PURE__ */ u(A.Fragment, { children: [
|
67
|
-
p(r, t),
|
68
|
-
I(d)
|
69
|
-
] })
|
142
|
+
A,
|
143
|
+
N
|
70
144
|
]
|
71
145
|
}
|
72
146
|
);
|
73
147
|
};
|
74
148
|
export {
|
75
|
-
|
149
|
+
M as default
|
76
150
|
};
|
@@ -7,5 +7,8 @@ export declare const WithLabel: import('@storybook/csf').AnnotatedStoryFn<import
|
|
7
7
|
export declare const WithLabelAndHelper: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
8
8
|
export declare const ErrorCase: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
9
9
|
export declare const GroupedInputs: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
10
|
-
export declare const ExpandedAndGroupedInputs: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
11
10
|
export declare const Horizontal: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
11
|
+
export declare const SelectCase: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
12
|
+
export declare const CheckboxCase: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
13
|
+
export declare const RadiobuttonCase: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
14
|
+
export declare const TextareaCase: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
@@ -199,7 +199,7 @@ export interface FileProps extends ComposedElementProps, InteractiveProps, Named
|
|
199
199
|
}
|
200
200
|
export interface CheckBoxProps extends ComposedElementProps, InteractiveOnChangeProps, NamedInputProps {
|
201
201
|
/** `Attribute` Sets checkbox's text that will be shown next to its control */
|
202
|
-
content?:
|
202
|
+
content?: string;
|
203
203
|
/** `Attribute` Will disable the checkbox */
|
204
204
|
isDisabled?: boolean;
|
205
205
|
}
|
@@ -1,19 +1,30 @@
|
|
1
1
|
import { ClickeableProps, ElementProps } from './commonProps';
|
2
2
|
import { InputControlProps, LevelItemProps, NavBarBrandProps, NavBarDropdownProps, PanelBlockProps, PanelTabsProps, TableRowProps } from './moleculeProps';
|
3
|
-
import { ImageProps, NavBarItemProps, TableHeadCellProps, TileProps } from './atomProps';
|
3
|
+
import { CheckBoxProps, ImageProps, NavBarItemProps, RadioButtonProps, SelectProps, TableHeadCellProps, TextAreaProps, TileProps } from './atomProps';
|
4
4
|
import { BasicColorType, SizeWithHeightType } from '../types/styleTypes';
|
5
5
|
import { ChildrenType, NavBarFixedPositionType } from '../types/domTypes';
|
6
|
-
export
|
6
|
+
export declare enum FormFieldType {
|
7
|
+
INPUT = "input",
|
8
|
+
SELECT = "select",
|
9
|
+
CHECKBOX = "checkbox",
|
10
|
+
RADIOBUTTON = "radiobutton",
|
11
|
+
TEXTAREA = "textarea"
|
12
|
+
}
|
13
|
+
export type FormFieldConfig = InputControlProps | SelectProps | CheckBoxProps | RadioButtonProps | TextAreaProps;
|
14
|
+
export interface FormFieldHelper {
|
7
15
|
text?: string;
|
8
16
|
color?: BasicColorType;
|
9
17
|
}
|
18
|
+
export interface FormFieldInputProps {
|
19
|
+
type: FormFieldType;
|
20
|
+
config: FormFieldConfig;
|
21
|
+
helper?: FormFieldHelper;
|
22
|
+
}
|
10
23
|
export interface FormFieldProps extends ElementProps {
|
11
|
-
/** `Attribute` `Required` Single or multiple `
|
12
|
-
inputControlConfig:
|
24
|
+
/** `Attribute` `Required` Single or multiple `FormFieldConfig` config objects which will be wrapped around the `FormField` */
|
25
|
+
inputControlConfig: FormFieldInputProps | FormFieldInputProps[];
|
13
26
|
/** `Attribute` Sets a custom text before the wrapped input to indicate its usage */
|
14
27
|
labelText?: string;
|
15
|
-
/** `Attribute` Adds a helper text below the wrapped paragraph to provide context information */
|
16
|
-
helperConfig?: FormFieldHelperProps;
|
17
28
|
/** `Styling` Will adjust field's sections (label, input/s and helper) in horizontal position */
|
18
29
|
isHorizontal?: boolean;
|
19
30
|
/** `Styling` Will group the list of inputs in a same wrapper (useful for several inputs with same usage, as a complex address) */
|
package/dist/types/domTypes.d.ts
CHANGED
@@ -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';
|
3
|
+
export type InputType = 'text' | 'password' | 'email' | 'tel' | 'number';
|
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
|
+
"version": "4.3.0",
|
4
4
|
"type": "module",
|
5
5
|
"description": "A component library based on React, Bulma, Typescript and Vite",
|
6
6
|
"keywords": [
|
@@ -63,7 +63,7 @@
|
|
63
63
|
"@babel/preset-react": "^7.26.3",
|
64
64
|
"@babel/preset-typescript": "^7.26.0",
|
65
65
|
"@eslint/compat": "^1.2.4",
|
66
|
-
"@eslint/js": "^9.
|
66
|
+
"@eslint/js": "^9.17.0",
|
67
67
|
"@mdi/font": "^7.4.47",
|
68
68
|
"@semantic-release/changelog": "^6.0.3",
|
69
69
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@semantic-release/git": "^10.0.1",
|
72
72
|
"@semantic-release/github": "^11.0.1",
|
73
73
|
"@semantic-release/npm": "^12.0.1",
|
74
|
-
"@semantic-release/release-notes-generator": "^14.0.
|
74
|
+
"@semantic-release/release-notes-generator": "^14.0.2",
|
75
75
|
"@storybook/addon-essentials": "^8.4.7",
|
76
76
|
"@storybook/addon-interactions": "^8.4.7",
|
77
77
|
"@storybook/addon-links": "^8.4.7",
|
@@ -85,16 +85,16 @@
|
|
85
85
|
"@testing-library/user-event": "^14.5.2",
|
86
86
|
"@types/css-modules": "^1.0.5",
|
87
87
|
"@types/jest": "^29.5.14",
|
88
|
-
"@types/node": "^22.10.
|
88
|
+
"@types/node": "^22.10.2",
|
89
89
|
"@types/react": "^19.0.1",
|
90
|
-
"@types/react-dom": "^19.0.
|
91
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
92
|
-
"@typescript-eslint/parser": "^8.
|
90
|
+
"@types/react-dom": "^19.0.2",
|
91
|
+
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
92
|
+
"@typescript-eslint/parser": "^8.18.1",
|
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
|
-
"eslint": "^9.
|
97
|
+
"eslint": "^9.17.0",
|
98
98
|
"eslint-config-prettier": "^9.1.0",
|
99
99
|
"eslint-plugin-react": "^7.37.2",
|
100
100
|
"eslint-plugin-react-hooks": "^5.1.0",
|
@@ -106,7 +106,7 @@
|
|
106
106
|
"hygen": "^6.2.11",
|
107
107
|
"jest": "^29.7.0",
|
108
108
|
"jest-environment-jsdom": "^29.7.0",
|
109
|
-
"lint-staged": "^15.2.
|
109
|
+
"lint-staged": "^15.2.11",
|
110
110
|
"npm-check-updates": "^17.1.11",
|
111
111
|
"prettier": "^3.4.2",
|
112
112
|
"react": "^18.3.1",
|
@@ -115,7 +115,7 @@
|
|
115
115
|
"storybook": "^8.4.7",
|
116
116
|
"tslib": "^2.8.1",
|
117
117
|
"typescript": "~5.7.2",
|
118
|
-
"typescript-eslint": "^8.
|
118
|
+
"typescript-eslint": "^8.18.1",
|
119
119
|
"vite": "^6.0.3",
|
120
120
|
"vite-plugin-dts": "^4.3.0"
|
121
121
|
},
|