@dss-kit/ui-kit 0.3.6 → 0.3.8
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/builders/Modal/Modal.js +57 -51
- package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +27 -27
- package/dist/components/builders/Modal/styles.d.ts +0 -1
- package/dist/components/builders/Modal/styles.js +6 -12
- package/dist/components/builders/Table/TablePagination/TablePagination.js +1 -1
- package/dist/components/charts/LineChart/LineChart.js +17 -15
- package/dist/components/charts/PieProgressChart/PieProgressChart.js +16 -14
- package/dist/components/controls/Button/Button.js +6 -6
- package/dist/components/controls/IconButton/IconButton.d.ts +17 -2
- package/dist/components/controls/IconButton/IconButton.js +17 -24
- package/dist/components/controls/IconButton/index.d.ts +2 -2
- package/dist/components/controls/Input/Input.js +147 -133
- package/dist/components/controls/Input/styles.d.ts +2 -0
- package/dist/components/controls/Input/styles.js +36 -28
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
- package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.js +8 -8
- package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
- package/dist/node_modules/@highcharts/react/Highcharts.js +161 -0
- package/dist/node_modules/@highcharts/react/options/Title.js +14 -0
- package/dist/node_modules/@highcharts/react/options/Tooltip.js +14 -0
- package/dist/ui-kit.cjs +8 -8
- package/dist/utils/theme/spacing.d.ts +15 -0
- package/dist/utils/theme/spacing.js +15 -0
- package/package.json +1 -1
- package/dist/components/controls/IconButton/IconButton.types.d.ts +0 -11
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { ModalContext as
|
|
6
|
-
import { styles as
|
|
7
|
-
import { Portal as
|
|
8
|
-
import { Box as
|
|
1
|
+
import { jsx as t, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { cx as s } from "@emotion/css";
|
|
3
|
+
import { forwardRef as D, useEffect as p, useCallback as d, useRef as N } from "react";
|
|
4
|
+
import B from "../../../assets/svg/modal/close.svg.js";
|
|
5
|
+
import { ModalContext as E } from "./context.js";
|
|
6
|
+
import { styles as i } from "./styles.js";
|
|
7
|
+
import { Portal as I } from "../Portal/Portal.js";
|
|
8
|
+
import { Box as l } from "../Box/Box.js";
|
|
9
9
|
import { IconButton as P } from "../../controls/IconButton/IconButton.js";
|
|
10
|
-
import { theme as
|
|
11
|
-
const
|
|
10
|
+
import { theme as f } from "../../../utils/theme/index.js";
|
|
11
|
+
const j = D(
|
|
12
12
|
({
|
|
13
13
|
isOpen: o,
|
|
14
14
|
onClose: r,
|
|
15
15
|
overlayClassName: y,
|
|
16
|
-
modalClassName:
|
|
17
|
-
absoluteCloseButtonClassName:
|
|
16
|
+
modalClassName: w,
|
|
17
|
+
absoluteCloseButtonClassName: g,
|
|
18
18
|
size: h = "md",
|
|
19
19
|
closeOnBackdropClick: m = !0,
|
|
20
20
|
closeOnEsc: u = !0,
|
|
21
|
-
disableBodyScroll:
|
|
22
|
-
showAbsoluteCloseButton:
|
|
21
|
+
disableBodyScroll: a = !0,
|
|
22
|
+
showAbsoluteCloseButton: x,
|
|
23
23
|
children: v
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
if (
|
|
24
|
+
}, k) => {
|
|
25
|
+
p(() => {
|
|
26
|
+
if (a && o && typeof window < "u" && typeof document < "u") {
|
|
27
27
|
const e = window.getComputedStyle(document.body).overflow;
|
|
28
28
|
return document.body.style.overflow = "hidden", () => {
|
|
29
29
|
document.body.style.overflow = e;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
}, [o,
|
|
33
|
-
const
|
|
32
|
+
}, [o, a]);
|
|
33
|
+
const n = d(
|
|
34
34
|
(e) => {
|
|
35
35
|
e.key === "Escape" && r();
|
|
36
36
|
},
|
|
37
37
|
[r]
|
|
38
38
|
);
|
|
39
|
-
|
|
39
|
+
p(() => {
|
|
40
40
|
if (typeof window < "u" && typeof document < "u" && u && o)
|
|
41
|
-
return document.addEventListener("keydown",
|
|
42
|
-
}, [o, u,
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}, []),
|
|
41
|
+
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
42
|
+
}, [o, u, n]);
|
|
43
|
+
const c = N(!1), b = d((e) => {
|
|
44
|
+
c.current = e.target === e.currentTarget;
|
|
45
|
+
}, []), M = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
m && e.target === e.currentTarget &&
|
|
47
|
+
m && e.target === e.currentTarget && c.current && r();
|
|
48
48
|
},
|
|
49
49
|
[m, r]
|
|
50
50
|
);
|
|
51
|
-
return o ? /* @__PURE__ */ t(
|
|
52
|
-
|
|
51
|
+
return o ? /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(E.Provider, { value: { isOpen: o, onClose: r }, children: /* @__PURE__ */ t(
|
|
52
|
+
l,
|
|
53
53
|
{
|
|
54
54
|
position: "fixed",
|
|
55
55
|
top: 0,
|
|
@@ -59,33 +59,39 @@ const C = B(
|
|
|
59
59
|
row: !0,
|
|
60
60
|
center: !0,
|
|
61
61
|
flex: 1,
|
|
62
|
-
onMouseDown:
|
|
63
|
-
onClick:
|
|
64
|
-
backgroundColor:
|
|
65
|
-
className: i
|
|
62
|
+
onMouseDown: b,
|
|
63
|
+
onClick: M,
|
|
64
|
+
backgroundColor: f.color.fill.bgOverlayPrimary,
|
|
65
|
+
className: s(i.overlay, y),
|
|
66
66
|
zIndex: 1,
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
|
|
67
|
+
children: /* @__PURE__ */ z(
|
|
68
|
+
l,
|
|
69
69
|
{
|
|
70
|
-
ref:
|
|
71
|
-
className:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
ref: k,
|
|
71
|
+
className: s(
|
|
72
|
+
i.modal,
|
|
73
|
+
i[`size_${h}`],
|
|
74
|
+
w
|
|
75
75
|
),
|
|
76
76
|
relative: !0,
|
|
77
77
|
children: [
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
x && /* @__PURE__ */ t(
|
|
79
|
+
l,
|
|
80
80
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
position: "absolute",
|
|
82
|
+
top: f.spacing.lg,
|
|
83
|
+
right: f.spacing.lg,
|
|
84
|
+
zIndex: 1,
|
|
85
|
+
children: /* @__PURE__ */ t(
|
|
86
|
+
P,
|
|
87
|
+
{
|
|
88
|
+
className: g,
|
|
89
|
+
onClick: r,
|
|
90
|
+
color: "neutral",
|
|
91
|
+
size: "xs",
|
|
92
|
+
children: /* @__PURE__ */ t(B, {})
|
|
93
|
+
}
|
|
94
|
+
)
|
|
89
95
|
}
|
|
90
96
|
),
|
|
91
97
|
v
|
|
@@ -96,7 +102,7 @@ const C = B(
|
|
|
96
102
|
) }) }) : null;
|
|
97
103
|
}
|
|
98
104
|
);
|
|
99
|
-
|
|
105
|
+
j.displayName = "Modal";
|
|
100
106
|
export {
|
|
101
|
-
|
|
107
|
+
j as Modal
|
|
102
108
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { useModalContext as
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
|
+
import B from "../../../../assets/svg/modal/close.svg.js";
|
|
4
|
+
import { useModalContext as W } from "../context.js";
|
|
5
5
|
import { Box as t } from "../../Box/Box.js";
|
|
6
|
-
import { theme as
|
|
7
|
-
import { Text as
|
|
6
|
+
import { theme as r } from "../../../../utils/theme/index.js";
|
|
7
|
+
import { Text as i } from "../../Text/Text.js";
|
|
8
8
|
import { IconButton as M } from "../../../controls/IconButton/IconButton.js";
|
|
9
|
-
const j =
|
|
9
|
+
const j = v(
|
|
10
10
|
({
|
|
11
|
-
title:
|
|
12
|
-
subtitle:
|
|
11
|
+
title: l,
|
|
12
|
+
subtitle: a,
|
|
13
13
|
w: m = "full",
|
|
14
14
|
p: s,
|
|
15
|
-
py:
|
|
16
|
-
px:
|
|
17
|
-
pt: c =
|
|
18
|
-
pb: p =
|
|
15
|
+
py: d,
|
|
16
|
+
px: n = r.spacing["2xl"],
|
|
17
|
+
pt: c = r.spacing["2xl"],
|
|
18
|
+
pb: p = r.spacing.lg,
|
|
19
19
|
row: f = !0,
|
|
20
20
|
justifyContent: h = "space-between",
|
|
21
21
|
showCloseButton: g = !1,
|
|
@@ -24,57 +24,57 @@ const j = B(
|
|
|
24
24
|
subtitleClassName: u,
|
|
25
25
|
closeButtonClassName: N
|
|
26
26
|
}, y) => {
|
|
27
|
-
const { onClose: C } =
|
|
27
|
+
const { onClose: C } = W();
|
|
28
28
|
return /* @__PURE__ */ e(
|
|
29
29
|
t,
|
|
30
30
|
{
|
|
31
31
|
w: m,
|
|
32
32
|
p: s,
|
|
33
|
-
py:
|
|
34
|
-
px:
|
|
33
|
+
py: d,
|
|
34
|
+
px: n,
|
|
35
35
|
pt: c,
|
|
36
36
|
pb: p,
|
|
37
37
|
row: f,
|
|
38
38
|
justifyContent: h,
|
|
39
39
|
ref: y,
|
|
40
|
-
borderColor:
|
|
40
|
+
borderColor: r.color.border.neutralAlphaBasic,
|
|
41
41
|
borderWidth: 0,
|
|
42
42
|
borderBottomWidth: 1,
|
|
43
43
|
borderStyle: "solid",
|
|
44
44
|
className: x,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ e(t, { gap:
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
46
|
+
/* @__PURE__ */ e(t, { gap: r.spacing.sm, children: [
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
i,
|
|
49
49
|
{
|
|
50
50
|
variant: "title-3",
|
|
51
51
|
colorName: "primary",
|
|
52
52
|
fontWeight: "semibold",
|
|
53
53
|
className: b,
|
|
54
|
-
children:
|
|
54
|
+
children: l
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
57
|
+
/* @__PURE__ */ o(
|
|
58
|
+
i,
|
|
59
59
|
{
|
|
60
60
|
variant: "body-1",
|
|
61
61
|
colorName: "tertiary",
|
|
62
62
|
fontWeight: "medium",
|
|
63
63
|
className: u,
|
|
64
|
-
children:
|
|
64
|
+
children: a
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] }),
|
|
68
|
-
g && /* @__PURE__ */
|
|
68
|
+
g && /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
69
69
|
M,
|
|
70
70
|
{
|
|
71
71
|
onClick: C,
|
|
72
72
|
color: "neutral",
|
|
73
73
|
className: N,
|
|
74
74
|
size: "xs",
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ o(B, {})
|
|
76
76
|
}
|
|
77
|
-
)
|
|
77
|
+
) })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as i, keyframes as a } from "@emotion/css";
|
|
2
|
-
import { bp as
|
|
2
|
+
import { bp as r } from "../../../styles/utils/breakpoints.js";
|
|
3
3
|
import { theme as o } from "../../../utils/theme/index.js";
|
|
4
|
-
const
|
|
4
|
+
const t = a`
|
|
5
5
|
0% {
|
|
6
6
|
opacity: 0;
|
|
7
7
|
transform: scale(0.95);
|
|
@@ -10,29 +10,23 @@ const n = a`
|
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transform: none;
|
|
12
12
|
}
|
|
13
|
-
`,
|
|
13
|
+
`, e = {
|
|
14
14
|
overlay: i({
|
|
15
15
|
backdropFilter: "blur(5px)"
|
|
16
16
|
}),
|
|
17
17
|
modal: i({
|
|
18
18
|
animationDuration: "0.2s",
|
|
19
19
|
animationTimingFunction: "ease-in-out",
|
|
20
|
-
animationName:
|
|
20
|
+
animationName: t,
|
|
21
21
|
maxWidth: `calc(100vw - ${o.spacing["3xl"]})`,
|
|
22
22
|
maxHeight: `calc(100vh - ${o.spacing["7xl"]} - ${o.spacing["7xl"]})`,
|
|
23
23
|
borderRadius: o.cornerRadius["2xl"],
|
|
24
24
|
backgroundColor: o.color.fill.bgPrimary,
|
|
25
25
|
boxShadow: `0 4px 20px 0 ${o.color.effect.shadowS}`,
|
|
26
|
-
[
|
|
26
|
+
[r.sm()]: {
|
|
27
27
|
flex: 1
|
|
28
28
|
}
|
|
29
29
|
}),
|
|
30
|
-
closeButton: i({
|
|
31
|
-
position: "absolute",
|
|
32
|
-
zIndex: 1,
|
|
33
|
-
top: o.spacing.lg,
|
|
34
|
-
right: o.spacing.lg
|
|
35
|
-
}),
|
|
36
30
|
size_lg: i({
|
|
37
31
|
width: 874
|
|
38
32
|
}),
|
|
@@ -44,5 +38,5 @@ const n = a`
|
|
|
44
38
|
})
|
|
45
39
|
};
|
|
46
40
|
export {
|
|
47
|
-
|
|
41
|
+
e as styles
|
|
48
42
|
};
|
|
@@ -6,10 +6,10 @@ import B from "../../../../assets/svg/table/chevron-right.svg.js";
|
|
|
6
6
|
import U from "../../../../assets/svg/table/dots.svg.js";
|
|
7
7
|
import { getPageNumbers as X } from "./TablePagination.utils.js";
|
|
8
8
|
import { Button as M } from "../../../controls/Button/Button.js";
|
|
9
|
+
import { IconButton as j } from "../../../controls/IconButton/IconButton.js";
|
|
9
10
|
import { Box as r } from "../../Box/Box.js";
|
|
10
11
|
import { Select as Y } from "../../../controls/Select/Select.js";
|
|
11
12
|
import { theme as Z } from "../../../../utils/theme/index.js";
|
|
12
|
-
import { IconButton as j } from "../../../controls/IconButton/IconButton.js";
|
|
13
13
|
import { Text as _ } from "../../Text/Text.js";
|
|
14
14
|
const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
|
|
15
15
|
pageIndex: o,
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cx as h } from "@emotion/css";
|
|
3
|
-
import { Chart as b
|
|
3
|
+
import { Chart as b } from "../../../node_modules/@highcharts/react/Highcharts.js";
|
|
4
|
+
import "../../../node_modules/@highcharts/react/options/Title.js";
|
|
5
|
+
import { Tooltip as C } from "../../../node_modules/@highcharts/react/options/Tooltip.js";
|
|
4
6
|
import { useRef as T, useEffect as y, useMemo as o } from "react";
|
|
5
7
|
import { buildLineChartOptions as E, buildTooltipProps as L } from "./utils.js";
|
|
6
8
|
const j = ({
|
|
7
9
|
color: n = "positive",
|
|
8
|
-
data:
|
|
9
|
-
xAxis:
|
|
10
|
-
yAxis:
|
|
10
|
+
data: i = [],
|
|
11
|
+
xAxis: s,
|
|
12
|
+
yAxis: m,
|
|
11
13
|
containerProps: e,
|
|
12
|
-
highcharts:
|
|
14
|
+
highcharts: l,
|
|
13
15
|
tooltip: r,
|
|
14
|
-
className:
|
|
15
|
-
style:
|
|
16
|
+
className: p,
|
|
17
|
+
style: f
|
|
16
18
|
}) => {
|
|
17
19
|
const t = T(null);
|
|
18
20
|
y(() => () => {
|
|
19
21
|
typeof t == "object" && t?.current?.chart && t.current.chart.destroy();
|
|
20
22
|
}, []);
|
|
21
|
-
const c = o(() => E(n,
|
|
23
|
+
const c = o(() => E(n, i, s, m, !!r), [n, i, s, m, r]), u = o(() => r ? L(r) : { enabled: !1 }, [r]), d = o(
|
|
22
24
|
() => ({
|
|
23
25
|
...e,
|
|
24
|
-
className: h(e?.className,
|
|
25
|
-
style: { ...e?.style, ...
|
|
26
|
+
className: h(e?.className, p),
|
|
27
|
+
style: { ...e?.style, ...f }
|
|
26
28
|
}),
|
|
27
|
-
[e,
|
|
29
|
+
[e, p, f]
|
|
28
30
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
30
32
|
b,
|
|
31
33
|
{
|
|
32
|
-
highcharts:
|
|
34
|
+
highcharts: l,
|
|
33
35
|
ref: t,
|
|
34
36
|
options: c,
|
|
35
37
|
containerProps: d,
|
|
36
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ a(C, { ...u })
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
41
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { Chart as d
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { cx as l } from "@emotion/css";
|
|
3
|
+
import { Chart as d } from "../../../node_modules/@highcharts/react/Highcharts.js";
|
|
4
|
+
import { Title as C } from "../../../node_modules/@highcharts/react/options/Title.js";
|
|
5
|
+
import "../../../node_modules/@highcharts/react/options/Tooltip.js";
|
|
4
6
|
import { forwardRef as P, useRef as y, useEffect as R, useMemo as n } from "react";
|
|
5
7
|
import { buildPieProgressChartOptions as x } from "./utils.js";
|
|
6
8
|
const b = P(
|
|
@@ -11,28 +13,28 @@ const b = P(
|
|
|
11
13
|
label: a = (o) => `${o}%`,
|
|
12
14
|
containerProps: t,
|
|
13
15
|
className: i,
|
|
14
|
-
style:
|
|
15
|
-
},
|
|
16
|
-
const o = y(null), r =
|
|
16
|
+
style: m
|
|
17
|
+
}, p) => {
|
|
18
|
+
const o = y(null), r = p || o;
|
|
17
19
|
R(() => () => {
|
|
18
20
|
typeof r == "object" && r?.current?.chart && r.current.chart.destroy();
|
|
19
21
|
}, [r]);
|
|
20
|
-
const
|
|
22
|
+
const u = n(() => x(e, s), [e, s]), h = n(
|
|
21
23
|
() => ({
|
|
22
24
|
...t,
|
|
23
|
-
className:
|
|
24
|
-
style: { ...t?.style, ...
|
|
25
|
+
className: l(t?.className, i),
|
|
26
|
+
style: { ...t?.style, ...m }
|
|
25
27
|
}),
|
|
26
|
-
[t, i,
|
|
28
|
+
[t, i, m]
|
|
27
29
|
);
|
|
28
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ f(
|
|
29
31
|
d,
|
|
30
32
|
{
|
|
31
33
|
highcharts: c,
|
|
32
34
|
ref: r,
|
|
33
|
-
options:
|
|
34
|
-
containerProps:
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
options: u,
|
|
36
|
+
containerProps: h,
|
|
37
|
+
children: /* @__PURE__ */ f(C, { children: a?.(e) })
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
40
|
}
|
|
@@ -5,10 +5,10 @@ import { useMemo as o } from "react";
|
|
|
5
5
|
import { cornerRadiusValues as u, baseButton as D, getVariantStyles as E, typeStyles as G, sizeValues as H } from "./styles.js";
|
|
6
6
|
import { Loader as I } from "../../builders/Loader/Loader.js";
|
|
7
7
|
import { AnimatedText as J } from "../../builders/Text/Text.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
const { color: m } =
|
|
8
|
+
import { theme as K } from "../../../utils/theme/index.js";
|
|
9
|
+
import { Box as P } from "../../builders/Box/Box.js";
|
|
10
|
+
import { Ripple as Q } from "../../builders/Ripple/Ripple.js";
|
|
11
|
+
const { color: m } = K, ue = ({
|
|
12
12
|
disabled: n,
|
|
13
13
|
loading: l,
|
|
14
14
|
className: g,
|
|
@@ -95,7 +95,7 @@ const { color: m } = P, ue = ({
|
|
|
95
95
|
}
|
|
96
96
|
}, [s]);
|
|
97
97
|
return /* @__PURE__ */ a(
|
|
98
|
-
|
|
98
|
+
P,
|
|
99
99
|
{
|
|
100
100
|
className: y(S, g),
|
|
101
101
|
w: h,
|
|
@@ -131,7 +131,7 @@ const { color: m } = P, ue = ({
|
|
|
131
131
|
),
|
|
132
132
|
R
|
|
133
133
|
] }),
|
|
134
|
-
/* @__PURE__ */ a(
|
|
134
|
+
/* @__PURE__ */ a(Q, {})
|
|
135
135
|
]
|
|
136
136
|
}
|
|
137
137
|
)
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CustomType, NegativeType, NeutralType, PositiveType, PrimaryType, SecondaryType, Size, TransferType, WarningType } from '../../../types/tokens.types';
|
|
3
|
+
export type IconButtonSize = Extract<Size, "xs" | "sm" | "md"> | CustomType;
|
|
4
|
+
export type IconButtonColor = PrimaryType | SecondaryType | NegativeType | PositiveType | WarningType | TransferType | NeutralType | CustomType | "neutral-white" | "no-bg";
|
|
5
|
+
export interface IconButtonProps extends ComponentProps<"button"> {
|
|
6
|
+
/**
|
|
7
|
+
* Размер кнопки.
|
|
8
|
+
* @default "md"
|
|
9
|
+
*/
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
/**
|
|
12
|
+
* Цветовая схема (токен).
|
|
13
|
+
* @default "primary"
|
|
14
|
+
*/
|
|
15
|
+
color?: IconButtonColor;
|
|
16
|
+
}
|
|
17
|
+
export declare function IconButton({ children, className, type, color, size, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import p from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: s = "button",
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as p } from "@emotion/css";
|
|
3
|
+
import { styles as l, sizeStyles as c, colorStyles as f } from "./styles.js";
|
|
4
|
+
import { Ripple as u } from "../../builders/Ripple/Ripple.js";
|
|
5
|
+
function d({
|
|
6
|
+
children: o,
|
|
7
|
+
className: t,
|
|
8
|
+
type: r = "button",
|
|
10
9
|
color: m = "primary",
|
|
11
|
-
size:
|
|
12
|
-
...
|
|
10
|
+
size: s = "md",
|
|
11
|
+
...e
|
|
13
12
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ i(
|
|
15
14
|
"button",
|
|
16
15
|
{
|
|
17
|
-
...
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className: p(
|
|
21
|
-
a,
|
|
22
|
-
f[e],
|
|
23
|
-
u[m],
|
|
24
|
-
r
|
|
25
|
-
),
|
|
16
|
+
...e,
|
|
17
|
+
type: r,
|
|
18
|
+
className: p(l, c[s], f[m], t),
|
|
26
19
|
children: [
|
|
27
|
-
/* @__PURE__ */ n(
|
|
28
|
-
|
|
20
|
+
/* @__PURE__ */ n(u, {}),
|
|
21
|
+
o
|
|
29
22
|
]
|
|
30
23
|
}
|
|
31
24
|
);
|
|
32
25
|
}
|
|
33
26
|
export {
|
|
34
|
-
|
|
27
|
+
d as IconButton
|
|
35
28
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type { IconButtonColor, IconButtonProps, IconButtonSize, } from './IconButton';
|
|
2
|
+
export { IconButton } from './IconButton';
|