@reportportal/ui-kit 0.0.1-alpha.250 → 0.0.1-alpha.252

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.250",
3
+ "version": "0.0.1-alpha.252",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,129 +0,0 @@
1
- import { jsxs as d, jsx as a, Fragment as p } from "react/jsx-runtime";
2
- import { useMemo as u, useCallback as b } from "react";
3
- import { c as E } from "./bind-06a7ff84.js";
4
- import { S as j } from "./close-4d480ef7.js";
5
- import { a as y, b as I, S as k, d as M, e as P, c as s, f as g } from "./xls-995781cc.js";
6
- const A = (e) => {
7
- var _;
8
- const f = e.split(".");
9
- return f.length > 1 && ((_ = f.pop()) == null ? void 0 : _.toLowerCase()) || "";
10
- }, B = (e) => e.length <= 15 ? e : e.slice(0, 4) + "..." + e.slice(-8), F = {
11
- "attached-file": "_attached-file_zf2i5_16",
12
- "attached-file__file-name": "_attached-file__file-name_zf2i5_29",
13
- "attached-file--bottom-placed": "_attached-file--bottom-placed_zf2i5_32",
14
- "attached-file__icon": "_attached-file__icon_zf2i5_42",
15
- "attached-file__file-icon": "_attached-file__file-icon_zf2i5_49",
16
- "attached-file--failed": "_attached-file--failed_zf2i5_52",
17
- "attached-file__name-text": "_attached-file__name-text_zf2i5_56",
18
- "attached-file--uploading": "_attached-file--uploading_zf2i5_65",
19
- "attached-file--full-width": "_attached-file--full-width_zf2i5_77",
20
- "attached-file__thumbnail": "_attached-file__thumbnail_zf2i5_98",
21
- "attached-file__info": "_attached-file__info_zf2i5_105",
22
- "attached-file__file-name--bottom-placed": "_attached-file__file-name--bottom-placed_zf2i5_126",
23
- "attached-file__download-icon": "_attached-file__download-icon_zf2i5_141",
24
- "attached-file__file-details": "_attached-file__file-details_zf2i5_150",
25
- "attached-file__error-message": "_attached-file__error-message_zf2i5_155",
26
- "attached-file__upload-progress": "_attached-file__upload-progress_zf2i5_160",
27
- "attached-file__upload-progress-bar": "_attached-file__upload-progress-bar_zf2i5_170",
28
- "attached-file__remove-button": "_attached-file__remove-button_zf2i5_174",
29
- "attached-file__remove-button--disabled": "_attached-file__remove-button--disabled_zf2i5_196"
30
- }, t = E.bind(F), O = {
31
- csv: k,
32
- jar: M,
33
- pdf: P,
34
- jpg: s,
35
- jpeg: s,
36
- png: s,
37
- gif: s,
38
- svg: s,
39
- webp: s,
40
- xls: g,
41
- xlsx: g
42
- }, J = (e) => O[e.toLowerCase()] ?? I, H = ({
43
- fileName: e,
44
- size: f,
45
- uploadingProgress: _ = 0,
46
- isUploadFailed: l = !1,
47
- uploadFailedMessage: v,
48
- isUploading: i = !1,
49
- isFullWidth: x = !1,
50
- onDownload: h,
51
- onRemove: n,
52
- withPreview: z = !1,
53
- textPosition: C = "right",
54
- imageSrc: m
55
- }) => {
56
- const o = u(() => A(e), [e]), L = o.toUpperCase(), N = u(() => J(o), [o]), S = b(
57
- (r) => {
58
- r.stopPropagation(), i || n == null || n();
59
- },
60
- [i, n]
61
- ), w = b(
62
- (r) => {
63
- r.stopPropagation(), !l && !i && h && h();
64
- },
65
- [l, i, h]
66
- ), c = C === "bottom";
67
- return /* @__PURE__ */ d(
68
- "div",
69
- {
70
- className: t("attached-file", {
71
- "attached-file--failed": l,
72
- "attached-file--uploading": i,
73
- "attached-file--full-width": x,
74
- "attached-file--bottom-placed": c
75
- }),
76
- children: [
77
- /* @__PURE__ */ a("div", { className: t("attached-file__icon"), children: z && m ? /* @__PURE__ */ a("img", { className: t("attached-file__thumbnail"), src: m, alt: e }) : /* @__PURE__ */ a("div", { className: t("attached-file__file-icon"), children: /* @__PURE__ */ a(N, {}) }) }),
78
- /* @__PURE__ */ d("div", { className: t("attached-file__info"), children: [
79
- !c && h ? /* @__PURE__ */ d("button", { type: "button", className: t("attached-file__file-name"), onClick: w, children: [
80
- /* @__PURE__ */ a("span", { className: t("attached-file__name-text"), children: e }),
81
- !i && !l && /* @__PURE__ */ a("span", { className: t("attached-file__download-icon"), children: /* @__PURE__ */ a(y, {}) })
82
- ] }) : /* @__PURE__ */ a(
83
- "div",
84
- {
85
- className: t("attached-file__file-name", {
86
- "attached-file__file-name--bottom-placed": c
87
- }),
88
- children: /* @__PURE__ */ a("span", { className: t("attached-file__name-text"), children: c ? B(e) : e })
89
- }
90
- ),
91
- c ? null : /* @__PURE__ */ d(p, { children: [
92
- !l && /* @__PURE__ */ d("div", { className: t("attached-file__file-details"), children: [
93
- L,
94
- ", ",
95
- f,
96
- " MB"
97
- ] }),
98
- l && /* @__PURE__ */ a("div", { className: t("attached-file__error-message"), children: v })
99
- ] })
100
- ] }),
101
- c ? null : /* @__PURE__ */ d(p, { children: [
102
- n && /* @__PURE__ */ a(
103
- "button",
104
- {
105
- type: "button",
106
- className: t("attached-file__remove-button", {
107
- "attached-file__remove-button--disabled": i
108
- }),
109
- disabled: i,
110
- onClick: S,
111
- children: /* @__PURE__ */ a(j, {})
112
- }
113
- ),
114
- i && _ > 0 && /* @__PURE__ */ a("div", { className: t("attached-file__upload-progress"), children: /* @__PURE__ */ a(
115
- "div",
116
- {
117
- className: t("attached-file__upload-progress-bar"),
118
- style: { width: `${_}%` }
119
- }
120
- ) })
121
- ] })
122
- ]
123
- }
124
- );
125
- };
126
- export {
127
- H as A,
128
- A as g
129
- };