@pismo/marola 2.1.14 → 2.1.16

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 +1 @@
1
- ._container_kdqr0_1{width:100%;height:56px;border-top:1px solid var(--border-secondary)}._container-grid_kdqr0_6{display:grid;grid-template-columns:1fr 1.5fr .5fr 5fr 2fr 2fr;align-items:center;justify-content:space-between;padding:12px 16px}._container-pending_kdqr0_13{display:flex;align-items:center;justify-content:flex-start;padding:12px 16px}._container-pending--right_kdqr0_19{margin-left:auto}._container_kdqr0_1 :hover{cursor:pointer;background-color:var(--border-secondary)}._info-section_kdqr0_27{display:flex}._info-section--item_kdqr0_30{padding-left:8px}._info-section--item_kdqr0_30:not(:first-child){margin-left:8px;border-left:1px solid var(--border-secondary)}._info-section--right_kdqr0_37{display:flex;justify-content:flex-end}
1
+ ._container_sv3th_1{width:100%;height:56px;border-top:1px solid var(--border-secondary)}._container-grid_sv3th_6{display:grid;grid-template-columns:1fr 1.5fr .5fr 5fr 2fr 2fr;align-items:center;justify-content:space-between;padding:12px 16px}._container-pending_sv3th_13{display:flex;align-items:center;justify-content:flex-start;padding:12px 16px}._container-pending--right_sv3th_19{margin-left:auto}._container_sv3th_1 :hover{cursor:pointer;background-color:var(--border-secondary)}._info-section_sv3th_27,._info-section--content_sv3th_31{width:100%;overflow:hidden}._info-section--item_sv3th_35{display:inline-flex;flex-shrink:0;padding-left:8px}._info-section--item_sv3th_35:not(:last-child){flex-shrink:0}._info-section--item_sv3th_35:last-child{flex-shrink:1;min-width:0;overflow:hidden}._info-section--item_sv3th_35:not(:first-child){margin-left:8px;border-left:1px solid var(--border-secondary)}._info-section--right_sv3th_52{display:flex;justify-content:flex-end}._info-section_sv3th_27 ._truncate-text_sv3th_56{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._info-section_sv3th_27 ._separator_sv3th_63{display:inline-block;width:1px;height:16px;margin:0 8px;vertical-align:middle;background-color:var(--border-secondary)}
@@ -15,9 +15,15 @@ export type AutocompleteProps<T> = Omit<InputProps, 'onChange' | 'value'> & {
15
15
  options?: Array<T>;
16
16
  /** CSS classes to be applied on the input container element */
17
17
  classNameInputWrapper?: string;
18
- /** callback for new option selected */
18
+ /** Callback for new option selected */
19
19
  onChange?: (event: SyntheticEvent<Element, Event>, newValue: T) => void;
20
- /** callback when characters are entered into the input box */
20
+ /** Callback when characters are entered into the input box */
21
21
  onInputChange?: (event: SyntheticEvent<Element, Event>, newValue: string) => void;
22
+ /** Control programmatically the state of the autocomplete list. Using this prop will disable the auto open/close handling and you must provide the behavior for yourself. */
23
+ open?: boolean;
24
+ /** Callback when the autocomplete list is opened */
25
+ onOpen?: () => void;
26
+ /** Callback when the autocomplete list is closed */
27
+ onClose?: () => void;
22
28
  };
23
- export declare const Autocomplete: <T extends string | object>({ labelKey, valueKey, renderOption, customSelectedOptionLabel, options, type, value, onChange, onInputChange, classNameWrapper, "data-testid-wrapper": dataTestId, classNameInputWrapper, ...props }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const Autocomplete: <T extends string | object>({ labelKey, valueKey, renderOption, customSelectedOptionLabel, options, type, value, onChange, onInputChange, classNameWrapper, "data-testid-wrapper": dataTestId, classNameInputWrapper, open, onOpen, onClose, ...props }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -6,8 +6,8 @@ import { Icon as ct } from "../Icon/Icon.js";
6
6
  import { Input as ft } from "../Input/Input.js";
7
7
  import { s as dt, b as Me } from "../../useSlotProps-C7dqSmdM.js";
8
8
  import { u as pt } from "../../useId-BW-oWmul.js";
9
- import { u as we } from "../../useControlled-CCMYYdCM.js";
10
- import { u as fe } from "../../useEventCallback-BAQJJ3ye.js";
9
+ import { u as Ee } from "../../useControlled-CCMYYdCM.js";
10
+ import { u as pe } from "../../useEventCallback-BAQJJ3ye.js";
11
11
  import '../../assets/Autocomplete.css';const gt = (c) => {
12
12
  const h = g.useRef({});
13
13
  return g.useEffect(() => {
@@ -21,25 +21,25 @@ function ht(c = {}) {
21
21
  const {
22
22
  ignoreAccents: h = !0,
23
23
  ignoreCase: m = !0,
24
- limit: $,
25
- matchFrom: N = "any",
26
- stringify: B,
24
+ limit: A,
25
+ matchFrom: v = "any",
26
+ stringify: j,
27
27
  trim: V = !1
28
28
  } = c;
29
- return (P, {
29
+ return (D, {
30
30
  inputValue: M,
31
31
  getOptionLabel: b
32
32
  }) => {
33
33
  let k = V ? M.trim() : M;
34
34
  m && (k = k.toLowerCase()), h && (k = Re(k));
35
- const U = k ? P.filter((K) => {
36
- let w = (B || b)(K);
37
- return m && (w = w.toLowerCase()), h && (w = Re(w)), N === "start" ? w.indexOf(k) === 0 : w.indexOf(k) > -1;
38
- }) : P;
39
- return typeof $ == "number" ? U.slice(0, $) : U;
35
+ const B = k ? D.filter((J) => {
36
+ let w = (j || b)(J);
37
+ return m && (w = w.toLowerCase()), h && (w = Re(w)), v === "start" ? w.indexOf(k) === 0 : w.indexOf(k) > -1;
38
+ }) : D;
39
+ return typeof A == "number" ? B.slice(0, A) : B;
40
40
  };
41
41
  }
42
- function de(c, h) {
42
+ function ge(c, h) {
43
43
  for (let m = 0; m < c.length; m += 1)
44
44
  if (h(c[m]))
45
45
  return m;
@@ -55,50 +55,50 @@ function yt(c) {
55
55
  unstable_isActiveElementInListbox: h = xt,
56
56
  // eslint-disable-next-line @typescript-eslint/naming-convention
57
57
  unstable_classNamePrefix: m = "Mui",
58
- autoComplete: $ = !1,
59
- autoHighlight: N = !1,
60
- autoSelect: B = !1,
58
+ autoComplete: A = !1,
59
+ autoHighlight: v = !1,
60
+ autoSelect: j = !1,
61
61
  blurOnSelect: V = !1,
62
- clearOnBlur: P = !c.freeSolo,
62
+ clearOnBlur: D = !c.freeSolo,
63
63
  clearOnEscape: M = !1,
64
64
  componentName: b = "useAutocomplete",
65
65
  defaultValue: k = c.multiple ? [] : null,
66
- disableClearable: U = !1,
67
- disableCloseOnSelect: K = !1,
66
+ disableClearable: B = !1,
67
+ disableCloseOnSelect: J = !1,
68
68
  disabled: w,
69
- disabledItemsFocusable: pe = !1,
70
- disableListWrap: ee = !1,
71
- filterOptions: ge = mt,
72
- filterSelectedOptions: te = !1,
73
- freeSolo: v = !1,
74
- getOptionDisabled: R,
75
- getOptionKey: ne,
76
- getOptionLabel: re = (t) => {
69
+ disabledItemsFocusable: he = !1,
70
+ disableListWrap: W = !1,
71
+ filterOptions: me = mt,
72
+ filterSelectedOptions: ee = !1,
73
+ freeSolo: L = !1,
74
+ getOptionDisabled: U,
75
+ getOptionKey: te,
76
+ getOptionLabel: ne = (t) => {
77
77
  var e;
78
78
  return (e = t.label) != null ? e : t;
79
79
  },
80
- groupBy: i,
81
- handleHomeEndKeys: x = !c.freeSolo,
82
- id: W,
83
- includeInputInList: H = !1,
84
- inputValue: L,
85
- isOptionEqualToValue: A = (t, e) => t === e,
80
+ groupBy: R,
81
+ handleHomeEndKeys: re = !c.freeSolo,
82
+ id: be,
83
+ includeInputInList: i = !1,
84
+ inputValue: y,
85
+ isOptionEqualToValue: E = (t, e) => t === e,
86
86
  multiple: l = !1,
87
- onChange: Se,
88
- onClose: ke,
89
- onHighlightChange: Ee,
90
- onInputChange: F,
87
+ onChange: T,
88
+ onClose: oe,
89
+ onHighlightChange: se,
90
+ onInputChange: H,
91
91
  onOpen: Te,
92
92
  open: He,
93
93
  openOnFocus: Fe = !1,
94
- options: he,
94
+ options: xe,
95
95
  readOnly: Y = !1,
96
96
  selectOnFocus: qe = !c.freeSolo,
97
97
  value: je
98
- } = c, E = pt(W);
99
- let O = re;
98
+ } = c, _ = pt(be);
99
+ let O = ne;
100
100
  O = (t) => {
101
- const e = re(t);
101
+ const e = ne(t);
102
102
  if (typeof e != "string") {
103
103
  if (process.env.NODE_ENV !== "production") {
104
104
  const n = e === void 0 ? "undefined" : `${typeof e} (${e})`;
@@ -108,17 +108,17 @@ function yt(c) {
108
108
  }
109
109
  return e;
110
110
  };
111
- const me = g.useRef(!1), be = g.useRef(!0), d = g.useRef(null), T = g.useRef(null), [oe, Be] = g.useState(null), [_, xe] = g.useState(-1), _e = N ? 0 : -1, y = g.useRef(_e), [r, Ue] = we({
111
+ const ye = g.useRef(!1), Oe = g.useRef(!0), d = g.useRef(null), $ = g.useRef(null), [ie, Be] = g.useState(null), [P, Ie] = g.useState(-1), _e = v ? 0 : -1, x = g.useRef(_e), [r, Ue] = Ee({
112
112
  controlled: je,
113
113
  default: k,
114
114
  name: b
115
- }), [u, se] = we({
116
- controlled: L,
115
+ }), [u, le] = Ee({
116
+ controlled: y,
117
117
  default: "",
118
118
  name: b,
119
119
  state: "inputValue"
120
- }), [ie, $e] = g.useState(!1), le = g.useCallback((t, e) => {
121
- if (!(l ? r.length < e.length : e !== null) && !P)
120
+ }), [ae, $e] = g.useState(!1), ue = g.useCallback((t, e) => {
121
+ if (!(l ? r.length < e.length : e !== null) && !D)
122
122
  return;
123
123
  let o;
124
124
  if (l)
@@ -129,75 +129,75 @@ function yt(c) {
129
129
  const s = O(e);
130
130
  o = typeof s == "string" ? s : "";
131
131
  }
132
- u !== o && (se(o), F && F(t, o, "reset"));
133
- }, [O, u, l, F, se, P, r]), [z, Pe] = we({
132
+ u !== o && (le(o), H && H(t, o, "reset"));
133
+ }, [O, u, l, H, le, D, r]), [K, Pe] = Ee({
134
134
  controlled: He,
135
135
  default: !1,
136
136
  name: b,
137
137
  state: "open"
138
- }), [Ke, Ae] = g.useState(!0), De = !l && r != null && u === O(r), S = z && !Y, f = S ? ge(
139
- he.filter((t) => !(te && (l ? r : [r]).some((e) => e !== null && A(t, e)))),
138
+ }), [Ke, Ae] = g.useState(!0), De = !l && r != null && u === O(r), S = K && !Y, f = S ? me(
139
+ xe.filter((t) => !(ee && (l ? r : [r]).some((e) => e !== null && E(t, e)))),
140
140
  // we use the empty string to manipulate `filterOptions` to not filter any options
141
141
  // i.e. the filter predicate always returns true
142
142
  {
143
143
  inputValue: De && Ke ? "" : u,
144
144
  getOptionLabel: O
145
145
  }
146
- ) : [], D = gt({
146
+ ) : [], C = gt({
147
147
  filteredOptions: f,
148
148
  value: r,
149
149
  inputValue: u
150
150
  });
151
151
  g.useEffect(() => {
152
- const t = r !== D.value;
153
- ie && !t || v && !t || le(null, r);
154
- }, [r, le, ie, D.value, v]);
155
- const ye = z && f.length > 0 && !Y;
156
- if (process.env.NODE_ENV !== "production" && r !== null && !v && he.length > 0) {
157
- const t = (l ? r : [r]).filter((e) => !he.some((n) => A(n, e)));
152
+ const t = r !== C.value;
153
+ ae && !t || L && !t || ue(null, r);
154
+ }, [r, ue, ae, C.value, L]);
155
+ const we = K && f.length > 0 && !Y;
156
+ if (process.env.NODE_ENV !== "production" && r !== null && !L && xe.length > 0) {
157
+ const t = (l ? r : [r]).filter((e) => !xe.some((n) => E(n, e)));
158
158
  t.length > 0 && console.warn([`MUI: The value provided to ${b} is invalid.`, `None of the options match with \`${t.length > 1 ? JSON.stringify(t) : JSON.stringify(t[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
159
159
  `));
160
160
  }
161
- const ae = fe((t) => {
162
- t === -1 ? d.current.focus() : oe.querySelector(`[data-tag-index="${t}"]`).focus();
161
+ const ce = pe((t) => {
162
+ t === -1 ? d.current.focus() : ie.querySelector(`[data-tag-index="${t}"]`).focus();
163
163
  });
164
164
  g.useEffect(() => {
165
- l && _ > r.length - 1 && (xe(-1), ae(-1));
166
- }, [r, l, _, ae]);
165
+ l && P > r.length - 1 && (Ie(-1), ce(-1));
166
+ }, [r, l, P, ce]);
167
167
  function ze(t, e) {
168
- if (!T.current || t < 0 || t >= f.length)
168
+ if (!$.current || t < 0 || t >= f.length)
169
169
  return -1;
170
170
  let n = t;
171
171
  for (; ; ) {
172
- const o = T.current.querySelector(`[data-option-index="${n}"]`), s = pe ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
172
+ const o = $.current.querySelector(`[data-option-index="${n}"]`), s = he ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
173
173
  if (o && o.hasAttribute("tabindex") && !s)
174
174
  return n;
175
175
  if (e === "next" ? n = (n + 1) % f.length : n = (n - 1 + f.length) % f.length, n === t)
176
176
  return -1;
177
177
  }
178
178
  }
179
- const q = fe(({
179
+ const F = pe(({
180
180
  event: t,
181
181
  index: e,
182
182
  reason: n = "auto"
183
183
  }) => {
184
- if (y.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${E}-option-${e}`), Ee && Ee(t, e === -1 ? null : f[e], n), !T.current)
184
+ if (x.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${_}-option-${e}`), se && se(t, e === -1 ? null : f[e], n), !$.current)
185
185
  return;
186
- const o = T.current.querySelector(`[role="option"].${m}-focused`);
186
+ const o = $.current.querySelector(`[role="option"].${m}-focused`);
187
187
  o && (o.classList.remove(`${m}-focused`), o.classList.remove(`${m}-focusVisible`));
188
- let s = T.current;
189
- if (T.current.getAttribute("role") !== "listbox" && (s = T.current.parentElement.querySelector('[role="listbox"]')), !s)
188
+ let s = $.current;
189
+ if ($.current.getAttribute("role") !== "listbox" && (s = $.current.parentElement.querySelector('[role="listbox"]')), !s)
190
190
  return;
191
191
  if (e === -1) {
192
192
  s.scrollTop = 0;
193
193
  return;
194
194
  }
195
- const a = T.current.querySelector(`[data-option-index="${e}"]`);
195
+ const a = $.current.querySelector(`[data-option-index="${e}"]`);
196
196
  if (a && (a.classList.add(`${m}-focused`), n === "keyboard" && a.classList.add(`${m}-focusVisible`), s.scrollHeight > s.clientHeight && n !== "mouse" && n !== "touch")) {
197
- const p = a, I = s.clientHeight + s.scrollTop, ce = p.offsetTop + p.offsetHeight;
198
- ce > I ? s.scrollTop = ce - s.clientHeight : p.offsetTop - p.offsetHeight * (i ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (i ? 1.3 : 0));
197
+ const p = a, I = s.clientHeight + s.scrollTop, de = p.offsetTop + p.offsetHeight;
198
+ de > I ? s.scrollTop = de - s.clientHeight : p.offsetTop - p.offsetHeight * (R ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (R ? 1.3 : 0));
199
199
  }
200
- }), C = fe(({
200
+ }), N = pe(({
201
201
  event: t,
202
202
  diff: e,
203
203
  direction: n = "next",
@@ -213,14 +213,14 @@ function yt(c) {
213
213
  return 0;
214
214
  if (e === "end")
215
215
  return p;
216
- const I = y.current + e;
217
- return I < 0 ? I === -1 && H ? -1 : ee && y.current !== -1 || Math.abs(e) > 1 ? 0 : p : I > p ? I === p + 1 && H ? -1 : ee || Math.abs(e) > 1 ? p : 0 : I;
216
+ const I = x.current + e;
217
+ return I < 0 ? I === -1 && i ? -1 : W && x.current !== -1 || Math.abs(e) > 1 ? 0 : p : I > p ? I === p + 1 && i ? -1 : W || Math.abs(e) > 1 ? p : 0 : I;
218
218
  })(), n);
219
- if (q({
219
+ if (F({
220
220
  index: a,
221
221
  reason: o,
222
222
  event: t
223
- }), $ && e !== "reset")
223
+ }), A && e !== "reset")
224
224
  if (a === -1)
225
225
  d.current.value = u;
226
226
  else {
@@ -232,48 +232,48 @@ function yt(c) {
232
232
  const o = e ? O(e) : "", s = n ? O(n) : "";
233
233
  return o === s;
234
234
  };
235
- if (y.current !== -1 && D.filteredOptions && D.filteredOptions.length !== f.length && D.inputValue === u && (l ? r.length === D.value.length && D.value.every((e, n) => O(r[n]) === O(e)) : t(D.value, r))) {
236
- const e = D.filteredOptions[y.current];
235
+ if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== f.length && C.inputValue === u && (l ? r.length === C.value.length && C.value.every((e, n) => O(r[n]) === O(e)) : t(C.value, r))) {
236
+ const e = C.filteredOptions[x.current];
237
237
  if (e)
238
- return de(f, (n) => O(n) === O(e));
238
+ return ge(f, (n) => O(n) === O(e));
239
239
  }
240
240
  return -1;
241
- }, Oe = g.useCallback(() => {
241
+ }, Se = g.useCallback(() => {
242
242
  if (!S)
243
243
  return;
244
244
  const t = Je();
245
245
  if (t !== -1) {
246
- y.current = t;
246
+ x.current = t;
247
247
  return;
248
248
  }
249
249
  const e = l ? r[0] : r;
250
250
  if (f.length === 0 || e == null) {
251
- C({
251
+ N({
252
252
  diff: "reset"
253
253
  });
254
254
  return;
255
255
  }
256
- if (T.current) {
256
+ if ($.current) {
257
257
  if (e != null) {
258
- const n = f[y.current];
259
- if (l && n && de(r, (s) => A(n, s)) !== -1)
258
+ const n = f[x.current];
259
+ if (l && n && ge(r, (s) => E(n, s)) !== -1)
260
260
  return;
261
- const o = de(f, (s) => A(s, e));
262
- o === -1 ? C({
261
+ const o = ge(f, (s) => E(s, e));
262
+ o === -1 ? N({
263
263
  diff: "reset"
264
- }) : q({
264
+ }) : F({
265
265
  index: o
266
266
  });
267
267
  return;
268
268
  }
269
- if (y.current >= f.length - 1) {
270
- q({
269
+ if (x.current >= f.length - 1) {
270
+ F({
271
271
  index: f.length - 1
272
272
  });
273
273
  return;
274
274
  }
275
- q({
276
- index: y.current
275
+ F({
276
+ index: x.current
277
277
  });
278
278
  }
279
279
  }, [
@@ -282,47 +282,47 @@ function yt(c) {
282
282
  // Don't sync the highlighted index with the value when multiple
283
283
  // eslint-disable-next-line react-hooks/exhaustive-deps
284
284
  l ? !1 : r,
285
- te,
286
- C,
287
- q,
285
+ ee,
286
+ N,
287
+ F,
288
288
  S,
289
289
  u,
290
290
  l
291
- ]), We = fe((t) => {
292
- dt(T, t), t && Oe();
291
+ ]), We = pe((t) => {
292
+ dt($, t), t && Se();
293
293
  });
294
294
  process.env.NODE_ENV !== "production" && g.useEffect(() => {
295
295
  (!d.current || d.current.nodeName !== "INPUT") && (d.current && d.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${b} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
296
296
  `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${d.current} while an HTMLInputElement was expected.`, `Instead, ${b} expects an input element.`, "", b === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
297
297
  `)));
298
298
  }, [b]), g.useEffect(() => {
299
- Oe();
300
- }, [Oe]);
301
- const j = (t) => {
302
- z || (Pe(!0), Ae(!0), Te && Te(t));
299
+ Se();
300
+ }, [Se]);
301
+ const q = (t) => {
302
+ K || (Pe(!0), Ae(!0), Te && Te(t));
303
303
  }, X = (t, e) => {
304
- z && (Pe(!1), ke && ke(t, e));
305
- }, J = (t, e, n, o) => {
304
+ K && (Pe(!1), oe && oe(t, e));
305
+ }, z = (t, e, n, o) => {
306
306
  if (l) {
307
307
  if (r.length === e.length && r.every((s, a) => s === e[a]))
308
308
  return;
309
309
  } else if (r === e)
310
310
  return;
311
- Se && Se(t, e, n, o), Ue(e);
312
- }, ue = g.useRef(!1), G = (t, e, n = "selectOption", o = "options") => {
311
+ T && T(t, e, n, o), Ue(e);
312
+ }, fe = g.useRef(!1), G = (t, e, n = "selectOption", o = "options") => {
313
313
  let s = n, a = e;
314
314
  if (l) {
315
315
  if (a = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
316
- const I = a.filter((ce) => A(e, ce));
316
+ const I = a.filter((de) => E(e, de));
317
317
  I.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${b} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${I.length} matches.`].join(`
318
318
  `));
319
319
  }
320
- const p = de(a, (I) => A(e, I));
320
+ const p = ge(a, (I) => E(e, I));
321
321
  p === -1 ? a.push(e) : o !== "freeSolo" && (a.splice(p, 1), s = "removeOption");
322
322
  }
323
- le(t, a), J(t, a, s, {
323
+ ue(t, a), z(t, a, s, {
324
324
  option: e
325
- }), !K && (!t || !t.ctrlKey && !t.metaKey) && X(t, s), (V === !0 || V === "touch" && ue.current || V === "mouse" && !ue.current) && d.current.blur();
325
+ }), !J && (!t || !t.ctrlKey && !t.metaKey) && X(t, s), (V === !0 || V === "touch" && fe.current || V === "mouse" && !fe.current) && d.current.blur();
326
326
  };
327
327
  function Ye(t, e) {
328
328
  if (t === -1)
@@ -331,7 +331,7 @@ function yt(c) {
331
331
  for (; ; ) {
332
332
  if (e === "next" && n === r.length || e === "previous" && n === -1)
333
333
  return -1;
334
- const o = oe.querySelector(`[data-tag-index="${n}"]`);
334
+ const o = ie.querySelector(`[data-tag-index="${n}"]`);
335
335
  if (!o || !o.hasAttribute("tabindex") || o.disabled || o.getAttribute("aria-disabled") === "true")
336
336
  n += e === "next" ? 1 : -1;
337
337
  else
@@ -342,15 +342,15 @@ function yt(c) {
342
342
  if (!l)
343
343
  return;
344
344
  u === "" && X(t, "toggleInput");
345
- let n = _;
346
- _ === -1 ? u === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = Ye(n, e), xe(n), ae(n);
345
+ let n = P;
346
+ P === -1 ? u === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = Ye(n, e), Ie(n), ce(n);
347
347
  }, Ne = (t) => {
348
- me.current = !0, se(""), F && F(t, "", "clear"), J(t, l ? [] : null, "clear");
348
+ ye.current = !0, le(""), H && H(t, "", "clear"), z(t, l ? [] : null, "clear");
349
349
  }, Xe = (t) => (e) => {
350
- if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (_ !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (xe(-1), ae(-1)), e.which !== 229))
350
+ if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (P !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (Ie(-1), ce(-1)), e.which !== 229))
351
351
  switch (e.key) {
352
352
  case "Home":
353
- S && x && (e.preventDefault(), C({
353
+ S && re && (e.preventDefault(), N({
354
354
  diff: "start",
355
355
  direction: "next",
356
356
  reason: "keyboard",
@@ -358,7 +358,7 @@ function yt(c) {
358
358
  }));
359
359
  break;
360
360
  case "End":
361
- S && x && (e.preventDefault(), C({
361
+ S && re && (e.preventDefault(), N({
362
362
  diff: "end",
363
363
  direction: "previous",
364
364
  reason: "keyboard",
@@ -366,36 +366,36 @@ function yt(c) {
366
366
  }));
367
367
  break;
368
368
  case "PageUp":
369
- e.preventDefault(), C({
369
+ e.preventDefault(), N({
370
370
  diff: -5,
371
371
  direction: "previous",
372
372
  reason: "keyboard",
373
373
  event: e
374
- }), j(e);
374
+ }), q(e);
375
375
  break;
376
376
  case "PageDown":
377
- e.preventDefault(), C({
377
+ e.preventDefault(), N({
378
378
  diff: bt,
379
379
  direction: "next",
380
380
  reason: "keyboard",
381
381
  event: e
382
- }), j(e);
382
+ }), q(e);
383
383
  break;
384
384
  case "ArrowDown":
385
- e.preventDefault(), C({
385
+ e.preventDefault(), N({
386
386
  diff: 1,
387
387
  direction: "next",
388
388
  reason: "keyboard",
389
389
  event: e
390
- }), j(e);
390
+ }), q(e);
391
391
  break;
392
392
  case "ArrowUp":
393
- e.preventDefault(), C({
393
+ e.preventDefault(), N({
394
394
  diff: -1,
395
395
  direction: "previous",
396
396
  reason: "keyboard",
397
397
  event: e
398
- }), j(e);
398
+ }), q(e);
399
399
  break;
400
400
  case "ArrowLeft":
401
401
  Ce(e, "previous");
@@ -404,82 +404,82 @@ function yt(c) {
404
404
  Ce(e, "next");
405
405
  break;
406
406
  case "Enter":
407
- if (y.current !== -1 && S) {
408
- const n = f[y.current], o = R ? R(n) : !1;
407
+ if (x.current !== -1 && S) {
408
+ const n = f[x.current], o = U ? U(n) : !1;
409
409
  if (e.preventDefault(), o)
410
410
  return;
411
- G(e, n, "selectOption"), $ && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
412
- } else v && u !== "" && De === !1 && (l && e.preventDefault(), G(e, u, "createOption", "freeSolo"));
411
+ G(e, n, "selectOption"), A && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
412
+ } else L && u !== "" && De === !1 && (l && e.preventDefault(), G(e, u, "createOption", "freeSolo"));
413
413
  break;
414
414
  case "Escape":
415
415
  S ? (e.preventDefault(), e.stopPropagation(), X(e, "escape")) : M && (u !== "" || l && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Ne(e));
416
416
  break;
417
417
  case "Backspace":
418
418
  if (l && !Y && u === "" && r.length > 0) {
419
- const n = _ === -1 ? r.length - 1 : _, o = r.slice();
420
- o.splice(n, 1), J(e, o, "removeOption", {
419
+ const n = P === -1 ? r.length - 1 : P, o = r.slice();
420
+ o.splice(n, 1), z(e, o, "removeOption", {
421
421
  option: r[n]
422
422
  });
423
423
  }
424
424
  break;
425
425
  case "Delete":
426
- if (l && !Y && u === "" && r.length > 0 && _ !== -1) {
427
- const n = _, o = r.slice();
428
- o.splice(n, 1), J(e, o, "removeOption", {
426
+ if (l && !Y && u === "" && r.length > 0 && P !== -1) {
427
+ const n = P, o = r.slice();
428
+ o.splice(n, 1), z(e, o, "removeOption", {
429
429
  option: r[n]
430
430
  });
431
431
  }
432
432
  break;
433
433
  }
434
434
  }, Ge = (t) => {
435
- $e(!0), Fe && !me.current && j(t);
435
+ $e(!0), Fe && !ye.current && q(t);
436
436
  }, ve = (t) => {
437
- if (h(T)) {
437
+ if (h($)) {
438
438
  d.current.focus();
439
439
  return;
440
440
  }
441
- $e(!1), be.current = !0, me.current = !1, B && y.current !== -1 && S ? G(t, f[y.current], "blur") : B && v && u !== "" ? G(t, u, "blur", "freeSolo") : P && le(t, r), X(t, "blur");
441
+ $e(!1), Oe.current = !0, ye.current = !1, j && x.current !== -1 && S ? G(t, f[x.current], "blur") : j && L && u !== "" ? G(t, u, "blur", "freeSolo") : D && ue(t, r), X(t, "blur");
442
442
  }, Qe = (t) => {
443
443
  const e = t.target.value;
444
- u !== e && (se(e), Ae(!1), F && F(t, e, "input")), e === "" ? !U && !l && J(t, null, "clear") : j(t);
444
+ u !== e && (le(e), Ae(!1), H && H(t, e, "input")), e === "" ? !B && !l && z(t, null, "clear") : q(t);
445
445
  }, Ze = (t) => {
446
446
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
447
- y.current !== e && q({
447
+ x.current !== e && F({
448
448
  event: t,
449
449
  index: e,
450
450
  reason: "mouse"
451
451
  });
452
452
  }, et = (t) => {
453
- q({
453
+ F({
454
454
  event: t,
455
455
  index: Number(t.currentTarget.getAttribute("data-option-index")),
456
456
  reason: "touch"
457
- }), ue.current = !0;
457
+ }), fe.current = !0;
458
458
  }, tt = (t) => {
459
459
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
460
- G(t, f[e], "selectOption"), ue.current = !1;
460
+ G(t, f[e], "selectOption"), fe.current = !1;
461
461
  }, nt = (t) => (e) => {
462
462
  const n = r.slice();
463
- n.splice(t, 1), J(e, n, "removeOption", {
463
+ n.splice(t, 1), z(e, n, "removeOption", {
464
464
  option: r[t]
465
465
  });
466
466
  }, Le = (t) => {
467
- z ? X(t, "toggleInput") : j(t);
467
+ K ? X(t, "toggleInput") : q(t);
468
468
  }, rt = (t) => {
469
- t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== E && t.preventDefault();
469
+ t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== _ && t.preventDefault();
470
470
  }, ot = (t) => {
471
- t.currentTarget.contains(t.target) && (d.current.focus(), qe && be.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), be.current = !1);
471
+ t.currentTarget.contains(t.target) && (d.current.focus(), qe && Oe.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), Oe.current = !1);
472
472
  }, st = (t) => {
473
- !w && (u === "" || !z) && Le(t);
473
+ !w && (u === "" || !K) && Le(t);
474
474
  };
475
- let Ie = v && u.length > 0;
476
- Ie = Ie || (l ? r.length > 0 : r !== null);
475
+ let ke = L && u.length > 0;
476
+ ke = ke || (l ? r.length > 0 : r !== null);
477
477
  let Ve = f;
478
- if (i) {
478
+ if (R) {
479
479
  const t = /* @__PURE__ */ new Map();
480
480
  let e = !1;
481
481
  Ve = f.reduce((n, o, s) => {
482
- const a = i(o);
482
+ const a = R(o);
483
483
  return n.length > 0 && n[n.length - 1].group === a ? n[n.length - 1].options.push(o) : (process.env.NODE_ENV !== "production" && (t.get(a) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${b} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(a, !0)), n.push({
484
484
  key: s,
485
485
  index: s,
@@ -488,20 +488,20 @@ function yt(c) {
488
488
  })), n;
489
489
  }, []);
490
490
  }
491
- return w && ie && ve(), {
491
+ return w && ae && ve(), {
492
492
  getRootProps: (t = {}) => Me({
493
- "aria-owns": ye ? `${E}-listbox` : null
493
+ "aria-owns": we ? `${_}-listbox` : null
494
494
  }, t, {
495
495
  onKeyDown: Xe(t),
496
496
  onMouseDown: rt,
497
497
  onClick: ot
498
498
  }),
499
499
  getInputLabelProps: () => ({
500
- id: `${E}-label`,
501
- htmlFor: E
500
+ id: `${_}-label`,
501
+ htmlFor: _
502
502
  }),
503
503
  getInputProps: () => ({
504
- id: E,
504
+ id: _,
505
505
  value: u,
506
506
  onBlur: ve,
507
507
  onFocus: Ge,
@@ -510,9 +510,9 @@ function yt(c) {
510
510
  // if open then this is handled imperatively so don't let react override
511
511
  // only have an opinion about this when closed
512
512
  "aria-activedescendant": S ? "" : null,
513
- "aria-autocomplete": $ ? "both" : "list",
514
- "aria-controls": ye ? `${E}-listbox` : void 0,
515
- "aria-expanded": ye,
513
+ "aria-autocomplete": A ? "both" : "list",
514
+ "aria-controls": we ? `${_}-listbox` : void 0,
515
+ "aria-expanded": we,
516
516
  // Disable browser's suggestion that might overlap with the popup.
517
517
  // Handle autocomplete but not autofill.
518
518
  autoComplete: "off",
@@ -543,8 +543,8 @@ function yt(c) {
543
543
  }),
544
544
  getListboxProps: () => ({
545
545
  role: "listbox",
546
- id: `${E}-listbox`,
547
- "aria-labelledby": `${E}-label`,
546
+ id: `${_}-listbox`,
547
+ "aria-labelledby": `${_}-label`,
548
548
  ref: We,
549
549
  onMouseDown: (t) => {
550
550
  t.preventDefault();
@@ -555,12 +555,12 @@ function yt(c) {
555
555
  option: e
556
556
  }) => {
557
557
  var n;
558
- const o = (l ? r : [r]).some((a) => a != null && A(e, a)), s = R ? R(e) : !1;
558
+ const o = (l ? r : [r]).some((a) => a != null && E(e, a)), s = U ? U(e) : !1;
559
559
  return {
560
- key: (n = ne == null ? void 0 : ne(e)) != null ? n : O(e),
560
+ key: (n = te == null ? void 0 : te(e)) != null ? n : O(e),
561
561
  tabIndex: -1,
562
562
  role: "option",
563
- id: `${E}-option-${t}`,
563
+ id: `${_}-option-${t}`,
564
564
  onMouseMove: Ze,
565
565
  onClick: tt,
566
566
  onTouchStart: et,
@@ -569,16 +569,16 @@ function yt(c) {
569
569
  "aria-selected": o
570
570
  };
571
571
  },
572
- id: E,
572
+ id: _,
573
573
  inputValue: u,
574
574
  value: r,
575
- dirty: Ie,
576
- expanded: S && oe,
575
+ dirty: ke,
576
+ expanded: S && ie,
577
577
  popupOpen: S,
578
- focused: ie || _ !== -1,
579
- anchorEl: oe,
578
+ focused: ae || P !== -1,
579
+ anchorEl: ie,
580
580
  setAnchorEl: Be,
581
- focusedTag: _,
581
+ focusedTag: P,
582
582
  groupedOptions: Ve
583
583
  };
584
584
  }
@@ -591,66 +591,84 @@ const Ot = "_autocomplete_mj65r_65", Z = {
591
591
  labelKey: c,
592
592
  valueKey: h,
593
593
  renderOption: m,
594
- customSelectedOptionLabel: $,
595
- options: N,
596
- type: B,
594
+ customSelectedOptionLabel: A,
595
+ options: v,
596
+ type: j,
597
597
  value: V,
598
- onChange: P,
598
+ onChange: D,
599
599
  onInputChange: M,
600
600
  classNameWrapper: b,
601
601
  "data-testid-wrapper": k,
602
- classNameInputWrapper: U,
603
- ...K
602
+ classNameInputWrapper: B,
603
+ open: J = void 0,
604
+ onOpen: w = void 0,
605
+ onClose: he = void 0,
606
+ ...W
604
607
  }) => {
605
- const w = lt(), [pe, ee] = at("");
606
- (N != null && N.some((i) => typeof i != "string") && !c && !m || !h) && console.error(
608
+ const me = lt(), [ee, L] = at("");
609
+ v != null && v.some((i) => typeof i != "string") && (!c && !m || !h) && console.error(
607
610
  '[autocomplete] When options is a list of objects, you must provide the "labelKey" or "renderOption" and "valueKey" parameters.'
608
611
  );
609
- const { getRootProps: ge, getInputProps: te, getOptionProps: v, groupedOptions: R, getListboxProps: ne } = yt({
610
- id: `autocomplete_${w}`,
611
- options: N,
612
- getOptionLabel: (i) => typeof i == "string" ? i : $ ? $(i) : String(i[c || "label"]),
612
+ const { getRootProps: U, getInputProps: te, getOptionProps: ne, groupedOptions: R, getListboxProps: re } = yt({
613
+ id: `autocomplete_${me}`,
614
+ options: v,
615
+ open: J,
616
+ onOpen: w,
617
+ onClose: he,
618
+ getOptionLabel: (i) => typeof i == "string" ? i : A ? A(i) : String(i[c || "label"]),
613
619
  value: V,
614
- inputValue: pe,
615
- isOptionEqualToValue: (i, x) => typeof i == "string" ? String(i) === String(x) : String(i[h || "id"]) === String(x[h || "id"]),
620
+ inputValue: ee,
621
+ isOptionEqualToValue: (i, y) => typeof i == "string" ? String(i) === String(y) : String(i[h || "id"]) === String(y[h || "id"]),
616
622
  getOptionKey(i) {
617
623
  return String(typeof i == "string" ? i : i[h || "id"]);
618
624
  },
619
- onChange: (i, x) => {
620
- P && P(i, x);
625
+ onChange: (i, y) => {
626
+ D && D(i, y);
621
627
  },
622
- onInputChange: (i, x) => {
623
- M && M(i, x), ee(x);
628
+ onInputChange: (i, y) => {
629
+ M && M(i, y), L(y);
624
630
  },
625
- onHighlightChange: (i, x, W) => {
626
- var H;
627
- if (W === "keyboard") {
628
- const L = document.querySelector("#autocomplete-list"), A = (i == null ? void 0 : i.target).getAttribute("aria-activedescendant");
629
- L == null || L.querySelectorAll("li").forEach((l) => l.classList.remove(Z["option-focused"])), (H = L == null ? void 0 : L.querySelector(`[id="${A}"]`)) == null || H.classList.add(Z["option-focused"]);
631
+ onHighlightChange: (i, y, E) => {
632
+ var l;
633
+ if (E === "keyboard") {
634
+ const T = document.querySelector("#autocomplete-list"), oe = (i == null ? void 0 : i.target).getAttribute("aria-activedescendant");
635
+ T == null || T.querySelectorAll("li").forEach((se) => se.classList.remove(Z["option-focused"])), (l = T == null ? void 0 : T.querySelector(`[id="${oe}"]`)) == null || l.classList.add(Z["option-focused"]);
630
636
  }
631
637
  }
632
- }), re = {
638
+ }), be = {
633
639
  ...te(),
634
- ...K,
635
- classNameWrapper: U
640
+ ...W,
641
+ classNameWrapper: B
636
642
  };
637
- return /* @__PURE__ */ Q("div", { className: ut(Z.autocomplete, b), "data-testid": k, children: /* @__PURE__ */ it("div", { ...ge(), children: [
643
+ return /* @__PURE__ */ Q("div", { className: ut(Z.autocomplete, b), "data-testid": k, children: /* @__PURE__ */ it("div", { ...U(), children: [
638
644
  /* @__PURE__ */ Q(
639
645
  ft,
640
646
  {
641
- rightIcon: B === "search" && /* @__PURE__ */ Q(ct, { color: "var(--accent)", icon: "magnifying-glass" }),
642
- ...re
647
+ rightIcon: j === "search" && /* @__PURE__ */ Q(ct, { color: "var(--accent)", icon: "magnifying-glass" }),
648
+ ...be
643
649
  }
644
650
  ),
645
- R.length > 0 && !K.disabled && /* @__PURE__ */ Q(
651
+ R.length > 0 && !W.disabled && /* @__PURE__ */ Q(
646
652
  "ul",
647
653
  {
648
- ...ne(),
654
+ ...re(),
649
655
  id: "autocomplete-list",
650
656
  className: Z["autocomplete__dropdown-list"],
651
- children: R.map((i, x) => {
652
- const W = v({ option: i, index: x }), H = typeof i == "string" ? i : m ? m(i) : String(i[c || "label"]);
653
- return /* @__PURE__ */ Q("li", { tabIndex: x, className: Z["autocomplete__dropdown-item"], ...W, children: H });
657
+ children: R.map((i, y) => {
658
+ const { key: E, ...l } = ne({
659
+ option: i,
660
+ index: y
661
+ }), T = typeof i == "string" ? i : m ? m(i) : String(i[c || "label"]);
662
+ return /* @__PURE__ */ Q(
663
+ "li",
664
+ {
665
+ tabIndex: y,
666
+ className: Z["autocomplete__dropdown-item"],
667
+ ...l,
668
+ children: T
669
+ },
670
+ E
671
+ );
654
672
  })
655
673
  }
656
674
  )
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: <T extends string | object>({ labelKey, valueKey, renderOption, customSelectedOptionLabel, options, type, value, onChange, onInputChange, classNameWrapper, "data-testid-wrapper": dataTestId, classNameInputWrapper, ...props }: import('./Autocomplete.tsx').AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
4
+ component: <T extends string | object>({ labelKey, valueKey, renderOption, customSelectedOptionLabel, options, type, value, onChange, onInputChange, classNameWrapper, "data-testid-wrapper": dataTestId, classNameInputWrapper, open, onOpen, onClose, ...props }: import('./Autocomplete.tsx').AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {
7
7
  layout: string;
@@ -22,3 +22,4 @@ export declare const WithLeftIcon: Story;
22
22
  export declare const WithBothIcons: Story;
23
23
  export declare const WithInfoMessage: Story;
24
24
  export declare const WithErrorMessage: Story;
25
+ export declare const HandleOpenCloseState: Story;
@@ -1,49 +1,89 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { Avatar as y } from "../Avatar/Avatar.js";
3
- import { Icon as f } from "../Icon/Icon.js";
4
- import { SkeletonCircle as _, Skeleton as r } from "../Skeleton/Skeleton.js";
1
+ import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
2
+ import { Avatar as _ } from "../Avatar/Avatar.js";
3
+ import { Icon as y } from "../Icon/Icon.js";
4
+ import { SkeletonCircle as f, Skeleton as r } from "../Skeleton/Skeleton.js";
5
5
  import { Typography as a } from "../Typography/Typography.js";
6
- import '../../assets/TransactionRow.css';const b = "_container_kdqr0_1", i = {
7
- container: b,
8
- "container-grid": "_container-grid_kdqr0_6",
9
- "container-pending": "_container-pending_kdqr0_13",
10
- "container-pending--right": "_container-pending--right_kdqr0_19",
11
- "info-section": "_info-section_kdqr0_27",
12
- "info-section--item": "_info-section--item_kdqr0_30",
13
- "info-section--right": "_info-section--right_kdqr0_37"
14
- }, A = ({
15
- dateTime: p,
16
- category: s,
17
- categoryType: l,
18
- name: d,
6
+ import '../../assets/TransactionRow.css';const k = "_container_sv3th_1", w = "_separator_sv3th_63", n = {
7
+ container: k,
8
+ "container-grid": "_container-grid_sv3th_6",
9
+ "container-pending": "_container-pending_sv3th_13",
10
+ "container-pending--right": "_container-pending--right_sv3th_19",
11
+ "info-section": "_info-section_sv3th_27",
12
+ "info-section--content": "_info-section--content_sv3th_31",
13
+ "info-section--item": "_info-section--item_sv3th_35",
14
+ "info-section--right": "_info-section--right_sv3th_52",
15
+ "truncate-text": "_truncate-text_sv3th_56",
16
+ separator: w
17
+ }, D = ({
18
+ dateTime: g,
19
+ category: l,
20
+ categoryType: d,
21
+ name: h,
19
22
  type: N,
20
- installments: h,
21
- amount: v,
22
- month: g,
23
- icon: m,
24
- onClick: o,
25
- isPendingTransaction: k,
26
- isLoading: t = !1,
27
- "data-testid": n = "Description"
28
- }) => k ? /* @__PURE__ */ e("div", { className: i.container, children: /* @__PURE__ */ c("div", { className: i["container-pending"], onClick: () => o == null ? void 0 : o(), children: [
29
- t ? /* @__PURE__ */ e(_, { size: "32px", "data-testid": `${n}-skeletonIcon` }) : /* @__PURE__ */ e(y, { type: "icon", children: /* @__PURE__ */ e(f, { icon: m || "clock" }) }),
30
- /* @__PURE__ */ e("div", { className: i["info-section"], children: /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 140 }, "data-testid": `${n}-skeletonName` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: d }) }) }),
31
- /* @__PURE__ */ e("div", { className: i["container-pending--right"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonAmount` }) : /* @__PURE__ */ e(a, { bold: !0, color: "var(--gray-95)", variant: "base", children: v }) })
32
- ] }) }) : /* @__PURE__ */ e("div", { className: i.container, children: /* @__PURE__ */ c("div", { onClick: () => o == null ? void 0 : o(), className: i["container-grid"], children: [
33
- /* @__PURE__ */ e("div", { children: t ? /* @__PURE__ */ e(r, { style: { width: 50 }, "data-testid": `${n}-skeletonMonth` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: g }) }),
34
- /* @__PURE__ */ e("div", { children: t ? /* @__PURE__ */ e(r, { style: { width: 90 }, "data-testid": `${n}-skeletonDate` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: p }) }),
35
- t ? /* @__PURE__ */ e(_, { size: "32px", "data-testid": `${n}-skeletonIcon` }) : /* @__PURE__ */ e(y, { type: "icon", children: /* @__PURE__ */ e(f, { icon: m || "coin" }) }),
36
- /* @__PURE__ */ c("div", { className: i["info-section"], children: [
37
- /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonName` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: d }) }),
38
- s && /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonCategory` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: s }) }),
39
- l && /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonCategoryType` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: l }) })
23
+ installments: v,
24
+ amount: m,
25
+ month: $,
26
+ icon: p,
27
+ onClick: c,
28
+ isPendingTransaction: b,
29
+ isLoading: i = !1,
30
+ "data-testid": t = "Description"
31
+ }) => b ? /* @__PURE__ */ e("div", { className: n.container, children: /* @__PURE__ */ s("div", { className: n["container-pending"], onClick: () => c == null ? void 0 : c(), children: [
32
+ i ? /* @__PURE__ */ e(f, { size: "32px", "data-testid": `${t}-skeletonIcon` }) : /* @__PURE__ */ e(_, { type: "icon", children: /* @__PURE__ */ e(y, { icon: p || "clock" }) }),
33
+ /* @__PURE__ */ e("div", { className: n["info-section"], children: /* @__PURE__ */ e("div", { className: n["info-section--item"], children: i ? /* @__PURE__ */ e(r, { style: { width: 140 }, "data-testid": `${t}-skeletonName` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", "data-testid": `${t}-content`, children: h }) }) }),
34
+ /* @__PURE__ */ e("div", { className: n["container-pending--right"], children: i ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${t}-skeletonAmount` }) : /* @__PURE__ */ e(a, { bold: !0, color: "var(--gray-95)", variant: "base", children: m }) })
35
+ ] }) }) : /* @__PURE__ */ e("div", { className: n.container, children: /* @__PURE__ */ s("div", { onClick: () => c == null ? void 0 : c(), className: n["container-grid"], children: [
36
+ /* @__PURE__ */ e("div", { children: i ? /* @__PURE__ */ e(r, { style: { width: 50 }, "data-testid": `${t}-skeletonMonth` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: $ }) }),
37
+ /* @__PURE__ */ e("div", { children: i ? /* @__PURE__ */ e(r, { style: { width: 90 }, "data-testid": `${t}-skeletonDate` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: g }) }),
38
+ i ? /* @__PURE__ */ e(f, { size: "32px", "data-testid": `${t}-skeletonIcon` }) : /* @__PURE__ */ e(_, { type: "icon", children: /* @__PURE__ */ e(y, { icon: p || "coin" }) }),
39
+ /* @__PURE__ */ e("div", { className: n["info-section"], children: /* @__PURE__ */ e("div", { className: n["info-section--content"], children: i ? /* @__PURE__ */ s(o, { children: [
40
+ /* @__PURE__ */ e(
41
+ r,
42
+ {
43
+ style: { width: 70, display: "inline-block", marginLeft: "8px" },
44
+ "data-testid": `${t}-skeletonName`
45
+ }
46
+ ),
47
+ /* @__PURE__ */ e(
48
+ r,
49
+ {
50
+ style: { width: 70, display: "inline-block", marginLeft: "8px" },
51
+ "data-testid": `${t}-skeletonCategory`
52
+ }
53
+ ),
54
+ /* @__PURE__ */ e(
55
+ r,
56
+ {
57
+ style: { width: 70, display: "inline-block", marginLeft: "8px" },
58
+ "data-testid": `${t}-skeletonCategoryType`
59
+ }
60
+ )
61
+ ] }) : /* @__PURE__ */ s(
62
+ a,
63
+ {
64
+ color: "var(--gray-95)",
65
+ variant: "base",
66
+ className: n["truncate-text"],
67
+ "data-testid": `${t}-content`,
68
+ children: [
69
+ /* @__PURE__ */ e("span", { "data-testid": `${t}-name`, children: h }),
70
+ l && /* @__PURE__ */ s(o, { children: [
71
+ /* @__PURE__ */ e("span", { className: n.separator }),
72
+ /* @__PURE__ */ e("span", { "data-testid": `${t}-category`, children: l })
73
+ ] }),
74
+ d && /* @__PURE__ */ s(o, { children: [
75
+ /* @__PURE__ */ e("span", { className: n.separator }),
76
+ /* @__PURE__ */ e("span", { "data-testid": `${t}-categoryType`, children: d })
77
+ ] })
78
+ ]
79
+ }
80
+ ) }) }),
81
+ /* @__PURE__ */ s("div", { className: n["info-section--right"], children: [
82
+ v && /* @__PURE__ */ e("div", { className: n["info-section--item"], children: i ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${t}-skeletonInstallments` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: v }) }),
83
+ /* @__PURE__ */ e("div", { className: n["info-section--item"], children: i ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${t}-skeletonType` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: N }) })
40
84
  ] }),
41
- /* @__PURE__ */ c("div", { className: i["info-section--right"], children: [
42
- h && /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonInstallments` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: h }) }),
43
- /* @__PURE__ */ e("div", { className: i["info-section--item"], children: t ? /* @__PURE__ */ e(r, { style: { width: 70 }, "data-testid": `${n}-skeletonType` }) : /* @__PURE__ */ e(a, { color: "var(--gray-95)", variant: "base", children: N }) })
44
- ] }),
45
- /* @__PURE__ */ e("div", { className: i["info-section--right"], children: t ? /* @__PURE__ */ e(r, { style: { width: 140 }, "data-testid": `${n}-skeletonAmount` }) : /* @__PURE__ */ e(a, { bold: !0, variant: "base", children: v }) })
85
+ /* @__PURE__ */ e("div", { className: n["info-section--right"], children: i ? /* @__PURE__ */ e(r, { style: { width: 140 }, "data-testid": `${t}-skeletonAmount` }) : /* @__PURE__ */ e(a, { bold: !0, variant: "base", children: m }) })
46
86
  ] }) });
47
87
  export {
48
- A as TransactionRow
88
+ D as TransactionRow
49
89
  };
@@ -33,3 +33,4 @@ export declare const WithTwoCurrencies: Story;
33
33
  export declare const WithLargeAmount: Story;
34
34
  export declare const IsPending: Story;
35
35
  export declare const IsPendingLoading: Story;
36
+ export declare const LongTitleAndCategory: Story;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pismo/marola",
3
3
  "description": "CDX tribe component library",
4
- "version": "2.1.14",
4
+ "version": "2.1.16",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",