prometeo-design-system 4.1.5 → 4.1.8

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 (33) hide show
  1. package/dist/Avatar.es.js +37 -38
  2. package/dist/CardProfile.es.js +278 -3
  3. package/dist/Icons/UserAvatar.es.js +4 -4
  4. package/dist/Input.es.js +72 -71
  5. package/dist/PlainTooltip.es.js +19 -19
  6. package/dist/PyrionLayout.es.js +459 -409
  7. package/dist/Select.es.js +46 -46
  8. package/dist/TicketCard.es.js +33 -31
  9. package/dist/badge-BEx-0Q-K.js +35 -0
  10. package/dist/components/Avatar/Avatar.d.ts +1 -2
  11. package/dist/index.d.ts +0 -16
  12. package/dist/prometeo-design-system.es.js +119 -2906
  13. package/dist/styles.css +1 -1
  14. package/package.json +1 -1
  15. package/dist/CardProfile-C1F83KJV.js +0 -280
  16. package/dist/badge-CbqYNrl4.js +0 -87
  17. package/dist/components/Layout/LayoutGeneric.d.ts +0 -6
  18. package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +0 -32
  19. package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +0 -2
  20. package/dist/components/Sidebar/SecondaryBar/index.d.ts +0 -1
  21. package/dist/components/Sidebar/SidebarComposable.d.ts +0 -43
  22. package/dist/components/Sidebar/components/NavigationLink.d.ts +0 -11
  23. package/dist/components/Sidebar/components/company-logo.d.ts +0 -5
  24. package/dist/components/Sidebar/components/nav-actions.d.ts +0 -7
  25. package/dist/components/Sidebar/components/nav-links.d.ts +0 -7
  26. package/dist/components/Sidebar/context/SidebarContext.d.ts +0 -13
  27. package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +0 -3
  28. package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +0 -9
  29. package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +0 -4
  30. package/dist/components/Sidebar/hooks/useNavLinks.d.ts +0 -32
  31. package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +0 -13
  32. package/dist/components/Sidebar/index.d.ts +0 -12
  33. package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +0 -2
package/dist/Input.es.js CHANGED
@@ -8,7 +8,7 @@ import { EyeVisibility as oe } from "./Icons/EyeVisibility.es.js";
8
8
  import { EyeVisibilityOff as se } from "./Icons/EyeVisibilityOff.es.js";
9
9
  import le from "./Button.es.js";
10
10
  import { Close as ae } from "./Icons/Close.es.js";
