prometeo-design-system 2.6.0 → 2.6.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.
@@ -1,70 +1,70 @@
1
1
  import { j as g } from "./jsx-runtime-ByW6EXIE.js";
2
- import { c as G } from "./cn-B6yFEsav.js";
3
- import { forwardRef as J, useState as _, useRef as h, useEffect as F, useCallback as c, useMemo as q, useImperativeHandle as K } from "react";
4
- import { createPortal as Q } from "react-dom";
5
- const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) => {
6
- const { children: x, defaultOpen: s = !1, onClose: f, snapPoints: d = ["60%"], setSnap: v, snap: w, attachToParent: O = !1 } = a, [E, r] = _(w || "0%"), [C, Y] = _(null), u = h(f), p = h(v), b = h(C);
7
- u.current = f, b.current = C, F(() => {
8
- s && H();
2
+ import { c as W } from "./cn-B6yFEsav.js";
3
+ import { forwardRef as K, useState as B, useRef as v, useEffect as F, useCallback as c, useMemo as J, useImperativeHandle as Q } from "react";
4
+ import { createPortal as U } from "react-dom";
5
+ const A = 44, V = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", te = K((u, o) => {
6
+ const { children: y, defaultOpen: s = !1, onClose: f, snapPoints: d = ["60%"], setSnap: w, snap: p, attachToParent: O = !1 } = u, [E, x] = B(p || "0%"), [r, C] = B(null), Y = v(f), a = v(w), m = v(r);
7
+ Y.current = f, m.current = r, F(() => {
8
+ s && b();
9
9
  }, [s]), F(() => {
10
- p.current = v;
11
- }, [v]);
10
+ a.current = w;
11
+ }, [w]);
12
12
  const M = c(() => {
13
- r("0%"), u.current?.(b.current), setTimeout(() => Y(null), 300);
14
- }, []), H = c((L, R) => {
15
- console.log(L || d[0] || "60%"), r(L || d[0] || "60%"), Y(R ?? null);
16
- }, [d]), S = q(() => E !== "0%", [E]);
17
- K(o, () => ({
18
- open: H,
13
+ x("0%"), Y.current?.(m.current), setTimeout(() => C(null), 300);
14
+ }, []), b = c((H, N) => {
15
+ console.log(H || d[0] || "60%"), x(H || d[0] || "60%"), C(N ?? null);
16
+ }, [d]), S = J(() => E !== "0%", [E]);
17
+ Q(o, () => ({
18
+ open: b,
19
19
  close: M,
20
20
  isOpen: S,
21
- getContext: () => b.current
22
- }), [H, M, S]);
23
- const y = w || E;
24
- return O ? /* @__PURE__ */ g.jsx(B, { ...a, snap: y, setSnap: r, children: x }) : Q(/* @__PURE__ */ g.jsx(B, { ...a, snap: y, setSnap: r, children: x }), document.body);
25
- }), B = ({ children: a, attachToParent: o = !1, className: x, snap: s, snapPoints: f = ["60%"], setSnap: d, hideOnClose: v = !1, header: w, modal: O = !1, closeOnOverlayClick: E = !1 }) => {
26
- const r = h(null), C = h(null), Y = h(null), u = h(null), p = h(null), b = c(() => {
21
+ getContext: () => m.current
22
+ }), [b, M, S]);
23
+ const L = p || E;
24
+ return O ? /* @__PURE__ */ g.jsx(q, { ...u, snap: L, setSnap: x, context: r, children: y }) : U(/* @__PURE__ */ g.jsx(q, { ...u, snap: L, setSnap: x, context: r, children: y }), document.body);
25
+ }), q = ({ children: u, attachToParent: o = !1, className: y, snap: s, snapPoints: f = ["60%"], setSnap: d, hideOnClose: w = !1, header: p, modal: O = !1, closeOnOverlayClick: E = !1, context: x }) => {
26
+ const r = v(null), C = v(null), Y = v(null), a = v(null), m = v(null), M = c(() => {
27
27
  if (!r.current) return [];
28
28
  const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
29
29
  return f?.map((t) => typeof t == "string" && t.endsWith("%") ? parseFloat(t) > 100 ? e : parseFloat(t) / 100 * e : typeof t == "string" && t.endsWith("px") ? parseFloat(t) : typeof t == "number" && t >= 0 && t <= 1 ? t * e : typeof t == "number" ? t : 0) || [];
30
- }, [f, o]), M = c((e, t) => {
31
- const n = b();
30
+ }, [f, o]), b = c((e, t) => {
31
+ const n = M();
32
32
  if (n.length === 0) return e;
33
33
  if (Math.abs(t) > 0.05)
34
34
  if (t > 0) {
35
35
  const l = n.filter((i) => i < e);
36
- return l.length > 0 ? Math.max(...l) : v ? 0 : W;
36
+ return l.length > 0 ? Math.max(...l) : w ? 0 : A;
37
37
  } else {
38
38
  const l = n.filter((i) => i > e);
39
39
  if (l.length > 0)
40
40
  return Math.min(...l);
41
41
  }
42
42
  return n.reduce((l, i) => Math.abs(i - e) < Math.abs(l - e) ? i : l);
43
- }, [b]), H = c((e) => {
43
+ }, [M]), S = c((e) => {
44
44
  if (d && f) {
45
- const t = o && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= W ? "0%" : `${Math.round(e / t * 100)}%`;
45
+ const t = o && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= A ? "0%" : `${Math.round(e / t * 100)}%`;
46
46
  d(n);
47
47
  }
48
- }, [d, f, o]), S = c((e) => {
49
- r.current && (r.current.style.transition = U, r.current.style.height = `${e}px`);
50
- }, [d, f, o]), y = c(() => {
51
- if (p.current && o) {
52
- const { scrollY: e } = p.current;
53
- document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), p.current = null;
48
+ }, [d, f, o]), L = c((e) => {
49
+ r.current && (r.current.style.transition = V, r.current.style.height = `${e}px`);
50
+ }, [d, f, o]), R = c(() => {
51
+ if (m.current && o) {
52
+ const { scrollY: e } = m.current;
53
+ document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), m.current = null;
54
54
  }
55
55
  }, [o]);
