@arthurzakharov/ui-kit 2.5.2 → 2.7.0

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
+ ._PriceLine_qio4u_1{display:flex;flex-direction:row;align-items:center;justify-content:space-between}
@@ -0,0 +1 @@
1
+ export { PriceLine, type PriceLineProps } from './price-line.component';
@@ -0,0 +1,4 @@
1
+ import { PriceLine as i } from "./price-line.component.js";
2
+ export {
3
+ i as PriceLine
4
+ };
@@ -0,0 +1,9 @@
1
+ export interface PriceLineProps {
2
+ text?: string;
3
+ price: number;
4
+ }
5
+ /**
6
+ * Two-column row that renders a label on the left and a German-formatted
7
+ * Euro amount on the right. Default label is "Pauschale Vergütung inkl. Steuern".
8
+ */
9
+ export declare const PriceLine: (props: PriceLineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { Text as r } from "../text/text.component.js";
3
+ import { convertToEuro as c } from "../../utils/functions/functions.util.js";
4
+ import '../../assets/price-line-B6G5Nune.css';const s = "_PriceLine_qio4u_1", a = {
5
+ PriceLine: s
6
+ }, g = (i) => {
7
+ const { text: o = "Pauschale Vergütung inkl. Steuern", price: t } = i;
8
+ return /* @__PURE__ */ n("div", { className: a.PriceLine, children: [
9
+ /* @__PURE__ */ e(r, { tag: "span", weight: "regular", size: "body-small", color: "theme-primary", children: o }),
10
+ /* @__PURE__ */ e(r, { tag: "span", weight: "regular", size: "body-small", color: "theme-primary", children: c(t) })
11
+ ] });
12
+ };
13
+ export {
14
+ g as PriceLine
15
+ };
@@ -1,8 +1,8 @@
1
1
  import { Base } from '../../utils/types';
2
2
  export interface UserPanelProps extends Base {
3
3
  title: string;
4
- button: string;
4
+ button?: string;
5
5
  data: string[];
6
- onClick: () => void;
6
+ onClick?: () => void;
7
7
  }
8
8
  export declare const UserPanel: ({ title, button, data, onClick, ...base }: UserPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { Pencil as d } from "lucide-react";
3
3
  import { clsx as p, baseProps as o } from "../../utils/functions/functions.util.js";
4
4
  import "react";
@@ -6,33 +6,33 @@ import "../../utils/content/content.component.js";
6
6
  import "usehooks-ts";
7
7
  import "../../controls/primitives/box/box.component.js";
8
8
  import { ButtonText as f } from "../../controls/buttons/button-text/button-text.component.js";
9
- import '../../assets/user-panel-SauszbHl.css';const _ = "_UserPanel_zes0v_1", u = "_Head_zes0v_13", P = "_Info_zes0v_25", t = {
9
+ import '../../assets/user-panel-SauszbHl.css';const _ = "_UserPanel_zes0v_1", P = "_Head_zes0v_13", u = "_Info_zes0v_25", t = {
10
10
  UserPanel: _,
11
- Head: u,
12
- Info: P
13
- }, j = ({ title: a, button: i, data: n, onClick: l, ...r }) => /* @__PURE__ */ s(
11
+ Head: P,
12
+ Info: u
13
+ }, j = ({ title: n, button: r, data: l, onClick: s, ...a }) => /* @__PURE__ */ i(
14
14
  "div",
15
15
  {
16
- "data-testid": o(r, "data-testid", "user-panel"),
17
- className: p(t.UserPanel, o(r, "className")),
16
+ "data-testid": o(a, "data-testid", "user-panel"),
17
+ className: p(t.UserPanel, o(a, "className")),
18
18
  children: [
19
- /* @__PURE__ */ s("div", { className: t.Head, children: [
20
- /* @__PURE__ */ e("span", { "data-testid": "user-panel-title", children: a }),
21
- /* @__PURE__ */ e(
19
+ /* @__PURE__ */ i("div", { className: t.Head, children: [
20
+ /* @__PURE__ */ e("span", { "data-testid": "user-panel-title", children: n }),
21
+ r && s && /* @__PURE__ */ e(
22
22
  f,
23
23
  {
24
- text: i,
24
+ text: r,
25
25
  preventDefault: !0,
26
26
  blurAfterClick: !0,
27
27
  icon: /* @__PURE__ */ e(d, {}),
28
28
  iconPosition: "right",
29
29
  size: "md",
30
30
  color: "text-primary",
31
- onClick: l
31
+ onClick: s
32
32
  }
33
33
  )
34
34
  ] }),
35
- /* @__PURE__ */ e("ul", { className: t.Info, children: n.map((c, m) => /* @__PURE__ */ e("li", { children: c }, m)) })
35
+ /* @__PURE__ */ e("ul", { className: t.Info, children: l.map((c, m) => /* @__PURE__ */ e("li", { children: c }, m)) })
36
36
  ]
37
37
  }
38
38
  );
package/dist/main.d.ts CHANGED
@@ -43,10 +43,11 @@ export { Message, type MessageProps } from './components/message';
43
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 PaymentInfoProps, type PaymentSidebarProps, type PaymentTextBlocksProps, type PaymentTextBlockItem, } from './components/payment/payment.component';
46
+ export { PriceLine, type PriceLineProps } from './components/price-line';
46
47
  export { Sidebar, type SidebarProps } from './components/sidebar';
47
48
  export { Signature } from './components/signature';
48
49
  export { Svg, type SvgProps } from './utils/svg/svg.component';
49
50
  export { Text, type TextProps } from './components/text';
50
51
  export { UserPanel } from './components/user-panel';
51
52
  export { Warranty, type WarrantyProps } from './components/warranty';
52
- export { clsx } from './utils/functions';
53
+ export { clsx, convertToEuro } from './utils/functions';
package/dist/main.js CHANGED
@@ -4,18 +4,18 @@ import { FadeSlide as f } from "./animations/fade-slide/fade-slide.component.js"
4
4
  import { Rotate as n } from "./animations/rotate/rotate.component.js";
5
5
  import "usehooks-ts";
6
6
  import { Button as d } from "./controls/buttons/button/button.component.js";
7
- import { ButtonCard as s } from "./controls/buttons/button-card/button-card.component.js";
7
+ import { ButtonCard as c } from "./controls/buttons/button-card/button-card.component.js";
8
8
  import { ButtonRadio as u } from "./controls/buttons/button-radio/button-radio.component.js";
9
9
  import { ButtonText as B } from "./controls/buttons/button-text/button-text.component.js";
10
10
  import { CardImage as F } from "./controls/interactives/card-image/card-image.component.js";
11
- import { CardText as L } from "./controls/interactives/card-text/card-text.component.js";
12
- import { Checkbox as T } from "./controls/interactives/checkbox/checkbox.component.js";
13
- import { Dropdown as R } from "./controls/interactives/dropdown/dropdown.component.js";
14
- import { Input as D } from "./controls/interactives/input/input.component.js";
15
- import { Radio as P } from "./controls/interactives/radio/radio.component.js";
11
+ import { CardText as T } from "./controls/interactives/card-text/card-text.component.js";
12
+ import { Checkbox as S } from "./controls/interactives/checkbox/checkbox.component.js";
13
+ import { Dropdown as P } from "./controls/interactives/dropdown/dropdown.component.js";
14
+ import { Input as A } from "./controls/interactives/input/input.component.js";
15
+ import { Radio as M } from "./controls/interactives/radio/radio.component.js";
16
16
  import { TextArea as w } from "./controls/interactives/text-area/text-area.component.js";
17
- import { TextField as k } from "./controls/interactives/text-field/text-field.component.js";
18
- import { Box as H } from "./controls/primitives/box/box.component.js";
17
+ import { TextField as E } from "./controls/interactives/text-field/text-field.component.js";
18
+ import { Box as v } from "./controls/primitives/box/box.component.js";
19
19
  import { Caption as G } from "./controls/primitives/caption/caption.component.js";
20
20
  import { Choice as U } from "./controls/primitives/choice/choice.component.js";
21
21
  import { ErrorMessage as j } from "./controls/primitives/error-message/error-message.component.js";
@@ -31,75 +31,78 @@ import { Dialog as mo } from "./components/dialog/dialog.component.js";
31
31
  import { DialogArticle as fo } from "./components/dialog-article/dialog-article.component.js";
32
32
  import { Expenses as no } from "./components/expenses/expenses.component.js";
33
33
  import { Footer as lo } from "./components/footer/footer.component.js";
34
- import { FormRow as co } from "./components/form-row/form-row.component.js";
34
+ import { FormRow as so } from "./components/form-row/form-row.component.js";
35
35
  import { Header as go } from "./components/header/header.component.js";
36
36
  import { InfoPanel as Co } from "./components/info-panel/info-panel.component.js";
37
- import { Information as bo } from "./components/information/information.component.js";
38
- import { Layout as So } from "./components/layout/layout.component.js";
37
+ import { Information as Lo } from "./components/information/information.component.js";
38
+ import { Layout as bo } from "./components/layout/layout.component.js";
39
39
  import { Line as Io } from "./components/line/line.component.js";
40
- import { Loader as Ao } from "./components/loader/loader.component.js";
41
- import { MainAttachment as Mo } from "./components/main-attachment/main-attachment.component.js";
40
+ import { Loader as Ro } from "./components/loader/loader.component.js";
41
+ import { MainAttachment as Do } from "./components/main-attachment/main-attachment.component.js";
42
42
  import { Message as ho } from "./components/message/message.component.js";
43
43
  import { MessageBlock as yo } from "./components/message-block/message-block.component.js";
44
- import { NotFound as Eo } from "./components/not-found/not-found.component.js";
45
- import { Payment as vo } from "./components/payment/payment.component.js";
46
- import { Sidebar as No } from "./components/sidebar/sidebar.component.js";
47
- import { Signature as Wo } from "./components/signature/signature.component.js";
48
- import { Svg as qo } from "./utils/svg/svg.component.js";
49
- import { Text as Jo } from "./components/text/text.component.js";
50
- import { UserPanel as Oo } from "./components/user-panel/user-panel.component.js";
51
- import { Warranty as Vo } from "./components/warranty/warranty.component.js";
52
- import { clsx as Yo } from "./utils/functions/functions.util.js";
44
+ import { NotFound as ko } from "./components/not-found/not-found.component.js";
45
+ import { Payment as Ho } from "./components/payment/payment.component.js";
46
+ import { PriceLine as No } from "./components/price-line/price-line.component.js";
47
+ import { Sidebar as Wo } from "./components/sidebar/sidebar.component.js";
48
+ import { Signature as qo } from "./components/signature/signature.component.js";
49
+ import { Svg as Jo } from "./utils/svg/svg.component.js";
50
+ import { Text as Oo } from "./components/text/text.component.js";
51
+ import { UserPanel as Vo } from "./components/user-panel/user-panel.component.js";
52
+ import { Warranty as Yo } from "./components/warranty/warranty.component.js";
53
+ import { clsx as _o, convertToEuro as $o } from "./utils/functions/functions.util.js";
53
54
  import './assets/main-DZmlIs7j.css';export {
54
55
  Z as AccordionTable,
55
56
  $ as BottomBar,
56
- H as Box,
57
+ v as Box,
57
58
  d as Button,
58
- s as ButtonCard,
59
+ c as ButtonCard,
59
60
  u as ButtonRadio,
60
61
  B as ButtonText,
61
62
  G as Caption,
62
63
  F as CardImage,
63
- L as CardText,
64
+ T as CardText,
64
65
  ro as Certifications,
65
- T as Checkbox,
66
+ S as Checkbox,
66
67
  U as Choice,
67
68
  to as DataProtectedLabel,
68
69
  mo as Dialog,
69
70
  fo as DialogArticle,
70
- R as Dropdown,
71
+ P as Dropdown,
71
72
  j as ErrorMessage,
72
73
  no as Expenses,
73
74
  t as FadeGrow,
74
75
  m as FadeScale,
75
76
  f as FadeSlide,
76
77
  lo as Footer,
77
- co as FormRow,
78
+ so as FormRow,
78
79
  go as Header,
79
80
  z as HiddenInput,
80
81
  Co as InfoPanel,
81
- bo as Information,
82
- D as Input,
82
+ Lo as Information,
83
+ A as Input,
83
84
  K as Label,
84
- So as Layout,
85
+ bo as Layout,
85
86
  Io as Line,
86
- Ao as Loader,
87
- Mo as MainAttachment,
87
+ Ro as Loader,
88
+ Do as MainAttachment,
88
89
  ho as Message,
89
90
  yo as MessageBlock,
90
- Eo as NotFound,
91
- vo as Payment,
92
- P as Radio,
91
+ ko as NotFound,
92
+ Ho as Payment,
93
+ No as PriceLine,
94
+ M as Radio,
93
95
  Q as RadioLabel,
94
96
  n as Rotate,
95
- No as Sidebar,
96
- Wo as Signature,
97
+ Wo as Sidebar,
98
+ qo as Signature,
97
99
  X as Status,
98
- qo as Svg,
99
- Jo as Text,
100
+ Jo as Svg,
101
+ Oo as Text,
100
102
  w as TextArea,
101
- k as TextField,
102
- Oo as UserPanel,
103
- Vo as Warranty,
104
- Yo as clsx
103
+ E as TextField,
104
+ Vo as UserPanel,
105
+ Yo as Warranty,
106
+ _o as clsx,
107
+ $o as convertToEuro
105
108
  };
@@ -31,6 +31,13 @@ export declare function baseProps(base: Base, key: keyof Base, or?: Base[keyof B
31
31
  type ClsxClassDictionary = Record<string, unknown>;
32
32
  type ClsxClassArray = ClsxClassValue[];
33
33
  type ClsxClassValue = ClsxClassArray | ClsxClassDictionary | string | number | bigint | null | boolean | undefined;
34
+ /**
35
+ * Formats a number as a German Euro currency string (e.g. 9.99 → "9,99 €").
36
+ * When `skipZeroCents` is true and the value has no fractional part, drops the cents (e.g. 9 → "9 €").
37
+ */
38
+ export declare const convertToEuro: (num: number, options?: {
39
+ skipZeroCents?: boolean;
40
+ }) => string;
34
41
  /**
35
42
  * Conditional class-name joiner. Drop-in replacement for the `clsx` npm package.
36
43
  * Accepts strings, numbers, bigints, arrays (recursively), and dictionaries (truthy values' keys are included).
@@ -1,43 +1,49 @@
1
- function o(n) {
2
- return typeof n == "string";
1
+ function o(t) {
2
+ return typeof t == "string";
3
3
  }
4
- function e(n) {
5
- const i = /<\/?[a-z][\s\S]*>/i, t = /&(?:[a-z][a-z0-9]+|#\d+|#x[\da-f]+);/i;
6
- return i.test(n) || t.test(n);
4
+ function e(t) {
5
+ const r = /<\/?[a-z][\s\S]*>/i, n = /&(?:[a-z][a-z0-9]+|#\d+|#x[\da-f]+);/i;
6
+ return r.test(t) || n.test(t);
7
7
  }
8
- function f(n) {
9
- return o(n) && e(n);
8
+ function u(t) {
9
+ return o(t) && e(t);
10
10
  }
11
- const u = (n, i) => (t) => {
12
- i?.prevent && t.preventDefault(), i?.stop && t.stopPropagation(), i?.blur && t.currentTarget.blur(), i?.withEvent ? n(t) : n();
11
+ const c = (t, r) => (n) => {
12
+ r?.prevent && n.preventDefault(), r?.stop && n.stopPropagation(), r?.blur && n.currentTarget.blur(), r?.withEvent ? t(n) : t();
13
13
  };
14
- function c(n, i, t) {
15
- return n[i] ? n[i] : t;
14
+ function f(t, r, n) {
15
+ return t[r] ? t[r] : n;
16
16
  }
17
- const s = (...n) => {
18
- const i = [];
19
- for (const t of n)
20
- if (t) {
21
- if (typeof t == "string" || typeof t == "number" || typeof t == "bigint") {
22
- i.push(String(t));
17
+ const p = (t, r) => new Intl.NumberFormat("de-DE", {
18
+ style: "currency",
19
+ currency: "EUR",
20
+ minimumFractionDigits: r?.skipZeroCents && t % 1 === 0 ? 0 : 2,
21
+ maximumFractionDigits: r?.skipZeroCents && t % 1 === 0 ? 0 : 2
22
+ }).format(t), s = (...t) => {
23
+ const r = [];
24
+ for (const n of t)
25
+ if (n) {
26
+ if (typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
27
+ r.push(String(n));
23
28
  continue;
24
29
  }
25
- if (Array.isArray(t)) {
26
- const r = s(...t);
27
- r && i.push(r);
30
+ if (Array.isArray(n)) {
31
+ const i = s(...n);
32
+ i && r.push(i);
28
33
  continue;
29
34
  }
30
- if (typeof t == "object")
31
- for (const r in t)
32
- t[r] && i.push(r);
35
+ if (typeof n == "object")
36
+ for (const i in n)
37
+ n[i] && r.push(i);
33
38
  }
34
- return i.join(" ");
39
+ return r.join(" ");
35
40
  };
36
41
  export {
37
- c as baseProps,
42
+ f as baseProps,
38
43
  s as clsx,
39
44
  e as containsHtml,
40
- f as isHtmlString,
45
+ p as convertToEuro,
46
+ u as isHtmlString,
41
47
  o as isString,
42
- u as withControl
48
+ c as withControl
43
49
  };
@@ -1,9 +1,10 @@
1
- import { baseProps as o, clsx as r, containsHtml as s, isHtmlString as n, isString as l, withControl as m } from "./functions.util.js";
1
+ import { baseProps as r, clsx as i, containsHtml as n, convertToEuro as s, isHtmlString as l, isString as c, withControl as e } from "./functions.util.js";
2
2
  export {
3
- o as baseProps,
4
- r as clsx,
5
- s as containsHtml,
6
- n as isHtmlString,
7
- l as isString,
8
- m as withControl
3
+ r as baseProps,
4
+ i as clsx,
5
+ n as containsHtml,
6
+ s as convertToEuro,
7
+ l as isHtmlString,
8
+ c as isString,
9
+ e as withControl
9
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "2.5.2",
4
+ "version": "2.7.0",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",