@fluidattacks/design 11.6.0 → 11.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useCallback as p, useMemo as b } from "react";
|
|
3
3
|
import { createPortal as I } from "react-dom";
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { OptionContainer as
|
|
6
|
-
import { StyledGroupContainer as
|
|
4
|
+
import { useTheme as L } from "styled-components";
|
|
5
|
+
import { OptionContainer as T } from "./option-container/index.js";
|
|
6
|
+
import { StyledGroupContainer as z, OptionBoxContainer as j } from "./styles.js";
|
|
7
7
|
import { Container as o } from "../container/index.js";
|
|
8
8
|
import { Divider as k } from "../divider/index.js";
|
|
9
9
|
import { Icon as G } from "../icon/index.js";
|
|
@@ -12,17 +12,17 @@ import { Search as H } from "../search/index.js";
|
|
|
12
12
|
import "../typography/heading/index.js";
|
|
13
13
|
import "../typography/span/index.js";
|
|
14
14
|
import { Text as h } from "../typography/text/index.js";
|
|
15
|
-
const c = 100,
|
|
15
|
+
const c = 100, B = ({
|
|
16
16
|
items: t,
|
|
17
|
-
handleNewOrganization:
|
|
17
|
+
handleNewOrganization: n,
|
|
18
18
|
itemAction: d,
|
|
19
|
-
onSelect:
|
|
20
|
-
onClose:
|
|
19
|
+
onSelect: u,
|
|
20
|
+
onClose: g,
|
|
21
21
|
selectedItem: f,
|
|
22
22
|
title: C,
|
|
23
23
|
variant: x
|
|
24
24
|
}) => {
|
|
25
|
-
const
|
|
25
|
+
const i = L(), [a, m] = w(""), y = p(
|
|
26
26
|
(r) => {
|
|
27
27
|
r.currentTarget && m(r.currentTarget.value.slice(0, c));
|
|
28
28
|
},
|
|
@@ -36,7 +36,7 @@ const c = 100, N = ({
|
|
|
36
36
|
if (!a) return [...t];
|
|
37
37
|
const r = a.toLowerCase();
|
|
38
38
|
return t.filter(
|
|
39
|
-
(
|
|
39
|
+
(v) => String(v.name).toLowerCase().includes(r)
|
|
40
40
|
);
|
|
41
41
|
}, [t, a]);
|
|
42
42
|
return /* @__PURE__ */ e(
|
|
@@ -56,8 +56,8 @@ const c = 100, N = ({
|
|
|
56
56
|
left: "0",
|
|
57
57
|
top: "0",
|
|
58
58
|
width: "100%",
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ l(z, { $itemsLength: s.length, children: [
|
|
60
|
+
/* @__PURE__ */ l(
|
|
61
61
|
o,
|
|
62
62
|
{
|
|
63
63
|
alignItems: "center",
|
|
@@ -67,7 +67,7 @@ const c = 100, N = ({
|
|
|
67
67
|
/* @__PURE__ */ e(
|
|
68
68
|
h,
|
|
69
69
|
{
|
|
70
|
-
color:
|
|
70
|
+
color: i.palette.gray[800],
|
|
71
71
|
fontWeight: "bold",
|
|
72
72
|
size: "lg",
|
|
73
73
|
children: C
|
|
@@ -77,10 +77,10 @@ const c = 100, N = ({
|
|
|
77
77
|
A,
|
|
78
78
|
{
|
|
79
79
|
icon: "xmark",
|
|
80
|
-
iconColor:
|
|
80
|
+
iconColor: i.palette.gray[400],
|
|
81
81
|
iconSize: "lg",
|
|
82
82
|
iconType: "fa-light",
|
|
83
|
-
onClick:
|
|
83
|
+
onClick: g,
|
|
84
84
|
variant: "ghost"
|
|
85
85
|
}
|
|
86
86
|
)
|
|
@@ -98,7 +98,7 @@ const c = 100, N = ({
|
|
|
98
98
|
}
|
|
99
99
|
) }),
|
|
100
100
|
/* @__PURE__ */ e(k, { mb: 1, mt: 1 }),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ l(
|
|
102
102
|
o,
|
|
103
103
|
{
|
|
104
104
|
display: "inline-flex",
|
|
@@ -107,26 +107,26 @@ const c = 100, N = ({
|
|
|
107
107
|
scroll: "y",
|
|
108
108
|
wrap: "wrap",
|
|
109
109
|
children: [
|
|
110
|
-
x === "organization-selector" ? /* @__PURE__ */ e(j, { onClick:
|
|
110
|
+
x === "organization-selector" && n !== void 0 ? /* @__PURE__ */ e(j, { onClick: n, children: /* @__PURE__ */ l(o, { alignItems: "center", display: "flex", children: [
|
|
111
111
|
/* @__PURE__ */ e(
|
|
112
112
|
G,
|
|
113
113
|
{
|
|
114
114
|
icon: "square-plus",
|
|
115
|
-
iconColor:
|
|
115
|
+
iconColor: i.palette.gray[400],
|
|
116
116
|
iconSize: "lg",
|
|
117
117
|
iconType: "fa-light",
|
|
118
118
|
mr: 0.5
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */ e(h, { color:
|
|
121
|
+
/* @__PURE__ */ e(h, { color: i.palette.gray[400], size: "md", children: "New organization" })
|
|
122
122
|
] }) }) : void 0,
|
|
123
123
|
s.map((r) => /* @__PURE__ */ e(
|
|
124
|
-
|
|
124
|
+
T,
|
|
125
125
|
{
|
|
126
126
|
isSelected: f.toLowerCase() === r.name,
|
|
127
127
|
itemAction: d,
|
|
128
128
|
label: r.name.charAt(0).toUpperCase() + r.name.slice(1),
|
|
129
|
-
onSelect:
|
|
129
|
+
onSelect: u,
|
|
130
130
|
value: r.name
|
|
131
131
|
},
|
|
132
132
|
r.name
|
|
@@ -141,8 +141,8 @@ const c = 100, N = ({
|
|
|
141
141
|
);
|
|
142
142
|
}, F = ({
|
|
143
143
|
isOpen: t = !0,
|
|
144
|
-
...
|
|
145
|
-
}) => t ? I(/* @__PURE__ */ e(
|
|
144
|
+
...n
|
|
145
|
+
}) => t ? I(/* @__PURE__ */ e(B, { ...n }), document.body) : /* @__PURE__ */ e("div", {});
|
|
146
146
|
export {
|
|
147
147
|
F as GroupSelector
|
|
148
148
|
};
|
package/package.json
CHANGED