@eyesee/ui-components 0.5.0 → 0.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.
- package/dist/components/Button/Button.js +62 -58
- package/dist/components/Button/Button.module.scss.js +36 -34
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.js +12 -12
- package/dist/components/DropdownList/DropdownList.js +5 -5
- package/dist/components/ImagePlaceholder/ImageHoverPreview/ImageHoverPreview.js +64 -0
- package/dist/components/ImagePlaceholder/ImageHoverPreview/ImageHoverPreview.module.scss.js +9 -0
- package/dist/components/ImagePlaceholder/ImagePlaceholder.js +148 -115
- package/dist/components/ImagePlaceholder/ImagePlaceholder.module.scss.js +30 -28
- package/dist/components/ImageWithData/ImageWithData.module.scss.js +20 -20
- package/dist/components/ListItem/ListItem.module.scss.js +13 -13
- package/dist/components/Pill/Pill.js +17 -19
- package/dist/components/Tab/Tab.module.scss.js +25 -25
- package/dist/components/icons-v2/ListCheckIcon.js +15 -0
- package/dist/components/icons-v2/PackseeIcon.js +12 -16
- package/dist/components/icons-v2/index.js +18 -16
- package/dist/index.js +37 -35
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/styles/_mixins.scss +1 -1
|
@@ -1,97 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { ChevronDownIcon as
|
|
5
|
-
import { ChevronUpIcon as
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as R } from "react";
|
|
3
|
+
import m from "clsx";
|
|
4
|
+
import { ChevronDownIcon as S } from "../icons-v2/ChevronDownIcon.js";
|
|
5
|
+
import { ChevronUpIcon as A } from "../icons-v2/ChevronUpIcon.js";
|
|
6
|
+
import E from "../../hooks/useClickOutside.js";
|
|
7
|
+
import { ListItem as U } from "../ListItem/ListItem.js";
|
|
8
|
+
import { DropdownList as q } from "../DropdownList/DropdownList.js";
|
|
9
|
+
import { Tooltip as z } from "../Tooltip/Tooltip.js";
|
|
7
10
|
import e from "./Button.module.scss.js";
|
|
8
|
-
|
|
9
|
-
import { DropdownList as A } from "../DropdownList/DropdownList.js";
|
|
10
|
-
import { Tooltip as E } from "../Tooltip/Tooltip.js";
|
|
11
|
-
const Q = ({
|
|
11
|
+
const Y = ({
|
|
12
12
|
text: l,
|
|
13
|
-
options:
|
|
14
|
-
onClick:
|
|
13
|
+
options: p = [],
|
|
14
|
+
onClick: u = () => {
|
|
15
15
|
},
|
|
16
|
-
className:
|
|
17
|
-
iconSize:
|
|
18
|
-
size:
|
|
19
|
-
variant:
|
|
20
|
-
type:
|
|
16
|
+
className: w,
|
|
17
|
+
iconSize: f = "m",
|
|
18
|
+
size: v = "md",
|
|
19
|
+
variant: N = "primary",
|
|
20
|
+
type: O = "fill",
|
|
21
|
+
pressed: h = !1,
|
|
21
22
|
icon: a = null,
|
|
22
|
-
tooltipContent:
|
|
23
|
-
tooltipTitle:
|
|
24
|
-
disabled:
|
|
25
|
-
fullWidth:
|
|
26
|
-
dropdownAlign:
|
|
27
|
-
tooltipProps:
|
|
28
|
-
|
|
23
|
+
tooltipContent: d = null,
|
|
24
|
+
tooltipTitle: g,
|
|
25
|
+
disabled: y = !1,
|
|
26
|
+
fullWidth: D = !1,
|
|
27
|
+
dropdownAlign: x = "start",
|
|
28
|
+
tooltipProps: k = { position: "bottom", variant: "light" },
|
|
29
|
+
dropdownCustomContent: s = null,
|
|
30
|
+
...B
|
|
29
31
|
}) => {
|
|
30
|
-
const [
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
},
|
|
32
|
+
const [o, i] = L(!1), b = R(null);
|
|
33
|
+
E(b, () => i(!1));
|
|
34
|
+
const T = (n) => {
|
|
35
|
+
u(n), i(!1);
|
|
36
|
+
}, t = p.length > 0 || !!s, W = a && !l && !t, j = a && !l, C = !!d, I = /* @__PURE__ */ c(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
37
|
-
ref:
|
|
39
|
+
ref: b,
|
|
38
40
|
"data-button-wrapper": !0,
|
|
39
|
-
className:
|
|
40
|
-
...
|
|
41
|
+
className: m(e.wrapper, w, D && e.fullWidth),
|
|
42
|
+
...B,
|
|
41
43
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ c(
|
|
43
45
|
"button",
|
|
44
46
|
{
|
|
45
47
|
type: "button",
|
|
46
|
-
className:
|
|
48
|
+
className: m(
|
|
47
49
|
e.button,
|
|
48
|
-
e[
|
|
49
|
-
e[
|
|
50
|
-
e[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
e[v],
|
|
51
|
+
e[N],
|
|
52
|
+
e[O],
|
|
53
|
+
t && e.hasDropdown,
|
|
54
|
+
W && e.iconOnly,
|
|
55
|
+
j && e.isIcon,
|
|
56
|
+
h && e.pressed
|
|
54
57
|
),
|
|
55
|
-
onClick: () =>
|
|
56
|
-
"aria-expanded":
|
|
58
|
+
onClick: () => t ? i((n) => !n) : u(),
|
|
59
|
+
"aria-expanded": o,
|
|
60
|
+
"aria-pressed": h,
|
|
57
61
|
"aria-haspopup": "menu",
|
|
58
|
-
disabled:
|
|
62
|
+
disabled: y,
|
|
59
63
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ c(
|
|
61
65
|
"span",
|
|
62
66
|
{
|
|
63
|
-
className:
|
|
67
|
+
className: m(
|
|
64
68
|
e.buttonContent,
|
|
65
|
-
|
|
69
|
+
t && e.buttonContentDropdown
|
|
66
70
|
),
|
|
67
71
|
children: [
|
|
68
|
-
a && /* @__PURE__ */
|
|
69
|
-
l && /* @__PURE__ */
|
|
72
|
+
a && /* @__PURE__ */ r("span", { className: e.icon, children: a }),
|
|
73
|
+
l && /* @__PURE__ */ r("span", { className: e.buttonText, children: l })
|
|
70
74
|
]
|
|
71
75
|
}
|
|
72
76
|
),
|
|
73
|
-
|
|
77
|
+
t && /* @__PURE__ */ r("span", { className: e.buttonArrow, children: o ? /* @__PURE__ */ r(A, { iconSize: f }) : /* @__PURE__ */ r(S, { iconSize: f }) })
|
|
74
78
|
]
|
|
75
79
|
}
|
|
76
80
|
),
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
o && t && /* @__PURE__ */ r(q, { align: x, children: s || p.map((n) => /* @__PURE__ */ r(
|
|
82
|
+
U,
|
|
79
83
|
{
|
|
80
84
|
role: "menuitem",
|
|
81
|
-
title:
|
|
82
|
-
controlItem:
|
|
85
|
+
title: n.label,
|
|
86
|
+
controlItem: n == null ? void 0 : n.icon,
|
|
83
87
|
horizontalSpacing: "xs",
|
|
84
88
|
verticalSpacing: "none",
|
|
85
|
-
...
|
|
86
|
-
onClick: () =>
|
|
89
|
+
...n,
|
|
90
|
+
onClick: () => T(n)
|
|
87
91
|
},
|
|
88
|
-
|
|
92
|
+
n.value
|
|
89
93
|
)) })
|
|
90
94
|
]
|
|
91
95
|
}
|
|
92
96
|
);
|
|
93
|
-
return
|
|
97
|
+
return C ? /* @__PURE__ */ r(z, { title: g, content: d, ...k, children: I }) : I;
|
|
94
98
|
};
|
|
95
99
|
export {
|
|
96
|
-
|
|
100
|
+
Y as Button
|
|
97
101
|
};
|
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_fullWidth_16rg3_3", n = "_button_16rg3_6", o = "_wrapper_16rg3_10", _ = "_buttonContent_16rg3_27", r = "_icon_16rg3_27", s = "_buttonArrow_16rg3_28", c = "_buttonText_16rg3_36", e = "_iconOnly_16rg3_53", l = "_buttonContentDropdown_16rg3_56", g = "_hasDropdown_16rg3_62", u = "_lg_16rg3_78", i = "_isIcon_16rg3_81", d = "_md_16rg3_85", x = "_sm_16rg3_92", a = "_xs_16rg3_99", p = "_xxs_16rg3_106", b = "_xxxs_16rg3_113", w = "_primary_16rg3_123", y = "_fill_16rg3_123", m = "_pressed_16rg3_127", f = "_outline_16rg3_154", h = "_blank_16rg3_167", C = "_secondary_16rg3_214", D = "_destructive_16rg3_305", k = "_neutral_16rg3_396", v = {
|
|
2
2
|
fullWidth: t,
|
|
3
3
|
button: n,
|
|
4
4
|
wrapper: o,
|
|
5
5
|
buttonContent: _,
|
|
6
|
-
icon:
|
|
7
|
-
buttonArrow:
|
|
8
|
-
buttonText:
|
|
9
|
-
iconOnly:
|
|
10
|
-
buttonContentDropdown:
|
|
11
|
-
hasDropdown:
|
|
6
|
+
icon: r,
|
|
7
|
+
buttonArrow: s,
|
|
8
|
+
buttonText: c,
|
|
9
|
+
iconOnly: e,
|
|
10
|
+
buttonContentDropdown: l,
|
|
11
|
+
hasDropdown: g,
|
|
12
12
|
lg: u,
|
|
13
|
-
isIcon:
|
|
14
|
-
md:
|
|
13
|
+
isIcon: i,
|
|
14
|
+
md: d,
|
|
15
15
|
sm: x,
|
|
16
16
|
xs: a,
|
|
17
|
-
xxs:
|
|
17
|
+
xxs: p,
|
|
18
18
|
xxxs: b,
|
|
19
|
-
primary:
|
|
20
|
-
fill:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
primary: w,
|
|
20
|
+
fill: y,
|
|
21
|
+
pressed: m,
|
|
22
|
+
outline: f,
|
|
23
|
+
blank: h,
|
|
24
|
+
secondary: C,
|
|
25
|
+
destructive: D,
|
|
26
|
+
neutral: k
|
|
26
27
|
};
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
h as blank,
|
|
29
30
|
n as button,
|
|
30
|
-
|
|
31
|
+
s as buttonArrow,
|
|
31
32
|
_ as buttonContent,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
l as buttonContentDropdown,
|
|
34
|
+
c as buttonText,
|
|
35
|
+
v as default,
|
|
36
|
+
D as destructive,
|
|
37
|
+
y as fill,
|
|
37
38
|
t as fullWidth,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
g as hasDropdown,
|
|
40
|
+
r as icon,
|
|
41
|
+
e as iconOnly,
|
|
42
|
+
i as isIcon,
|
|
42
43
|
u as lg,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
d as md,
|
|
45
|
+
k as neutral,
|
|
46
|
+
f as outline,
|
|
47
|
+
m as pressed,
|
|
48
|
+
w as primary,
|
|
49
|
+
C as secondary,
|
|
48
50
|
x as sm,
|
|
49
51
|
o as wrapper,
|
|
50
52
|
a as xs,
|
|
51
|
-
|
|
53
|
+
p as xxs,
|
|
52
54
|
b as xxxs
|
|
53
55
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as z, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as C } from "react";
|
|
3
3
|
import n from "clsx";
|
|
4
|
-
import o from "./Checkbox.module.scss.js";
|
|
5
4
|
import { CheckmarkLargeIcon as I } from "../icons-v2/CheckmarkLargeIcon.js";
|
|
6
5
|
import { MinusIcon as y } from "../icons-v2/MinusIcon.js";
|
|
7
6
|
import { iconSizes as a } from "../icons-v2/constants.js";
|
|
7
|
+
import o from "./Checkbox.module.scss.js";
|
|
8
8
|
const N = (e) => e === "lg" ? "m" : "s", W = ({
|
|
9
9
|
label: e,
|
|
10
10
|
checked: c = !1,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
checkboxWrapper:
|
|
3
|
-
disabled:
|
|
1
|
+
const e = "_checkboxWrapper_1u1h6_3", c = "_disabled_1u1h6_13", _ = "_input_1u1h6_18", l = "_checkbox_1u1h6_3", t = "_filled_1u1h6_42", o = "_labelText_1u1h6_46", b = {
|
|
2
|
+
checkboxWrapper: e,
|
|
3
|
+
disabled: c,
|
|
4
4
|
input: _,
|
|
5
|
-
checkbox:
|
|
6
|
-
filled:
|
|
7
|
-
labelText:
|
|
5
|
+
checkbox: l,
|
|
6
|
+
filled: t,
|
|
7
|
+
labelText: o
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
l as checkbox,
|
|
11
|
+
e as checkboxWrapper,
|
|
12
|
+
b as default,
|
|
13
|
+
c as disabled,
|
|
14
|
+
t as filled,
|
|
15
15
|
_ as input,
|
|
16
|
-
|
|
16
|
+
o as labelText
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import w from "clsx";
|
|
3
3
|
import r from "./DropdownList.module.scss.js";
|
|
4
4
|
const a = ({
|
|
@@ -13,12 +13,12 @@ const a = ({
|
|
|
13
13
|
onLoadMore: t,
|
|
14
14
|
style: d
|
|
15
15
|
}) => {
|
|
16
|
-
const f = (
|
|
17
|
-
const l =
|
|
16
|
+
const f = (g) => {
|
|
17
|
+
const l = g.currentTarget;
|
|
18
18
|
l.scrollHeight - l.scrollTop - l.clientHeight < 48 && (t == null || t());
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
"
|
|
20
|
+
return /* @__PURE__ */ u(
|
|
21
|
+
"div",
|
|
22
22
|
{
|
|
23
23
|
ref: p,
|
|
24
24
|
id: c,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as f, Fragment as p, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useState as E } from "react";
|
|
3
|
+
import { createPortal as M } from "react-dom";
|
|
4
|
+
import P from "../ImagePlaceholder.js";
|
|
5
|
+
import d from "./ImageHoverPreview.module.scss.js";
|
|
6
|
+
const w = 200, r = 8, u = 8, x = () => document.getElementById("modal") ?? document.body, g = (t, e, a) => Math.min(Math.max(t, e), a), j = ({ previewSize: t = w, ...e }) => {
|
|
7
|
+
const a = I(null), [s, c] = E(null);
|
|
8
|
+
return /* @__PURE__ */ f(p, { children: [
|
|
9
|
+
/* @__PURE__ */ m(
|
|
10
|
+
P,
|
|
11
|
+
{
|
|
12
|
+
...e,
|
|
13
|
+
imageAreaRef: a,
|
|
14
|
+
onImageAreaMouseEnter: (l) => {
|
|
15
|
+
var i;
|
|
16
|
+
l.stopPropagation();
|
|
17
|
+
const o = (i = a.current) == null ? void 0 : i.getBoundingClientRect();
|
|
18
|
+
if (!o) return;
|
|
19
|
+
let n = o.right + u;
|
|
20
|
+
n + t > window.innerWidth - r && (n = o.left - t - u), n = g(
|
|
21
|
+
n,
|
|
22
|
+
r,
|
|
23
|
+
window.innerWidth - t - r
|
|
24
|
+
);
|
|
25
|
+
const h = g(
|
|
26
|
+
o.top + o.height / 2 - t / 2,
|
|
27
|
+
r,
|
|
28
|
+
window.innerHeight - t - r
|
|
29
|
+
);
|
|
30
|
+
c({ top: h, left: n });
|
|
31
|
+
},
|
|
32
|
+
onImageAreaMouseLeave: (l) => {
|
|
33
|
+
l.stopPropagation(), c(null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
s && M(
|
|
38
|
+
/* @__PURE__ */ m(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: d.preview,
|
|
42
|
+
style: {
|
|
43
|
+
top: s.top,
|
|
44
|
+
left: s.left,
|
|
45
|
+
width: t,
|
|
46
|
+
height: t
|
|
47
|
+
},
|
|
48
|
+
children: /* @__PURE__ */ m(
|
|
49
|
+
"img",
|
|
50
|
+
{
|
|
51
|
+
src: e.url,
|
|
52
|
+
alt: e.text ?? "",
|
|
53
|
+
className: d.previewImage
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
x()
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
j as ImageHoverPreview
|
|
64
|
+
};
|