@arthurzakharov/ui-kit 2.8.0 → 2.10.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.
- package/dist/assets/dropzone-iRe6v-43.css +1 -0
- package/dist/assets/timetable-C4OGIa6M.css +1 -0
- package/dist/components/dropzone/dropzone.component.d.ts +14 -0
- package/dist/components/dropzone/dropzone.component.js +107 -0
- package/dist/components/dropzone/index.d.ts +1 -0
- package/dist/components/dropzone/index.js +4 -0
- package/dist/components/timetable/index.d.ts +1 -0
- package/dist/components/timetable/index.js +4 -0
- package/dist/components/timetable/timetable.component.d.ts +6 -0
- package/dist/components/timetable/timetable.component.js +16 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +71 -67
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Dropzone_14jbn_1{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--rm-ui-padding-xs);width:100%;min-height:160px;padding:var(--rm-ui-padding-md);border:2px dashed var(--rm-ui-grey-300);border-radius:var(--rm-ui-border-radius-md, 8px);background-color:var(--rm-ui-grey-50);text-align:center;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}._Dropzone_14jbn_1:hover,._Active_14jbn_21{border-color:var(--rm-ui-color-theme-primary);background-color:var(--rm-ui-color-background-primary, #fff)}._Dropzone_14jbn_1:focus-visible{outline:2px solid var(--rm-ui-color-focus);outline-offset:2px}._Disabled_14jbn_31{cursor:not-allowed;opacity:.5}._HiddenInput_14jbn_36{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}._Icon_14jbn_48{color:var(--rm-ui-color-theme-primary)}._Invitation_14jbn_52{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._HelpText_14jbn_58{font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small);color:var(--rm-ui-color-text-secondary)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Timetable_1y4a7_1{display:flex;flex-direction:column;gap:var(--rm-ui-padding-xxs);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-md)}._Title_1y4a7_8{margin:0;font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small);color:var(--rm-ui-color-text-primary)}._Line_1y4a7_16{margin:0;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small);color:var(--rm-ui-color-text-secondary)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Base } from '../../utils/types';
|
|
3
|
+
export type DropzoneRejectionReason = 'tooLarge' | 'wrongType';
|
|
4
|
+
export interface DropzoneProps extends Base {
|
|
5
|
+
accept: string;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
maxSize?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
invitation: ReactNode;
|
|
10
|
+
helpText?: ReactNode;
|
|
11
|
+
onDrop: (files: File[]) => void;
|
|
12
|
+
onReject?: (files: File[], reason: DropzoneRejectionReason) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const Dropzone: ({ accept, multiple, maxSize, disabled, invitation, helpText, onDrop, onReject, ...base }: DropzoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as N, useState as T } from "react";
|
|
3
|
+
import { Upload as L } from "lucide-react";
|
|
4
|
+
import { baseProps as I, clsx as P } from "../../utils/functions/functions.util.js";
|
|
5
|
+
import '../../assets/dropzone-iRe6v-43.css';const W = "_Dropzone_14jbn_1", k = "_Active_14jbn_21", E = "_Disabled_14jbn_31", K = "_HiddenInput_14jbn_36", O = "_Icon_14jbn_48", $ = "_Invitation_14jbn_52", B = "_HelpText_14jbn_58", o = {
|
|
6
|
+
Dropzone: W,
|
|
7
|
+
Active: k,
|
|
8
|
+
Disabled: E,
|
|
9
|
+
HiddenInput: K,
|
|
10
|
+
Icon: O,
|
|
11
|
+
Invitation: $,
|
|
12
|
+
HelpText: B
|
|
13
|
+
}, F = (r, u) => {
|
|
14
|
+
const s = u.split(",").map((n) => n.trim()).filter(Boolean);
|
|
15
|
+
return s.length === 0 ? !0 : s.some((n) => {
|
|
16
|
+
if (n.startsWith("."))
|
|
17
|
+
return r.name.toLowerCase().endsWith(n.toLowerCase());
|
|
18
|
+
if (n.endsWith("/*")) {
|
|
19
|
+
const f = n.slice(0, -1);
|
|
20
|
+
return r.type.startsWith(f);
|
|
21
|
+
}
|
|
22
|
+
return r.type === n;
|
|
23
|
+
});
|
|
24
|
+
}, M = ({
|
|
25
|
+
accept: r,
|
|
26
|
+
multiple: u = !1,
|
|
27
|
+
maxSize: s,
|
|
28
|
+
disabled: n = !1,
|
|
29
|
+
invitation: f,
|
|
30
|
+
helpText: d,
|
|
31
|
+
onDrop: y,
|
|
32
|
+
onReject: c,
|
|
33
|
+
...D
|
|
34
|
+
}) => {
|
|
35
|
+
const h = N(null), [b, g] = T(!1), _ = I(D, "data-testid", "dropzone"), x = (t) => {
|
|
36
|
+
const l = [], a = [], i = [];
|
|
37
|
+
for (const e of t) {
|
|
38
|
+
if (!F(e, r)) {
|
|
39
|
+
i.push(e);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (s !== void 0 && e.size > s) {
|
|
43
|
+
a.push(e);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
l.push(e);
|
|
47
|
+
}
|
|
48
|
+
return { accepted: l, tooLarge: a, wrongType: i };
|
|
49
|
+
}, m = (t) => {
|
|
50
|
+
if (!t || t.length === 0) return;
|
|
51
|
+
const l = Array.from(t), { accepted: a, tooLarge: i, wrongType: e } = x(l);
|
|
52
|
+
a.length > 0 && y(a), i.length > 0 && c && c(i, "tooLarge"), e.length > 0 && c && c(e, "wrongType");
|
|
53
|
+
}, A = () => {
|
|
54
|
+
n || h.current?.click();
|
|
55
|
+
}, H = (t) => {
|
|
56
|
+
n || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), h.current?.click());
|
|
57
|
+
}, w = (t) => {
|
|
58
|
+
m(t.target.files), t.target.value = "";
|
|
59
|
+
}, v = (t) => {
|
|
60
|
+
t.preventDefault(), t.stopPropagation(), !n && g(!0);
|
|
61
|
+
}, z = (t) => {
|
|
62
|
+
t.preventDefault(), t.stopPropagation(), g(!1);
|
|
63
|
+
}, j = (t) => {
|
|
64
|
+
t.preventDefault(), t.stopPropagation(), g(!1), !n && m(t.dataTransfer.files);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ C(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
"data-testid": _,
|
|
70
|
+
className: P(o.Dropzone, I(D, "className"), {
|
|
71
|
+
[o.Active]: b,
|
|
72
|
+
[o.Disabled]: n
|
|
73
|
+
}),
|
|
74
|
+
role: "button",
|
|
75
|
+
tabIndex: n ? -1 : 0,
|
|
76
|
+
"aria-disabled": n,
|
|
77
|
+
onClick: A,
|
|
78
|
+
onKeyDown: H,
|
|
79
|
+
onDragOver: v,
|
|
80
|
+
onDragEnter: v,
|
|
81
|
+
onDragLeave: z,
|
|
82
|
+
onDrop: j,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ p(
|
|
85
|
+
"input",
|
|
86
|
+
{
|
|
87
|
+
ref: h,
|
|
88
|
+
type: "file",
|
|
89
|
+
className: o.HiddenInput,
|
|
90
|
+
accept: r,
|
|
91
|
+
multiple: u,
|
|
92
|
+
disabled: n,
|
|
93
|
+
onChange: w,
|
|
94
|
+
"data-testid": `${_}-input`,
|
|
95
|
+
tabIndex: -1
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ p(L, { size: 32, className: o.Icon, "aria-hidden": !0 }),
|
|
99
|
+
/* @__PURE__ */ p("div", { className: o.Invitation, children: f }),
|
|
100
|
+
d != null && /* @__PURE__ */ p("div", { className: o.HelpText, children: d })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
M as Dropzone
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dropzone, type DropzoneProps, type DropzoneRejectionReason } from './dropzone.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Timetable, type TimetableProps } from './timetable.component';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { baseProps as l, clsx as o } from "../../utils/functions/functions.util.js";
|
|
3
|
+
import '../../assets/timetable-C4OGIa6M.css';const r = "_Timetable_1y4a7_1", T = "_Title_1y4a7_8", _ = "_Line_1y4a7_16", e = {
|
|
4
|
+
Timetable: r,
|
|
5
|
+
Title: T,
|
|
6
|
+
Line: _
|
|
7
|
+
}, L = ({ title: c, lines: m, ...a }) => {
|
|
8
|
+
const t = l(a, "data-testid", "timetable");
|
|
9
|
+
return /* @__PURE__ */ d("div", { "data-testid": t, className: o(e.Timetable, l(a, "className")), children: [
|
|
10
|
+
/* @__PURE__ */ s("p", { "data-testid": `${t}-title`, className: e.Title, children: c }),
|
|
11
|
+
m.map((n, i) => /* @__PURE__ */ s("p", { "data-testid": `${t}-line-${i}`, className: e.Line, children: n }, i))
|
|
12
|
+
] });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
L as Timetable
|
|
16
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { RadioLabel, type RadioLabelProps } from './controls/primitives/radio-la
|
|
|
25
25
|
export { Status, type StatusProps } from './controls/primitives/status';
|
|
26
26
|
export { Accordion, type AccordionProps } from './components/accordion';
|
|
27
27
|
export { AccordionTable, type AccordionTableProps } from './components/accordion-table/accordion-table.component';
|
|
28
|
+
export { Dropzone, type DropzoneProps, type DropzoneRejectionReason } from './components/dropzone';
|
|
28
29
|
export { BottomBar } from './components/bottom-bar';
|
|
29
30
|
export { Certifications, type CertificationsProps } from './components/certifications';
|
|
30
31
|
export { DataProtectedLabel } from './components/data-protected-label';
|
|
@@ -47,6 +48,7 @@ export { Payment, type PaymentBlockProps, type PaymentGlassProps, type PaymentIn
|
|
|
47
48
|
export { PriceLine, type PriceLineProps } from './components/price-line';
|
|
48
49
|
export { Sidebar, type SidebarProps } from './components/sidebar';
|
|
49
50
|
export { Signature } from './components/signature';
|
|
51
|
+
export { Timetable, type TimetableProps } from './components/timetable';
|
|
50
52
|
export { Svg, type SvgProps } from './utils/svg/svg.component';
|
|
51
53
|
export { Text, type TextProps } from './components/text';
|
|
52
54
|
export { UserPanel } from './components/user-panel';
|
package/dist/main.js
CHANGED
|
@@ -7,104 +7,108 @@ import { Button as d } from "./controls/buttons/button/button.component.js";
|
|
|
7
7
|
import { ButtonCard as l } 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
|
-
import { CardImage as
|
|
11
|
-
import { CardText as
|
|
10
|
+
import { CardImage as b } from "./controls/interactives/card-image/card-image.component.js";
|
|
11
|
+
import { CardText as F } from "./controls/interactives/card-text/card-text.component.js";
|
|
12
12
|
import { Checkbox as S } from "./controls/interactives/checkbox/checkbox.component.js";
|
|
13
|
-
import { Dropdown as
|
|
14
|
-
import { Input as
|
|
13
|
+
import { Dropdown as D } from "./controls/interactives/dropdown/dropdown.component.js";
|
|
14
|
+
import { Input as P } from "./controls/interactives/input/input.component.js";
|
|
15
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
17
|
import { TextField as E } from "./controls/interactives/text-field/text-field.component.js";
|
|
18
18
|
import { Box as v } from "./controls/primitives/box/box.component.js";
|
|
19
|
-
import { Caption as
|
|
20
|
-
import { Choice as
|
|
21
|
-
import { ErrorMessage as
|
|
22
|
-
import { HiddenInput as
|
|
19
|
+
import { Caption as z } from "./controls/primitives/caption/caption.component.js";
|
|
20
|
+
import { Choice as N } from "./controls/primitives/choice/choice.component.js";
|
|
21
|
+
import { ErrorMessage as W } from "./controls/primitives/error-message/error-message.component.js";
|
|
22
|
+
import { HiddenInput as q } from "./controls/primitives/hidden-input/hidden-input.component.js";
|
|
23
23
|
import { Label as K } from "./controls/primitives/label/label.component.js";
|
|
24
24
|
import { RadioLabel as Q } from "./controls/primitives/radio-label/radio-label.component.js";
|
|
25
25
|
import { Status as X } from "./controls/primitives/status/status.component.js";
|
|
26
26
|
import { Accordion as Z } from "./components/accordion/accordion.component.js";
|
|
27
27
|
import { AccordionTable as $ } from "./components/accordion-table/accordion-table.component.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
28
|
+
import { Dropzone as ro } from "./components/dropzone/dropzone.component.js";
|
|
29
|
+
import { BottomBar as to } from "./components/bottom-bar/bottom-bar.component.js";
|
|
30
|
+
import { Certifications as mo } from "./components/certifications/certifications.component.js";
|
|
31
|
+
import { DataProtectedLabel as fo } from "./components/data-protected-label/data-protected-label.component.js";
|
|
32
|
+
import { Dialog as no } from "./components/dialog/dialog.component.js";
|
|
33
|
+
import { DialogArticle as co } from "./components/dialog-article/dialog-article.component.js";
|
|
34
|
+
import { Expenses as so } from "./components/expenses/expenses.component.js";
|
|
35
|
+
import { Footer as go } from "./components/footer/footer.component.js";
|
|
36
|
+
import { FormRow as To } from "./components/form-row/form-row.component.js";
|
|
36
37
|
import { Header as Co } from "./components/header/header.component.js";
|
|
37
38
|
import { InfoPanel as Lo } from "./components/info-panel/info-panel.component.js";
|
|
38
|
-
import { Information as
|
|
39
|
-
import { Layout as
|
|
40
|
-
import { Line as
|
|
41
|
-
import { Loader as
|
|
42
|
-
import { MainAttachment as
|
|
43
|
-
import { Message as
|
|
44
|
-
import { MessageBlock as
|
|
45
|
-
import { NotFound as
|
|
46
|
-
import { Payment as
|
|
47
|
-
import { PriceLine as
|
|
48
|
-
import { Sidebar as
|
|
49
|
-
import { Signature as
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
39
|
+
import { Information as Ao } from "./components/information/information.component.js";
|
|
40
|
+
import { Layout as Io } from "./components/layout/layout.component.js";
|
|
41
|
+
import { Line as Ro } from "./components/line/line.component.js";
|
|
42
|
+
import { Loader as ho } from "./components/loader/loader.component.js";
|
|
43
|
+
import { MainAttachment as yo } from "./components/main-attachment/main-attachment.component.js";
|
|
44
|
+
import { Message as ko } from "./components/message/message.component.js";
|
|
45
|
+
import { MessageBlock as Ho } from "./components/message-block/message-block.component.js";
|
|
46
|
+
import { NotFound as Go } from "./components/not-found/not-found.component.js";
|
|
47
|
+
import { Payment as Uo } from "./components/payment/payment.component.js";
|
|
48
|
+
import { PriceLine as jo } from "./components/price-line/price-line.component.js";
|
|
49
|
+
import { Sidebar as Jo } from "./components/sidebar/sidebar.component.js";
|
|
50
|
+
import { Signature as Oo } from "./components/signature/signature.component.js";
|
|
51
|
+
import { Timetable as Vo } from "./components/timetable/timetable.component.js";
|
|
52
|
+
import { Svg as Yo } from "./utils/svg/svg.component.js";
|
|
53
|
+
import { Text as _o } from "./components/text/text.component.js";
|
|
54
|
+
import { UserPanel as or } from "./components/user-panel/user-panel.component.js";
|
|
55
|
+
import { Warranty as er } from "./components/warranty/warranty.component.js";
|
|
56
|
+
import { clsx as xr, convertToEuro as mr } from "./utils/functions/functions.util.js";
|
|
55
57
|
import './assets/main-DZmlIs7j.css';export {
|
|
56
58
|
Z as Accordion,
|
|
57
59
|
$ as AccordionTable,
|
|
58
|
-
|
|
60
|
+
to as BottomBar,
|
|
59
61
|
v as Box,
|
|
60
62
|
d as Button,
|
|
61
63
|
l as ButtonCard,
|
|
62
64
|
u as ButtonRadio,
|
|
63
65
|
B as ButtonText,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
z as Caption,
|
|
67
|
+
b as CardImage,
|
|
68
|
+
F as CardText,
|
|
69
|
+
mo as Certifications,
|
|
68
70
|
S as Checkbox,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
N as Choice,
|
|
72
|
+
fo as DataProtectedLabel,
|
|
73
|
+
no as Dialog,
|
|
74
|
+
co as DialogArticle,
|
|
75
|
+
D as Dropdown,
|
|
76
|
+
ro as Dropzone,
|
|
77
|
+
W as ErrorMessage,
|
|
78
|
+
so as Expenses,
|
|
76
79
|
t as FadeGrow,
|
|
77
80
|
m as FadeScale,
|
|
78
81
|
f as FadeSlide,
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
go as Footer,
|
|
83
|
+
To as FormRow,
|
|
81
84
|
Co as Header,
|
|
82
|
-
|
|
85
|
+
q as HiddenInput,
|
|
83
86
|
Lo as InfoPanel,
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
Ao as Information,
|
|
88
|
+
P as Input,
|
|
86
89
|
K as Label,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
Io as Layout,
|
|
91
|
+
Ro as Line,
|
|
92
|
+
ho as Loader,
|
|
93
|
+
yo as MainAttachment,
|
|
94
|
+
ko as Message,
|
|
95
|
+
Ho as MessageBlock,
|
|
96
|
+
Go as NotFound,
|
|
97
|
+
Uo as Payment,
|
|
98
|
+
jo as PriceLine,
|
|
96
99
|
M as Radio,
|
|
97
100
|
Q as RadioLabel,
|
|
98
101
|
n as Rotate,
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
Jo as Sidebar,
|
|
103
|
+
Oo as Signature,
|
|
101
104
|
X as Status,
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
Yo as Svg,
|
|
106
|
+
_o as Text,
|
|
104
107
|
w as TextArea,
|
|
105
108
|
E as TextField,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
Vo as Timetable,
|
|
110
|
+
or as UserPanel,
|
|
111
|
+
er as Warranty,
|
|
112
|
+
xr as clsx,
|
|
113
|
+
mr as convertToEuro
|
|
110
114
|
};
|