prometeo-design-system 4.2.5 → 4.3.1

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 (58) hide show
  1. package/dist/Avatar.es.js +41 -40
  2. package/dist/CardProfile-C1F83KJV.js +280 -0
  3. package/dist/CardProfile.es.js +3 -291
  4. package/dist/CheckBox.es.js +21 -24
  5. package/dist/DialogModal.es.js +46 -52
  6. package/dist/Icons/UserAvatar.es.js +4 -4
  7. package/dist/Input.es.js +72 -73
  8. package/dist/NotificationCard.es.js +21 -27
  9. package/dist/PlainTooltip.es.js +19 -19
  10. package/dist/PyrionLayout.es.js +786 -879
  11. package/dist/Scrollable.es.js +127 -201
  12. package/dist/Select.es.js +47 -47
  13. package/dist/SelectSearch.es.js +83 -85
  14. package/dist/TabLinks.es.js +121 -2
  15. package/dist/TicketCard.es.js +2 -2
  16. package/dist/badge-CbqYNrl4.js +87 -0
  17. package/dist/components/Avatar/Avatar.d.ts +4 -2
  18. package/dist/components/CardProfile/CardProfile.d.ts +4 -7
  19. package/dist/components/DropZone/useFileDropzone.d.ts +1 -9
  20. package/dist/components/Layout/LayoutGeneric.d.ts +6 -0
  21. package/dist/components/NotificationCard/NotificationCard.d.ts +2 -3
  22. package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +2 -5
  23. package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +1 -3
  24. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +0 -2
  25. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +0 -2
  26. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +1 -3
  27. package/dist/components/Scrollable/Scrollable.d.ts +0 -19
  28. package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +32 -0
  29. package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +2 -0
  30. package/dist/components/Sidebar/SecondaryBar/index.d.ts +1 -0
  31. package/dist/components/Sidebar/SidebarComposable.d.ts +43 -0
  32. package/dist/components/Sidebar/components/NavigationLink.d.ts +11 -0
  33. package/dist/components/Sidebar/components/company-logo.d.ts +5 -0
  34. package/dist/components/Sidebar/components/nav-actions.d.ts +7 -0
  35. package/dist/components/Sidebar/components/nav-links.d.ts +7 -0
  36. package/dist/components/Sidebar/context/SidebarContext.d.ts +13 -0
  37. package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +3 -0
  38. package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +9 -0
  39. package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +4 -0
  40. package/dist/components/Sidebar/hooks/useNavLinks.d.ts +32 -0
  41. package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +13 -0
  42. package/dist/components/Sidebar/index.d.ts +12 -0
  43. package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +2 -0
  44. package/dist/components/TabLinks/TabLinks.d.ts +0 -19
  45. package/dist/components/UserCard/UserCard.d.ts +2 -3
  46. package/dist/hooks/useLabelBackground.d.ts +0 -1
  47. package/dist/index.d.ts +16 -0
  48. package/dist/prometeo-design-system.es.js +2906 -119
  49. package/dist/styles.css +1 -1
  50. package/dist/useLabelBackground-BDIHUdND.js +26 -0
  51. package/package.json +2 -2
  52. package/src/styles/base.css +46 -0
  53. package/dist/TabLinks-DxqprStp.js +0 -147
  54. package/dist/UserCard.d.ts +0 -6
  55. package/dist/UserCard.es.js +0 -28
  56. package/dist/badge-BEx-0Q-K.js +0 -35
  57. package/dist/exports/UserCard.d.ts +0 -2
  58. package/dist/useLabelBackground-D5SzHhl_.js +0 -32
