prometeo-design-system 2.7.9 → 2.8.2
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/Button.es.js +5 -5
- package/dist/{CardProfile-DV3gwvqE.js → CardProfile-WHoeSibd.js} +24 -24
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +4 -4
- package/dist/DatePicker.es.js +68 -68
- package/dist/DrawerDesktop.es.js +4 -4
- package/dist/DropZone.es.js +32 -32
- package/dist/FAButton.es.js +2 -2
- package/dist/HelperComponent-BeNlTMqI.js +24 -0
- package/dist/Icons/Icons.d.ts +61 -1
- package/dist/Icons.es.js +572 -410
- package/dist/{ImageGallery-D8nIvBpV.js → ImageGallery-WKzUevOQ.js} +43 -43
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-60IT1aGF.js → Input-Bdiozi8s.js} +68 -82
- package/dist/Input.es.js +1 -1
- package/dist/InputMultiple.es.js +51 -51
- package/dist/Logo.es.js +3 -3
- package/dist/Menu.es.js +2 -2
- package/dist/OtpInput.es.js +42 -42
- package/dist/Pagination.es.js +1 -1
- package/dist/RadioButton.es.js +1 -1
- package/dist/{Select-C4UvSsof.js → Select-DpnghyhT.js} +164 -164
- package/dist/Select.es.js +1 -1
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Steps.es.js +14 -14
- package/dist/TabLinks.es.js +2 -2
- package/dist/Table.es.js +2 -2
- package/dist/Toast.es.js +23 -23
- package/dist/Tooltip.es.js +7 -7
- package/dist/components/Spinner/SpinnerV2.d.ts +12 -0
- package/dist/components/Toaster/Toaster.d.ts +3 -3
- package/dist/exports/Icons.d.ts +1 -1
- package/dist/index.d.ts +0 -12
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +111 -122
- package/package.json +2 -27
- package/dist/CheckboxFormik.d.ts +0 -6
- package/dist/CheckboxFormik.es.js +0 -88
- package/dist/HelperComponent-U6mPwuDH.js +0 -24
- package/dist/InputFormik.d.ts +0 -6
- package/dist/InputFormik.es.js +0 -213
- package/dist/InputFormikV2.d.ts +0 -6
- package/dist/InputFormikV2.es.js +0 -41
- package/dist/RadioButtonFormik.d.ts +0 -2
- package/dist/RadioButtonFormik.es.js +0 -30
- package/dist/SelectFormik.d.ts +0 -6
- package/dist/SelectFormik.es.js +0 -62
- package/dist/SelectFormikLegacy.d.ts +0 -6
- package/dist/SelectFormikLegacy.es.js +0 -194
- package/dist/components/CheckboxFormik/CheckboxFormik.d.ts +0 -12
- package/dist/components/InputFormik/InputFormik.d.ts +0 -23
- package/dist/components/InputFormik/InputFormikV2.d.ts +0 -6
- package/dist/components/RadioButtonFormik/RadioButtonFormik.d.ts +0 -8
- package/dist/components/SelectFormik/SelectFormik.d.ts +0 -8
- package/dist/components/SelectFormik/SelectFormikLegacy.d.ts +0 -21
- package/dist/exports/CheckboxFormik.d.ts +0 -2
- package/dist/exports/InputFormik.d.ts +0 -2
- package/dist/exports/InputFormikV2.d.ts +0 -2
- package/dist/exports/RadioButtonFormik.d.ts +0 -1
- package/dist/exports/SelectFormik.d.ts +0 -2
- package/dist/exports/SelectFormikLegacy.d.ts +0 -2
- package/dist/pages/Autocomplete.page.d.ts +0 -2
- package/dist/pages/ButtonsPage.d.ts +0 -2
- package/dist/pages/DatePicker.d.ts +0 -2
- package/dist/pages/DialogPage.d.ts +0 -2
- package/dist/pages/DrawersPage.d.ts +0 -2
- package/dist/pages/ImagesPage.d.ts +0 -2
- package/dist/pages/OtpPage.d.ts +0 -2
- package/dist/pages/RecurrentDatePicker.page.d.ts +0 -2
- package/dist/pages/SelectsPage.d.ts +0 -2
- package/dist/pages/Skeletons.d.ts +0 -2
- package/dist/pages/ToastsPage.d.ts +0 -2
- package/dist/preview/AutocompletePreview.d.ts +0 -2
- package/dist/preview/ButtonPreview.d.ts +0 -2
- package/dist/preview/DialogModalPreview.d.ts +0 -2
- package/dist/preview/DrawerMobilePreview.d.ts +0 -2
- package/dist/preview/Dropzone.d.ts +0 -2
- package/dist/preview/FABPreview.d.ts +0 -2
- package/dist/preview/IconsPreview.d.ts +0 -2
- package/dist/preview/ImagePreview.d.ts +0 -2
- package/dist/preview/InputsPreviews.d.ts +0 -2
- package/dist/preview/Layout.d.ts +0 -2
- package/dist/preview/OTPPreview.d.ts +0 -2
- package/dist/preview/RadioButtonPreview.d.ts +0 -2
- package/dist/preview/RecurrentDatePickerPreview.d.ts +0 -2
- package/dist/preview/SegmentedButtonPreview.d.ts +0 -2
- package/dist/preview/SelectPreview/CustomFooterExample.d.ts +0 -2
- package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +0 -2
- package/dist/preview/SelectPreview/SelectPreview.d.ts +0 -2
- package/dist/preview/SidebarPreview.d.ts +0 -2
- package/dist/preview/StepsPreview.d.ts +0 -2
- package/dist/preview/SwitchPreview.d.ts +0 -2
- package/dist/preview/TabLinks.d.ts +0 -2
- package/dist/preview/TablePreview.d.ts +0 -2
- package/dist/preview/TextArea.d.ts +0 -2
- package/dist/preview/ToastsPreview.d.ts +0 -2
package/dist/InputMultiple.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Close as Z, Info as T, Error as ee } from "./Icons.es.js";
|
|
3
3
|
import { c as d } from "./cn-B6yFEsav.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
const o =
|
|
4
|
+
import M, { useRef as _, useState as x, useCallback as te, useEffect as re } from "react";
|
|
5
|
+
const se = ({ label: S, name: D, onChange: f, value: l, icon: C, valueSeparator: w = ",", variant: I = "default", placeholder: K, itemClassName: U, itemIcon: V, helperText: j, errorText: N, disabled: a, onClick: F, className: $, readonly: h, onValueDelete: B, ...O }) => {
|
|
6
|
+
const o = _(null), E = _(null), [u, n] = x(""), [z, i] = x(0), [q, c] = x(!0), [v, P] = x(!1), [m, p] = x(!1), [k, y] = x(null), g = (e) => {
|
|
7
7
|
if (h || !e) return;
|
|
8
8
|
const t = e.selectionStart ?? u.length;
|
|
9
9
|
i(t);
|
|
10
|
-
},
|
|
10
|
+
}, A = (e) => {
|
|
11
11
|
if (h) return;
|
|
12
12
|
if (e.target.value[e.target.value.length - 1] === w && u.length > 0) {
|
|
13
13
|
const s = u.trim();
|
|
@@ -25,17 +25,17 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
25
25
|
n(e.target.value), c(!1);
|
|
26
26
|
}
|
|
27
27
|
g(e.target);
|
|
28
|
-
}, b =
|
|
28
|
+
}, b = te(() => {
|
|
29
29
|
const e = u.trim();
|
|
30
30
|
if (e.length === 0) {
|
|
31
|
-
p(!1), n(""), c(!0), i(0),
|
|
31
|
+
p(!1), n(""), c(!0), i(0), y(null);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
p(!1), k !== null && f(
|
|
35
|
-
}, [k, u, f, l]),
|
|
34
|
+
p(!1), k !== null && f(Q(l.map((t, s) => s === k ? e : t))), n(""), c(!0), i(0), y(null);
|
|
35
|
+
}, [k, u, f, l]), G = (e) => {
|
|
36
36
|
if (!h) {
|
|
37
37
|
if (e.key === "Backspace" && u.length === 0) {
|
|
38
|
-
if (
|
|
38
|
+
if (q) {
|
|
39
39
|
const t = l[l.length - 1];
|
|
40
40
|
t && (f(l.filter((s) => s !== t)), n(t), i(t.length));
|
|
41
41
|
} else
|
|
@@ -50,27 +50,27 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
50
50
|
}
|
|
51
51
|
t.length > 0 && !l.includes(t) && t !== w && (f([...l, t]), n(""), c(!0), i(0));
|
|
52
52
|
}
|
|
53
|
-
e.key === "Escape" && m && (p(!1), n(""), c(!0), i(0),
|
|
53
|
+
e.key === "Escape" && m && (p(!1), n(""), c(!0), i(0), y(null)), g(e.currentTarget);
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, H = (e) => {
|
|
56
56
|
const t = l.filter((s) => s !== e);
|
|
57
|
-
f(t),
|
|
57
|
+
f(t), B?.(e);
|
|
58
|
+
}, J = (e) => {
|
|
59
|
+
h || (L(e), p(!0), n(e), i(e.length), y(l.length - 1), o.current?.focus());
|
|
58
60
|
}, L = (e) => {
|
|
59
|
-
h || (Q(e), p(!0), n(e), i(e.length), I(l.length - 1), o.current?.focus());
|
|
60
|
-
}, Q = (e) => {
|
|
61
61
|
const t = l.filter((s) => s !== e);
|
|
62
62
|
f([...t, e]);
|
|
63
|
-
},
|
|
64
|
-
|
|
63
|
+
}, Q = (e) => e.filter((t, s, Y) => Y.indexOf(t) === s);
|
|
64
|
+
re(() => {
|
|
65
65
|
o.current && (o.current.onfocus = () => {
|
|
66
|
-
|
|
66
|
+
P(!0);
|
|
67
67
|
}, o.current.onblur = () => {
|
|
68
|
-
|
|
68
|
+
P(!1), m && b();
|
|
69
69
|
}), E.current && (E.current.onblur = () => {
|
|
70
70
|
m && b();
|
|
71
71
|
});
|
|
72
72
|
}, [m, b]);
|
|
73
|
-
const
|
|
73
|
+
const W = {
|
|
74
74
|
isFocused: {
|
|
75
75
|
error: "border-error-default-focused ring-error-default-focused",
|
|
76
76
|
success: "border-success-default-focused ring-success-default-focused",
|
|
@@ -89,7 +89,7 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
89
89
|
warning: "border-warning-default-disabled",
|
|
90
90
|
default: "border-neutral-default-disabled"
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, X = {
|
|
93
93
|
default: {
|
|
94
94
|
default: "text-neutral-default-default",
|
|
95
95
|
isFocused: "text-neutral-default-focused",
|
|
@@ -110,27 +110,27 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
110
110
|
isFocused: "text-warning-default-focused",
|
|
111
111
|
disabled: "text-warning-default-disabled"
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, R = a ? "disabled" : v ? "isFocused" : "default";
|
|
114
114
|
return /* @__PURE__ */ r.jsxs("div", { className: d(
|
|
115
115
|
"relative w-full",
|
|
116
|
-
|
|
116
|
+
$
|
|
117
117
|
), children: [
|
|
118
118
|
/* @__PURE__ */ r.jsx("p", { className: d(
|
|
119
119
|
"mb-1 px-3",
|
|
120
120
|
"prometeo-fonts-label-large",
|
|
121
|
-
|
|
122
|
-
), children:
|
|
121
|
+
X?.[I || "default"]?.[R]
|
|
122
|
+
), children: S }),
|
|
123
123
|
/* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
|
|
124
124
|
/* @__PURE__ */ r.jsx(
|
|
125
125
|
"input",
|
|
126
126
|
{
|
|
127
127
|
ref: o,
|
|
128
128
|
value: u,
|
|
129
|
-
onKeyUp:
|
|
130
|
-
onChange:
|
|
129
|
+
onKeyUp: G,
|
|
130
|
+
onChange: A,
|
|
131
131
|
onClick: (e) => g(e.currentTarget),
|
|
132
132
|
onSelect: (e) => g(e.currentTarget),
|
|
133
|
-
name:
|
|
133
|
+
name: D,
|
|
134
134
|
disabled: a,
|
|
135
135
|
className: d(
|
|
136
136
|
"absolute inset-0 w-full h-full",
|
|
@@ -143,7 +143,7 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
143
143
|
autoCapitalize: "off",
|
|
144
144
|
spellCheck: "false",
|
|
145
145
|
inputMode: "text",
|
|
146
|
-
...
|
|
146
|
+
...O
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
149
|
/* @__PURE__ */ r.jsxs(
|
|
@@ -151,42 +151,42 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
151
151
|
{
|
|
152
152
|
ref: E,
|
|
153
153
|
className: d(
|
|
154
|
-
"border
|
|
154
|
+
"border border-neutral-default-default rounded-md p-3",
|
|
155
155
|
"flex flex-wrap gap-1 min-h-[58px]",
|
|
156
156
|
"transition-all duration-300 ease-in-out",
|
|
157
157
|
"cursor-text",
|
|
158
|
-
|
|
158
|
+
W[R][I],
|
|
159
159
|
v ? "ring-[1px]" : "",
|
|
160
160
|
// 'hover:border-primary-default-hover',
|
|
161
161
|
a && "hover:border-neutral-default-disabled"
|
|
162
162
|
),
|
|
163
163
|
onMouseDown: (e) => {
|
|
164
|
-
e.stopPropagation(),
|
|
164
|
+
e.stopPropagation(), F?.(e), o.current?.focus();
|
|
165
165
|
const t = u.length;
|
|
166
166
|
o.current && (o.current.selectionStart = t, o.current.selectionEnd = t), i(t);
|
|
167
167
|
},
|
|
168
168
|
onClick: (e) => {
|
|
169
|
-
e.stopPropagation(), o.current?.focus(),
|
|
169
|
+
e.stopPropagation(), o.current?.focus(), F?.(e);
|
|
170
170
|
},
|
|
171
171
|
children: [
|
|
172
|
-
|
|
172
|
+
C && /* @__PURE__ */ r.jsx("div", { className: d(
|
|
173
173
|
"flex items-center text-neutral-default-default",
|
|
174
174
|
a && "text-neutral-default-disabled"
|
|
175
|
-
), children:
|
|
175
|
+
), children: C }),
|
|
176
176
|
l.map((e, t) => /* @__PURE__ */ r.jsxs(
|
|
177
177
|
"div",
|
|
178
178
|
{
|
|
179
179
|
className: d(
|
|
180
|
-
"h-8 max-h-8 rounded-lg bg-primary-light-default border
|
|
180
|
+
"h-8 max-h-8 rounded-lg bg-primary-light-default border border-neutral-default-default",
|
|
181
181
|
"flex items-center gap-2 px-2",
|
|
182
182
|
"prometeo-fonts-label-medium z-20",
|
|
183
183
|
t === l.length - 1 && m ? "opacity-0 hidden overflow-hidden" : "",
|
|
184
184
|
a && "border-neutral-default-disabled text-neutral-default-disabled",
|
|
185
|
-
|
|
185
|
+
U
|
|
186
186
|
),
|
|
187
187
|
children: [
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
V && /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: M.createElement(
|
|
189
|
+
V,
|
|
190
190
|
{
|
|
191
191
|
size: 16,
|
|
192
192
|
className: d(
|
|
@@ -199,7 +199,7 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
199
199
|
"span",
|
|
200
200
|
{
|
|
201
201
|
onClick: (s) => {
|
|
202
|
-
s.stopPropagation(), !a &&
|
|
202
|
+
s.stopPropagation(), !a && J(e);
|
|
203
203
|
},
|
|
204
204
|
className: d(
|
|
205
205
|
"cursor-pointer hover:text-neutral-default-hover",
|
|
@@ -212,14 +212,14 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
212
212
|
"div",
|
|
213
213
|
{
|
|
214
214
|
onClick: (s) => {
|
|
215
|
-
s.stopPropagation(), !a &&
|
|
215
|
+
s.stopPropagation(), !a && H(e);
|
|
216
216
|
},
|
|
217
217
|
className: d(
|
|
218
218
|
"cursor-pointer hover:scale-105 transition-all duration-200 ",
|
|
219
219
|
a && " cursor-default hover:scale-100 "
|
|
220
220
|
),
|
|
221
221
|
children: /* @__PURE__ */ r.jsx(
|
|
222
|
-
|
|
222
|
+
Z,
|
|
223
223
|
{
|
|
224
224
|
size: 16,
|
|
225
225
|
className: d(
|
|
@@ -235,28 +235,28 @@ const te = ({ label: D, name: K, onChange: f, value: l, icon: V, valueSeparator:
|
|
|
235
235
|
e
|
|
236
236
|
)),
|
|
237
237
|
v && !h && /* @__PURE__ */ r.jsxs("div", { className: "flex items-center min-w-[2px]", children: [
|
|
238
|
-
/* @__PURE__ */ r.jsx("span", { className: "text-neutral-default-default whitespace-pre-wrap break-
|
|
239
|
-
/* @__PURE__ */ r.jsx("span", { className: "animate-[cursor-intermitent_1s_ease-in-out_infinite] bg-neutral-default-pressed w-[2px] h-5 inline-block align-middle mx-
|
|
240
|
-
/* @__PURE__ */ r.jsx("span", { className: "text-neutral-default-default whitespace-pre-wrap break-
|
|
238
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-neutral-default-default whitespace-pre-wrap wrap-break-word", children: u.slice(0, z) }),
|
|
239
|
+
/* @__PURE__ */ r.jsx("span", { className: "animate-[cursor-intermitent_1s_ease-in-out_infinite] bg-neutral-default-pressed w-[2px] h-5 inline-block align-middle mx-px z-20" }),
|
|
240
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-neutral-default-default whitespace-pre-wrap wrap-break-word", children: u.slice(z) })
|
|
241
241
|
] }),
|
|
242
242
|
l.length === 0 && !v && /* @__PURE__ */ r.jsx("span", { className: d(
|
|
243
243
|
"text-neutral-medium-default self-center",
|
|
244
244
|
a && "text-neutral-default-disabled"
|
|
245
|
-
), children:
|
|
245
|
+
), children: K || `Escribe los valores separados por ${w}` })
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
)
|
|
249
249
|
] }),
|
|
250
|
-
j &&
|
|
251
|
-
/* @__PURE__ */ r.jsx(
|
|
250
|
+
j && I !== "error" && !a && (typeof j == "string" ? /* @__PURE__ */ r.jsxs("div", { className: "prometeo-fonts-body-small text-neutral-medium-default ml-3 mt-1 flex items-center gap-1", children: [
|
|
251
|
+
/* @__PURE__ */ r.jsx(T, { size: 16, className: "text-neutral-medium-default" }),
|
|
252
252
|
j
|
|
253
253
|
] }) : /* @__PURE__ */ r.jsx("div", { className: "ml-3", children: j })),
|
|
254
254
|
N && typeof N == "string" && !a ? /* @__PURE__ */ r.jsxs("div", { className: "prometeo-fonts-body-small text-error-default-default ml-3 mt-1 flex items-center gap-1", children: [
|
|
255
|
-
/* @__PURE__ */ r.jsx(
|
|
255
|
+
/* @__PURE__ */ r.jsx(ee, { size: 16, className: "text-error-default-default" }),
|
|
256
256
|
N
|
|
257
257
|
] }) : N
|
|
258
258
|
] });
|
|
259
|
-
},
|
|
259
|
+
}, de = M.memo(se);
|
|
260
260
|
export {
|
|
261
|
-
|
|
261
|
+
de as InputMultiple
|
|
262
262
|
};
|
package/dist/Logo.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
3
|
-
const s = () => /* @__PURE__ */ e.jsxs("div", { className: "container-logo flex items-center justify-center gap-1 bg-
|
|
4
|
-
/* @__PURE__ */ e.jsx(t
|
|
2
|
+
import { TicketFilled as t } from "./Icons.es.js";
|
|
3
|
+
const s = () => /* @__PURE__ */ e.jsxs("div", { className: "container-logo flex items-center justify-center gap-1 bg-linear-to-br from-[#312C85] to-[#1E1A4D] rounded-md min-w-[185px]", children: [
|
|
4
|
+
/* @__PURE__ */ e.jsx(t, { size: 28, className: "rotate-140 text-primary-medium-pressed icon-logo" }),
|
|
5
5
|
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-[28px] text-primary-medium-pressed font-monserra -tracking-wide text-logo", children: "TICKETS" })
|
|
6
6
|
] });
|
|
7
7
|
export {
|
package/dist/Menu.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
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
|
|
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 border-neutral-strong-default h-auto w-60 rounded-md px-2", i), children: /* @__PURE__ */ e.jsx(n, { mode: "wait", children: /* @__PURE__ */ e.jsx(
|
|
5
5
|
o.div,
|
|
6
6
|
{
|
|
7
7
|
initial: { height: 0, opacity: 0 },
|
|
@@ -42,7 +42,7 @@ const s = ({ menuRef: t, children: a, className: i }) => /* @__PURE__ */ e.jsx("
|
|
|
42
42
|
ease: "easeInOut"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border
|
|
45
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
|
|
46
46
|
}
|
|
47
47
|
), d = ({ onClick: t, children: a, className: i }) => /* @__PURE__ */ e.jsx(
|
|
48
48
|
o.button,
|
package/dist/OtpInput.es.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Check as Re, Error as De } from "./Icons.es.js";
|
|
3
3
|
import { c as $ } from "./cn-B6yFEsav.js";
|
|
4
4
|
import * as n from "react";
|
|
5
|
-
import
|
|
6
|
-
var
|
|
7
|
-
for (var r in a || (a = {}))
|
|
8
|
-
if (ee) for (var r of ee(a))
|
|
5
|
+
import ge, { memo as Oe } from "react";
|
|
6
|
+
var Te = Object.defineProperty, We = Object.defineProperties, Ae = Object.getOwnPropertyDescriptors, ee = Object.getOwnPropertySymbols, be = Object.prototype.hasOwnProperty, we = Object.prototype.propertyIsEnumerable, xe = (t, a, r) => a in t ? Te(t, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[a] = r, Be = (t, a) => {
|
|
7
|
+
for (var r in a || (a = {})) be.call(a, r) && xe(t, r, a[r]);
|
|
8
|
+
if (ee) for (var r of ee(a)) we.call(a, r) && xe(t, r, a[r]);
|
|
9
9
|
return t;
|
|
10
|
-
},
|
|
10
|
+
}, _e = (t, a) => We(t, Ae(a)), Ie = (t, a) => {
|
|
11
11
|
var r = {};
|
|
12
|
-
for (var u in t)
|
|
13
|
-
if (t != null && ee) for (var u of ee(t)) a.indexOf(u) < 0 &&
|
|
12
|
+
for (var u in t) be.call(t, u) && a.indexOf(u) < 0 && (r[u] = t[u]);
|
|
13
|
+
if (t != null && ee) for (var u of ee(t)) a.indexOf(u) < 0 && we.call(t, u) && (r[u] = t[u]);
|
|
14
14
|
return r;
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Fe(t) {
|
|
17
17
|
let a = setTimeout(t, 0), r = setTimeout(t, 10), u = setTimeout(t, 50);
|
|
18
18
|
return [a, r, u];
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function He(t) {
|
|
21
21
|
let a = n.useRef();
|
|
22
22
|
return n.useEffect(() => {
|
|
23
23
|
a.current = t;
|
|
24
24
|
}), a.current;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
function
|
|
26
|
+
var Le = 18, ye = 40, $e = `${ye}px`, ze = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
27
|
+
function Ge({ containerRef: t, inputRef: a, pushPasswordManagerStrategy: r, isFocused: u }) {
|
|
28
28
|
let [M, d] = n.useState(!1), [D, k] = n.useState(!1), [O, B] = n.useState(!1), _ = 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
|
-
let m = f, b = m.getBoundingClientRect().left + m.offsetWidth, w = m.getBoundingClientRect().top + m.offsetHeight / 2, o = b -
|
|
32
|
-
document.querySelectorAll(
|
|
31
|
+
let m = f, b = m.getBoundingClientRect().left + m.offsetWidth, w = m.getBoundingClientRect().top + m.offsetHeight / 2, o = b - Le, P = w;
|
|
32
|
+
document.querySelectorAll(ze).length === 0 && document.elementFromPoint(o, P) === f || (d(!0), B(!0));
|
|
33
33
|
}, [t, a, O, r]);
|
|
34
34
|
return n.useEffect(() => {
|
|
35
35
|
let f = t.current;
|
|
36
36
|
if (!f || r === "none") return;
|
|
37
37
|
function v() {
|
|
38
38
|
let b = window.innerWidth - f.getBoundingClientRect().right;
|
|
39
|
-
k(b >=
|
|
39
|
+
k(b >= ye);
|
|
40
40
|
}
|
|
41
41
|
v();
|
|
42
42
|
let m = setInterval(v, 1e3);
|
|
@@ -52,11 +52,11 @@ 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: _, PWM_BADGE_SPACE_WIDTH:
|
|
55
|
+
}, [a, u, r, x]), { hasPWMBadge: M, willPushPWMBadge: _, PWM_BADGE_SPACE_WIDTH: $e };
|
|
56
56
|
}
|
|
57
|
-
var
|
|
58
|
-
var r = t, { value: u, onChange: M, maxLength: d, textAlign: D = "left", pattern: k, placeholder: O, inputMode: B = "numeric", onComplete: _, pushPasswordManagerStrategy: x = "increase-width", pasteTransformer: f, containerClassName: v, noScriptCSSFallback: m =
|
|
59
|
-
let [te, ne] = n.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""), i = u ?? te, E =
|
|
57
|
+
var Ve = n.createContext({}), Se = 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: _, pushPasswordManagerStrategy: x = "increase-width", pasteTransformer: f, containerClassName: v, noScriptCSSFallback: m = qe, 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 : ""), i = u ?? te, E = He(i), q = n.useCallback((e) => {
|
|
60
60
|
M?.(e), ne(e);
|
|
61
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: i, 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(() => {
|
|
@@ -70,8 +70,8 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
70
70
|
}
|
|
71
71
|
let s = e.selectionStart, g = e.selectionEnd, Y = e.selectionDirection, j = e.maxLength, F = e.value, R = X.current.prev, W = -1, A = -1, H;
|
|
72
72
|
if (F.length !== 0 && s !== null && g !== null) {
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
73
|
+
let Me = s === g, ke = s === F.length && F.length < j;
|
|
74
|
+
if (Me && !ke) {
|
|
75
75
|
let L = s;
|
|
76
76
|
if (L === 0) W = 0, A = 1, H = "forward";
|
|
77
77
|
else if (L === j) W = L - 1, A = L, H = "backward";
|
|
@@ -79,16 +79,16 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
79
79
|
let ie = 0;
|
|
80
80
|
if (R[0] !== null && R[1] !== null) {
|
|
81
81
|
H = L < R[1] ? "backward" : "forward";
|
|
82
|
-
let
|
|
83
|
-
H === "backward" && !
|
|
82
|
+
let Ne = R[0] === R[1] && R[0] < j;
|
|
83
|
+
H === "backward" && !Ne && (ie = -1);
|
|
84
84
|
}
|
|
85
85
|
W = ie + L, A = ie + 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 : s, ve = A !== -1 ? A : g,
|
|
91
|
-
J(he), K(ve), X.current.prev = [he, ve,
|
|
90
|
+
let he = W !== -1 ? W : s, ve = A !== -1 ? A : g, Ce = H ?? Y;
|
|
91
|
+
J(he), K(ve), X.current.prev = [he, ve, Ce];
|
|
92
92
|
}
|
|
93
93
|
if (document.addEventListener("selectionchange", h, { capture: !0 }), h(), document.activeElement === e && re(!0), !document.getElementById("input-otp-style")) {
|
|
94
94
|
let s = document.createElement("style");
|
|
@@ -108,7 +108,7 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
108
108
|
}, []);
|
|
109
109
|
let [ue, ce] = n.useState(!1), [Z, re] = n.useState(!1), [I, J] = n.useState(null), [z, K] = n.useState(null);
|
|
110
110
|
n.useEffect(() => {
|
|
111
|
-
|
|
111
|
+
Fe(() => {
|
|
112
112
|
var e, l, h, y;
|
|
113
113
|
(e = c.current) == null || e.dispatchEvent(new Event("input"));
|
|
114
114
|
let S = (l = c.current) == null ? void 0 : l.selectionStart, s = (h = c.current) == null ? void 0 : h.selectionEnd, g = (y = c.current) == null ? void 0 : y.selectionDirection;
|
|
@@ -117,7 +117,7 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
117
117
|
}, [i, Z]), n.useEffect(() => {
|
|
118
118
|
E !== void 0 && i !== E && E.length < d && i.length === d && _?.(i);
|
|
119
119
|
}, [d, _, E, i]);
|
|
120
|
-
let G =
|
|
120
|
+
let G = Ge({ 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)) {
|
|
123
123
|
e.preventDefault();
|
|
@@ -142,7 +142,7 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
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, i]),
|
|
145
|
+
}, [d, q, C, i]), Ee = 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]), je = n.useMemo(() => n.createElement("input", _e(Be({ autoComplete: o.autoComplete || "one-time-code" }, o), { "data-input-otp": !0, "data-input-otp-placeholder-shown": i.length === 0 || void 0, "data-input-otp-mss": I, "data-input-otp-mse": z, inputMode: B, pattern: C?.source, "aria-placeholder": O, style: me, maxLength: d, value: i, 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) => {
|
|
@@ -161,10 +161,10 @@ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
|
|
|
161
161
|
var h;
|
|
162
162
|
let y = Z && I !== null && z !== null && (I === z && l === I || l >= I && l < z), S = i[l] !== void 0 ? i[l] : null, s = i[0] !== void 0 ? null : (h = O?.[l]) != null ? h : null;
|
|
163
163
|
return { char: S, placeholderChar: s, isActive: y, hasFakeCaret: y && S === null };
|
|
164
|
-
}), isFocused: Z, isHovering: !o.disabled && ue }), [Z, ue, d, z, I, o.disabled, i]),
|
|
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:
|
|
164
|
+
}), isFocused: Z, isHovering: !o.disabled && ue }), [Z, ue, d, z, I, o.disabled, i]), Pe = n.useMemo(() => b ? b(oe) : n.createElement(Ve.Provider, { value: oe }, w), [w, oe, b]);
|
|
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: Ee, className: v }, Pe, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, je)));
|
|
166
166
|
});
|
|
167
|
-
|
|
167
|
+
Se.displayName = "Input";
|
|
168
168
|
function Q(t, a) {
|
|
169
169
|
try {
|
|
170
170
|
t.insertRule(a);
|
|
@@ -172,7 +172,7 @@ function Q(t, a) {
|
|
|
172
172
|
console.error("input-otp could not insert CSS rule:", a);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var qe = `
|
|
176
176
|
[data-input-otp] {
|
|
177
177
|
--nojs-bg: white !important;
|
|
178
178
|
--nojs-fg: black !important;
|
|
@@ -192,7 +192,7 @@ var Ve = `
|
|
|
192
192
|
--nojs-fg: white !important;
|
|
193
193
|
}
|
|
194
194
|
}`;
|
|
195
|
-
const
|
|
195
|
+
const Ze = ({
|
|
196
196
|
value: t = "",
|
|
197
197
|
name: a,
|
|
198
198
|
onChange: r,
|
|
@@ -219,17 +219,17 @@ const qe = ({
|
|
|
219
219
|
},
|
|
220
220
|
error: {
|
|
221
221
|
text: "text-error-default-default",
|
|
222
|
-
icon: /* @__PURE__ */ p.jsx(
|
|
222
|
+
icon: /* @__PURE__ */ p.jsx(De, { size: 18, className: "text-error-default-default" })
|
|
223
223
|
},
|
|
224
224
|
success: {
|
|
225
225
|
text: "text-success-default-default",
|
|
226
|
-
icon: /* @__PURE__ */ p.jsx(
|
|
226
|
+
icon: /* @__PURE__ */ p.jsx(Re, { size: 18, className: "text-success-default-default" })
|
|
227
227
|
}
|
|
228
228
|
}, U = (T) => {
|
|
229
229
|
r?.(T, a);
|
|
230
230
|
};
|
|
231
231
|
return /* @__PURE__ */ p.jsx(
|
|
232
|
-
|
|
232
|
+
Se,
|
|
233
233
|
{
|
|
234
234
|
value: t,
|
|
235
235
|
name: a,
|
|
@@ -253,7 +253,7 @@ const qe = ({
|
|
|
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,
|
|
255
255
|
x
|
|
256
|
-
] }) :
|
|
256
|
+
] }) : ge.cloneElement(x, { className: $(
|
|
257
257
|
"text-error-default-default text-xs mt-1",
|
|
258
258
|
P,
|
|
259
259
|
N.error.text,
|
|
@@ -262,14 +262,14 @@ const qe = ({
|
|
|
262
262
|
v && m && (typeof v == "string" ? /* @__PURE__ */ p.jsxs("span", { className: $("text-neutral-medium-default text-xs mt-1 flex items-center gap-1", N[w].text, P), children: [
|
|
263
263
|
N[w].icon,
|
|
264
264
|
v
|
|
265
|
-
] }) :
|
|
265
|
+
] }) : ge.cloneElement(v, { className: $("text-neutral-medium-default text-xs mt-1", P, N[w].text, v?.props?.className) }))
|
|
266
266
|
] });
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
270
|
};
|
|
271
|
-
|
|
272
|
-
const
|
|
271
|
+
Ze.displayName = "OtpInput";
|
|
272
|
+
const Je = (t) => {
|
|
273
273
|
const a = {
|
|
274
274
|
default: "border-neutral-default-default",
|
|
275
275
|
error: "border-error-default-default",
|
|
@@ -294,8 +294,8 @@ const Ze = (t) => {
|
|
|
294
294
|
]
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
}, se =
|
|
297
|
+
}, se = Oe(Je);
|
|
298
298
|
se.displayName = "Slot";
|
|
299
299
|
export {
|
|
300
|
-
|
|
300
|
+
Ze as default
|
|
301
301
|
};
|
package/dist/Pagination.es.js
CHANGED
|
@@ -64,7 +64,7 @@ function h({
|
|
|
64
64
|
a.div,
|
|
65
65
|
{
|
|
66
66
|
layoutId: "activePage",
|
|
67
|
-
className: "absolute inset-0 border
|
|
67
|
+
className: "absolute inset-0 border border-primary-default-default rounded-md",
|
|
68
68
|
initial: !1,
|
|
69
69
|
transition: {
|
|
70
70
|
type: "spring",
|
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-BeNlTMqI.js";
|
|
5
5
|
const s = k((n, a) => {
|
|
6
6
|
const r = g(null);
|
|
7
7
|
y(() => {
|