56
56
  F(() => () => {
57
- y();
58
- }, [y]), F(() => {
57
+ R();
58
+ }, [R]), F(() => {
59
59
  if (!r.current || !s) return;
60
60
  const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
61
61
  let t = 0;
62
- typeof s == "string" && s.endsWith("%") ? parseFloat(s) <= 0 ? t = v ? 0 : W : t = parseFloat(s) / 100 * e : typeof s == "string" && s.endsWith("px") ? t = parseFloat(s) : typeof s == "number" && (s >= 0 && s <= 1 ? t = s * e : t = s), S(t);
62
+ typeof s == "string" && s.endsWith("%") ? parseFloat(s) <= 0 ? t = w ? 0 : A : t = parseFloat(s) / 100 * e : typeof s == "string" && s.endsWith("px") ? t = parseFloat(s) : typeof s == "number" && (s >= 0 && s <= 1 ? t = s * e : t = s), L(t);
63
63
  }, [s, o]);
64
- const N = c((e) => {
64
+ const H = c((e) => {
65
65
  if (!r.current) return;
66
66
  const t = e.touches[0], n = r.current.offsetHeight;
67
- u.current = {
67
+ a.current = {
68
68
  isDragging: !1,
69
69
  startY: t.clientY,
70
70
  startHeight: n,
@@ -72,10 +72,10 @@ const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) =>
72
72
  lastTime: Date.now(),
73
73
  velocity: 0
74
74
  };
75
- }, []), L = c((e) => {
75
+ }, []), N = c((e) => {
76
76
  if (!r.current) return;
77
77
  const t = e, n = r.current.offsetHeight;
78
- u.current = {
78
+ a.current = {
79
79
  isDragging: !1,
80
80
  startY: t.clientY,
81
81
  startHeight: n,
@@ -83,67 +83,67 @@ const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) =>
83
83
  lastTime: Date.now(),
84
84
  velocity: 0
85
85
  };
86
- }, []), R = c((e) => {
87
- if (!u.current || !r.current) return;
88
- const t = e.touches[0], n = u.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
86
+ }, []), I = c((e) => {
87
+ if (!a.current || !r.current) return;
88
+ const t = e.touches[0], n = a.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
89
89
  if (!n.isDragging && l && (n.isDragging = !0, o)) {
90
90
  const i = window.scrollY;
91
- p.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
91
+ m.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
92
92
  }
93
93
  if (l) {
94
94
  e.preventDefault();
95
95
  const i = Date.now(), j = i - n.lastTime;
96
96
  if (j > 0) {
97
- const z = (t.clientY - n.lastY) / j;
98
- n.velocity = n.velocity * 0.8 + z * 0.2;
97
+ const G = (t.clientY - n.lastY) / j;
98
+ n.velocity = n.velocity * 0.8 + G * 0.2;
99
99
  }
100
100
  n.lastY = t.clientY, n.lastTime = i;
101
- const k = n.startHeight + D, T = o && r.current.parentElement?.offsetHeight || window.innerHeight, $ = Math.max(0, Math.min(k, T));
102
- r.current.style.transition = "none", r.current.style.height = `${$}px`;
101
+ const T = n.startHeight + D, $ = o && r.current.parentElement?.offsetHeight || window.innerHeight, z = Math.max(0, Math.min(T, $));
102
+ r.current.style.transition = "none", r.current.style.height = `${z}px`;
103
103
  }
104
- }, [o]), A = c((e) => {
105
- if (!u.current || !r.current) return;
106
- const t = e, n = u.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
104
+ }, [o]), _ = c((e) => {
105
+ if (!a.current || !r.current) return;
106
+ const t = e, n = a.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
107
107
  if (!n.isDragging && l && (n.isDragging = !0, o)) {
108
108
  const i = window.scrollY;
109
- p.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
109
+ m.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
110
110
  }
111
111
  if (l) {
112
112
  e.preventDefault();
113
113
  const i = Date.now(), j = i - n.lastTime;
114
114
  if (j > 0) {
115
- const z = (t.clientY - n.lastY) / j;
116
- n.velocity = n.velocity * 0.8 + z * 0.2;
115
+ const G = (t.clientY - n.lastY) / j;
116
+ n.velocity = n.velocity * 0.8 + G * 0.2;
117
117
  }
118
118
  n.lastY = t.clientY, n.lastTime = i;
119
- const k = n.startHeight + D, T = o && r.current.parentElement?.offsetHeight || window.innerHeight, $ = Math.max(0, Math.min(k, T));
120
- r.current.style.transition = "none", r.current.style.height = `${$}px`;
119
+ const T = n.startHeight + D, $ = o && r.current.parentElement?.offsetHeight || window.innerHeight, z = Math.max(0, Math.min(T, $));
120
+ r.current.style.transition = "none", r.current.style.height = `${z}px`;
121
121
  }
122
- }, [o]), m = c(() => {
123
- if (!u.current || !r.current) return;
124
- const e = u.current;
122
+ }, [o]), h = c(() => {
123
+ if (!a.current || !r.current) return;
124
+ const e = a.current;
125
125
  if (e.isDragging) {
126
- y();
127
- const t = r.current.offsetHeight, n = M(t, e.velocity);
128
- H(n);
126
+ R();
127
+ const t = r.current.offsetHeight, n = b(t, e.velocity);
128
+ S(n);
129
129
  }
130
- u.current = null;
131
- }, [M, S, y]);
130
+ a.current = null;
131
+ }, [b, L, R]);
132
132
  F(() => {
133
133
  const e = Y.current;
134
134
  if (e)
135
- return e.addEventListener("touchstart", N, { passive: !1 }), e.addEventListener("touchmove", R, { passive: !1 }), e.addEventListener("touchend", m), e.addEventListener("touchcancel", m), e.addEventListener("mousedown", L, { passive: !1 }), e.addEventListener("mousemove", A, { passive: !1 }), e.addEventListener("mouseup", m), e.addEventListener("mouseleave", m), () => {
136
- e.removeEventListener("touchstart", N), e.removeEventListener("touchmove", R), e.removeEventListener("touchend", m), e.removeEventListener("touchcancel", m), e.removeEventListener("mousedown", L), e.removeEventListener("mousemove", A), e.removeEventListener("mouseup", m), e.removeEventListener("mouseleave", m);
135
+ return e.addEventListener("touchstart", H, { passive: !1 }), e.addEventListener("touchmove", I, { passive: !1 }), e.addEventListener("touchend", h), e.addEventListener("touchcancel", h), e.addEventListener("mousedown", N, { passive: !1 }), e.addEventListener("mousemove", _, { passive: !1 }), e.addEventListener("mouseup", h), e.addEventListener("mouseleave", h), () => {
136
+ e.removeEventListener("touchstart", H), e.removeEventListener("touchmove", I), e.removeEventListener("touchend", h), e.removeEventListener("touchcancel", h), e.removeEventListener("mousedown", N), e.removeEventListener("mousemove", _), e.removeEventListener("mouseup", h), e.removeEventListener("mouseleave", h);
137
137
  };
138
- }, [N, R, m]);
139
- const I = q(() => s !== "0%", [s]);
138
+ }, [H, I, h]);
139
+ const k = J(() => s !== "0%", [s]);
140
140
  return /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
