@arthurzakharov/ui-kit 1.5.8 → 1.5.9
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TextProps } from '../text/text.component';
|
|
1
2
|
import { Base, FontColor, FontSize, FontWeight } from '../../utils/types';
|
|
2
3
|
type BottomBarInfoItem<T> = {
|
|
3
4
|
lined?: boolean;
|
|
@@ -18,10 +19,16 @@ type BottomBarInfo = {
|
|
|
18
19
|
bottomLeft?: BottomBarInfoItem<string> | string;
|
|
19
20
|
bottomRight?: BottomBarInfoItem<string> | string;
|
|
20
21
|
};
|
|
22
|
+
type BottomBarMessage = {
|
|
23
|
+
text: string;
|
|
24
|
+
hidden?: boolean;
|
|
25
|
+
color?: TextProps['color'];
|
|
26
|
+
align?: TextProps['align'];
|
|
27
|
+
};
|
|
21
28
|
interface BottomBarProps extends Base {
|
|
22
29
|
button: BottomBarButton;
|
|
23
30
|
info: BottomBarInfo;
|
|
24
|
-
message?:
|
|
31
|
+
message?: BottomBarMessage;
|
|
25
32
|
staticFrom?: number;
|
|
26
33
|
}
|
|
27
34
|
export declare const BottomBar: ({ button, info, message, staticFrom, ...base }: BottomBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as p, useEffect as B, useMemo as u } from "react";
|
|
3
3
|
import b from "clsx";
|
|
4
4
|
import { useResizeObserver as _, useWindowSize as k } from "usehooks-ts";
|
|
5
|
-
import { Text as
|
|
5
|
+
import { Text as l } 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 h } from "../../utils/functions/functions.util.js";
|
|
9
9
|
import "lucide-react";
|
|
10
10
|
import '../../assets/bottom-bar-B35eeXqR.css';const f = "_BottomBar_xd6ok_1", w = "_Fixed_xd6ok_7", R = "_Static_xd6ok_16", z = "_TopBlock_xd6ok_20", L = "_LeftBlock_xd6ok_24", v = "_RightBlock_xd6ok_31", N = "_Message_xd6ok_38", M = "_Button_xd6ok_43", r = {
|
|
11
11
|
BottomBar: f,
|
|
@@ -34,14 +34,14 @@ import '../../assets/bottom-bar-B35eeXqR.css';const f = "_BottomBar_xd6ok_1", w
|
|
|
34
34
|
weight: t.weight || "regular",
|
|
35
35
|
size: t.size || "body",
|
|
36
36
|
color: t.color || "text-primary"
|
|
37
|
-
}, I = ({ button: o, info: t, message:
|
|
38
|
-
const
|
|
39
|
-
ref:
|
|
37
|
+
}, I = ({ button: o, info: t, message: c, staticFrom: x = 768, ...a }) => {
|
|
38
|
+
const m = p(null), { height: d } = _({
|
|
39
|
+
ref: m,
|
|
40
40
|
box: "border-box"
|
|
41
|
-
}), { width:
|
|
42
|
-
B(() => (
|
|
41
|
+
}), { width: g } = k({ initializeWithValue: !0, debounceDelay: 150 });
|
|
42
|
+
B(() => (d ? document.body.style.marginBottom = `${Math.round(d)}px` : document.body.style.removeProperty("margin-bottom"), () => {
|
|
43
43
|
document.body.style.removeProperty("margin-bottom");
|
|
44
|
-
}), [
|
|
44
|
+
}), [d]);
|
|
45
45
|
const e = u(
|
|
46
46
|
() => ({
|
|
47
47
|
topLeft: s(t.topLeft, { weight: "medium", color: "text-primary" }),
|
|
@@ -51,24 +51,24 @@ import '../../assets/bottom-bar-B35eeXqR.css';const f = "_BottomBar_xd6ok_1", w
|
|
|
51
51
|
}),
|
|
52
52
|
[t]
|
|
53
53
|
);
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
|
-
"data-testid":
|
|
58
|
-
ref:
|
|
59
|
-
className: b(r.BottomBar,
|
|
57
|
+
"data-testid": h(a, "data-testid", "bottom-bar"),
|
|
58
|
+
ref: m,
|
|
59
|
+
className: b(r.BottomBar, h(a, "className"), g >= x ? r.Static : r.Fixed),
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */ i(
|
|
64
|
-
/* @__PURE__ */ i(
|
|
61
|
+
/* @__PURE__ */ n("div", { className: r.TopBlock, children: [
|
|
62
|
+
/* @__PURE__ */ n("div", { className: r.LeftBlock, children: [
|
|
63
|
+
/* @__PURE__ */ i(l, { ...e.topLeft, children: e.topLeft.text }),
|
|
64
|
+
/* @__PURE__ */ i(l, { ...e.bottomLeft, children: e.bottomLeft.text })
|
|
65
65
|
] }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ i(
|
|
68
|
-
/* @__PURE__ */ i(
|
|
66
|
+
/* @__PURE__ */ n("div", { className: r.RightBlock, children: [
|
|
67
|
+
/* @__PURE__ */ i(l, { ...e.topRight, children: e.topRight.text }),
|
|
68
|
+
/* @__PURE__ */ i(l, { ...e.bottomRight, children: e.bottomRight.text })
|
|
69
69
|
] })
|
|
70
70
|
] }),
|
|
71
|
-
|
|
71
|
+
c && !c.hidden && /* @__PURE__ */ i(l, { color: c.color || "text-secondary", align: c.align || "center", className: r.Message, children: c.text }),
|
|
72
72
|
/* @__PURE__ */ i(
|
|
73
73
|
y,
|
|
74
74
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Text } from './text.component';
|
|
1
|
+
export { Text, type TextProps } from './text.component';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
2
|
import { Base, FontAlign, FontColor, FontSize, FontWeight, TagNames, TextPreset } from '../../utils/types';
|
|
3
|
-
interface
|
|
3
|
+
export interface TextProps extends HTMLAttributes<HTMLElementTagNameMap>, PropsWithChildren<Base> {
|
|
4
4
|
preset?: TextPreset;
|
|
5
5
|
tag?: TagNames;
|
|
6
6
|
lined?: boolean;
|
|
@@ -9,5 +9,4 @@ interface TextFieldProps extends HTMLAttributes<HTMLElementTagNameMap>, PropsWit
|
|
|
9
9
|
size?: FontSize;
|
|
10
10
|
color?: FontColor;
|
|
11
11
|
}
|
|
12
|
-
export declare const Text: ({ children, className, preset, lined, align, tag, weight, size, color, ...rest }:
|
|
13
|
-
export {};
|
|
12
|
+
export declare const Text: ({ children, className, preset, lined, align, tag, weight, size, color, ...rest }: TextProps) => import("react/jsx-runtime").JSX.Element;
|