@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.
Files changed (37) hide show
  1. package/dist/components/button/index.js +60 -60
  2. package/dist/components/button/index.stories.d.ts +2 -1
  3. package/dist/components/button/index.test.d.ts +1 -0
  4. package/dist/components/charts/data-number/index.d.ts +4 -0
  5. package/dist/components/charts/data-number/index.js +75 -0
  6. package/dist/components/charts/data-number/index.stories.d.ts +10 -0
  7. package/dist/components/charts/data-number/index.test.d.ts +1 -0
  8. package/dist/components/charts/data-number/types.d.ts +32 -0
  9. package/dist/components/charts/data-number/utils.d.ts +2 -0
  10. package/dist/components/charts/data-number/utils.js +4 -0
  11. package/dist/components/charts/index.d.ts +3 -0
  12. package/dist/components/charts/index.js +4 -0
  13. package/dist/components/filters/context/types.d.ts +2 -0
  14. package/dist/components/filters/index.js +120 -116
  15. package/dist/components/filters/index.stories.d.ts +2 -1
  16. package/dist/components/filters/options-menu/index.js +74 -73
  17. package/dist/components/filters/types.d.ts +3 -0
  18. package/dist/components/skeleton/index.d.ts +6 -0
  19. package/dist/components/skeleton/index.js +18 -0
  20. package/dist/components/skeleton/index.stories.d.ts +8 -0
  21. package/dist/components/skeleton/index.test.d.ts +1 -0
  22. package/dist/components/skeleton/styles.d.ts +5 -0
  23. package/dist/components/skeleton/styles.js +33 -0
  24. package/dist/components/skeleton/types.d.ts +24 -0
  25. package/dist/components/stepper/index.d.ts +1 -1
  26. package/dist/components/stepper/index.js +16 -15
  27. package/dist/components/stepper/styles.d.ts +5 -1
  28. package/dist/components/stepper/styles.js +6 -0
  29. package/dist/components/stepper/types.d.ts +2 -0
  30. package/dist/components/tabs/index.js +27 -25
  31. package/dist/components/tabs/index.stories.d.ts +1 -2
  32. package/dist/components/tabs/tab/index.d.ts +1 -1
  33. package/dist/components/tabs/tab/index.js +25 -28
  34. package/dist/components/tabs/types.d.ts +7 -2
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +304 -300
  37. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
- import { jsx as u, jsxs as te } from "react/jsx-runtime";
2
- import { forwardRef as oe, useState as F, useMemo as w, useCallback as m, useImperativeHandle as ne, createElement as le, useContext as se } from "react";
3
- import { useFloating as j } from "../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
4
- import re from "../../_virtual/isEmpty.js";
5
- import ie from "../../_virtual/lowerFirst.js";
6
- import { ActiveFilters as Je } from "./active-filters/index.js";
7
- import { FiltersContext as H } from "./context/index.js";
8
- import { FiltersMenu as ae } from "./filters-menu/index.js";
9
- import { useFilterCalendarState as ce, useFilterSearchState as me, useFilterScrollState as pe } from "./hooks.js";
10
- import { OptionsMenu as ue } from "./options-menu/index.js";
11
- import { partitionFilters as fe, getSelectedFilter as de, getGroupedFilters as he, MAX_FILTERS_LENGTH as ge } from "./utils.js";
12
- import { useClickOutside as Fe } from "../../hooks/use-click-outside.js";
13
- import { useFiltersValues as ve } from "../../hooks/use-filters.js";
14
- import { useModal as Ce } from "../../hooks/use-modal.js";
15
- import { getPathname as be, clearStorage as V } from "../../utils/storage.js";
16
- import { Button as Oe } from "../button/index.js";
17
- import { Container as Se } from "../container/index.js";
18
- import { Toggle as ke } from "../toggle/index.js";
19
- const R = "y", Te = ({
20
- disabled: p,
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 } = se(H), a = d[t] === R, l = m(() => {
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] === R ? "" : R
28
+ [t]: s[t] === w ? "" : w
29
29
  }));
30
30
  }, [t, e]);