141
141
  O && /* @__PURE__ */ g.jsx(
142
142
  "div",
143
143
  {
144
- className: G(I ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
144
+ className: W(k ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
145
145
  onClick: (e) => {
146
- e.preventDefault(), e.stopPropagation(), E && H(0);
146
+ e.preventDefault(), e.stopPropagation(), E && S(0);
147
147
  },
148
148
  "aria-hidden": "true"
149
149
  }
@@ -152,13 +152,13 @@ const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) =>
152
152
  "div",
153
153
  {
154
154
  ref: r,
155
- className: G(
155
+ className: W(
156
156
  o ? "absolute" : "fixed",
157
157
  "z-60 bottom-0 w-full overflow-hidden",
158
158
  "bg-neutral-default-default",
159
159
  "border-t border-neutral-strong-default rounded-t-[12px]",
160
- I ? "" : "border-neutral-weak",
161
- x,
160
+ k ? "" : "border-neutral-weak",
161
+ y,
162
162
  "flex flex-col items-center",
163
163
  "touch-none select-none"
164
164
  ),
@@ -171,41 +171,41 @@ const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) =>
171
171
  children: /* @__PURE__ */ g.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
172
172
  }
173
173
  ),
174
- typeof w == "string" ? /* @__PURE__ */ g.jsx("p", { className: " prometeo-fonts-headline-small text-neutral-default-default w-full h-11 bg-inherit absolute top-11 z-50 px-4", children: w }) : w,
174
+ typeof p == "string" ? /* @__PURE__ */ g.jsx("p", { className: " prometeo-fonts-headline-small text-neutral-default-default w-full h-11 bg-inherit absolute top-11 z-50 px-4", children: p }) : p,
175
175
  /* @__PURE__ */ g.jsx(
176
176
  "div",
177
177
  {
178
178
  ref: C,
179
- className: G(
179
+ className: W(
180
180
  "w-full h-full overflow-y-auto px-4 pb-4 ",
181
- w ? "mt-22" : "mt-11"
181
+ p ? "mt-22" : "mt-11"
182
182
  ),
183
183
  style: {
184
184
  overscrollBehavior: "contain",
185
- overflow: I ? "auto" : "hidden"
185
+ overflow: k ? "auto" : "hidden"
186
186
  },
187
- children: a
187
+ children: typeof u == "function" ? u(x) : u
188
188
  }
189
189
  )
190
190
  ]
191
191
  }
