@fluidattacks/design 9.9.2 → 10.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.
- package/dist/components/advisories-card/index.js +4 -2
- package/dist/components/carousel/index.js +12 -10
- package/dist/components/cloud-image/index.js +10 -8
- package/dist/components/conditions-dialog/index.js +23 -21
- package/dist/components/confirm-dialog/index.js +9 -7
- package/dist/components/item-card-db/index.js +10 -8
- package/dist/components/modal/dialog/index.js +8 -6
- package/dist/components/modal/footer/index.js +15 -14
- package/dist/components/modal/header/index.d.ts +1 -1
- package/dist/components/modal/header/index.js +58 -40
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/index.stories.d.ts +17 -5
- package/dist/components/modal/styles.js +22 -13
- package/dist/components/modal/types.d.ts +23 -3
- package/dist/components/package-card/index.js +25 -23
- package/dist/components/rules-card/index.js +19 -17
- package/dist/components/severity-indicator/index.js +16 -14
- package/dist/components/table/table-column-toggle/index.js +7 -6
- package/dist/components/table/wrapper/index.js +10 -8
- package/dist/components/weaknesses-card/index.js +4 -2
- package/dist/hooks/use-search.js +4 -3
- package/package.json +1 -1
|
@@ -8,8 +8,10 @@ import { Heading as T } from "../typography/heading/index.js";
|
|
|
8
8
|
import { Span as f } from "../typography/span/index.js";
|
|
9
9
|
import { Text as l } from "../typography/text/index.js";
|
|
10
10
|
import { CardContainer as k, Divisor as t } from "../weaknesses-card/styles.js";
|
|
11
|
+
import "../../_virtual/dayjs.min.js";
|
|
12
|
+
import "../../_virtual/lodash.js";
|
|
11
13
|
import { safeUrl as A } from "../../utils/url.js";
|
|
12
|
-
const
|
|
14
|
+
const G = ({
|
|
13
15
|
author: g,
|
|
14
16
|
creator: p,
|
|
15
17
|
cwes: d,
|
|
@@ -147,5 +149,5 @@ const W = ({
|
|
|
147
149
|
] });
|
|
148
150
|
};
|
|
149
151
|
export {
|
|
150
|
-
|
|
152
|
+
G as AdvisoriesCard
|
|
151
153
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as p } from "react";
|
|
3
|
-
import { CarouselContainer as
|
|
3
|
+
import { CarouselContainer as m, CarouselWrapper as C, CarouselSlide as d, NavContainer as v, NavButton as h } from "./styles.js";
|
|
4
4
|
import { useCarousel as k } from "../../hooks/use-carousel.js";
|
|
5
|
-
|
|
5
|
+
import "../../_virtual/lodash.js";
|
|
6
|
+
import "nuqs";
|
|
7
|
+
const j = ({
|
|
6
8
|
slides: a,
|
|
7
9
|
interval: c = 300
|
|
8
10
|
}) => {
|
|
9
|
-
const { cycle:
|
|
11
|
+
const { cycle: i, setCycle: l, setProgress: n } = k(c, a.length), s = p(
|
|
10
12
|
(e) => () => {
|
|
11
|
-
|
|
13
|
+
l(e), n(0);
|
|
12
14
|
},
|
|
13
|
-
[
|
|
15
|
+
[l, n]
|
|
14
16
|
);
|
|
15
|
-
return /* @__PURE__ */ u(
|
|
16
|
-
/* @__PURE__ */ o(
|
|
17
|
+
return /* @__PURE__ */ u(m, { "aria-roledescription": "carousel", children: [
|
|
18
|
+
/* @__PURE__ */ o(C, { $currentIndex: i, children: a.map((e, r) => {
|
|
17
19
|
const t = `slide-${r}`;
|
|
18
20
|
return /* @__PURE__ */ o(
|
|
19
21
|
d,
|
|
@@ -30,9 +32,9 @@ const N = ({
|
|
|
30
32
|
return /* @__PURE__ */ o(
|
|
31
33
|
h,
|
|
32
34
|
{
|
|
33
|
-
$isActive: r ===
|
|
35
|
+
$isActive: r === i,
|
|
34
36
|
"aria-label": `Go to slide ${r + 1}`,
|
|
35
|
-
"data-testid": r ===
|
|
37
|
+
"data-testid": r === i ? "active" : "inactive",
|
|
36
38
|
onClick: s(r)
|
|
37
39
|
},
|
|
38
40
|
t
|
|
@@ -41,5 +43,5 @@ const N = ({
|
|
|
41
43
|
] });
|
|
42
44
|
};
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
j as Carousel
|
|
45
47
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { AdvancedImage as l, lazyload as g, placeholder as
|
|
3
|
-
import
|
|
4
|
-
import { useCloudinaryImage as
|
|
5
|
-
|
|
2
|
+
import { AdvancedImage as l, lazyload as g, placeholder as p } from "../../node_modules/@cloudinary/react/dist/index.js";
|
|
3
|
+
import c from "react";
|
|
4
|
+
import { useCloudinaryImage as f } from "../../hooks/use-cloudinary-image.js";
|
|
5
|
+
import "../../_virtual/lodash.js";
|
|
6
|
+
import "nuqs";
|
|
7
|
+
const n = ({
|
|
6
8
|
alt: e = "img",
|
|
7
9
|
height: a = "",
|
|
8
10
|
width: r = "",
|
|
9
11
|
transformation: m,
|
|
10
|
-
plugins: d = [g(),
|
|
12
|
+
plugins: d = [g(), p()],
|
|
11
13
|
publicId: t
|
|
12
14
|
}) => {
|
|
13
|
-
const o =
|
|
15
|
+
const o = f({ publicId: t });
|
|
14
16
|
return m && o.addTransformation(m), /* @__PURE__ */ i(
|
|
15
17
|
l,
|
|
16
18
|
{
|
|
@@ -21,7 +23,7 @@ const p = ({
|
|
|
21
23
|
width: r
|
|
22
24
|
}
|
|
23
25
|
);
|
|
24
|
-
},
|
|
26
|
+
}, z = c.memo(n);
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
z as CloudImage
|
|
27
29
|
};
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as p, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useRef as j, useCallback as r, useMemo as D } from "react";
|
|
3
3
|
import { Checkbox as M } from "../checkbox/index.js";
|
|
4
4
|
import { Container as O } from "../container/index.js";
|
|
5
5
|
import { Modal as y } from "../modal/index.js";
|
|
6
|
+
import "../../_virtual/lodash.js";
|
|
7
|
+
import "nuqs";
|
|
6
8
|
import { useModal as v } from "../../hooks/use-modal.js";
|
|
7
9
|
import { ModalConfirm as R } from "../modal/modal-confirm/index.js";
|
|
8
10
|
const S = ({
|
|
9
11
|
children: a,
|
|
10
|
-
conditions:
|
|
12
|
+
conditions: n,
|
|
11
13
|
id: c,
|
|
12
14
|
modalRef: s,
|
|
13
15
|
onConfirm: m,
|
|
14
16
|
title: d
|
|
15
17
|
}) => {
|
|
16
|
-
const [
|
|
17
|
-
i({ ...
|
|
18
|
-
}, [
|
|
18
|
+
const [t, i] = k(n), f = r(() => {
|
|
19
|
+
i({ ...n });
|
|
20
|
+
}, [n]), u = r((o) => () => {
|
|
19
21
|
i((e) => ({
|
|
20
22
|
...e,
|
|
21
23
|
[o]: { ...e[o], state: !e[o].state }
|
|
22
24
|
}));
|
|
23
|
-
}, []), l = !Object.values(
|
|
25
|
+
}, []), l = !Object.values(t).every(
|
|
24
26
|
({ state: o }) => o
|
|
25
|
-
),
|
|
26
|
-
([o, { state: e, label: C }]) => /* @__PURE__ */
|
|
27
|
+
), h = Object.entries(t).map(
|
|
28
|
+
([o, { state: e, label: C }]) => /* @__PURE__ */ p(
|
|
27
29
|
M,
|
|
28
30
|
{
|
|
29
31
|
defaultChecked: e,
|
|
@@ -45,17 +47,17 @@ const S = ({
|
|
|
45
47
|
title: d,
|
|
46
48
|
children: [
|
|
47
49
|
a,
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ p(O, { display: "flex", flexDirection: "column", gap: 0.5, children: h }),
|
|
51
|
+
/* @__PURE__ */ p(R, { disabled: l, id: c, onConfirm: m })
|
|
50
52
|
]
|
|
51
53
|
}
|
|
52
54
|
);
|
|
53
|
-
},
|
|
54
|
-
const { close: s, isOpen: m, name: d, open:
|
|
55
|
+
}, G = (a, n, c) => {
|
|
56
|
+
const { close: s, isOpen: m, name: d, open: t, setIsOpen: i, toggle: f } = v(
|
|
55
57
|
"confirm-dialog-modal"
|
|
56
|
-
), [u] = k(c), l = j(null),
|
|
58
|
+
), [u] = k(c), l = j(null), h = r(async () => (t(), new Promise((g) => {
|
|
57
59
|
l.current = g;
|
|
58
|
-
})), [
|
|
60
|
+
})), [t]), o = r(() => {
|
|
59
61
|
s(), l.current?.(!0);
|
|
60
62
|
}, [s]), e = r(() => {
|
|
61
63
|
s(), l.current?.(!1);
|
|
@@ -64,27 +66,27 @@ const S = ({
|
|
|
64
66
|
close: e,
|
|
65
67
|
isOpen: m,
|
|
66
68
|
name: d,
|
|
67
|
-
open:
|
|
69
|
+
open: t,
|
|
68
70
|
setIsOpen: i,
|
|
69
71
|
toggle: f
|
|
70
72
|
}),
|
|
71
|
-
[e, m, d,
|
|
73
|
+
[e, m, d, t, i, f]
|
|
72
74
|
), b = r(
|
|
73
|
-
({ children: g }) => /* @__PURE__ */
|
|
75
|
+
({ children: g }) => /* @__PURE__ */ p(
|
|
74
76
|
S,
|
|
75
77
|
{
|
|
76
78
|
conditions: u,
|
|
77
79
|
id: a,
|
|
78
80
|
modalRef: C,
|
|
79
81
|
onConfirm: o,
|
|
80
|
-
title:
|
|
82
|
+
title: n,
|
|
81
83
|
children: g
|
|
82
84
|
}
|
|
83
85
|
),
|
|
84
|
-
[o, a, u, C,
|
|
86
|
+
[o, a, u, C, n]
|
|
85
87
|
);
|
|
86
|
-
return [
|
|
88
|
+
return [h, b];
|
|
87
89
|
};
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
G as useConditionsDialog
|
|
90
92
|
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useRef as C, useCallback as l } from "react";
|
|
3
3
|
import { Modal as p } from "../modal/index.js";
|
|
4
|
+
import "../../_virtual/lodash.js";
|
|
5
|
+
import "nuqs";
|
|
4
6
|
import { useModal as g } from "../../hooks/use-modal.js";
|
|
5
|
-
const
|
|
6
|
-
const [o, n] = u(), r = C(null), c = g("confirm-dialog-modal"), { close: e, open: s } = c,
|
|
7
|
+
const P = () => {
|
|
8
|
+
const [o, n] = u(), r = C(null), c = g("confirm-dialog-modal"), { close: e, open: s } = c, a = l(
|
|
7
9
|
async (i) => (n(i), s(), new Promise((t) => {
|
|
8
10
|
r.current = t;
|
|
9
11
|
})),
|
|
10
12
|
[s]
|
|
11
13
|
), d = l(() => {
|
|
12
14
|
e(), n(void 0), r.current?.(!0);
|
|
13
|
-
}, [e]),
|
|
15
|
+
}, [e]), m = l(() => {
|
|
14
16
|
e(), n(void 0), r.current?.(!1);
|
|
15
17
|
}, [e]);
|
|
16
18
|
return { ConfirmDialog: ({ id: i = "confirm-dialog-modal", children: t }) => /* @__PURE__ */ f(
|
|
17
19
|
p,
|
|
18
20
|
{
|
|
19
21
|
cancelButton: o?.showCancel === !0 || o?.showCancel === void 0 ? {
|
|
20
|
-
onClick:
|
|
22
|
+
onClick: m,
|
|
21
23
|
text: o?.cancelText ?? "Cancel"
|
|
22
24
|
} : void 0,
|
|
23
25
|
confirmButton: o?.showConfirm === !0 || o?.showConfirm === void 0 ? {
|
|
@@ -27,7 +29,7 @@ const M = () => {
|
|
|
27
29
|
} : void 0,
|
|
28
30
|
description: o?.message,
|
|
29
31
|
id: i,
|
|
30
|
-
modalRef: { ...c, close:
|
|
32
|
+
modalRef: { ...c, close: m },
|
|
31
33
|
size: o?.modalSize ?? "sm",
|
|
32
34
|
title: o?.title,
|
|
33
35
|
children: [
|
|
@@ -35,8 +37,8 @@ const M = () => {
|
|
|
35
37
|
t
|
|
36
38
|
]
|
|
37
39
|
}
|
|
38
|
-
), confirm:
|
|
40
|
+
), confirm: a };
|
|
39
41
|
};
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
P as useConfirmDialog
|
|
42
44
|
};
|
|
@@ -7,25 +7,27 @@ import { Tag as y } from "../tag/index.js";
|
|
|
7
7
|
import { Heading as k } from "../typography/heading/index.js";
|
|
8
8
|
import "../typography/span/index.js";
|
|
9
9
|
import { Text as l } from "../typography/text/index.js";
|
|
10
|
+
import "../../_virtual/dayjs.min.js";
|
|
11
|
+
import "../../_virtual/lodash.js";
|
|
10
12
|
import { safeUrl as j } from "../../utils/url.js";
|
|
11
13
|
const L = {
|
|
12
14
|
md: { titleSize: "xs", descSize: "md", linkTextSize: "md" },
|
|
13
15
|
lg: { titleSize: "sm", descSize: "lg", linkTextSize: "lg" }
|
|
14
|
-
},
|
|
16
|
+
}, _ = ({
|
|
15
17
|
desc: r,
|
|
16
18
|
href: c,
|
|
17
19
|
icon: n,
|
|
18
20
|
imageHeight: m = 48,
|
|
19
21
|
imageWidth: a = 48,
|
|
20
|
-
Link:
|
|
21
|
-
LinkElement:
|
|
22
|
-
linkText:
|
|
22
|
+
Link: p,
|
|
23
|
+
LinkElement: h,
|
|
24
|
+
linkText: f = "Learn more ",
|
|
23
25
|
publicId: o,
|
|
24
26
|
size: z = "lg",
|
|
25
27
|
tag: d,
|
|
26
28
|
title: t
|
|
27
29
|
}) => {
|
|
28
|
-
const g =
|
|
30
|
+
const g = p ?? "a", { titleSize: x, descSize: S, linkTextSize: I } = L[z];
|
|
29
31
|
return /* @__PURE__ */ i(C, { "data-testid": t, children: [
|
|
30
32
|
/* @__PURE__ */ i(
|
|
31
33
|
w,
|
|
@@ -61,12 +63,12 @@ const L = {
|
|
|
61
63
|
),
|
|
62
64
|
/* @__PURE__ */ e(k, { size: x, children: t }),
|
|
63
65
|
r ? /* @__PURE__ */ e(l, { size: S, children: r }) : void 0,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
h ?? /* @__PURE__ */ e(g, { href: j(c), style: { textDecoration: "none" }, children: /* @__PURE__ */ i(l, { size: I, children: [
|
|
67
|
+
f,
|
|
66
68
|
/* @__PURE__ */ e(s, { icon: "arrow-right", iconSize: "sm", iconType: "fa-light" })
|
|
67
69
|
] }) })
|
|
68
70
|
] });
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
_ as ItemCardDB
|
|
72
74
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as p, useState as f } from "react";
|
|
3
3
|
import { trapTabKey as o } from "./utils.js";
|
|
4
|
-
import { ModalWrapper as
|
|
4
|
+
import { ModalWrapper as c } from "../styles.js";
|
|
5
|
+
import "../../../_virtual/lodash.js";
|
|
6
|
+
import "nuqs";
|
|
5
7
|
import { useMountEffect as s } from "../../../hooks/use-mount-effect.js";
|
|
6
|
-
const
|
|
8
|
+
const x = ({
|
|
7
9
|
children: n = void 0,
|
|
8
10
|
id: a = void 0,
|
|
9
11
|
label: i
|
|
10
12
|
}) => {
|
|
11
|
-
const r =
|
|
13
|
+
const r = p(null), [t] = f(() => document.activeElement);
|
|
12
14
|
return s(() => {
|
|
13
15
|
const e = r.current;
|
|
14
16
|
return e?.contains(document.activeElement) !== !0 && e?.focus(), e?.addEventListener("keydown", o), () => {
|
|
15
17
|
e?.removeEventListener("keydown", o), t instanceof HTMLElement && t.focus();
|
|
16
18
|
};
|
|
17
19
|
}), /* @__PURE__ */ m(
|
|
18
|
-
|
|
20
|
+
c,
|
|
19
21
|
{
|
|
20
22
|
"aria-label": i,
|
|
21
23
|
"aria-modal": "true",
|
|
@@ -28,5 +30,5 @@ const w = ({
|
|
|
28
30
|
);
|
|
29
31
|
};
|
|
30
32
|
export {
|
|
31
|
-
|
|
33
|
+
x as Dialog
|
|
32
34
|
};
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { l as x } from "../../../_virtual/lodash.js";
|
|
3
|
-
import { useCallback as
|
|
3
|
+
import { useCallback as l } from "react";
|
|
4
4
|
import { Footer as C } from "../styles.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Container as
|
|
5
|
+
import { Button as s } from "../../button/index.js";
|
|
6
|
+
import { Container as f } from "../../container/index.js";
|
|
7
7
|
const w = ({
|
|
8
8
|
alert: p,
|
|
9
9
|
modalRef: a,
|
|
10
10
|
confirmButton: i = void 0,
|
|
11
11
|
cancelButton: r = void 0
|
|
12
12
|
}) => {
|
|
13
|
-
const { close: o } = a, h =
|
|
13
|
+
const { close: o } = a, h = l(() => {
|
|
14
14
|
r?.onClick && r.onClick(), o();
|
|
15
|
-
}, [r, o]),
|
|
15
|
+
}, [r, o]), m = l(() => {
|
|
16
16
|
i?.onClick && i.onClick(), o();
|
|
17
17
|
}, [i, o]);
|
|
18
18
|
return [i, r].some(
|
|
19
|
-
(
|
|
20
|
-
) ? /* @__PURE__ */
|
|
21
|
-
|
|
19
|
+
(t) => !x.isEmpty(t)
|
|
20
|
+
) ? /* @__PURE__ */ d(
|
|
21
|
+
f,
|
|
22
22
|
{
|
|
23
23
|
display: "flex",
|
|
24
24
|
flexDirection: "column",
|
|
25
25
|
gap: 0.625,
|
|
26
|
+
id: "modal-footer",
|
|
26
27
|
position: "sticky",
|
|
27
28
|
px: 1.25,
|
|
28
29
|
py: 1.25,
|
|
29
30
|
children: [
|
|
30
31
|
p,
|
|
31
|
-
/* @__PURE__ */ e(C, { children: /* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ d("div", { children: [
|
|
32
33
|
r && /* @__PURE__ */ e(
|
|
33
|
-
|
|
34
|
+
s,
|
|
34
35
|
{
|
|
35
36
|
id: r.id,
|
|
36
37
|
onClick: h,
|
|
37
|
-
variant: "tertiary",
|
|
38
|
+
variant: i ? "tertiary" : "primary",
|
|
38
39
|
width: "100%",
|
|
39
40
|
children: r.text
|
|
40
41
|
}
|
|
41
42
|
),
|
|
42
43
|
i && /* @__PURE__ */ e(
|
|
43
|
-
|
|
44
|
+
s,
|
|
44
45
|
{
|
|
45
46
|
id: i.id,
|
|
46
|
-
onClick:
|
|
47
|
+
onClick: m,
|
|
47
48
|
variant: "primary",
|
|
48
49
|
width: "100%",
|
|
49
50
|
children: i.text
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IModalHeaderProps } from '../types';
|
|
2
|
-
declare const Header: ({ title, description, dismissable,
|
|
2
|
+
declare const Header: ({ title, description, dismissable, headerActions, modalRef, onClose, }: Readonly<IModalHeaderProps>) => JSX.Element;
|
|
3
3
|
export { Header };
|
|
@@ -1,67 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { l as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { Header as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { Heading as
|
|
8
|
-
import { Span as
|
|
9
|
-
import { Text as
|
|
10
|
-
const
|
|
11
|
-
title:
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { l as c } from "../../../_virtual/lodash.js";
|
|
3
|
+
import { useCallback as w, useEffect as u } from "react";
|
|
4
|
+
import { useTheme as k } from "styled-components";
|
|
5
|
+
import { Header as v, Title as x } from "../styles.js";
|
|
6
|
+
import { IconButton as f } from "../../icon-button/index.js";
|
|
7
|
+
import { Heading as E } from "../../typography/heading/index.js";
|
|
8
|
+
import { Span as T } from "../../typography/span/index.js";
|
|
9
|
+
import { Text as z } from "../../typography/text/index.js";
|
|
10
|
+
const N = ({
|
|
11
|
+
title: i,
|
|
12
12
|
description: e,
|
|
13
|
-
dismissable:
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
dismissable: n = !0,
|
|
14
|
+
headerActions: h,
|
|
15
|
+
modalRef: l,
|
|
16
16
|
onClose: d
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
d?.(),
|
|
20
|
-
}, [
|
|
21
|
-
return
|
|
22
|
-
if (!
|
|
18
|
+
const t = k(), a = w(() => {
|
|
19
|
+
d?.(), l.close();
|
|
20
|
+
}, [l, d]);
|
|
21
|
+
return u(() => {
|
|
22
|
+
if (!n) return () => {
|
|
23
23
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const o = (m) => {
|
|
25
|
+
m.key === "Escape" && a();
|
|
26
26
|
};
|
|
27
|
-
return window.addEventListener("keydown",
|
|
28
|
-
window.removeEventListener("keydown",
|
|
27
|
+
return window.addEventListener("keydown", o), () => {
|
|
28
|
+
window.removeEventListener("keydown", o);
|
|
29
29
|
};
|
|
30
|
-
}, [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
typeof
|
|
33
|
-
|
|
30
|
+
}, [n, a]), /* @__PURE__ */ s(v, { children: [
|
|
31
|
+
/* @__PURE__ */ s(x, { children: [
|
|
32
|
+
typeof i == "string" ? /* @__PURE__ */ r(
|
|
33
|
+
E,
|
|
34
34
|
{
|
|
35
35
|
fontWeight: "bold",
|
|
36
36
|
mr: 1,
|
|
37
37
|
size: "sm",
|
|
38
38
|
wordBreak: "break-word",
|
|
39
|
-
children:
|
|
39
|
+
children: i
|
|
40
40
|
}
|
|
41
|
-
) :
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
) : i,
|
|
42
|
+
/* @__PURE__ */ s("div", { className: "items-center flex gap-3", children: [
|
|
43
|
+
h?.filter(({ visible: o = !0 }) => o).map(({ icon: o, id: m, label: p, onClick: g, tooltip: y }) => /* @__PURE__ */ r(
|
|
44
|
+
f,
|
|
45
|
+
{
|
|
46
|
+
"aria-label": p,
|
|
47
|
+
icon: o,
|
|
48
|
+
iconColor: t.palette.gray[700],
|
|
49
|
+
iconSize: "sm",
|
|
50
|
+
iconType: "fa-light",
|
|
51
|
+
id: m,
|
|
52
|
+
onClick: g,
|
|
53
|
+
px: 0.25,
|
|
54
|
+
py: 0.25,
|
|
55
|
+
tooltip: y,
|
|
56
|
+
variant: "ghost",
|
|
57
|
+
width: t.spacing[1.25]
|
|
58
|
+
},
|
|
59
|
+
p
|
|
60
|
+
)),
|
|
61
|
+
n && /* @__PURE__ */ r(
|
|
62
|
+
f,
|
|
46
63
|
{
|
|
47
64
|
icon: "close",
|
|
48
|
-
iconColor:
|
|
49
|
-
iconSize: "
|
|
65
|
+
iconColor: t.palette.gray[700],
|
|
66
|
+
iconSize: "sm",
|
|
50
67
|
iconTransform: "grow-2",
|
|
51
68
|
iconType: "fa-light",
|
|
52
69
|
id: "modal-close",
|
|
53
|
-
onClick:
|
|
70
|
+
onClick: a,
|
|
54
71
|
px: 0.25,
|
|
55
72
|
py: 0.25,
|
|
56
|
-
variant: "ghost"
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
width: t.spacing[1.25]
|
|
57
75
|
}
|
|
58
76
|
)
|
|
59
77
|
] })
|
|
60
78
|
] }),
|
|
61
|
-
e &&
|
|
62
|
-
e && !
|
|
79
|
+
e && c.isString(e) && !c.isEmpty(e) ? /* @__PURE__ */ r(z, { mt: 0.5, size: "md", children: e }) : void 0,
|
|
80
|
+
e && !c.isString(e) && /* @__PURE__ */ r(T, { display: "block", mt: 0.5, size: "md", children: e })
|
|
63
81
|
] });
|
|
64
82
|
};
|
|
65
83
|
export {
|
|
66
|
-
|
|
84
|
+
N as Header
|
|
67
85
|
};
|
|
@@ -2,6 +2,6 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ModalFooter } from './footer';
|
|
3
3
|
import { ModalConfirm } from './modal-confirm';
|
|
4
4
|
import { IModalProps } from './types';
|
|
5
|
-
declare const Modal: ({ _portal, alert, cancelButton, children, confirmButton, content, description, dismissable,
|
|
5
|
+
declare const Modal: ({ _portal, alert, cancelButton, children, confirmButton, content, description, dismissable, headerActions, modalRef, onClose, tabItems, title, size, id, }: Readonly<PropsWithChildren<IModalProps>>) => JSX.Element | null;
|
|
6
6
|
export { Modal, ModalConfirm, ModalFooter };
|
|
7
7
|
export { ColumnsModal } from './columns-modal';
|
|
@@ -24,8 +24,8 @@ const oi = ({
|
|
|
24
24
|
content: i = void 0,
|
|
25
25
|
description: M = void 0,
|
|
26
26
|
dismissable: O = !0,
|
|
27
|
+
headerActions: T = void 0,
|
|
27
28
|
modalRef: e,
|
|
28
|
-
otherActions: T = void 0,
|
|
29
29
|
onClose: j = void 0,
|
|
30
30
|
tabItems: t = void 0,
|
|
31
31
|
title: s = void 0,
|
|
@@ -55,9 +55,9 @@ const oi = ({
|
|
|
55
55
|
{
|
|
56
56
|
description: M,
|
|
57
57
|
dismissable: O,
|
|
58
|
+
headerActions: T,
|
|
58
59
|
modalRef: e,
|
|
59
60
|
onClose: j,
|
|
60
|
-
otherActions: T,
|
|
61
61
|
title: s
|
|
62
62
|
}
|
|
63
63
|
),
|
|
@@ -2,14 +2,26 @@ import { Meta } from '@storybook/react-vite';
|
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { IModalProps } from './types';
|
|
4
4
|
declare const config: Meta;
|
|
5
|
-
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IModalProps & {
|
|
5
|
+
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
6
6
|
id: string;
|
|
7
|
-
}
|
|
8
|
-
declare const
|
|
7
|
+
}>>;
|
|
8
|
+
declare const WithForm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
9
|
+
id: string;
|
|
10
|
+
}>>;
|
|
11
|
+
declare const ScrollableContent: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
12
|
+
id: string;
|
|
13
|
+
}>>;
|
|
14
|
+
declare const SingleAction: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
9
15
|
id: string;
|
|
10
|
-
}
|
|
16
|
+
}>>;
|
|
17
|
+
declare const WithoutFooter: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
18
|
+
id: string;
|
|
19
|
+
}>>;
|
|
20
|
+
declare const ImageModal: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
21
|
+
id: string;
|
|
22
|
+
}>>;
|
|
11
23
|
declare const WithTabs: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
12
24
|
id: string;
|
|
13
25
|
}>>;
|
|
14
26
|
export default config;
|
|
15
|
-
export { Default, ImageModal, WithTabs };
|
|
27
|
+
export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled as a } from "styled-components";
|
|
2
|
-
import { variantBuilder as
|
|
2
|
+
import { variantBuilder as n } from "../@core/variants/utils.js";
|
|
3
3
|
import { Container as t } from "../container/index.js";
|
|
4
|
-
const { getVariant: r } =
|
|
4
|
+
const { getVariant: r } = n(
|
|
5
5
|
(i) => ({
|
|
6
6
|
fixed: `
|
|
7
7
|
height: auto;
|
|
@@ -31,7 +31,7 @@ const { getVariant: r } = o(
|
|
|
31
31
|
}
|
|
32
32
|
`
|
|
33
33
|
})
|
|
34
|
-
),
|
|
34
|
+
), l = a.div.attrs({
|
|
35
35
|
className: "comp-modal fixed inset-0 overflow-auto"
|
|
36
36
|
})`
|
|
37
37
|
align-items: center;
|
|
@@ -39,8 +39,8 @@ const { getVariant: r } = o(
|
|
|
39
39
|
display: flex;
|
|
40
40
|
justify-content: center;
|
|
41
41
|
z-index: 99999;
|
|
42
|
-
`,
|
|
43
|
-
${({ theme: i, $size:
|
|
42
|
+
`, c = a(t)`
|
|
43
|
+
${({ theme: i, $size: o }) => `
|
|
44
44
|
background-color: ${i.palette.white};
|
|
45
45
|
border: 1px solid ${i.palette.gray[200]};
|
|
46
46
|
border-radius: ${i.spacing[0.25]};
|
|
@@ -49,12 +49,16 @@ const { getVariant: r } = o(
|
|
|
49
49
|
font-family: ${i.typography.type.primary};
|
|
50
50
|
font-size: ${i.typography.text.md};
|
|
51
51
|
max-height: 80%;
|
|
52
|
-
min-height:
|
|
52
|
+
min-height: 32%;
|
|
53
53
|
box-shadow: ${i.shadows.lg};
|
|
54
54
|
margin: auto;
|
|
55
55
|
white-space: pre-line;
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
> #modal-footer {
|
|
58
|
+
margin-top: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
${r(i, o)}
|
|
58
62
|
`}
|
|
59
63
|
`, p = a.div`
|
|
60
64
|
${({ theme: i }) => `
|
|
@@ -62,6 +66,7 @@ const { getVariant: r } = o(
|
|
|
62
66
|
border-radius: 0 0 ${i.spacing[0.25]} ${i.spacing[0.25]};
|
|
63
67
|
display: flex;
|
|
64
68
|
flex-direction: column;
|
|
69
|
+
flex-grow: 1;
|
|
65
70
|
overflow: hidden auto;
|
|
66
71
|
padding: 0 ${i.spacing[1.5]} ${i.spacing[1.5]} ${i.spacing[1.5]};
|
|
67
72
|
scrollbar-color: ${i.palette.gray[600]} ${i.palette.gray[100]};
|
|
@@ -71,6 +76,10 @@ const { getVariant: r } = o(
|
|
|
71
76
|
flex-direction: unset;
|
|
72
77
|
overflow: hidden;
|
|
73
78
|
padding: 0;
|
|
79
|
+
|
|
80
|
+
> form > div {
|
|
81
|
+
flex-grow: 1;
|
|
82
|
+
}
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
&:has(#footer) {
|
|
@@ -95,9 +104,9 @@ const { getVariant: r } = o(
|
|
|
95
104
|
padding-bottom: ${({ theme: i }) => `${i.spacing[1.5]}`};
|
|
96
105
|
position: sticky;
|
|
97
106
|
z-index: 1;
|
|
98
|
-
`,
|
|
107
|
+
`, f = a.div.attrs({
|
|
99
108
|
className: "flex items-center justify-between"
|
|
100
|
-
})``,
|
|
109
|
+
})``, $ = a.div`
|
|
101
110
|
${({ theme: i }) => `
|
|
102
111
|
border-radius: 0 0 ${i.spacing[0.25]} ${i.spacing[0.25]};
|
|
103
112
|
display: flex;
|
|
@@ -146,11 +155,11 @@ const { getVariant: r } = o(
|
|
|
146
155
|
}
|
|
147
156
|
`;
|
|
148
157
|
export {
|
|
149
|
-
|
|
158
|
+
$ as Footer,
|
|
150
159
|
g as Header,
|
|
151
160
|
x as ImageContainer,
|
|
152
|
-
|
|
161
|
+
c as ModalContainer,
|
|
153
162
|
p as ModalContent,
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
l as ModalWrapper,
|
|
164
|
+
f as Title
|
|
156
165
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IIconModifiable } from '../@core/types';
|
|
1
2
|
import { ITabProps } from '../tabs/types';
|
|
2
3
|
import { IUseModal } from '../../hooks';
|
|
3
4
|
type TSize = "fixed" | "lg" | "md" | "sm";
|
|
@@ -35,20 +36,39 @@ interface IDialogProps {
|
|
|
35
36
|
id?: string;
|
|
36
37
|
label: string;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Modal header action props.
|
|
41
|
+
* @interface IModalHeaderAction
|
|
42
|
+
* @property { IconName } icon - The icon the button shows.
|
|
43
|
+
* @property { string } [id] - The id of the button.
|
|
44
|
+
* @property { string } label - The name screen readers announce for the button, unique among the actions.
|
|
45
|
+
* @property { Function } onClick - The function to call when the button is clicked.
|
|
46
|
+
* @property { string } [tooltip] - The text shown when hovering the button.
|
|
47
|
+
* @property { boolean } [visible] - Whether the button is shown. Defaults to true.
|
|
48
|
+
*/
|
|
49
|
+
interface IModalHeaderAction {
|
|
50
|
+
icon: IIconModifiable["icon"];
|
|
51
|
+
id?: string;
|
|
52
|
+
label: string;
|
|
53
|
+
onClick: () => void;
|
|
54
|
+
tooltip?: string;
|
|
55
|
+
visible?: boolean;
|
|
56
|
+
}
|
|
57
|
+
type TModalHeaderActions = readonly [IModalHeaderAction, IModalHeaderAction, IModalHeaderAction] | readonly [IModalHeaderAction, IModalHeaderAction] | readonly [IModalHeaderAction];
|
|
38
58
|
/**
|
|
39
59
|
* Modal header component props.
|
|
40
60
|
* @interface IModalHeaderProps
|
|
41
61
|
* @property { React.ReactNode | string } [description] - The description of the modal.
|
|
62
|
+
* @property { TModalHeaderActions } [headerActions] - Up to three buttons shown left of the close button.
|
|
42
63
|
* @property { IUseModal } [modalRef] - The modal reference.
|
|
43
|
-
* @property { React.ReactNode } [otherActions] - The other actions of the modal.
|
|
44
64
|
* @property { Function } [onClose] - The function to call when the modal is closed.
|
|
45
65
|
* @property { React.ReactNode | string } [title] - The title of the modal.
|
|
46
66
|
*/
|
|
47
67
|
interface IModalHeaderProps {
|
|
48
68
|
description?: React.ReactNode | string;
|
|
49
69
|
dismissable?: boolean;
|
|
70
|
+
headerActions?: TModalHeaderActions;
|
|
50
71
|
modalRef: IModalProps["modalRef"];
|
|
51
|
-
otherActions?: React.ReactNode;
|
|
52
72
|
onClose?: () => void;
|
|
53
73
|
title?: React.ReactNode | string;
|
|
54
74
|
}
|
|
@@ -102,4 +122,4 @@ interface IModalConfirmProps {
|
|
|
102
122
|
txtCancel?: string;
|
|
103
123
|
txtConfirm?: React.ReactNode | string;
|
|
104
124
|
}
|
|
105
|
-
export type { IDialogProps, IModalProps, IModalContent, IModalConfirmProps, IModalFooterProps, IModalHeaderProps, TSize, };
|
|
125
|
+
export type { IDialogProps, IModalHeaderAction, TModalHeaderActions, IModalProps, IModalContent, IModalConfirmProps, IModalFooterProps, IModalHeaderProps, TSize, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import x from "../../_virtual/capitalize.js";
|
|
3
3
|
import { Fragment as y } from "react";
|
|
4
4
|
import { useTheme as b } from "styled-components";
|
|
@@ -7,8 +7,10 @@ import { SeverityBadge as u } from "../severity-badge/index.js";
|
|
|
7
7
|
import { Tag as I } from "../tag/index.js";
|
|
8
8
|
import { Heading as w } from "../typography/heading/index.js";
|
|
9
9
|
import "../typography/span/index.js";
|
|
10
|
-
import { Text as
|
|
10
|
+
import { Text as l } from "../typography/text/index.js";
|
|
11
11
|
import { CardContainer as C, Divisor as z } from "../weaknesses-card/styles.js";
|
|
12
|
+
import "../../_virtual/dayjs.min.js";
|
|
13
|
+
import "../../_virtual/lodash.js";
|
|
12
14
|
import { safeUrl as v } from "../../utils/url.js";
|
|
13
15
|
const R = {
|
|
14
16
|
critical: "critical",
|
|
@@ -16,23 +18,23 @@ const R = {
|
|
|
16
18
|
low: "low",
|
|
17
19
|
medium: "medium",
|
|
18
20
|
none: "disable"
|
|
19
|
-
},
|
|
20
|
-
affectedVersions:
|
|
21
|
-
ecosystem:
|
|
22
|
-
href:
|
|
21
|
+
}, B = ({
|
|
22
|
+
affectedVersions: a,
|
|
23
|
+
ecosystem: p,
|
|
24
|
+
href: d,
|
|
23
25
|
indx: s,
|
|
24
26
|
packageName: m,
|
|
25
|
-
severity:
|
|
27
|
+
severity: o,
|
|
26
28
|
status: c,
|
|
27
29
|
Link: h
|
|
28
30
|
}) => {
|
|
29
|
-
const r = b(), n =
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ e(g, { href: v(
|
|
33
|
-
/* @__PURE__ */ e(I, { tagLabel:
|
|
31
|
+
const r = b(), n = o ? R[o.toLowerCase()] : void 0, g = h ?? "a", f = c === "vulnerable";
|
|
32
|
+
return /* @__PURE__ */ t(C, { $index: s, children: [
|
|
33
|
+
/* @__PURE__ */ t(i, { display: "flex", justify: "space-between", width: "100%", children: [
|
|
34
|
+
/* @__PURE__ */ e(g, { href: v(d), children: /* @__PURE__ */ e(i, { alignItems: "center", display: "flex", gap: 0.75, children: /* @__PURE__ */ e(w, { fontWeight: "bold", size: "sm", children: m }) }) }),
|
|
35
|
+
/* @__PURE__ */ e(I, { tagLabel: p })
|
|
34
36
|
] }),
|
|
35
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ t(
|
|
36
38
|
i,
|
|
37
39
|
{
|
|
38
40
|
alignItems: "center",
|
|
@@ -41,7 +43,7 @@ const R = {
|
|
|
41
43
|
width: "100%",
|
|
42
44
|
wrap: "wrap",
|
|
43
45
|
children: [
|
|
44
|
-
f ? /* @__PURE__ */
|
|
46
|
+
f ? /* @__PURE__ */ t(i, { alignItems: "center", display: "flex", children: [
|
|
45
47
|
/* @__PURE__ */ e(
|
|
46
48
|
i,
|
|
47
49
|
{
|
|
@@ -51,7 +53,7 @@ const R = {
|
|
|
51
53
|
borderRadius: "4px 0 0 4px",
|
|
52
54
|
display: "flex",
|
|
53
55
|
px: 0.25,
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
56
|
+
children: /* @__PURE__ */ e(l, { color: r.palette.primary[500], size: "md", children: "Vulnerable" })
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
59
|
/* @__PURE__ */ e(
|
|
@@ -62,7 +64,7 @@ const R = {
|
|
|
62
64
|
borderRadius: "0 4px 4px 0",
|
|
63
65
|
display: "flex",
|
|
64
66
|
px: 0.25,
|
|
65
|
-
children: /* @__PURE__ */ e(
|
|
67
|
+
children: /* @__PURE__ */ e(l, { color: r.palette.gray[800], size: "md", children: `${a} affected version${a === 1 ? "" : "s"}` })
|
|
66
68
|
}
|
|
67
69
|
)
|
|
68
70
|
] }) : /* @__PURE__ */ e(
|
|
@@ -73,14 +75,14 @@ const R = {
|
|
|
73
75
|
borderRadius: "4px",
|
|
74
76
|
display: "flex",
|
|
75
77
|
px: 0.25,
|
|
76
|
-
children: /* @__PURE__ */ e(
|
|
78
|
+
children: /* @__PURE__ */ e(l, { color: r.palette.success[500], size: "md", children: "Safe" })
|
|
77
79
|
}
|
|
78
80
|
),
|
|
79
|
-
|
|
81
|
+
o && /* @__PURE__ */ t(y, { children: [
|
|
80
82
|
/* @__PURE__ */ e(z, {}),
|
|
81
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ t(i, { alignItems: "center", display: "flex", gap: 0.5, children: [
|
|
82
84
|
/* @__PURE__ */ e(
|
|
83
|
-
|
|
85
|
+
l,
|
|
84
86
|
{
|
|
85
87
|
color: r.palette.gray[400],
|
|
86
88
|
fontWeight: "bold",
|
|
@@ -88,10 +90,10 @@ const R = {
|
|
|
88
90
|
children: "Max severity:"
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
|
-
n === void 0 ? /* @__PURE__ */ e(
|
|
93
|
+
n === void 0 ? /* @__PURE__ */ e(l, { color: r.palette.gray[400], size: "sm", children: "None" }) : /* @__PURE__ */ e(
|
|
92
94
|
u,
|
|
93
95
|
{
|
|
94
|
-
textR: x(
|
|
96
|
+
textR: x(o),
|
|
95
97
|
variant: n
|
|
96
98
|
}
|
|
97
99
|
)
|
|
@@ -103,5 +105,5 @@ const R = {
|
|
|
103
105
|
] });
|
|
104
106
|
};
|
|
105
107
|
export {
|
|
106
|
-
|
|
108
|
+
B as PackageCard
|
|
107
109
|
};
|
|
@@ -9,6 +9,8 @@ import { Heading as w } from "../typography/heading/index.js";
|
|
|
9
9
|
import "../typography/span/index.js";
|
|
10
10
|
import { Text as t } from "../typography/text/index.js";
|
|
11
11
|
import { CardContainer as E, Divisor as d } from "../weaknesses-card/styles.js";
|
|
12
|
+
import "../../_virtual/dayjs.min.js";
|
|
13
|
+
import "../../_virtual/lodash.js";
|
|
12
14
|
import { safeUrl as s } from "../../utils/url.js";
|
|
13
15
|
const N = {
|
|
14
16
|
md: {
|
|
@@ -21,7 +23,7 @@ const N = {
|
|
|
21
23
|
titleSize: "sm",
|
|
22
24
|
detailsSize: "lg"
|
|
23
25
|
}
|
|
24
|
-
},
|
|
26
|
+
}, Q = ({
|
|
25
27
|
technology: g,
|
|
26
28
|
technique: f,
|
|
27
29
|
cwes: y,
|
|
@@ -32,11 +34,11 @@ const N = {
|
|
|
32
34
|
target: u,
|
|
33
35
|
lastUpdated: p,
|
|
34
36
|
score: v,
|
|
35
|
-
size:
|
|
37
|
+
size: r = "lg",
|
|
36
38
|
severity: a,
|
|
37
39
|
title: C
|
|
38
40
|
}) => {
|
|
39
|
-
const
|
|
41
|
+
const l = j(), { methodIdSize: I, titleSize: D, detailsSize: o } = N[r], h = b ?? "a";
|
|
40
42
|
return /* @__PURE__ */ i(E, { $index: S, children: [
|
|
41
43
|
/* @__PURE__ */ i(
|
|
42
44
|
c,
|
|
@@ -50,7 +52,7 @@ const N = {
|
|
|
50
52
|
/* @__PURE__ */ e(
|
|
51
53
|
t,
|
|
52
54
|
{
|
|
53
|
-
color:
|
|
55
|
+
color: l.palette.gray[800],
|
|
54
56
|
display: "inline",
|
|
55
57
|
size: I,
|
|
56
58
|
children: z
|
|
@@ -65,9 +67,9 @@ const N = {
|
|
|
65
67
|
/* @__PURE__ */ i(
|
|
66
68
|
c,
|
|
67
69
|
{
|
|
68
|
-
alignItems:
|
|
70
|
+
alignItems: r === "md" ? "flex-start" : "center",
|
|
69
71
|
display: "flex",
|
|
70
|
-
flexDirection:
|
|
72
|
+
flexDirection: r === "md" ? "column" : "row",
|
|
71
73
|
gap: 0.75,
|
|
72
74
|
width: "fit-content",
|
|
73
75
|
children: [
|
|
@@ -80,11 +82,11 @@ const N = {
|
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
84
|
/* @__PURE__ */ i(n, { children: [
|
|
83
|
-
|
|
85
|
+
r === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
84
86
|
/* @__PURE__ */ i(
|
|
85
87
|
t,
|
|
86
88
|
{
|
|
87
|
-
color:
|
|
89
|
+
color: l.palette.gray[400],
|
|
88
90
|
display: "inline",
|
|
89
91
|
size: o,
|
|
90
92
|
children: [
|
|
@@ -95,11 +97,11 @@ const N = {
|
|
|
95
97
|
)
|
|
96
98
|
] }),
|
|
97
99
|
/* @__PURE__ */ i(n, { children: [
|
|
98
|
-
|
|
100
|
+
r === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
99
101
|
/* @__PURE__ */ i(
|
|
100
102
|
t,
|
|
101
103
|
{
|
|
102
|
-
color:
|
|
104
|
+
color: l.palette.gray[400],
|
|
103
105
|
display: "inline",
|
|
104
106
|
size: o,
|
|
105
107
|
children: [
|
|
@@ -110,11 +112,11 @@ const N = {
|
|
|
110
112
|
)
|
|
111
113
|
] }),
|
|
112
114
|
/* @__PURE__ */ i(n, { children: [
|
|
113
|
-
|
|
115
|
+
r === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
114
116
|
/* @__PURE__ */ e(
|
|
115
117
|
t,
|
|
116
118
|
{
|
|
117
|
-
color:
|
|
119
|
+
color: l.palette.gray[400],
|
|
118
120
|
display: "inline",
|
|
119
121
|
fontWeight: "bold",
|
|
120
122
|
size: o,
|
|
@@ -125,7 +127,7 @@ const N = {
|
|
|
125
127
|
T > 0 ? /* @__PURE__ */ e(
|
|
126
128
|
t,
|
|
127
129
|
{
|
|
128
|
-
color:
|
|
130
|
+
color: l.palette.gray[400],
|
|
129
131
|
display: "inline",
|
|
130
132
|
size: o,
|
|
131
133
|
children: " , "
|
|
@@ -134,7 +136,7 @@ const N = {
|
|
|
134
136
|
/* @__PURE__ */ e(h, { href: s(m.href), children: /* @__PURE__ */ e(
|
|
135
137
|
t,
|
|
136
138
|
{
|
|
137
|
-
color:
|
|
139
|
+
color: l.palette.gray[400],
|
|
138
140
|
display: "inline",
|
|
139
141
|
size: o,
|
|
140
142
|
textDecoration: "underline",
|
|
@@ -144,11 +146,11 @@ const N = {
|
|
|
144
146
|
] }, m.key))
|
|
145
147
|
] }),
|
|
146
148
|
p ? /* @__PURE__ */ i(n, { children: [
|
|
147
|
-
|
|
149
|
+
r === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
148
150
|
/* @__PURE__ */ i(
|
|
149
151
|
t,
|
|
150
152
|
{
|
|
151
|
-
color:
|
|
153
|
+
color: l.palette.gray[400],
|
|
152
154
|
display: "inline",
|
|
153
155
|
size: o,
|
|
154
156
|
children: [
|
|
@@ -164,5 +166,5 @@ const N = {
|
|
|
164
166
|
] });
|
|
165
167
|
};
|
|
166
168
|
export {
|
|
167
|
-
|
|
169
|
+
Q as RulesCard
|
|
168
170
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { StyledContainer as
|
|
2
|
+
import { StyledContainer as s, StyledIndicatorPill as d } from "./styles.js";
|
|
3
3
|
import { variantColors as h } from "./utils.js";
|
|
4
|
-
import { theme as
|
|
4
|
+
import { theme as p } from "../colors/index.js";
|
|
5
5
|
import { Link as y } from "../link/index.js";
|
|
6
6
|
import "../typography/heading/index.js";
|
|
7
7
|
import "../typography/span/index.js";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { Text as a } from "../typography/text/index.js";
|
|
9
|
+
import "../../_virtual/dayjs.min.js";
|
|
10
|
+
import "../../_virtual/lodash.js";
|
|
9
11
|
import { safeUrl as v } from "../../utils/url.js";
|
|
10
|
-
const
|
|
12
|
+
const P = ({
|
|
11
13
|
number: e,
|
|
12
14
|
text: n,
|
|
13
15
|
link: r,
|
|
14
16
|
variant: f
|
|
15
17
|
}) => {
|
|
16
|
-
const l = h[f], i = r && v(r) === r ? r : void 0, c = i ? "inherit" :
|
|
18
|
+
const l = h[f], i = r && v(r) === r ? r : void 0, c = i ? "inherit" : p.palette.gray[500], m = /* @__PURE__ */ t(
|
|
17
19
|
"span",
|
|
18
20
|
{
|
|
19
21
|
style: {
|
|
@@ -23,7 +25,7 @@ const u = ({
|
|
|
23
25
|
},
|
|
24
26
|
children: [
|
|
25
27
|
e !== void 0 ? /* @__PURE__ */ o(
|
|
26
|
-
|
|
28
|
+
a,
|
|
27
29
|
{
|
|
28
30
|
color: c,
|
|
29
31
|
display: "inline",
|
|
@@ -32,18 +34,18 @@ const u = ({
|
|
|
32
34
|
children: e
|
|
33
35
|
}
|
|
34
36
|
) : void 0,
|
|
35
|
-
n ? /* @__PURE__ */ o(
|
|
37
|
+
n ? /* @__PURE__ */ o(a, { color: c, display: "inline", size: "sm", children: n }) : void 0
|
|
36
38
|
]
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
|
-
return i ? /* @__PURE__ */ t(
|
|
40
|
-
/* @__PURE__ */ o(
|
|
41
|
-
/* @__PURE__ */ o(y, { color:
|
|
42
|
-
] }) : /* @__PURE__ */ t(
|
|
43
|
-
/* @__PURE__ */ o(
|
|
44
|
-
|
|
41
|
+
return i ? /* @__PURE__ */ t(s, { children: [
|
|
42
|
+
/* @__PURE__ */ o(d, { $color: l }),
|
|
43
|
+
/* @__PURE__ */ o(y, { color: p.palette.gray[500], href: i, children: m })
|
|
44
|
+
] }) : /* @__PURE__ */ t(s, { children: [
|
|
45
|
+
/* @__PURE__ */ o(d, { $color: l }),
|
|
46
|
+
m
|
|
45
47
|
] });
|
|
46
48
|
};
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
P as SeverityIndicator
|
|
49
51
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import g from "../../../_virtual/isNil.js";
|
|
3
3
|
import { useMemo as l, useCallback as c } from "react";
|
|
4
4
|
import { Button as f } from "../../button/index.js";
|
|
@@ -6,6 +6,7 @@ import "../../../_virtual/lodash.js";
|
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "styled-components";
|
|
8
8
|
import { useColumnsModal as b } from "../../../hooks/use-columns-modal.js";
|
|
9
|
+
import "nuqs";
|
|
9
10
|
import "../../container/index.js";
|
|
10
11
|
import "../../icon-button/index.js";
|
|
11
12
|
import "../../typography/heading/index.js";
|
|
@@ -16,7 +17,7 @@ import "react-router";
|
|
|
16
17
|
import "../../notification-sign/index.js";
|
|
17
18
|
import "../../icon/index.js";
|
|
18
19
|
import { ColumnsModal as C } from "../../modal/columns-modal/index.js";
|
|
19
|
-
const
|
|
20
|
+
const N = (s) => {
|
|
20
21
|
const { table: t } = s, { meta: m } = t.options, [, n] = t.getHeaderGroups(), a = t.getVisibleLeafColumns().filter((o) => o.id !== "selection").length, i = l(
|
|
21
22
|
() => t.getAllLeafColumns().filter((o) => o.id !== "selection"),
|
|
22
23
|
[t]
|
|
@@ -33,16 +34,16 @@ const G = (s) => {
|
|
|
33
34
|
name: "table-column-management",
|
|
34
35
|
setColumnOrder: t.setColumnOrder,
|
|
35
36
|
setColumnVisibility: t.setColumnVisibility
|
|
36
|
-
}),
|
|
37
|
+
}), p = c(() => {
|
|
37
38
|
e.toggle();
|
|
38
39
|
}, [e]);
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ u("div", { id: "columns-filter", children: [
|
|
40
41
|
/* @__PURE__ */ r(
|
|
41
42
|
f,
|
|
42
43
|
{
|
|
43
44
|
icon: "columns",
|
|
44
45
|
id: "columns-toggle-btn",
|
|
45
|
-
onClick:
|
|
46
|
+
onClick: p,
|
|
46
47
|
tag: a.toString(),
|
|
47
48
|
variant: "ghost"
|
|
48
49
|
}
|
|
@@ -58,5 +59,5 @@ const G = (s) => {
|
|
|
58
59
|
] });
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
N as ColumnToggle
|
|
62
63
|
};
|
|
@@ -2,15 +2,17 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as l, useState as x, useCallback as m } from "react";
|
|
3
3
|
import { TableContext as z } from "../context/index.js";
|
|
4
4
|
import { TableContainer as y } from "../styles.js";
|
|
5
|
+
import "../../../_virtual/lodash.js";
|
|
6
|
+
import "nuqs";
|
|
5
7
|
import { useMountEffect as u } from "../../../hooks/use-mount-effect.js";
|
|
6
8
|
const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
7
9
|
const { paddingLeft: e, paddingRight: n } = getComputedStyle(t);
|
|
8
10
|
return t.clientWidth - f(e) - f(n);
|
|
9
|
-
},
|
|
11
|
+
}, j = ({
|
|
10
12
|
children: t,
|
|
11
13
|
table: e
|
|
12
14
|
}) => {
|
|
13
|
-
const n = l(null), p = l(null), { id: h } = e.options.meta ?? {}, { enableMultiRowSelection: S } = e?.options ?? {},
|
|
15
|
+
const n = l(null), p = l(null), { id: h } = e.options.meta ?? {}, { enableMultiRowSelection: S } = e?.options ?? {}, i = Object.keys(e.getState().rowSelection).length, w = i === 1 ? "item" : "items", g = i === 0 || !S, [v, R] = x(0);
|
|
14
16
|
u(() => {
|
|
15
17
|
const o = () => {
|
|
16
18
|
const r = n.current ? E(n.current) : 0;
|
|
@@ -33,13 +35,13 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
33
35
|
const T = Math.max(
|
|
34
36
|
v,
|
|
35
37
|
e.getTotalSize() + C
|
|
36
|
-
),
|
|
38
|
+
), s = m(() => {
|
|
37
39
|
e.resetRowSelection();
|
|
38
40
|
}, [e]), b = m(
|
|
39
41
|
(o) => {
|
|
40
|
-
o.key === "Enter" &&
|
|
42
|
+
o.key === "Enter" && s();
|
|
41
43
|
},
|
|
42
|
-
[
|
|
44
|
+
[s]
|
|
43
45
|
);
|
|
44
46
|
return u(() => {
|
|
45
47
|
e.setPageIndex(0);
|
|
@@ -49,10 +51,10 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
49
51
|
value: {
|
|
50
52
|
containerRef: n,
|
|
51
53
|
elementName: w,
|
|
52
|
-
handleUnselectAll:
|
|
54
|
+
handleUnselectAll: s,
|
|
53
55
|
hidden: g,
|
|
54
56
|
onKeyDown: b,
|
|
55
|
-
selected:
|
|
57
|
+
selected: i,
|
|
56
58
|
tableSize: T,
|
|
57
59
|
tableRef: p,
|
|
58
60
|
table: e
|
|
@@ -62,5 +64,5 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
62
64
|
);
|
|
63
65
|
};
|
|
64
66
|
export {
|
|
65
|
-
|
|
67
|
+
j as Table
|
|
66
68
|
};
|
|
@@ -8,6 +8,8 @@ import { SeverityBadge as w } from "../severity-badge/index.js";
|
|
|
8
8
|
import { Heading as c } from "../typography/heading/index.js";
|
|
9
9
|
import "../typography/span/index.js";
|
|
10
10
|
import { Text as l } from "../typography/text/index.js";
|
|
11
|
+
import "../../_virtual/dayjs.min.js";
|
|
12
|
+
import "../../_virtual/lodash.js";
|
|
11
13
|
import { safeUrl as p } from "../../utils/url.js";
|
|
12
14
|
const G = {
|
|
13
15
|
md: {
|
|
@@ -22,7 +24,7 @@ const G = {
|
|
|
22
24
|
descriptionSize: "lg",
|
|
23
25
|
detailsSize: "lg"
|
|
24
26
|
}
|
|
25
|
-
},
|
|
27
|
+
}, K = ({
|
|
26
28
|
title: g,
|
|
27
29
|
href: h,
|
|
28
30
|
description: f,
|
|
@@ -165,5 +167,5 @@ const G = {
|
|
|
165
167
|
] });
|
|
166
168
|
};
|
|
167
169
|
export {
|
|
168
|
-
|
|
170
|
+
K as WeaknessesCard
|
|
169
171
|
};
|
package/dist/hooks/use-search.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useState as a } from "react";
|
|
2
2
|
import { useDebouncedCallback as s } from "./use-debounced-callback.js";
|
|
3
|
+
import "nuqs";
|
|
3
4
|
const S = (e) => {
|
|
4
|
-
const [t,
|
|
5
|
-
c
|
|
5
|
+
const [t, o] = a(), r = s((c) => {
|
|
6
|
+
o(c);
|
|
6
7
|
}, e?.debounceWait ?? 300);
|
|
7
|
-
return [t,
|
|
8
|
+
return [t, r];
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
11
|
S as useSearch
|
package/package.json
CHANGED