@arthurzakharov/ui-kit 1.7.0 → 1.7.1
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._BottomBar_1pxm3_1{background-color:var(--rm-ui-content-bg);flex-direction:column;justify-content:stretch}._Fixed_1pxm3_7{position:fixed;z-index:8000000;bottom:0;left:0;width:100%;padding:var(--rm-ui-padding-md) var(--rm-ui-padding-xl) var(--rm-ui-padding-lg)}._Static_1pxm3_16{position:static}._TopBlock_1pxm3_20{display:flex}._LeftBlock_1pxm3_24{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start}._RightBlock_1pxm3_31{flex-grow:1;display:flex;flex-direction:column;align-items:flex-end;text-align:right}._Message_1pxm3_39{margin-top:var(--rm-ui-padding-sm);margin-bottom:var(--rm-ui-padding-md)}._Button_1pxm3_44{margin-top:var(--rm-ui-padding-md)}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TextProps } from '../text/text.component';
|
|
2
|
-
import { Base
|
|
2
|
+
import { Base } from '../../utils/types';
|
|
3
3
|
type BottomBarInfoItem<T> = {
|
|
4
4
|
lined?: boolean;
|
|
5
|
-
weight?:
|
|
6
|
-
size?:
|
|
7
|
-
color?:
|
|
5
|
+
weight?: TextProps['weight'];
|
|
6
|
+
size?: TextProps['size'];
|
|
7
|
+
color?: TextProps['color'];
|
|
8
|
+
align?: TextProps['align'];
|
|
8
9
|
text: T;
|
|
9
10
|
};
|
|
10
11
|
type BottomBarButton = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
import { Text as
|
|
2
|
+
import { useRef as x, useEffect as B, useMemo as b } from "react";
|
|
3
|
+
import _ from "clsx";
|
|
4
|
+
import { useResizeObserver as f, useWindowSize as u } from "usehooks-ts";
|
|
5
|
+
import { Text as c } from "../text/text.component.js";
|
|
6
6
|
import { Button as y } from "../../controls/buttons/button/button.component.js";
|
|
7
7
|
import "../../controls/primitives/box/box.component.js";
|
|
8
|
-
import { baseProps as
|
|
8
|
+
import { baseProps as d } from "../../utils/functions/functions.util.js";
|
|
9
9
|
import "lucide-react";
|
|
10
|
-
import '../../assets/bottom-bar-
|
|
11
|
-
BottomBar:
|
|
10
|
+
import '../../assets/bottom-bar-DE6QuEjZ.css';const k = "_BottomBar_1pxm3_1", w = "_Fixed_1pxm3_7", R = "_Static_1pxm3_16", z = "_TopBlock_1pxm3_20", L = "_LeftBlock_1pxm3_24", v = "_RightBlock_1pxm3_31", N = "_Message_1pxm3_39", M = "_Button_1pxm3_44", r = {
|
|
11
|
+
BottomBar: k,
|
|
12
12
|
Fixed: w,
|
|
13
13
|
Static: R,
|
|
14
14
|
TopBlock: z,
|
|
@@ -16,59 +16,71 @@ import '../../assets/bottom-bar-B35eeXqR.css';const f = "_BottomBar_xd6ok_1", w
|
|
|
16
16
|
RightBlock: v,
|
|
17
17
|
Message: N,
|
|
18
18
|
Button: M
|
|
19
|
-
},
|
|
19
|
+
}, a = (o, t) => o ? typeof o == "string" ? {
|
|
20
20
|
text: o,
|
|
21
21
|
lined: !1,
|
|
22
22
|
weight: t.weight || "regular",
|
|
23
23
|
size: t.size || "body",
|
|
24
|
-
color: t.color || "text-primary"
|
|
24
|
+
color: t.color || "text-primary",
|
|
25
|
+
align: t.align || "left"
|
|
25
26
|
} : {
|
|
26
27
|
text: o.text || /* @__PURE__ */ i("wbr", {}),
|
|
27
28
|
lined: o.lined,
|
|
28
29
|
weight: o.weight || t.weight || "regular",
|
|
29
30
|
size: o.size || t.size || "body",
|
|
30
|
-
color: o.color || t.color || "text-primary"
|
|
31
|
+
color: o.color || t.color || "text-primary",
|
|
32
|
+
align: o.align || t.align || "left"
|
|
31
33
|
} : {
|
|
32
34
|
text: /* @__PURE__ */ i("wbr", {}),
|
|
33
35
|
lined: !1,
|
|
34
36
|
weight: t.weight || "regular",
|
|
35
37
|
size: t.size || "body",
|
|
36
|
-
color: t.color || "text-primary"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
color: t.color || "text-primary",
|
|
39
|
+
align: t.align || "left"
|
|
40
|
+
}, I = ({ button: o, info: t, message: l, staticFrom: p = 768, ...s }) => {
|
|
41
|
+
const g = x(null), { height: m } = f({
|
|
42
|
+
ref: g,
|
|
40
43
|
box: "border-box"
|
|
41
|
-
}), { width:
|
|
42
|
-
B(() => (
|
|
44
|
+
}), { width: h } = u({ initializeWithValue: !0, debounceDelay: 150 });
|
|
45
|
+
B(() => (m ? document.body.style.marginBottom = `${Math.round(m)}px` : document.body.style.removeProperty("margin-bottom"), () => {
|
|
43
46
|
document.body.style.removeProperty("margin-bottom");
|
|
44
|
-
}), [
|
|
45
|
-
const e =
|
|
47
|
+
}), [m]);
|
|
48
|
+
const e = b(
|
|
46
49
|
() => ({
|
|
47
|
-
topLeft:
|
|
48
|
-
topRight:
|
|
49
|
-
bottomLeft:
|
|
50
|
-
bottomRight:
|
|
50
|
+
topLeft: a(t.topLeft, { weight: "medium", color: "text-primary", align: "left" }),
|
|
51
|
+
topRight: a(t.topRight, { weight: "medium", color: "text-primary", align: "right" }),
|
|
52
|
+
bottomLeft: a(t.bottomLeft, { weight: "regular", color: "text-secondary", align: "left" }),
|
|
53
|
+
bottomRight: a(t.bottomRight, { weight: "regular", color: "text-secondary", align: "right" })
|
|
51
54
|
}),
|
|
52
55
|
[t]
|
|
53
56
|
);
|
|
54
57
|
return /* @__PURE__ */ n(
|
|
55
58
|
"div",
|
|
56
59
|
{
|
|
57
|
-
"data-testid":
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
60
|
+
"data-testid": d(s, "data-testid", "bottom-bar"),
|
|
61
|
+
ref: g,
|
|
62
|
+
className: _(r.BottomBar, d(s, "className"), h >= p ? r.Static : r.Fixed),
|
|
60
63
|
children: [
|
|
61
64
|
/* @__PURE__ */ n("div", { className: r.TopBlock, children: [
|
|
62
65
|
/* @__PURE__ */ n("div", { className: r.LeftBlock, children: [
|
|
63
|
-
/* @__PURE__ */ i(
|
|
64
|
-
/* @__PURE__ */ i(
|
|
66
|
+
/* @__PURE__ */ i(c, { ...e.topLeft, children: e.topLeft.text }),
|
|
67
|
+
/* @__PURE__ */ i(c, { ...e.bottomLeft, children: e.bottomLeft.text })
|
|
65
68
|
] }),
|
|
66
69
|
/* @__PURE__ */ n("div", { className: r.RightBlock, children: [
|
|
67
|
-
/* @__PURE__ */ i(
|
|
68
|
-
/* @__PURE__ */ i(
|
|
70
|
+
/* @__PURE__ */ i(c, { ...e.topRight, children: e.topRight.text }),
|
|
71
|
+
/* @__PURE__ */ i(c, { ...e.bottomRight, children: e.bottomRight.text })
|
|
69
72
|
] })
|
|
70
73
|
] }),
|
|
71
|
-
|
|
74
|
+
l && !l.hidden && /* @__PURE__ */ i(
|
|
75
|
+
c,
|
|
76
|
+
{
|
|
77
|
+
size: "body-small",
|
|
78
|
+
color: l.color || "text-secondary",
|
|
79
|
+
align: l.align || "center",
|
|
80
|
+
className: r.Message,
|
|
81
|
+
children: l.text
|
|
82
|
+
}
|
|
83
|
+
),
|
|
72
84
|
/* @__PURE__ */ i(
|
|
73
85
|
y,
|
|
74
86
|
{
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._BottomBar_xd6ok_1{background-color:var(--rm-ui-content-bg);flex-direction:column;justify-content:stretch}._Fixed_xd6ok_7{position:fixed;z-index:8000000;bottom:0;left:0;width:100%;padding:var(--rm-ui-padding-md) var(--rm-ui-padding-xl) var(--rm-ui-padding-lg)}._Static_xd6ok_16{position:static}._TopBlock_xd6ok_20{display:flex}._LeftBlock_xd6ok_24{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start}._RightBlock_xd6ok_31{flex-grow:1;display:flex;flex-direction:column;align-items:flex-end}._Message_xd6ok_38{margin-top:var(--rm-ui-padding-sm);margin-bottom:var(--rm-ui-padding-md)}._Button_xd6ok_43{margin-top:var(--rm-ui-padding-md)}
|