@fluidattacks/design 10.0.0 → 10.1.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 +2 -4
- package/dist/components/carousel/index.js +10 -12
- package/dist/components/cloud-image/index.js +8 -10
- package/dist/components/conditions-dialog/index.js +21 -23
- package/dist/components/confirm-dialog/index.js +7 -9
- package/dist/components/filters/utils.js +22 -22
- package/dist/components/form/index.js +26 -26
- package/dist/components/form/styles.d.ts +6 -1
- package/dist/components/form/styles.js +11 -5
- package/dist/components/item-card-db/index.js +8 -10
- package/dist/components/list-item/styles.js +2 -0
- package/dist/components/modal/dialog/index.js +6 -8
- package/dist/components/modal/index.stories.d.ts +3 -2
- package/dist/components/package-card/index.js +23 -25
- package/dist/components/rules-card/index.js +17 -19
- package/dist/components/severity-indicator/index.js +14 -16
- package/dist/components/table/styles.js +1 -1
- package/dist/components/table/table-column-toggle/index.js +6 -7
- package/dist/components/table/wrapper/index.js +8 -10
- package/dist/components/weaknesses-card/index.js +2 -4
- package/dist/hooks/use-search.js +3 -4
- package/package.json +5 -5
|
@@ -8,10 +8,8 @@ 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";
|
|
13
11
|
import { safeUrl as A } from "../../utils/url.js";
|
|
14
|
-
const
|
|
12
|
+
const W = ({
|
|
15
13
|
author: g,
|
|
16
14
|
creator: p,
|
|
17
15
|
cwes: d,
|
|
@@ -149,5 +147,5 @@ const G = ({
|
|
|
149
147
|
] });
|
|
150
148
|
};
|
|
151
149
|
export {
|
|
152
|
-
|
|
150
|
+
W as AdvisoriesCard
|
|
153
151
|
};
|
|
@@ -1,21 +1,19 @@
|
|
|
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 C, CarouselWrapper as m, CarouselSlide as d, NavContainer as v, NavButton as h } from "./styles.js";
|
|
4
4
|
import { useCarousel as k } from "../../hooks/use-carousel.js";
|
|
5
|
-
|
|
6
|
-
import "nuqs";
|
|
7
|
-
const j = ({
|
|
5
|
+
const N = ({
|
|
8
6
|
slides: a,
|
|
9
7
|
interval: c = 300
|
|
10
8
|
}) => {
|
|
11
|
-
const { cycle:
|
|
9
|
+
const { cycle: l, setCycle: n, setProgress: i } = k(c, a.length), s = p(
|
|
12
10
|
(e) => () => {
|
|
13
|
-
|
|
11
|
+
n(e), i(0);
|
|
14
12
|
},
|
|
15
|
-
[
|
|
13
|
+
[n, i]
|
|
16
14
|
);
|
|
17
|
-
return /* @__PURE__ */ u(
|
|
18
|
-
/* @__PURE__ */ o(
|
|
15
|
+
return /* @__PURE__ */ u(C, { "aria-roledescription": "carousel", children: [
|
|
16
|
+
/* @__PURE__ */ o(m, { $currentIndex: l, children: a.map((e, r) => {
|
|
19
17
|
const t = `slide-${r}`;
|
|
20
18
|
return /* @__PURE__ */ o(
|
|
21
19
|
d,
|
|
@@ -32,9 +30,9 @@ const j = ({
|
|
|
32
30
|
return /* @__PURE__ */ o(
|
|
33
31
|
h,
|
|
34
32
|
{
|
|
35
|
-
$isActive: r ===
|
|
33
|
+
$isActive: r === l,
|
|
36
34
|
"aria-label": `Go to slide ${r + 1}`,
|
|
37
|
-
"data-testid": r ===
|
|
35
|
+
"data-testid": r === l ? "active" : "inactive",
|
|
38
36
|
onClick: s(r)
|
|
39
37
|
},
|
|
40
38
|
t
|
|
@@ -43,5 +41,5 @@ const j = ({
|
|
|
43
41
|
] });
|
|
44
42
|
};
|
|
45
43
|
export {
|
|
46
|
-
|
|
44
|
+
N as Carousel
|
|
47
45
|
};
|
|
@@ -1,18 +1,16 @@
|
|
|
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
|
-
|
|
6
|
-
import "nuqs";
|
|
7
|
-
const n = ({
|
|
2
|
+
import { AdvancedImage as l, lazyload as g, placeholder as c } from "../../node_modules/@cloudinary/react/dist/index.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { useCloudinaryImage as n } from "../../hooks/use-cloudinary-image.js";
|
|
5
|
+
const p = ({
|
|
8
6
|
alt: e = "img",
|
|
9
7
|
height: a = "",
|
|
10
8
|
width: r = "",
|
|
11
9
|
transformation: m,
|
|
12
|
-
plugins: d = [g(),
|
|
10
|
+
plugins: d = [g(), c()],
|
|
13
11
|
publicId: t
|
|
14
12
|
}) => {
|
|
15
|
-
const o =
|
|
13
|
+
const o = n({ publicId: t });
|
|
16
14
|
return m && o.addTransformation(m), /* @__PURE__ */ i(
|
|
17
15
|
l,
|
|
18
16
|
{
|
|
@@ -23,7 +21,7 @@ const n = ({
|
|
|
23
21
|
width: r
|
|
24
22
|
}
|
|
25
23
|
);
|
|
26
|
-
},
|
|
24
|
+
}, x = f.memo(p);
|
|
27
25
|
export {
|
|
28
|
-
|
|
26
|
+
x as CloudImage
|
|
29
27
|
};
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as h, 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";
|
|
8
6
|
import { useModal as v } from "../../hooks/use-modal.js";
|
|
9
7
|
import { ModalConfirm as R } from "../modal/modal-confirm/index.js";
|
|
10
8
|
const S = ({
|
|
11
9
|
children: a,
|
|
12
|
-
conditions:
|
|
10
|
+
conditions: t,
|
|
13
11
|
id: c,
|
|
14
12
|
modalRef: s,
|
|
15
13
|
onConfirm: m,
|
|
16
14
|
title: d
|
|
17
15
|
}) => {
|
|
18
|
-
const [
|
|
19
|
-
i({ ...
|
|
20
|
-
}, [
|
|
16
|
+
const [n, i] = k(t), f = r(() => {
|
|
17
|
+
i({ ...t });
|
|
18
|
+
}, [t]), u = r((o) => () => {
|
|
21
19
|
i((e) => ({
|
|
22
20
|
...e,
|
|
23
21
|
[o]: { ...e[o], state: !e[o].state }
|
|
24
22
|
}));
|
|
25
|
-
}, []), l = !Object.values(
|
|
23
|
+
}, []), l = !Object.values(n).every(
|
|
26
24
|
({ state: o }) => o
|
|
27
|
-
),
|
|
28
|
-
([o, { state: e, label: C }]) => /* @__PURE__ */
|
|
25
|
+
), p = Object.entries(n).map(
|
|
26
|
+
([o, { state: e, label: C }]) => /* @__PURE__ */ h(
|
|
29
27
|
M,
|
|
30
28
|
{
|
|
31
29
|
defaultChecked: e,
|
|
@@ -47,17 +45,17 @@ const S = ({
|
|
|
47
45
|
title: d,
|
|
48
46
|
children: [
|
|
49
47
|
a,
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ h(O, { display: "flex", flexDirection: "column", gap: 0.5, children: p }),
|
|
49
|
+
/* @__PURE__ */ h(R, { disabled: l, id: c, onConfirm: m })
|
|
52
50
|
]
|
|
53
51
|
}
|
|
54
52
|
);
|
|
55
|
-
},
|
|
56
|
-
const { close: s, isOpen: m, name: d, open:
|
|
53
|
+
}, E = (a, t, c) => {
|
|
54
|
+
const { close: s, isOpen: m, name: d, open: n, setIsOpen: i, toggle: f } = v(
|
|
57
55
|
"confirm-dialog-modal"
|
|
58
|
-
), [u] = k(c), l = j(null),
|
|
56
|
+
), [u] = k(c), l = j(null), p = r(async () => (n(), new Promise((g) => {
|
|
59
57
|
l.current = g;
|
|
60
|
-
})), [
|
|
58
|
+
})), [n]), o = r(() => {
|
|
61
59
|
s(), l.current?.(!0);
|
|
62
60
|
}, [s]), e = r(() => {
|
|
63
61
|
s(), l.current?.(!1);
|
|
@@ -66,27 +64,27 @@ const S = ({
|
|
|
66
64
|
close: e,
|
|
67
65
|
isOpen: m,
|
|
68
66
|
name: d,
|
|
69
|
-
open:
|
|
67
|
+
open: n,
|
|
70
68
|
setIsOpen: i,
|
|
71
69
|
toggle: f
|
|
72
70
|
}),
|
|
73
|
-
[e, m, d,
|
|
71
|
+
[e, m, d, n, i, f]
|
|
74
72
|
), b = r(
|
|
75
|
-
({ children: g }) => /* @__PURE__ */
|
|
73
|
+
({ children: g }) => /* @__PURE__ */ h(
|
|
76
74
|
S,
|
|
77
75
|
{
|
|
78
76
|
conditions: u,
|
|
79
77
|
id: a,
|
|
80
78
|
modalRef: C,
|
|
81
79
|
onConfirm: o,
|
|
82
|
-
title:
|
|
80
|
+
title: t,
|
|
83
81
|
children: g
|
|
84
82
|
}
|
|
85
83
|
),
|
|
86
|
-
[o, a, u, C,
|
|
84
|
+
[o, a, u, C, t]
|
|
87
85
|
);
|
|
88
|
-
return [
|
|
86
|
+
return [p, b];
|
|
89
87
|
};
|
|
90
88
|
export {
|
|
91
|
-
|
|
89
|
+
E as useConditionsDialog
|
|
92
90
|
};
|
|
@@ -1,25 +1,23 @@
|
|
|
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";
|
|
6
4
|
import { useModal as g } from "../../hooks/use-modal.js";
|
|
7
|
-
const
|
|
8
|
-
const [o, n] = u(), r = C(null), c = g("confirm-dialog-modal"), { close: e, open: s } = c,
|
|
5
|
+
const M = () => {
|
|
6
|
+
const [o, n] = u(), r = C(null), c = g("confirm-dialog-modal"), { close: e, open: s } = c, m = l(
|
|
9
7
|
async (i) => (n(i), s(), new Promise((t) => {
|
|
10
8
|
r.current = t;
|
|
11
9
|
})),
|
|
12
10
|
[s]
|
|
13
11
|
), d = l(() => {
|
|
14
12
|
e(), n(void 0), r.current?.(!0);
|
|
15
|
-
}, [e]),
|
|
13
|
+
}, [e]), a = l(() => {
|
|
16
14
|
e(), n(void 0), r.current?.(!1);
|
|
17
15
|
}, [e]);
|
|
18
16
|
return { ConfirmDialog: ({ id: i = "confirm-dialog-modal", children: t }) => /* @__PURE__ */ f(
|
|
19
17
|
p,
|
|
20
18
|
{
|
|
21
19
|
cancelButton: o?.showCancel === !0 || o?.showCancel === void 0 ? {
|
|
22
|
-
onClick:
|
|
20
|
+
onClick: a,
|
|
23
21
|
text: o?.cancelText ?? "Cancel"
|
|
24
22
|
} : void 0,
|
|
25
23
|
confirmButton: o?.showConfirm === !0 || o?.showConfirm === void 0 ? {
|
|
@@ -29,7 +27,7 @@ const P = () => {
|
|
|
29
27
|
} : void 0,
|
|
30
28
|
description: o?.message,
|
|
31
29
|
id: i,
|
|
32
|
-
modalRef: { ...c, close:
|
|
30
|
+
modalRef: { ...c, close: a },
|
|
33
31
|
size: o?.modalSize ?? "sm",
|
|
34
32
|
title: o?.title,
|
|
35
33
|
children: [
|
|
@@ -37,8 +35,8 @@ const P = () => {
|
|
|
37
35
|
t
|
|
38
36
|
]
|
|
39
37
|
}
|
|
40
|
-
), confirm:
|
|
38
|
+
), confirm: m };
|
|
41
39
|
};
|
|
42
40
|
export {
|
|
43
|
-
|
|
41
|
+
M as useConfirmDialog
|
|
44
42
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = 7, g = (n) => n.reduce(
|
|
2
2
|
(e, t) => t.type === "toggle" ? { ...e, inline: [...e.inline, t] } : t.type === "select" ? { ...e, pinned: [...e.pinned, t] } : { ...e, menu: [...e.menu, t] },
|
|
3
3
|
{ menu: [], inline: [], pinned: [] }
|
|
4
|
-
),
|
|
4
|
+
), m = (n) => n.reduce(
|
|
5
5
|
(e, t) => (t.group ? (e[t.group] || (e[t.group] = []), e[t.group].push(t)) : e.default = [...e.default || [], t], e),
|
|
6
6
|
{}
|
|
7
|
-
)
|
|
8
|
-
|
|
7
|
+
);
|
|
8
|
+
const i = (n, e) => n.value === "" ? 0 : e.includes(n.value) ? 1 : 2, b = (n, e, t) => {
|
|
9
|
+
const s = n.find((r) => r.id === e), o = s?.hideMenuTitle ?? !1;
|
|
9
10
|
if (!s || !t)
|
|
10
11
|
return {
|
|
11
|
-
hideMenuTitle:
|
|
12
|
+
hideMenuTitle: o,
|
|
12
13
|
label: s?.label ?? "",
|
|
13
14
|
options: s?.options ?? []
|
|
14
15
|
};
|
|
15
|
-
const
|
|
16
|
+
const u = t.split(","), l = s.options?.map((r) => {
|
|
16
17
|
if (!r.items) return r;
|
|
17
|
-
const d = [...r.items].sort(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
18
|
+
const d = [...r.items].sort(
|
|
19
|
+
(p, L) => i(p, u) - i(L, u)
|
|
20
|
+
);
|
|
21
21
|
return { ...r, items: d };
|
|
22
22
|
});
|
|
23
|
-
return { hideMenuTitle:
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
(
|
|
23
|
+
return { hideMenuTitle: o, label: s.label, options: l };
|
|
24
|
+
}, c = (n, e) => Object.entries(n).map(([t, s]) => {
|
|
25
|
+
const o = s.filter(
|
|
26
|
+
(u) => !u.hide && u.label.toLowerCase().includes(e.toLowerCase())
|
|
27
27
|
);
|
|
28
|
-
return
|
|
29
|
-
}).filter((t) => t !== void 0),
|
|
28
|
+
return o.length > 0 ? { group: t, filters: o } : void 0;
|
|
29
|
+
}).filter((t) => t !== void 0), h = (n, e) => n.value.toLowerCase().includes(e) || (n.label ?? "").toLowerCase().includes(e) || (n.searchTerms ?? []).some(
|
|
30
30
|
(t) => t.toLowerCase().includes(e)
|
|
31
31
|
);
|
|
32
32
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
a as MAX_FILTERS_LENGTH,
|
|
34
|
+
c as filterMenu,
|
|
35
|
+
m as getGroupedFilters,
|
|
36
|
+
b as getSelectedFilter,
|
|
37
|
+
h as matchesQuery,
|
|
38
|
+
g as partitionFilters
|
|
39
39
|
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { yupResolver as S } from "../../node_modules/@hookform/resolvers/yup/dist/yup.js";
|
|
3
3
|
import { useForm as j, FormProvider as k } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
4
|
-
import { Controller as
|
|
4
|
+
import { Controller as J, useController as K, useFieldArray as L, useFormContext as M, useWatch as N } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
5
5
|
import { useTheme as D } from "styled-components";
|
|
6
|
-
import { InnerForm as
|
|
7
|
-
import { StyledForm as P } from "./styles.js";
|
|
6
|
+
import { InnerForm as U } from "./inner-form/index.js";
|
|
7
|
+
import { StyledForm as P, FormContent as R } from "./styles.js";
|
|
8
8
|
import { Button as h } from "../button/index.js";
|
|
9
|
-
import { Container as
|
|
10
|
-
const
|
|
9
|
+
import { Container as l } from "../container/index.js";
|
|
10
|
+
const A = ({
|
|
11
11
|
alert: n,
|
|
12
12
|
buttonAlignment: a,
|
|
13
13
|
cancelButton: o,
|
|
14
14
|
children: u,
|
|
15
|
-
confirmButton:
|
|
15
|
+
confirmButton: t,
|
|
16
16
|
defaultDisabled: x = !0,
|
|
17
17
|
id: d = "modal-confirm",
|
|
18
18
|
maxButtonWidth: y = "392px",
|
|
19
19
|
mode: b,
|
|
20
20
|
onSubmit: g,
|
|
21
21
|
padding: C = !0,
|
|
22
|
-
showButtons:
|
|
23
|
-
yupSchema:
|
|
22
|
+
showButtons: m = !0,
|
|
23
|
+
yupSchema: p,
|
|
24
24
|
...F
|
|
25
25
|
}) => {
|
|
26
26
|
const e = D(), i = j({
|
|
27
27
|
...F,
|
|
28
28
|
mode: b ?? "all",
|
|
29
|
-
resolver:
|
|
29
|
+
resolver: p ? S(p) : void 0
|
|
30
30
|
});
|
|
31
31
|
function $(f) {
|
|
32
32
|
f.stopPropagation(), i.handleSubmit(g)(f);
|
|
33
33
|
}
|
|
34
|
-
const v =
|
|
35
|
-
return /* @__PURE__ */ r(k, { ...i, children: /* @__PURE__ */ r(P, { onSubmit: $, children: /* @__PURE__ */ l
|
|
34
|
+
const v = m ? `calc(100% - ${n ? "139px" : "83px"})` : "100%", c = C ? 1.5 : 0;
|
|
35
|
+
return /* @__PURE__ */ r(k, { ...i, children: /* @__PURE__ */ r(P, { onSubmit: $, children: /* @__PURE__ */ s(l, { scroll: "y", width: "100%", children: [
|
|
36
36
|
/* @__PURE__ */ r(
|
|
37
|
-
|
|
37
|
+
R,
|
|
38
38
|
{
|
|
39
39
|
borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
|
|
40
40
|
display: "flex",
|
|
@@ -48,8 +48,8 @@ const z = ({
|
|
|
48
48
|
children: u
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
m && /* @__PURE__ */ s(
|
|
52
|
+
l,
|
|
53
53
|
{
|
|
54
54
|
borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
|
|
55
55
|
borderTop: `1px solid ${e.palette.gray[200]}`,
|
|
@@ -62,7 +62,7 @@ const z = ({
|
|
|
62
62
|
py: 1.25,
|
|
63
63
|
children: [
|
|
64
64
|
n,
|
|
65
|
-
/* @__PURE__ */ l
|
|
65
|
+
/* @__PURE__ */ s(l, { display: "flex", gap: 0.75, maxWidth: y, children: [
|
|
66
66
|
o ? /* @__PURE__ */ r(
|
|
67
67
|
h,
|
|
68
68
|
{
|
|
@@ -79,13 +79,13 @@ const z = ({
|
|
|
79
79
|
/* @__PURE__ */ r(
|
|
80
80
|
h,
|
|
81
81
|
{
|
|
82
|
-
disabled: (
|
|
83
|
-
icon:
|
|
82
|
+
disabled: (t?.disabled ?? !1) || i.formState.isSubmitting || x && !i.formState.isDirty,
|
|
83
|
+
icon: t?.icon,
|
|
84
84
|
id: d,
|
|
85
85
|
justify: "center",
|
|
86
86
|
type: "submit",
|
|
87
87
|
width: "100%",
|
|
88
|
-
children:
|
|
88
|
+
children: t?.label ?? "Confirm"
|
|
89
89
|
}
|
|
90
90
|
)
|
|
91
91
|
] })
|
|
@@ -95,11 +95,11 @@ const z = ({
|
|
|
95
95
|
] }) }) });
|
|
96
96
|
};
|
|
97
97
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
J as Controller,
|
|
99
|
+
A as Form,
|
|
100
|
+
U as InnerForm,
|
|
101
|
+
K as useController,
|
|
102
|
+
L as useFieldArray,
|
|
103
|
+
M as useFormContext,
|
|
104
|
+
N as useWatch
|
|
105
105
|
};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
declare const FormContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, never> & Partial<Pick<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, never>>> & string & Omit<import('react').ForwardRefExoticComponent<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>>, keyof import('react').Component<any, {}, any>>;
|
|
1
6
|
declare const StyledForm: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, never>>> & string;
|
|
2
|
-
export { StyledForm };
|
|
7
|
+
export { FormContent, StyledForm };
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { styled as t } from "styled-components";
|
|
2
|
+
import { Container as e } from "../container/index.js";
|
|
3
|
+
const n = t(e)`
|
|
4
|
+
> * {
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
}
|
|
7
|
+
`, l = t.form`
|
|
8
|
+
${({ theme: o }) => `
|
|
4
9
|
align-items: flex-start;
|
|
5
10
|
align-self: stretch;
|
|
6
11
|
display: flex;
|
|
7
12
|
flex-direction: column;
|
|
8
|
-
gap: ${
|
|
13
|
+
gap: ${o.spacing[0.5]};
|
|
9
14
|
overflow: hidden auto;
|
|
10
15
|
width: 100%;
|
|
11
16
|
`}
|
|
12
17
|
`;
|
|
13
18
|
export {
|
|
14
|
-
|
|
19
|
+
n as FormContent,
|
|
20
|
+
l as StyledForm
|
|
15
21
|
};
|
|
@@ -7,27 +7,25 @@ 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";
|
|
12
10
|
import { safeUrl as j } from "../../utils/url.js";
|
|
13
11
|
const L = {
|
|
14
12
|
md: { titleSize: "xs", descSize: "md", linkTextSize: "md" },
|
|
15
13
|
lg: { titleSize: "sm", descSize: "lg", linkTextSize: "lg" }
|
|
16
|
-
},
|
|
14
|
+
}, U = ({
|
|
17
15
|
desc: r,
|
|
18
16
|
href: c,
|
|
19
17
|
icon: n,
|
|
20
18
|
imageHeight: m = 48,
|
|
21
19
|
imageWidth: a = 48,
|
|
22
|
-
Link:
|
|
23
|
-
LinkElement:
|
|
24
|
-
linkText:
|
|
20
|
+
Link: h,
|
|
21
|
+
LinkElement: f,
|
|
22
|
+
linkText: p = "Learn more ",
|
|
25
23
|
publicId: o,
|
|
26
24
|
size: z = "lg",
|
|
27
25
|
tag: d,
|
|
28
26
|
title: t
|
|
29
27
|
}) => {
|
|
30
|
-
const g =
|
|
28
|
+
const g = h ?? "a", { titleSize: x, descSize: S, linkTextSize: I } = L[z];
|
|
31
29
|
return /* @__PURE__ */ i(C, { "data-testid": t, children: [
|
|
32
30
|
/* @__PURE__ */ i(
|
|
33
31
|
w,
|
|
@@ -63,12 +61,12 @@ const L = {
|
|
|
63
61
|
),
|
|
64
62
|
/* @__PURE__ */ e(k, { size: x, children: t }),
|
|
65
63
|
r ? /* @__PURE__ */ e(l, { size: S, children: r }) : void 0,
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
f ?? /* @__PURE__ */ e(g, { href: j(c), style: { textDecoration: "none" }, children: /* @__PURE__ */ i(l, { size: I, children: [
|
|
65
|
+
p,
|
|
68
66
|
/* @__PURE__ */ e(s, { icon: "arrow-right", iconSize: "sm", iconType: "fa-light" })
|
|
69
67
|
] }) })
|
|
70
68
|
] });
|
|
71
69
|
};
|
|
72
70
|
export {
|
|
73
|
-
|
|
71
|
+
U as ItemCardDB
|
|
74
72
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as f, useState as c } from "react";
|
|
3
3
|
import { trapTabKey as o } from "./utils.js";
|
|
4
|
-
import { ModalWrapper as
|
|
5
|
-
import "../../../_virtual/lodash.js";
|
|
6
|
-
import "nuqs";
|
|
4
|
+
import { ModalWrapper as p } from "../styles.js";
|
|
7
5
|
import { useMountEffect as s } from "../../../hooks/use-mount-effect.js";
|
|
8
|
-
const
|
|
6
|
+
const w = ({
|
|
9
7
|
children: n = void 0,
|
|
10
8
|
id: a = void 0,
|
|
11
9
|
label: i
|
|
12
10
|
}) => {
|
|
13
|
-
const r =
|
|
11
|
+
const r = f(null), [t] = c(() => document.activeElement);
|
|
14
12
|
return s(() => {
|
|
15
13
|
const e = r.current;
|
|
16
14
|
return e?.contains(document.activeElement) !== !0 && e?.focus(), e?.addEventListener("keydown", o), () => {
|
|
17
15
|
e?.removeEventListener("keydown", o), t instanceof HTMLElement && t.focus();
|
|
18
16
|
};
|
|
19
17
|
}), /* @__PURE__ */ m(
|
|
20
|
-
|
|
18
|
+
p,
|
|
21
19
|
{
|
|
22
20
|
"aria-label": i,
|
|
23
21
|
"aria-modal": "true",
|
|
@@ -30,5 +28,5 @@ const x = ({
|
|
|
30
28
|
);
|
|
31
29
|
};
|
|
32
30
|
export {
|
|
33
|
-
|
|
31
|
+
w as Dialog
|
|
34
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { IModalProps } from './types';
|
|
4
4
|
declare const config: Meta;
|
|
@@ -8,6 +8,7 @@ declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import(
|
|
|
8
8
|
declare const WithForm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
9
9
|
id: string;
|
|
10
10
|
}>>;
|
|
11
|
+
declare const WithTabsAndLongForm: StoryFn;
|
|
11
12
|
declare const ScrollableContent: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
12
13
|
id: string;
|
|
13
14
|
}>>;
|
|
@@ -24,4 +25,4 @@ declare const WithTabs: import('storybook/internal/csf').AnnotatedStoryFn<import
|
|
|
24
25
|
id: string;
|
|
25
26
|
}>>;
|
|
26
27
|
export default config;
|
|
27
|
-
export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, };
|
|
28
|
+
export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, WithTabsAndLongForm, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, 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,10 +7,8 @@ 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 t } 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";
|
|
14
12
|
import { safeUrl as v } from "../../utils/url.js";
|
|
15
13
|
const R = {
|
|
16
14
|
critical: "critical",
|
|
@@ -18,23 +16,23 @@ const R = {
|
|
|
18
16
|
low: "low",
|
|
19
17
|
medium: "medium",
|
|
20
18
|
none: "disable"
|
|
21
|
-
},
|
|
22
|
-
affectedVersions:
|
|
23
|
-
ecosystem:
|
|
24
|
-
href:
|
|
19
|
+
}, W = ({
|
|
20
|
+
affectedVersions: o,
|
|
21
|
+
ecosystem: d,
|
|
22
|
+
href: p,
|
|
25
23
|
indx: s,
|
|
26
24
|
packageName: m,
|
|
27
|
-
severity:
|
|
25
|
+
severity: a,
|
|
28
26
|
status: c,
|
|
29
27
|
Link: h
|
|
30
28
|
}) => {
|
|
31
|
-
const r = b(), n =
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ e(g, { href: v(
|
|
35
|
-
/* @__PURE__ */ e(I, { tagLabel:
|
|
29
|
+
const r = b(), n = a ? R[a.toLowerCase()] : void 0, g = h ?? "a", f = c === "vulnerable";
|
|
30
|
+
return /* @__PURE__ */ l(C, { $index: s, children: [
|
|
31
|
+
/* @__PURE__ */ l(i, { display: "flex", justify: "space-between", width: "100%", children: [
|
|
32
|
+
/* @__PURE__ */ e(g, { href: v(p), children: /* @__PURE__ */ e(i, { alignItems: "center", display: "flex", gap: 0.75, children: /* @__PURE__ */ e(w, { fontWeight: "bold", size: "sm", children: m }) }) }),
|
|
33
|
+
/* @__PURE__ */ e(I, { tagLabel: d })
|
|
36
34
|
] }),
|
|
37
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ l(
|
|
38
36
|
i,
|
|
39
37
|
{
|
|
40
38
|
alignItems: "center",
|
|
@@ -43,7 +41,7 @@ const R = {
|
|
|
43
41
|
width: "100%",
|
|
44
42
|
wrap: "wrap",
|
|
45
43
|
children: [
|
|
46
|
-
f ? /* @__PURE__ */
|
|
44
|
+
f ? /* @__PURE__ */ l(i, { alignItems: "center", display: "flex", children: [
|
|
47
45
|
/* @__PURE__ */ e(
|
|
48
46
|
i,
|
|
49
47
|
{
|
|
@@ -53,7 +51,7 @@ const R = {
|
|
|
53
51
|
borderRadius: "4px 0 0 4px",
|
|
54
52
|
display: "flex",
|
|
55
53
|
px: 0.25,
|
|
56
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
children: /* @__PURE__ */ e(t, { color: r.palette.primary[500], size: "md", children: "Vulnerable" })
|
|
57
55
|
}
|
|
58
56
|
),
|
|
59
57
|
/* @__PURE__ */ e(
|
|
@@ -64,7 +62,7 @@ const R = {
|
|
|
64
62
|
borderRadius: "0 4px 4px 0",
|
|
65
63
|
display: "flex",
|
|
66
64
|
px: 0.25,
|
|
67
|
-
children: /* @__PURE__ */ e(
|
|
65
|
+
children: /* @__PURE__ */ e(t, { color: r.palette.gray[800], size: "md", children: `${o} affected version${o === 1 ? "" : "s"}` })
|
|
68
66
|
}
|
|
69
67
|
)
|
|
70
68
|
] }) : /* @__PURE__ */ e(
|
|
@@ -75,14 +73,14 @@ const R = {
|
|
|
75
73
|
borderRadius: "4px",
|
|
76
74
|
display: "flex",
|
|
77
75
|
px: 0.25,
|
|
78
|
-
children: /* @__PURE__ */ e(
|
|
76
|
+
children: /* @__PURE__ */ e(t, { color: r.palette.success[500], size: "md", children: "Safe" })
|
|
79
77
|
}
|
|
80
78
|
),
|
|
81
|
-
|
|
79
|
+
a && /* @__PURE__ */ l(y, { children: [
|
|
82
80
|
/* @__PURE__ */ e(z, {}),
|
|
83
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ l(i, { alignItems: "center", display: "flex", gap: 0.5, children: [
|
|
84
82
|
/* @__PURE__ */ e(
|
|
85
|
-
|
|
83
|
+
t,
|
|
86
84
|
{
|
|
87
85
|
color: r.palette.gray[400],
|
|
88
86
|
fontWeight: "bold",
|
|
@@ -90,10 +88,10 @@ const R = {
|
|
|
90
88
|
children: "Max severity:"
|
|
91
89
|
}
|
|
92
90
|
),
|
|
93
|
-
n === void 0 ? /* @__PURE__ */ e(
|
|
91
|
+
n === void 0 ? /* @__PURE__ */ e(t, { color: r.palette.gray[400], size: "sm", children: "None" }) : /* @__PURE__ */ e(
|
|
94
92
|
u,
|
|
95
93
|
{
|
|
96
|
-
textR: x(
|
|
94
|
+
textR: x(a),
|
|
97
95
|
variant: n
|
|
98
96
|
}
|
|
99
97
|
)
|
|
@@ -105,5 +103,5 @@ const R = {
|
|
|
105
103
|
] });
|
|
106
104
|
};
|
|
107
105
|
export {
|
|
108
|
-
|
|
106
|
+
W as PackageCard
|
|
109
107
|
};
|
|
@@ -9,8 +9,6 @@ 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";
|
|
14
12
|
import { safeUrl as s } from "../../utils/url.js";
|
|
15
13
|
const N = {
|
|
16
14
|
md: {
|
|
@@ -23,7 +21,7 @@ const N = {
|
|
|
23
21
|
titleSize: "sm",
|
|
24
22
|
detailsSize: "lg"
|
|
25
23
|
}
|
|
26
|
-
},
|
|
24
|
+
}, M = ({
|
|
27
25
|
technology: g,
|
|
28
26
|
technique: f,
|
|
29
27
|
cwes: y,
|
|
@@ -34,11 +32,11 @@ const N = {
|
|
|
34
32
|
target: u,
|
|
35
33
|
lastUpdated: p,
|
|
36
34
|
score: v,
|
|
37
|
-
size:
|
|
35
|
+
size: l = "lg",
|
|
38
36
|
severity: a,
|
|
39
37
|
title: C
|
|
40
38
|
}) => {
|
|
41
|
-
const
|
|
39
|
+
const r = j(), { methodIdSize: I, titleSize: D, detailsSize: o } = N[l], h = b ?? "a";
|
|
42
40
|
return /* @__PURE__ */ i(E, { $index: S, children: [
|
|
43
41
|
/* @__PURE__ */ i(
|
|
44
42
|
c,
|
|
@@ -52,7 +50,7 @@ const N = {
|
|
|
52
50
|
/* @__PURE__ */ e(
|
|
53
51
|
t,
|
|
54
52
|
{
|
|
55
|
-
color:
|
|
53
|
+
color: r.palette.gray[800],
|
|
56
54
|
display: "inline",
|
|
57
55
|
size: I,
|
|
58
56
|
children: z
|
|
@@ -67,9 +65,9 @@ const N = {
|
|
|
67
65
|
/* @__PURE__ */ i(
|
|
68
66
|
c,
|
|
69
67
|
{
|
|
70
|
-
alignItems:
|
|
68
|
+
alignItems: l === "md" ? "flex-start" : "center",
|
|
71
69
|
display: "flex",
|
|
72
|
-
flexDirection:
|
|
70
|
+
flexDirection: l === "md" ? "column" : "row",
|
|
73
71
|
gap: 0.75,
|
|
74
72
|
width: "fit-content",
|
|
75
73
|
children: [
|
|
@@ -82,11 +80,11 @@ const N = {
|
|
|
82
80
|
}
|
|
83
81
|
),
|
|
84
82
|
/* @__PURE__ */ i(n, { children: [
|
|
85
|
-
|
|
83
|
+
l === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
86
84
|
/* @__PURE__ */ i(
|
|
87
85
|
t,
|
|
88
86
|
{
|
|
89
|
-
color:
|
|
87
|
+
color: r.palette.gray[400],
|
|
90
88
|
display: "inline",
|
|
91
89
|
size: o,
|
|
92
90
|
children: [
|
|
@@ -97,11 +95,11 @@ const N = {
|
|
|
97
95
|
)
|
|
98
96
|
] }),
|
|
99
97
|
/* @__PURE__ */ i(n, { children: [
|
|
100
|
-
|
|
98
|
+
l === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
101
99
|
/* @__PURE__ */ i(
|
|
102
100
|
t,
|
|
103
101
|
{
|
|
104
|
-
color:
|
|
102
|
+
color: r.palette.gray[400],
|
|
105
103
|
display: "inline",
|
|
106
104
|
size: o,
|
|
107
105
|
children: [
|
|
@@ -112,11 +110,11 @@ const N = {
|
|
|
112
110
|
)
|
|
113
111
|
] }),
|
|
114
112
|
/* @__PURE__ */ i(n, { children: [
|
|
115
|
-
|
|
113
|
+
l === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
116
114
|
/* @__PURE__ */ e(
|
|
117
115
|
t,
|
|
118
116
|
{
|
|
119
|
-
color:
|
|
117
|
+
color: r.palette.gray[400],
|
|
120
118
|
display: "inline",
|
|
121
119
|
fontWeight: "bold",
|
|
122
120
|
size: o,
|
|
@@ -127,7 +125,7 @@ const N = {
|
|
|
127
125
|
T > 0 ? /* @__PURE__ */ e(
|
|
128
126
|
t,
|
|
129
127
|
{
|
|
130
|
-
color:
|
|
128
|
+
color: r.palette.gray[400],
|
|
131
129
|
display: "inline",
|
|
132
130
|
size: o,
|
|
133
131
|
children: " , "
|
|
@@ -136,7 +134,7 @@ const N = {
|
|
|
136
134
|
/* @__PURE__ */ e(h, { href: s(m.href), children: /* @__PURE__ */ e(
|
|
137
135
|
t,
|
|
138
136
|
{
|
|
139
|
-
color:
|
|
137
|
+
color: r.palette.gray[400],
|
|
140
138
|
display: "inline",
|
|
141
139
|
size: o,
|
|
142
140
|
textDecoration: "underline",
|
|
@@ -146,11 +144,11 @@ const N = {
|
|
|
146
144
|
] }, m.key))
|
|
147
145
|
] }),
|
|
148
146
|
p ? /* @__PURE__ */ i(n, { children: [
|
|
149
|
-
|
|
147
|
+
l === "lg" ? /* @__PURE__ */ e(d, {}) : void 0,
|
|
150
148
|
/* @__PURE__ */ i(
|
|
151
149
|
t,
|
|
152
150
|
{
|
|
153
|
-
color:
|
|
151
|
+
color: r.palette.gray[400],
|
|
154
152
|
display: "inline",
|
|
155
153
|
size: o,
|
|
156
154
|
children: [
|
|
@@ -166,5 +164,5 @@ const N = {
|
|
|
166
164
|
] });
|
|
167
165
|
};
|
|
168
166
|
export {
|
|
169
|
-
|
|
167
|
+
M as RulesCard
|
|
170
168
|
};
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { StyledContainer as
|
|
2
|
+
import { StyledContainer as d, StyledIndicatorPill as m } from "./styles.js";
|
|
3
3
|
import { variantColors as h } from "./utils.js";
|
|
4
|
-
import { theme as
|
|
4
|
+
import { theme as a } 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
|
|
9
|
-
import "../../_virtual/dayjs.min.js";
|
|
10
|
-
import "../../_virtual/lodash.js";
|
|
8
|
+
import { Text as p } from "../typography/text/index.js";
|
|
11
9
|
import { safeUrl as v } from "../../utils/url.js";
|
|
12
|
-
const
|
|
10
|
+
const u = ({
|
|
13
11
|
number: e,
|
|
14
12
|
text: n,
|
|
15
13
|
link: r,
|
|
16
14
|
variant: f
|
|
17
15
|
}) => {
|
|
18
|
-
const l = h[f], i = r && v(r) === r ? r : void 0, c = i ? "inherit" :
|
|
16
|
+
const l = h[f], i = r && v(r) === r ? r : void 0, c = i ? "inherit" : a.palette.gray[500], s = /* @__PURE__ */ t(
|
|
19
17
|
"span",
|
|
20
18
|
{
|
|
21
19
|
style: {
|
|
@@ -25,7 +23,7 @@ const P = ({
|
|
|
25
23
|
},
|
|
26
24
|
children: [
|
|
27
25
|
e !== void 0 ? /* @__PURE__ */ o(
|
|
28
|
-
|
|
26
|
+
p,
|
|
29
27
|
{
|
|
30
28
|
color: c,
|
|
31
29
|
display: "inline",
|
|
@@ -34,18 +32,18 @@ const P = ({
|
|
|
34
32
|
children: e
|
|
35
33
|
}
|
|
36
34
|
) : void 0,
|
|
37
|
-
n ? /* @__PURE__ */ o(
|
|
35
|
+
n ? /* @__PURE__ */ o(p, { color: c, display: "inline", size: "sm", children: n }) : void 0
|
|
38
36
|
]
|
|
39
37
|
}
|
|
40
38
|
);
|
|
41
|
-
return i ? /* @__PURE__ */ t(
|
|
42
|
-
/* @__PURE__ */ o(
|
|
43
|
-
/* @__PURE__ */ o(y, { color:
|
|
44
|
-
] }) : /* @__PURE__ */ t(
|
|
45
|
-
/* @__PURE__ */ o(
|
|
46
|
-
|
|
39
|
+
return i ? /* @__PURE__ */ t(d, { children: [
|
|
40
|
+
/* @__PURE__ */ o(m, { $color: l }),
|
|
41
|
+
/* @__PURE__ */ o(y, { color: a.palette.gray[500], href: i, children: s })
|
|
42
|
+
] }) : /* @__PURE__ */ t(d, { children: [
|
|
43
|
+
/* @__PURE__ */ o(m, { $color: l }),
|
|
44
|
+
s
|
|
47
45
|
] });
|
|
48
46
|
};
|
|
49
47
|
export {
|
|
50
|
-
|
|
48
|
+
u as SeverityIndicator
|
|
51
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, 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,7 +6,6 @@ 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";
|
|
10
9
|
import "../../container/index.js";
|
|
11
10
|
import "../../icon-button/index.js";
|
|
12
11
|
import "../../typography/heading/index.js";
|
|
@@ -17,7 +16,7 @@ import "react-router";
|
|
|
17
16
|
import "../../notification-sign/index.js";
|
|
18
17
|
import "../../icon/index.js";
|
|
19
18
|
import { ColumnsModal as C } from "../../modal/columns-modal/index.js";
|
|
20
|
-
const
|
|
19
|
+
const G = (s) => {
|
|
21
20
|
const { table: t } = s, { meta: m } = t.options, [, n] = t.getHeaderGroups(), a = t.getVisibleLeafColumns().filter((o) => o.id !== "selection").length, i = l(
|
|
22
21
|
() => t.getAllLeafColumns().filter((o) => o.id !== "selection"),
|
|
23
22
|
[t]
|
|
@@ -34,16 +33,16 @@ const N = (s) => {
|
|
|
34
33
|
name: "table-column-management",
|
|
35
34
|
setColumnOrder: t.setColumnOrder,
|
|
36
35
|
setColumnVisibility: t.setColumnVisibility
|
|
37
|
-
}),
|
|
36
|
+
}), u = c(() => {
|
|
38
37
|
e.toggle();
|
|
39
38
|
}, [e]);
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ p("div", { id: "columns-filter", children: [
|
|
41
40
|
/* @__PURE__ */ r(
|
|
42
41
|
f,
|
|
43
42
|
{
|
|
44
43
|
icon: "columns",
|
|
45
44
|
id: "columns-toggle-btn",
|
|
46
|
-
onClick:
|
|
45
|
+
onClick: u,
|
|
47
46
|
tag: a.toString(),
|
|
48
47
|
variant: "ghost"
|
|
49
48
|
}
|
|
@@ -59,5 +58,5 @@ const N = (s) => {
|
|
|
59
58
|
] });
|
|
60
59
|
};
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
G as ColumnToggle
|
|
63
62
|
};
|
|
@@ -2,17 +2,15 @@ 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";
|
|
7
5
|
import { useMountEffect as u } from "../../../hooks/use-mount-effect.js";
|
|
8
6
|
const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
9
7
|
const { paddingLeft: e, paddingRight: n } = getComputedStyle(t);
|
|
10
8
|
return t.clientWidth - f(e) - f(n);
|
|
11
|
-
},
|
|
9
|
+
}, M = ({
|
|
12
10
|
children: t,
|
|
13
11
|
table: e
|
|
14
12
|
}) => {
|
|
15
|
-
const n = l(null), p = l(null), { id: h } = e.options.meta ?? {}, { enableMultiRowSelection: S } = e?.options ?? {},
|
|
13
|
+
const n = l(null), p = l(null), { id: h } = e.options.meta ?? {}, { enableMultiRowSelection: S } = e?.options ?? {}, s = Object.keys(e.getState().rowSelection).length, w = s === 1 ? "item" : "items", g = s === 0 || !S, [v, R] = x(0);
|
|
16
14
|
u(() => {
|
|
17
15
|
const o = () => {
|
|
18
16
|
const r = n.current ? E(n.current) : 0;
|
|
@@ -35,13 +33,13 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
35
33
|
const T = Math.max(
|
|
36
34
|
v,
|
|
37
35
|
e.getTotalSize() + C
|
|
38
|
-
),
|
|
36
|
+
), i = m(() => {
|
|
39
37
|
e.resetRowSelection();
|
|
40
38
|
}, [e]), b = m(
|
|
41
39
|
(o) => {
|
|
42
|
-
o.key === "Enter" &&
|
|
40
|
+
o.key === "Enter" && i();
|
|
43
41
|
},
|
|
44
|
-
[
|
|
42
|
+
[i]
|
|
45
43
|
);
|
|
46
44
|
return u(() => {
|
|
47
45
|
e.setPageIndex(0);
|
|
@@ -51,10 +49,10 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
51
49
|
value: {
|
|
52
50
|
containerRef: n,
|
|
53
51
|
elementName: w,
|
|
54
|
-
handleUnselectAll:
|
|
52
|
+
handleUnselectAll: i,
|
|
55
53
|
hidden: g,
|
|
56
54
|
onKeyDown: b,
|
|
57
|
-
selected:
|
|
55
|
+
selected: s,
|
|
58
56
|
tableSize: T,
|
|
59
57
|
tableRef: p,
|
|
60
58
|
table: e
|
|
@@ -64,5 +62,5 @@ const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
|
64
62
|
);
|
|
65
63
|
};
|
|
66
64
|
export {
|
|
67
|
-
|
|
65
|
+
M as Table
|
|
68
66
|
};
|
|
@@ -8,8 +8,6 @@ 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";
|
|
13
11
|
import { safeUrl as p } from "../../utils/url.js";
|
|
14
12
|
const G = {
|
|
15
13
|
md: {
|
|
@@ -24,7 +22,7 @@ const G = {
|
|
|
24
22
|
descriptionSize: "lg",
|
|
25
23
|
detailsSize: "lg"
|
|
26
24
|
}
|
|
27
|
-
},
|
|
25
|
+
}, A = ({
|
|
28
26
|
title: g,
|
|
29
27
|
href: h,
|
|
30
28
|
description: f,
|
|
@@ -167,5 +165,5 @@ const G = {
|
|
|
167
165
|
] });
|
|
168
166
|
};
|
|
169
167
|
export {
|
|
170
|
-
|
|
168
|
+
A as WeaknessesCard
|
|
171
169
|
};
|
package/dist/hooks/use-search.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useState as a } from "react";
|
|
2
2
|
import { useDebouncedCallback as s } from "./use-debounced-callback.js";
|
|
3
|
-
import "nuqs";
|
|
4
3
|
const S = (e) => {
|
|
5
|
-
const [t,
|
|
6
|
-
|
|
4
|
+
const [t, c] = a(), o = s((r) => {
|
|
5
|
+
c(r);
|
|
7
6
|
}, e?.debounceWait ?? 300);
|
|
8
|
-
return [t,
|
|
7
|
+
return [t, o];
|
|
9
8
|
};
|
|
10
9
|
export {
|
|
11
10
|
S as useSearch
|
package/package.json
CHANGED
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@types/react-dom": "18.3.0",
|
|
43
43
|
"@types/react-syntax-highlighter": "15.5.13",
|
|
44
44
|
"@vitejs/plugin-react-swc": "4.3.1",
|
|
45
|
-
"@vitest/browser-playwright": "4.1.
|
|
46
|
-
"@vitest/coverage-v8": "4.1.
|
|
45
|
+
"@vitest/browser-playwright": "4.1.12",
|
|
46
|
+
"@vitest/coverage-v8": "4.1.12",
|
|
47
47
|
"eslint": "9.31.0",
|
|
48
48
|
"eslint-config-prettier": "10.0.1",
|
|
49
49
|
"eslint-import-resolver-typescript": "3.8.0",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"tailwindcss": "4.3.0",
|
|
71
71
|
"typescript": "6.0.3",
|
|
72
72
|
"typescript-eslint": "8.59.4",
|
|
73
|
-
"vite": "6.4.
|
|
73
|
+
"vite": "6.4.5",
|
|
74
74
|
"vite-plugin-dts": "5.0.3",
|
|
75
75
|
"vite-plugin-lib-inject-css": "2.2.2",
|
|
76
|
-
"vitest": "4.1.
|
|
76
|
+
"vitest": "4.1.12"
|
|
77
77
|
},
|
|
78
78
|
"eslintConfig": {
|
|
79
79
|
"extends": [
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"./dist/index.js"
|
|
136
136
|
],
|
|
137
137
|
"typings": "./dist/index.d.ts",
|
|
138
|
-
"version": "10.
|
|
138
|
+
"version": "10.1.0"
|
|
139
139
|
}
|