prometeo-design-system 1.8.2 → 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.
@@ -1,97 +1,162 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
- import { c as o } from "./cn-B6yFEsav.js";
3
- import { FastField as $, ErrorMessage as D } from "formik";
4
- import { memo as L, useState as w, useCallback as f } from "react";
5
- import { Icons as v } from "./Icons.es.js";
6
- const T = ({
7
- icon: r,
8
- iconPosition: a = "left",
9
- label: u,
10
- className: F,
11
- containerClassName: I,
12
- id: x,
13
- type: p = "text",
14
- labelVariant: s = "default",
15
- placeholder: d,
16
- disabled: h = !1,
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { c as u } from "./cn-B6yFEsav.js";
3
+ import { FastField as O, ErrorMessage as q } from "formik";
4
+ import { memo as G, useState as I, useRef as H, useCallback as y, useLayoutEffect as J } from "react";
5
+ import { Icons as N } from "./Icons.es.js";
6
+ const Q = ({
7
+ icon: l,
8
+ iconPosition: r = "left",
9
+ label: d,
10
+ className: B,
11
+ containerClassName: $,
12
+ id: w,
13
+ type: j = "text",
14
+ labelVariant: n = "default",
15
+ placeholder: p,
16
+ disabled: b = !1,
17
17
  field: t,
18
- form: N,
19
- ...n
18
+ form: z,
19
+ ...a
20
20
  }) => {
21
- const [i, g] = w(!1), [y, E] = w(!1), b = N.getFieldMeta(t.name), m = b.touched && b.error, j = t.value && t.value.toString().length > 0, c = p === "password", k = c ? y ? "text" : "password" : p, z = () => {
22
- const l = () => r ? a === "left" ? "left-9" : "left-0" : "left-2";
23
- return s === "static" ? `-top-5 ${l()} scale-90 px-1` : i || j ? `-top-2 ${l()} scale-90` : `top-1/2 -translate-y-1/2 ${l()} scale-100`;
24
- }, C = () => s === "static" ? "text-sm" : "text-sm peer-focus:text-sm peer-placeholder-shown:text-base", B = () => s === "static" ? d || u : d || "", K = () => c ? r ? a === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : r ? a === "left" ? "pl-10" : "pr-10" : "", P = f(() => {
25
- g(!0), n.onFocus?.();
26
- }, [n]), M = f((l) => {
27
- g(!1), n.onBlur?.(), t.onBlur(l);
28
- }, [t, n]), S = f(() => {
29
- E((l) => !l);
21
+ const [o, v] = I(!1), [C, K] = I(!1), c = H(null), F = z.getFieldMeta(t.name), k = F.touched && F.error, E = t.value && t.value.toString().length > 0, x = j === "password", M = x ? C ? "text" : "password" : j, P = () => n === "static" ? p || d : p || "", R = () => x ? l ? r === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : l ? r === "left" ? "pl-10" : "pr-10" : "", A = y(() => {
22
+ v(!0), a.onFocus?.();
23
+ }, [a]), D = y((i) => {
24
+ v(!1), a.onBlur?.(), t.onBlur(i);
25
+ }, [t, a]), T = y(() => {
26
+ K((i) => !i);
30
27
  }, []);
31
- return /* @__PURE__ */ e.jsxs("div", { className: o("relative w-full bg-inherit", s === "static" && "mt-2", I), children: [
28
+ J(() => {
29
+ if (c.current) {
30
+ const V = ((L) => {
31
+ let s = L;
32
+ for (; s && s !== document.body; ) {
33
+ const f = window.getComputedStyle(s).backgroundColor;
34
+ if (f && f !== "transparent" && f !== "rgba(0, 0, 0, 0)")
35
+ return f;
36
+ s = s.parentElement;
37
+ }
38
+ const m = window.getComputedStyle(document.body).backgroundColor;
39
+ return m && m !== "transparent" && m !== "rgba(0, 0, 0, 0)" ? m : "rgb(255, 255, 255)";
40
+ })(c.current.parentElement);
41
+ c.current.style.backgroundColor = V;
42
+ }
43
+ }, []);
44
+ const h = {
45
+ default: {
46
+ input: `${o && "ring-primary-default-default ring-[1px] "} border-neutral-default-default hover:border-primary-default-default`,
47
+ label: `${o ? "text-primary-default-default" : "text-neutral-medium-default"}`,
48
+ icon: {},
49
+ placeholder: {}
50
+ },
51
+ disabled: {
52
+ input: "border-neutral-default-disabled",
53
+ label: "text-neutral-medium-disabled",
54
+ icon: "text-neutral-medium-disabled",
55
+ placeholder: {}
56
+ },
57
+ error: {
58
+ input: "border-error-default-default ",
59
+ label: "text-error-medium-default",
60
+ icon: {},
61
+ placeholder: {}
62
+ },
63
+ success: {
64
+ input: {},
65
+ label: {},
66
+ icon: {},
67
+ placeholder: {}
68
+ },
69
+ warning: {
70
+ input: {},
71
+ label: {},
72
+ icon: {},
73
+ placeholder: {}
74
+ }
75
+ }, U = {
76
+ none: {
77
+ label: "left-2 "
78
+ },
79
+ left: {
80
+ label: `left-9 ${(o || E || n === "static") && "left-2"} `
81
+ },
82
+ right: {
83
+ label: "left-2"
84
+ }
85
+ }, S = {
86
+ static: {
87
+ input: "placeholder:text-neutral-medium-default placeholder:opacity-50",
88
+ label: "-top-1 -translate-y-full scale-90 px-0 "
89
+ },
90
+ default: {
91
+ input: `${p && o ? "placeholder:text-neutral-medium-default placeholder:opacity-50" : "placeholder:text-transparent"}`,
92
+ label: `top-1/2 -translate-y-1/2 scale-100 peer-focus:text-sm peer-placeholder-shown:text-base ${(o || E) && "top-0 scale-90"}`
93
+ }
94
+ }, g = b ? "disabled" : k ? "error" : "default";
95
+ return /* @__PURE__ */ e.jsxs("div", { className: u("relative w-full bg-inherit", n === "static" && "mt-5", $), children: [
32
96
  /* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
33
97
  /* @__PURE__ */ e.jsx(
34
98
  "input",
35
99
  {
36
- disabled: h,
37
- id: x || t.name,
38
- type: k,
100
+ disabled: b,
101
+ id: w || t.name,
102
+ type: M,
39
103
  name: t.name,
40
104
  value: t.value || "",
41
- placeholder: B(),
105
+ placeholder: P(),
42
106
  onChange: t.onChange,
43
- onFocus: P,
44
- onEmptied: n.onEmptied,
45
- onKeyDown: n.onKeyDown,
46
- onKeyUp: n.onKeyUp,
47
- onBlur: M,
48
- className: o(
49
- "w-full px-3 h-12 text-left border-1 rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
107
+ onFocus: A,
108
+ onEmptied: a.onEmptied,
109
+ onKeyDown: a.onKeyDown,
110
+ onKeyUp: a.onKeyUp,
111
+ onBlur: D,
112
+ className: u(
113
+ "w-full px-3 h-12 text-left border-[1px] rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
50
114
  "bg-transparent focus:outline-none",
51
- s === "default" && !d && "placeholder:text-transparent",
52
- s === "default" && d && "placeholder:text-neutral-medium-default placeholder:opacity-50",
53
- s === "static" && "placeholder:text-neutral-medium-default placeholder:opacity-50",
54
- i ? "border-primary-default-default border-2 text-primary-default-default" : m ? "border-error-default-default" : "border-neutral-default-default hover:border-neutral-strong-default",
55
- K(),
56
- F
115
+ S[n].input,
116
+ h[g].input,
117
+ R(),
118
+ B
57
119
  )
58
120
  }
59
121
  ),
60
122
  /* @__PURE__ */ e.jsx(
61
123
  "label",
62
124
  {
63
- htmlFor: x || t.name,
64
- className: o(
125
+ ref: c,
126
+ htmlFor: w || a.name,
127
+ className: u(
65
128
  "absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
66
- C(),
67
- z(),
68
- j || i ? "text-primary-default-default" : m ? "text-red-500" : "text-neutral-medium-default"
129
+ "prometeo-fonts-label-large text-sm",
130
+ U[l ? r : "none"].label,
131
+ S[n].label,
132
+ h[g].label
69
133
  ),
70
- children: u
134
+ children: d
71
135
  }
72
136
  ),
73
- r && /* @__PURE__ */ e.jsx("div", { className: o(
137
+ l && /* @__PURE__ */ e.jsx("div", { className: u(
74
138
  "absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
75
- a === "left" ? "left-3" : "right-3"
76
- ), children: r }),
77
- c && /* @__PURE__ */ e.jsx(
139
+ h[g].icon,
140
+ r === "left" ? "left-3" : "right-3"
141
+ ), children: l }),
142
+ x && /* @__PURE__ */ e.jsx(
78
143
  "button",
79
144
  {
80
145
  type: "button",
81
- onClick: S,
82
- className: o(
146
+ onClick: T,
147
+ className: u(
83
148
  "absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
84
149
  "transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
85
- r && a === "right" ? "right-8" : "right-3"
150
+ l && r === "right" ? "right-8" : "right-3"
86
151
  ),
87
152
  tabIndex: -1,
88
- disabled: h,
89
- children: y ? /* @__PURE__ */ e.jsx(v.EyeVisibility, { size: 24, className: "text-neutral-default-default" }) : /* @__PURE__ */ e.jsx(v.EyeVisibilityOff, { size: 24, className: "text-neutral-default-default" })
153
+ disabled: b,
154
+ children: C ? /* @__PURE__ */ e.jsx(N.EyeVisibility, { size: 24, className: "text-neutral-default-default" }) : /* @__PURE__ */ e.jsx(N.EyeVisibilityOff, { size: 24, className: "text-neutral-default-default" })
90
155
  }
91
156
  )
92
157
  ] }),
93
- m && /* @__PURE__ */ e.jsx(
94
- D,
158
+ k && /* @__PURE__ */ e.jsx(
159
+ q,
95
160
  {
96
161
  name: t.name,
97
162
  component: "span",
@@ -99,7 +164,7 @@ const T = ({
99
164
  }
100
165
  )
101
166
  ] });
102
- }, U = L(T), G = (r) => /* @__PURE__ */ e.jsx($, { name: r.name, children: ({ field: a, form: u }) => /* @__PURE__ */ e.jsx(U, { ...r, field: a, form: u }) });
167
+ }, W = G(Q), le = (l) => /* @__PURE__ */ e.jsx(O, { name: l.name, children: ({ field: r, form: d }) => /* @__PURE__ */ e.jsx(W, { ...l, field: r, form: d }) });
103
168
  export {
104
- G as default
169
+ le as default
105
170
  };
@@ -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 { Icons as E } from "./Icons.es.js";
3
3
  import { c as d } from "./cn-B6yFEsav.js";
4
4
  import M, { useRef as D, useState as p, useCallback as W, useEffect as X } from "react";
@@ -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 { 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-p4Pll4Cm.js";
1
+ import { L as f } from "./LayoutGeneric-jDE96L2N.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-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.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-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.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-DKDX3adD.js";
1
+ import { j as p } from "./jsx-runtime-ByW6EXIE.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-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.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-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { motion as n, AnimatePresence as L } from "framer-motion";
3
3
  import { useRef as B, useState as C } from "react";
4
4
  import b from "./Avatar.es.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 x } from "./cn-B6yFEsav.js";
3
3
  import u from "react";
4
4
  const j = u.forwardRef(
package/dist/Select.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 { Icons as w } from "./Icons.es.js";
3
3
  import { c as o } from "./cn-B6yFEsav.js";
4
4
  import { memo as se, useState as y, useRef as re, useEffect as oe } from "react";
@@ -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 v } from "./Icons.es.js";
3
3
  import { c as o } from "./cn-B6yFEsav.js";
4
4
  import { useField as P, ErrorMessage as M } from "formik";
@@ -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 { ClipLoader as l, SyncLoader as m, HashLoader as p, GridLoader as x, DotLoader as j, BounceLoader as f } from "react-spinners";
3
3
  import { c as L } from "./cn-B6yFEsav.js";
4
4
  const y = ({
package/dist/Steps.es.js CHANGED
@@ -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 j } from "./cn-B6yFEsav.js";
3
3
  import { motion as r } from "framer-motion";
4
4
  import N from "react";
@@ -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 i } from "./cn-B6yFEsav.js";
3
3
  import { useState as d, useRef as D, useEffect as L } from "react";
4
4
  const O = ({
@@ -1,4 +1,4 @@
1
- import { j as a } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as a } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { motion as x } from "framer-motion";
3
3
  import { memo as b } from "react";
4
4
  import { c as r } from "./cn-B6yFEsav.js";
package/dist/Table.es.js CHANGED
@@ -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 { c as l } from "./cn-B6yFEsav.js";
3
3
  import * as o from "react";
4
4
  const n = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r.jsx("div", { className: "w-full", children: /* @__PURE__ */ r.jsx(
@@ -1,4 +1,4 @@
1
- import { j as y } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as y } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as C } from "./cn-B6yFEsav.js";
3
3
  import * as s from "react";
4
4
  function M({
@@ -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 { AnimatePresence as f, motion as n } from "framer-motion";
3
3
  import { useState as p, cloneElement as x } from "react";
4
4
  import { Icons as b } from "./Icons.es.js";
@@ -24,5 +24,6 @@ export interface ButtonProps extends VariantProps<typeof buttonVariants> {
24
24
  variant?: "filled" | "outline" | "text";
25
25
  form?: string;
26
26
  }
27
- export default function Button({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner, className, form, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
28
- export {};
27
+ declare function Button({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner, className, form, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
28
+ declare const _default: import('react').MemoExoticComponent<typeof Button>;
29
+ export default _default;