reactive-bulma 4.3.28 → 4.4.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/README.md +1 -0
- package/dist/assets/reactive-bulma.css +1 -1
- package/dist/components/atoms/BreadcrumbItem/index.js +58 -34
- package/dist/components/atoms/BreadcrumbItem/index.stories.d.ts +1 -0
- package/dist/components/atoms/Button/index.js +76 -38
- package/dist/components/atoms/Button/index.stories.d.ts +5 -0
- package/dist/components/atoms/Checkbox/index.js +47 -40
- package/dist/components/atoms/Column/index.js +22 -21
- package/dist/components/atoms/Delete/index.js +22 -17
- package/dist/components/atoms/GridCell/index.d.ts +4 -0
- package/dist/components/atoms/GridCell/index.js +40 -0
- package/dist/components/atoms/GridCell/index.stories.d.ts +5 -0
- package/dist/components/atoms/GridCell/index.test.d.ts +0 -0
- package/dist/components/atoms/Icon/index.js +54 -57
- package/dist/components/atoms/Image/index.js +28 -27
- package/dist/components/atoms/Image/index.stories.d.ts +1 -0
- package/dist/components/atoms/NavBarItem/index.js +7 -7
- package/dist/components/atoms/ProgressBar/index.js +25 -24
- package/dist/components/atoms/RadioButton/index.js +53 -73
- package/dist/components/atoms/Select/index.js +72 -54
- package/dist/components/atoms/TabItem/index.js +34 -30
- package/dist/components/atoms/TableCell/index.js +20 -15
- package/dist/components/atoms/TableCell/index.stories.d.ts +1 -0
- package/dist/components/atoms/TableHeadCell/index.js +22 -14
- package/dist/components/atoms/TableHeadCell/index.stories.d.ts +1 -0
- package/dist/components/atoms/Tag/index.js +36 -69
- package/dist/components/atoms/Tag/index.stories.d.ts +0 -3
- package/dist/components/atoms/TagWithAddon/index.d.ts +4 -0
- package/dist/components/atoms/TagWithAddon/index.js +91 -0
- package/dist/components/atoms/TagWithAddon/index.stories.d.ts +11 -0
- package/dist/components/atoms/TagWithAddon/index.test.d.ts +0 -0
- package/dist/components/atoms/Tile/index.js +31 -29
- package/dist/components/atoms/Title/index.js +28 -16
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/atoms/index.js +36 -32
- package/dist/components/molecules/Breadcrumbs/index.js +48 -49
- package/dist/components/molecules/CheckboxGroup/index.d.ts +4 -0
- package/dist/components/molecules/CheckboxGroup/index.js +34 -0
- package/dist/components/molecules/CheckboxGroup/index.stories.d.ts +5 -0
- package/dist/components/molecules/CheckboxGroup/index.test.d.ts +0 -0
- package/dist/components/molecules/ColumnGroup/index.js +41 -37
- package/dist/components/molecules/Dropdown/index.js +58 -49
- package/dist/components/molecules/Dropdown/index.stories.d.ts +3 -0
- package/dist/components/molecules/FormFieldInput/index.js +68 -85
- package/dist/components/molecules/FormFieldInput/index.stories.d.ts +1 -3
- package/dist/components/molecules/Grid/index.d.ts +4 -0
- package/dist/components/molecules/Grid/index.js +86 -0
- package/dist/components/molecules/Grid/index.stories.d.ts +12 -0
- package/dist/components/molecules/Grid/index.test.d.ts +0 -0
- package/dist/components/molecules/InputControl/index.js +92 -47
- package/dist/components/molecules/InputControl/index.stories.d.ts +2 -0
- package/dist/components/molecules/Menu/index.js +32 -29
- package/dist/components/molecules/MenuList/index.js +33 -30
- package/dist/components/molecules/Message/index.js +32 -26
- package/dist/components/molecules/NavBarBrand/index.js +1 -1
- package/dist/components/molecules/NavBarDropdown/index.js +55 -57
- package/dist/components/molecules/NavBarDropdown/index.stories.d.ts +2 -0
- package/dist/components/molecules/Notification/index.js +26 -25
- package/dist/components/molecules/Pagination/index.js +91 -81
- package/dist/components/molecules/Pagination/index.stories.d.ts +2 -0
- package/dist/components/molecules/Section/index.js +18 -13
- package/dist/components/molecules/TableRow/index.js +41 -32
- package/dist/components/molecules/TableRow/index.stories.d.ts +1 -0
- package/dist/components/molecules/Tabs/index.js +36 -32
- package/dist/components/molecules/TagList/index.d.ts +4 -0
- package/dist/components/molecules/TagList/index.js +31 -0
- package/dist/components/molecules/TagList/index.stories.d.ts +5 -0
- package/dist/components/molecules/TagList/index.test.d.ts +0 -0
- package/dist/components/molecules/TileBox/index.js +1 -1
- package/dist/components/molecules/index.d.ts +3 -0
- package/dist/components/molecules/index.js +26 -20
- package/dist/components/organisms/Card/index.js +84 -72
- package/dist/components/organisms/FormField/index.js +54 -57
- package/dist/components/organisms/FormField/index.stories.d.ts +2 -0
- package/dist/components/organisms/Hero/index.js +26 -20
- package/dist/components/organisms/Level/index.js +43 -30
- package/dist/components/organisms/NavBar/index.js +65 -57
- package/dist/components/organisms/Panel/index.js +33 -27
- package/dist/components/organisms/Table/index.js +2 -2
- package/dist/components/organisms/Table/index.stories.d.ts +1 -0
- package/dist/components/organisms/TileGroup/index.js +31 -36
- package/dist/constants/classes.d.ts +34 -0
- package/dist/constants/classes.js +37 -0
- package/dist/constants/regExp.d.ts +18 -0
- package/dist/constants/regExp.js +23 -0
- package/dist/functions/parsers.js +5 -4
- package/dist/index.js +104 -94
- package/dist/interfaces/atomProps.d.ts +62 -31
- package/dist/interfaces/commonProps.d.ts +5 -0
- package/dist/interfaces/moleculeProps.d.ts +67 -22
- package/dist/interfaces/moleculeProps.js +1 -1
- package/dist/interfaces/organismProps.d.ts +35 -5
- package/dist/types/domTypes.d.ts +4 -3
- package/dist/types/domTypes.js +2 -2
- package/dist/types/styleTypes.d.ts +28 -18
- package/package.json +18 -17
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as T } from "react";
|
|
3
|
+
import { COMMON_CLASSES as l } from "../../../constants/classes.js";
|
|
4
|
+
import { parseClasses as $, parseTestId as b } from "../../../functions/parsers.js";
|
|
5
|
+
import { generateKey as S } from "../../../functions/generators.js";
|
|
4
6
|
import f from "../../atoms/TabItem/index.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
cssClasses: a = null,
|
|
7
|
+
const v = ({
|
|
8
|
+
testId: m = null,
|
|
9
|
+
cssClasses: u = null,
|
|
9
10
|
style: i = null,
|
|
10
|
-
tabs:
|
|
11
|
-
alignment:
|
|
12
|
-
size:
|
|
13
|
-
format:
|
|
11
|
+
tabs: e,
|
|
12
|
+
alignment: t = null,
|
|
13
|
+
size: a = null,
|
|
14
|
+
format: r = null,
|
|
14
15
|
isRounded: d = null,
|
|
15
|
-
isFullWidth:
|
|
16
|
+
isFullWidth: c = null
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
+
const n = $([
|
|
18
19
|
"tabs",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
d ?
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
]),
|
|
26
|
-
|
|
20
|
+
t ? `${l.IS}${t}` : null,
|
|
21
|
+
a ? `${l.IS}${a}` : null,
|
|
22
|
+
r ? `${l.IS}${r}` : null,
|
|
23
|
+
d ? l.TOGGLE_ROUNDED : null,
|
|
24
|
+
c ? l.FULL_WIDTH : null,
|
|
25
|
+
u
|
|
26
|
+
]), p = m ?? b({ tag: "tabs", parsedClasses: n }), I = T(
|
|
27
|
+
() => e.map((o) => /* @__PURE__ */ s(
|
|
28
|
+
"li",
|
|
29
|
+
{
|
|
30
|
+
className: o.isActive ? l.ACTIVE : void 0,
|
|
31
|
+
children: /* @__PURE__ */ s(f, { ...o })
|
|
32
|
+
},
|
|
33
|
+
`tab-item-${S()}`
|
|
34
|
+
)),
|
|
35
|
+
[e]
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ s(
|
|
27
38
|
"section",
|
|
28
39
|
{
|
|
29
|
-
"data-testid":
|
|
30
|
-
className:
|
|
40
|
+
"data-testid": p,
|
|
41
|
+
className: n,
|
|
31
42
|
style: i ?? void 0,
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
"li",
|
|
34
|
-
{
|
|
35
|
-
className: t.isActive ? "is-active" : void 0,
|
|
36
|
-
children: /* @__PURE__ */ l(f, { ...t })
|
|
37
|
-
},
|
|
38
|
-
`tab-item-${h()}`
|
|
39
|
-
)) })
|
|
43
|
+
children: /* @__PURE__ */ s("ul", { children: I })
|
|
40
44
|
}
|
|
41
45
|
);
|
|
42
46
|
};
|
|
43
47
|
export {
|
|
44
|
-
|
|
48
|
+
v as default
|
|
45
49
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { parseClasses as m, parseTestId as n } from "../../../functions/parsers.js";
|
|
4
|
+
import p from "../../atoms/Tag/index.js";
|
|
5
|
+
import { generateKey as g } from "../../../functions/generators.js";
|
|
6
|
+
const C = ({
|
|
7
|
+
testId: a = null,
|
|
8
|
+
cssClasses: e = null,
|
|
9
|
+
style: r = null,
|
|
10
|
+
listOfTags: o
|
|
11
|
+
}) => {
|
|
12
|
+
const s = m(["tags", e]), i = a ?? n({ tag: "tags", parsedClasses: s });
|
|
13
|
+
return /* @__PURE__ */ t(
|
|
14
|
+
"section",
|
|
15
|
+
{
|
|
16
|
+
"data-testid": i,
|
|
17
|
+
className: s,
|
|
18
|
+
style: r ?? void 0,
|
|
19
|
+
children: o.map((l) => /* @__PURE__ */ t(
|
|
20
|
+
p,
|
|
21
|
+
{
|
|
22
|
+
...l
|
|
23
|
+
},
|
|
24
|
+
`tag-list-item-${g()}`
|
|
25
|
+
))
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
C as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { default as TagList } from '.';
|
|
3
|
+
declare const _default: Meta<typeof TagList>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const BasicExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/moleculeProps').TagListProps>;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { parseClasses as d, parseTestId as m } from "../../../functions/parsers.js";
|
|
3
2
|
import "react";
|
|
3
|
+
import { parseClasses as d, parseTestId as m } from "../../../functions/parsers.js";
|
|
4
4
|
import u from "../../atoms/Tile/index.js";
|
|
5
5
|
const T = ({
|
|
6
6
|
testId: r = null,
|
|
@@ -21,3 +21,6 @@ export { default as NavBarBrand } from './NavBarBrand';
|
|
|
21
21
|
export { default as NavBarDropdown } from './NavBarDropdown';
|
|
22
22
|
export { default as TableRow } from './TableRow';
|
|
23
23
|
export { default as FormFieldInput } from './FormFieldInput';
|
|
24
|
+
export { default as TagList } from './TagList';
|
|
25
|
+
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
26
|
+
export { default as Grid } from './Grid';
|
|
@@ -5,44 +5,50 @@ import { default as d } from "./Breadcrumbs/index.js";
|
|
|
5
5
|
import { default as s } from "./Dropdown/index.js";
|
|
6
6
|
import { default as x } from "./Message/index.js";
|
|
7
7
|
import { default as i } from "./Menu/index.js";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
8
|
+
import { default as b } from "./MenuList/index.js";
|
|
9
|
+
import { default as M } from "./Pagination/index.js";
|
|
10
|
+
import { default as G } from "./Modal/index.js";
|
|
11
|
+
import { default as v } from "./Tabs/index.js";
|
|
12
|
+
import { default as C } from "./InputControl/index.js";
|
|
13
|
+
import { default as I } from "./PanelBlock/index.js";
|
|
14
|
+
import { default as N } from "./PanelTabs/index.js";
|
|
15
|
+
import { default as k } from "./LevelItem/index.js";
|
|
16
|
+
import { default as h } from "./TileBox/index.js";
|
|
17
|
+
import { default as S } from "./Footer/index.js";
|
|
18
18
|
import { default as q } from "./Media/index.js";
|
|
19
19
|
import { default as z } from "./Section/index.js";
|
|
20
20
|
import { default as E } from "./NavBarBrand/index.js";
|
|
21
21
|
import { default as J } from "./NavBarDropdown/index.js";
|
|
22
22
|
import { default as O } from "./TableRow/index.js";
|
|
23
23
|
import { default as U } from "./FormFieldInput/index.js";
|
|
24
|
+
import { default as W } from "./TagList/index.js";
|
|
25
|
+
import { default as Y } from "./CheckboxGroup/index.js";
|
|
26
|
+
import { default as _ } from "./Grid/index.js";
|
|
24
27
|
export {
|
|
25
28
|
d as Breadcrumbs,
|
|
26
29
|
e as ButtonGroup,
|
|
30
|
+
Y as CheckboxGroup,
|
|
27
31
|
t as ColumnGroup,
|
|
28
32
|
s as Dropdown,
|
|
29
|
-
|
|
33
|
+
S as Footer,
|
|
30
34
|
U as FormFieldInput,
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
_ as Grid,
|
|
36
|
+
C as InputControl,
|
|
37
|
+
k as LevelItem,
|
|
33
38
|
q as Media,
|
|
34
39
|
i as Menu,
|
|
35
|
-
|
|
40
|
+
b as MenuList,
|
|
36
41
|
x as Message,
|
|
37
|
-
|
|
42
|
+
G as Modal,
|
|
38
43
|
E as NavBarBrand,
|
|
39
44
|
J as NavBarDropdown,
|
|
40
45
|
l as Notification,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
M as Pagination,
|
|
47
|
+
I as PanelBlock,
|
|
48
|
+
N as PanelTabs,
|
|
44
49
|
z as Section,
|
|
45
50
|
O as TableRow,
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
v as Tabs,
|
|
52
|
+
W as TagList,
|
|
53
|
+
h as TileBox
|
|
48
54
|
};
|
|
@@ -1,88 +1,100 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
testId:
|
|
8
|
-
cssClasses:
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as r } from "react";
|
|
3
|
+
import { parseClasses as g, parseTestId as y } from "../../../functions/parsers.js";
|
|
4
|
+
import { generateKey as m } from "../../../functions/generators.js";
|
|
5
|
+
import z from "../../atoms/Image/index.js";
|
|
6
|
+
const A = ({
|
|
7
|
+
testId: h = null,
|
|
8
|
+
cssClasses: u = null,
|
|
9
9
|
style: p = null,
|
|
10
10
|
headerText: c = null,
|
|
11
11
|
image: d = null,
|
|
12
|
-
content:
|
|
12
|
+
content: t,
|
|
13
13
|
footerLinks: l = null
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */ a(
|
|
31
|
-
"button",
|
|
15
|
+
const i = g(["card", u]), a = h ?? y({ tag: "card", parsedClasses: i }), N = r(
|
|
16
|
+
() => c ? /* @__PURE__ */ o(
|
|
17
|
+
"header",
|
|
18
|
+
{
|
|
19
|
+
"data-testid": `${a}-header`,
|
|
20
|
+
className: "card-header",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ e("p", { className: "card-header-title", children: c }),
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
className: "card-header-icon",
|
|
27
|
+
"aria-label": "more options",
|
|
28
|
+
children: /* @__PURE__ */ e("span", { className: "icon", children: /* @__PURE__ */ e(
|
|
29
|
+
"i",
|
|
32
30
|
{
|
|
33
|
-
className: "
|
|
34
|
-
"aria-
|
|
35
|
-
children: /* @__PURE__ */ a("span", { className: "icon", children: /* @__PURE__ */ a(
|
|
36
|
-
"i",
|
|
37
|
-
{
|
|
38
|
-
className: "fas fa-angle-down",
|
|
39
|
-
"aria-hidden": "true"
|
|
40
|
-
}
|
|
41
|
-
) })
|
|
31
|
+
className: "fas fa-angle-down",
|
|
32
|
+
"aria-hidden": "true"
|
|
42
33
|
}
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
) })
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
) : null,
|
|
40
|
+
[c, a]
|
|
41
|
+
), $ = r(
|
|
42
|
+
() => d ? /* @__PURE__ */ e(
|
|
43
|
+
"section",
|
|
44
|
+
{
|
|
45
|
+
"data-testid": `${a}-image`,
|
|
46
|
+
className: "card-image",
|
|
47
|
+
children: /* @__PURE__ */ e(z, { ...d })
|
|
48
|
+
}
|
|
49
|
+
) : null,
|
|
50
|
+
[d, a]
|
|
51
|
+
), f = r(
|
|
52
|
+
() => /* @__PURE__ */ e(
|
|
53
|
+
"section",
|
|
54
|
+
{
|
|
55
|
+
"data-testid": `${a}-content`,
|
|
56
|
+
className: "card-content",
|
|
57
|
+
children: Array.isArray(t) ? t.map((s, n) => /* @__PURE__ */ e(
|
|
56
58
|
"section",
|
|
57
59
|
{
|
|
58
|
-
"data-testid": `${
|
|
59
|
-
className: "
|
|
60
|
-
children:
|
|
61
|
-
"section",
|
|
62
|
-
{
|
|
63
|
-
"data-testid": `${e}-content-item-${r}`,
|
|
64
|
-
className: "content",
|
|
65
|
-
children: t
|
|
66
|
-
},
|
|
67
|
-
`card-content-item-${o()}`
|
|
68
|
-
)) : /* @__PURE__ */ a("section", { className: "content", children: s })
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
l ? /* @__PURE__ */ a("section", { className: "card-footer", children: l.map((t, r) => /* @__PURE__ */ a(
|
|
72
|
-
"a",
|
|
73
|
-
{
|
|
74
|
-
"data-testid": `${e}-footer-item-${r}`,
|
|
75
|
-
className: "card-footer-item",
|
|
76
|
-
"aria-hidden": "true",
|
|
77
|
-
onClick: t.onClick ?? void 0,
|
|
78
|
-
children: t.text
|
|
60
|
+
"data-testid": `${a}-content-item-${n}`,
|
|
61
|
+
className: "content",
|
|
62
|
+
children: s
|
|
79
63
|
},
|
|
80
|
-
`card-
|
|
81
|
-
))
|
|
64
|
+
`card-content-item-${m()}`
|
|
65
|
+
)) : /* @__PURE__ */ e("section", { className: "content", children: t })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
[a, t]
|
|
69
|
+
), C = r(
|
|
70
|
+
() => l ? /* @__PURE__ */ e("section", { className: "card-footer", children: l.map((s, n) => /* @__PURE__ */ e(
|
|
71
|
+
"a",
|
|
72
|
+
{
|
|
73
|
+
"data-testid": `${a}-footer-item-${n}`,
|
|
74
|
+
className: "card-footer-item",
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
onClick: s.onClick ?? void 0,
|
|
77
|
+
children: s.text
|
|
78
|
+
},
|
|
79
|
+
`card-footer-item-${m()}`
|
|
80
|
+
)) }) : null,
|
|
81
|
+
[l, a]
|
|
82
|
+
);
|
|
83
|
+
return /* @__PURE__ */ o(
|
|
84
|
+
"section",
|
|
85
|
+
{
|
|
86
|
+
"data-testid": a,
|
|
87
|
+
className: i,
|
|
88
|
+
style: p ?? void 0,
|
|
89
|
+
children: [
|
|
90
|
+
N,
|
|
91
|
+
$,
|
|
92
|
+
f,
|
|
93
|
+
C
|
|
82
94
|
]
|
|
83
95
|
}
|
|
84
96
|
);
|
|
85
97
|
};
|
|
86
98
|
export {
|
|
87
|
-
|
|
99
|
+
A as default
|
|
88
100
|
};
|
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { parseClasses as
|
|
5
|
-
import { generateKey as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as I } from "react";
|
|
3
|
+
import t from "../../molecules/FormFieldInput/index.js";
|
|
4
|
+
import { parseClasses as h, parseTestId as A } from "../../../functions/parsers.js";
|
|
5
|
+
import { generateKey as m } from "../../../functions/generators.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
testId: c = null,
|
|
8
|
+
cssClasses: i = null,
|
|
9
|
+
style: u = null,
|
|
10
|
+
inputsConfig: e,
|
|
11
|
+
isHorizontal: r = !1,
|
|
12
|
+
isGrouped: s = !1,
|
|
13
|
+
withAddons: p = !1
|
|
14
|
+
}) => {
|
|
15
|
+
const a = h([
|
|
16
|
+
"field",
|
|
17
|
+
r ? "is-horizontal" : null,
|
|
18
|
+
s ? "is-grouped" : null,
|
|
19
|
+
p ? "has-addons" : null,
|
|
20
|
+
i
|
|
21
|
+
]), y = c ?? A({ tag: "field", parsedClasses: a }), d = I(() => {
|
|
22
|
+
const n = s ? `grouped-input-control-body-${m()}` : `input-control-body-${m()}`;
|
|
23
|
+
if (s)
|
|
24
|
+
return Array.isArray(e) ? e.map((l, f) => {
|
|
25
|
+
const F = {
|
|
26
|
+
...l,
|
|
27
|
+
isHorizontal: l.isHorizontal ?? r,
|
|
28
|
+
testId: `test-grouped-input-control-${f}`
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ o(
|
|
31
|
+
t,
|
|
32
|
+
{
|
|
33
|
+
...F
|
|
34
|
+
},
|
|
35
|
+
n
|
|
36
|
+
);
|
|
37
|
+
}) : /* @__PURE__ */ o(
|
|
38
|
+
t,
|
|
17
39
|
{
|
|
18
|
-
...
|
|
40
|
+
...e,
|
|
41
|
+
isHorizontal: e.isHorizontal ?? r
|
|
19
42
|
},
|
|
20
|
-
|
|
43
|
+
n
|
|
21
44
|
);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
labelText: e.labelText,
|
|
26
|
-
input: e.input,
|
|
27
|
-
type: e.type,
|
|
28
|
-
helper: e.helper,
|
|
45
|
+
{
|
|
46
|
+
const l = Array.isArray(e) ? null : {
|
|
47
|
+
...e,
|
|
29
48
|
isHorizontal: e.isHorizontal ?? r
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
isHorizontal: e.isHorizontal ?? r
|
|
36
|
-
};
|
|
37
|
-
return l !== null ? /* @__PURE__ */ s(m, { ...l }) : null;
|
|
38
|
-
}
|
|
39
|
-
}, z = ({
|
|
40
|
-
testId: e = null,
|
|
41
|
-
cssClasses: o = null,
|
|
42
|
-
style: r = null,
|
|
43
|
-
config: a,
|
|
44
|
-
isHorizontal: l = !1,
|
|
45
|
-
isGrouped: t = !1
|
|
46
|
-
}) => {
|
|
47
|
-
const d = u([
|
|
48
|
-
"field",
|
|
49
|
-
l ? "is-horizontal" : null,
|
|
50
|
-
t ? "is-grouped" : null,
|
|
51
|
-
o
|
|
52
|
-
]), p = e ?? y({ tag: "field", parsedClasses: d }), n = i(
|
|
53
|
-
() => F(a, t, l),
|
|
54
|
-
[a, t, l]
|
|
55
|
-
);
|
|
56
|
-
return /* @__PURE__ */ s(
|
|
49
|
+
};
|
|
50
|
+
return l !== null ? /* @__PURE__ */ o(t, { ...l }) : null;
|
|
51
|
+
}
|
|
52
|
+
}, [e, s, r]);
|
|
53
|
+
return /* @__PURE__ */ o(
|
|
57
54
|
"section",
|
|
58
55
|
{
|
|
59
|
-
"data-testid":
|
|
60
|
-
className:
|
|
61
|
-
style:
|
|
62
|
-
children:
|
|
56
|
+
"data-testid": y,
|
|
57
|
+
className: a,
|
|
58
|
+
style: u ?? void 0,
|
|
59
|
+
children: r ? /* @__PURE__ */ o("section", { className: "field-body", children: d }) : d
|
|
63
60
|
}
|
|
64
61
|
);
|
|
65
62
|
};
|
|
66
63
|
export {
|
|
67
|
-
|
|
64
|
+
N as default
|
|
68
65
|
};
|
|
@@ -5,3 +5,5 @@ export default _default;
|
|
|
5
5
|
export declare const BasicExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
|
6
6
|
export declare const InHorizontalMode: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
|
7
7
|
export declare const GroupedInputs: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
|
8
|
+
export declare const InputWithAddon: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
|
9
|
+
export declare const InputWithBothAddons: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/organismProps').FormFieldProps>;
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsxs as m, jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import { COMMON_CLASSES as c } from "../../../constants/classes.js";
|
|
3
|
+
import { parseClasses as f, parseTestId as C } from "../../../functions/parsers.js";
|
|
4
|
+
const a = "hero", r = (o, l, t, n) => l === "body" || n === "fullheight" ? /* @__PURE__ */ $(
|
|
4
5
|
"section",
|
|
5
6
|
{
|
|
6
|
-
"data-testid": `${t}-${
|
|
7
|
-
className:
|
|
7
|
+
"data-testid": `${t}-${l}`,
|
|
8
|
+
className: `${a}-${l}`,
|
|
8
9
|
children: o
|
|
9
10
|
}
|
|
10
|
-
) : null,
|
|
11
|
+
) : null, x = ({
|
|
11
12
|
testId: o = null,
|
|
12
|
-
cssClasses:
|
|
13
|
+
cssClasses: l = null,
|
|
13
14
|
style: t = null,
|
|
14
|
-
header:
|
|
15
|
-
body:
|
|
16
|
-
footer:
|
|
17
|
-
color:
|
|
18
|
-
size:
|
|
15
|
+
header: n = null,
|
|
16
|
+
body: h,
|
|
17
|
+
footer: i = null,
|
|
18
|
+
color: d = null,
|
|
19
|
+
size: s = null
|
|
19
20
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
21
|
+
const u = f([
|
|
22
|
+
a,
|
|
23
|
+
d ? `${c.IS}${d}` : null,
|
|
24
|
+
s ? `${c.IS}${s}` : null,
|
|
25
|
+
l
|
|
26
|
+
]), e = o ?? C({ tag: a, parsedClasses: u });
|
|
27
|
+
return /* @__PURE__ */ m(
|
|
22
28
|
"section",
|
|
23
29
|
{
|
|
24
|
-
"data-testid":
|
|
25
|
-
className:
|
|
30
|
+
"data-testid": e,
|
|
31
|
+
className: u,
|
|
26
32
|
style: t ?? void 0,
|
|
27
33
|
children: [
|
|
28
|
-
n
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
r(n, "head", e, s),
|
|
35
|
+
r(h, "body", e, s),
|
|
36
|
+
r(i, "foot", e, s)
|
|
31
37
|
]
|
|
32
38
|
}
|
|
33
39
|
);
|
|
34
40
|
};
|
|
35
41
|
export {
|
|
36
|
-
|
|
42
|
+
x as default
|
|
37
43
|
};
|