prometeo-design-system 4.4.0 → 4.4.3

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.
@@ -4,19 +4,19 @@ import { useState as A, useRef as E, useEffect as b, useMemo as ee, useCallback
4
4
  import Z from "./Select.es.js";
5
5
  function re(e) {
6
6
  const {
7
- options: C,
7
+ options: O,
8
8
  fetcher: d,
9
- asyncMode: _ = "fetch_in_open",
10
- disabled: w = !1,
11
- debounceDelay: P = 500,
9
+ asyncMode: w = "fetch_in_open",
10
+ disabled: _ = !1,
11
+ debounceDelay: M = 500,
12
12
  minCharacters: T = 3,
13
13
  optionLabel: h,
14
14
  optionValue: c,
15
15
  controlledValue: f,
16
- isOpen: F,
16
+ isOpen: P,
17
17
  inputRef: p,
18
18
  name: I
19
- } = e || {}, M = C ? C.filter((n) => n != null) : [], [V, g] = A(M || []), [D, k] = A(M || []), [s, N] = A(""), [W, v] = A(!1), [J, U] = A(!1), o = E(null), O = E(null), m = E(!1), S = E(d), L = e?.multiple === !0 || !1, j = E(L ? [] : void 0), [a, y] = A(L ? [] : void 0);
19
+ } = e || {}, F = O ? O.filter((n) => n != null) : [], [V, g] = A(F || []), [D, k] = A(F || []), [s, N] = A(""), [W, C] = A(!1), [J, U] = A(!1), o = E(null), v = E(null), m = E(!1), S = E(d), L = e?.multiple === !0 || !1, j = E(L ? [] : void 0), [a, y] = A(L ? [] : void 0);
20
20
  b(() => {
21
21
  S.current = d;
22
22
  }, [d]), b(() => {
@@ -54,28 +54,28 @@ function re(e) {
54
54
  t && t();
55
55
  };
56
56
  }, [e?.subscribeOpenChange]);
57
- const G = F !== void 0 ? F : J;
57
+ const G = P !== void 0 ? P : J;
58
58
  b(() => {
59
- if (!w && S.current && _ === "fetch_on_type") {
59
+ if (!_ && S.current && w === "fetch_on_type") {
60
60
  if (!s || s === "" || s.length < T) {
61
- o.current && clearTimeout(o.current), v(!1);
61
+ o.current && clearTimeout(o.current), C(!1);
62
62
  return;
63
63
  }
64
- const n = B(q, P);
65
- v(!0), n.then((t) => {
64
+ const n = B(q, M);
65
+ C(!0), n.then((t) => {
66
66
  const l = z(t);
67
67
  g(l);
68
68
  }).finally(() => {
69
- v(!1), e?.onFetchingEnd?.();
69
+ C(!1), e?.onFetchingEnd?.();
70
70
  });
71
71
  }
72
- }, [_, s, w, P, B, T]), b(() => {
73
- if (!w)
72
+ }, [w, s, _, M, B, T]), b(() => {
73
+ if (!_)
74
74
  if (G) {
75
- if (e?.onOpen?.(), _ === "fetch_in_open") {
75
+ if (e?.onOpen?.(), w === "fetch_in_open") {
76
76
  if (!S.current)
77
77
  return;
78
- v(!0), q().then((n) => {
78
+ C(!0), q().then((n) => {
79
79
  const t = z(n);
80
80
  g(() => {
81
81
  const l = t.filter((r) => {
@@ -85,12 +85,12 @@ function re(e) {
85
85
  return L && a.length > 0 ? [...$(a, l), ...a] : l;
86
86
  });
87
87
  }).finally(() => {
88
- v(!1), e?.onFetchingEnd?.();
88
+ C(!1), e?.onFetchingEnd?.();
89
89
  });
90
90
  }
91
91
  } else
92
92
  e?.onClose?.();
93
- }, [G, _, w]);
93
+ }, [G, w, _]);
94
94
  const H = (n, t) => n?.filter((l) => {
95
95
  if (h)
96
96
  return i(l, h)?.toLowerCase().includes(t.toLowerCase());
@@ -129,9 +129,9 @@ function re(e) {
129
129
  }
130
130
  }) || [], Q = (n) => {
131
131
  const t = typeof p == "function" ? p() : p;
132
- n.target === t?.current && (O.current && clearTimeout(O.current), m.current || (m.current = !0, e?.onTypeStart?.()), O.current = setTimeout(() => {
132
+ n.target === t?.current && (v.current && clearTimeout(v.current), m.current || (m.current = !0, e?.onTypeStart?.()), v.current = setTimeout(() => {
133
133
  m.current = !1;
134
- }, P));
134
+ }, M));
135
135
  };
136
136
  b(() => {
137
137
  if (s === "")
@@ -173,18 +173,18 @@ function re(e) {
173
173
  };
174
174
  }
175
175
  const he = (e) => {
176
- const C = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (o, O, m) => {
176
+ const O = E(null), { asyncMode: d = "fetch_in_open" } = e, w = (o, v, m) => {
177
177
  const S = {
178
178
  options: o.options,
179
179
  fetcher: o.fetcher,
180
- asyncMode: O,
180
+ asyncMode: v,
181
181
  debounceDelay: o.debounceDelay,
182
182
  minCharacters: o.minCharacters,
183
183
  disabled: o.disabled,
184
184
  optionValue: o.optionValue,
185
185
  optionLabel: o.optionLabel,
186
186
  onFetchingStart: () => {
187
- O === "fetch_on_type" && m.current?.open();
187
+ m.current?.open();
188
188
  },
189
189
  onTypeStart: () => {
190
190
  !o?.fetcher && m.current?.open();
@@ -204,29 +204,29 @@ const he = (e) => {
204
204
  controlledValue: o.value,
205
205
  onChange: o.onChange
206
206
  };
207
- }, { inputValue: w, setInputValue: P, filteredOptions: T, isLoading: h, value: c, onOptionClick: f, cleanInputValue: F, cleanOptions: p, clearValue: I } = re(_(e, d, C));
207
+ }, { inputValue: _, setInputValue: M, filteredOptions: T, isLoading: h, value: c, onOptionClick: f, cleanInputValue: P, cleanOptions: p, clearValue: I } = re(w(e, d, O));
208
208
  b(() => {
209
- !e.controls || !C.current || (e.controls.current = {
210
- ...C.current,
209
+ !e.controls || !O.current || (e.controls.current = {
210
+ ...O.current,
211
211
  cleanOptions: () => {
212
212
  p();
213
213
  }
214
214
  });
215
215
  }, [e.controls, p]);
216
- const M = ne(
216
+ const F = ne(
217
217
  () => d === "fetch_on_type" ? h : !1,
218
218
  [d, h]
219
219
  ), V = ee(() => e.multiple ? c.map((o) => i(o, e.optionValue)) : c ? i(c, e.optionValue) : void 0, [c, e.optionValue, e.multiple]), g = (o) => {
220
- const O = T.find((m) => i(m, e.optionValue) === o.id);
221
- O && f(O);
222
- }, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...v } = e.selectComponentProps || {}, J = {
223
- controledSearchValue: w,
224
- onSearchValueChange: d === "fetch_on_type" ? P : void 0,
220
+ const v = T.find((m) => i(m, e.optionValue) === o.id);
221
+ v && f(v);
222
+ }, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...C } = e.selectComponentProps || {}, J = {
223
+ controledSearchValue: _,
224
+ onSearchValueChange: d === "fetch_on_type" ? M : void 0,
225
225
  onSearchClear: d === "fetch_on_type" ? () => {
226
- F(), p();
226
+ P(), p();
227
227
  } : void 0,
228
228
  inputSearchPlaceholder: e.inputSearchPlaceholder,
229
- isLoading: M(),
229
+ isLoading: F(),
230
230
  focusSearchInputOnOpen: !0,
231
231
  ...k || {}
232
232
  }, U = () => {
@@ -240,7 +240,7 @@ const he = (e) => {
240
240
  name: e.name,
241
241
  overflow: s,
242
242
  placeholder: e.placeholder,
243
- ...v,
243
+ ...C,
244
244
  onClear: e?.selectComponentProps?.onClear && U,
245
245
  multiple: !0,
246
246
  value: V,
@@ -252,7 +252,7 @@ const he = (e) => {
252
252
  renderSelection: e.renderSelection,
253
253
  onOptionClick: g,
254
254
  displayMode: D,
255
- controls: C,
255
+ controls: O,
256
256
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
257
257
  dropdownOptions: J,
258
258
  isLoading: d === "fetch_in_open" ? h : !1
@@ -261,7 +261,7 @@ const he = (e) => {
261
261
  Z,
262
262
  {
263
263
  disabled: e.disabled,
264
- ...v,
264
+ ...C,
265
265
  placeholder: e.placeholder,
266
266
  onClear: U,
267
267
  className: e.className,
@@ -277,7 +277,7 @@ const he = (e) => {
277
277
  renderSelection: e.renderSelection,
278
278
  onOptionClick: g,
279
279
  displayMode: "compact",
280
- controls: C,
280
+ controls: O,
281
281
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
282
282
  dropdownOptions: J,
283
283
  isLoading: d === "fetch_in_open" ? h : !1
@@ -1,21 +1,21 @@
1
- import { j as n } from "./jsx-runtime-GkKLlHH4.js";
1
+ import { j as i } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { motion as I } from "framer-motion";
3
3
  import { memo as $, useId as w, useRef as z, useEffect as E, isValidElement as L } from "react";
4
4
  import { c as d } from "./cn-B6yFEsav.js";
5
5
  import M from "./PlainTooltip.es.js";
6
- const R = /* @__PURE__ */ Symbol.for("react.memo"), S = (e, a, o) => {
6
+ const R = /* @__PURE__ */ Symbol.for("react.memo"), S = (e, a, n) => {
7
7
  if (!e)
8
8
  return null;
9
9
  if (typeof e == "function") {
10
- const i = e;
11
- return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
10
+ const o = e;
11
+ return /* @__PURE__ */ i.jsx(o, { size: n, className: a });
12
12
  }
13
13
  if (typeof e == "object") {
14
14
  if (L(e))
15
15
  return e;
16
16
  if ("$$typeof" in e && e.$$typeof === R) {
17
- const i = e;
18
- return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
17
+ const o = e;
18
+ return /* @__PURE__ */ i.jsx(o, { size: n, className: a });
19
19
  }
20
20
  }
21
21
  return e;
@@ -23,28 +23,28 @@ const R = /* @__PURE__ */ Symbol.for("react.memo"), S = (e, a, o) => {
23
23
  function v({
24
24
  items: e,
25
25
  activeTab: a,
26
- onTabChange: o,
27
- className: i,
28
- tabClassName: l,
26
+ onTabChange: n,
27
+ className: o,
28
+ tabClassName: r,
29
29
  activeTabClassName: s,
30
30
  indicatorClassName: b,
31
- animated: r = !0,
31
+ animated: l = !0,
32
32
  renderTab: u
33
33
  }) {
34
- const p = (t) => {
35
- t.disabled || o?.(t.id, t);
36
- }, x = w();
37
- return /* @__PURE__ */ n.jsx(
34
+ const x = (t) => {
35
+ t.disabled || n?.(t.id, t);
36
+ }, p = w();
37
+ return /* @__PURE__ */ i.jsx(
38
38
  "div",
39
39
  {
40
40
  className: d(
41
- "flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5 overflow-hidden",
42
- i
41
+ "flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5 overflow-x-auto prometeo-scrollbar-none",
42
+ o
43
43
  ),
44
44
  role: "tablist",
45
45
  children: e?.map((t) => {
46
- const c = a === t.id, f = () => p(t), { iconPosition: h = "top", iconSize: m = 24 } = t;
47
- return u ? /* @__PURE__ */ n.jsx("div", { children: u(t, c, f, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ n.jsx(
46
+ const c = a === t.id, f = () => x(t), { iconPosition: h = "top", iconSize: m = 24 } = t;
47
+ return u ? /* @__PURE__ */ i.jsx("div", { children: u(t, c, f, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ i.jsx(
48
48
  H,
49
49
  {
50
50
  id: t.id,
@@ -53,17 +53,17 @@ function v({
53
53
  iconPosition: h,
54
54
  onClick: f,
55
55
  disabled: t.disabled,
56
- className: l,
56
+ className: r,
57
57
  isActive: c,
58
58
  activeClassName: s,
59
- animated: r,
59
+ animated: l,
60
60
  onIconHover: t.onIconHover,
61
61
  onIconClick: t.onIconClick,
62
62
  iconTooltipTitle: t.iconTooltipTitle,
63
63
  iconTooltipProps: t.iconTooltipProps,
64
64
  iconSize: m,
65
65
  indicatorClassName: b,
66
- layoutId: x
66
+ layoutId: p
67
67
  },
68
68
  t.id
69
69
  );
@@ -75,22 +75,22 @@ v.displayName = "TabLinks";
75
75
  const D = $(v, (e, a) => {
76
76
  if (e.activeTab !== a.activeTab || e.className !== a.className || e.tabClassName !== a.tabClassName || e.activeTabClassName !== a.activeTabClassName || e.indicatorClassName !== a.indicatorClassName || e.animated !== a.animated || e.onTabChange !== a.onTabChange || e.renderTab !== a.renderTab || e.items.length !== a.items.length)
77
77
  return !1;
78
- for (let o = 0; o < e.items.length; o++) {
79
- const i = e.items[o], l = a.items[o];
80
- if (i.id !== l.id || i.title !== l.title || i.disabled !== l.disabled || i.description !== l.description)
78
+ for (let n = 0; n < e.items.length; n++) {
79
+ const o = e.items[n], r = a.items[n];
80
+ if (o.id !== r.id || o.title !== r.title || o.disabled !== r.disabled || o.description !== r.description)
81
81
  return !1;
82
82
  }
83
83
  return !0;
84
- }), H = ({ id: e, title: a, icon: o, iconPosition: i = "top", onClick: l, disabled: s = !1, className: b, isActive: r, activeClassName: u, onIconHover: p, onIconClick: x, iconTooltipTitle: t, iconTooltipProps: c, iconSize: f = 20, indicatorClassName: h, layoutId: m }) => {
84
+ }), H = ({ id: e, title: a, icon: n, iconPosition: o = "top", onClick: r, disabled: s = !1, className: b, isActive: l, activeClassName: u, onIconHover: x, onIconClick: p, iconTooltipTitle: t, iconTooltipProps: c, iconSize: f = 20, indicatorClassName: h, layoutId: m }) => {
85
85
  const y = z(!0);
86
86
  E(() => {
87
87
  y.current && (y.current = !1);
88
88
  }, []);
89
- const C = (T, g, j, N, k) => j ? /* @__PURE__ */ n.jsx(M, { title: j, ...N, children: /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T }) }) : /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T });
90
- return /* @__PURE__ */ n.jsxs(
89
+ const C = (T, g, j, N, k) => j ? /* @__PURE__ */ i.jsx(M, { title: j, ...N, children: /* @__PURE__ */ i.jsx("div", { onMouseEnter: g, onClick: k, children: T }) }) : /* @__PURE__ */ i.jsx("div", { onMouseEnter: g, onClick: k, children: T });
90
+ return /* @__PURE__ */ i.jsxs(
91
91
  "button",
92
92
  {
93
- onClick: l,
93
+ onClick: r,
94
94
  disabled: s,
95
95
  className: d(
96
96
  "group/tablink-item",
@@ -98,35 +98,35 @@ const D = $(v, (e, a) => {
98
98
  s && "hover:text-primary-default-default cursor-pointer",
99
99
  s && "opacity-50 cursor-default",
100
100
  b,
101
- r && u
101
+ l && u
102
102
  ),
103
103
  tabIndex: s ? -1 : 0,
104
104
  "aria-label": a,
105
105
  role: "tab",
106
- "aria-selected": r,
106
+ "aria-selected": l,
107
107
  children: [
108
- /* @__PURE__ */ n.jsxs("div", { className: d(
108
+ /* @__PURE__ */ i.jsxs("div", { className: d(
109
109
  "flex items-center gap-0.5",
110
- i === "left" && "flex-row-reverse",
111
- i === "top" ? "flex-col-reverse" : "gap-1"
110
+ o === "left" && "flex-row-reverse",
111
+ o === "top" ? "flex-col-reverse" : "gap-1"
112
112
  ), children: [
113
- /* @__PURE__ */ n.jsx(
113
+ /* @__PURE__ */ i.jsx(
114
114
  "label",
115
115
  {
116
116
  className: d(
117
117
  "transition-all duration-300 ease-in-out relative z-10 group-hover/tablink-item:text-neutral-medium-hover ",
118
- r ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large cursor-pointer",
119
- "leading-6! line-clamp-1"
118
+ l ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large cursor-pointer",
119
+ "leading-6! min-w-max"
120
120
  ),
121
121
  children: a
122
122
  }
123
123
  ),
124
- C(S(o, d(
124
+ C(S(n, d(
125
125
  "transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
126
- r ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large"
127
- ), f), p, t, c, x)
126
+ l ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large"
127
+ ), f), x, t, c, p)
128
128
  ] }),
129
- r ? /* @__PURE__ */ n.jsx(
129
+ l ? /* @__PURE__ */ i.jsx(
130
130
  I.div,
131
131
  {
132
132
  layoutId: m ? `tab-indicator-${m}` : "tab-indicator",
@@ -1,4 +1,4 @@
1
- import { T as f } from "./TabLinks-BjGwvqR9.js";
1
+ import { T as f } from "./TabLinks-DnoWdrdk.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -6,6 +6,7 @@ export type CheckBoxProps = {
6
6
  interface ICheckBox extends CheckBoxProps {
7
7
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
8
  value?: string;
9
+ checked?: boolean;
9
10
  }
10
11
  declare const _default: import('react').NamedExoticComponent<Omit<ICheckBox, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
11
12
  export default _default;
@@ -6,6 +6,7 @@ export interface IHeader {
6
6
  subtitle?: string;
7
7
  subtitleClassName?: string;
8
8
  titleClassName?: string;
9
+ mainActionSlot?: ReactNode | (() => ReactNode);
9
10
  }
10
- declare const _default: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName, titleClassName }: IHeader) => import("react/jsx-runtime").JSX.Element>;
11
- export default _default;
11
+ declare const Header: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName, titleClassName, mainActionSlot }: IHeader) => import("react/jsx-runtime").JSX.Element>;
12
+ export default Header;
@@ -1,5 +1,5 @@
1
1
  export type InputVariant = "default" | "error" | "success";
2
- export type InputSize = "small" | "medium" | "large";
2
+ export type InputSize = "xsmall" | "small" | "medium" | "large";
3
3
  export type LabelVariant = "default" | "static";
4
4
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
5
5
  label: string;
@@ -31,5 +31,5 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
31
31
  onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
32
32
  onClickIcon?: (event: React.MouseEvent) => void;
33
33
  }
34
- declare const _default: import('react').NamedExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
35
- export default _default;
34
+ declare const Input: import('react').NamedExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
35
+ export default Input;
@@ -1,6 +1,6 @@
1
1
  import { ComponentVariant } from './types';
2
- type ChipProps = {
3
- id: string | number;
2
+ export type ChipProps = {
3
+ id?: string | number;
4
4
  label: string;
5
5
  onRemove?: (optionId: string | number) => void;
6
6
  className?: string;
@@ -0,0 +1,2 @@
1
+ export { default } from '../components/Shared/Chip';
2
+ export type { ChipProps } from '../components/Shared/Chip';
@@ -21,7 +21,7 @@ import { D as ne } from "./DatePicker-QuBgR5DQ.js";
21
21
  import { RecurrentDatePicker as me } from "./RecurrentDatePicker.es.js";
22
22
  import { RecurrentDatePickerRRule as ie } from "./RecurrentDatePickerRRule.es.js";
23
23
  import { Table as ce, TableBody as be, TableCaption as De, TableCell as ve, TableFooter as Te, TableHead as ge, TableHeader as ke, TableRow as he } from "./Table.es.js";
24
- import { T as Ce } from "./TabLinks-BjGwvqR9.js";
24
+ import { T as Ce } from "./TabLinks-DnoWdrdk.js";
25
25
  import { default as Ee } from "./TextArea.es.js";
26
26
  import { default as Re } from "./Tooltip.es.js";
27
27
  import { default as Se } from "./Skeleton.es.js";