@prokodo/ui 0.0.25 → 0.0.26
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 +65 -65
- package/dist/components/animated/Animated.js +17 -17
- package/dist/components/animatedText/AnimatedText.js +4 -4
- package/dist/components/avatar/Avatar.js +34 -34
- package/dist/components/base-link/BaseLink.js +12 -12
- package/dist/components/button/Button.js +48 -48
- package/dist/components/calendly/Calendly.js +32 -32
- package/dist/components/card/Card.js +107 -107
- package/dist/components/carousel/Carousel.js +106 -106
- package/dist/components/chip/Chip.js +26 -26
- package/dist/components/datePicker/DatePicker.js +37 -37
- package/dist/components/dialog/Dialog.js +82 -82
- package/dist/components/drawer/Drawer.js +48 -48
- package/dist/components/form/Form.js +94 -94
- package/dist/components/form/FormField.js +41 -41
- package/dist/components/form/FormResponse.js +22 -22
- package/dist/components/grid/Grid.js +8 -8
- package/dist/components/grid/GridRow.js +10 -10
- package/dist/components/headline/Headline.js +28 -28
- package/dist/components/icon/Icon.js +4 -4
- package/dist/components/image/Image.js +15 -15
- package/dist/components/image-text/ImageText.js +48 -48
- package/dist/components/input/Input.js +121 -121
- package/dist/components/inputOTP/InputOTP.js +24 -24
- package/dist/components/label/Label.js +26 -26
- package/dist/components/link/Link.js +27 -27
- package/dist/components/list/List.js +75 -75
- package/dist/components/loading/Loading.js +17 -17
- package/dist/components/lottie/Lottie.js +23 -23
- package/dist/components/map/Map.js +19 -19
- package/dist/components/post-item/PostItem.js +73 -73
- package/dist/components/post-item/PostItemAuthor.js +16 -16
- package/dist/components/post-teaser/PostTeaser.js +76 -76
- package/dist/components/post-widget/PostWidget.js +63 -63
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +67 -67
- package/dist/components/quote/Quote.js +40 -40
- package/dist/components/rich-text/RichText.js +76 -76
- package/dist/components/select/Select.js +92 -92
- package/dist/components/skeleton/Skeleton.js +8 -8
- package/dist/components/slider/Slider.js +50 -50
- package/dist/components/stepper/Stepper.js +41 -41
- package/dist/components/switch/Switch.js +32 -32
- package/dist/components/table/Table.js +31 -31
- package/dist/components/teaser/Teaser.js +55 -55
- package/dist/constants/project.js +1 -1
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Option/Option.js +23 -23
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Portal/Portal.js +22 -22
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Select/Select.js +46 -46
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Slider/Slider.js +141 -141
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Switch/Switch.js +33 -33
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Unstable_Popup/Popup.js +31 -31
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/SelectProvider.js +14 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -3
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.js +0 -4
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.development.js +0 -247
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.production.js +0 -35
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.js +0 -10
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { create as
|
|
4
|
-
import { isNull as
|
|
5
|
-
import
|
|
6
|
-
import { Headline as
|
|
7
|
-
import { Animated as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Icon as
|
|
10
|
-
const a =
|
|
11
|
-
id:
|
|
12
|
-
expanded:
|
|
13
|
-
className:
|
|
14
|
-
variant:
|
|
15
|
-
titleOptions:
|
|
16
|
-
iconProps:
|
|
17
|
-
items:
|
|
18
|
-
onChange:
|
|
19
|
-
...
|
|
1
|
+
import { jsx as d, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useCallback as f } from "react";
|
|
3
|
+
import { create as S } from "../../helpers/bem.js";
|
|
4
|
+
import { isNull as y } from "../../helpers/validations.js";
|
|
5
|
+
import j from "./Accordion.module.scss.js";
|
|
6
|
+
import { Headline as z } from "../headline/Headline.js";
|
|
7
|
+
import { Animated as B } from "../animated/Animated.js";
|
|
8
|
+
import { Button as H } from "../button/Button.js";
|
|
9
|
+
import { Icon as D } from "../icon/Icon.js";
|
|
10
|
+
const a = S(j, "Accordion"), K = ({
|
|
11
|
+
id: I,
|
|
12
|
+
expanded: $,
|
|
13
|
+
className: b,
|
|
14
|
+
variant: v = "primary",
|
|
15
|
+
titleOptions: g,
|
|
16
|
+
iconProps: m,
|
|
17
|
+
items: k,
|
|
18
|
+
onChange: p,
|
|
19
|
+
...A
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
21
|
+
const [s, C] = E($), h = f(
|
|
22
22
|
(e, r) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const i = s === e ? null : e;
|
|
24
|
+
C(i), p(e, r, i !== null);
|
|
25
25
|
},
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
(e, r,
|
|
29
|
-
|
|
26
|
+
[s, p]
|
|
27
|
+
), u = f(
|
|
28
|
+
(e, r, i) => /* @__PURE__ */ d(
|
|
29
|
+
D,
|
|
30
30
|
{
|
|
31
|
-
className: a("icon", { "is-hidden": !!
|
|
31
|
+
className: a("icon", { "is-hidden": !!i }),
|
|
32
32
|
color: r,
|
|
33
33
|
name: e,
|
|
34
34
|
size: "sm",
|
|
35
|
-
...
|
|
35
|
+
...m
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
[
|
|
38
|
+
[m]
|
|
39
39
|
);
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ d("div", { className: a(void 0, { [v]: !0 }, b), ...A, children: k.map((e, r) => {
|
|
41
41
|
const {
|
|
42
|
-
className:
|
|
43
|
-
title:
|
|
44
|
-
renderHeader:
|
|
45
|
-
renderContent:
|
|
42
|
+
className: i,
|
|
43
|
+
title: w,
|
|
44
|
+
renderHeader: x,
|
|
45
|
+
renderContent: N,
|
|
46
46
|
actions: c
|
|
47
|
-
} = e,
|
|
48
|
-
return /* @__PURE__ */
|
|
47
|
+
} = e, t = `${I}-${e.title}`, n = s === r;
|
|
48
|
+
return /* @__PURE__ */ l(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
className: a(
|
|
52
52
|
"item",
|
|
53
|
-
{ "is-expanded":
|
|
54
|
-
|
|
53
|
+
{ "is-expanded": n },
|
|
54
|
+
i
|
|
55
55
|
),
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ l(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
|
-
"aria-controls": `${
|
|
61
|
-
"aria-expanded":
|
|
62
|
-
className: a("header", { "is-expanded":
|
|
63
|
-
id: `${
|
|
60
|
+
"aria-controls": `${t}-content`,
|
|
61
|
+
"aria-expanded": n,
|
|
62
|
+
className: a("header", { "is-expanded": n }),
|
|
63
|
+
id: `${t}-header`,
|
|
64
64
|
role: "button",
|
|
65
65
|
tabIndex: 0,
|
|
66
|
-
onClick: (o) =>
|
|
66
|
+
onClick: (o) => h(r, o),
|
|
67
67
|
onKeyDown: (o) => {
|
|
68
|
-
(o.key === "Enter" || o.key === " ") &&
|
|
68
|
+
(o.key === "Enter" || o.key === " ") && h(r, o);
|
|
69
69
|
},
|
|
70
70
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
y(x) ? /* @__PURE__ */ d(
|
|
72
|
+
z,
|
|
73
73
|
{
|
|
74
|
-
className: a("title", { "is-expanded":
|
|
74
|
+
className: a("title", { "is-expanded": n }),
|
|
75
75
|
size: "sm",
|
|
76
76
|
type: "h3",
|
|
77
|
-
...(e == null ? void 0 : e.titleOptions) ??
|
|
78
|
-
children:
|
|
77
|
+
...(e == null ? void 0 : e.titleOptions) ?? g,
|
|
78
|
+
children: w
|
|
79
79
|
}
|
|
80
|
-
) :
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
) : x,
|
|
81
|
+
u("PlusSignIcon", "primary", n),
|
|
82
|
+
u("MinusSignIcon", "white", !n)
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ l(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
"aria-labelledby": `${
|
|
90
|
-
className: a("content", { "is-expanded":
|
|
91
|
-
hidden: !
|
|
92
|
-
id: `${
|
|
89
|
+
"aria-labelledby": `${t}-header`,
|
|
90
|
+
className: a("content", { "is-expanded": n }),
|
|
91
|
+
hidden: !n,
|
|
92
|
+
id: `${t}-content`,
|
|
93
93
|
role: "region",
|
|
94
94
|
children: [
|
|
95
|
-
!N
|
|
96
|
-
c && c.length > 0 && /* @__PURE__ */
|
|
97
|
-
|
|
95
|
+
!y(N) && /* @__PURE__ */ d(B, { children: N }),
|
|
96
|
+
c && c.length > 0 && /* @__PURE__ */ d("div", { className: a("actions"), children: c.map((o) => /* @__PURE__ */ d(
|
|
97
|
+
H,
|
|
98
98
|
{
|
|
99
99
|
...o
|
|
100
100
|
},
|
|
101
|
-
`${
|
|
101
|
+
`${t}-action-${o.id}`
|
|
102
102
|
)) })
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
]
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
t
|
|
109
109
|
);
|
|
110
110
|
}) });
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
K.displayName = "Accordion";
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
K as Accordion
|
|
115
115
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { create as
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as u, useEffect as g } from "react";
|
|
3
|
+
import { create as x } from "../../helpers/bem.js";
|
|
4
4
|
import { isNumber as d } from "../../helpers/validations.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import N from "./Animated.module.scss.js";
|
|
6
|
+
const V = x(N, "Animated"), q = ({
|
|
7
7
|
className: b,
|
|
8
8
|
disabled: p = !1,
|
|
9
9
|
delay: i = 0,
|
|
@@ -12,28 +12,28 @@ const E = T(g, "Animated"), q = ({
|
|
|
12
12
|
children: v,
|
|
13
13
|
intersectionObserverOptions: f = {},
|
|
14
14
|
onAnimate: r,
|
|
15
|
-
...
|
|
15
|
+
...h
|
|
16
16
|
}) => {
|
|
17
|
-
const [t, m] =
|
|
18
|
-
return
|
|
19
|
-
if (!
|
|
20
|
-
const
|
|
21
|
-
const [
|
|
17
|
+
const [t, m] = T(!1), c = u(null), e = u(null), s = u(null);
|
|
18
|
+
return g(() => {
|
|
19
|
+
if (!c.current) return;
|
|
20
|
+
const I = (R) => {
|
|
21
|
+
const [n] = R, a = (n == null ? void 0 : n.isIntersecting) ?? !1;
|
|
22
22
|
a && !t && (e.current !== null && d(e.current) && clearTimeout(e.current), e.current = window.setTimeout(() => {
|
|
23
23
|
m(!0), r == null || r(!0);
|
|
24
24
|
}, i)), !a && t && m(!1);
|
|
25
25
|
};
|
|
26
|
-
return s.current = new IntersectionObserver(
|
|
26
|
+
return s.current = new IntersectionObserver(I, {
|
|
27
27
|
threshold: 0.1,
|
|
28
28
|
...f
|
|
29
|
-
}), s.current.observe(
|
|
29
|
+
}), s.current.observe(c.current), () => {
|
|
30
30
|
s.current && s.current.disconnect(), e.current !== null && d(e.current) && clearTimeout(e.current);
|
|
31
31
|
};
|
|
32
|
-
}, [r, i, f, t]), /* @__PURE__ */
|
|
32
|
+
}, [r, i, f, t]), /* @__PURE__ */ w(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
ref:
|
|
36
|
-
className:
|
|
35
|
+
ref: c,
|
|
36
|
+
className: V(
|
|
37
37
|
void 0,
|
|
38
38
|
{
|
|
39
39
|
"is-visible": !!t,
|
|
@@ -43,7 +43,7 @@ const E = T(g, "Animated"), q = ({
|
|
|
43
43
|
},
|
|
44
44
|
b
|
|
45
45
|
),
|
|
46
|
-
...
|
|
46
|
+
...h,
|
|
47
47
|
children: v
|
|
48
48
|
}
|
|
49
49
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as b, useState as n, useEffect as f } from "react";
|
|
3
|
-
const
|
|
3
|
+
const C = ({
|
|
4
4
|
speed: o = 30,
|
|
5
5
|
delay: s = 0,
|
|
6
6
|
disabled: u,
|
|
@@ -24,8 +24,8 @@ const E = ({
|
|
|
24
24
|
p((e) => e + t[r]), I((e) => e + 1);
|
|
25
25
|
}, o);
|
|
26
26
|
return () => clearTimeout(m);
|
|
27
|
-
}, [i, r, t, o]), /* @__PURE__ */ v
|
|
27
|
+
}, [i, r, t, o]), /* @__PURE__ */ v("span", { ...T, ref: c, children: x });
|
|
28
28
|
};
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
C as AnimatedText
|
|
31
31
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as d, useCallback as f } from "react";
|
|
3
|
-
import { create as
|
|
4
|
-
import
|
|
5
|
-
import { Image as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Link as
|
|
8
|
-
const t =
|
|
9
|
-
className:
|
|
3
|
+
import { create as p } from "../../helpers/bem.js";
|
|
4
|
+
import h from "./Avatar.module.scss.js";
|
|
5
|
+
import { Image as I } from "../image/Image.js";
|
|
6
|
+
import { Icon as u, getIconSize as N } from "../icon/Icon.js";
|
|
7
|
+
import { Link as b } from "../link/Link.js";
|
|
8
|
+
const t = p(h, "Avatar"), j = ({
|
|
9
|
+
className: n,
|
|
10
10
|
variant: o = "primary",
|
|
11
|
-
size:
|
|
12
|
-
image:
|
|
11
|
+
size: r = "sm",
|
|
12
|
+
image: e,
|
|
13
13
|
redirect: i,
|
|
14
|
-
...
|
|
14
|
+
...a
|
|
15
15
|
}) => {
|
|
16
|
-
const
|
|
16
|
+
const m = d(
|
|
17
17
|
() => ({
|
|
18
18
|
[o]: !!o
|
|
19
19
|
}),
|
|
20
20
|
[o]
|
|
21
|
-
),
|
|
21
|
+
), c = d(
|
|
22
22
|
() => ({
|
|
23
|
-
[`has-size-${
|
|
23
|
+
[`has-size-${r}`]: !!r
|
|
24
24
|
}),
|
|
25
|
-
[
|
|
25
|
+
[r]
|
|
26
26
|
), l = f(
|
|
27
|
-
() => /* @__PURE__ */
|
|
27
|
+
() => /* @__PURE__ */ s(
|
|
28
28
|
"div",
|
|
29
29
|
{
|
|
30
|
-
...
|
|
30
|
+
...a,
|
|
31
31
|
tabIndex: -1,
|
|
32
32
|
className: t(
|
|
33
33
|
void 0,
|
|
34
34
|
{
|
|
35
|
-
...
|
|
36
|
-
...
|
|
35
|
+
...m,
|
|
36
|
+
...c
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
n
|
|
39
39
|
),
|
|
40
|
-
children:
|
|
41
|
-
|
|
40
|
+
children: e ? /* @__PURE__ */ s(
|
|
41
|
+
I,
|
|
42
42
|
{
|
|
43
|
-
...
|
|
44
|
-
className: t("image", void 0,
|
|
43
|
+
...e,
|
|
44
|
+
className: t("image", void 0, e.className),
|
|
45
45
|
tabIndex: 0
|
|
46
46
|
}
|
|
47
|
-
) : /* @__PURE__ */
|
|
48
|
-
|
|
47
|
+
) : /* @__PURE__ */ s(
|
|
48
|
+
u,
|
|
49
49
|
{
|
|
50
|
-
className: t("icon",
|
|
50
|
+
className: t("icon", m),
|
|
51
51
|
name: "UserIcon",
|
|
52
|
-
size:
|
|
52
|
+
size: N(r) * 2,
|
|
53
53
|
color: ["inherit", "white"].includes(o) ? void 0 : "white"
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
[
|
|
58
|
+
[c, m, n, e, o, r, a]
|
|
59
59
|
);
|
|
60
|
-
return i ? /* @__PURE__ */
|
|
61
|
-
|
|
60
|
+
return i ? /* @__PURE__ */ s(
|
|
61
|
+
b,
|
|
62
62
|
{
|
|
63
63
|
...i,
|
|
64
64
|
className: t(
|
|
65
65
|
"link",
|
|
66
66
|
{
|
|
67
|
-
...
|
|
68
|
-
...
|
|
67
|
+
...m,
|
|
68
|
+
...c
|
|
69
69
|
},
|
|
70
70
|
i.className
|
|
71
71
|
),
|
|
@@ -74,5 +74,5 @@ const t = x(p, "Avatar"), y = ({
|
|
|
74
74
|
) : l();
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
j as Avatar
|
|
78
78
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isNull as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { isNull as r } from "../../helpers/validations.js";
|
|
3
|
+
const x = ({
|
|
4
4
|
href: o,
|
|
5
5
|
children: s,
|
|
6
6
|
disabled: i,
|
|
7
7
|
linkComponent: e,
|
|
8
|
-
style:
|
|
8
|
+
style: l,
|
|
9
9
|
target: d,
|
|
10
10
|
rel: m,
|
|
11
11
|
...t
|
|
12
12
|
}) => {
|
|
13
|
-
const u = { pointerEvents: "none" }, n = o == null ? void 0 : o.startsWith("http"), v = t.download !== void 0,
|
|
14
|
-
return n || v ||
|
|
13
|
+
const u = { pointerEvents: "none" }, n = o == null ? void 0 : o.startsWith("http"), v = t.download !== void 0, k = /^\w+:/.test(o), S = d ?? (n ? "_blank" : void 0), w = m ?? (n ? "noopener noreferrer" : void 0), a = r(i) ? void 0 : -1, p = r(i) ? l : { ...u, ...l };
|
|
14
|
+
return n || v || k || e === void 0 ? /* @__PURE__ */ c(
|
|
15
15
|
"a",
|
|
16
16
|
{
|
|
17
17
|
...t,
|
|
18
18
|
href: o,
|
|
19
|
-
rel:
|
|
19
|
+
rel: w,
|
|
20
20
|
style: p,
|
|
21
|
-
tabIndex:
|
|
22
|
-
target:
|
|
21
|
+
tabIndex: a,
|
|
22
|
+
target: S,
|
|
23
23
|
children: s
|
|
24
24
|
}
|
|
25
|
-
) : /* @__PURE__ */
|
|
25
|
+
) : /* @__PURE__ */ c(e, { ...t, href: o, style: p, tabIndex: a, children: s });
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
x.displayName = "BaseLink";
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
x as BaseLink
|
|
30
30
|
};
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useId as
|
|
3
|
-
import { create as
|
|
4
|
-
import { isString as
|
|
5
|
-
import
|
|
6
|
-
import { Link as
|
|
7
|
-
import { Loading as
|
|
8
|
-
import { Icon as
|
|
9
|
-
const
|
|
10
|
-
id:
|
|
1
|
+
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useId as v, useRef as w, useMemo as D } from "react";
|
|
3
|
+
import { create as K } from "../../helpers/bem.js";
|
|
4
|
+
import { isString as L } from "../../helpers/validations.js";
|
|
5
|
+
import j from "./Button.module.scss.js";
|
|
6
|
+
import { Link as E } from "../link/Link.js";
|
|
7
|
+
import { Loading as M } from "../loading/Loading.js";
|
|
8
|
+
import { Icon as O } from "../icon/Icon.js";
|
|
9
|
+
const o = K(j, "Button"), R = {}, q = {}, J = ({
|
|
10
|
+
id: u,
|
|
11
11
|
fullWidth: f,
|
|
12
|
-
color:
|
|
12
|
+
color: t = "primary",
|
|
13
13
|
iconProps: m = {},
|
|
14
|
-
loading:
|
|
14
|
+
loading: h,
|
|
15
15
|
variant: e = "contained",
|
|
16
|
-
className:
|
|
17
|
-
contentClassName:
|
|
18
|
-
disabled:
|
|
19
|
-
redirect:
|
|
16
|
+
className: B,
|
|
17
|
+
contentClassName: s,
|
|
18
|
+
disabled: i,
|
|
19
|
+
redirect: d,
|
|
20
20
|
...n
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
22
|
+
const k = v(), N = w(null), x = `Button-${k}`, C = e === "outlined", $ = m == null ? void 0 : m.name, b = $ && !(n != null && n.title), c = D(
|
|
23
23
|
() => ({
|
|
24
|
-
"icon-only":
|
|
24
|
+
"icon-only": !!b
|
|
25
25
|
}),
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
|
|
26
|
+
[b]
|
|
27
|
+
), g = () => /* @__PURE__ */ r("span", { ref: N, "aria-labelledby": x, className: o("title"), children: [
|
|
28
|
+
$ && /* @__PURE__ */ l(O, { className: o("icon", c), ...m }),
|
|
29
29
|
n == null ? void 0 : n.title
|
|
30
|
-
] }),
|
|
31
|
-
return
|
|
32
|
-
|
|
30
|
+
] }), y = () => h ? /* @__PURE__ */ l(M, { size: "xs" }) : g(), I = () => C ? /* @__PURE__ */ l("div", { className: o("content", c, s), children: y() }) : y();
|
|
31
|
+
return d ? /* @__PURE__ */ l(
|
|
32
|
+
E,
|
|
33
33
|
{
|
|
34
|
-
disabled:
|
|
35
|
-
href:
|
|
36
|
-
className:
|
|
34
|
+
disabled: i,
|
|
35
|
+
href: d.href,
|
|
36
|
+
className: o(
|
|
37
37
|
void 0,
|
|
38
38
|
{
|
|
39
39
|
"has-fullWidth": !!f,
|
|
40
40
|
[`has-variant-${e}`]: !0,
|
|
41
|
-
[`has-bg-${
|
|
42
|
-
[`has-text-${
|
|
43
|
-
"is-disabled": !!
|
|
41
|
+
[`has-bg-${t}`]: e === "contained",
|
|
42
|
+
[`has-text-${t}`]: e === "text",
|
|
43
|
+
"is-disabled": !!i,
|
|
44
44
|
...c
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
B
|
|
47
47
|
),
|
|
48
48
|
onClick: () => {
|
|
49
|
-
var
|
|
50
|
-
return (
|
|
49
|
+
var a;
|
|
50
|
+
return (a = n == null ? void 0 : n.onClick) == null ? void 0 : a.call(n, R);
|
|
51
51
|
},
|
|
52
52
|
onKeyDown: () => {
|
|
53
|
-
var
|
|
54
|
-
return (
|
|
53
|
+
var a;
|
|
54
|
+
return (a = n == null ? void 0 : n.onKeyDown) == null ? void 0 : a.call(n, q);
|
|
55
55
|
},
|
|
56
|
-
children:
|
|
56
|
+
children: I()
|
|
57
57
|
}
|
|
58
|
-
) : /* @__PURE__ */
|
|
58
|
+
) : /* @__PURE__ */ l(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
...n,
|
|
62
|
-
color:
|
|
63
|
-
disabled: !!
|
|
64
|
-
id: `${
|
|
65
|
-
className:
|
|
62
|
+
color: t,
|
|
63
|
+
disabled: !!i || !!h,
|
|
64
|
+
id: `${x}${L(u) ? ` ${u}` : ""}`,
|
|
65
|
+
className: o(
|
|
66
66
|
void 0,
|
|
67
67
|
{
|
|
68
68
|
"has-fullWidth": !!f,
|
|
69
69
|
[`has-variant-${e}`]: !0,
|
|
70
|
-
[`has-bg-${
|
|
71
|
-
[`has-text-${
|
|
72
|
-
"is-disabled": !!
|
|
70
|
+
[`has-bg-${t}`]: e === "contained",
|
|
71
|
+
[`has-text-${t}`]: e === "text",
|
|
72
|
+
"is-disabled": !!i,
|
|
73
73
|
...c
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
B
|
|
76
76
|
),
|
|
77
|
-
tabIndex:
|
|
78
|
-
children:
|
|
77
|
+
tabIndex: d !== void 0 || i ? -1 : (n == null ? void 0 : n.tabIndex) ?? void 0,
|
|
78
|
+
children: I()
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
};
|
|
82
82
|
export {
|
|
83
|
-
|
|
83
|
+
J as Button
|
|
84
84
|
};
|