prometeo-design-system 1.8.3 → 1.8.4

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.
package/dist/Avatar.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as p } from "./cn-B6yFEsav.js";
3
3
  import { motion as f } from "framer-motion";
4
4
  import { useState as u } from "react";
package/dist/Button.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as o } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as o } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as x } from "./cn-B6yFEsav.js";
3
3
  import { c as N } from "./index-BOQuZ0gG.js";
4
4
  import { useAnimationControls as k, motion as y } from "framer-motion";
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as l } from "./cn-B6yFEsav.js";
3
3
  import { motion as i, AnimatePresence as u } from "framer-motion";
4
4
  import m from "./Avatar.es.js";
@@ -1,4 +1,4 @@
1
- import { C as a } from "./CardProfile-Bg_q2qMm.js";
1
+ import { C as a } from "./CardProfile-BZajBGbO.js";
2
2
  export {
3
3
  a as CardProfile
4
4
  };
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { Icons as l } from "./Icons.es.js";
3
3
  import { useId as o, useRef as d } from "react";
4
4
  const k = ({ className: s, disabled: e, ...a }) => {
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { Icons as x } from "./Icons.es.js";
3
3
  import { c as r } from "./cn-B6yFEsav.js";
4
4
  import { useField as h, ErrorMessage as p } from "formik";
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { forwardRef as u, useState as p, useImperativeHandle as f, useRef as g } from "react";
3
3
  import { c as i } from "./cn-B6yFEsav.js";
4
4
  const x = u(({
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { Icons as j } from "./Icons.es.js";
3
3
  import { c as m } from "./cn-B6yFEsav.js";
4
4
  import { c as d } from "./index-BOQuZ0gG.js";
@@ -1,4 +1,4 @@
1
- import { j as r } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as r } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { forwardRef as O, useState as g, useRef as x, useCallback as t, useImperativeHandle as D } from "react";
3
3
  import { Drawer as n } from "vaul";
4
4
  import { c as R } from "./cn-B6yFEsav.js";
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as i } from "./cn-B6yFEsav.js";
3
3
  import w, { useCallback as z } from "react";
4
4
  import { useDropzone as R } from "react-dropzone";
package/dist/Header.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as x } from "./cn-B6yFEsav.js";
3
3
  import { motion as i } from "framer-motion";
4
4
  import { memo as m } from "react";
5
- const n = ({ title: t, subtitle: s, children: l, className: a }) => /* @__PURE__ */ e.jsx("header", { className: x("h-16 flex items-center px-4 sm:h-20 md:h-24 md:px-6 lg:h-28 xl:h-32 2xl:h-36", a), children: /* @__PURE__ */ e.jsxs(
5
+ const n = ({ title: t, subtitle: l, children: s, className: a }) => /* @__PURE__ */ e.jsx("header", { className: x("h-16 flex items-center px-4 sm:h-20 md:h-24 md:px-6 lg:h-28 xl:h-32 2xl:h-36", a), children: /* @__PURE__ */ e.jsxs(
6
6
  i.div,
7
7
  {
8
8
  initial: { opacity: 0, y: -10 },
@@ -11,10 +11,10 @@ const n = ({ title: t, subtitle: s, children: l, className: a }) => /* @__PURE__
11
11
  className: "flex justify-between items-center w-full ",
12
12
  children: [
13
13
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col leading-6", children: [
14
- /* @__PURE__ */ e.jsx("h3", { className: "text-xs font-semibold text-neutral-medium-default leading-1 sm:leading-2", children: s }),
14
+ /* @__PURE__ */ e.jsx("h3", { className: "text-xs font-semibold text-neutral-medium-default leading-1 sm:leading-2 prometeo-fonts-headline-large", children: l }),
15
15
  /* @__PURE__ */ e.jsx("h1", { className: "text-xl font-bold text-neutral-strong-default sm:text-2xl md:text-3xl xl:text-[32px] 2xl:text-[34px]", children: t })
16
16
  ] }),
17
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-4", children: l })
17
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-4", children: s })
18
18
  ]
19
19
  }
20
20
  ) }), f = m(n);