package/dist/Avatar.es.js CHANGED
@@ -1,17 +1,18 @@
1
- import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
- import { g as v } from "./useLabelBackground-D5SzHhl_.js";
3
- import { c as x } from "./cn-B6yFEsav.js";
4
- import { useState as C, useRef as u, useLayoutEffect as N } from "react";
5
- import { UserAvatar as y } from "./Icons/UserAvatar.es.js";
6
- function I({
7
- imageUrl: s,
8
- sizeImage: n = "md",
9
- sizeFallback: e = "md",
10
- fallbackText: d = "",
11
- subImageUrl: i,
12
- fallbackType: c = "initials"
1
+ import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { g as S } from "./useLabelBackground-BDIHUdND.js";
3
+ import { c as u } from "./cn-B6yFEsav.js";
4
+ import { useState as N, useRef as d, useLayoutEffect as y } from "react";
5
+ import { UserAvatar as f } from "./Icons/UserAvatar.es.js";
6
+ function q({
7
+ imageUrl: t,
8
+ sizeImage: a = "md",
9
+ sizeFallback: s = "md",
10
+ sizeFallbackIcon: x = 24,
11
+ fallbackText: h = "Selene Soluciones",
12
+ subImageUrl: n,
13
+ fallbackType: i = "initials"
13
14
  }) {
14
- const [f, h] = C(!1), m = s && s.trim() !== "" && !f, g = (a) => a.split(" ").map((j) => j.charAt(0)).join("").toUpperCase().slice(0, 2), r = {
15
+ const [g, p] = N(!1), c = t && t.trim() !== "" && !g, w = (l) => l.split(" ").map((C) => C.charAt(0)).join("").toUpperCase().slice(0, 2), m = {
15
16
  xxxs: "w-6.5 h-6.5",
16
17
  xxs: "w-8 h-8",
17
18
  xs: "w-10 h-10",
@@ -19,7 +20,7 @@ function I({
19
20
  md: "w-24 h-24",
20
21
  lg: "w-32 h-32",
21
22
  xl: "w-40 h-40"
22
- }, p = {
23
+ }, b = {
23
24
  xxxs: "text-[12px]",
24
25
  xxs: "text-xs",
25
26
  xs: "text-sm",
@@ -27,7 +28,7 @@ function I({
27
28
  md: "text-2xl",
28
29
  lg: "text-3xl",
29
30
  xl: "text-4xl"
30
- }, w = {
31
+ }, j = {
31
32
  xxxs: "w-3 h-3",
32
33
  xxs: "w-[18px] h-[18px] bottom-0 right-0 translate-x-1/3 translate-y-1/3",
33
34
  xs: "w-5 h-5",
@@ -35,54 +36,54 @@ function I({
35
36
  md: "w-12 h-12 border-3",
36
37
  lg: "w-16 h-16 border-4",
37
38
  xl: "w-20 h-20 border-5"
38
- }, b = m ? n : e, o = u(null), l = u(null);
39
- return N(() => {
40
- if (!o.current || !l.current) return;
41
- const a = v(o.current);
42
- l.current.style.borderColor = a;
43
- }, []), /* @__PURE__ */ t.jsxs("div", { className: "relative inline-block min-w-max ", ref: o, children: [
44
- m ? /* @__PURE__ */ t.jsx(
39
+ }, v = c ? a : s, r = d(null), o = d(null);
40
+ return y(() => {
41
+ if (!r.current || !o.current) return;
42
+ const l = S(r.current);
43
+ o.current.style.borderColor = l;
44
+ }, []), /* @__PURE__ */ e.jsxs("div", { className: "relative inline-block min-w-max ", ref: r, children: [
45
+ c ? /* @__PURE__ */ e.jsx(
45
46
  "img",
46
47
  {
47
48
  onError: () => {
48
- h(!0);
49
+ p(!0);
49
50
  },
50
- src: s,
51
- className: `rounded-full object-cover ${r[n]}`,
51
+ src: t,
52
+ className: `rounded-full object-cover ${m[a]}`,
52
53
  alt: "Profile",
53
54
  draggable: !1
54
55
  }
55
- ) : c === "initials" ? /* @__PURE__ */ t.jsx(
56
+ ) : i === "initials" ? /* @__PURE__ */ e.jsx(
56
57
  "div",
57
58
  {
58
- className: ` flex items-center justify-center rounded-full aspect-square ${r[e]}`,
59
+ className: ` flex items-center justify-center rounded-full aspect-square ${m[s]}`,
59
60
  style: { backgroundColor: "#C6D2FF" },
60
- children: /* @__PURE__ */ t.jsx(
61
+ children: /* @__PURE__ */ e.jsx(
61
62
  "span",
62
63
  {
63
- className: x(
64
+ className: u(
64
65
  "text-[#312C85] font-semibold",
65
- p[e]
66
+ b[s]
66
67
  ),
67
- children: g(d)
68
+ children: w(h)
68
69
  }
69
70
  )
70
71
  },
71
72
  "initials"
72
- ) : c === "defaultAvatar" && /* @__PURE__ */ t.jsx(y, { className: x(r[e], "fill-[#D4D4D8] text-(--neutral-700)") }),
73
- i && /* @__PURE__ */ t.jsx(
73
+ ) : i === "defaultAvatar" ? /* @__PURE__ */ e.jsx(f, { size: x }) : /* @__PURE__ */ e.jsx(f, { size: x }),
74
+ n && /* @__PURE__ */ e.jsx(
74
75
  "div",
75
76
  {
76
- className: x(
77
- "absolute bottom-[-10px] right-[-10px] rounded-full border overflow-hidden bg-gray-900",
78
- w[b]
77
+ className: u(
78
+ "absolute bottom-[-10px] right-[-10px] rounded-full border-1 overflow-hidden bg-gray-900",
79
+ j[v]
79
80
  ),
80
- ref: l,
81
- children: /* @__PURE__ */ t.jsx(
81
+ ref: o,
82
+ children: /* @__PURE__ */ e.jsx(
82
83
  "img",
83
84
  {
84
85
  draggable: !1,
85
- src: i,
86
+ src: n,
86
87
  alt: "Sub badge",
87
88
  className: "w-full h-full object-cover"
88
89
  }
@@ -92,5 +93,5 @@ function I({
92
93
  ] });
93
94
  }
94
95
  export {
95
- I as default
96
+ q as default
96
97
  };
@@ -0,0 +1,280 @@
1
+ import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as i } from "./cn-B6yFEsav.js";
3
+ import { motion as l, AnimatePresence as d } from "framer-motion";
4
+ import u from "./Avatar.es.js";
5
+ import { ChevronDown as f } from "./Icons/ChevronDown.es.js";
6
+ import { Logout as m } from "./Icons/Logout.es.js";
7
+ function x({
8
+ sessions: t,
9
+ handleTokenLogin: a
10
+ }) {
11
+ return /* @__PURE__ */ e.jsx("div", { className: "profile-options-container w-full ", children: t?.map((r) => /* @__PURE__ */ e.jsx(
12
+ "button",
13
+ {
14
+ className: "w-full ",
15
+ onClick: () => a?.(r.token),
16
+ children: /* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx(
17
+ s.Content,
18
+ {
19
+ onClick: () => {
20
+ console.log("hola");
21
+ },
22
+ isExpanded: !1,
23
+ nameUser: r.name,
24
+ nameArea: r?.areaId?.name,
25
+ nameCompany: r.companyId.name,
26
+ cardProfile: /* @__PURE__ */ e.jsx(s.Image, { isExpanded: !1 })
27
+ }
28
+ ) })
29
+ },
30
+ r._id
31
+ )) });
32
+ }
33
+ const h = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profile-container flex gap-0.5 overflow-hidden w-full min-w-0 ", children: t }), p = ({
34
+ isExpanded: t,
35
+ sessions: a,
36
+ onClickLogout: r,
37
+ handleTokenLogin: n
38
+ }) => /* @__PURE__ */ e.jsx(d, { mode: "wait", children: t && /* @__PURE__ */ e.jsxs(
39
+ l.div,
40
+ {
41
+ initial: { height: 0, opacity: 0 },
42
+ animate: {
43
+ height: "auto",
44
+ opacity: 1,
45
+ transition: {
46
+ height: { duration: 0.6, ease: "easeOut" },
47
+ opacity: { duration: 0.4, delay: 0.2 }
48
+ }
49
+ },
50
+ exit: {
51
+ height: 0,
52
+ opacity: 0,
53
+ transition: {
54
+ height: {
55
+ duration: 0.8,
56
+ delay: 0.2,
57
+ ease: "easeIn"
58
+ },
59
+ opacity: { duration: 0.3, delay: 0.1 }
60
+ }
61
+ },
62
+ className: "overflow-hidden",
63
+ children: [
64
+ /* @__PURE__ */ e.jsx(
65
+ l.div,
66
+ {
67
+ className: "flex justify-center items-center w-full mt-4",
68
+ exit: {
69
+ opacity: 0,
70
+ scaleX: 0,
71
+ height: 0,
72
+ transition: {
73
+ duration: 0.4,
74
+ delay: 0.5,
75
+ ease: "easeInOut"
76
+ }
77
+ },
78
+ children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
79
+ }
80
+ ),
81
+ a && a.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
82
+ /* @__PURE__ */ e.jsx(
83
+ l.div,
84
+ {
85
+ className: "mt-4",
86
+ exit: {
87
+ opacity: 0,
88
+ y: -5,
89
+ height: 0,
90
+ transition: {
91
+ duration: 0.4,
92
+ delay: 0.4,
93
+ ease: "easeInOut"
94
+ }
95
+ },
96
+ children: /* @__PURE__ */ e.jsx("span", { className: "text-neutral-medium-default font-semibold text-xs", children: "Cambiar cuenta" })
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e.jsx(
100
+ l.div,
101
+ {
102
+ className: "mt-4 overflow-hidden w-full ",
103
+ exit: {
104
+ height: 0,
105
+ opacity: 0,
106
+ y: -10,
107
+ scale: 0.98,
108
+ transition: {
109
+ height: { duration: 0.5, delay: 0.2 },
110
+ opacity: { duration: 0.3, delay: 0.3 },
111
+ y: { duration: 0.3, delay: 0.3 },
112
+ scale: { duration: 0.3, delay: 0.3 },
113
+ ease: "easeInOut"
114
+ }
115
+ },
116
+ children: /* @__PURE__ */ e.jsx(
117
+ x,
118
+ {
119
+ sessions: a,
120
+ handleTokenLogin: n
121
+ }
122
+ )
123
+ }
124
+ ),
125
+ /* @__PURE__ */ e.jsx(
126
+ l.div,
127
+ {
128
+ className: "flex justify-center items-center w-full mt-4",
129
+ exit: {
130
+ opacity: 0,
131
+ scaleX: 0,
132
+ height: 0,
133
+ transition: {
134
+ duration: 0.4,
135
+ delay: 0.15,
136
+ ease: "easeInOut"
137
+ }
138
+ },
139
+ children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
140
+ }
141
+ )
142
+ ] }),
143
+ /* @__PURE__ */ e.jsxs(
144
+ l.button,
145
+ {
146
+ onClick: r,
147
+ className: "flex flex-1 h-12 w-full gap-1 rounded-md cursor-pointer mt-4 mb-4 px-2 items-center overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile",
148
+ exit: {
149
+ opacity: 0,
150
+ y: -8,
151
+ scale: 0.96,
152
+ transition: {
153
+ duration: 0.5,
154
+ delay: 0,
155
+ ease: "easeInOut"
156
+ }
157
+ },
158
+ whileHover: {
159
+ opacity: 1,
160
+ scale: [1, 1.02, 1],
161
+ transition: { duration: 0.2 }
162
+ },
163
+ whileTap: { scale: 0.98 },
164
+ children: [
165
+ /* @__PURE__ */ e.jsx(m, { size: 24, className: "text-neutral-default-default" }),
166
+ /* @__PURE__ */ e.jsx("span", { className: "text-neutral-default-default font-semibold text-sm", children: "Cerrar sesión" })
167
+ ]
168
+ }
169
+ )
170
+ ]
171
+ }
172
+ ) }), g = ({ imageUrl: t, fallbackText: a }) => /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center profile-image-wrapper", children: /* @__PURE__ */ e.jsx(
173
+ u,
174
+ {
175
+ subImageUrl: t,
176
+ imageUrl: t,
177
+ sizeImage: "xxs",
178
+ sizeFallback: "xxs",
179
+ fallbackText: a
180
+ }
181
+ ) }), j = ({
182
+ isExpanded: t,
183
+ nameUser: a,
184
+ nameCompany: r,
185
+ nameArea: n,
186
+ cardProfile: o,
187
+ onClick: c
188
+ }) => /* @__PURE__ */ e.jsxs(
189
+ l.button,
190
+ {
191
+ onClick: c,
192
+ className: i(
193
+ "flex flex-1 gap-2 rounded-lg cursor-pointer relative overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile h-max p-3",
194
+ t && "bg-neutral-medium-selected"
195
+ ),
196
+ whileHover: {
197
+ opacity: 1,
198
+ scale: [1, 1.02, 1]
199
+ },
200
+ whileTap: { scale: 0.98 },
201
+ transition: { duration: 0.2, ease: "easeInOut" },
202
+ children: [
203
+ o,
204
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center overflow-hidden flex-1 relative z-10 profile-user-info mr-2 p-0", children: [
205
+ /* @__PURE__ */ e.jsx(
206
+ "p",
207
+ {
208
+ className: i(
209
+ "profile-name font-semibold leading-tight mb-0 text-left",
210
+ t ? "text-primary-default-default" : "text-neutral-default-default"
211
+ ),
212
+ children: a?.length && a?.length > 20 ? a?.slice(0, 10) + ".." : a
213
+ }
214
+ ),
215
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1 mt-0 ", children: r && r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
216
+ /* @__PURE__ */ e.jsx(
217
+ "p",
218
+ {
219
+ className: i(
220
+ "profile-options truncate text-xs mt-0",
221
+ t ? "text-primary-default-default" : "text-neutral-default-default"
222
+ ),
223
+ children: r?.length && r?.length > 20 ? r?.slice(0, 10) + ".." : r
224
+ }
225
+ ),
226
+ /* @__PURE__ */ e.jsx(
227
+ "p",
228
+ {
229
+ className: i(
230
+ "profile-options truncate font-bold mt-0",
231
+ t ? "text-primary-default-default" : "text-neutral-default-default"
232
+ ),
233
+ children: "·"
234
+ }
235
+ ),
236
+ /* @__PURE__ */ e.jsx(
237
+ "p",
238
+ {
239
+ className: i(
240
+ "profile-options truncate text-xs mt-0",
241
+ t ? "text-primary-default-default" : "text-neutral-default-default"
242
+ ),
243
+ children: n || "Sin asignar"
244
+ }
245
+ )
246
+ ] }) : /* @__PURE__ */ e.jsx("span", { className: "font-semibold leading-tight ml-3 text-xs text-blue-300 text-center", children: "Sin asignar" }) })
247
+ ] })
248
+ ]
249
+ }
250
+ ), v = () => /* @__PURE__ */ e.jsx("div", { className: "w-px bg-gray-500/30 my-1 border-separator-profile" }), y = ({ isExpanded: t, onClick: a }) => /* @__PURE__ */ e.jsx(
251
+ l.button,
252
+ {
253
+ onClick: a,
254
+ className: "flex items-center justify-center p-3 rounded-lg cursor-pointer relative overflow-hidden focus:outline-none w-8 min-w-8 hover:bg-neutral-medium-selected button-content-chevron",
255
+ whileHover: { scale: 1.05 },
256
+ whileTap: { scale: 0.95 },
257
+ transition: { duration: 0.2, ease: "easeOut" },
258
+ title: t ? "Ocultar opciones" : "Mostrar opciones",
259
+ "aria-label": t ? "Ocultar opciones" : "Mostrar opciones",
260
+ children: /* @__PURE__ */ e.jsx(
261
+ l.div,
262
+ {
263
+ animate: { rotate: t ? 180 : 0 },
264
+ transition: { duration: 0.3, ease: "easeOut" },
265
+ className: "relative button-select-crevron",
266
+ children: /* @__PURE__ */ e.jsx(l.div, { transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(f, { size: 24, className: "text-prometeo-neutral " }) })
267
+ }
268
+ )
269
+ }
270
+ ), s = Object.assign(h, {
271
+ Menu: p,
272
+ Image: g,
273
+ Content: j,
274
+ Separator: v,
275
+ Options: y
276
+ });
277
+ export {
278
+ s as C,
279
+ x as a
280
+ };