@arthurzakharov/ui-kit 2.12.0 → 3.0.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
+ ._Sidebar_ub5hz_1{display:block}._Board_ub5hz_5{display:flex;flex-direction:column;gap:var(--rm-ui-padding-md);border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-lg);background-color:var(--rm-ui-sidebar-bg)}._Steps_ub5hz_14,._Info_ub5hz_15{display:flex;flex-direction:column;align-items:flex-start;gap:var(--rm-ui-padding-sm)}._Step_ub5hz_14{display:inline-flex;align-items:center;gap:var(--rm-ui-padding-xs)}._InfoRow_ub5hz_28{display:inline-flex;align-items:center;justify-content:space-between;gap:var(--rm-ui-padding-xs);width:100%}._SidebarButton_ub5hz_36{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}@media screen and (min-width:1024px){._Board_ub5hz_5{padding:var(--rm-ui-padding-xl)}}@media screen and (min-width:1200px){._Board_ub5hz_5{padding:var(--rm-ui-padding-xxl);gap:var(--rm-ui-padding-lg)}}
@@ -1 +1 @@
1
- export { Sidebar, type SidebarProps } from './sidebar.component';
1
+ export { Sidebar, type SidebarInfoProps, type SidebarInfoRow, type SidebarProps, type SidebarStep, type SidebarStepsProps, type SidebarSubmitProps, type SidebarTitleProps, type SidebarUserProps, } from './sidebar.component';
@@ -1,22 +1,40 @@
1
- import { PropsWithChildren, ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { CertificationsProps } from '../certifications';
3
+ import { TimetableProps } from '../timetable';
3
4
  import { UserPanelProps } from '../user-panel';
4
5
  import { State } from '../../controls/utils';
5
6
  import { Base } from '../../utils/types';
6
- type SidebarStep = {
7
+ export type SidebarStep = {
7
8
  state: State;
8
9
  text: string;
9
10
  };
10
- type SidebarInfo = [string, string];
11
- export interface SidebarProps extends PropsWithChildren<Base> {
12
- isButtonVisible: boolean;
13
- isUserOpen: boolean;
14
- title: string;
11
+ export type SidebarInfoRow = [string, string];
12
+ export type SidebarProps = PropsWithChildren<Base>;
13
+ export interface SidebarTitleProps extends PropsWithChildren<Base> {
14
+ }
15
+ export interface SidebarStepsProps extends Base {
15
16
  steps: SidebarStep[];
16
- info: SidebarInfo[];
17
- user: UserPanelProps;
18
- certifications: CertificationsProps;
19
- extras?: ReactNode;
20
17
  }
21
- export declare const Sidebar: ({ children, isButtonVisible, isUserOpen, title, steps, info, certifications, user, extras, ...base }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
22
- export {};
18
+ export interface SidebarInfoProps extends Base {
19
+ rows: SidebarInfoRow[];
20
+ }
21
+ export interface SidebarUserProps extends Base {
22
+ isOpen: boolean;
23
+ title: UserPanelProps['title'];
24
+ data: UserPanelProps['data'];
25
+ button?: UserPanelProps['button'];
26
+ onClick?: UserPanelProps['onClick'];
27
+ }
28
+ export interface SidebarSubmitProps extends PropsWithChildren<Base> {
29
+ isVisible: boolean;
30
+ }
31
+ export declare const Sidebar: (({ children, ...base }: SidebarProps) => import("react/jsx-runtime").JSX.Element) & {
32
+ Title: ({ children, ...base }: SidebarTitleProps) => import("react/jsx-runtime").JSX.Element;
33
+ Steps: ({ steps, ...base }: SidebarStepsProps) => import("react/jsx-runtime").JSX.Element;
34
+ Info: ({ rows, ...base }: SidebarInfoProps) => import("react/jsx-runtime").JSX.Element | null;
35
+ User: ({ isOpen, title, data, button, onClick, ...base }: SidebarUserProps) => import("react/jsx-runtime").JSX.Element;
36
+ Submit: ({ isVisible, children, ...base }: SidebarSubmitProps) => import("react/jsx-runtime").JSX.Element;
37
+ Certifications: (props: CertificationsProps) => import("react/jsx-runtime").JSX.Element;
38
+ Timetable: (props: TimetableProps) => import("react/jsx-runtime").JSX.Element;
39
+ Line: () => import("react/jsx-runtime").JSX.Element;
40
+ };
@@ -1,97 +1,90 @@
1
- import { jsx as t, jsxs as o, Fragment as I } from "react/jsx-runtime";
2
- import { clsx as l, baseProps as h } from "../../utils/functions/functions.util.js";
3
- import { FadeScale as f } from "../../animations/fade-scale/fade-scale.component.js";
4
- import { Certifications as u } from "../certifications/certifications.component.js";
5
- import { Line as c } from "../line/line.component.js";
6
- import { Text as m } from "../text/text.component.js";
7
- import { UserPanel as w } from "../user-panel/user-panel.component.js";
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import { clsx as m, baseProps as a } from "../../utils/functions/functions.util.js";
3
+ import { FadeScale as b } from "../../animations/fade-scale/fade-scale.component.js";
4
+ import { Certifications as p } from "../certifications/certifications.component.js";
5
+ import { Line as S } from "../line/line.component.js";
6
+ import { Text as n } from "../text/text.component.js";
7
+ import { Timetable as f } from "../timetable/timetable.component.js";
8
+ import { UserPanel as u } from "../user-panel/user-panel.component.js";
8
9
  import "../../controls/primitives/box/box.component.js";
9
10
  import "../../utils/content/content.component.js";
10
11
  import "lucide-react";
11
12
  import "usehooks-ts";
12
- import { Status as A } from "../../controls/primitives/status/status.component.js";
13
- import '../../assets/sidebar-rLhJNVa5.css';const B = "_Sidebar_ex9j5_1", y = "_Board_ex9j5_5", T = "_SidebarTitle_ex9j5_11", E = "_SidebarButton_ex9j5_12", R = "_Steps_ex9j5_16", z = "_Info_ex9j5_17", C = "_Step_ex9j5_16", $ = "_InfoRow_ex9j5_30", F = "_SidebarExtras_ex9j5_44", P = "_NothingAbove_ex9j5_54", e = {
14
- Sidebar: B,
15
- Board: y,
16
- SidebarTitle: T,
17
- SidebarButton: E,
18
- Steps: R,
19
- Info: z,
20
- Step: C,
21
- InfoRow: $,
22
- SidebarExtras: F,
23
- NothingAbove: P
24
- }, Y = ({
25
- // Sidebar props
26
- children: v,
27
- isButtonVisible: b = !1,
28
- isUserOpen: r = !1,
29
- title: x = "Ihre Übersicht",
30
- steps: g = [],
31
- info: N = [],
32
- certifications: _,
33
- user: d,
34
- extras: n,
35
- // Base props
36
- ...S
37
- }) => {
38
- const p = N.filter(([, i]) => i.trim() !== ""), a = p.length > 0;
39
- return /* @__PURE__ */ t(
13
+ import { Status as _ } from "../../controls/primitives/status/status.component.js";
14
+ import '../../assets/sidebar-DAm9EssD.css';const h = "_Sidebar_ub5hz_1", N = "_Board_ub5hz_5", z = "_Steps_ub5hz_14", I = "_Info_ub5hz_15", g = "_Step_ub5hz_14", v = "_InfoRow_ub5hz_28", B = "_SidebarButton_ub5hz_36", d = {
15
+ Sidebar: h,
16
+ Board: N,
17
+ Steps: z,
18
+ Info: I,
19
+ Step: g,
20
+ InfoRow: v,
21
+ SidebarButton: B
22
+ }, w = ({ children: e, ...i }) => /* @__PURE__ */ t(
23
+ "div",
24
+ {
25
+ "data-testid": a(i, "data-testid", "sidebar"),
26
+ className: m(d.Sidebar, a(i, "className")),
27
+ children: /* @__PURE__ */ t("div", { className: d.Board, children: e })
28
+ }
29
+ ), x = ({ children: e, ...i }) => /* @__PURE__ */ t(
30
+ n,
31
+ {
32
+ preset: "sidebar-title",
33
+ "data-testid": a(i, "data-testid", "sidebar-title"),
34
+ className: a(i, "className"),
35
+ children: e
36
+ }
37
+ ), T = ({ steps: e, ...i }) => /* @__PURE__ */ t(
38
+ "div",
39
+ {
40
+ "data-testid": a(i, "data-testid", "sidebar-steps"),
41
+ className: m(d.Steps, a(i, "className")),
42
+ children: e.map(({ state: s, text: r }) => /* @__PURE__ */ l("div", { className: d.Step, "data-testid": "sidebar-step", children: [
43
+ /* @__PURE__ */ t(_, { state: s }),
44
+ /* @__PURE__ */ t(n, { tag: "span", weight: "medium", size: "body-small", color: s === "idle" ? "grey-400" : "text-primary", children: r })
45
+ ] }, r))
46
+ }
47
+ ), y = ({ rows: e, ...i }) => {
48
+ const s = e.filter(([, r]) => r.trim() !== "");
49
+ return s.length === 0 ? null : /* @__PURE__ */ t(
40
50
  "div",
41
51
  {
42
- "data-testid": h(S, "data-testid", "sidebar"),
43
- className: l(e.Sidebar, h(S, "className")),
44
- children: /* @__PURE__ */ o("div", { className: e.Board, children: [
45
- /* @__PURE__ */ t(m, { preset: "sidebar-title", className: e.SidebarTitle, children: x }),
46
- /* @__PURE__ */ t("div", { className: e.Steps, "data-testid": "sidebar-steps", children: g.map(({ state: i, text: s }) => /* @__PURE__ */ o("div", { className: e.Step, "data-testid": "sidebar-step", children: [
47
- /* @__PURE__ */ t(A, { state: i }),
48
- /* @__PURE__ */ t(m, { tag: "span", weight: "medium", size: "body-small", color: i === "idle" ? "grey-400" : "text-primary", children: s })
49
- ] }, s)) }),
50
- a && /* @__PURE__ */ o(I, { children: [
51
- /* @__PURE__ */ t(c, {}),
52
- /* @__PURE__ */ t("div", { className: e.Info, "data-testid": "sidebar-info", children: p.map(([i, s], j) => /* @__PURE__ */ o("div", { className: e.InfoRow, "data-testid": "sidebar-info-row", children: [
53
- /* @__PURE__ */ t(m, { tag: "span", size: "body-small", color: "text-secondary", children: i }),
54
- /* @__PURE__ */ t(m, { tag: "span", size: "body-small", align: "right", children: s })
55
- ] }, `${i}-${j}`)) }),
56
- /* @__PURE__ */ t(c, {})
57
- ] }),
58
- /* @__PURE__ */ o(f, { name: "user", condition: r, children: [
59
- !a && /* @__PURE__ */ t(c, {}),
60
- /* @__PURE__ */ t(w, { title: d.title, button: d.button, data: d.data, onClick: d.onClick }),
61
- /* @__PURE__ */ t(c, {})
62
- ] }),
63
- /* @__PURE__ */ t(f, { name: "button", condition: b, children: /* @__PURE__ */ t(
64
- "div",
65
- {
66
- className: l(e.SidebarButton, {
67
- [e.NothingAbove]: !a && !r
68
- }),
69
- children: v
70
- }
71
- ) }),
72
- n != null && /* @__PURE__ */ t(
73
- "div",
74
- {
75
- "data-testid": "sidebar-extras",
76
- className: l(e.SidebarExtras, {
77
- [e.NothingAbove]: !a && !r && !b
78
- }),
79
- children: n
80
- }
81
- ),
82
- /* @__PURE__ */ t(u, { icons: _.icons, tuvSrc: _.tuvSrc, align: _.align }),
83
- /* @__PURE__ */ t(
84
- "div",
85
- {
86
- className: l({
87
- [e.NothingAbove]: !a && !r && !b && n == null
88
- })
89
- }
90
- )
91
- ] })
52
+ "data-testid": a(i, "data-testid", "sidebar-info"),
53
+ className: m(d.Info, a(i, "className")),
54
+ children: s.map(([r, c], o) => /* @__PURE__ */ l("div", { className: d.InfoRow, "data-testid": "sidebar-info-row", children: [
55
+ /* @__PURE__ */ t(n, { tag: "span", size: "body-small", color: "text-secondary", children: r }),
56
+ /* @__PURE__ */ t(n, { tag: "span", size: "body-small", align: "right", children: c })
57
+ ] }, `${r}-${o}`))
92
58
  }
93
59
  );
94
- };
60
+ }, R = ({ isOpen: e, title: i, data: s, button: r, onClick: c, ...o }) => /* @__PURE__ */ t(
61
+ b,
62
+ {
63
+ name: "sidebar-user",
64
+ condition: e,
65
+ "data-testid": a(o, "data-testid", "sidebar-user"),
66
+ className: a(o, "className"),
67
+ children: /* @__PURE__ */ t(u, { title: i, data: s, button: r, onClick: c })
68
+ }
69
+ ), j = ({ isVisible: e, children: i, ...s }) => /* @__PURE__ */ t(
70
+ b,
71
+ {
72
+ name: "sidebar-submit",
73
+ condition: e,
74
+ "data-testid": a(s, "data-testid", "sidebar-submit"),
75
+ className: a(s, "className"),
76
+ children: /* @__PURE__ */ t("div", { className: d.SidebarButton, children: i })
77
+ }
78
+ ), C = (e) => /* @__PURE__ */ t(p, { ...e }), L = (e) => /* @__PURE__ */ t(f, { ...e }), U = () => /* @__PURE__ */ t(S, {}), Q = Object.assign(w, {
79
+ Title: x,
80
+ Steps: T,
81
+ Info: y,
82
+ User: R,
83
+ Submit: j,
84
+ Certifications: C,
85
+ Timetable: L,
86
+ Line: U
87
+ });
95
88
  export {
96
- Y as Sidebar
89
+ Q as Sidebar
97
90
  };
package/dist/main.d.ts CHANGED
@@ -46,7 +46,7 @@ export { MessageBlock, type MessageBlockProps } from './components/message-block
46
46
  export { NotFound, type NotFoundProps } from './components/not-found';
47
47
  export { Payment, type PaymentBlockProps, type PaymentGlassProps, type PaymentInfoProps, type PaymentSidebarProps, type PaymentTextBlocksProps, type PaymentTextBlockItem, } from './components/payment/payment.component';
48
48
  export { PriceLine, type PriceLineProps } from './components/price-line';
49
- export { Sidebar, type SidebarProps } from './components/sidebar';
49
+ export { Sidebar, type SidebarInfoProps, type SidebarInfoRow, type SidebarProps, type SidebarStep, type SidebarStepsProps, type SidebarSubmitProps, type SidebarTitleProps, type SidebarUserProps, } from './components/sidebar';
50
50
  export { SignCtaTracker, type SignCtaTrackerProps } from './components/sign-cta-tracker';
51
51
  export { Signature } from './components/signature';
52
52
  export { Timetable, type TimetableProps } from './components/timetable';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "2.12.0",
4
+ "version": "3.0.0",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Sidebar_ex9j5_1{display:block}._Board_ex9j5_5{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-lg);background-color:var(--rm-ui-sidebar-bg)}._SidebarTitle_ex9j5_11,._SidebarButton_ex9j5_12{padding-bottom:var(--rm-ui-padding-md)}._Steps_ex9j5_16,._Info_ex9j5_17{display:flex;flex-direction:column;align-items:flex-start;gap:var(--rm-ui-padding-sm)}._Step_ex9j5_16{display:inline-flex;align-items:center;gap:var(--rm-ui-padding-xs)}._InfoRow_ex9j5_30{display:inline-flex;align-items:center;justify-content:space-between;gap:var(--rm-ui-padding-xs)}._SidebarButton_ex9j5_12{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}._SidebarExtras_ex9j5_44{padding-bottom:var(--rm-ui-padding-md)}@media screen and (min-width:1200px){._SidebarExtras_ex9j5_44{padding-bottom:var(--rm-ui-padding-lg)}}._NothingAbove_ex9j5_54{margin-top:var(--rm-ui-padding-lg)}@media screen and (min-width:1024px){._Board_ex9j5_5{padding:var(--rm-ui-padding-xl)}}@media screen and (min-width:1200px){._Board_ex9j5_5{padding:var(--rm-ui-padding-xxl)}._SidebarTitle_ex9j5_11,._SidebarButton_ex9j5_12{padding-bottom:var(--rm-ui-padding-lg)}}