@reportportal/ui-kit 0.0.1-alpha.210 → 0.0.1-alpha.212

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.
@@ -1,5 +1,6 @@
1
1
  import { KeyCodes } from '../../common/constants/keyCodes';
2
2
 
3
3
  export declare const DEFAULT_WIDTH_CH = 5;
4
- export declare const MAX_WIDTH_CH = 16;
4
+ export declare const SAFARI_CLIP_FIX_CH = 0.4;
5
+ export declare const MAX_WIDTH_CH: number;
5
6
  export declare const ALLOWED_KEY_CODES: KeyCodes[];
@@ -12,9 +12,14 @@ export interface PopoverProps {
12
12
  safeZone?: number;
13
13
  arrowColor?: string;
14
14
  dataAutomationId?: string;
15
- isOpened?: boolean;
16
- isCentered?: boolean;
17
15
  strategy?: Strategy;
16
+ transitionDuration?: number | Partial<{
17
+ open: number;
18
+ close: number;
19
+ }>;
20
+ isCentered?: boolean;
21
+ isFocusDisabled?: boolean;
22
+ isOpened?: boolean;
18
23
  shouldUsePortal?: boolean;
19
24
  setIsOpened?: (isOpened: boolean) => void;
20
25
  }
@@ -1,12 +1,12 @@
1
- import { jsxs as a, Fragment as V, jsx as r } from "react/jsx-runtime";
2
- import { useRef as W, useId as y, useMemo as B } from "react";
3
- import { c as w } from "./bind-06a7ff84.js";
1
+ import { jsxs as a, Fragment as W, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as y, useId as B, useMemo as w } from "react";
3
+ import { c as v } from "./bind-06a7ff84.js";
4
4
  import { K as e } from "./keyCodes-f63c0e11.js";
5
5
  import { B as D } from "./baseIconButton-251479f7.js";
6
- import { S as v } from "./minus-2857540f.js";
6
+ import { S as H } from "./minus-2857540f.js";
7
7
  import { S as k } from "./plus-199fb2a8.js";