192
192
  )
193
193
  ] });
194
- }, te = () => {
195
- const a = h(null), o = c((d, v) => {
196
- a.current?.open(d, v);
197
- }, []), x = c(() => {
198
- a.current?.close();
199
- }, []), s = c(() => a.current?.isOpen ?? !1, []), f = c(() => a.current?.getContext() ?? null, []);
194
+ }, ne = () => {
195
+ const u = v(null), o = c((d, w) => {
196
+ u.current?.open(d, w);
197
+ }, []), y = c(() => {
198
+ u.current?.close();
199
+ }, []), s = c(() => u.current?.isOpen ?? !1, []), f = c(() => u.current?.getContext() ?? null, []);
200
200
  return {
201
201
  isOpen: s,
202
202
  open: o,
203
- close: x,
204
- drawerRef: a,
203
+ close: y,
204
+ drawerRef: u,
205
205
  getContext: f
206
206
  };
207
207
  };
208
208
  export {
209
- ee as default,
210
- te as useDrawerMobile
209
+ te as default,
210
+ ne as useDrawerMobile
211
211
  };
@@ -1,44 +1,50 @@
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";
2
+ import { c as s } from "./cn-B6yFEsav.js";
3
+ import { FastField as q, ErrorMessage as G } from "formik";
4
+ import { memo as H, useState as I, useRef as J, useCallback as y, useLayoutEffect as Q } from "react";
5
5
  import { Icons as N } from "./Icons.es.js";