31
31
  return /* @__PURE__ */ u(
32
- ke,
32
+ Te,
33
33
  {
34
34
  defaultChecked: a,
35
- disabled: p,
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
- }, xe = ({
44
- disabled: p,
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: c,
54
- width: h,
55
- justify: O,
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 = Ce("filters"), { calendarState: r } = ce(), { searchState: v, updateSearch: g } = me(), { scrollState: C } = pe(), [T, x] = F(""), [P, G] = F(null), { refs: M } = j({ placement: "bottom-start" }), { refs: y } = j({ placement: "right-end" }), { setFloating: B, setReference: U } = M, { setFloating: X } = y, { activeFilters: q, values: E, setValues: z } = i, { previousValue: D } = v, {
60
- menu: L,
61
- inline: J,
62
- pinned: Q
63
- } = w(() => fe(t), [t]), { hideMenuTitle: W, label: A, options: _ } = de(
64
- L,
65
- T,
66
- D
67
- ), Y = he(L), Z = re(a) || a === null || T !== a, $ = !k && L.length > ge, b = m(
68
- (n, N) => {
69
- x(n), l(n), G(N);
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
- ), I = m(
73
+ ), K = c(
73
74
  (n) => {
74
- b(n, null);
75
+ O(n, null);
75
76
  },
76
- [b]
77
- ), K = m(() => {
78
- o.isOpen || s(), o.toggle(), x(""), l(null), G(null), e({ searchGlobal: "", searchFilter: "" });
79
- }, [o, l, e, s]), ee = m(() => {
80
- r.isOpen || (o.close(), x(""), l(null), G(null), e({ searchGlobal: "", searchFilter: "" }), c());
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
- c
87
+ h
87
88
  ]);
88
- return ne(
89
+ return le(
89
90
  S,
90
91
  () => ({
91
- openAndNavigate: (n, N) => {
92
- o.isOpen || (s(), o.open()), e({ searchGlobal: "", searchFilter: "" }), g({ previousValue: E[n] ?? "" }), b(n, N ?? null);
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, g, E, b]
96
- ), Fe(
97
- M.floating,
98
- ee,
99
- [M.reference, y.floating],
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
- H.Provider,
103
+ P.Provider,
103
104
  {
104
105
  value: {
105
- id: T,
106
+ id: x,
106
107
  calendarState: r,
107
- searchState: v,
108
- values: E,
109
- scrollState: C,
108
+ searchState: C,
109
+ values: L,
110
+ scrollState: b,
110
111
  searchValues: d,
111
112
  setSearchValues: e,
112
- setValues: z,
113
- updateSearch: g,
114
- navMode: P
113
+ setValues: D,
114
+ updateSearch: F,
115
+ navMode: B,
116
+ optionsSearchThreshold: T
115
117
  },
116
- children: /* @__PURE__ */ te(
117
- Se,
118
+ children: /* @__PURE__ */ oe(
119
+ ke,
118
120
  {
119
121
  alignItems: "center",
120
122
  display: "flex",
121
- justify: O,
123
+ justify: g,
122
124
  position: "relative",
123
- width: h,
125
+ width: p,
124
126
  wrap: "wrap",
125
127
  children: [
126
128
  /* @__PURE__ */ u(
127
- Oe,
129
+ Se,
128
130
  {
129
131
  "data-testid": "filter-btn",
130
- disabled: p,
132
+ disabled: m,
131
133
  icon: "filter",
132
134
  id: "filter-btn",
133
- onClick: K,
134
- ref: U,
135
- tag: q.toString(),
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
- ae,
143
+ ce,
142
144
  {
143
- groupedFilters: Y,
144
- handleChangeId: I,
145
- includeSearch: $,
146
- pinnedFilters: Q,
147
- ref: B
145
+ groupedFilters: Z,
146
+ handleChangeId: K,
147
+ includeSearch: I,
148
+ pinnedFilters: W,
149
+ ref: U
148
150
  }
149
151
  ) : void 0,
150
- Z ? void 0 : /* @__PURE__ */ u(
151
- ue,
152
+ $ ? void 0 : /* @__PURE__ */ u(
153
+ fe,
152
154
  {
153
- hideTitle: W,
154
- label: _?.[0]?.formatLabel ?? !0 ? ie(A) : A,
155
- options: _,
156
- ref: X
155
+ hideTitle: Y,
156
+ label: j?.[0]?.formatLabel ?? !0 ? ae(_) : _,
157
+ options: j,
158
+ ref: q
157
159
  }
158
160
  ),
159
- J.map((n) => /* @__PURE__ */ le(
160
- Te,
161
+ Q.map((n) => /* @__PURE__ */ se(
162
+ xe,
161
163
  {
162
164
  ...n,
163
- disabled: p || n.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
- }, Ge = oe(
174
+ }, Me = ne(
173
175
  ({
174
- disabled: p = !1,
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
- }, l) => {
182
- const [s] = F(be), c = w(() => i ?? s, [i, s]), h = ve({ filters: t, storageKey: i }), [O, S] = F(null), [k, o] = F({
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 = w(
186
- () => Object.values(h.values).some(
187
- (C) => !!C && C !== "undefined"
188
+ }), r = y(
189
+ () => Object.values(g.values).some(
190
+ (b) => !!b && b !== "undefined"
188
191
  ),
189
- [h.values]
190
- ), v = m(() => {
191
- r || V(c);
192
- }, [r, c]), g = m(() => {
193
- r || V(c);
194
- }, [r, c]);
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
- xe,
199
+ Ge,
197
200
  {
198
- disabled: p,
199
- filterId: O,
200
- filterState: h,
201
+ disabled: m,
202
+ filterId: S,
203
+ filterState: g,
201
204
  filters: t,
202
205
  hideMenuSearch: a,
203
- imperativeRef: l,
206
+ imperativeRef: s,
204
207
  justify: e,
205
- onButtonClick: v,
206
- onOutsideClick: g,
207
- searchValues: k,
208
- setFilterId: S,
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
- Ge.displayName = "Filters";
220
+ Me.displayName = "Filters";
217
221
  export {
218
- Je as ActiveFilters,
219
- Ge as Filters,
220
- fe as partitionFilters
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, };