@arthurzakharov/ui-kit 1.5.7 → 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?: string;
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 l, jsx as i } from "react/jsx-runtime";
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 c } from "../text/text.component.js";
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 g } from "../../utils/functions/functions.util.js";
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: a = "", staticFrom: h = 768, ...m }) => {
38
- const d = p(null), { height: n } = _({
39
- ref: d,
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: x } = k({ initializeWithValue: !0, debounceDelay: 150 });
42
- B(() => (n ? document.body.style.marginBottom = `${Math.round(n)}px` : document.body.style.removeProperty("margin-bottom"), () => {
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
- }), [n]);
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__ */ l(
54
+ return /* @__PURE__ */ n(
55
55
  "div",
56
56
  {
57
- "data-testid": g(m, "data-testid", "bottom-bar"),
58
- ref: d,
59
- className: b(r.BottomBar, g(m, "className"), x >= h ? r.Static : r.Fixed),
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__ */ l("div", { className: r.TopBlock, children: [
62
- /* @__PURE__ */ l("div", { className: r.LeftBlock, children: [
63
- /* @__PURE__ */ i(c, { ...e.topLeft, children: e.topLeft.text }),
64
- /* @__PURE__ */ i(c, { ...e.bottomLeft, children: e.bottomLeft.text })
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__ */ l("div", { className: r.RightBlock, children: [
67
- /* @__PURE__ */ i(c, { ...e.topRight, children: e.topRight.text }),
68
- /* @__PURE__ */ i(c, { ...e.bottomRight, children: e.bottomRight.text })
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
- a && /* @__PURE__ */ i(c, { color: "text-secondary", align: "center", className: r.Message, children: a }),
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 { MessageBlock } from './message-block.component';
1
+ export { MessageBlock, type MessageBlockProps } from './message-block.component';
@@ -1,9 +1,8 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { Base } from '../../utils/types';
3
- interface MessageBlockProps extends PropsWithChildren<Base> {
3
+ export interface MessageBlockProps extends PropsWithChildren<Base> {
4
4
  emoji?: string;
5
5
  title?: string;
6
6
  subtitle?: string;
7
7
  }
8
8
  export declare const MessageBlock: ({ children, emoji, title, subtitle, ...base }: MessageBlockProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -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 TextFieldProps extends HTMLAttributes<HTMLElementTagNameMap>, PropsWithChildren<Base> {
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 }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
12
+ export declare const Text: ({ children, className, preset, lined, align, tag, weight, size, color, ...rest }: TextProps) => import("react/jsx-runtime").JSX.Element;
package/dist/main.d.ts CHANGED
@@ -40,7 +40,7 @@ export { Line } from './components/line/line.component';
40
40
  export { Loader } from './components/loader';
41
41
  export { MainAttachment, type MainAttachmentProps } from './components/main-attachment/main-attachment.component';
42
42
  export { Message, type MessageProps } from './components/message';
43
- export { MessageBlock } from './components/message-block';
43
+ export { MessageBlock, type MessageBlockProps } from './components/message-block';
44
44
  export { NotFound, type NotFoundProps } from './components/not-found';
45
45
  export { Payment, type PaymentBlockProps, type PaymentGlassProps, type PaymentSidebarProps, type PaymentTextBlocksProps, type PaymentTextBlockItem, } from './components/payment/payment.component';
46
46
  export { Sidebar, type SidebarProps } from './components/sidebar';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "1.5.7",
4
+ "version": "1.5.9",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",