8
- import { FieldLabel as H } from "./fieldLabel.js";
9
- const b = 5, Y = 16, P = [
8
+ import { FieldLabel as P } from "./fieldLabel.js";
9
+ const b = 5, I = 0.4, Y = 16 + I, G = [
10
10
  e.TAB_KEY_CODE,
11
11
  e.BACKSPACE_KEY_CODE,
12
12
  e.ARROW_LEFT_KEY_CODE,
@@ -24,33 +24,33 @@ const b = 5, Y = 16, P = [
24
24
  e.NUM_LOCK_7_KEY_CODE,
25
25
  e.NUM_LOCK_8_KEY_CODE,
26
26
  e.NUM_LOCK_9_KEY_CODE
27
- ], G = "_sign_3v3h5_7", j = "_error_3v3h5_22", z = "_disabled_3v3h5_27", X = "_input_3v3h5_12", $ = {
27
+ ], X = "_sign_3v3h5_7", $ = "_error_3v3h5_22", j = "_disabled_3v3h5_27", z = "_input_3v3h5_12", q = {
28
28
  "field-number": "_field-number_3v3h5_1",
29
- sign: G,
29
+ sign: X,
30
30
  "input-container": "_input-container_3v3h5_12",
31
- error: j,
32
- disabled: z,
31
+ error: $,
32
+ disabled: j,
33
33
  "input-field": "_input-field_3v3h5_38",
34
- input: X,
34
+ input: z,
35
35
  "additional-content": "_additional-content_3v3h5_84",
36
36
  "error-text": "_error-text_3v3h5_88"
37
- }, c = w.bind($), tn = ({
37
+ }, c = v.bind(q), rn = ({
38
38
  value: i = "",
39
- placeholder: I = "0",
39
+ placeholder: L = "0",
40
40
  disabled: t = !1,
41
41
  onChange: l,
42
42
  onFocus: d,
43
43
  onBlur: N,
44
- label: m,
44
+ label: f,
45
45
  postfix: E = "",
46
46
  min: s = 0,
47
47
  max: o = Number.MAX_SAFE_INTEGER,
48
- title: L,
48
+ title: A,
49
49
  error: C,
50
50
  id: h,
51
51
  ...M
52
52
  }) => {
53
- const u = W(null), p = y(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, R = (n) => {
53
+ const u = y(null), m = B(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, R = (n) => {
54
54
  const _ = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
55
55
  if (_ === "") {
56
56
  l("");
@@ -59,26 +59,26 @@ const b = 5, Y = 16, P = [
59
59
  l(+_);
60
60
  }, T = (n) => {
61
61
  N && N(n);
62
- const _ = +n.currentTarget.value, f = O(_);
63
- f !== _ && l(f);
64
- }, A = (n) => {
62
+ const _ = +n.currentTarget.value, p = O(_);
63
+ p !== _ && l(p);
64
+ }, U = (n) => {
65
65
  const { keyCode: _ } = n;
66
- P.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
- }, U = () => {
66
+ G.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
+ }, F = () => {
68
68
  const _ = O(+i) - 1;
69
69
  _ >= s && _ <= o && l(_);
70
70
  }, g = () => {
71
71
  const _ = O(+i) + 1;
72
72
  _ >= s && _ <= o && l(_);
73
- }, K = I + E, F = B(() => {
73
+ }, K = L + E, S = w(() => {
74
74
  let n = (String(i) || K).length;
75
- return E && !i && (n += 1), n > Y ? `${Y}ch` : `${n || b}ch`;
76
- }, [K, E, i]), S = () => {
75
+ return E && !i && (n += 1), n ? n > Y ? `${Y}ch` : `${n + I}ch` : `${b}ch`;
76
+ }, [K, E, i]), V = () => {
77
77
  u && u.current && u.current.focus(), d && d();
78
78
  };
79
- return /* @__PURE__ */ a(V, { children: [
79
+ return /* @__PURE__ */ a(W, { children: [
80
80
  /* @__PURE__ */ a("div", { className: c("field-number", { disabled: t }), children: [
81
- m && /* @__PURE__ */ r(H, { htmlFor: h ?? p, children: m }),
81
+ f && /* @__PURE__ */ r(P, { htmlFor: h ?? m, children: f }),
82
82
  /* @__PURE__ */ a(
83
83
  "div",
84
84
  {
@@ -86,22 +86,22 @@ const b = 5, Y = 16, P = [
86
86
  error: C,
87
87
  disabled: t
88
88
  }),
89
- title: L,
89
+ title: A,
90
90
  children: [
91
91
  /* @__PURE__ */ r(
92
92
  D,
93
93
  {
94
94
  className: c("sign", "minus"),
95
95
  disabled: t,
96
- onClick: U,
97
- children: /* @__PURE__ */ r(v, {})
96
+ onClick: F,
97
+ children: /* @__PURE__ */ r(H, {})
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: S, children: [
100
+ /* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: V, children: [
101
101
  /* @__PURE__ */ r(
102
102
  "input",
103
103
  {
104
- id: h ?? p,
104
+ id: h ?? m,
105
105
  ref: u,
106
106
  className: c("input"),
107
107
  type: "number",
@@ -110,11 +110,11 @@ const b = 5, Y = 16, P = [
110
110
  disabled: t,
111
111
  min: s,
112
112
  max: o,
113
- onKeyDown: t ? void 0 : A,
113
+ onKeyDown: t ? void 0 : U,
114
114
  onChange: t ? void 0 : R,
115
115
  onFocus: t ? void 0 : d,
116
116
  onBlur: t ? void 0 : T,
117
- style: { width: F },
117
+ style: { width: S },
118
118
  ...M
119
119
  }
120
120
  ),
@@ -137,5 +137,5 @@ const b = 5, Y = 16, P = [
137
137
  ] });
138
138
  };
139
139
  export {
140
- tn as F
140
+ rn as F
141
141
  };
@@ -1,4 +1,4 @@
1
- import { F as m } from "./fieldNumber-dd8e6902.js";
1
+ import { F as m } from "./fieldNumber-b4aa4d7e.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { D as K } from "./datePicker-6085b8d0.js";
13
13
  import "react-datepicker";
14
14
  import { D as Y } from "./dropdown-0b931e15.js";
15
15
  import { FieldLabel as $ } from "./fieldLabel.js";
16
- import { F as ro } from "./fieldNumber-dd8e6902.js";
16
+ import { F as ro } from "./fieldNumber-b4aa4d7e.js";
17
17
  import { F as to } from "./fieldText-1749da7a.js";
18
18
  import { F as no } from "./fieldTextFlex-2f51c173.js";
19
19
  import { FileDropArea as mo } from "./fileDropArea.js";
package/dist/popover.js CHANGED
@@ -1,86 +1,95 @@
1
- import { jsxs as f, Fragment as j, jsx as s } from "react/jsx-runtime";
2
- import { useRef as C, useState as L, useCallback as M } from "react";
3
- import { useFloating as W, offset as U, flip as q, arrow as z, autoUpdate as B, useClick as J, useDismiss as K, useRole as Q, useInteractions as V, FloatingFocusManager as X, FloatingArrow as Y, FloatingPortal as Z } from "@floating-ui/react";
4
- import { c as $ } from "./bind-06a7ff84.js";
5
- import { g as ee, T as g, a as te, A as se, b as ne, m as oe } from "./floatingUi-46f5b896.js";
6
- const le = "_popover_n3nff_1", ae = "_title_n3nff_28", re = {
1
+ import { jsxs as f, Fragment as W, jsx as s } from "react/jsx-runtime";
2
+ import { useRef as U, useState as q, useCallback as z } from "react";
3
+ import { useFloating as B, offset as J, flip as K, arrow as Q, autoUpdate as V, useClick as X, useDismiss as Y, useRole as Z, useInteractions as $, useTransitionStyles as ee, FloatingFocusManager as te, FloatingArrow as se, FloatingPortal as ne } from "@floating-ui/react";
4
+ import { c as oe } from "./bind-06a7ff84.js";
5
+ import { g as ae, T as u, a as le, A as ie, b as re, m as ce } from "./floatingUi-46f5b896.js";
6
+ const pe = "_popover_n3nff_1", me = "_title_n3nff_28", fe = {
7
7
  "popover-wrapper": "_popover-wrapper_n3nff_1",
8
- popover: le,
9
- title: ae
10
- }, a = $.bind(re), ge = ({
11
- content: u,
12
- children: d,
13
- className: _,
14
- placement: h = "bottom",
15
- fallbackPlacements: v = te,
16
- title: r,
17
- arrowOffset: n = se,
8
+ popover: pe,
9
+ title: me
10
+ }, l = oe.bind(fe), he = ({
11
+ content: d,
12
+ children: g,
13
+ placement: v = "bottom",
14
+ fallbackPlacements: _ = le,
15
+ className: h,
16
+ title: i,
17
+ arrowOffset: n = ie,
18
18
  safeZone: A = 4,
19
19
  arrowColor: F = "white",
20
20
  dataAutomationId: x,
21
- isOpened: R,
22
- isCentered: i = !0,
23
- strategy: w = "absolute",
24
- shouldUsePortal: E = !1,
21
+ strategy: y = "absolute",
22
+ transitionDuration: R = 0,
23
+ isCentered: r = !0,
24
+ isFocusDisabled: w = !1,
25
+ isOpened: E,
26
+ shouldUsePortal: b = !1,
25
27
  setIsOpened: o
26
28
  }) => {
27
- const c = C(null), [b, N] = L(!1), m = o ? R : b, P = (e) => {
29
+ const c = U(null), [T, N] = q(!1), p = o ? E : T, P = (e) => {
28
30
  o ? o(e) : N(e);
29
- }, T = M(
30
- (e, l) => ee(e, l, n, i),
31
- [n, i]
32
- ), { placement: y, refs: p, floatingStyles: k, context: t } = W({
33
- open: m,
31
+ }, S = z(
32
+ (e, a) => ae(e, a, n, r),
33
+ [n, r]
34
+ ), { placement: k, refs: m, floatingStyles: I, context: t } = B({
35
+ open: p,
34
36
  onOpenChange: P,
35
- placement: h,
36
- strategy: w,
37
+ placement: v,
38
+ strategy: y,
37
39
  middleware: [
38
- U(({ rects: e, placement: l }) => ({
39
- mainAxis: A + g,
40
- alignmentAxis: T(e, l)
40
+ J(({ rects: e, placement: a }) => ({
41
+ mainAxis: A + u,
42
+ alignmentAxis: S(e, a)
41
43
  })),
42
- q({
44
+ K({
43
45
  fallbackAxisSideDirection: "start",
44
- fallbackPlacements: v
46
+ fallbackPlacements: _
45
47
  }),
46
- z({
48
+ Q({
47
49
  element: c
48
50
  })
49
51
  ],
50
- whileElementsMounted: B
51
- }), I = J(t), S = K(t), D = Q(t), { getReferenceProps: G, getFloatingProps: H } = V([I, S, D]), O = () => {
52
- const e = /* @__PURE__ */ s(X, { context: t, modal: !1, children: /* @__PURE__ */ f(
52
+ whileElementsMounted: V
53
+ }), D = X(t), G = Y(t), H = Z(t), { getReferenceProps: M, getFloatingProps: O } = $([D, G, H]), { isMounted: j, styles: C } = ee(t, {
54
+ duration: R,
55
+ initial: { opacity: 0 }
56
+ }), L = () => {
57
+ const e = /* @__PURE__ */ s(te, { context: t, modal: !1, disabled: w, children: /* @__PURE__ */ f(
53
58
  "div",
54
59
  {
55
- className: a("popover", _),
60
+ className: l("popover", h),
56
61
  "data-automation-id": x,
57
- ref: p.setFloating,
58
- style: k,
59
- ...H(),
62
+ ref: m.setFloating,
63
+ style: {
64
+ ...I,
65
+ ...C,
66
+ pointerEvents: p ? "auto" : "none"
67
+ },
68
+ ...O(),
60
69
  children: [
61
70
  /* @__PURE__ */ s(
62
- Y,
71
+ se,
63
72
  {
64
73
  ref: c,
65
74
  context: t,
66
- width: ne,
67
- height: g,
75
+ width: re,
76
+ height: u,
68
77
  fill: F,
69
- staticOffset: oe.includes(y) ? null : n
78
+ staticOffset: ce.includes(k) ? null : n
70
79
  }
71
80
  ),
72
- r && /* @__PURE__ */ s("div", { className: a("title"), children: r }),
73
- u
81
+ i && /* @__PURE__ */ s("div", { className: l("title"), children: i }),
82
+ d
74
83
  ]
75
84
  }
76
85
  ) });
77
- return E ? /* @__PURE__ */ s(Z, { children: e }) : e;
86
+ return b ? /* @__PURE__ */ s(ne, { children: e }) : e;
78
87
  };
79
- return /* @__PURE__ */ f(j, { children: [
80
- /* @__PURE__ */ s("div", { ref: p.setReference, ...G(), className: a("popover-wrapper"), children: d }),
81
- m && O()
88
+ return /* @__PURE__ */ f(W, { children: [
89
+ /* @__PURE__ */ s("div", { ref: m.setReference, ...M(), className: l("popover-wrapper"), children: g }),
90
+ j && L()
82
91
  ] });
83
92
  };
84
93
  export {
85
- ge as Popover
94
+ he as Popover
86
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.210",
3
+ "version": "0.0.1-alpha.212",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {