@fluidattacks/design 9.7.1 → 9.8.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/_virtual/index.js +2 -3
- package/dist/_virtual/index2.js +3 -5
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -2
- package/dist/components/card/card-with-input/index.js +2 -3
- package/dist/components/filters/filters-menu/index.js +23 -24
- package/dist/components/filters/options-menu/options/index.js +2 -3
- package/dist/components/group-selector/index.js +44 -41
- package/dist/components/group-selector/index.stories.d.ts +2 -1
- package/dist/components/group-selector/option-container/index.d.ts +1 -1
- package/dist/components/group-selector/option-container/index.js +37 -24
- package/dist/components/group-selector/styles.d.ts +4 -2
- package/dist/components/group-selector/styles.js +9 -9
- package/dist/components/group-selector/types.d.ts +5 -0
- package/dist/components/list-item/index.d.ts +1 -1
- package/dist/components/list-item/index.js +67 -47
- package/dist/components/list-item/index.stories.d.ts +2 -1
- package/dist/components/list-item/item-action/index.d.ts +3 -0
- package/dist/components/list-item/item-action/index.js +36 -0
- package/dist/components/list-item/item-action/styles.d.ts +6 -0
- package/dist/components/list-item/item-action/styles.js +17 -0
- package/dist/components/list-item/item-action/types.d.ts +14 -0
- package/dist/components/list-item/styles.d.ts +5 -1
- package/dist/components/list-item/styles.js +9 -9
- package/dist/components/list-item/types.d.ts +17 -1
- package/dist/components/menu/index.js +3 -2
- package/dist/components/modal/columns-modal/preview-panel/styles.d.ts +1 -1
- package/dist/components/modal/columns-modal/search-panel/styles.d.ts +1 -1
- package/dist/components/slider/index.js +2 -3
- package/dist/components/table/index.stories.d.ts +2 -1
- package/dist/components/table/styles.js +10 -0
- package/dist/components/table/wrapper/index.js +41 -38
- package/dist/node_modules/react-joyride/dist/index.js +4 -4
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index.js
CHANGED
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var t = e();
|
|
4
|
-
const n = /* @__PURE__ */ r(t);
|
|
1
|
+
import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
|
|
2
|
+
var i = r();
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
i as s
|
|
7
5
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as e } from "../node_modules/react-innertext/index.js";
|
|
3
|
+
var t = e();
|
|
4
|
+
const n = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
n as default
|
|
7
7
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/@fastify/deepmerge/index.js";
|
|
3
|
+
var o = r();
|
|
4
|
+
const p = /* @__PURE__ */ e(o);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -12,7 +12,6 @@ import "react-dom";
|
|
|
12
12
|
import "../../typography/heading/index.js";
|
|
13
13
|
import "../../typography/span/index.js";
|
|
14
14
|
import "../../typography/text/index.js";
|
|
15
|
-
import "../../inputs/styles.js";
|
|
16
15
|
import "../../container/index.js";
|
|
17
16
|
import "../../icon-button/index.js";
|
|
18
17
|
import "../../../_virtual/dayjs.min.js";
|
|
@@ -21,7 +20,7 @@ import "../../layout/categories/buttons/index.js";
|
|
|
21
20
|
import { InputNumber as S } from "../../inputs/fields/number/index.js";
|
|
22
21
|
import "../../inputs/utils/action-button/index.js";
|
|
23
22
|
import "../../../node_modules/react-international-phone/dist/index.js";
|
|
24
|
-
const
|
|
23
|
+
const it = ({
|
|
25
24
|
control: u,
|
|
26
25
|
description: B,
|
|
27
26
|
disabled: t,
|
|
@@ -142,5 +141,5 @@ const pt = ({
|
|
|
142
141
|
);
|
|
143
142
|
};
|
|
144
143
|
export {
|
|
145
|
-
|
|
144
|
+
it as CardWithInput
|
|
146
145
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import I from "../../../_virtual/snakeCase.js";
|
|
3
|
-
import { forwardRef as O, useContext as $, useMemo as B, useCallback as
|
|
3
|
+
import { forwardRef as O, useContext as $, useMemo as B, useCallback as h, Fragment as L } from "react";
|
|
4
4
|
import { useTheme as R } from "styled-components";
|
|
5
5
|
import { FiltersContext as A } from "../context/index.js";
|
|
6
6
|
import { NoMatches as P } from "../search/no-matches/index.js";
|
|
@@ -15,7 +15,6 @@ import "react-dom";
|
|
|
15
15
|
import "../../typography/heading/index.js";
|
|
16
16
|
import "../../typography/span/index.js";
|
|
17
17
|
import { Text as M } from "../../typography/text/index.js";
|
|
18
|
-
import "../../inputs/styles.js";
|
|
19
18
|
import { Tag as K } from "../../tag/index.js";
|
|
20
19
|
import "../../../_virtual/dayjs.min.js";
|
|
21
20
|
import "../../icon-button/index.js";
|
|
@@ -27,8 +26,8 @@ import { parseTextFilterValue as U, parseCheckboxesFilterValue as X, parseInclud
|
|
|
27
26
|
const Z = (c, d) => {
|
|
28
27
|
if (d?.some((t) => t.type === "text") ?? !1)
|
|
29
28
|
return U(c ?? "").text ? "1" : "0";
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
29
|
+
const l = new Set(d?.map((t) => t.type) ?? []);
|
|
30
|
+
if (l.size === 1 && l.has("checkboxes"))
|
|
32
31
|
return X(
|
|
33
32
|
c ?? ""
|
|
34
33
|
).values.length.toString();
|
|
@@ -39,11 +38,11 @@ const Z = (c, d) => {
|
|
|
39
38
|
return (t.length + f.length).toString();
|
|
40
39
|
}
|
|
41
40
|
return (c ?? "").split(",").filter((t) => t && t !== "-").length.toString();
|
|
42
|
-
},
|
|
41
|
+
}, ke = O(function({
|
|
43
42
|
includeSearch: d = !1,
|
|
44
43
|
groupedFilters: g,
|
|
45
|
-
handleChangeId:
|
|
46
|
-
pinnedFilters:
|
|
44
|
+
handleChangeId: l,
|
|
45
|
+
pinnedFilters: p
|
|
47
46
|
}, b) {
|
|
48
47
|
const t = R(), {
|
|
49
48
|
id: f,
|
|
@@ -52,16 +51,16 @@ const Z = (c, d) => {
|
|
|
52
51
|
values: s,
|
|
53
52
|
updateSearch: v,
|
|
54
53
|
setValues: u
|
|
55
|
-
} = $(A), C = q(g, y), w = B(() => Object.values(s).filter(Boolean).length > 0, [s]), S =
|
|
54
|
+
} = $(A), C = q(g, y), w = B(() => Object.values(s).filter(Boolean).length > 0, [s]), S = p.length > 0, V = h(
|
|
56
55
|
(e) => () => {
|
|
57
|
-
|
|
56
|
+
l(e), v({ previousValue: s[e] ?? "" }), m({ searchFilter: "", searchGlobal: "" });
|
|
58
57
|
},
|
|
59
|
-
[
|
|
60
|
-
), j =
|
|
58
|
+
[l, v, m, s]
|
|
59
|
+
), j = h(() => {
|
|
61
60
|
u(
|
|
62
61
|
(e) => Object.keys(e).reduce((n, r) => ({ ...n, [r]: "" }), {})
|
|
63
|
-
),
|
|
64
|
-
}, [u,
|
|
62
|
+
), l("");
|
|
63
|
+
}, [u, l]), z = h(
|
|
65
64
|
(e) => {
|
|
66
65
|
m((n) => ({
|
|
67
66
|
...n,
|
|
@@ -69,7 +68,7 @@ const Z = (c, d) => {
|
|
|
69
68
|
}));
|
|
70
69
|
},
|
|
71
70
|
[m]
|
|
72
|
-
), E =
|
|
71
|
+
), E = h(
|
|
73
72
|
(e) => (n) => {
|
|
74
73
|
u((r) => ({ ...r, [e]: n }));
|
|
75
74
|
},
|
|
@@ -108,7 +107,7 @@ const Z = (c, d) => {
|
|
|
108
107
|
scroll: "y",
|
|
109
108
|
width: "100%",
|
|
110
109
|
children: [
|
|
111
|
-
S ? /* @__PURE__ */ o(k, { "data-testid": "menu-pinned", children:
|
|
110
|
+
S ? /* @__PURE__ */ o(k, { "data-testid": "menu-pinned", children: p.map((e) => {
|
|
112
111
|
const n = e.options?.[0]?.items?.map((r) => ({
|
|
113
112
|
name: r.label ?? r.value,
|
|
114
113
|
value: r.value
|
|
@@ -141,17 +140,17 @@ const Z = (c, d) => {
|
|
|
141
140
|
children: e
|
|
142
141
|
}
|
|
143
142
|
) : void 0,
|
|
144
|
-
n.map((
|
|
145
|
-
const G = s[
|
|
143
|
+
n.map((i) => {
|
|
144
|
+
const G = s[i.id], F = Z(
|
|
146
145
|
G,
|
|
147
|
-
|
|
146
|
+
i.options
|
|
148
147
|
);
|
|
149
148
|
return /* @__PURE__ */ o(L, { children: /* @__PURE__ */ a(
|
|
150
149
|
N,
|
|
151
150
|
{
|
|
152
151
|
as: "button",
|
|
153
|
-
"data-testid":
|
|
154
|
-
onClick: V(
|
|
152
|
+
"data-testid": i.id,
|
|
153
|
+
onClick: V(i.id),
|
|
155
154
|
children: [
|
|
156
155
|
/* @__PURE__ */ o(
|
|
157
156
|
T,
|
|
@@ -162,7 +161,7 @@ const Z = (c, d) => {
|
|
|
162
161
|
iconType: "fa-light"
|
|
163
162
|
}
|
|
164
163
|
),
|
|
165
|
-
|
|
164
|
+
i.label,
|
|
166
165
|
/* @__PURE__ */ a(
|
|
167
166
|
x,
|
|
168
167
|
{
|
|
@@ -171,7 +170,7 @@ const Z = (c, d) => {
|
|
|
171
170
|
gap: 0.5,
|
|
172
171
|
style: { marginLeft: "auto" },
|
|
173
172
|
children: [
|
|
174
|
-
f ===
|
|
173
|
+
f === i.id ? /* @__PURE__ */ o(
|
|
175
174
|
T,
|
|
176
175
|
{
|
|
177
176
|
icon: "chevron-right",
|
|
@@ -186,7 +185,7 @@ const Z = (c, d) => {
|
|
|
186
185
|
)
|
|
187
186
|
]
|
|
188
187
|
}
|
|
189
|
-
) },
|
|
188
|
+
) }, i.id);
|
|
190
189
|
})
|
|
191
190
|
]
|
|
192
191
|
},
|
|
@@ -198,5 +197,5 @@ const Z = (c, d) => {
|
|
|
198
197
|
] });
|
|
199
198
|
});
|
|
200
199
|
export {
|
|
201
|
-
|
|
200
|
+
ke as FiltersMenu
|
|
202
201
|
};
|
|
@@ -16,7 +16,6 @@ import "react-dom";
|
|
|
16
16
|
import "../../../typography/heading/index.js";
|
|
17
17
|
import { Span as G } from "../../../typography/span/index.js";
|
|
18
18
|
import "../../../typography/text/index.js";
|
|
19
|
-
import "../../../inputs/styles.js";
|
|
20
19
|
import "../../../container/index.js";
|
|
21
20
|
import { Tag as H } from "../../../tag/index.js";
|
|
22
21
|
import "../../../icon-button/index.js";
|
|
@@ -280,7 +279,7 @@ const Z = ({
|
|
|
280
279
|
}
|
|
281
280
|
) });
|
|
282
281
|
}
|
|
283
|
-
},
|
|
282
|
+
}, $e = ({
|
|
284
283
|
id: i,
|
|
285
284
|
filteredItems: n,
|
|
286
285
|
filterValue: l,
|
|
@@ -358,6 +357,6 @@ const Z = ({
|
|
|
358
357
|
}) ?? null });
|
|
359
358
|
};
|
|
360
359
|
export {
|
|
361
|
-
|
|
360
|
+
$e as Options,
|
|
362
361
|
Z as TextFilterRenderer
|
|
363
362
|
};
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { OptionContainer as
|
|
6
|
-
import { StyledGroupContainer as
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useCallback as p, useMemo as b } from "react";
|
|
3
|
+
import { createPortal as I } from "react-dom";
|
|
4
|
+
import { useTheme as z } from "styled-components";
|
|
5
|
+
import { OptionContainer as L } from "./option-container/index.js";
|
|
6
|
+
import { StyledGroupContainer as T, OptionBoxContainer as j } from "./styles.js";
|
|
7
7
|
import { Container as o } from "../container/index.js";
|
|
8
|
-
import { Divider as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { IconButton as
|
|
11
|
-
import { Search as
|
|
8
|
+
import { Divider as k } from "../divider/index.js";
|
|
9
|
+
import { Icon as G } from "../icon/index.js";
|
|
10
|
+
import { IconButton as A } from "../icon-button/index.js";
|
|
11
|
+
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, N = ({
|
|
16
16
|
items: t,
|
|
17
17
|
handleNewOrganization: l,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
itemAction: d,
|
|
19
|
+
onSelect: g,
|
|
20
|
+
onClose: u,
|
|
21
|
+
selectedItem: f,
|
|
22
|
+
title: C,
|
|
23
|
+
variant: x
|
|
23
24
|
}) => {
|
|
24
|
-
const n =
|
|
25
|
+
const n = z(), [a, m] = v(""), y = p(
|
|
25
26
|
(r) => {
|
|
26
27
|
r.currentTarget && m(r.currentTarget.value.slice(0, c));
|
|
27
28
|
},
|
|
28
29
|
[]
|
|
29
|
-
),
|
|
30
|
+
), S = p(
|
|
30
31
|
(r) => {
|
|
31
32
|
m(r.target.value.slice(0, c));
|
|
32
33
|
},
|
|
33
34
|
[]
|
|
34
35
|
), s = b(() => {
|
|
35
|
-
if (!
|
|
36
|
-
const r =
|
|
36
|
+
if (!a) return [...t];
|
|
37
|
+
const r = a.toLowerCase();
|
|
37
38
|
return t.filter(
|
|
38
|
-
(
|
|
39
|
+
(w) => String(w.name).toLowerCase().includes(r)
|
|
39
40
|
);
|
|
40
|
-
}, [t,
|
|
41
|
+
}, [t, a]);
|
|
41
42
|
return /* @__PURE__ */ e(
|
|
42
43
|
o,
|
|
43
44
|
{
|
|
@@ -55,8 +56,8 @@ const c = 100, H = ({
|
|
|
55
56
|
left: "0",
|
|
56
57
|
top: "0",
|
|
57
58
|
width: "100%",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ i(T, { $itemsLength: s.length, children: [
|
|
60
|
+
/* @__PURE__ */ i(
|
|
60
61
|
o,
|
|
61
62
|
{
|
|
62
63
|
alignItems: "center",
|
|
@@ -69,17 +70,17 @@ const c = 100, H = ({
|
|
|
69
70
|
color: n.palette.gray[800],
|
|
70
71
|
fontWeight: "bold",
|
|
71
72
|
size: "lg",
|
|
72
|
-
children:
|
|
73
|
+
children: C
|
|
73
74
|
}
|
|
74
75
|
),
|
|
75
76
|
/* @__PURE__ */ e(
|
|
76
|
-
|
|
77
|
+
A,
|
|
77
78
|
{
|
|
78
79
|
icon: "xmark",
|
|
79
80
|
iconColor: n.palette.gray[400],
|
|
80
81
|
iconSize: "lg",
|
|
81
82
|
iconType: "fa-light",
|
|
82
|
-
onClick:
|
|
83
|
+
onClick: u,
|
|
83
84
|
variant: "ghost"
|
|
84
85
|
}
|
|
85
86
|
)
|
|
@@ -87,17 +88,17 @@ const c = 100, H = ({
|
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
90
|
/* @__PURE__ */ e(o, { mt: 1, children: /* @__PURE__ */ e(
|
|
90
|
-
|
|
91
|
+
H,
|
|
91
92
|
{
|
|
92
93
|
maxLength: c,
|
|
93
|
-
onChange:
|
|
94
|
-
onInput:
|
|
94
|
+
onChange: S,
|
|
95
|
+
onInput: y,
|
|
95
96
|
placeholder: "Search",
|
|
96
|
-
value:
|
|
97
|
+
value: a
|
|
97
98
|
}
|
|
98
99
|
) }),
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ e(k, { mb: 1, mt: 1 }),
|
|
101
|
+
/* @__PURE__ */ i(
|
|
101
102
|
o,
|
|
102
103
|
{
|
|
103
104
|
display: "inline-flex",
|
|
@@ -106,9 +107,9 @@ const c = 100, H = ({
|
|
|
106
107
|
scroll: "y",
|
|
107
108
|
wrap: "wrap",
|
|
108
109
|
children: [
|
|
109
|
-
|
|
110
|
+
x === "organization-selector" ? /* @__PURE__ */ e(j, { onClick: l, children: /* @__PURE__ */ i(o, { alignItems: "center", display: "flex", children: [
|
|
110
111
|
/* @__PURE__ */ e(
|
|
111
|
-
|
|
112
|
+
G,
|
|
112
113
|
{
|
|
113
114
|
icon: "square-plus",
|
|
114
115
|
iconColor: n.palette.gray[400],
|
|
@@ -120,11 +121,13 @@ const c = 100, H = ({
|
|
|
120
121
|
/* @__PURE__ */ e(h, { color: n.palette.gray[400], size: "md", children: "New organization" })
|
|
121
122
|
] }) }) : void 0,
|
|
122
123
|
s.map((r) => /* @__PURE__ */ e(
|
|
123
|
-
|
|
124
|
+
L,
|
|
124
125
|
{
|
|
125
|
-
isSelected:
|
|
126
|
+
isSelected: f.toLowerCase() === r.name,
|
|
127
|
+
itemAction: d,
|
|
126
128
|
label: r.name.charAt(0).toUpperCase() + r.name.slice(1),
|
|
127
|
-
onSelect:
|
|
129
|
+
onSelect: g,
|
|
130
|
+
value: r.name
|
|
128
131
|
},
|
|
129
132
|
r.name
|
|
130
133
|
))
|
|
@@ -136,10 +139,10 @@ const c = 100, H = ({
|
|
|
136
139
|
)
|
|
137
140
|
}
|
|
138
141
|
);
|
|
139
|
-
},
|
|
142
|
+
}, F = ({
|
|
140
143
|
isOpen: t = !0,
|
|
141
144
|
...l
|
|
142
|
-
}) => t ?
|
|
145
|
+
}) => t ? I(/* @__PURE__ */ e(N, { ...l }), document.body) : /* @__PURE__ */ e("div", {});
|
|
143
146
|
export {
|
|
144
|
-
|
|
147
|
+
F as GroupSelector
|
|
145
148
|
};
|
|
@@ -4,5 +4,6 @@ declare const config: Meta;
|
|
|
4
4
|
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IGroupSelectorProps>;
|
|
5
5
|
declare const Short: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IGroupSelectorProps>;
|
|
6
6
|
declare const OrganizationVariant: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IGroupSelectorProps>;
|
|
7
|
+
declare const OrganizationWithItemAction: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IGroupSelectorProps>;
|
|
7
8
|
export default config;
|
|
8
|
-
export { Short, Default, OrganizationVariant };
|
|
9
|
+
export { Short, Default, OrganizationVariant, OrganizationWithItemAction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OptionBoxContainer } from '../styles';
|
|
2
2
|
import { IOptionProps } from '../types';
|
|
3
|
-
declare const OptionContainer: ({ isSelected, label, onSelect, }: Readonly<IOptionProps>) => JSX.Element;
|
|
3
|
+
declare const OptionContainer: ({ isSelected, itemAction, label, onSelect, value, }: Readonly<IOptionProps>) => JSX.Element;
|
|
4
4
|
export { OptionContainer, OptionBoxContainer };
|
|
@@ -1,32 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as c } from "react";
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { OptionBoxContainer as
|
|
3
|
+
import { useTheme as f } from "styled-components";
|
|
4
|
+
import { OptionBoxContainer as a } from "../styles.js";
|
|
5
|
+
import { Container as d } from "../../container/index.js";
|
|
5
6
|
import { Icon as s } from "../../icon/index.js";
|
|
7
|
+
import { ItemAction as h } from "../../list-item/item-action/index.js";
|
|
6
8
|
import "../../typography/heading/index.js";
|
|
7
9
|
import "../../typography/span/index.js";
|
|
8
|
-
import { Text as
|
|
9
|
-
const
|
|
10
|
-
isSelected:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { Text as C } from "../../typography/text/index.js";
|
|
11
|
+
const T = ({
|
|
12
|
+
isSelected: n = !1,
|
|
13
|
+
itemAction: o,
|
|
14
|
+
label: i,
|
|
15
|
+
onSelect: t,
|
|
16
|
+
value: e
|
|
13
17
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const m = f(), p = c(() => {
|
|
19
|
+
t && t(i);
|
|
20
|
+
}, [t, i]);
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
22
|
+
a,
|
|
23
|
+
{
|
|
24
|
+
$hasAction: o !== void 0,
|
|
25
|
+
$isSelected: n,
|
|
26
|
+
onClick: p,
|
|
27
|
+
children: [
|
|
28
|
+
n && o === void 0 ? /* @__PURE__ */ r(
|
|
29
|
+
s,
|
|
30
|
+
{
|
|
31
|
+
icon: "check",
|
|
32
|
+
iconColor: m.palette.gray[800],
|
|
33
|
+
iconSize: "lg"
|
|
34
|
+
}
|
|
35
|
+
) : null,
|
|
36
|
+
/* @__PURE__ */ r(d, { flexGrow: o === void 0 ? void 0 : 1, children: /* @__PURE__ */ r(C, { color: m.palette.gray[800], fontWeight: "bold", size: "md", children: i }) }),
|
|
37
|
+
o === void 0 ? null : /* @__PURE__ */ r(h, { action: o, value: e })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
28
41
|
};
|
|
29
42
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
a as OptionBoxContainer,
|
|
44
|
+
T as OptionContainer
|
|
32
45
|
};
|
|
@@ -3,9 +3,11 @@ declare const StyledGroupContainer: import('styled-components/dist/types').IStyl
|
|
|
3
3
|
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$itemsLength"> & {
|
|
4
4
|
$itemsLength: number;
|
|
5
5
|
}, never>>> & string;
|
|
6
|
-
declare const OptionBoxContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
6
|
+
declare const OptionBoxContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hasAction" | "$isSelected"> & {
|
|
7
|
+
$hasAction?: boolean;
|
|
7
8
|
$isSelected?: boolean;
|
|
8
|
-
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
9
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hasAction" | "$isSelected"> & {
|
|
10
|
+
$hasAction?: boolean;
|
|
9
11
|
$isSelected?: boolean;
|
|
10
12
|
}, never>>> & string;
|
|
11
13
|
export { StyledGroupContainer, OptionBoxContainer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const
|
|
1
|
+
import { styled as d } from "styled-components";
|
|
2
|
+
const p = d.div`
|
|
3
3
|
${({ theme: i, $itemsLength: r }) => `
|
|
4
4
|
display: flex;
|
|
5
5
|
background-color: ${i.palette.white};
|
|
@@ -18,25 +18,25 @@ const o = a.div`
|
|
|
18
18
|
width: 507px;
|
|
19
19
|
}
|
|
20
20
|
`}
|
|
21
|
-
`,
|
|
22
|
-
${({ theme: i, $
|
|
21
|
+
`, n = d.div`
|
|
22
|
+
${({ theme: i, $hasAction: r = !1, $isSelected: a }) => `
|
|
23
23
|
align-items: center;
|
|
24
|
-
background-color: ${
|
|
24
|
+
background-color: ${a ? i.palette.gray[100] : i.palette.white};
|
|
25
25
|
border: 1px solid ${i.palette.gray[200]};
|
|
26
26
|
border-radius: ${i.spacing[0.25]};
|
|
27
27
|
cursor: pointer;
|
|
28
28
|
display: flex;
|
|
29
|
-
flex-direction: ${r ? "row-reverse" : "row"};
|
|
29
|
+
flex-direction: ${a && !r ? "row-reverse" : "row"};
|
|
30
30
|
min-height: 50px;
|
|
31
31
|
padding: ${i.spacing[1]} ${i.spacing[0.625]};
|
|
32
32
|
width: 215px;
|
|
33
33
|
|
|
34
34
|
&:hover {
|
|
35
|
-
background-color: ${i.palette.gray[100]};
|
|
35
|
+
background-color: ${i.palette.gray[r ? 50 : 100]};
|
|
36
36
|
}
|
|
37
37
|
`}
|
|
38
38
|
`;
|
|
39
39
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
n as OptionBoxContainer,
|
|
41
|
+
p as StyledGroupContainer
|
|
42
42
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IItemAction } from '../list-item/types';
|
|
1
2
|
type TVariant = "organization-selector";
|
|
2
3
|
/**
|
|
3
4
|
* Item handlers.
|
|
@@ -5,9 +6,11 @@ type TVariant = "organization-selector";
|
|
|
5
6
|
* @property { Function } [handleNewOrganization] - Handle new organization.
|
|
6
7
|
* @property { Function } [onSelect] - Handle select item.
|
|
7
8
|
* @property { Function } [onClose] - Handle close.
|
|
9
|
+
* @property { IItemAction } [itemAction] - Action button rendered in every item.
|
|
8
10
|
*/
|
|
9
11
|
interface IItemHandlers {
|
|
10
12
|
handleNewOrganization?: () => void;
|
|
13
|
+
itemAction?: IItemAction;
|
|
11
14
|
onSelect?: (itemName: string) => void;
|
|
12
15
|
onClose?: () => void;
|
|
13
16
|
}
|
|
@@ -36,9 +39,11 @@ interface IGroupSelectorProps extends IItemHandlers {
|
|
|
36
39
|
* @extends IItemHandlers
|
|
37
40
|
* @property { boolean } [isSelected] - Option is selected.
|
|
38
41
|
* @property { string } label - Option label.
|
|
42
|
+
* @property { string } value - Option value passed to the item action.
|
|
39
43
|
*/
|
|
40
44
|
interface IOptionProps extends IItemHandlers {
|
|
41
45
|
isSelected?: boolean;
|
|
42
46
|
label: string;
|
|
47
|
+
value: string;
|
|
43
48
|
}
|
|
44
49
|
export type { IGroupSelectorProps, IOptionProps, TVariant };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListItemsWrapper } from './styles';
|
|
2
2
|
import { IListItemProps } from './types';
|
|
3
|
-
declare const ListItem: ({ children, disabled, icon, iconType, href, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<IListItemProps>) => JSX.Element;
|
|
3
|
+
declare const ListItem: ({ children, disabled, icon, iconType, href, itemAction, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<IListItemProps>) => JSX.Element;
|
|
4
4
|
export type { IListItemProps };
|
|
5
5
|
export { ListItem, ListItemsWrapper };
|
|
@@ -1,64 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Children as
|
|
3
|
-
import { useTheme as
|
|
1
|
+
import { jsxs as x, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Children as g, isValidElement as I, cloneElement as L } from "react";
|
|
3
|
+
import { useTheme as k } from "styled-components";
|
|
4
|
+
import { ItemAction as j } from "./item-action/index.js";
|
|
4
5
|
import { Li as z } from "./styles.js";
|
|
5
|
-
import { ListItemsWrapper as
|
|
6
|
+
import { ListItemsWrapper as J } from "./styles.js";
|
|
6
7
|
import { Container as E } from "../container/index.js";
|
|
7
8
|
import { Icon as C } from "../icon/index.js";
|
|
8
9
|
import { Link as S } from "../link/index.js";
|
|
9
|
-
const
|
|
10
|
-
children:
|
|
10
|
+
const D = ({
|
|
11
|
+
children: m,
|
|
11
12
|
disabled: o = !1,
|
|
12
|
-
icon:
|
|
13
|
-
iconType:
|
|
14
|
-
href:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
icon: n,
|
|
14
|
+
iconType: l = "fa-light",
|
|
15
|
+
href: s,
|
|
16
|
+
itemAction: r,
|
|
17
|
+
onClick: h,
|
|
18
|
+
onClickIcon: u,
|
|
19
|
+
onKeyDown: v,
|
|
20
|
+
rightIcon: p,
|
|
21
|
+
selected: a = !1,
|
|
22
|
+
value: t,
|
|
23
|
+
...d
|
|
22
24
|
}) => {
|
|
23
|
-
const
|
|
25
|
+
const f = k().palette.gray[o ? 300 : 800], c = o ? g.map(m, (e) => I(e) ? L(e, {
|
|
24
26
|
disabled: o,
|
|
25
|
-
...
|
|
26
|
-
}) :
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
...e.props
|
|
28
|
+
}) : e) : m;
|
|
29
|
+
return /* @__PURE__ */ x(
|
|
28
30
|
z,
|
|
29
31
|
{
|
|
32
|
+
$hasAction: r !== void 0,
|
|
30
33
|
"aria-disabled": o,
|
|
31
|
-
"aria-label":
|
|
32
|
-
"aria-selected":
|
|
33
|
-
"data-testid":
|
|
34
|
-
onClick:
|
|
35
|
-
onKeyDown:
|
|
36
|
-
value:
|
|
37
|
-
...
|
|
34
|
+
"aria-label": t,
|
|
35
|
+
"aria-selected": a,
|
|
36
|
+
"data-testid": t,
|
|
37
|
+
onClick: h,
|
|
38
|
+
onKeyDown: v,
|
|
39
|
+
value: t,
|
|
40
|
+
...d,
|
|
38
41
|
children: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
n !== void 0 || t !== void 0 ? /* @__PURE__ */ x(
|
|
43
|
+
E,
|
|
44
|
+
{
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
display: "flex",
|
|
47
|
+
flexGrow: r === void 0 ? void 0 : 1,
|
|
48
|
+
gap: 0.625,
|
|
49
|
+
children: [
|
|
50
|
+
n ? /* @__PURE__ */ i(
|
|
51
|
+
C,
|
|
52
|
+
{
|
|
53
|
+
disabled: o,
|
|
54
|
+
icon: n,
|
|
55
|
+
iconColor: f,
|
|
56
|
+
iconSize: "sm",
|
|
57
|
+
iconType: l
|
|
58
|
+
}
|
|
59
|
+
) : null,
|
|
60
|
+
s === void 0 ? c : /* @__PURE__ */ i(S, { href: s, children: c })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
) : null,
|
|
64
|
+
r === void 0 ? null : /* @__PURE__ */ i(
|
|
65
|
+
j,
|
|
66
|
+
{
|
|
67
|
+
action: r,
|
|
68
|
+
disabled: o,
|
|
69
|
+
value: t ?? ""
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
r === void 0 && (a || p) ? /* @__PURE__ */ i(
|
|
53
73
|
C,
|
|
54
74
|
{
|
|
55
75
|
disabled: o,
|
|
56
|
-
icon:
|
|
76
|
+
icon: p ?? "check",
|
|
57
77
|
iconClass: "selected",
|
|
58
|
-
iconColor:
|
|
78
|
+
iconColor: f,
|
|
59
79
|
iconSize: "lg",
|
|
60
|
-
iconType:
|
|
61
|
-
onClick:
|
|
80
|
+
iconType: l,
|
|
81
|
+
onClick: u
|
|
62
82
|
}
|
|
63
83
|
) : null
|
|
64
84
|
]
|
|
@@ -66,6 +86,6 @@ const A = ({
|
|
|
66
86
|
);
|
|
67
87
|
};
|
|
68
88
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
89
|
+
D as ListItem,
|
|
90
|
+
J as ListItemsWrapper
|
|
71
91
|
};
|
|
@@ -4,5 +4,6 @@ declare const config: Meta;
|
|
|
4
4
|
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<IListItemProps>>;
|
|
5
5
|
declare const WithCheckbox: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<IListItemProps>>;
|
|
6
6
|
declare const WithRadioButton: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<IListItemProps>>;
|
|
7
|
+
declare const WithItemAction: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, Readonly<IListItemProps>>;
|
|
7
8
|
export default config;
|
|
8
|
-
export { Default, WithCheckbox, WithRadioButton };
|
|
9
|
+
export { Default, WithCheckbox, WithItemAction, WithRadioButton };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as e } from "react";
|
|
3
|
+
import { StyledItemAction as h } from "./styles.js";
|
|
4
|
+
import { Button as d } from "../../button/index.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
action: i,
|
|
7
|
+
disabled: c = !1,
|
|
8
|
+
value: n
|
|
9
|
+
}) => {
|
|
10
|
+
const { icon: s, label: l, onClick: t, showOnHover: a = !0 } = i, m = e(
|
|
11
|
+
(o) => {
|
|
12
|
+
o.stopPropagation(), t(n);
|
|
13
|
+
},
|
|
14
|
+
[t, n]
|
|
15
|
+
), p = e(
|
|
16
|
+
(o) => {
|
|
17
|
+
o.stopPropagation();
|
|
18
|
+
},
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ r(h, { $showOnHover: a, children: /* @__PURE__ */ r(
|
|
22
|
+
d,
|
|
23
|
+
{
|
|
24
|
+
disabled: c,
|
|
25
|
+
icon: s,
|
|
26
|
+
iconSize: "sm",
|
|
27
|
+
onClick: m,
|
|
28
|
+
onKeyDown: p,
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
children: l
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
g as ItemAction
|
|
36
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const StyledItemAction: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$showOnHover"> & {
|
|
2
|
+
$showOnHover: boolean;
|
|
3
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$showOnHover"> & {
|
|
4
|
+
$showOnHover: boolean;
|
|
5
|
+
}, never>>> & string;
|
|
6
|
+
export { StyledItemAction };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { styled as t } from "styled-components";
|
|
2
|
+
const e = t.span`
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
|
|
6
|
+
${({ $showOnHover: i }) => i ? `
|
|
7
|
+
opacity: 0;
|
|
8
|
+
|
|
9
|
+
*:hover > &,
|
|
10
|
+
*:focus-within > & {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
` : ""}
|
|
14
|
+
`;
|
|
15
|
+
export {
|
|
16
|
+
e as StyledItemAction
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IItemAction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Item action component props.
|
|
4
|
+
* @interface IItemActionProps
|
|
5
|
+
* @property { IItemAction } action - The action to render.
|
|
6
|
+
* @property { boolean } [disabled] - Whether the action is disabled.
|
|
7
|
+
* @property { string } value - The item value passed to the action.
|
|
8
|
+
*/
|
|
9
|
+
interface IItemActionProps {
|
|
10
|
+
action: IItemAction;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export type { IItemActionProps };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
declare const Li: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('
|
|
1
|
+
declare const Li: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$hasAction"> & {
|
|
2
|
+
$hasAction: boolean;
|
|
3
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$hasAction"> & {
|
|
4
|
+
$hasAction: boolean;
|
|
5
|
+
}, never>>> & string;
|
|
2
6
|
declare const ListItemsWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>>> & string;
|
|
3
7
|
export { Li, ListItemsWrapper };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const
|
|
3
|
-
${({ theme: a }) => `
|
|
1
|
+
import { styled as o } from "styled-components";
|
|
2
|
+
const p = o.li`
|
|
3
|
+
${({ theme: a, $hasAction: r }) => `
|
|
4
4
|
align-items: center;
|
|
5
5
|
background-color: ${a.palette.white};
|
|
6
6
|
color: ${a.palette.gray[800]};
|
|
@@ -14,7 +14,7 @@ const i = r.li`
|
|
|
14
14
|
list-style-type: none;
|
|
15
15
|
min-height: 40px;
|
|
16
16
|
min-width: 240px;
|
|
17
|
-
padding: ${a.spacing[0.625]} ${a.spacing[1]};
|
|
17
|
+
padding: ${r ? `6px ${a.spacing[0.5]}` : `${a.spacing[0.625]} ${a.spacing[1]}`};
|
|
18
18
|
|
|
19
19
|
p,
|
|
20
20
|
a {
|
|
@@ -39,14 +39,14 @@ const i = r.li`
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&[aria-selected="true"] {
|
|
42
|
-
background-color: ${a.palette.gray[200]};
|
|
42
|
+
background-color: ${a.palette.gray[r ? 100 : 200]};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
&:hover:not([aria-selected="true"]) {
|
|
46
|
-
background-color: ${a.palette.gray[100]};
|
|
46
|
+
background-color: ${a.palette.gray[r ? 50 : 100]};
|
|
47
47
|
}
|
|
48
48
|
`}
|
|
49
|
-
`,
|
|
49
|
+
`, l = o.ul`
|
|
50
50
|
${({ theme: a }) => `
|
|
51
51
|
background-color: ${a.palette.white};
|
|
52
52
|
border: 1px solid ${a.palette.gray[200]};
|
|
@@ -59,6 +59,6 @@ const i = r.li`
|
|
|
59
59
|
`}
|
|
60
60
|
`;
|
|
61
61
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
p as Li,
|
|
63
|
+
l as ListItemsWrapper
|
|
64
64
|
};
|
|
@@ -11,6 +11,20 @@ interface ILabelProps {
|
|
|
11
11
|
color: string;
|
|
12
12
|
href?: string;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Item action props.
|
|
16
|
+
* @interface IItemAction
|
|
17
|
+
* @property { IIconModifiable["icon"] } icon - The icon of the action button.
|
|
18
|
+
* @property { string } label - The label of the action button.
|
|
19
|
+
* @property { Function } onClick - The function to call with the item value when the action is clicked.
|
|
20
|
+
* @property { boolean } [showOnHover] - Whether the action shows only while the item is hovered or focused.
|
|
21
|
+
*/
|
|
22
|
+
interface IItemAction {
|
|
23
|
+
icon: IIconModifiable["icon"];
|
|
24
|
+
label: string;
|
|
25
|
+
onClick: (value: string) => void;
|
|
26
|
+
showOnHover?: boolean;
|
|
27
|
+
}
|
|
14
28
|
/**
|
|
15
29
|
* List item component props.
|
|
16
30
|
* @interface IListItemProps
|
|
@@ -22,6 +36,7 @@ interface ILabelProps {
|
|
|
22
36
|
* @property { string } [value] - The value for the list item.
|
|
23
37
|
* @property { IIconModifiable["icon"] } [rightIcon] - The icon for the right side of the list item.
|
|
24
38
|
* @property { IIconProps["onClick"] } [onClickIcon] - The function to call when the icon on the left side is clicked.
|
|
39
|
+
* @property { IItemAction } [itemAction] - The action button on the right side of the list item. When set, `rightIcon` and the selected check are not rendered.
|
|
25
40
|
*/
|
|
26
41
|
interface IListItemProps extends Partial<Pick<IIconModifiable, "icon" | "iconType">>, HTMLAttributes<HTMLLIElement>, HTMLProps<HTMLLIElement> {
|
|
27
42
|
href?: string;
|
|
@@ -29,5 +44,6 @@ interface IListItemProps extends Partial<Pick<IIconModifiable, "icon" | "iconTyp
|
|
|
29
44
|
value?: string;
|
|
30
45
|
rightIcon?: IIconModifiable["icon"];
|
|
31
46
|
onClickIcon?: IIconProps["onClick"];
|
|
47
|
+
itemAction?: IItemAction;
|
|
32
48
|
}
|
|
33
|
-
export type { IListItemProps, ILabelProps };
|
|
49
|
+
export type { IItemAction, IListItemProps, ILabelProps };
|
|
@@ -4,6 +4,7 @@ import { useTheme as x } from "styled-components";
|
|
|
4
4
|
import { Container as t } from "../container/index.js";
|
|
5
5
|
import { Divider as s } from "../divider/index.js";
|
|
6
6
|
import "react";
|
|
7
|
+
import "../button/index.js";
|
|
7
8
|
import { ListItemsWrapper as y } from "../list-item/styles.js";
|
|
8
9
|
import "../icon/index.js";
|
|
9
10
|
import { Tag as v } from "../tag/index.js";
|
|
@@ -11,7 +12,7 @@ import "../typography/heading/index.js";
|
|
|
11
12
|
import "../typography/span/index.js";
|
|
12
13
|
import { Text as o } from "../typography/text/index.js";
|
|
13
14
|
import { useClickOutside as z } from "../../hooks/use-click-outside.js";
|
|
14
|
-
const
|
|
15
|
+
const M = ({
|
|
15
16
|
children: a,
|
|
16
17
|
commitShortSha: l,
|
|
17
18
|
parentElement: d,
|
|
@@ -56,5 +57,5 @@ const I = ({
|
|
|
56
57
|
] });
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
M as Menu
|
|
60
61
|
};
|
|
@@ -6,5 +6,5 @@ declare const StyledReorderItem: import('styled-components/dist/types').IStyledC
|
|
|
6
6
|
ref?: ((instance: HTMLLIElement | 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<HTMLLIElement> | null | undefined;
|
|
7
7
|
}, "$isDragging"> & {
|
|
8
8
|
$isDragging?: boolean;
|
|
9
|
-
}, never>>> & string & Omit<({ children, disabled, icon, iconType, href, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<import('../../../list-item').IListItemProps>) => JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
9
|
+
}, never>>> & string & Omit<({ children, disabled, icon, iconType, href, itemAction, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<import('../../../list-item').IListItemProps>) => JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
10
10
|
export { StyledReorderItem };
|
|
@@ -2,5 +2,5 @@ declare const StyledList: import('styled-components/dist/types').IStyledComponen
|
|
|
2
2
|
ref?: ((instance: HTMLLIElement | 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<HTMLLIElement> | null | undefined;
|
|
3
3
|
}, never> & Partial<Pick<Omit<Readonly<import('../../../list-item').IListItemProps>, "ref"> & {
|
|
4
4
|
ref?: ((instance: HTMLLIElement | 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<HTMLLIElement> | null | undefined;
|
|
5
|
-
}, never>>> & string & Omit<({ children, disabled, icon, iconType, href, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<import('../../../list-item').IListItemProps>) => JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
5
|
+
}, never>>> & string & Omit<({ children, disabled, icon, iconType, href, itemAction, onClick, onClickIcon, onKeyDown, rightIcon, selected, value, ...props }: Readonly<import('../../../list-item').IListItemProps>) => JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
6
6
|
export { StyledList };
|
|
@@ -9,7 +9,6 @@ import { Thumb as k } from "./thumb/index.js";
|
|
|
9
9
|
import { normalizeValue as v } from "./utils.js";
|
|
10
10
|
import { Container as w } from "../container/index.js";
|
|
11
11
|
import { OutlineContainer as y } from "../inputs/outline-container/index.js";
|
|
12
|
-
import "../inputs/styles.js";
|
|
13
12
|
import "../checkbox/index.js";
|
|
14
13
|
import "../icon/index.js";
|
|
15
14
|
import "../../_virtual/lodash.js";
|
|
@@ -23,7 +22,7 @@ import "react-dom";
|
|
|
23
22
|
import "../layout/categories/buttons/index.js";
|
|
24
23
|
import "../inputs/utils/action-button/index.js";
|
|
25
24
|
import "../../node_modules/react-international-phone/dist/index.js";
|
|
26
|
-
const
|
|
25
|
+
const ee = (o) => {
|
|
27
26
|
const p = S(), m = $(null), { label: s, minValue: i = 0, maxValue: n = 100, name: r, setValue: d, watch: c } = o, a = x(), t = V({
|
|
28
27
|
...o,
|
|
29
28
|
numberFormatter: a,
|
|
@@ -76,6 +75,6 @@ const re = (o) => {
|
|
|
76
75
|
) });
|
|
77
76
|
};
|
|
78
77
|
export {
|
|
79
|
-
|
|
78
|
+
ee as Slider,
|
|
80
79
|
x as useNumberFormatter
|
|
81
80
|
};
|
|
@@ -13,5 +13,6 @@ declare const TableWithMultiSelection: import('storybook/internal/csf').Annotate
|
|
|
13
13
|
declare const TableWithSingleSelection: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ITable<IRandomData>>;
|
|
14
14
|
declare const TableWithRowSelection: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ITable<IRandomData>>;
|
|
15
15
|
declare const MultiSelectRowClick: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ITable<IRandomData>>;
|
|
16
|
-
|
|
16
|
+
declare const TableWithOverflow: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ITable<IRandomData>>;
|
|
17
|
+
export { Default, TableWithFilters, TableWithExpanding, TableWithMultiSelection, TableWithSingleSelection, TableWithRowSelection, MultiSelectRowClick, TableWithOverflow, };
|
|
17
18
|
export default config;
|
|
@@ -10,6 +10,12 @@ const i = r.div`
|
|
|
10
10
|
margin-left: -3px;
|
|
11
11
|
padding-left: 3px;
|
|
12
12
|
padding-bottom: 5px;
|
|
13
|
+
|
|
14
|
+
@media (hover: hover) {
|
|
15
|
+
&:not(:hover, :focus-within) {
|
|
16
|
+
scrollbar-color: transparent transparent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
table {
|
|
@@ -251,6 +257,10 @@ const i = r.div`
|
|
|
251
257
|
transition: all 150ms;
|
|
252
258
|
border-right: 1px solid ${({ theme: t }) => t.palette.black};
|
|
253
259
|
}
|
|
260
|
+
|
|
261
|
+
th:last-child > & {
|
|
262
|
+
right: 0;
|
|
263
|
+
}
|
|
254
264
|
`;
|
|
255
265
|
export {
|
|
256
266
|
i as TableContainer,
|
|
@@ -1,63 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { TableContext as
|
|
4
|
-
import { TableContainer as
|
|
5
|
-
import { useMountEffect as
|
|
6
|
-
const
|
|
7
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useState as x, useCallback as m } from "react";
|
|
3
|
+
import { TableContext as z } from "../context/index.js";
|
|
4
|
+
import { TableContainer as y } from "../styles.js";
|
|
5
|
+
import { useMountEffect as u } from "../../../hooks/use-mount-effect.js";
|
|
6
|
+
const C = 160, f = (t) => Number.parseFloat(t) || 0, E = (t) => {
|
|
7
|
+
const { paddingLeft: e, paddingRight: n } = getComputedStyle(t);
|
|
8
|
+
return t.clientWidth - f(e) - f(n);
|
|
9
|
+
}, M = ({
|
|
10
|
+
children: t,
|
|
8
11
|
table: e
|
|
9
12
|
}) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
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);
|
|
14
|
+
u(() => {
|
|
15
|
+
const o = () => {
|
|
16
|
+
const r = n.current ? E(n.current) : 0;
|
|
14
17
|
R(
|
|
15
|
-
(
|
|
18
|
+
(d) => d === r ? d : r
|
|
16
19
|
);
|
|
17
20
|
};
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
|
|
21
|
+
o();
|
|
22
|
+
const c = n.current;
|
|
23
|
+
if (c && typeof ResizeObserver < "u") {
|
|
24
|
+
const r = new ResizeObserver(o);
|
|
25
|
+
return r.observe(c), () => {
|
|
26
|
+
r.disconnect();
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
|
-
return window.addEventListener("resize",
|
|
27
|
-
window.removeEventListener("resize",
|
|
29
|
+
return window.addEventListener("resize", o), () => {
|
|
30
|
+
window.removeEventListener("resize", o);
|
|
28
31
|
};
|
|
29
32
|
});
|
|
30
33
|
const T = Math.max(
|
|
31
34
|
v,
|
|
32
|
-
e.getTotalSize() +
|
|
33
|
-
),
|
|
35
|
+
e.getTotalSize() + C
|
|
36
|
+
), i = m(() => {
|
|
34
37
|
e.resetRowSelection();
|
|
35
|
-
}, [e]),
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
+
}, [e]), b = m(
|
|
39
|
+
(o) => {
|
|
40
|
+
o.key === "Enter" && i();
|
|
38
41
|
},
|
|
39
|
-
[
|
|
42
|
+
[i]
|
|
40
43
|
);
|
|
41
|
-
return
|
|
44
|
+
return u(() => {
|
|
42
45
|
e.setPageIndex(0);
|
|
43
|
-
}), /* @__PURE__ */
|
|
44
|
-
|
|
46
|
+
}), /* @__PURE__ */ a(
|
|
47
|
+
z.Provider,
|
|
45
48
|
{
|
|
46
49
|
value: {
|
|
47
|
-
containerRef:
|
|
48
|
-
elementName:
|
|
49
|
-
handleUnselectAll:
|
|
50
|
-
hidden:
|
|
51
|
-
onKeyDown:
|
|
52
|
-
selected:
|
|
50
|
+
containerRef: n,
|
|
51
|
+
elementName: w,
|
|
52
|
+
handleUnselectAll: i,
|
|
53
|
+
hidden: g,
|
|
54
|
+
onKeyDown: b,
|
|
55
|
+
selected: s,
|
|
53
56
|
tableSize: T,
|
|
54
|
-
tableRef:
|
|
57
|
+
tableRef: p,
|
|
55
58
|
table: e
|
|
56
59
|
},
|
|
57
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ a(y, { id: h, children: t })
|
|
58
61
|
}
|
|
59
62
|
);
|
|
60
63
|
};
|
|
61
64
|
export {
|
|
62
|
-
|
|
65
|
+
M as Table
|
|
63
66
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import E, { useMemo as J, useCallback as Q, useRef as N, useState as nt, useEffect as F, isValidElement as dt, cloneElement as ht } from "react";
|
|
2
2
|
import { useMemoDeepCompare as $t, usePrevious as xt, useMount as Ut, useUpdateEffect as Mt, useWindowSize as jt } from "../../@gilbarbara/hooks/dist/index.js";
|
|
3
|
-
import { s as Ht } from "../../../_virtual/
|
|
3
|
+
import { s as Ht } from "../../../_virtual/index2.js";
|
|
4
4
|
import z from "../../is-lite/dist/index.js";
|
|
5
|
-
import ut from "../../../_virtual/
|
|
6
|
-
import Yt from "../../../_virtual/
|
|
5
|
+
import ut from "../../../_virtual/index3.js";
|
|
6
|
+
import Yt from "../../../_virtual/index4.js";
|
|
7
7
|
import It from "../../@gilbarbara/deep-equal/dist/index.js";
|
|
8
|
-
import zt from "../../../_virtual/
|
|
8
|
+
import zt from "../../../_virtual/index5.js";
|
|
9
9
|
import Nt from "../../../_virtual/scrollparent.js";
|
|
10
10
|
import { createPortal as Wt } from "react-dom";
|
|
11
11
|
import { offset as yt, shift as Kt, arrow as Gt, useFloating as Et, autoPlacement as Vt, flip as Jt } from "../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../_virtual/
|
|
1
|
+
import { __module as r } from "../../../_virtual/index.js";
|
|
2
2
|
import { __require as o } from "../cjs/use-sync-external-store-shim.production.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.development.js";
|
|
4
4
|
var e;
|
package/package.json
CHANGED