@klu_dev/ui-klu-green 1.2.5 → 1.2.7
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/README.md +86 -1
- package/dist/index.css +102 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +258 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -20,6 +20,11 @@ npm install @klu_dev/ui-klu-green
|
|
|
20
20
|
- BalanceInfo
|
|
21
21
|
- Toast
|
|
22
22
|
- LoaderScreen
|
|
23
|
+
- PromoBanner
|
|
24
|
+
- SidebarTabs
|
|
25
|
+
- MobileMenuDrawer
|
|
26
|
+
- SearchSelect
|
|
27
|
+
- InputCode
|
|
23
28
|
|
|
24
29
|
## Antes de comenzar a agregar componentes
|
|
25
30
|
|
|
@@ -724,7 +729,6 @@ export function AppMobileLayout() {
|
|
|
724
729
|
```
|
|
725
730
|
|
|
726
731
|
|
|
727
|
-
### Props de MobileMenuDrawer
|
|
728
732
|
### Props de MobileMenuDrawer
|
|
729
733
|
|
|
730
734
|
| Prop | Tipo | Descripción |
|
|
@@ -736,3 +740,84 @@ export function AppMobileLayout() {
|
|
|
736
740
|
| `onTabChange` | `(id: string) => void` | Callback gatillado al pulsar una nueva opción del menú. Devuelve el `id`. |
|
|
737
741
|
|
|
738
742
|
|
|
743
|
+
## Uso de InputCode
|
|
744
|
+
|
|
745
|
+
Componente modular de 6 celdas independientes para captura de tokens numéricos (MFA/OTP). Soporta autoenfoque secuencial inteligente, pegado (paste) masivo inteligente de cadenas numéricas enteras y control condicional de estados destructivos.
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
```tsx
|
|
749
|
+
import { InputCode } from "@klu_dev/ui-klu-green"
|
|
750
|
+
import { useState } from "react"
|
|
751
|
+
|
|
752
|
+
export default function VerificationForm() {
|
|
753
|
+
const [hasError, setHasError] = useState(false)
|
|
754
|
+
|
|
755
|
+
const handleComplete = (code: string) => {
|
|
756
|
+
console.log("Código unificado enviado:", code)
|
|
757
|
+
if (code !== "123456") {
|
|
758
|
+
setHasError(true) // Pinta bordes y texto numérico en color destructivo
|
|
759
|
+
} else {
|
|
760
|
+
setHasError(false)
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return (
|
|
765
|
+
<div className="uiklu-max-w-[400px] uiklu-mx-auto uiklu-p-6">
|
|
766
|
+
<InputCode hasError="{hasError}" onComplete="{handleComplete}" title="Código de seguridad SMS"/>
|
|
767
|
+
{hasError && (
|
|
768
|
+
<p className="uiklu-text-destructive uiklu-text-xs uiklu-text-center uiklu-mt-2">
|
|
769
|
+
Código inválido. Revisa tus dígitos e intenta de nuevo.
|
|
770
|
+
</p>
|
|
771
|
+
)}
|
|
772
|
+
</div>
|
|
773
|
+
)
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
### Props de InputCode
|
|
778
|
+
|
|
779
|
+
| Prop | Tipo | Por defecto | Descripción |
|
|
780
|
+
| :--- | :--- | :--- | :--- |
|
|
781
|
+
| `title` | `string` | `"Código de autenticación"` | Texto dinámico renderizado en la etiqueta del componente. |
|
|
782
|
+
| `hasError` | `boolean` | `false` | Modifica de forma síncrona el color de los bordes y el contenido numérico a la variable destructiva. |
|
|
783
|
+
| `onComplete` | `(code: string) => void` | - | Callback gatillado automáticamente cuando se ha rellenado la celda número 6. |
|
|
784
|
+
|
|
785
|
+
## Uso de SearchSelect
|
|
786
|
+
|
|
787
|
+
Componente de menú desplegable de búsqueda avanzada impulsado con Radix UI Popover. Permite filtrado de texto reactivo en tiempo real con limpieza rápida integrada, slots dinámicos laterales adicionales y escala adaptativa de dimensiones.
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
```tsx
|
|
791
|
+
import { SearchSelect } from "@klu_dev/ui-klu-green"
|
|
792
|
+
import { useState } from "react"
|
|
793
|
+
|
|
794
|
+
export default function BankSelector() {
|
|
795
|
+
const [selectedBank, setSelectedBank] = useState("")
|
|
796
|
+
|
|
797
|
+
const bancos = [
|
|
798
|
+
{ value: "002", label: "Banamex", extra: <span className="uiklu-text-xs uiklu-opacity-50">Nacional</span> },
|
|
799
|
+
{ value: "012", label: "BBVA Bancomer" },
|
|
800
|
+
{ value: "014", label: "Santander", extra: <span className="uiklu-text-xs uiklu-text-primary">Popular</span> },
|
|
801
|
+
{ value: "072", label: "Banorte" },
|
|
802
|
+
{ value: "646", label: "KLU Banca Digital" }
|
|
803
|
+
]
|
|
804
|
+
|
|
805
|
+
return (
|
|
806
|
+
<div className="uiklu-flex uiklu-flex-col uiklu-gap-4 uiklu-p-6">
|
|
807
|
+
<SearchSelect error="{false}" onChange="{setSelectedBank}" options="{bancos}" placeholder="Selecciona tu banco emisor..." size="lg" value="{selectedBank}"/>
|
|
808
|
+
<p className="uiklu-text-sm">ID Banco Seleccionado: <strong>{selectedBank || "Ninguno"}</strong></p>
|
|
809
|
+
</div>
|
|
810
|
+
)
|
|
811
|
+
}
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### Props de SearchSelect
|
|
815
|
+
| Prop | Tipo | Por defecto | Descripción |
|
|
816
|
+
| :--- | :--- | :--- | :--- |
|
|
817
|
+
| `options` | `Option[]` | - | Listado de opciones de formato `{ value: string; label: string; extra?: ReactNode }`. |
|
|
818
|
+
| `value` | `string` | - | ID de la opción seleccionada. |
|
|
819
|
+
| `onChange` | `(value: string) => void` | - | Callback despachado al seleccionar o limpiar una opción. |
|
|
820
|
+
| `placeholder` | `string` | `"Buscar..."` | Texto de soporte visible cuando el campo se encuentra vacío. |
|
|
821
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'full'` | `'lg'` | Determina la escala del ancho mínimo, alto de caja e interlineado tipográfico interno. |
|
|
822
|
+
| `error` | `boolean` | `false` | Alterna el color de la caja a la paleta destructiva y formatea el color del placeholder. |
|
|
823
|
+
| `disabled` | `boolean` | `false` | Inactiva por completo la interacción del gatillo y cancela el despliegue del Popover. |
|
package/dist/index.css
CHANGED
|
@@ -188,6 +188,10 @@ button,
|
|
|
188
188
|
[class*="backdrop-blur"] .uiklu-error-message {
|
|
189
189
|
color: #FFFFFF !important;
|
|
190
190
|
}
|
|
191
|
+
.uiklu-pointer-events-none{
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
|
|
194
|
+
}
|
|
191
195
|
.uiklu-pointer-events-auto{
|
|
192
196
|
pointer-events: auto;
|
|
193
197
|
|
|
@@ -317,6 +321,10 @@ button,
|
|
|
317
321
|
.uiklu-mb-\[10px\]{
|
|
318
322
|
margin-bottom: 10px;
|
|
319
323
|
|
|
324
|
+
}
|
|
325
|
+
.uiklu-mb-\[12px\]{
|
|
326
|
+
margin-bottom: 12px;
|
|
327
|
+
|
|
320
328
|
}
|
|
321
329
|
.uiklu-mb-\[18px\]{
|
|
322
330
|
margin-bottom: 18px;
|
|
@@ -349,6 +357,10 @@ button,
|
|
|
349
357
|
.uiklu-ml-auto{
|
|
350
358
|
margin-left: auto;
|
|
351
359
|
|
|
360
|
+
}
|
|
361
|
+
.uiklu-mr-1{
|
|
362
|
+
margin-right: 0.25rem;
|
|
363
|
+
|
|
352
364
|
}
|
|
353
365
|
.uiklu-mr-\[10px\]{
|
|
354
366
|
margin-right: 10px;
|
|
@@ -453,6 +465,10 @@ button,
|
|
|
453
465
|
.uiklu-h-\[40px\]{
|
|
454
466
|
height: 40px;
|
|
455
467
|
|
|
468
|
+
}
|
|
469
|
+
.uiklu-h-\[43px\]{
|
|
470
|
+
height: 43px;
|
|
471
|
+
|
|
456
472
|
}
|
|
457
473
|
.uiklu-h-\[44px\]{
|
|
458
474
|
height: 44px;
|
|
@@ -585,6 +601,10 @@ button,
|
|
|
585
601
|
.uiklu-w-\[383px\]{
|
|
586
602
|
width: 383px;
|
|
587
603
|
|
|
604
|
+
}
|
|
605
|
+
.uiklu-w-\[39px\]{
|
|
606
|
+
width: 39px;
|
|
607
|
+
|
|
588
608
|
}
|
|
589
609
|
.uiklu-w-\[40px\]{
|
|
590
610
|
width: 40px;
|
|
@@ -766,6 +786,10 @@ button,
|
|
|
766
786
|
.uiklu-cursor-pointer{
|
|
767
787
|
cursor: pointer;
|
|
768
788
|
|
|
789
|
+
}
|
|
790
|
+
.uiklu-cursor-text{
|
|
791
|
+
cursor: text;
|
|
792
|
+
|
|
769
793
|
}
|
|
770
794
|
.uiklu-select-none{
|
|
771
795
|
-webkit-user-select: none;
|
|
@@ -940,6 +964,10 @@ button,
|
|
|
940
964
|
.uiklu-overflow-y-auto{
|
|
941
965
|
overflow-y: auto;
|
|
942
966
|
|
|
967
|
+
}
|
|
968
|
+
.uiklu-overflow-x-hidden{
|
|
969
|
+
overflow-x: hidden;
|
|
970
|
+
|
|
943
971
|
}
|
|
944
972
|
.uiklu-truncate{
|
|
945
973
|
overflow: hidden;
|
|
@@ -1002,6 +1030,10 @@ button,
|
|
|
1002
1030
|
.uiklu-rounded-\[50px\]{
|
|
1003
1031
|
border-radius: 50px;
|
|
1004
1032
|
|
|
1033
|
+
}
|
|
1034
|
+
.uiklu-rounded-\[8px\]{
|
|
1035
|
+
border-radius: 8px;
|
|
1036
|
+
|
|
1005
1037
|
}
|
|
1006
1038
|
.uiklu-rounded-full{
|
|
1007
1039
|
border-radius: 9999px;
|
|
@@ -1238,6 +1270,10 @@ button,
|
|
|
1238
1270
|
--tw-bg-opacity: 1;
|
|
1239
1271
|
background-color: hsl(var(--uiklu-primary) / var(--tw-bg-opacity, 1));
|
|
1240
1272
|
|
|
1273
|
+
}
|
|
1274
|
+
.uiklu-bg-primary\/5{
|
|
1275
|
+
background-color: hsl(var(--uiklu-primary) / 0.05);
|
|
1276
|
+
|
|
1241
1277
|
}
|
|
1242
1278
|
.uiklu-bg-primary300{
|
|
1243
1279
|
--tw-bg-opacity: 1;
|
|
@@ -1413,6 +1449,11 @@ button,
|
|
|
1413
1449
|
padding-left: 0.75rem !important;
|
|
1414
1450
|
padding-right: 0.75rem !important;
|
|
1415
1451
|
|
|
1452
|
+
}
|
|
1453
|
+
.uiklu-px-0{
|
|
1454
|
+
padding-left: 0px;
|
|
1455
|
+
padding-right: 0px;
|
|
1456
|
+
|
|
1416
1457
|
}
|
|
1417
1458
|
.uiklu-px-2{
|
|
1418
1459
|
padding-left: 0.5rem;
|
|
@@ -1604,6 +1645,10 @@ button,
|
|
|
1604
1645
|
.uiklu-text-\[24px\]{
|
|
1605
1646
|
font-size: 24px;
|
|
1606
1647
|
|
|
1648
|
+
}
|
|
1649
|
+
.uiklu-text-\[28px\]{
|
|
1650
|
+
font-size: 28px;
|
|
1651
|
+
|
|
1607
1652
|
}
|
|
1608
1653
|
.uiklu-text-\[32px\]{
|
|
1609
1654
|
font-size: 32px;
|
|
@@ -1641,6 +1686,10 @@ button,
|
|
|
1641
1686
|
line-height: 14px;
|
|
1642
1687
|
font-weight: 500;
|
|
1643
1688
|
|
|
1689
|
+
}
|
|
1690
|
+
.uiklu-font-\[600\]{
|
|
1691
|
+
font-weight: 600;
|
|
1692
|
+
|
|
1644
1693
|
}
|
|
1645
1694
|
.uiklu-font-bold{
|
|
1646
1695
|
font-weight: 700;
|
|
@@ -1885,6 +1934,10 @@ button,
|
|
|
1885
1934
|
.uiklu-opacity-100{
|
|
1886
1935
|
opacity: 1;
|
|
1887
1936
|
|
|
1937
|
+
}
|
|
1938
|
+
.uiklu-opacity-50{
|
|
1939
|
+
opacity: 0.5;
|
|
1940
|
+
|
|
1888
1941
|
}
|
|
1889
1942
|
.uiklu-opacity-70{
|
|
1890
1943
|
opacity: 0.7;
|
|
@@ -2006,6 +2059,18 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2006
2059
|
|
|
2007
2060
|
}
|
|
2008
2061
|
|
|
2062
|
+
.placeholder\:uiklu-text-destructive::-moz-placeholder{
|
|
2063
|
+
--tw-text-opacity: 1;
|
|
2064
|
+
color: hsl(var(--uiklu-destructive) / var(--tw-text-opacity, 1));
|
|
2065
|
+
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
.placeholder\:uiklu-text-destructive::placeholder{
|
|
2069
|
+
--tw-text-opacity: 1;
|
|
2070
|
+
color: hsl(var(--uiklu-destructive) / var(--tw-text-opacity, 1));
|
|
2071
|
+
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2009
2074
|
.placeholder\:uiklu-text-gray500::-moz-placeholder{
|
|
2010
2075
|
--tw-text-opacity: 1;
|
|
2011
2076
|
color: hsl(var(--uiklu-gray-500) / var(--tw-text-opacity, 1));
|
|
@@ -2028,6 +2093,23 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2028
2093
|
|
|
2029
2094
|
}
|
|
2030
2095
|
|
|
2096
|
+
.focus-within\:uiklu-border-\[1px\]:focus-within{
|
|
2097
|
+
border-width: 1px;
|
|
2098
|
+
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
.focus-within\:uiklu-border-baseblack:focus-within{
|
|
2102
|
+
--tw-border-opacity: 1;
|
|
2103
|
+
border-color: hsl(var(--uiklu-baseblack) / var(--tw-border-opacity, 1));
|
|
2104
|
+
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
.focus-within\:uiklu-border-destructive:focus-within{
|
|
2108
|
+
--tw-border-opacity: 1;
|
|
2109
|
+
border-color: hsl(var(--uiklu-destructive) / var(--tw-border-opacity, 1));
|
|
2110
|
+
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2031
2113
|
.hover\:uiklu-bg-gray-100:hover{
|
|
2032
2114
|
--tw-bg-opacity: 1;
|
|
2033
2115
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
|
@@ -2050,6 +2132,11 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2050
2132
|
|
|
2051
2133
|
}
|
|
2052
2134
|
|
|
2135
|
+
.hover\:uiklu-bg-primary\/10:hover{
|
|
2136
|
+
background-color: hsl(var(--uiklu-primary) / 0.1);
|
|
2137
|
+
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2053
2140
|
.hover\:uiklu-bg-primary900\/5:hover{
|
|
2054
2141
|
background-color: hsl(var(--uiklu-primary-900) / 0.05);
|
|
2055
2142
|
|
|
@@ -2065,6 +2152,12 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2065
2152
|
|
|
2066
2153
|
}
|
|
2067
2154
|
|
|
2155
|
+
.hover\:uiklu-text-primary:hover{
|
|
2156
|
+
--tw-text-opacity: 1;
|
|
2157
|
+
color: hsl(var(--uiklu-primary) / var(--tw-text-opacity, 1));
|
|
2158
|
+
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2068
2161
|
.hover\:uiklu-underline:hover{
|
|
2069
2162
|
text-decoration-line: underline;
|
|
2070
2163
|
|
|
@@ -2107,6 +2200,12 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2107
2200
|
|
|
2108
2201
|
}
|
|
2109
2202
|
|
|
2203
|
+
.focus\:uiklu-border-gray800:focus{
|
|
2204
|
+
--tw-border-opacity: 1;
|
|
2205
|
+
border-color: hsl(var(--uiklu-gray-800) / var(--tw-border-opacity, 1));
|
|
2206
|
+
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2110
2209
|
.focus\:uiklu-border-primary900:focus{
|
|
2111
2210
|
--tw-border-opacity: 1;
|
|
2112
2211
|
border-color: hsl(var(--uiklu-primary-900) / var(--tw-border-opacity, 1));
|
|
@@ -2183,8 +2282,9 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2183
2282
|
|
|
2184
2283
|
}
|
|
2185
2284
|
|
|
2186
|
-
.data-\[placeholder\]\:uiklu-
|
|
2187
|
-
opacity:
|
|
2285
|
+
.data-\[placeholder\]\:uiklu-text-gray500[data-placeholder]{
|
|
2286
|
+
--tw-text-opacity: 1;
|
|
2287
|
+
color: hsl(var(--uiklu-gray-500) / var(--tw-text-opacity, 1));
|
|
2188
2288
|
|
|
2189
2289
|
}
|
|
2190
2290
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -159,4 +159,30 @@ declare const Icons: {
|
|
|
159
159
|
CIRCLE_MOVEMENTS: react_jsx_runtime.JSX.Element;
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
declare const searchSelectTriggerVariants: (props?: ({
|
|
163
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
164
|
+
error?: boolean | null | undefined;
|
|
165
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
166
|
+
interface Option {
|
|
167
|
+
value: string;
|
|
168
|
+
label: string;
|
|
169
|
+
extra?: React.ReactNode;
|
|
170
|
+
}
|
|
171
|
+
interface SearchSelectProps extends VariantProps<typeof searchSelectTriggerVariants> {
|
|
172
|
+
options: Option[];
|
|
173
|
+
value: string;
|
|
174
|
+
onChange: (value: string) => void;
|
|
175
|
+
placeholder?: string;
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
className?: string;
|
|
178
|
+
}
|
|
179
|
+
declare const SearchSelect: ({ options, value, onChange, placeholder, size, error, disabled, className, }: SearchSelectProps) => react_jsx_runtime.JSX.Element;
|
|
180
|
+
|
|
181
|
+
interface AuthCodeProps {
|
|
182
|
+
onComplete?: (code: string) => void;
|
|
183
|
+
title?: string;
|
|
184
|
+
hasError?: boolean;
|
|
185
|
+
}
|
|
186
|
+
declare const InputCode: React__default.FC<AuthCodeProps>;
|
|
187
|
+
|
|
188
|
+
export { BackButton, BalanceInfo, Button, Icons, Input, InputCode, LoadingScreen, Modal, PromoBanner, SearchSelect, Select, SidebarTabs, ToastAction, Toaster, Typography, useToast };
|
package/dist/index.js
CHANGED
|
@@ -325,7 +325,7 @@ var selectTriggerVariants = cva2(
|
|
|
325
325
|
[
|
|
326
326
|
"uiklu-flex uiklu-items-center uiklu-justify-between uiklu-transition-all",
|
|
327
327
|
"uiklu-rounded-[50px] uiklu-border-[1px] uiklu-border-solid uiklu-bg-background uiklu-font-sans",
|
|
328
|
-
"uiklu-outline-none focus:uiklu-border-baseblack focus:uiklu-border-[1px]",
|
|
328
|
+
"uiklu-outline-none focus:uiklu-border-baseblack focus:uiklu-border-[1px] ",
|
|
329
329
|
"disabled:uiklu-cursor-not-allowed disabled:uiklu-opacity-50",
|
|
330
330
|
"uiklu-leading-none"
|
|
331
331
|
],
|
|
@@ -339,7 +339,7 @@ var selectTriggerVariants = cva2(
|
|
|
339
339
|
},
|
|
340
340
|
error: {
|
|
341
341
|
true: "uiklu-border-destructive uiklu-text-destructive focus:uiklu-border-destructive",
|
|
342
|
-
false: "uiklu-border-border uiklu-text-
|
|
342
|
+
false: "uiklu-border-border uiklu-text-gray800 data-[placeholder]:uiklu-text-gray500"
|
|
343
343
|
}
|
|
344
344
|
},
|
|
345
345
|
defaultVariants: {
|
|
@@ -355,7 +355,7 @@ var SelectTrigger = React4.forwardRef(({ className, children, size, error, ...pr
|
|
|
355
355
|
className: cn(selectTriggerVariants({ size, error, className })),
|
|
356
356
|
...props,
|
|
357
357
|
children: [
|
|
358
|
-
/* @__PURE__ */ jsx4("span", { className: "uiklu-truncate
|
|
358
|
+
/* @__PURE__ */ jsx4("span", { className: "uiklu-truncate", children }),
|
|
359
359
|
/* @__PURE__ */ jsx4(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx4(ChevronDown, { className: cn(
|
|
360
360
|
"uiklu-h-5 uiklu-w-5 uiklu-ml-2 uiklu-shrink-0 uiklu-transition-opacity uiklu-opacity-70",
|
|
361
361
|
error ? "uiklu-text-destructive" : "uiklu-text-inputtext"
|
|
@@ -1402,15 +1402,270 @@ function SidebarTabs({ items }) {
|
|
|
1402
1402
|
/* @__PURE__ */ jsx17("div", { className: "uiklu-flex-1", children: currentActiveItem?.content ? currentActiveItem.content : /* @__PURE__ */ jsx17("div", { className: "uiklu-p-8", children: /* @__PURE__ */ jsx17("h2", { children: "Pr\xF3ximamente..." }) }) })
|
|
1403
1403
|
] });
|
|
1404
1404
|
}
|
|
1405
|
+
|
|
1406
|
+
// src/components/ui/searchSelect/searchSelect.tsx
|
|
1407
|
+
import * as React10 from "react";
|
|
1408
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1409
|
+
import { Check as Check2, ChevronDown as ChevronDown2, X } from "lucide-react";
|
|
1410
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1411
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1412
|
+
var searchSelectTriggerVariants = cva5(
|
|
1413
|
+
[
|
|
1414
|
+
"uiklu-flex uiklu-items-center uiklu-justify-between uiklu-transition-all",
|
|
1415
|
+
"uiklu-rounded-[50px] uiklu-border-[1px] uiklu-border-solid uiklu-bg-background uiklu-font-sans",
|
|
1416
|
+
"uiklu-outline-none focus-within:uiklu-border-baseblack focus-within:uiklu-border-[1px]",
|
|
1417
|
+
"disabled:uiklu-cursor-not-allowed disabled:uiklu-opacity-50",
|
|
1418
|
+
"uiklu-leading-none"
|
|
1419
|
+
],
|
|
1420
|
+
{
|
|
1421
|
+
variants: {
|
|
1422
|
+
size: {
|
|
1423
|
+
sm: "uiklu-h-[40px] uiklu-w-[150px] uiklu-min-w-[150px] uiklu-px-4 uiklu-text-sm",
|
|
1424
|
+
md: "uiklu-h-[40px] uiklu-w-[250px] uiklu-min-w-[250px] uiklu-px-5 uiklu-text-md",
|
|
1425
|
+
lg: "uiklu-h-[50px] uiklu-w-[350px] uiklu-min-w-[350px] uiklu-px-5 uiklu-text-lg",
|
|
1426
|
+
full: "uiklu-h-[50px] uiklu-w-full uiklu-px-5 uiklu-text-lg"
|
|
1427
|
+
},
|
|
1428
|
+
error: {
|
|
1429
|
+
true: "uiklu-border-destructive uiklu-text-destructive focus-within:uiklu-border-destructive",
|
|
1430
|
+
false: "uiklu-border-border uiklu-text-inputtext"
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
defaultVariants: {
|
|
1434
|
+
size: "lg",
|
|
1435
|
+
error: false
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
);
|
|
1439
|
+
var inputFontSizes = {
|
|
1440
|
+
sm: "uiklu-text-sm",
|
|
1441
|
+
md: "uiklu-text-md",
|
|
1442
|
+
lg: "uiklu-text-lg",
|
|
1443
|
+
full: "uiklu-text-lg"
|
|
1444
|
+
};
|
|
1445
|
+
var SearchSelect = ({
|
|
1446
|
+
options,
|
|
1447
|
+
value,
|
|
1448
|
+
onChange,
|
|
1449
|
+
placeholder = "Buscar...",
|
|
1450
|
+
size = "lg",
|
|
1451
|
+
error = false,
|
|
1452
|
+
disabled = false,
|
|
1453
|
+
className
|
|
1454
|
+
}) => {
|
|
1455
|
+
const [open, setOpen] = React10.useState(false);
|
|
1456
|
+
const [search, setSearch] = React10.useState("");
|
|
1457
|
+
const containerRef = React10.useRef(null);
|
|
1458
|
+
const inputRef = React10.useRef(null);
|
|
1459
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
1460
|
+
React10.useEffect(() => {
|
|
1461
|
+
if (selectedOption) {
|
|
1462
|
+
setSearch(selectedOption.label);
|
|
1463
|
+
} else {
|
|
1464
|
+
setSearch("");
|
|
1465
|
+
}
|
|
1466
|
+
}, [selectedOption]);
|
|
1467
|
+
const filteredOptions = options.filter(
|
|
1468
|
+
(option) => option.label.toLowerCase().includes(search.toLowerCase())
|
|
1469
|
+
);
|
|
1470
|
+
const handleClear = (e) => {
|
|
1471
|
+
e.stopPropagation();
|
|
1472
|
+
onChange("");
|
|
1473
|
+
setSearch("");
|
|
1474
|
+
setOpen(true);
|
|
1475
|
+
inputRef.current?.focus();
|
|
1476
|
+
};
|
|
1477
|
+
return /* @__PURE__ */ jsxs15(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
|
|
1478
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
1479
|
+
"div",
|
|
1480
|
+
{
|
|
1481
|
+
ref: containerRef,
|
|
1482
|
+
className: cn(
|
|
1483
|
+
searchSelectTriggerVariants({ size, error, className }),
|
|
1484
|
+
"uiklu-cursor-text uiklu-relative",
|
|
1485
|
+
disabled && "uiklu-opacity-50 uiklu-pointer-events-none"
|
|
1486
|
+
),
|
|
1487
|
+
onClick: () => {
|
|
1488
|
+
inputRef.current?.focus();
|
|
1489
|
+
setOpen(true);
|
|
1490
|
+
},
|
|
1491
|
+
children: [
|
|
1492
|
+
/* @__PURE__ */ jsx18(
|
|
1493
|
+
"input",
|
|
1494
|
+
{
|
|
1495
|
+
ref: inputRef,
|
|
1496
|
+
type: "text",
|
|
1497
|
+
className: cn(
|
|
1498
|
+
"uiklu-w-full uiklu-bg-transparent uiklu-outline-none uiklu-border-none uiklu-p-0",
|
|
1499
|
+
"uiklu-font-sans uiklu-text-gray800 placeholder:uiklu-opacity-100",
|
|
1500
|
+
inputFontSizes[size || "lg"],
|
|
1501
|
+
!error ? "placeholder:uiklu-text-gray500" : "placeholder:uiklu-text-destructive"
|
|
1502
|
+
),
|
|
1503
|
+
placeholder,
|
|
1504
|
+
value: search,
|
|
1505
|
+
disabled,
|
|
1506
|
+
onFocus: () => setOpen(true),
|
|
1507
|
+
onClick: (e) => {
|
|
1508
|
+
e.stopPropagation();
|
|
1509
|
+
setOpen(true);
|
|
1510
|
+
},
|
|
1511
|
+
onChange: (e) => {
|
|
1512
|
+
setSearch(e.target.value);
|
|
1513
|
+
if (!open) setOpen(true);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
),
|
|
1517
|
+
/* @__PURE__ */ jsxs15("div", { className: "uiklu-flex uiklu-items-center uiklu-ml-2 uiklu-shrink-0", children: [
|
|
1518
|
+
search && /* @__PURE__ */ jsx18(
|
|
1519
|
+
"button",
|
|
1520
|
+
{
|
|
1521
|
+
type: "button",
|
|
1522
|
+
onClick: handleClear,
|
|
1523
|
+
className: "uiklu-mr-1 uiklu-opacity-50 hover:uiklu-opacity-100 uiklu-transition-opacity\n uiklu-bg-transparent uiklu-border-none uiklu-outline-none uiklu-p-0 \n uiklu-cursor-pointer uiklu-flex uiklu-items-center uiklu-justify-center",
|
|
1524
|
+
children: /* @__PURE__ */ jsx18(X, { className: "uiklu-h-4 uiklu-w-4" })
|
|
1525
|
+
}
|
|
1526
|
+
),
|
|
1527
|
+
/* @__PURE__ */ jsx18(
|
|
1528
|
+
ChevronDown2,
|
|
1529
|
+
{
|
|
1530
|
+
className: cn(
|
|
1531
|
+
"uiklu-h-5 uiklu-w-5 uiklu-transition-opacity uiklu-opacity-70 uiklu-cursor-pointer",
|
|
1532
|
+
error ? "uiklu-text-destructive" : "uiklu-text-inputtext"
|
|
1533
|
+
),
|
|
1534
|
+
onClick: (e) => {
|
|
1535
|
+
e.stopPropagation();
|
|
1536
|
+
setOpen((prev) => !prev);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
)
|
|
1540
|
+
] })
|
|
1541
|
+
]
|
|
1542
|
+
}
|
|
1543
|
+
) }),
|
|
1544
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx18(
|
|
1545
|
+
PopoverPrimitive.Content,
|
|
1546
|
+
{
|
|
1547
|
+
className: cn(
|
|
1548
|
+
"uiklu-relative uiklu-z-50 uiklu-overflow-hidden uiklu-rounded-[20px] uiklu-border-[1px] uiklu-border-border uiklu-bg-background uiklu-text-inputtext uiklu-font-sans uiklu-shadow-md uiklu-translate-y-1"
|
|
1549
|
+
),
|
|
1550
|
+
style: {
|
|
1551
|
+
width: containerRef.current ? containerRef.current.offsetWidth : "var(--radix-popover-trigger-width)"
|
|
1552
|
+
},
|
|
1553
|
+
align: "start",
|
|
1554
|
+
sideOffset: 4,
|
|
1555
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1556
|
+
children: /* @__PURE__ */ jsx18("div", { className: "uiklu-py-1 uiklu-px-0 uiklu-max-h-96 uiklu-overflow-y-auto uiklu-overflow-x-hidden uiklu-w-full uiklu-box-border", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx18("div", { className: "uiklu-py-3 uiklu-px-4 uiklu-text-sm uiklu-text-center uiklu-opacity-50 uiklu-font-sans", children: "No se encontraron resultados" }) : filteredOptions.map((option) => {
|
|
1557
|
+
const isSelected = value === option.value;
|
|
1558
|
+
return /* @__PURE__ */ jsxs15(
|
|
1559
|
+
"div",
|
|
1560
|
+
{
|
|
1561
|
+
onClick: () => {
|
|
1562
|
+
onChange(option.value);
|
|
1563
|
+
setSearch(option.label);
|
|
1564
|
+
setOpen(false);
|
|
1565
|
+
},
|
|
1566
|
+
className: cn(
|
|
1567
|
+
"uiklu-relative uiklu-flex uiklu-w-full uiklu-box-border uiklu-cursor-pointer uiklu-select-none uiklu-items-center uiklu-py-2.5 uiklu-pl-10 uiklu-pr-4 uiklu-text-md uiklu-font-sans uiklu-outline-none hover:uiklu-bg-primary/10 hover:uiklu-text-primary uiklu-transition-colors",
|
|
1568
|
+
isSelected && "uiklu-bg-primary/5 uiklu-text-primary uiklu-font-medium"
|
|
1569
|
+
),
|
|
1570
|
+
children: [
|
|
1571
|
+
/* @__PURE__ */ jsx18("span", { className: "uiklu-absolute uiklu-left-3 uiklu-flex uiklu-h-3.5 uiklu-w-3.5 uiklu-items-center uiklu-justify-center", children: isSelected && /* @__PURE__ */ jsx18(Check2, { className: "uiklu-h-4 uiklu-w-4 uiklu-text-primary" }) }),
|
|
1572
|
+
/* @__PURE__ */ jsx18("span", { className: "uiklu-flex-1 uiklu-truncate uiklu-min-w-0", children: option.label }),
|
|
1573
|
+
option.extra && /* @__PURE__ */ jsx18("span", { className: "uiklu-ml-2 uiklu-shrink-0 uiklu-flex uiklu-items-center", children: option.extra })
|
|
1574
|
+
]
|
|
1575
|
+
},
|
|
1576
|
+
option.value
|
|
1577
|
+
);
|
|
1578
|
+
}) })
|
|
1579
|
+
}
|
|
1580
|
+
) })
|
|
1581
|
+
] });
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
// src/components/ui/inputCode/inputCode.tsx
|
|
1585
|
+
import { useRef as useRef2, useState as useState6 } from "react";
|
|
1586
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1587
|
+
var InputCode = ({
|
|
1588
|
+
onComplete,
|
|
1589
|
+
title = "C\xF3digo de autenticaci\xF3n",
|
|
1590
|
+
hasError = false
|
|
1591
|
+
}) => {
|
|
1592
|
+
const [code, setCode] = useState6(Array(6).fill(""));
|
|
1593
|
+
const inputsRef = useRef2([]);
|
|
1594
|
+
const handleChange = (e, index) => {
|
|
1595
|
+
const value = e.target.value;
|
|
1596
|
+
if (isNaN(Number(value))) return;
|
|
1597
|
+
const newCode = [...code];
|
|
1598
|
+
newCode[index] = value.substring(value.length - 1);
|
|
1599
|
+
setCode(newCode);
|
|
1600
|
+
const fullCode = newCode.join("");
|
|
1601
|
+
if (fullCode.length === 6 && onComplete) {
|
|
1602
|
+
onComplete(fullCode);
|
|
1603
|
+
}
|
|
1604
|
+
if (value && index < 5) {
|
|
1605
|
+
inputsRef.current[index + 1]?.focus();
|
|
1606
|
+
}
|
|
1607
|
+
};
|
|
1608
|
+
const handleKeyDown = (e, index) => {
|
|
1609
|
+
if (e.key === "Backspace" && !code[index] && index > 0) {
|
|
1610
|
+
inputsRef.current[index - 1]?.focus();
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
const handlePaste = (e) => {
|
|
1614
|
+
e.preventDefault();
|
|
1615
|
+
const pastedData = e.clipboardData.getData("text").trim();
|
|
1616
|
+
if (!/^\d+$/.test(pastedData)) return;
|
|
1617
|
+
const pastedCode = pastedData.slice(0, 6).split("");
|
|
1618
|
+
const newCode = [...code];
|
|
1619
|
+
pastedCode.forEach((char, index) => {
|
|
1620
|
+
if (index < 6) newCode[index] = char;
|
|
1621
|
+
});
|
|
1622
|
+
setCode(newCode);
|
|
1623
|
+
const focusIndex = Math.min(pastedCode.length, 5);
|
|
1624
|
+
inputsRef.current[focusIndex]?.focus();
|
|
1625
|
+
const fullCode = newCode.join("");
|
|
1626
|
+
if (fullCode.length === 6 && onComplete) {
|
|
1627
|
+
onComplete(fullCode);
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
return /* @__PURE__ */ jsxs16("div", { className: "uiklu-flex uiklu-flex-col uiklu-items-center \n uiklu-justify-center uiklu-font-sans uiklu-w-full", children: [
|
|
1631
|
+
/* @__PURE__ */ jsx19("label", { className: "uiklu-text-[14px] uiklu-text-gray600 uiklu-font-normal\n uiklu-block uiklu-mb-[12px]", children: title }),
|
|
1632
|
+
/* @__PURE__ */ jsx19("div", { className: "uiklu-flex uiklu-justify-center uiklu-gap-[14px] uiklu-w-full", children: code.map((digit, index) => /* @__PURE__ */ jsx19(
|
|
1633
|
+
"input",
|
|
1634
|
+
{
|
|
1635
|
+
ref: (el) => {
|
|
1636
|
+
if (el) inputsRef.current[index] = el;
|
|
1637
|
+
},
|
|
1638
|
+
type: "text",
|
|
1639
|
+
inputMode: "numeric",
|
|
1640
|
+
pattern: "[0-9]*",
|
|
1641
|
+
maxLength: 1,
|
|
1642
|
+
value: digit,
|
|
1643
|
+
onChange: (e) => handleChange(e, index),
|
|
1644
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
1645
|
+
onPaste: index === 0 ? handlePaste : void 0,
|
|
1646
|
+
className: `uiklu-w-[39px] uiklu-h-[43px]
|
|
1647
|
+
uiklu-flex-shrink-0 uiklu-box-border uiklu-text-center
|
|
1648
|
+
uiklu-text-[28px] uiklu-font-sans uiklu-font-[600]
|
|
1649
|
+
uiklu-border-[1px] uiklu-border-solid
|
|
1650
|
+
uiklu-rounded-[8px] uiklu-transition-colors uiklu-text-ellipsis
|
|
1651
|
+
focus:uiklu-outline-none
|
|
1652
|
+
${hasError ? "uiklu-border-destructive uiklu-text-destructive focus:uiklu-border-destructive" : "uiklu-border-inputlight uiklu-text-gray800 focus:uiklu-border-gray800"}`
|
|
1653
|
+
},
|
|
1654
|
+
index
|
|
1655
|
+
)) })
|
|
1656
|
+
] });
|
|
1657
|
+
};
|
|
1405
1658
|
export {
|
|
1406
1659
|
BackButton,
|
|
1407
1660
|
BalanceInfo,
|
|
1408
1661
|
Button,
|
|
1409
1662
|
Icons,
|
|
1410
1663
|
Input,
|
|
1664
|
+
InputCode,
|
|
1411
1665
|
LoadingScreen,
|
|
1412
1666
|
Modal,
|
|
1413
1667
|
PromoBanner,
|
|
1668
|
+
SearchSelect,
|
|
1414
1669
|
Select,
|
|
1415
1670
|
SidebarTabs,
|
|
1416
1671
|
ToastAction,
|