11
- const m = {
11
+ const x = {
12
12
  default: {
13
13
  container: "",
14
14
  input: e(
@@ -44,45 +44,45 @@ const m = {
44
44
  }
45
45
  }, $ = V(
46
46
  ({
47
- label: x,
48
- icon: s,
49
- iconPosition: d = "left",
47
+ label: h,
48
+ icon: o,
49
+ iconPosition: l = "left",
50
50
  onChange: I,
51
51
  value: S,
52
- name: h,
52
+ name: b,
53
53
  width: i = "100%",
54
- height: l,
55
- variant: a = "default",
56
- labelVariant: o = "default",
54
+ height: a,
55
+ variant: u = "default",
56
+ labelVariant: s = "default",
57
57
  size: E = "medium",
58
- disabled: u = !1,
58
+ disabled: f = !1,
59
59
  type: r = "text",
60
60
  isFetching: n,
61
- errorComponent: b,
62
- helperComponent: g,
61
+ errorComponent: g,
62
+ helperComponent: w,
63
63
  placeholder: L,
64
- required: j = !1,
65
- onFocus: P,
66
- onBlur: R,
67
- onKeyDown: k,
68
- onKeyUp: B,
69
- className: C,
70
- style: D,
71
- readOnly: M = !1,
72
- onClear: N,
64
+ required: N = !1,
65
+ onFocus: R,
66
+ onBlur: k,
67
+ onKeyDown: B,
68
+ onKeyUp: D,
69
+ className: P,
70
+ style: M,
71
+ readOnly: O = !1,
72
+ onClear: m,
73
73
  onClickIcon: z,
74
74
  ...v
75
- }, O) => {
76
- const [w, T] = F(!1), { ref: A } = te();
77
- let f = E;
78
- l && (f = "customHeight");
75
+ }, T) => {
76
+ const [y, A] = F(!1), { ref: C } = te();
77
+ let p = E;
78
+ a && (p = "customHeight");
79
79
  const c = {
80
80
  small: {
81
81
  container: "text-sm",
82
82
  input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
83
83
  label: ` prometeo-fonts-label-large
84
84
  peer-focus:prometeo-fonts-label-large
85
- peer-placeholder-shown:${o === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
85
+ peer-placeholder-shown:${s === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
86
86
  icon: "w-4 h-4 right-3"
87
87
  },
88
88
  medium: {
@@ -90,7 +90,7 @@ const m = {
90
90
  input: "h-12 px-3 prometeo-fonts-body-large",
91
91
  label: ` prometeo-fonts-label-large
92
92
  peer-focus:prometeo-fonts-label-large
93
- peer-placeholder-shown:${o === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
93
+ peer-placeholder-shown:${s === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
94
94
  icon: "w-5 h-5 right-3"
95
95
  },
96
96
  large: {
@@ -106,112 +106,113 @@ const m = {
106
106
  icon: "w-6 h-6 right-3"
107
107
  }
108
108
  }, G = () => {
109
- T(!w);
110
- }, y = {};
111
- i && i !== "100%" && (y.width = i), l && (y.height = l);
112
- const H = a === "error" && b, J = !H && g, K = r === "password", Q = () => o === "static" ? "-top-1 -translate-y-full left-0 pl-3" : s ? `${p ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${d === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${p ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, U = () => l ? c.customHeight.label : c[f].label, W = () => l ? { height: l } : {}, X = () => o === "default" ? x : L || x || "", Y = () => K ? s ? d === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : s ? d === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", Z = o === "default" && "transition-all duration-200 ease-in-out", p = b || g;
109
+ A(!y);
110
+ }, j = {};
111
+ i && i !== "100%" && (j.width = i), a && (j.height = a);
112
+ const H = u === "error" && g, J = !H && w, K = r === "password", Q = () => s === "static" ? "-top-1 -translate-y-full left-0 pl-3" : o ? `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${l === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, U = () => a ? c.customHeight.label : c[p].label, W = () => a ? { height: a } : {}, X = () => s === "default" ? h : L || h || "", Y = () => K ? !o && !m ? "pr-10" : l === "left" ? "pl-10 pr-10" : "pr-16" : m ? o ? l === "left" ? "pl-10 pr-7" : "pr-10 pl-3" : "pr-7" : o ? l === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", Z = s === "default" && "transition-all duration-200 ease-in-out", d = g || w;
113
113
  return /* @__PURE__ */ t.jsxs(
114
114
  "div",
115
115
  {
116
116
  className: e(
117
117
  "relative",
118
- c[f].container,
118
+ c[p].container,
119
119
  !i && "w-full",
120
120
  "bg-inherit",
121
- o === "static" && "mt-2",
122
- C
121
+ s === "static" && "mt-2",
122
+ P
123
123
  ),
124
- style: { ...D, ...y },
124
+ style: { ...M, ...j },
125
125
  children: [
126
126
  /* @__PURE__ */ t.jsx(
127
127
  "input",
128
128
  {
129
- id: h,
130
- name: h,
131
- ref: O,
129
+ id: b,
130
+ name: b,
131
+ ref: T,
132
132
  value: S,
133
133
  placeholder: X(),
134
- type: r === "password" && w ? "text" : r,
134
+ type: r === "password" && y ? "text" : r,
135
135
  className: e(
136
136
  "peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
137
137
  "focus:outline-none px-3",
138
- o === "default" && "placeholder:text-transparent",
139
- o === "static" && "placeholder:text-neutral-medium-default ",
140
- m[a].input,
141
- c[f].input,
142
- s && "pr-10",
143
- u && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
144
- m[a].container,
138
+ s === "default" && "placeholder:text-transparent",
139
+ s === "static" && "placeholder:text-neutral-medium-default ",
140
+ x[u].input,
141
+ c[p].input,
142
+ o && "pr-10",
143
+ f && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
144
+ x[u].container,
145
145
  Y()
146
146
  ),
147
147
  style: W(),
148
148
  onChange: I,
149
- onFocus: P,
150
- onBlur: R,
151
- disabled: u,
152
- required: j,
153
- onKeyDown: k,
154
- onKeyUp: B,
149
+ onFocus: R,
150
+ onBlur: k,
151
+ disabled: f,
152
+ required: N,
153
+ onKeyDown: B,
154
+ onKeyUp: D,
155
155
  defaultValue: v.defaultValue,
156
- readOnly: M,
156
+ readOnly: O,
157
157
  ...v
158
158
  }
159
159
  ),
160
160
  /* @__PURE__ */ t.jsx(
161
161
  "label",
162
162
  {
163
- ref: A,
164
- htmlFor: h,
163
+ ref: C,
164
+ htmlFor: b,
165
165
  className: e(
166
166
  "absolute left-3 pointer-events-none px-1 z-10",
167
167
  Z,
168
168
  U(),
169
- m[a].label,
169
+ x[u].label,
170
170
  Q(),
171
- j && "after:content-['*'] after:text-error-default after:ml-1",
172
- u && "text-neutral-medium-disabled prometeo-fonts-label-large"
171
+ N && "after:content-['*'] after:text-error-default after:ml-1",
172
+ f && "text-neutral-medium-disabled prometeo-fonts-label-large"
173
173
  ),
174
- children: x
174
+ children: h
175
175
  }
176
176
  ),
177
- (s || r === "password" || n) && /* @__PURE__ */ t.jsx(
177
+ (o || r === "password" || n) && /* @__PURE__ */ t.jsx(
178
178
  "button",
179
179
  {
180
180
  tabIndex: -1,
181
181
  type: "button",
182
182
  className: e(
183
- `absolute ${p ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
184
- c[f].icon,
185
- m[a].icon,
183
+ `absolute ${d ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
184
+ c[p].icon,
185
+ x[u].icon,
186
186
  (r === "password" || z) && !n ? "cursor-pointer" : "pointer-events-none",
187
- d === "right" ? "right-3" : "left-3"
187
+ l === "right" ? "right-3" : "left-3"
188
188
  ),
189
189
  onClick: n ? void 0 : r === "password" ? G : z,
190
190
  onMouseDown: (_) => r === "password" && !n && _.preventDefault(),
191
191
  children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
192
- n && r !== "password" ? /* @__PURE__ */ t.jsx(ee, { variant: "sync", size: "small", className: "size-5" }) : s,
193
- r === "password" && (w ? /* @__PURE__ */ t.jsx(oe, { size: 24, className: "" }) : /* @__PURE__ */ t.jsx(se, { size: 24, className: "" }))
192
+ n && r !== "password" ? /* @__PURE__ */ t.jsx(ee, { variant: "sync", size: "small", className: "size-5" }) : o,
193
+ r === "password" && (y ? /* @__PURE__ */ t.jsx(oe, { size: 24, className: "" }) : /* @__PURE__ */ t.jsx(se, { size: 24, className: "" }))
194
194
  ] })
195
195
  }
196
196
  ),
197
- N && /* @__PURE__ */ t.jsx(
197
+ m && /* @__PURE__ */ t.jsx(
198
198
  le,
199
199
  {
200
200
  type: "button",
201
201
  className: e(
202
- `absolute ${p ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10 right-1`,
202
+ `absolute ${d ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10 right-1`,
203
203
  "size-6 p-1 rounded-full",
204
204
  "hover:bg-neutral-medium-hover transition-colors",
205
- u && "opacity-50 cursor-not-allowed"
205
+ f && "opacity-50 cursor-not-allowed",
206
+ (o && l === "right" || r === "password" || n) && "mr-9"
206
207
  ),
207
- disabled: u,
208
- onClick: N,
208
+ disabled: f,
209
+ onClick: m,
209
210
  variant: "text",
210
211
  color: "secondary",
211
212
  icon: /* @__PURE__ */ t.jsx(ae, { size: 20, className: "" })
212
213
  }
213
214
  ),
214
- p && /* @__PURE__ */ t.jsx("div", { className: "min-h-6", children: (H || J) && /* @__PURE__ */ t.jsx(re, { className: "absolute ", variant: a, children: b || g }) })
215
+ d && /* @__PURE__ */ t.jsx("div", { className: "min-h-6", children: (H || J) && /* @__PURE__ */ t.jsx(re, { className: "absolute ", variant: u, children: g || w }) })
215
216
  ]
216
217
  }
217
218
  );
@@ -1,62 +1,62 @@
1
1
  import { j as y } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as _ } from "./cn-B6yFEsav.js";
3
- import { memo as j, useRef as v, useCallback as A, useEffect as a } from "react";
3
+ import { memo as j, useRef as v, useCallback as A, useEffect as u } from "react";
4
4
  import { createPortal as C } from "react-dom";
5
5
  const G = ({ title: w, children: p, delayToShow: x = 500, delayToClose: R = 1e3, className: B, attachToParent: d = !1, disabled: D = !1 }) => {
6
- const s = v(null), r = v(null), n = v(null), o = A(() => {
6
+ const s = v(null), n = v(null), r = v(null), o = A(() => {
7
7
  if (typeof window > "u")
8
8
  return;
9
- const e = r.current, i = s.current;
9
+ const e = n.current, i = s.current;
10
10
  if (!e || !i)
11
11
  return;
12
12
  const l = window.getComputedStyle(e).display, c = e.style.display, m = e.style.visibility, f = e.style.translate, h = l === "none";
13
13
  h && (e.style.visibility = "hidden", e.style.display = "block"), f && e.style.removeProperty("translate");
14
14
  const E = i.getBoundingClientRect();
15
15
  d ? (e.style.removeProperty("position"), e.style.removeProperty("left"), e.style.removeProperty("top")) : (e.style.setProperty("position", "fixed"), e.style.setProperty("left", `${E.right}px`), e.style.setProperty("top", `${E.bottom}px`));
16
- const u = e.getBoundingClientRect(), I = window.innerWidth, N = window.innerHeight, b = Math.max(0, 0 - u.left), M = Math.max(0, u.right - I), L = Math.max(0, 0 - u.top), P = Math.max(0, u.bottom - N), O = b > 0 ? b + 16 : M > 0 ? -(M + 16) : 0, T = L > 0 ? L + 16 : P > 0 ? -(P + 16) : 0;
16
+ const a = e.getBoundingClientRect(), I = window.innerWidth, N = window.innerHeight, b = Math.max(0, 0 - a.left), M = Math.max(0, a.right - I), L = Math.max(0, 0 - a.top), P = Math.max(0, a.bottom - N), O = b > 0 ? b + 16 : M > 0 ? -(M + 16) : 0, T = L > 0 ? L + 16 : P > 0 ? -(P + 16) : 0;
17
17
  O === 0 && T === 0 ? e.style.removeProperty("translate") : e.style.setProperty("translate", `${O}px ${T}px`), h && (e.style.display = c, e.style.visibility = m);
18
18
  }, [d]);
19
- if (a(() => {
20
- const t = s.current, e = r.current;
19
+ if (u(() => {
20
+ const t = s.current, e = n.current;
21
21
  if (!t || !e)
22
22
  return;
23
23
  const i = (m, f) => {
24
- n.current = setTimeout(() => {
24
+ r.current = setTimeout(() => {
25
25
  f();
26
26
  }, m);
27
27
  }, l = () => {
28
- n.current && clearTimeout(n.current), o(), i(x, () => {
29
- r.current?.classList.add("visible");
28
+ r.current && clearTimeout(r.current), o(), i(x, () => {
29
+ n.current?.classList.add("visible");
30
30
  });
31
31
  }, c = () => {
32
- n.current && clearTimeout(n.current), i(R, () => {
33
- r.current?.classList.remove("visible");
32
+ r.current && clearTimeout(r.current), i(R, () => {
33
+ n.current?.classList.remove("visible");
34
34
  });
35
35
  };
36
36
  return t.addEventListener("mouseenter", l), t.addEventListener("mouseleave", c), () => {
37
37
  t.removeEventListener("mouseenter", l), t.removeEventListener("mouseleave", c);
38
38
  };
39
- }, [x, R, o]), a(() => {
39
+ }, [x, R, o]), u(() => {
40
40
  o();
41
- }, [o, w]), a(() => {
41
+ }, [o, w]), u(() => {
42
42
  if (typeof window > "u")
43
43
  return;
44
44
  const t = () => {
45
- r.current && r.current.classList.contains("visible") && o();
45
+ n.current && n.current.classList.contains("visible") && o();
46
46
  };
47
47
  return window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
48
48
  window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
49
49
  };
50
- }, [o]), a(() => () => {
51
- n.current && clearTimeout(n.current);
50
+ }, [o]), u(() => () => {
51
+ r.current && clearTimeout(r.current);
52
52
  }, []), D) return p;
53
- const g = /* @__PURE__ */ y.jsx("span", { ref: r, className: _(
53
+ const g = /* @__PURE__ */ y.jsx("span", { ref: n, className: _(
54
54
  "plain-tooltip ",
55
55
  "absolute z-999",
56
56
  "bg-neutral-weak-default px-2 py-1 rounded-lg w-max",
57
- "text-neutral-strong-default prometeo-fonts-body-small ",
57
+ "text-neutral-strong-default prometeo-fonts-body-small text-balance ",
58
58
  B,
59
- r.current?.innerText?.length && r.current?.innerText?.length > Math.floor(450 / 10) ? "w-max line-clamp-1" : "max-w-[200px] line-clamp-none"
59
+ n.current?.innerText?.length && n.current?.innerText?.length > Math.floor(450 / 10) ? "w-max line-clamp-1" : "max-w-[200px] line-clamp-none"
60
60
  ), children: w });
61
61
  return !d && typeof document < "u" ? /* @__PURE__ */ y.jsxs("div", { ref: s, children: [
62
62
  p,