prometeo-design-system 2.7.9 → 2.8.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.
- package/dist/{CardProfile-DV3gwvqE.js → CardProfile-CHUivLbW.js} +8 -8
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +3 -3
- package/dist/CheckboxFormik.es.js +1 -1
- package/dist/DatePicker.es.js +2 -2
- package/dist/DrawerDesktop.es.js +8 -8
- package/dist/DropZone.es.js +1 -1
- package/dist/FAButton.es.js +1 -1
- package/dist/{HelperComponent-U6mPwuDH.js → HelperComponent-CcGxM09g.js} +1 -1
- package/dist/Icons/Icons.d.ts +60 -0
- package/dist/Icons-ChYkaR8R.js +899 -0
- package/dist/Icons.es.js +2 -891
- package/dist/{ImageGallery-D8nIvBpV.js → ImageGallery-TkgHO3JL.js} +1 -1
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-60IT1aGF.js → Input-CsNlU1Hu.js} +66 -73
- package/dist/Input.es.js +1 -1
- package/dist/InputFormik.es.js +33 -33
- package/dist/InputFormikV2.es.js +1 -1
- package/dist/InputMultiple.es.js +1 -1
- package/dist/Logo.es.js +1 -1
- package/dist/OtpInput.es.js +39 -39
- package/dist/RadioButton.es.js +1 -1
- package/dist/{Select-C4UvSsof.js → Select-D7Cs1OlG.js} +164 -164
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectFormikLegacy.es.js +8 -8
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Steps.es.js +1 -1
- package/dist/Toast.es.js +1 -1
- package/dist/Tooltip.es.js +1 -1
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +5 -5
- package/package.json +2 -5
package/dist/OtpInput.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { I as ge } from "./Icons-ChYkaR8R.js";
|
|
3
3
|
import { c as $ } from "./cn-B6yFEsav.js";
|
|
4
4
|
import * as n from "react";
|
|
5
5
|
import xe, { memo as De } from "react";
|
|
@@ -7,13 +7,13 @@ var Oe = Object.defineProperty, Te = Object.defineProperties, We = Object.getOwn
|
|
|
7
7
|
for (var r in a || (a = {})) we.call(a, r) && be(t, r, a[r]);
|
|
8
8
|
if (ee) for (var r of ee(a)) ye.call(a, r) && be(t, r, a[r]);
|
|
9
9
|
return t;
|
|
10
|
-
}, Be = (t, a) => Te(t, We(a)),
|
|
10
|
+
}, Be = (t, a) => Te(t, We(a)), Ie = (t, a) => {
|
|
11
11
|
var r = {};
|
|
12
12
|
for (var u in t) we.call(t, u) && a.indexOf(u) < 0 && (r[u] = t[u]);
|
|
13
13
|
if (t != null && ee) for (var u of ee(t)) a.indexOf(u) < 0 && ye.call(t, u) && (r[u] = t[u]);
|
|
14
14
|
return r;
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function _e(t) {
|
|
17
17
|
let a = setTimeout(t, 0), r = setTimeout(t, 10), u = setTimeout(t, 50);
|
|
18
18
|
return [a, r, u];
|
|
19
19
|
}
|
|
@@ -25,7 +25,7 @@ function Fe(t) {
|
|
|
25
25
|
}
|
|
26
26
|
var He = 18, Se = 40, Le = `${Se}px`, $e = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
27
27
|
function ze({ containerRef: t, inputRef: a, pushPasswordManagerStrategy: r, isFocused: u }) {
|
|
28
|
-
let [M, d] = n.useState(!1), [D, k] = n.useState(!1), [O, B] = n.useState(!1),
|
|
28
|
+
let [M, d] = n.useState(!1), [D, k] = n.useState(!1), [O, B] = n.useState(!1), I = n.useMemo(() => r === "none" ? !1 : (r === "increase-width" || r === "experimental-no-flickering") && M && D, [M, D, r]), x = n.useCallback(() => {
|
|
29
29
|
let f = t.current, v = a.current;
|
|
30
30
|
if (!f || !v || O || r === "none") return;
|
|
31
31
|
let m = f, b = m.getBoundingClientRect().left + m.offsetWidth, w = m.getBoundingClientRect().top + m.offsetHeight / 2, o = b - He, P = w;
|
|
@@ -52,13 +52,13 @@ function ze({ containerRef: t, inputRef: a, pushPasswordManagerStrategy: r, isFo
|
|
|
52
52
|
return () => {
|
|
53
53
|
clearTimeout(v), clearTimeout(m), clearTimeout(b), clearTimeout(w);
|
|
54
54
|
};
|
|
55
|
-
}, [a, u, r, x]), { hasPWMBadge: M, willPushPWMBadge:
|
|
55
|
+
}, [a, u, r, x]), { hasPWMBadge: M, willPushPWMBadge: I, PWM_BADGE_SPACE_WIDTH: Le };
|
|
56
56
|
}
|
|
57
57
|
var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
58
|
-
var r = t, { value: u, onChange: M, maxLength: d, textAlign: D = "left", pattern: k, placeholder: O, inputMode: B = "numeric", onComplete:
|
|
59
|
-
let [te, ne] = n.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""),
|
|
58
|
+
var r = t, { value: u, onChange: M, maxLength: d, textAlign: D = "left", pattern: k, placeholder: O, inputMode: B = "numeric", onComplete: I, pushPasswordManagerStrategy: x = "increase-width", pasteTransformer: f, containerClassName: v, noScriptCSSFallback: m = Ve, render: b, children: w } = r, o = Ie(r, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), P, N, U, T, V;
|
|
59
|
+
let [te, ne] = n.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""), s = u ?? te, E = Fe(s), q = n.useCallback((e) => {
|
|
60
60
|
M?.(e), ne(e);
|
|
61
|
-
}, [M]), C = n.useMemo(() => k ? typeof k == "string" ? new RegExp(k) : k : null, [k]), c = n.useRef(null), le = n.useRef(null), ae = n.useRef({ value:
|
|
61
|
+
}, [M]), C = n.useMemo(() => k ? typeof k == "string" ? new RegExp(k) : k : null, [k]), c = n.useRef(null), le = n.useRef(null), ae = n.useRef({ value: s, onChange: q, isIOS: typeof window < "u" && ((N = (P = window?.CSS) == null ? void 0 : P.supports) == null ? void 0 : N.call(P, "-webkit-touch-callout", "none")) }), X = n.useRef({ prev: [(U = c.current) == null ? void 0 : U.selectionStart, (T = c.current) == null ? void 0 : T.selectionEnd, (V = c.current) == null ? void 0 : V.selectionDirection] });
|
|
62
62
|
n.useImperativeHandle(a, () => c.current, []), n.useEffect(() => {
|
|
63
63
|
let e = c.current, l = le.current;
|
|
64
64
|
if (!e || !l) return;
|
|
@@ -68,33 +68,33 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
68
68
|
J(null), K(null);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
let
|
|
72
|
-
if (F.length !== 0 &&
|
|
73
|
-
let ke =
|
|
71
|
+
let i = e.selectionStart, g = e.selectionEnd, Y = e.selectionDirection, j = e.maxLength, F = e.value, R = X.current.prev, W = -1, A = -1, H;
|
|
72
|
+
if (F.length !== 0 && i !== null && g !== null) {
|
|
73
|
+
let ke = i === g, Ne = i === F.length && F.length < j;
|
|
74
74
|
if (ke && !Ne) {
|
|
75
|
-
let L =
|
|
75
|
+
let L = i;
|
|
76
76
|
if (L === 0) W = 0, A = 1, H = "forward";
|
|
77
77
|
else if (L === j) W = L - 1, A = L, H = "backward";
|
|
78
78
|
else if (j > 1 && F.length > 1) {
|
|
79
|
-
let
|
|
79
|
+
let se = 0;
|
|
80
80
|
if (R[0] !== null && R[1] !== null) {
|
|
81
81
|
H = L < R[1] ? "backward" : "forward";
|
|
82
82
|
let Re = R[0] === R[1] && R[0] < j;
|
|
83
|
-
H === "backward" && !Re && (
|
|
83
|
+
H === "backward" && !Re && (se = -1);
|
|
84
84
|
}
|
|
85
|
-
W =
|
|
85
|
+
W = se + L, A = se + L + 1;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
W !== -1 && A !== -1 && W !== A && c.current.setSelectionRange(W, A, H);
|
|
89
89
|
}
|
|
90
|
-
let he = W !== -1 ? W :
|
|
90
|
+
let he = W !== -1 ? W : i, ve = A !== -1 ? A : g, Me = H ?? Y;
|
|
91
91
|
J(he), K(ve), X.current.prev = [he, ve, Me];
|
|
92
92
|
}
|
|
93
93
|
if (document.addEventListener("selectionchange", h, { capture: !0 }), h(), document.activeElement === e && re(!0), !document.getElementById("input-otp-style")) {
|
|
94
|
-
let
|
|
95
|
-
if (
|
|
94
|
+
let i = document.createElement("style");
|
|
95
|
+
if (i.id = "input-otp-style", document.head.appendChild(i), i.sheet) {
|
|
96
96
|
let g = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
97
|
-
Q(
|
|
97
|
+
Q(i.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Q(i.sheet, `[data-input-otp]:autofill { ${g} }`), Q(i.sheet, `[data-input-otp]:-webkit-autofill { ${g} }`), Q(i.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), Q(i.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
let y = () => {
|
|
@@ -106,17 +106,17 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
106
106
|
document.removeEventListener("selectionchange", h, { capture: !0 }), S.disconnect();
|
|
107
107
|
};
|
|
108
108
|
}, []);
|
|
109
|
-
let [ue, ce] = n.useState(!1), [Z, re] = n.useState(!1), [
|
|
109
|
+
let [ue, ce] = n.useState(!1), [Z, re] = n.useState(!1), [_, J] = n.useState(null), [z, K] = n.useState(null);
|
|
110
110
|
n.useEffect(() => {
|
|
111
|
-
|
|
111
|
+
_e(() => {
|
|
112
112
|
var e, l, h, y;
|
|
113
113
|
(e = c.current) == null || e.dispatchEvent(new Event("input"));
|
|
114
|
-
let S = (l = c.current) == null ? void 0 : l.selectionStart,
|
|
115
|
-
S !== null &&
|
|
114
|
+
let S = (l = c.current) == null ? void 0 : l.selectionStart, i = (h = c.current) == null ? void 0 : h.selectionEnd, g = (y = c.current) == null ? void 0 : y.selectionDirection;
|
|
115
|
+
S !== null && i !== null && (J(S), K(i), X.current.prev = [S, i, g]);
|
|
116
116
|
});
|
|
117
|
-
}, [
|
|
118
|
-
E !== void 0 &&
|
|
119
|
-
}, [d,
|
|
117
|
+
}, [s, Z]), n.useEffect(() => {
|
|
118
|
+
E !== void 0 && s !== E && E.length < d && s.length === d && I?.(s);
|
|
119
|
+
}, [d, I, E, s]);
|
|
120
120
|
let G = ze({ containerRef: le, inputRef: c, pushPasswordManagerStrategy: x, isFocused: Z }), de = n.useCallback((e) => {
|
|
121
121
|
let l = e.currentTarget.value.slice(0, d);
|
|
122
122
|
if (l.length > 0 && C && !C.test(l)) {
|
|
@@ -135,14 +135,14 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
135
135
|
var l, h;
|
|
136
136
|
let y = c.current;
|
|
137
137
|
if (!f && (!ae.current.isIOS || !e.clipboardData || !y)) return;
|
|
138
|
-
let S = e.clipboardData.getData("text/plain"),
|
|
138
|
+
let S = e.clipboardData.getData("text/plain"), i = f ? f(S) : S;
|
|
139
139
|
e.preventDefault();
|
|
140
|
-
let g = (l = c.current) == null ? void 0 : l.selectionStart, Y = (h = c.current) == null ? void 0 : h.selectionEnd, j = (g !== Y ?
|
|
140
|
+
let g = (l = c.current) == null ? void 0 : l.selectionStart, Y = (h = c.current) == null ? void 0 : h.selectionEnd, j = (g !== Y ? s.slice(0, g) + i + s.slice(Y) : s.slice(0, g) + i + s.slice(g)).slice(0, d);
|
|
141
141
|
if (j.length > 0 && C && !C.test(j)) return;
|
|
142
142
|
y.value = j, q(j);
|
|
143
143
|
let F = Math.min(j.length, d - 1), R = j.length;
|
|
144
144
|
y.setSelectionRange(F, R), J(F), K(R);
|
|
145
|
-
}, [d, q, C,
|
|
145
|
+
}, [d, q, C, s]), je = n.useMemo(() => ({ position: "relative", cursor: o.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [o.disabled]), me = n.useMemo(() => ({ position: "absolute", inset: 0, width: G.willPushPWMBadge ? `calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: G.willPushPWMBadge ? `inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: D, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [G.PWM_BADGE_SPACE_WIDTH, G.willPushPWMBadge, D]), Pe = n.useMemo(() => n.createElement("input", Be(Ae({ autoComplete: o.autoComplete || "one-time-code" }, o), { "data-input-otp": !0, "data-input-otp-placeholder-shown": s.length === 0 || void 0, "data-input-otp-mss": _, "data-input-otp-mse": z, inputMode: B, pattern: C?.source, "aria-placeholder": O, style: me, maxLength: d, value: s, ref: c, onPaste: (e) => {
|
|
146
146
|
var l;
|
|
147
147
|
pe(e), (l = o.onPaste) == null || l.call(o, e);
|
|
148
148
|
}, onChange: de, onMouseOver: (e) => {
|
|
@@ -157,11 +157,11 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
157
157
|
}, onBlur: (e) => {
|
|
158
158
|
var l;
|
|
159
159
|
re(!1), (l = o.onBlur) == null || l.call(o, e);
|
|
160
|
-
} })), [de, fe, pe, B, me, d, z,
|
|
160
|
+
} })), [de, fe, pe, B, me, d, z, _, o, C?.source, s]), oe = n.useMemo(() => ({ slots: Array.from({ length: d }).map((e, l) => {
|
|
161
161
|
var h;
|
|
162
|
-
let y = Z &&
|
|
163
|
-
return { char: S, placeholderChar:
|
|
164
|
-
}), isFocused: Z, isHovering: !o.disabled && ue }), [Z, ue, d, z,
|
|
162
|
+
let y = Z && _ !== null && z !== null && (_ === z && l === _ || l >= _ && l < z), S = s[l] !== void 0 ? s[l] : null, i = s[0] !== void 0 ? null : (h = O?.[l]) != null ? h : null;
|
|
163
|
+
return { char: S, placeholderChar: i, isActive: y, hasFakeCaret: y && S === null };
|
|
164
|
+
}), isFocused: Z, isHovering: !o.disabled && ue }), [Z, ue, d, z, _, o.disabled, s]), Ce = n.useMemo(() => b ? b(oe) : n.createElement(Ge.Provider, { value: oe }, w), [w, oe, b]);
|
|
165
165
|
return n.createElement(n.Fragment, null, m !== null && n.createElement("noscript", null, n.createElement("style", null, m)), n.createElement("div", { ref: le, "data-input-otp-container": !0, style: je, className: v }, Ce, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Pe)));
|
|
166
166
|
});
|
|
167
167
|
Ee.displayName = "Input";
|
|
@@ -203,7 +203,7 @@ const qe = ({
|
|
|
203
203
|
disabled: k = !1,
|
|
204
204
|
className: O,
|
|
205
205
|
autoFocus: B = !1,
|
|
206
|
-
pasteTransformer:
|
|
206
|
+
pasteTransformer: I,
|
|
207
207
|
errorComponent: x,
|
|
208
208
|
hasError: f,
|
|
209
209
|
helperComponent: v,
|
|
@@ -239,16 +239,16 @@ const qe = ({
|
|
|
239
239
|
onBlur: M,
|
|
240
240
|
maxLength: d,
|
|
241
241
|
disabled: k,
|
|
242
|
-
pasteTransformer:
|
|
242
|
+
pasteTransformer: I,
|
|
243
243
|
spellCheck: !1,
|
|
244
244
|
containerClassName: $("group flex items-center has-[:disabled]:opacity-30 w-max justify-center", O),
|
|
245
245
|
render: ({ slots: T }) => {
|
|
246
246
|
const V = Math.floor(T.length / 2), te = T.slice(0, V), ne = T.slice(V);
|
|
247
247
|
return /* @__PURE__ */ p.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
248
248
|
/* @__PURE__ */ p.jsxs("div", { className: "flex items-center", children: [
|
|
249
|
-
/* @__PURE__ */ p.jsx("div", { className: "flex", children: te.map((
|
|
249
|
+
/* @__PURE__ */ p.jsx("div", { className: "flex", children: te.map((s, E) => /* @__PURE__ */ p.jsx(ie, { ...s, placeholder: D, hasError: f, className: b, variant: w }, E)) }),
|
|
250
250
|
/* @__PURE__ */ p.jsx("hr", { className: $("w-2 h-1 mx-2 border-neutral-default-default", o && "hidden") }),
|
|
251
|
-
/* @__PURE__ */ p.jsx("div", { className: "flex", children: ne.map((
|
|
251
|
+
/* @__PURE__ */ p.jsx("div", { className: "flex", children: ne.map((s, E) => /* @__PURE__ */ p.jsx(ie, { ...s, placeholder: D, hasError: f, variant: w, className: b }, E)) })
|
|
252
252
|
] }),
|
|
253
253
|
f && x && (typeof x == "string" ? /* @__PURE__ */ p.jsxs("span", { className: $("text-error-default-default text-xs mt-1 flex items-center gap-1", P, N.error.text), children: [
|
|
254
254
|
N.error.icon,
|
|
@@ -294,8 +294,8 @@ const Ze = (t) => {
|
|
|
294
294
|
]
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
},
|
|
298
|
-
|
|
297
|
+
}, ie = De(Ze);
|
|
298
|
+
ie.displayName = "Slot";
|
|
299
299
|
export {
|
|
300
300
|
qe as default
|
|
301
301
|
};
|
package/dist/RadioButton.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { c as t } from "./cn-B6yFEsav.js";
|
|
3
3
|
import { memo as x, forwardRef as k, useRef as g, useEffect as y } from "react";
|
|
4
|
-
import { H as j } from "./HelperComponent-
|
|
4
|
+
import { H as j } from "./HelperComponent-CcGxM09g.js";
|
|
5
5
|
const s = k((n, a) => {
|
|
6
6
|
const r = g(null);
|
|
7
7
|
y(() => {
|