@fluidattacks/design 11.1.1 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/index.js +60 -60
- package/dist/components/button/index.stories.d.ts +2 -1
- package/dist/components/button/index.test.d.ts +1 -0
- package/dist/components/charts/data-number/index.d.ts +4 -0
- package/dist/components/charts/data-number/index.js +75 -0
- package/dist/components/charts/data-number/index.stories.d.ts +10 -0
- package/dist/components/charts/data-number/index.test.d.ts +1 -0
- package/dist/components/charts/data-number/types.d.ts +32 -0
- package/dist/components/charts/data-number/utils.d.ts +2 -0
- package/dist/components/charts/data-number/utils.js +4 -0
- package/dist/components/charts/index.d.ts +3 -0
- package/dist/components/charts/index.js +4 -0
- package/dist/components/filters/context/types.d.ts +2 -0
- package/dist/components/filters/index.js +120 -116
- package/dist/components/filters/index.stories.d.ts +2 -1
- package/dist/components/filters/options-menu/index.js +74 -73
- package/dist/components/filters/types.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts +6 -0
- package/dist/components/skeleton/index.js +18 -0
- package/dist/components/skeleton/index.stories.d.ts +8 -0
- package/dist/components/skeleton/index.test.d.ts +1 -0
- package/dist/components/skeleton/styles.d.ts +5 -0
- package/dist/components/skeleton/styles.js +33 -0
- package/dist/components/skeleton/types.d.ts +24 -0
- package/dist/components/stepper/index.d.ts +1 -1
- package/dist/components/stepper/index.js +16 -15
- package/dist/components/stepper/styles.d.ts +5 -1
- package/dist/components/stepper/styles.js +6 -0
- package/dist/components/stepper/types.d.ts +2 -0
- package/dist/components/tabs/index.js +27 -25
- package/dist/components/tabs/index.stories.d.ts +1 -2
- package/dist/components/tabs/tab/index.d.ts +1 -1
- package/dist/components/tabs/tab/index.js +25 -28
- package/dist/components/tabs/types.d.ts +7 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +304 -300
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ActiveFilters as
|
|
7
|
-
import { FiltersContext as
|
|
8
|
-
import { FiltersMenu as
|
|
9
|
-
import { useFilterCalendarState as
|
|
10
|
-
import { OptionsMenu as
|
|
11
|
-
import { partitionFilters as
|
|
12
|
-
import { useClickOutside as
|
|
13
|
-
import { useFiltersValues as
|
|
14
|
-
import { useModal as
|
|
15
|
-
import { getPathname as
|
|
16
|
-
import { Button as
|
|
17
|
-
import { Container as
|
|
18
|
-
import { Toggle as
|
|
19
|
-
const
|
|
20
|
-
disabled:
|
|
1
|
+
import { jsx as u, jsxs as oe } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ne, useState as v, useMemo as y, useCallback as c, useImperativeHandle as le, createElement as se, useContext as re } from "react";
|
|
3
|
+
import { useFloating as V } from "../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
|
|
4
|
+
import ie from "../../_virtual/isEmpty.js";
|
|
5
|
+
import ae from "../../_virtual/lowerFirst.js";
|
|
6
|
+
import { ActiveFilters as Qe } from "./active-filters/index.js";
|
|
7
|
+
import { FiltersContext as P } from "./context/index.js";
|
|
8
|
+
import { FiltersMenu as ce } from "./filters-menu/index.js";
|
|
9
|
+
import { useFilterCalendarState as me, useFilterSearchState as pe, useFilterScrollState as ue } from "./hooks.js";
|
|
10
|
+
import { OptionsMenu as fe } from "./options-menu/index.js";
|
|
11
|
+
import { partitionFilters as de, getSelectedFilter as he, getGroupedFilters as ge, MAX_FILTERS_LENGTH as Fe } from "./utils.js";
|
|
12
|
+
import { useClickOutside as ve } from "../../hooks/use-click-outside.js";
|
|
13
|
+
import { useFiltersValues as Ce } from "../../hooks/use-filters.js";
|
|
14
|
+
import { useModal as be } from "../../hooks/use-modal.js";
|
|
15
|
+
import { getPathname as Oe, clearStorage as H } from "../../utils/storage.js";
|
|
16
|
+
import { Button as Se } from "../button/index.js";
|
|
17
|
+
import { Container as ke } from "../container/index.js";
|
|
18
|
+
import { Toggle as Te } from "../toggle/index.js";
|
|
19
|
+
const w = "y", xe = ({
|
|
20
|
+
disabled: m,
|
|
21
21
|
id: t,
|
|
22
22
|
label: f,
|
|
23
23
|
tooltip: i
|
|
24
24
|
}) => {
|
|
25
|
-
const { values: d, setValues: e } =
|
|
25
|
+
const { values: d, setValues: e } = re(P), a = d[t] === w, l = c(() => {
|
|
26
26
|
e((s) => ({
|
|
27
27
|
...s,
|
|
28
|
-
[t]: s[t] ===
|
|
28
|
+
[t]: s[t] === w ? "" : w
|
|
29
29
|
}));
|
|
30
30
|
}, [t, e]);
|
|
31
31
|
return /* @__PURE__ */ u(
|
|
32
|
-
|
|
32
|
+
Te,
|
|
33
33
|
{
|
|
34
34
|
defaultChecked: a,
|
|
35
|
-
disabled:
|
|
35
|
+
disabled: m,
|
|
36
36
|
leftText: f,
|
|
37
37
|
name: t,
|
|
38
38
|
onChange: l,
|
|
@@ -40,8 +40,8 @@ const R = "y", Te = ({
|
|
|
40
40
|
variant: "inline"
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
|
-
},
|
|
44
|
-
disabled:
|
|
43
|
+
}, Ge = ({
|
|
44
|
+
disabled: m,
|
|
45
45
|
filters: t,
|
|
46
46
|
tooltip: f,
|
|
47
47
|
filterState: i,
|
|
@@ -50,117 +50,119 @@ const R = "y", Te = ({
|
|
|
50
50
|
filterId: a,
|
|
51
51
|
setFilterId: l,
|
|
52
52
|
onButtonClick: s,
|
|
53
|
-
onOutsideClick:
|
|
54
|
-
width:
|
|
55
|
-
justify:
|
|
53
|
+
onOutsideClick: h,
|
|
54
|
+
width: p,
|
|
55
|
+
justify: g,
|
|
56
56
|
imperativeRef: S,
|
|
57
|
-
hideMenuSearch: k = !1
|
|
57
|
+
hideMenuSearch: k = !1,
|
|
58
|
+
optionsSearchThreshold: T
|
|
58
59
|
}) => {
|
|
59
|
-
const o =
|
|
60
|
-
menu:
|
|
61
|
-
inline:
|
|
62
|
-
pinned:
|
|
63
|
-
} =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
68
|
-
(n,
|
|
69
|
-
|
|
60
|
+
const o = be("filters"), { calendarState: r } = me(), { searchState: C, updateSearch: F } = pe(), { scrollState: b } = ue(), [x, G] = v(""), [B, M] = v(null), { refs: E } = V({ placement: "bottom-start" }), { refs: A } = V({ placement: "right-end" }), { setFloating: U, setReference: X } = E, { setFloating: q } = A, { activeFilters: z, values: L, setValues: D } = i, { previousValue: J } = C, {
|
|
61
|
+
menu: N,
|
|
62
|
+
inline: Q,
|
|
63
|
+
pinned: W
|
|
64
|
+
} = y(() => de(t), [t]), { hideMenuTitle: Y, label: _, options: j } = he(
|
|
65
|
+
N,
|
|
66
|
+
x,
|
|
67
|
+
J
|
|
68
|
+
), Z = ge(N), $ = ie(a) || a === null || x !== a, I = !k && N.length > Fe, O = c(
|
|
69
|
+
(n, R) => {
|
|
70
|
+
G(n), l(n), M(R);
|
|
70
71
|
},
|
|
71
72
|
[l]
|
|
72
|
-
),
|
|
73
|
+
), K = c(
|
|
73
74
|
(n) => {
|
|
74
|
-
|
|
75
|
+
O(n, null);
|
|
75
76
|
},
|
|
76
|
-
[
|
|
77
|
-
),
|
|
78
|
-
o.isOpen || s(), o.toggle(),
|
|
79
|
-
}, [o, l, e, s]),
|
|
80
|
-
r.isOpen || (o.close(),
|
|
77
|
+
[O]
|
|
78
|
+
), ee = c(() => {
|
|
79
|
+
o.isOpen || s(), o.toggle(), G(""), l(null), M(null), e({ searchGlobal: "", searchFilter: "" });
|
|
80
|
+
}, [o, l, e, s]), te = c(() => {
|
|
81
|
+
r.isOpen || (o.close(), G(""), l(null), M(null), e({ searchGlobal: "", searchFilter: "" }), h());
|
|
81
82
|
}, [
|
|
82
83
|
r.isOpen,
|
|
83
84
|
o,
|
|
84
85
|
l,
|
|
85
86
|
e,
|
|
86
|
-
|
|
87
|
+
h
|
|
87
88
|
]);
|
|
88
|
-
return
|
|
89
|
+
return le(
|
|
89
90
|
S,
|
|
90
91
|
() => ({
|
|
91
|
-
openAndNavigate: (n,
|
|
92
|
-
o.isOpen || (s(), o.open()), e({ searchGlobal: "", searchFilter: "" }),
|
|
92
|
+
openAndNavigate: (n, R) => {
|
|
93
|
+
o.isOpen || (s(), o.open()), e({ searchGlobal: "", searchFilter: "" }), F({ previousValue: L[n] ?? "" }), O(n, R ?? null);
|
|
93
94
|
}
|
|
94
95
|
}),
|
|
95
|
-
[o, s, e,
|
|
96
|
-
),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
[
|
|
96
|
+
[o, s, e, F, L, O]
|
|
97
|
+
), ve(
|
|
98
|
+
E.floating,
|
|
99
|
+
te,
|
|
100
|
+
[E.reference, A.floating],
|
|
100
101
|
"[id^='popover-']"
|
|
101
102
|
), /* @__PURE__ */ u(
|
|
102
|
-
|
|
103
|
+
P.Provider,
|
|
103
104
|
{
|
|
104
105
|
value: {
|
|
105
|
-
id:
|
|
106
|
+
id: x,
|
|
106
107
|
calendarState: r,
|
|
107
|
-
searchState:
|
|
108
|
-
values:
|
|
109
|
-
scrollState:
|
|
108
|
+
searchState: C,
|
|
109
|
+
values: L,
|
|
110
|
+
scrollState: b,
|
|
110
111
|
searchValues: d,
|
|
111
112
|
setSearchValues: e,
|
|
112
|
-
setValues:
|
|
113
|
-
updateSearch:
|
|
114
|
-
navMode:
|
|
113
|
+
setValues: D,
|
|
114
|
+
updateSearch: F,
|
|
115
|
+
navMode: B,
|
|
116
|
+
optionsSearchThreshold: T
|
|
115
117
|
},
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
|
|
118
|
+
children: /* @__PURE__ */ oe(
|
|
119
|
+
ke,
|
|
118
120
|
{
|
|
119
121
|
alignItems: "center",
|
|
120
122
|
display: "flex",
|
|
121
|
-
justify:
|
|
123
|
+
justify: g,
|
|
122
124
|
position: "relative",
|
|
123
|
-
width:
|
|
125
|
+
width: p,
|
|
124
126
|
wrap: "wrap",
|
|
125
127
|
children: [
|
|
126
128
|
/* @__PURE__ */ u(
|
|
127
|
-
|
|
129
|
+
Se,
|
|
128
130
|
{
|
|
129
131
|
"data-testid": "filter-btn",
|
|
130
|
-
disabled:
|
|
132
|
+
disabled: m,
|
|
131
133
|
icon: "filter",
|
|
132
134
|
id: "filter-btn",
|
|
133
|
-
onClick:
|
|
134
|
-
ref:
|
|
135
|
-
tag:
|
|
135
|
+
onClick: ee,
|
|
136
|
+
ref: X,
|
|
137
|
+
tag: z.toString(),
|
|
136
138
|
tooltip: f,
|
|
137
139
|
variant: "ghost"
|
|
138
140
|
}
|
|
139
141
|
),
|
|
140
142
|
o.isOpen ? /* @__PURE__ */ u(
|
|
141
|
-
|
|
143
|
+
ce,
|
|
142
144
|
{
|
|
143
|
-
groupedFilters:
|
|
144
|
-
handleChangeId:
|
|
145
|
-
includeSearch:
|
|
146
|
-
pinnedFilters:
|
|
147
|
-
ref:
|
|
145
|
+
groupedFilters: Z,
|
|
146
|
+
handleChangeId: K,
|
|
147
|
+
includeSearch: I,
|
|
148
|
+
pinnedFilters: W,
|
|
149
|
+
ref: U
|
|
148
150
|
}
|
|
149
151
|
) : void 0,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
$ ? void 0 : /* @__PURE__ */ u(
|
|
153
|
+
fe,
|
|
152
154
|
{
|
|
153
|
-
hideTitle:
|
|
154
|
-
label:
|
|
155
|
-
options:
|
|
156
|
-
ref:
|
|
155
|
+
hideTitle: Y,
|
|
156
|
+
label: j?.[0]?.formatLabel ?? !0 ? ae(_) : _,
|
|
157
|
+
options: j,
|
|
158
|
+
ref: q
|
|
157
159
|
}
|
|
158
160
|
),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
Q.map((n) => /* @__PURE__ */ se(
|
|
162
|
+
xe,
|
|
161
163
|
{
|
|
162
164
|
...n,
|
|
163
|
-
disabled:
|
|
165
|
+
disabled: m || n.disabled,
|
|
164
166
|
key: n.id
|
|
165
167
|
}
|
|
166
168
|
))
|
|
@@ -169,43 +171,45 @@ const R = "y", Te = ({
|
|
|
169
171
|
)
|
|
170
172
|
}
|
|
171
173
|
);
|
|
172
|
-
},
|
|
174
|
+
}, Me = ne(
|
|
173
175
|
({
|
|
174
|
-
disabled:
|
|
176
|
+
disabled: m = !1,
|
|
175
177
|
filters: t,
|
|
176
178
|
tooltip: f,
|
|
177
179
|
storageKey: i,
|
|
178
180
|
width: d,
|
|
179
181
|
justify: e,
|
|
180
|
-
hideMenuSearch: a = !1
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
hideMenuSearch: a = !1,
|
|
183
|
+
optionsSearchThreshold: l
|
|
184
|
+
}, s) => {
|
|
185
|
+
const [h] = v(Oe), p = y(() => i ?? h, [i, h]), g = Ce({ filters: t, storageKey: i }), [S, k] = v(null), [T, o] = v({
|
|
183
186
|
searchGlobal: "",
|
|
184
187
|
searchFilter: ""
|
|
185
|
-
}), r =
|
|
186
|
-
() => Object.values(
|
|
187
|
-
(
|
|
188
|
+
}), r = y(
|
|
189
|
+
() => Object.values(g.values).some(
|
|
190
|
+
(b) => !!b && b !== "undefined"
|
|
188
191
|
),
|
|
189
|
-
[
|
|
190
|
-
),
|
|
191
|
-
r ||
|
|
192
|
-
}, [r,
|
|
193
|
-
r ||
|
|
194
|
-
}, [r,
|
|
192
|
+
[g.values]
|
|
193
|
+
), C = c(() => {
|
|
194
|
+
r || H(p);
|
|
195
|
+
}, [r, p]), F = c(() => {
|
|
196
|
+
r || H(p);
|
|
197
|
+
}, [r, p]);
|
|
195
198
|
return /* @__PURE__ */ u(
|
|
196
|
-
|
|
199
|
+
Ge,
|
|
197
200
|
{
|
|
198
|
-
disabled:
|
|
199
|
-
filterId:
|
|
200
|
-
filterState:
|
|
201
|
+
disabled: m,
|
|
202
|
+
filterId: S,
|
|
203
|
+
filterState: g,
|
|
201
204
|
filters: t,
|
|
202
205
|
hideMenuSearch: a,
|
|
203
|
-
imperativeRef:
|
|
206
|
+
imperativeRef: s,
|
|
204
207
|
justify: e,
|
|
205
|
-
onButtonClick:
|
|
206
|
-
onOutsideClick:
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
onButtonClick: C,
|
|
209
|
+
onOutsideClick: F,
|
|
210
|
+
optionsSearchThreshold: l,
|
|
211
|
+
searchValues: T,
|
|
212
|
+
setFilterId: k,
|
|
209
213
|
setSearchValues: o,
|
|
210
214
|
tooltip: f,
|
|
211
215
|
width: d
|
|
@@ -213,9 +217,9 @@ const R = "y", Te = ({
|
|
|
213
217
|
);
|
|
214
218
|
}
|
|
215
219
|
);
|
|
216
|
-
|
|
220
|
+
Me.displayName = "Filters";
|
|
217
221
|
export {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
Qe as ActiveFilters,
|
|
223
|
+
Me as Filters,
|
|
224
|
+
de as partitionFilters
|
|
221
225
|
};
|
|
@@ -9,5 +9,6 @@ declare const IncludeExcludeSearch: import('storybook/internal/csf').AnnotatedSt
|
|
|
9
9
|
declare const PinnedSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('@storybook/react').Args>;
|
|
10
10
|
declare const Combobox: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
11
11
|
declare const CheckboxesIndicators: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
12
|
+
declare const OptionsSearchThreshold: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
12
13
|
export default config;
|
|
13
|
-
export { CheckboxesIndicators, Combobox, Default, Grouped, IncludeExclude, IncludeExcludeSearch, Navigable, PinnedSelect, };
|
|
14
|
+
export { CheckboxesIndicators, Combobox, Default, Grouped, IncludeExclude, IncludeExcludeSearch, Navigable, OptionsSearchThreshold, PinnedSelect, };
|