@arthurzakharov/ui-kit 1.2.8 → 1.2.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.
@@ -0,0 +1 @@
1
+ ._Loader_11mao_1{display:inline-flex}._Padding_11mao_5{display:flex;justify-content:center}._XXS_11mao_10{padding:32px}._XS_11mao_14{padding:64px}._SM_11mao_18{padding:96px}._MD_11mao_22{padding:128px}._LG_11mao_26{padding:160px}._XL_11mao_30{padding:192px}._XXL_11mao_34{padding:224px}._XXXL_11mao_38{padding:256px}._Icon_11mao_42{animation:_spinPulse_11mao_1 2s linear infinite;transform-origin:center}._White_11mao_47{stroke:#fff}._Primary_11mao_51{stroke:var(--rm-ui-color-accent-primary)}._Secondary_11mao_55{stroke:var(--rm-ui-color-accent-secondary)}._Icon_11mao_42>path{animation:_dash_11mao_1 2s linear infinite}@keyframes _spinPulse_11mao_1{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.25)}to{transform:rotate(360deg) scale(1)}}@keyframes _dash_11mao_1{0%{stroke-opacity:1}50%{stroke-opacity:.5}to{stroke-opacity:1}}
@@ -0,0 +1 @@
1
+ ._User_12b2p_1{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-sm);font-weight:var(--rm-ui-font-weight-light);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}._Head_12b2p_13{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._Info_12b2p_25{display:inline-flex;flex-direction:column;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start}
@@ -3,6 +3,7 @@ type LoaderColor = 'white' | 'primary' | 'secondary';
3
3
  export interface LoaderProps extends BaseProps {
4
4
  size: Size;
5
5
  color: LoaderColor;
6
+ padding?: Size;
6
7
  }
7
- export declare const Loader: ({ size, color, className }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Loader: ({ size, color, padding, className }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,41 +1,72 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import t from "clsx";
3
- import { Loader as c } from "lucide-react";
4
- import '../../assets/loader-BBn4lDjH.css';const n = "_Loader_2orye_1", i = "_White_2orye_6", m = "_Primary_2orye_10", y = "_Secondary_2orye_14", r = {
1
+ import { jsxs as t, jsx as c } from "react/jsx-runtime";
2
+ import s from "clsx";
3
+ import { Loader as X } from "lucide-react";
4
+ import '../../assets/loader-C0f3AvRU.css';const n = "_Loader_11mao_1", m = "_Padding_11mao_5", L = "_XXS_11mao_10", x = "_XS_11mao_14", i = "_SM_11mao_18", S = "_MD_11mao_22", d = "_LG_11mao_26", l = "_XL_11mao_30", y = "_XXL_11mao_34", u = "_XXXL_11mao_38", M = "_Icon_11mao_42", P = "_White_11mao_47", h = "_Primary_11mao_51", D = "_Secondary_11mao_55", o = {
5
5
  Loader: n,
6
- White: i,
7
- Primary: m,
8
- Secondary: y
9
- }, u = ({ size: a, color: e, className: o = "" }) => /* @__PURE__ */ s(
10
- c,
6
+ Padding: m,
7
+ XXS: L,
8
+ XS: x,
9
+ SM: i,
10
+ MD: S,
11
+ LG: d,
12
+ XL: l,
13
+ XXL: y,
14
+ XXXL: u,
15
+ Icon: M,
16
+ White: P,
17
+ Primary: h,
18
+ Secondary: D
19
+ }, f = ({ size: e, color: r, padding: a, className: _ = "" }) => /* @__PURE__ */ t(
20
+ "div",
11
21
  {
12
- size: (() => {
13
- switch (a) {
14
- case "xxs":
15
- return 16;
16
- case "xs":
17
- return 24;
18
- case "sm":
19
- return 32;
20
- case "md":
21
- return 40;
22
- case "lg":
23
- return 48;
24
- case "xl":
25
- return 56;
26
- case "xxl":
27
- return 64;
28
- case "xxxl":
29
- return 72;
30
- }
31
- })(),
32
- className: t(r.Loader, o, {
33
- [r.White]: e === "white",
34
- [r.Primary]: e === "primary",
35
- [r.Secondary]: e === "secondary"
36
- })
22
+ "data-testid": "loader",
23
+ className: s(o.Loader, _, {
24
+ [o.Padding]: !!a,
25
+ [o.XXS]: a === "xxs",
26
+ [o.XS]: a === "xs",
27
+ [o.SM]: a === "sm",
28
+ [o.MD]: a === "md",
29
+ [o.LG]: a === "lg",
30
+ [o.XL]: a === "xl",
31
+ [o.XXL]: a === "xxl",
32
+ [o.XXXL]: a === "xxxl"
33
+ }),
34
+ children: [
35
+ /* @__PURE__ */ c(
36
+ X,
37
+ {
38
+ "data-testid": "loader-icon",
39
+ size: (() => {
40
+ switch (e) {
41
+ case "xxs":
42
+ return 16;
43
+ case "xs":
44
+ return 24;
45
+ case "sm":
46
+ return 32;
47
+ case "md":
48
+ return 40;
49
+ case "lg":
50
+ return 48;
51
+ case "xl":
52
+ return 56;
53
+ case "xxl":
54
+ return 64;
55
+ case "xxxl":
56
+ return 72;
57
+ }
58
+ })(),
59
+ className: s(o.Icon, {
60
+ [o.White]: r === "white",
61
+ [o.Primary]: r === "primary",
62
+ [o.Secondary]: r === "secondary"
63
+ })
64
+ }
65
+ ),
66
+ " "
67
+ ]
37
68
  }
38
69
  );
39
70
  export {
40
- u as Loader
71
+ f as Loader
41
72
  };
@@ -0,0 +1 @@
1
+ export { UserPanel, type UserPanelProps } from './user-panel.component';
@@ -0,0 +1,4 @@
1
+ import { UserPanel as o } from "./user-panel.component.js";
2
+ export {
3
+ o as UserPanel
4
+ };
@@ -1,7 +1,8 @@
1
- export interface UserPanelProps {
2
- title?: string;
3
- button?: string;
4
- data?: string[];
1
+ import { BaseProps } from '../../utils/types';
2
+ export interface UserPanelProps extends BaseProps {
3
+ title: string;
4
+ button: string;
5
+ data: string[];
5
6
  onClick: () => void;
6
7
  }
7
- export declare const UserPanel: (props: UserPanelProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const UserPanel: ({ title, button, data, onClick, className }: UserPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,29 @@
1
- import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
- import { Pencil as u } from "lucide-react";
3
- import '../../assets/user-panel-BEeXLR6v.css';const i = "_User_1kveo_1", d = "_UserHead_1kveo_9", m = "_UserTitle_1kveo_17", I = "_UserButton_1kveo_24", B = "_UserButtonText_1kveo_41", f = "_UserButtonIcon_1kveo_48", k = "_UserInfo_1kveo_55", v = "_UserInfoRaw_1kveo_63", e = {
4
- User: i,
5
- UserHead: d,
6
- UserTitle: m,
7
- UserButton: I,
8
- UserButtonText: B,
9
- UserButtonIcon: f,
10
- UserInfo: k,
11
- UserInfoRaw: v
12
- }, p = (o) => {
13
- const { title: r = "Ihre Angaben", button: c = "Ändern", data: a = [], onClick: U } = o, l = (t) => {
14
- t.preventDefault(), t.currentTarget.blur(), U();
15
- };
16
- return /* @__PURE__ */ n("div", { className: e.User, children: [
17
- /* @__PURE__ */ n("div", { className: e.UserHead, children: [
18
- /* @__PURE__ */ s("span", { className: e.UserTitle, dangerouslySetInnerHTML: { __html: r } }),
19
- /* @__PURE__ */ n("button", { type: "button", className: e.UserButton, onClick: l, children: [
20
- /* @__PURE__ */ s("span", { className: e.UserButtonText, children: c }),
21
- /* @__PURE__ */ s(u, { className: e.UserButtonIcon })
22
- ] })
23
- ] }),
24
- /* @__PURE__ */ s("ul", { className: e.UserInfo, children: a.map((t, _) => /* @__PURE__ */ s("li", { className: e.UserInfoRaw, children: t }, _)) })
25
- ] });
26
- };
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { Pencil as d } from "lucide-react";
3
+ import m from "clsx";
4
+ import { C as p } from "../../control.component-Cq46ev8T.js";
5
+ import '../../assets/user-panel-BJB6pJ70.css';const f = "_Head_12b2p_13", u = "_Info_12b2p_25", r = {
6
+ Head: f,
7
+ Info: u
8
+ }, I = ({ title: n, button: o, data: i, onClick: s, className: a = "" }) => /* @__PURE__ */ t("div", { "data-testid": "user-panel", className: m(r.UserPanel, a), children: [
9
+ /* @__PURE__ */ t("div", { className: r.Head, children: [
10
+ /* @__PURE__ */ e("span", { "data-testid": "user-panel-title", children: n }),
11
+ /* @__PURE__ */ e(
12
+ p.ButtonText,
13
+ {
14
+ preventDefault: !0,
15
+ blurAfterClick: !0,
16
+ icon: /* @__PURE__ */ e(d, {}),
17
+ iconPosition: "right",
18
+ size: "md",
19
+ color: "primary",
20
+ onClick: s,
21
+ children: o
22
+ }
23
+ )
24
+ ] }),
25
+ /* @__PURE__ */ e("ul", { className: r.Info, children: i.map((l, c) => /* @__PURE__ */ e("li", { children: l }, c)) })
26
+ ] });
27
27
  export {
28
- p as UserPanel
28
+ I as UserPanel
29
29
  };
package/dist/main.d.ts CHANGED
@@ -16,7 +16,6 @@ export { Information, type InformationProps } from './components/information/inf
16
16
  export { Layout, type LayoutProps } from './components/layout/layout.component';
17
17
  export { Line } from './components/line/line.component';
18
18
  export { Loader, type LoaderProps } from './components/loader';
19
- export { LoadingBlock } from './components/loading-block/loading-block.component';
20
19
  export { MainAttachment, type MainAttachmentProps } from './components/main-attachment/main-attachment.component';
21
20
  export { Message, type MessageProps } from './components/message';
22
21
  export { MessageBlock, type MessageBlockProps } from './components/message-block/message-block.component';
@@ -26,5 +25,5 @@ export { Sidebar, type SidebarProps } from './components/sidebar/sidebar.compone
26
25
  export { Signature, type SignatureProps, type SignatureMode } from './components/signature/signature.component';
27
26
  export { Svg, type SvgProps } from './components/svg/svg.component';
28
27
  export { Text } from './components/text/text.component';
29
- export { UserPanel, type UserPanelProps } from './components/user-panel/user-panel.component';
28
+ export { UserPanel, type UserPanelProps } from './components/user-panel';
30
29
  export { Warranty, type WarrantyProps } from './components/warranty';
package/dist/main.js CHANGED
@@ -5,29 +5,28 @@ import { Certifications as a } from "./components/certifications/certifications.
5
5
  import { C as i } from "./control.component-Cq46ev8T.js";
6
6
  import { DataProtectedLabel as s } from "./components/data-protected-label/data-protected-label.component.js";
7
7
  import { Dialog as d } from "./components/dialog/dialog.component.js";
8
- import { DialogArticle as L } from "./components/dialog-article/dialog-article.component.js";
9
- import { Expenses as B } from "./components/expenses/expenses.component.js";
10
- import { Flex as P } from "./components/flex/flex.component.js";
11
- import { Footer as u } from "./components/footer/footer.component.js";
8
+ import { DialogArticle as A } from "./components/dialog-article/dialog-article.component.js";
9
+ import { Expenses as L } from "./components/expenses/expenses.component.js";
10
+ import { Flex as b } from "./components/flex/flex.component.js";
11
+ import { Footer as y } from "./components/footer/footer.component.js";
12
12
  import { FormRow as C } from "./components/form-row/form-row.component.js";
13
13
  import { Header as M } from "./components/header/header.component.js";
14
- import { InfoPanel as k } from "./components/info-panel/info-panel.component.js";
15
- import { Information as T } from "./components/information/information.component.js";
14
+ import { InfoPanel as I } from "./components/info-panel/info-panel.component.js";
15
+ import { Information as h } from "./components/information/information.component.js";
16
16
  import { Layout as v } from "./components/layout/layout.component.js";
17
17
  import { Line as E } from "./components/line/line.component.js";
18
18
  import { Loader as N } from "./components/loader/loader.component.js";
19
- import { LoadingBlock as U } from "./components/loading-block/loading-block.component.js";
20
- import { MainAttachment as j } from "./components/main-attachment/main-attachment.component.js";
21
- import { Message as z } from "./components/message/message.component.js";
22
- import { MessageBlock as J } from "./components/message-block/message-block.component.js";
23
- import { NotFound as O } from "./components/not-found/not-found.component.js";
24
- import { Payment as V } from "./components/payment/payment.component.js";
25
- import { Sidebar as Y } from "./components/sidebar/sidebar.component.js";
26
- import { Signature as _ } from "./components/signature/signature.component.js";
27
- import { Svg as oo } from "./components/svg/svg.component.js";
28
- import { Text as eo } from "./components/text/text.component.js";
29
- import { UserPanel as mo } from "./components/user-panel/user-panel.component.js";
30
- import { Warranty as xo } from "./components/warranty/warranty.component.js";
19
+ import { MainAttachment as U } from "./components/main-attachment/main-attachment.component.js";
20
+ import { Message as j } from "./components/message/message.component.js";
21
+ import { MessageBlock as z } from "./components/message-block/message-block.component.js";
22
+ import { NotFound as J } from "./components/not-found/not-found.component.js";
23
+ import { Payment as O } from "./components/payment/payment.component.js";
24
+ import { Sidebar as V } from "./components/sidebar/sidebar.component.js";
25
+ import { Signature as Y } from "./components/signature/signature.component.js";
26
+ import { Svg as _ } from "./components/svg/svg.component.js";
27
+ import { Text as oo } from "./components/text/text.component.js";
28
+ import { UserPanel as eo } from "./components/user-panel/user-panel.component.js";
29
+ import { Warranty as mo } from "./components/warranty/warranty.component.js";
31
30
  import './assets/main-BK_1RcKG.css';export {
32
31
  e as AccordionTable,
33
32
  m as Animation,
@@ -36,27 +35,26 @@ import './assets/main-BK_1RcKG.css';export {
36
35
  i as Control,
37
36
  s as DataProtectedLabel,
38
37
  d as Dialog,
39
- L as DialogArticle,
40
- B as Expenses,
41
- P as Flex,
42
- u as Footer,
38
+ A as DialogArticle,
39
+ L as Expenses,
40
+ b as Flex,
41
+ y as Footer,
43
42
  C as FormRow,
44
43
  M as Header,
45
- k as InfoPanel,
46
- T as Information,
44
+ I as InfoPanel,
45
+ h as Information,
47
46
  v as Layout,
48
47
  E as Line,
49
48
  N as Loader,
50
- U as LoadingBlock,
51
- j as MainAttachment,
52
- z as Message,
53
- J as MessageBlock,
54
- O as NotFound,
55
- V as Payment,
56
- Y as Sidebar,
57
- _ as Signature,
58
- oo as Svg,
59
- eo as Text,
60
- mo as UserPanel,
61
- xo as Warranty
49
+ U as MainAttachment,
50
+ j as Message,
51
+ z as MessageBlock,
52
+ J as NotFound,
53
+ O as Payment,
54
+ V as Sidebar,
55
+ Y as Signature,
56
+ _ as Svg,
57
+ oo as Text,
58
+ eo as UserPanel,
59
+ mo as Warranty
62
60
  };
@@ -1,3 +1,4 @@
1
+ import { SyntheticEvent } from 'react';
1
2
  /**
2
3
  * Type guard: checks whether value is a string
3
4
  */
@@ -12,3 +13,9 @@ export declare function containsHtml(value: string): boolean;
12
13
  * Checks if unknown value is a string containing HTML markup
13
14
  */
14
15
  export declare function isHtmlString(value: unknown): value is string;
16
+ type ControlAction = 'prevent' | 'stop' | 'blur';
17
+ /**
18
+ * A higher-order function to wrap event handlers with common event control logic.
19
+ */
20
+ export declare const withControl: <E extends SyntheticEvent<HTMLElement>>(handler: (e: E) => void, ...actions: ControlAction[]) => (e: E) => void;
21
+ export {};
@@ -1,14 +1,18 @@
1
- function n(t) {
1
+ function e(t) {
2
2
  return typeof t == "string";
3
3
  }
4
4
  function i(t) {
5
5
  return /<\/?[a-z][\s\S]*>/i.test(t);
6
6
  }
7
- function e(t) {
8
- return n(t) && i(t);
7
+ function o(t) {
8
+ return e(t) && i(t);
9
9
  }
10
+ const u = (t, ...n) => (r) => {
11
+ n.includes("prevent") && r.preventDefault(), n.includes("stop") && r.stopPropagation(), n.includes("blur") && r.currentTarget.blur(), t(r);
12
+ };
10
13
  export {
11
14
  i as containsHtml,
12
- e as isHtmlString,
13
- n as isString
15
+ o as isHtmlString,
16
+ e as isString,
17
+ u as withControl
14
18
  };
@@ -1,6 +1,7 @@
1
- import { containsHtml as n, isHtmlString as r, isString as m } from "./functions.util.js";
1
+ import { containsHtml as n, isHtmlString as o, isString as r, withControl as l } from "./functions.util.js";
2
2
  export {
3
3
  n as containsHtml,
4
- r as isHtmlString,
5
- m as isString
4
+ o as isHtmlString,
5
+ r as isString,
6
+ l as withControl
6
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "1.2.8",
4
+ "version": "1.2.9",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Loader_2orye_1{animation:_spinPulse_2orye_1 2s linear infinite;transform-origin:center}._White_2orye_6{stroke:#fff}._Primary_2orye_10{stroke:var(--rm-ui-color-accent-primary)}._Secondary_2orye_14{stroke:var(--rm-ui-color-accent-secondary)}._Loader_2orye_1>path{animation:_dash_2orye_1 2s linear infinite}@keyframes _spinPulse_2orye_1{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.25)}to{transform:rotate(360deg) scale(1)}}@keyframes _dash_2orye_1{0%{stroke-opacity:1}50%{stroke-opacity:.5}to{stroke-opacity:1}}
@@ -1 +0,0 @@
1
- ._LoadingBlock_1h5nh_1{height:var(--rm-ui-loading-screen-height);display:flex;align-items:center;justify-content:center;background-color:transparent}
@@ -1 +0,0 @@
1
- ._User_1kveo_1{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-sm)}._UserHead_1kveo_9{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}._UserTitle_1kveo_17{font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._UserButton_1kveo_24{padding:0;border:none;background-color:transparent;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:var(--rm-ui-padding-xs)}._UserButton_1kveo_24:focus-visible{outline-offset:2px;outline-color:var(--rm-ui-color-focus)}._UserButtonText_1kveo_41{font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._UserButtonIcon_1kveo_48{width:24px;height:24px;stroke-width:2px;stroke:var(--rm-ui-color-text-primary)}._UserInfo_1kveo_55{display:inline-flex;flex-direction:column;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start}._UserInfoRaw_1kveo_63{font-weight:var(--rm-ui-font-weight-light);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}
@@ -1 +0,0 @@
1
- export declare const LoadingBlock: () => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { Loader as c } from "../loader/loader.component.js";
3
- import '../../assets/loading-block-al0S6J3z.css';const n = "_LoadingBlock_1h5nh_1", r = {
4
- LoadingBlock: n
5
- }, l = () => /* @__PURE__ */ o("div", { className: r.LoadingBlock, children: /* @__PURE__ */ o(c, { size: "lg", color: "primary" }) });
6
- export {
7
- l as LoadingBlock
8
- };