6
- const Q = ({
7
- icon: l,
6
+ const W = ({
7
+ icon: t,
8
8
  iconPosition: r = "left",
9
9
  label: d,
10
10
  className: B,
11
- containerClassName: $,
11
+ containerClassName: R,
12
12
  id: w,
13
13
  type: j = "text",
14
14
  labelVariant: n = "default",
15
15
  placeholder: p,
16
16
  disabled: b = !1,
17
- field: t,
17
+ field: l,
18
+ innerRef: $,
18
19
  form: z,
19
20
  ...a
20
21
  }) => {
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
+ const [o, v] = I(!1), [C, K] = I(!1), i = J(null), F = z.getFieldMeta(l.name), k = F.touched && F.error, E = l.value && l.value.toString().length > 0, x = j === "password", M = x ? C ? "text" : "password" : j, P = () => n === "static" ? p || d : p || "", A = () => x ? t ? r === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : t ? r === "left" ? "pl-10" : "pr-10" : "", D = y(() => {
22
23
  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);
24
+ }, [a]), T = y(
25
+ (c) => {
26
+ v(!1), a.onBlur?.(), l.onBlur(c);
27
+ },
28
+ [l, a]
29
+ ), U = y(() => {
30
+ K((c) => !c);
27
31
  }, []);
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;
32
+ Q(() => {
33
+ if (i.current) {
34
+ const L = ((O) => {
35
+ let u = O;
36
+ for (; u && u !== document.body; ) {
37
+ const f = window.getComputedStyle(u).backgroundColor;
34
38
  if (f && f !== "transparent" && f !== "rgba(0, 0, 0, 0)")
35
39
  return f;
36
- s = s.parentElement;
40
+ u = u.parentElement;
37
41
  }
38
42
  const m = window.getComputedStyle(document.body).backgroundColor;
39
43
  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;
44
+ })(
45
+ i.current.parentElement
46
+ );
47
+ i.current.style.backgroundColor = L;
42
48
  }
43
49
  }, []);
44
50
  const g = {
@@ -72,7 +78,7 @@ const Q = ({
72
78
  icon: {},
73
79
  placeholder: {}
74
80
  }
75
- }, U = {
81
+ }, V = {
76
82
  none: {
77
83
  label: "left-2 "
78
84
  },
@@ -92,79 +98,116 @@ const Q = ({
92
98
  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
99
  }
94
100
  }, h = b ? "disabled" : k ? "error" : "default";
95
- return /* @__PURE__ */ e.jsxs("div", { className: u("relative w-full bg-inherit", n === "static" && "mt-5", $), children: [
96
- /* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
97
- /* @__PURE__ */ e.jsx(
98
- "input",
99
- {
100
- disabled: b,
101
- id: w || t.name,
102
- type: M,
103
- name: t.name,
104
- value: t.value || "",
105
- placeholder: P(),
106
- onChange: t.onChange,
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",
114
- "bg-transparent focus:outline-none",
115
- S[n].input,
116
- g[h].input,
117
- R(),
118
- B
119
- )
120
- }
101
+ return /* @__PURE__ */ e.jsxs(
102
+ "div",
103
+ {
104
+ className: s(
105
+ "relative w-full bg-inherit",
106
+ n === "static" && "mt-5",
107
+ R
121
108
  ),
122
- /* @__PURE__ */ e.jsx(
123
- "label",
124
- {
125
- ref: c,
126
- htmlFor: w || a.name,
127
- className: u(
128
- "absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
129
- "prometeo-fonts-label-large text-sm",
130
- U[l ? r : "none"].label,
131
- S[n].label,
132
- g[h].label
109
+ children: [
110
+ /* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
111
+ /* @__PURE__ */ e.jsx(
112
+ "input",
113
+ {
114
+ disabled: b,
115
+ id: w || l.name,
116
+ type: M,
117
+ name: l.name,
118
+ value: l.value || "",
119
+ placeholder: P(),
120
+ onChange: l.onChange,
121
+ onFocus: D,
122
+ onEmptied: a.onEmptied,
123
+ onKeyDown: a.onKeyDown,
124
+ onKeyUp: a.onKeyUp,
125
+ onBlur: T,
126
+ className: s(
127
+ "w-full px-3 h-12 text-left border-[1px] rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
128
+ "bg-transparent focus:outline-none",
129
+ S[n].input,
130
+ g[h].input,
131
+ A(),
132
+ B
133
+ ),
134
+ ref: $
135
+ }
133
136
  ),
134
- children: d
135
- }
136
- ),
137
- l && /* @__PURE__ */ e.jsx("div", { className: u(
138
- "absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
139
- g[h].icon,
140
- r === "left" ? "left-3" : "right-3"
141
- ), children: l }),
142
- x && /* @__PURE__ */ e.jsx(
143
- "button",
144
- {
145
- type: "button",
146
- onClick: T,
147
- className: u(
148
- "absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
149
- "transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
150
- l && r === "right" ? "right-8" : "right-3"
137
+ /* @__PURE__ */ e.jsx(
138
+ "label",
139
+ {
140
+ ref: i,
141
+ htmlFor: w || a.name,
142
+ className: s(
143
+ "absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
144
+ "prometeo-fonts-label-large text-sm",
145
+ V[t ? r : "none"].label,
146
+ S[n].label,
147
+ g[h].label
148
+ ),
149
+ children: d
150
+ }
151
151
  ),
152
- tabIndex: -1,
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" })
155
- }
156
- )
157
- ] }),
158
- k && /* @__PURE__ */ e.jsx(
159
- q,
160
- {
161
- name: t.name,
162
- component: "span",
163
- className: "block text-error-default-default text-xs mt-1"
164
- }
165
- )
166
- ] });
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 }) });
152
+ t && /* @__PURE__ */ e.jsx(
153
+ "div",
154
+ {
155
+ className: s(
156
+ "absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
157
+ g[h].icon,
158
+ r === "left" ? "left-3" : "right-3"
159
+ ),
160
+ children: t
161
+ }
162
+ ),
163
+ x && /* @__PURE__ */ e.jsx(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ onClick: U,
168
+ className: s(
169
+ "absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
170
+ "transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
171
+ t && r === "right" ? "right-8" : "right-3"
172
+ ),
173
+ tabIndex: -1,
174
+ disabled: b,
175
+ children: C ? /* @__PURE__ */ e.jsx(
176
+ N.EyeVisibility,
177
+ {
178
+ size: 24,
179
+ className: "text-neutral-default-default"
180
+ }
181
+ ) : /* @__PURE__ */ e.jsx(
182
+ N.EyeVisibilityOff,
183
+ {
184
+ size: 24,
185
+ className: "text-neutral-default-default"
186
+ }
187
+ )
188
+ }
189
+ )
190
+ ] }),
191
+ k && /* @__PURE__ */ e.jsx(
192
+ G,
193
+ {
194
+ name: l.name,
195
+ component: "span",
196
+ className: "block text-error-default-default text-xs mt-1"
197
+ }
198
+ )
199
+ ]
200
+ }
201
+ );
202
+ }, X = H(W), ae = (t) => /* @__PURE__ */ e.jsx(q, { name: t.name, children: ({ field: r, form: d }) => /* @__PURE__ */ e.jsx(
203
+ X,
204
+ {
205
+ ...t,
206
+ field: r,
207
+ form: d,
208
+ innerRef: t.innerRef
209
+ }
210
+ ) });
168
211
  export {
169
- le as default
212
+ ae as default
170
213
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export interface DrawerMobileProps<TContext = unknown> {
3
- children?: React.ReactNode;
3
+ children?: React.ReactNode | ((context: TContext | null) => React.ReactNode);
4
4
  defaultOpen?: boolean;
5
5
  onClose?: (context: TContext | null) => void;
6
6
  snap?: string | number | null;
@@ -3,7 +3,7 @@ export type LabelVariant = "default" | "static";
3
3
  export interface IInputFormik {
4
4
  label: string;
5
5
  icon?: ReactNode;
6
- iconPosition?: 'left' | 'right';
6
+ iconPosition?: "left" | "right";
7
7
  className?: string;
8
8
  containerClassName?: string;
9
9
  id?: string;
@@ -17,6 +17,7 @@ export interface IInputFormik {
17
17
  onEmptied?: () => void;
18
18
  onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
19
19
  onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
20
+ innerRef?: React.Ref<HTMLInputElement>;
20
21
  }
21
22
  declare const InputFormik: (props: IInputFormik) => import("react/jsx-runtime").JSX.Element;
22
23
  export default InputFormik;
@@ -1,5 +1,6 @@
1
1
  import { InputProps } from '../../index';
2
2
  export interface IInputFormikV2 extends Omit<InputProps, 'onChange' | 'form'> {
3
+ innerRef?: React.Ref<HTMLInputElement>;
3
4
  }
4
5
  declare const InputFormik: (props: IInputFormikV2) => import("react/jsx-runtime").JSX.Element;
5
6
  export default InputFormik;
@@ -118,7 +118,8 @@ const G = ({
118
118
  },
119
119
  variant: n ? "error" : "default",
120
120
  errorComponent: o.error,
121
- type: a.type
121
+ type: a.type,
122
+ ref: a.innerRef
122
123
  }
123
124
  );
124
125
  }, X = B(G), Se = (t) => /* @__PURE__ */ r.jsx(H, { name: t.name, children: ({ field: e, form: a }) => /* @__PURE__ */ r.jsx(X, { ...t, field: e, form: a }) }), Z = (t, e) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "2.6.0",
4
+ "version": "2.6.1",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",