@prokodo/ui 0.0.14 → 0.0.15
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/accordion/Accordion.js +63 -72
- package/dist/components/accordion/Accordion.module.scss.js +0 -1
- package/dist/components/avatar/Avatar.js +34 -32
- package/dist/components/button/Button.js +59 -54
- package/dist/components/carousel/Carousel.js +90 -95
- package/dist/components/dialog/Dialog.js +38 -39
- package/dist/components/drawer/Drawer.js +40 -41
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +58 -61
- package/dist/components/switch/Switch.js +4 -4
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.model.d.ts +5 -2
- package/dist/types/components/accordion/index.d.ts +1 -1
- package/dist/types/components/avatar/Avatar.model.d.ts +2 -1
- package/dist/types/components/button/Button.model.d.ts +5 -5
- package/dist/ui.css +1 -1
- package/package.json +3 -3
|
@@ -1,115 +1,106 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import w from "
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as s } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as E, useCallback as u } from "react";
|
|
3
|
+
import S from "../../vendor/hugeicons/minus_sign_icon.js";
|
|
4
|
+
import g from "../../vendor/hugeicons/plus_sign_icon.js";
|
|
5
|
+
import { create as w } from "../../helpers/bem.js";
|
|
6
|
+
import { isNull as f } from "../../helpers/validations.js";
|
|
7
|
+
import B from "./Accordion.module.scss.js";
|
|
8
|
+
import { Headline as H } from "../headline/Headline.js";
|
|
9
|
+
import { Animated as D } from "../animated/Animated.js";
|
|
10
|
+
import { Button as K } from "../button/Button.js";
|
|
11
|
+
const a = w(B, "Accordion"), R = ({
|
|
12
|
+
id: j,
|
|
13
|
+
expanded: N,
|
|
14
|
+
className: $,
|
|
15
|
+
variant: y = "primary",
|
|
15
16
|
titleOptions: b,
|
|
16
|
-
|
|
17
|
-
items: v,
|
|
17
|
+
items: z,
|
|
18
18
|
onChange: m,
|
|
19
|
-
|
|
19
|
+
iconOverride: t,
|
|
20
|
+
...I
|
|
20
21
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
(e,
|
|
23
|
-
const
|
|
24
|
-
k(
|
|
22
|
+
const [c, k] = E(N), p = u(
|
|
23
|
+
(e, l) => {
|
|
24
|
+
const d = c === e ? null : e;
|
|
25
|
+
k(d), m(e, l, d !== null);
|
|
25
26
|
},
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
(e,
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
className: a("icon", { "is-hidden": !!t }),
|
|
32
|
-
color: r,
|
|
33
|
-
name: e,
|
|
34
|
-
size: "sm",
|
|
35
|
-
...l
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
[l]
|
|
27
|
+
[c, m]
|
|
28
|
+
), A = u(
|
|
29
|
+
(e) => e ? (t == null ? void 0 : t.expanded) ?? /* @__PURE__ */ s.jsx(S, { className: a("icon"), size: 20 }) : (t == null ? void 0 : t.collapsed) ?? /* @__PURE__ */ s.jsx(g, { className: a("icon"), size: 20 }),
|
|
30
|
+
[t]
|
|
39
31
|
);
|
|
40
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ s.jsx("div", { className: a(void 0, { [y]: !0 }, $), ...I, children: z.map((e, l) => {
|
|
41
33
|
const {
|
|
42
|
-
className:
|
|
43
|
-
title:
|
|
44
|
-
renderHeader:
|
|
45
|
-
renderContent:
|
|
46
|
-
actions:
|
|
47
|
-
} = e,
|
|
48
|
-
return /* @__PURE__ */
|
|
34
|
+
className: d,
|
|
35
|
+
title: C,
|
|
36
|
+
renderHeader: x,
|
|
37
|
+
renderContent: h,
|
|
38
|
+
actions: i
|
|
39
|
+
} = e, r = `${j}-${e.title}`, o = c === l;
|
|
40
|
+
return /* @__PURE__ */ s.jsxs(
|
|
49
41
|
"div",
|
|
50
42
|
{
|
|
51
43
|
className: a(
|
|
52
44
|
"item",
|
|
53
|
-
{ "is-expanded":
|
|
54
|
-
|
|
45
|
+
{ "is-expanded": o },
|
|
46
|
+
d
|
|
55
47
|
),
|
|
56
48
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ s.jsxs(
|
|
58
50
|
"div",
|
|
59
51
|
{
|
|
60
|
-
"aria-controls": `${
|
|
61
|
-
"aria-expanded":
|
|
62
|
-
className: a("header", { "is-expanded":
|
|
63
|
-
id: `${
|
|
52
|
+
"aria-controls": `${r}-content`,
|
|
53
|
+
"aria-expanded": o,
|
|
54
|
+
className: a("header", { "is-expanded": o }),
|
|
55
|
+
id: `${r}-header`,
|
|
64
56
|
role: "button",
|
|
65
57
|
tabIndex: 0,
|
|
66
|
-
onClick: (
|
|
67
|
-
onKeyDown: (
|
|
68
|
-
(
|
|
58
|
+
onClick: (n) => p(l, n),
|
|
59
|
+
onKeyDown: (n) => {
|
|
60
|
+
(n.key === "Enter" || n.key === " ") && p(l, n);
|
|
69
61
|
},
|
|
70
62
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
f(x) ? /* @__PURE__ */ s.jsx(
|
|
64
|
+
H,
|
|
73
65
|
{
|
|
74
|
-
className: a("title", { "is-expanded":
|
|
66
|
+
className: a("title", { "is-expanded": o }),
|
|
75
67
|
size: "sm",
|
|
76
68
|
type: "h3",
|
|
77
69
|
...(e == null ? void 0 : e.titleOptions) ?? b,
|
|
78
|
-
children:
|
|
70
|
+
children: C
|
|
79
71
|
}
|
|
80
|
-
) :
|
|
81
|
-
|
|
82
|
-
x("MinusSignIcon", "white", !s)
|
|
72
|
+
) : x,
|
|
73
|
+
A(o)
|
|
83
74
|
]
|
|
84
75
|
}
|
|
85
76
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ s.jsxs(
|
|
87
78
|
"div",
|
|
88
79
|
{
|
|
89
|
-
"aria-labelledby": `${
|
|
90
|
-
className: a("content", { "is-expanded":
|
|
91
|
-
hidden: !
|
|
92
|
-
id: `${
|
|
80
|
+
"aria-labelledby": `${r}-header`,
|
|
81
|
+
className: a("content", { "is-expanded": o }),
|
|
82
|
+
hidden: !o,
|
|
83
|
+
id: `${r}-content`,
|
|
93
84
|
role: "region",
|
|
94
85
|
children: [
|
|
95
|
-
!
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
!f(h) && /* @__PURE__ */ s.jsx(D, { children: h }),
|
|
87
|
+
i && i.length > 0 && /* @__PURE__ */ s.jsx("div", { className: a("actions"), children: i.map((n) => /* @__PURE__ */ s.jsx(
|
|
88
|
+
K,
|
|
98
89
|
{
|
|
99
|
-
...
|
|
90
|
+
...n
|
|
100
91
|
},
|
|
101
|
-
`${
|
|
92
|
+
`${r}-action-${n.id}`
|
|
102
93
|
)) })
|
|
103
94
|
]
|
|
104
95
|
}
|
|
105
96
|
)
|
|
106
97
|
]
|
|
107
98
|
},
|
|
108
|
-
|
|
99
|
+
r
|
|
109
100
|
);
|
|
110
101
|
}) });
|
|
111
102
|
};
|
|
112
|
-
|
|
103
|
+
R.displayName = "Accordion";
|
|
113
104
|
export {
|
|
114
|
-
|
|
105
|
+
R as Accordion
|
|
115
106
|
};
|
|
@@ -8,7 +8,6 @@ const o = "backgroundFill", d = "gradientMove", c = "fadeInKeyframe", r = {
|
|
|
8
8
|
"prokodo-Accordion__title": "prokodo-Accordion__title",
|
|
9
9
|
"prokodo-Accordion__title--is-expanded": "prokodo-Accordion__title--is-expanded",
|
|
10
10
|
"prokodo-Accordion__icon": "prokodo-Accordion__icon",
|
|
11
|
-
"prokodo-Accordion__icon--is-hidden": "prokodo-Accordion__icon--is-hidden",
|
|
12
11
|
"prokodo-Accordion__content": "prokodo-Accordion__content",
|
|
13
12
|
"prokodo-Accordion__content--is-expanded": "prokodo-Accordion__content--is-expanded",
|
|
14
13
|
"prokodo-Accordion__actions": "prokodo-Accordion__actions",
|
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useMemo as d, useCallback as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { j as e } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useMemo as d, useCallback as p } from "react";
|
|
3
|
+
import x from "../../vendor/hugeicons/user_icon.js";
|
|
4
|
+
import { create as h } from "../../helpers/bem.js";
|
|
5
|
+
import j from "./Avatar.module.scss.js";
|
|
6
|
+
import { Image as u } from "../image/Image.js";
|
|
7
|
+
import { getIconSize as I } from "../icon/Icon.js";
|
|
8
|
+
import { Link as N } from "../link/Link.js";
|
|
9
|
+
const t = h(j, "Avatar"), E = ({
|
|
10
|
+
className: n,
|
|
10
11
|
variant: o = "primary",
|
|
11
12
|
size: s = "sm",
|
|
12
13
|
image: r,
|
|
13
14
|
redirect: i,
|
|
14
|
-
|
|
15
|
+
iconOverride: c,
|
|
16
|
+
...l
|
|
15
17
|
}) => {
|
|
16
|
-
const
|
|
18
|
+
const m = d(
|
|
17
19
|
() => ({
|
|
18
20
|
[o]: !!o
|
|
19
21
|
}),
|
|
20
22
|
[o]
|
|
21
|
-
),
|
|
23
|
+
), a = d(
|
|
22
24
|
() => ({
|
|
23
25
|
[`has-size-${s}`]: !!s
|
|
24
26
|
}),
|
|
25
27
|
[s]
|
|
26
|
-
),
|
|
27
|
-
() => /* @__PURE__ */
|
|
28
|
+
), f = p(
|
|
29
|
+
() => /* @__PURE__ */ e.jsx(
|
|
28
30
|
"div",
|
|
29
31
|
{
|
|
30
|
-
...
|
|
32
|
+
...l,
|
|
31
33
|
tabIndex: -1,
|
|
32
34
|
className: t(
|
|
33
35
|
void 0,
|
|
34
36
|
{
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
+
...m,
|
|
38
|
+
...a
|
|
37
39
|
},
|
|
38
|
-
|
|
40
|
+
n
|
|
39
41
|
),
|
|
40
|
-
children: r ? /* @__PURE__ */
|
|
41
|
-
|
|
42
|
+
children: r ? /* @__PURE__ */ e.jsx(
|
|
43
|
+
u,
|
|
42
44
|
{
|
|
43
45
|
...r,
|
|
44
46
|
className: t("image", void 0, r.className),
|
|
45
47
|
tabIndex: 0
|
|
46
48
|
}
|
|
47
|
-
) : /* @__PURE__ */
|
|
48
|
-
|
|
49
|
+
) : c ?? /* @__PURE__ */ e.jsx(
|
|
50
|
+
x,
|
|
49
51
|
{
|
|
50
|
-
className: t("icon",
|
|
52
|
+
className: t("icon", m),
|
|
51
53
|
name: "UserIcon",
|
|
52
|
-
size:
|
|
54
|
+
size: I(s) * 2,
|
|
53
55
|
color: ["inherit", "white"].includes(o) ? void 0 : "white"
|
|
54
56
|
}
|
|
55
57
|
)
|
|
56
58
|
}
|
|
57
59
|
),
|
|
58
|
-
[
|
|
60
|
+
[a, m, n, r, o, s, c, l]
|
|
59
61
|
);
|
|
60
|
-
return i ? /* @__PURE__ */
|
|
61
|
-
|
|
62
|
+
return i ? /* @__PURE__ */ e.jsx(
|
|
63
|
+
N,
|
|
62
64
|
{
|
|
63
65
|
...i,
|
|
64
66
|
className: t(
|
|
65
67
|
"link",
|
|
66
68
|
{
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
+
...m,
|
|
70
|
+
...a
|
|
69
71
|
},
|
|
70
72
|
i.className
|
|
71
73
|
),
|
|
72
|
-
children:
|
|
74
|
+
children: f()
|
|
73
75
|
}
|
|
74
|
-
) :
|
|
76
|
+
) : f();
|
|
75
77
|
};
|
|
76
78
|
export {
|
|
77
|
-
|
|
79
|
+
E as Avatar
|
|
78
80
|
};
|
|
@@ -1,81 +1,86 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { create as
|
|
1
|
+
import { j as o } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useId as E, useRef as N, useMemo as C, isValidElement as g, cloneElement as w } from "react";
|
|
3
|
+
import { create as z } from "../../helpers/bem.js";
|
|
4
4
|
import { isString as D } from "../../helpers/validations.js";
|
|
5
|
-
import
|
|
6
|
-
import { Link as
|
|
7
|
-
import { Loading as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
variant: e = "contained",
|
|
5
|
+
import K from "./Button.module.scss.js";
|
|
6
|
+
import { Link as L } from "../link/Link.js";
|
|
7
|
+
import { Loading as R } from "../loading/Loading.js";
|
|
8
|
+
const m = z(K, "Button"), M = {}, O = {}, H = ({
|
|
9
|
+
id: u,
|
|
10
|
+
fullWidth: c,
|
|
11
|
+
color: l = "primary",
|
|
12
|
+
icon: t,
|
|
13
|
+
loading: f,
|
|
14
|
+
variant: a = "contained",
|
|
16
15
|
className: h,
|
|
17
16
|
contentClassName: y,
|
|
18
|
-
disabled:
|
|
19
|
-
redirect:
|
|
20
|
-
...
|
|
17
|
+
disabled: i,
|
|
18
|
+
redirect: s,
|
|
19
|
+
...e
|
|
21
20
|
}) => {
|
|
22
|
-
const
|
|
21
|
+
const j = E(), I = N(null), x = `Button-${j}`, k = a === "outlined", B = t !== void 0 && !(e != null && e.title), d = C(
|
|
23
22
|
() => ({
|
|
24
|
-
"icon-only":
|
|
23
|
+
"icon-only": !!B
|
|
25
24
|
}),
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
[B]
|
|
26
|
+
), v = () => {
|
|
27
|
+
var n, r;
|
|
28
|
+
return /* @__PURE__ */ o.jsxs("span", { ref: I, "aria-labelledby": x, className: m("title"), children: [
|
|
29
|
+
t !== void 0 && g(t) && w(t, {
|
|
30
|
+
className: m("icon", d, (n = t == null ? void 0 : t.props) == null ? void 0 : n.className),
|
|
31
|
+
size: ((r = t == null ? void 0 : t.props) == null ? void 0 : r.size) ?? 20
|
|
32
|
+
}),
|
|
33
|
+
e == null ? void 0 : e.title
|
|
34
|
+
] });
|
|
35
|
+
}, $ = () => f ? /* @__PURE__ */ o.jsx(R, { size: "xs" }) : v(), b = () => k ? /* @__PURE__ */ o.jsx("div", { className: m("content", d, y), children: $() }) : $();
|
|
36
|
+
return s ? /* @__PURE__ */ o.jsx(
|
|
37
|
+
L,
|
|
33
38
|
{
|
|
34
|
-
disabled:
|
|
35
|
-
href:
|
|
36
|
-
className:
|
|
39
|
+
disabled: i,
|
|
40
|
+
href: s.href,
|
|
41
|
+
className: m(
|
|
37
42
|
void 0,
|
|
38
43
|
{
|
|
39
|
-
"has-fullWidth": !!
|
|
40
|
-
[`has-variant-${
|
|
41
|
-
[`has-bg-${
|
|
42
|
-
[`has-text-${
|
|
43
|
-
"is-disabled": !!
|
|
44
|
-
...
|
|
44
|
+
"has-fullWidth": !!c,
|
|
45
|
+
[`has-variant-${a}`]: !0,
|
|
46
|
+
[`has-bg-${l}`]: a === "contained",
|
|
47
|
+
[`has-text-${l}`]: a === "text",
|
|
48
|
+
"is-disabled": !!i,
|
|
49
|
+
...d
|
|
45
50
|
},
|
|
46
51
|
h
|
|
47
52
|
),
|
|
48
53
|
onClick: () => {
|
|
49
|
-
var
|
|
50
|
-
return (
|
|
54
|
+
var n;
|
|
55
|
+
return (n = e == null ? void 0 : e.onClick) == null ? void 0 : n.call(e, M);
|
|
51
56
|
},
|
|
52
57
|
onKeyDown: () => {
|
|
53
|
-
var
|
|
54
|
-
return (
|
|
58
|
+
var n;
|
|
59
|
+
return (n = e == null ? void 0 : e.onKeyDown) == null ? void 0 : n.call(e, O);
|
|
55
60
|
},
|
|
56
|
-
children:
|
|
61
|
+
children: b()
|
|
57
62
|
}
|
|
58
|
-
) : /* @__PURE__ */
|
|
63
|
+
) : /* @__PURE__ */ o.jsx(
|
|
59
64
|
"button",
|
|
60
65
|
{
|
|
61
|
-
...
|
|
62
|
-
color:
|
|
63
|
-
disabled: !!
|
|
64
|
-
id: `${
|
|
65
|
-
className:
|
|
66
|
+
...e,
|
|
67
|
+
color: l,
|
|
68
|
+
disabled: !!i || !!f,
|
|
69
|
+
id: `${x}${D(u) ? ` ${u}` : ""}`,
|
|
70
|
+
className: m(
|
|
66
71
|
void 0,
|
|
67
72
|
{
|
|
68
|
-
"has-fullWidth": !!
|
|
69
|
-
[`has-variant-${
|
|
70
|
-
[`has-bg-${
|
|
71
|
-
[`has-text-${
|
|
72
|
-
"is-disabled": !!
|
|
73
|
-
...
|
|
73
|
+
"has-fullWidth": !!c,
|
|
74
|
+
[`has-variant-${a}`]: !0,
|
|
75
|
+
[`has-bg-${l}`]: a === "contained",
|
|
76
|
+
[`has-text-${l}`]: a === "text",
|
|
77
|
+
"is-disabled": !!i,
|
|
78
|
+
...d
|
|
74
79
|
},
|
|
75
80
|
h
|
|
76
81
|
),
|
|
77
|
-
tabIndex:
|
|
78
|
-
children:
|
|
82
|
+
tabIndex: s !== void 0 || i ? -1 : (e == null ? void 0 : e.tabIndex) ?? void 0,
|
|
83
|
+
children: b()
|
|
79
84
|
}
|
|
80
85
|
);
|
|
81
86
|
};
|