package/dist/Icons.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as q } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as q } from "./jsx-runtime-ByW6EXIE.js";
2
2
  const l = ({
3
3
  size: t,
4
4
  className: h,
package/dist/Input.es.js CHANGED
@@ -1,10 +1,10 @@
1
- import { j as r } from "./jsx-runtime-DKDX3adD.js";
2
- import { Icons as z } from "./Icons.es.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { Icons as O } from "./Icons.es.js";
3
3
  import { c as e } from "./cn-B6yFEsav.js";
4
- import { memo as oe, useState as L, useRef as ae, useCallback as ne, useEffect as B, useLayoutEffect as ue } from "react";
5
- import { useDebounce as ce } from "use-debounce";
6
- import fe from "./Spinner.es.js";
7
- const h = {
4
+ import { memo as ue, useState as N, useRef as ce, useCallback as fe, useEffect as $, useLayoutEffect as ie } from "react";
5
+ import { useDebounce as de } from "use-debounce";
6
+ import pe from "./Spinner.es.js";
7
+ const j = {
8
8
  default: {
9
9
  container: "",
10
10
  input: e(
@@ -53,161 +53,176 @@ const h = {
53
53
  "peer-focus:text-success-light"
54
54
  )
55
55
  }
56
- }, x = {
57
- small: {
58
- container: "text-sm",
59
- input: "h-10 px-3 text-sm",
60
- label: "text-xs peer-focus:text-xs peer-placeholder-shown:text-sm",
61
- icon: "w-4 h-4 right-3"
62
- },
63
- medium: {
64
- container: "text-base",
65
- input: "h-12 px-3 text-base",
66
- label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-base",
67
- icon: "w-5 h-5 right-3"
68
- },
69
- large: {
70
- container: "text-lg",
71
- input: "h-14 px-3 text-lg",
72
- label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-lg",
73
- icon: "w-6 h-6 right-3"
74
- }
75
- }, ie = ({
76
- label: w,
77
- icon: n,
56
+ }, xe = ({
57
+ label: C,
58
+ icon: a,
78
59
  iconPosition: m = "left",
79
- onChange: y,
80
- value: c = "",
81
- debounceMs: f = 0,
82
- name: j,
60
+ onChange: S,
61
+ value: n = "",
62
+ debounceMs: u = 0,
63
+ name: E,
83
64
  width: g = "100%",
84
- height: t,
85
- variant: i = "default",
65
+ height: s,
66
+ variant: c = "default",
86
67
  labelVariant: o = "default",
87
- size: d = "medium",
88
- disabled: v = !1,
89
- type: s = "text",
90
- isFetching: p,
91
- errorComponent: N,
92
- helperComponent: S,
93
- placeholder: F,
94
- required: k = !1,
95
- onFocus: H,
96
- onBlur: O,
97
- onEmptied: P,
98
- onKeyDown: T,
99
- onKeyUp: W
68
+ size: T = "medium",
69
+ disabled: k = !1,
70
+ type: r = "text",
71
+ isFetching: f,
72
+ errorComponent: H,
73
+ helperComponent: L,
74
+ placeholder: G,
75
+ required: P = !1,
76
+ onFocus: J,
77
+ onBlur: K,
78
+ onEmptied: D,
79
+ onKeyDown: Q,
80
+ onKeyUp: U
100
81
  }) => {
101
- const [b, D] = L(c), [C] = ce(b, f), [A, R] = L(!1), [E, G] = L(!1), a = ae(null), V = ne(y, [y]);
102
- B(() => {
103
- f > 0 && C !== c && V(C);
104
- }, [C, f, V, c]), B(() => {
105
- D(c);
106
- }, [c]);
107
- const J = () => {
108
- R(!0), H?.();
109
- }, K = () => {
110
- R(!1), O?.();
111
- }, Q = (l) => {
112
- const u = l.target.value, se = l.target.name, le = b;
113
- D(u), le.length > 0 && u.length === 0 && P?.(), (!f || f === 0) && y(u, se);
114
- }, U = () => {
115
- G(!E);
82
+ const [h, R] = N(n), [v] = de(h, u), [W, V] = N(!1), [z, X] = N(!1), b = ce(null);
83
+ let i = T;
84
+ s && (i = "customHeight");
85
+ const d = {
86
+ small: {
87
+ container: "text-sm",
88
+ input: "h-10 px-3 text-sm",
89
+ label: "text-xs peer-focus:text-xs peer-placeholder-shown:text-sm",
90
+ icon: "w-4 h-4 right-3"
91
+ },
92
+ medium: {
93
+ container: "text-base",
94
+ input: "h-12 px-3 text-base",
95
+ label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-base",
96
+ icon: "w-5 h-5 right-3"
97
+ },
98
+ large: {
99
+ container: "text-lg",
100
+ input: "h-14 px-3 text-lg",
101
+ label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-lg",
102
+ icon: "w-6 h-6 right-3"
103
+ },
104
+ customHeight: {
105
+ container: "text-base",
106
+ input: "text-base",
107
+ label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
108
+ icon: "w-6 h-6 right-3"
109
+ }
110
+ }, A = fe(S, [S]);
111
+ $(() => {
112
+ u > 0 && v !== n && A(v);
113
+ }, [v, u, A, n]), $(() => {
114
+ R(n);
115
+ }, [n]);
116
+ const Y = () => {
117
+ V(!0), J?.();
118
+ }, Z = () => {
119
+ V(!1), K?.();
120
+ }, _ = (p) => {
121
+ const x = p.target.value, B = p.target.name, l = h;
122
+ R(x), l.length > 0 && x.length === 0 && D?.(), (!u || u === 0) && S(x, B);
123
+ }, q = () => {
124
+ X(!z);
116
125
  }, I = {};
117
- g && g !== "100%" && (I.width = g), t && (I.height = t);
118
- const X = b.length > 0, $ = i === "error" && N, Y = !$ && S, Z = s === "password", _ = () => o === "static" || A || X ? "-top-2 left-2 scale-90" : t ? "top-1/2 -translate-y-1/2 scale-100" : n ? `top-1/2 -translate-y-1/2 ${m === "left" ? "ml-6" : "mr-6"} scale-100 ` : "top-1/2 -translate-y-1/2 scale-100", q = () => o === "static" ? t ? "text-sm" : "text-xs" : t ? "text-sm" : x[d].label, M = () => t ? { height: t } : {}, ee = () => o === "default" ? w : F || w || "", te = () => Z ? n ? m === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : n ? m === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", re = o === "default" && "transition-all duration-200 ease-in-out";
119
- return ue(() => {
120
- if (a.current && a.current.parentElement) {
121
- const l = window.getComputedStyle(a.current.parentElement);
122
- console.log(l.backgroundColor, "bg color parent");
123
- const u = l.backgroundColor;
124
- u === "transparent" || u === "rgba(0, 0, 0, 0)" ? (a.current.classList.remove("bg-inherit"), a.current.style.backgroundColor = "var(--neutral-900)") : a.current.classList.add("bg-inherit");
126
+ g && g !== "100%" && (I.width = g), s && (I.height = s);
127
+ const M = h.length > 0, F = c === "error" && H, ee = !F && L, te = r === "password", re = () => o === "static" || W || M ? "-top-2 left-2 scale-90" : a ? `top-1/2 -translate-y-1/2 ${m === "left" ? "ml-6" : "mr-6"} scale-100 ` : "top-1/2 -translate-y-1/2 scale-100", se = () => o === "static" ? s ? "text-sm" : "text-xs" : s ? d.customHeight.label : d[i].label, oe = () => s ? { height: s } : {}, le = () => o === "default" ? C : G || C || "", ae = () => te ? a ? m === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : a ? m === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", ne = o === "default" && "transition-all duration-200 ease-in-out";
128
+ return ie(() => {
129
+ if (b.current) {
130
+ const x = ((B) => {
131
+ let l = B;
132
+ for (; l && l !== document.body; ) {
133
+ const y = window.getComputedStyle(l).backgroundColor;
134
+ if (y && y !== "transparent" && y !== "rgba(0, 0, 0, 0)")
135
+ return y;
136
+ l = l.parentElement;
137
+ }
138
+ const w = window.getComputedStyle(document.body).backgroundColor;
139
+ return w && w !== "transparent" && w !== "rgba(0, 0, 0, 0)" ? w : "rgb(255, 255, 255)";
140
+ })(b.current.parentElement);
141
+ b.current.style.backgroundColor = x;
125
142
  }
126
- }, []), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
127
- /* @__PURE__ */ r.jsxs(
143
+ }, []), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
144
+ /* @__PURE__ */ t.jsxs(
128
145
  "div",
129
146
  {
130
147
  className: e(
131
148
  "relative",
132
- x[d].container,
149
+ d[i].container,
133
150
  !g && "w-full",
134
151
  "bg-inherit",
135
152
  o === "static" && "mt-2"
136
153
  ),
137
154
  style: I,
138
155
  children: [
139
- /* @__PURE__ */ r.jsx(
156
+ /* @__PURE__ */ t.jsx(
140
157
  "input",
141
158
  {
142
- id: j,
143
- name: j,
144
- type: s === "password" && E ? "text" : s,
145
- value: b,
146
- placeholder: ee(),
159
+ id: E,
160
+ name: E,
161
+ type: r === "password" && z ? "text" : r,
162
+ value: h,
163
+ placeholder: le(),
147
164
  className: e(
148
165
  "peer w-full border-1 rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
149
166
  "focus:outline-none px-3",
150
167
  o === "default" && "placeholder:text-transparent",
151
168
  o === "static" && "placeholder:text-neutral-medium-default placeholder:opacity-50",
152
- !t && x[d].input,
153
- t && `px-3 ${x[d].input.split(" ").filter((l) => l.startsWith("text-")).join(" ")}`,
154
- h[i].input,
155
- n && "pr-10",
156
- v && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
157
- h[i].container,
158
- te()
169
+ d[i].input,
170
+ j[c].input,
171
+ a && "pr-10",
172
+ k && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
173
+ j[c].container,
174
+ ae()
159
175
  ),
160
- style: M(),
161
- onChange: Q,
162
- onFocus: J,
163
- onBlur: K,
164
- disabled: v,
165
- required: k,
166
- onEmptied: P,
167
- onKeyDown: T,
168
- onKeyUp: W
176
+ style: oe(),
177
+ onChange: _,
178
+ onFocus: Y,
179
+ onBlur: Z,
180
+ disabled: k,
181
+ required: P,
182
+ onEmptied: D,
183
+ onKeyDown: Q,
184
+ onKeyUp: U
169
185
  }
170
186
  ),
171
- /* @__PURE__ */ r.jsx(
187
+ /* @__PURE__ */ t.jsx(
172
188
  "label",
173
189
  {
174
- ref: a,
175
- htmlFor: j,
190
+ ref: b,
191
+ htmlFor: E,
176
192
  className: e(
177
193
  "absolute left-3 pointer-events-none px-1 z-10",
178
- re,
179
- q(),
180
- h[i].label,
181
- _(),
182
- k && "after:content-['*'] after:text-error-default after:ml-1",
183
- v && "text-neutral-medium-disabled prometeo-fonts-label-large"
194
+ ne,
195
+ se(),
196
+ j[c].label,
197
+ re(),
198
+ P && "after:content-['*'] after:text-error-default after:ml-1",
199
+ k && "text-neutral-medium-disabled prometeo-fonts-label-large"
184
200
  ),
185
- children: w
201
+ children: C
186
202
  }
187
203
  ),
188
- (n || s === "password" || p) && /* @__PURE__ */ r.jsx(
204
+ (a || r === "password" || f) && /* @__PURE__ */ t.jsx(
189
205
  "div",
190
206
  {
191
207
  className: e(
192
208
  "absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10",
193
- !t && x[d].icon,
194
- t && "w-5 h-5 right-3",
195
- h[i].icon,
196
- s === "password" && !p ? "cursor-pointer" : "pointer-events-none",
209
+ d[i].icon,
210
+ j[c].icon,
211
+ r === "password" && !f ? "cursor-pointer" : "pointer-events-none",
197
212
  m === "right" ? "right-3" : "left-3"
198
213
  ),
199
- onClick: s === "password" && !p ? U : void 0,
200
- onMouseDown: (l) => s === "password" && !p && l.preventDefault(),
201
- children: /* @__PURE__ */ r.jsx("div", { children: p && s !== "password" ? /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(fe, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : s === "password" ? E ? /* @__PURE__ */ r.jsx(z.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ r.jsx(z.EyeVisibilityOff, { size: 24, className: "" }) : n })
214
+ onClick: r === "password" && !f ? q : void 0,
215
+ onMouseDown: (p) => r === "password" && !f && p.preventDefault(),
216
+ children: /* @__PURE__ */ t.jsx("div", { children: f && r !== "password" ? /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(pe, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : r === "password" ? z ? /* @__PURE__ */ t.jsx(O.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ t.jsx(O.EyeVisibilityOff, { size: 24, className: "" }) : a })
202
217
  }
203
218
  )
204
219
  ]
205
220
  }
206
221
  ),
207
- Y && S,
208
- $ && N
222
+ ee && L,
223
+ F && H
209
224
  ] });
210
- }, he = oe(ie);
225
+ }, Ce = ue(xe);
211
226
  export {
212
- he as default
227
+ Ce as default
213
228
  };