prometeo-design-system 2.3.1 → 2.3.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.
Files changed (62) hide show
  1. package/dist/Avatar.es.js +1 -1
  2. package/dist/{Button-Bc0LYLfg.js → Button-DsbEyjth.js} +1 -1
  3. package/dist/Button.es.js +1 -1
  4. package/dist/{CardProfile-BiYr6kY9.js → CardProfile-BhFog7j5.js} +1 -1
  5. package/dist/CardProfile.es.js +1 -1
  6. package/dist/CheckBox.es.js +1 -1
  7. package/dist/CheckboxFormik.es.js +1 -1
  8. package/dist/DatePicker.es.js +2 -2
  9. package/dist/DialogModal.es.js +35 -31
  10. package/dist/DrawerDesktop.es.js +2 -2
  11. package/dist/DrawerMobile.es.js +1 -1
  12. package/dist/DropZone.es.js +1 -1
  13. package/dist/Header.es.js +1 -1
  14. package/dist/Icons/Icons.d.ts +48 -46
  15. package/dist/Icons.es.js +93 -90
  16. package/dist/Image.es.js +1 -1
  17. package/dist/ImageGallery-DnoRTpCr.js +317 -0
  18. package/dist/ImageGallery.es.js +1 -1
  19. package/dist/Input.es.js +1 -1
  20. package/dist/InputFormik.es.js +1 -1
  21. package/dist/InputMultiple.es.js +1 -1
  22. package/dist/{LayoutGeneric-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.js} +1 -1
  23. package/dist/LayoutGeneric.es.js +1 -1
  24. package/dist/Logo.es.js +1 -1
  25. package/dist/Menu.es.js +1 -1
  26. package/dist/OtpInput.es.js +1 -1
  27. package/dist/Pagination.es.js +1 -1
  28. package/dist/ProfilePictureUpload.es.js +1 -1
  29. package/dist/ProgressBar.es.js +1 -1
  30. package/dist/SegmentedButton.es.js +1 -1
  31. package/dist/Select.es.js +368 -185
  32. package/dist/SelectFormik.es.js +90 -72
  33. package/dist/Skeleton.es.js +35 -34
  34. package/dist/Spinner.es.js +1 -1
  35. package/dist/Steps.es.js +1 -1
  36. package/dist/SwipeContainer.es.js +1 -1
  37. package/dist/Switch.es.js +31 -28
  38. package/dist/TabLinks.es.js +35 -33
  39. package/dist/Table.es.js +1 -1
  40. package/dist/TextArea.es.js +1 -1
  41. package/dist/Tooltip.es.js +1 -1
  42. package/dist/components/Dialog/Dialog.d.ts +7 -6
  43. package/dist/components/Dialog/useDialogControl.d.ts +4 -3
  44. package/dist/components/Select/Select.d.ts +33 -13
  45. package/dist/components/SelectFormik/SelectFormik.d.ts +4 -2
  46. package/dist/components/Skeleton/Skeleton.d.ts +5 -2
  47. package/dist/components/Switch/Switch.d.ts +5 -2
  48. package/dist/components/TabLinks/TabLinks.d.ts +2 -2
  49. package/dist/exports/Select.d.ts +1 -1
  50. package/dist/hooks/useDragScroll.d.ts +29 -0
  51. package/dist/hooks/useLabelBackground.d.ts +5 -0
  52. package/dist/index.d.ts +8 -8
  53. package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
  54. package/dist/pages/SelectsPage.d.ts +2 -0
  55. package/dist/prometeo-design-system.css +1 -1
  56. package/dist/prometeo-design-system.es.js +6 -6
  57. package/dist/useDragScroll-CHN9OMwn.js +165 -0
  58. package/package.json +4 -4
  59. package/src/styles/intellisense.css +5 -0
  60. package/dist/ImageGallery-O5Y4oBrD.js +0 -352
  61. package/dist/lib/utils.d.ts +0 -1
  62. package/dist/preview/Select.d.ts +0 -2
@@ -0,0 +1,317 @@
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
+ import ee, { memo as D, forwardRef as L, useRef as v, useEffect as te, useCallback as i, useState as R, useImperativeHandle as ne } from "react";
3
+ import { c as X } from "./cn-B6yFEsav.js";
4
+ import { u as re } from "./useDragScroll-CHN9OMwn.js";
5
+ import { B as S } from "./Button-DsbEyjth.js";
6
+ import { Icons as M } from "./Icons.es.js";
7
+ const O = D(L(({ images: n, className: c }, r) => {
8
+ const { ref: d, bind: a } = re({
9
+ axis: "x",
10
+ friction: 0.9,
11
+ minVelocity: 0.5,
12
+ startMomentumThreshold: 1,
13
+ momentum: !0,
14
+ clickThreshold: 5,
15
+ cursor: { idle: "default", dragging: "grabbing" },
16
+ preventTextSelection: !0
17
+ });
18
+ return /* @__PURE__ */ t.jsx(
19
+ "section",
20
+ {
21
+ ref: d,
22
+ className: X("flex gap-4 w-full overflow-x-auto py-2 relative", c),
23
+ onPointerDown: a.onPointerDown,
24
+ onPointerMove: a.onPointerMove,
25
+ onPointerUp: a.onPointerUp,
26
+ onPointerLeave: a.onPointerLeave,
27
+ onPointerCancel: a.onPointerCancel,
28
+ onClickCapture: a.onClickCapture,
29
+ "aria-label": "Image gallery",
30
+ children: n && n.length > 0 && n.map((l, o) => ee.cloneElement(l, {
31
+ key: l.props.src || o,
32
+ ...l.props,
33
+ galleryRef: r,
34
+ allowPreview: !0
35
+ }))
36
+ }
37
+ );
38
+ }));
39
+ O.displayName = "GalleryPreview";
40
+ const B = D(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails: d, thumbnailsClassName: a, currentIndex: l, goToNext: o, goToPrevious: s, goToIndex: N }) => {
41
+ const h = v(null), y = v(null), w = v(null), m = v({
42
+ scale: 1,
43
+ translateX: 0,
44
+ translateY: 0
45
+ }), u = v({
46
+ startX: 0,
47
+ startY: 0,
48
+ isDragging: !1,
49
+ distanceX: 0,
50
+ distanceY: 0
51
+ });
52
+ te(() => {
53
+ w.current && w.current.focus();
54
+ }, []);
55
+ const k = i((e) => {
56
+ e.preventDefault(), e.stopPropagation(), e.key === "Escape" ? r() : e.key === "ArrowLeft" ? s() : e.key === "ArrowRight" && o();
57
+ }, [r, s, o]), I = i((e) => {
58
+ u.current = { startX: e.touches[0].clientX, startY: e.touches[0].clientY, isDragging: !0, distanceX: 0, distanceY: 0 };
59
+ }, []), j = i((e) => {
60
+ const g = e.touches[0];
61
+ u.current = { ...u.current, isDragging: !0, distanceX: g.clientX - u.current.startX, distanceY: g.clientY - u.current.startY };
62
+ }, []), P = i(() => {
63
+ u.current = { ...u.current, startX: 0, startY: 0, isDragging: !1 }, Math.abs(u.current.distanceX) > Math.abs(u.current.distanceY) && (u.current.distanceX < 0 ? o() : s());
64
+ }, [o, s]), C = i(() => {
65
+ const e = h.current;
66
+ if (!e) return;
67
+ const { scale: g, translateX: p, translateY: z } = m.current;
68
+ e.style.transform = `scale(${g}) translate(${p}px, ${z}px)`, e.style.transformOrigin = "center center", e.style.transition = "transform 0.1s ease-out";
69
+ }, []), b = i(() => {
70
+ m.current = { scale: 1, translateX: 0, translateY: 0 }, h.current && (h.current.style.transform = "scale(1) translate(0px, 0px)", h.current.style.transformOrigin = "center center");
71
+ }, []), f = i((e) => {
72
+ const g = h.current, p = y.current;
73
+ if (!g || !p) return;
74
+ if (e.shiftKey) {
75
+ e.deltaY < 0 ? o() : e.deltaY > 0 && s();
76
+ return;
77
+ }
78
+ const z = 2e-3, E = 1, F = 8, G = -e.deltaY * z, T = m.current.scale;
79
+ let x = T + G;
80
+ if (x = Math.max(E, Math.min(F, x)), x === E) {
81
+ b();
82
+ return;
83
+ }
84
+ const Y = p.getBoundingClientRect(), W = e.clientX - Y.left, H = e.clientY - Y.top, K = Y.width / 2, $ = Y.height / 2, q = W - K, U = H - $, A = x / T, V = m.current.translateX, Z = m.current.translateY, J = V - q * (A - 1) / x, Q = Z - U * (A - 1) / x;
85
+ m.current = {
86
+ scale: x,
87
+ translateX: J,
88
+ translateY: Q
89
+ }, C();
90
+ }, [o, s, C, b]);
91
+ return n.length === 0 ? null : /* @__PURE__ */ t.jsxs(
92
+ "div",
93
+ {
94
+ ref: w,
95
+ className: X("fixed inset-0 z-50 bg-black/90 flex items-center justify-center lg:px-16", c),
96
+ onClick: r,
97
+ onKeyDown: k,
98
+ onTouchStart: I,
99
+ onTouchMove: j,
100
+ onTouchEnd: P,
101
+ tabIndex: 0,
102
+ role: "dialog",
103
+ "aria-modal": "true",
104
+ children: [
105
+ /* @__PURE__ */ t.jsx("div", { className: "absolute top-4 right-4 z-110", children: /* @__PURE__ */ t.jsx(
106
+ S,
107
+ {
108
+ variant: "text",
109
+ color: "secondary",
110
+ size: "small",
111
+ onClick: r,
112
+ className: "!text-white hover:!text-gray-300 !w-auto !h-auto !p-2",
113
+ "aria-label": "Close gallery",
114
+ children: /* @__PURE__ */ t.jsx(M.Close, { size: 24 })
115
+ }
116
+ ) }),
117
+ n.length > 1 && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
118
+ /* @__PURE__ */ t.jsx(
119
+ "div",
120
+ {
121
+ className: "absolute left-0 lg:h-full items-center flex justify-center w-16 z-100 cursor-w-resize",
122
+ onClick: (e) => {
123
+ e.stopPropagation(), s();
124
+ },
125
+ children: /* @__PURE__ */ t.jsx(
126
+ S,
127
+ {
128
+ variant: "text",
129
+ color: "secondary",
130
+ size: "small",
131
+ onClick: (e) => {
132
+ e.stopPropagation(), s();
133
+ },
134
+ className: "!text-white hover:!text-gray-300 !w-auto !h-auto !p-2",
135
+ "aria-label": "Previous image",
136
+ children: /* @__PURE__ */ t.jsx(M.CrevronLeft, { size: 24 })
137
+ }
138
+ )
139
+ }
140
+ ),
141
+ /* @__PURE__ */ t.jsx(
142
+ "div",
143
+ {
144
+ className: "absolute right-0 lg:h-full items-center flex justify-center w-16 z-100 cursor-e-resize",
145
+ onClick: (e) => {
146
+ e.stopPropagation(), o();
147
+ },
148
+ children: /* @__PURE__ */ t.jsx(
149
+ S,
150
+ {
151
+ variant: "text",
152
+ color: "secondary",
153
+ size: "small",
154
+ onClick: (e) => {
155
+ e.stopPropagation(), o();
156
+ },
157
+ className: "!text-white hover:!text-gray-300 !w-auto !h-auto !p-2",
158
+ "aria-label": "Next image",
159
+ children: /* @__PURE__ */ t.jsx(M.CrevronRight, { size: 24 })
160
+ }
161
+ )
162
+ }
163
+ )
164
+ ] }),
165
+ /* @__PURE__ */ t.jsx(
166
+ "div",
167
+ {
168
+ ref: y,
169
+ onClick: (e) => e.stopPropagation(),
170
+ className: "relative max-w-[90vw] max-h-[98vh] mx-auto flex flex-col w-max lg:h-full h-max",
171
+ onWheel: f,
172
+ children: /* @__PURE__ */ t.jsx(
173
+ "div",
174
+ {
175
+ className: "max-h-[98vh] relative overflow-hidden w-full h-full",
176
+ style: {
177
+ animation: "galleryFadeIn 0.6s ease-in-out"
178
+ },
179
+ ref: h,
180
+ children: /* @__PURE__ */ t.jsx(
181
+ "img",
182
+ {
183
+ src: n[l].src,
184
+ alt: n[l].alt,
185
+ className: X(
186
+ " w-full h-full object-contain select-none",
187
+ "prometeo-lightbox-image"
188
+ ),
189
+ onLoad: () => b()
190
+ }
191
+ )
192
+ },
193
+ l
194
+ )
195
+ }
196
+ ),
197
+ d && /* @__PURE__ */ t.jsx("div", { className: " w-full absolute items-center flex justify-center left-0 right-0 z-[100] bottom-0", children: /* @__PURE__ */ t.jsx(_, { images: n, currentIndex: l, goToIndex: N, thumbnailsClassName: a }) }),
198
+ n.length > 1 && /* @__PURE__ */ t.jsxs("div", { className: "absolute bottom-20 left-1/2 transform -translate-x-1/2 text-neutral-default-default prometeo-fonts-label-xlarge px-4 py-2 rounded-full", children: [
199
+ l + 1,
200
+ " / ",
201
+ n.length
202
+ ] })
203
+ ]
204
+ }
205
+ );
206
+ });
207
+ B.displayName = "LightBox";
208
+ const se = (n, c) => {
209
+ if (n.currentIndex !== c.currentIndex || n.thumbnailsClassName !== c.thumbnailsClassName || n.images.length !== c.images.length) return !1;
210
+ for (let r = 0; r < n.images.length; r++)
211
+ if (n.images[r].src !== c.images[r].src) return !1;
212
+ return !0;
213
+ }, _ = D(({ images: n, currentIndex: c, goToIndex: r, thumbnailsClassName: d }) => /* @__PURE__ */ t.jsxs(
214
+ "div",
215
+ {
216
+ className: "flex gap-4 w-max overflow-x-auto overflow-y-visible max-w-full px-16 py-4",
217
+ style: {
218
+ scrollbarWidth: "none",
219
+ msOverflowStyle: "none",
220
+ WebkitOverflowScrolling: "touch"
221
+ },
222
+ children: [
223
+ /* @__PURE__ */ t.jsx("style", { children: `
224
+ .flex.gap-4.w-max::-webkit-scrollbar {
225
+ display: none;
226
+ }
227
+ ` }),
228
+ n.map((a, l) => /* @__PURE__ */ t.jsx(
229
+ "button",
230
+ {
231
+ type: "button",
232
+ onClick: (o) => {
233
+ o.stopPropagation(), r(l);
234
+ },
235
+ className: X(
236
+ "w-16 h-16 aspect-square min-w-16 rounded overflow-hidden transition-all duration-300 hover:scale-125 cursor-pointer",
237
+ d,
238
+ l === c ? "scale-110" : ""
239
+ ),
240
+ children: /* @__PURE__ */ t.jsx(
241
+ "img",
242
+ {
243
+ src: a.src,
244
+ alt: a.alt,
245
+ className: "w-full h-full object-cover select-none"
246
+ }
247
+ )
248
+ },
249
+ a.src
250
+ ))
251
+ ]
252
+ }
253
+ ), se);
254
+ _.displayName = "Thumbnails";
255
+ const ae = L(
256
+ (n, c) => {
257
+ const {
258
+ children: r,
259
+ className: d,
260
+ lightboxClassName: a,
261
+ showThumbnails: l,
262
+ thumbnailsClassName: o
263
+ } = n, [s, N] = R([]), [h, y] = R(!1), [w, m] = R(0), u = r ? Array.isArray(r) ? r : [r] : [], k = i((f) => {
264
+ N((e) => e.some((p) => p.src === f.src) ? e : [...e, f]);
265
+ }, []), I = i((f = 0) => {
266
+ m(f), y(!0);
267
+ }, []), j = i(() => {
268
+ y(!1);
269
+ }, []);
270
+ ne(
271
+ c,
272
+ () => ({
273
+ openLightbox: I,
274
+ closeLightbox: j,
275
+ isOpen: h,
276
+ addImage: k,
277
+ images: s
278
+ }),
279
+ [s]
280
+ );
281
+ const P = i(() => {
282
+ m((f) => (f + 1) % s.length);
283
+ }, [s.length]), C = i(() => {
284
+ m((f) => (f - 1 + s.length) % s.length);
285
+ }, [s.length]), b = i((f) => {
286
+ m(f);
287
+ }, []);
288
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
289
+ /* @__PURE__ */ t.jsx(
290
+ O,
291
+ {
292
+ images: u,
293
+ className: d,
294
+ ref: c
295
+ }
296
+ ),
297
+ h && /* @__PURE__ */ t.jsx(
298
+ B,
299
+ {
300
+ images: s,
301
+ closeLightbox: j,
302
+ showThumbnails: l,
303
+ lightboxClassName: a,
304
+ thumbnailsClassName: o,
305
+ currentIndex: w,
306
+ goToNext: P,
307
+ goToPrevious: C,
308
+ goToIndex: b
309
+ }
310
+ )
311
+ ] });
312
+ }
313
+ );
314
+ ae.displayName = "ImageGallery";
315
+ export {
316
+ ae as I
317
+ };
@@ -1,4 +1,4 @@
1
- import { I as p } from "./ImageGallery-O5Y4oBrD.js";
1
+ import { I as p } from "./ImageGallery-DnoRTpCr.js";
2
2
  import { useRef as u, useCallback as r } from "react";
3
3
  const g = () => {
4
4
  const e = u(null), t = r((a) => {
package/dist/Input.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as J } from "./Icons.es.js";
3
3
  import { c as e } from "./cn-B6yFEsav.js";
4
4
  import { memo as xe, useState as H, useRef as K, useCallback as me, useEffect as L, useLayoutEffect as ge } from "react";
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as u } from "./cn-B6yFEsav.js";
3
3
  import { FastField as O, ErrorMessage as q } from "formik";
4
4
  import { memo as G, useState as I, useRef as H, useCallback as y, useLayoutEffect as J } from "react";
@@ -1,4 +1,4 @@
1
- import { j as r } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as r } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as C } from "./Icons.es.js";
3
3
  import { c as d } from "./cn-B6yFEsav.js";
4
4
  import S, { useRef as M, useState as x, useCallback as T, useEffect as ee } from "react";
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { useRef as a, createContext as i, useContext as u, memo as c } from "react";
3
3
  const o = i(null), l = ({ children: e }) => {
4
4
  const r = a(null), s = (n) => {
@@ -1,4 +1,4 @@
1
- import { L as f } from "./LayoutGeneric-jDE96L2N.js";
1
+ import { L as f } from "./LayoutGeneric-p4Pll4Cm.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/dist/Logo.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as t } from "./Icons.es.js";
3
3
  const s = () => /* @__PURE__ */ e.jsxs("div", { className: "container-logo flex items-center justify-center gap-1 bg-gradient-to-br from-[#312C85] to-[#1E1A4D] rounded-md min-w-[185px]", children: [
4
4
  /* @__PURE__ */ e.jsx(t.TicketFilled, { size: 28, className: "rotate-140 text-primary-medium-pressed icon-logo" }),
package/dist/Menu.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as r } from "./cn-B6yFEsav.js";
3
3
  import { AnimatePresence as n, motion as o } from "framer-motion";
4
4
  const s = ({ menuRef: t, children: a, className: i }) => /* @__PURE__ */ e.jsx("div", { ref: t, className: r("flex bg-neutral-default-default absolute bottom-10 left-24 border-1 border-neutral-strong-default h-auto w-60 rounded-md px-2", i), children: /* @__PURE__ */ e.jsx(n, { mode: "wait", children: /* @__PURE__ */ e.jsx(
@@ -1,4 +1,4 @@
1
- import { j as p } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as p } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as ve } from "./Icons.es.js";
3
3
  import { c as L } from "./cn-B6yFEsav.js";
4
4
  import * as n from "react";
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { motion as a } from "framer-motion";
3
3
  function h({
4
4
  currentPage: i = 1,
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { motion as i, AnimatePresence as E } from "framer-motion";
3
3
  import { useRef as v, useState as R, useLayoutEffect as A } from "react";
4
4
  import H from "./Avatar.es.js";
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as x } from "./cn-B6yFEsav.js";
3
3
  import u from "react";
4
4
  const j = u.forwardRef(
@@ -1,4 +1,4 @@
1
- import { j as u } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as u } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as d } from "./cn-B6yFEsav.js";
3
3
  import z, { useState as M, useMemo as C, useEffect as L } from "react";
4
4
  import { motion as E } from "framer-motion";