@komensal/ui 0.9.0 → 0.10.0
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 +6 -5
- package/dist/index.d.ts +6 -2
- package/dist/index.js +337 -263
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +2 -1
- package/dist/locales/index.js.map +1 -1
- package/package.json +3 -7
package/dist/index.js
CHANGED
|
@@ -58,6 +58,13 @@ function emit(type, options) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
// src/utils/z-index.ts
|
|
62
|
+
var zPopover = "z-50";
|
|
63
|
+
var zDialogOverlay = "z-60";
|
|
64
|
+
var zDialogContent = "z-70";
|
|
65
|
+
var zPopoverAboveDialog = "z-100";
|
|
66
|
+
var zToast = "z-4000";
|
|
67
|
+
|
|
61
68
|
// src/components/alert.tsx
|
|
62
69
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
70
|
var variantStyles = {
|
|
@@ -138,7 +145,8 @@ var ui_default = {
|
|
|
138
145
|
placeholder: "Selecciona...",
|
|
139
146
|
loading: "Cargando...",
|
|
140
147
|
search: "Buscar...",
|
|
141
|
-
noResults: "Sin resultados."
|
|
148
|
+
noResults: "Sin resultados.",
|
|
149
|
+
clear: "Limpiar selecci\xF3n"
|
|
142
150
|
},
|
|
143
151
|
passwordChecklist: {
|
|
144
152
|
minLength: "M\xEDnimo {{min}} caracteres",
|
|
@@ -190,7 +198,7 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
190
198
|
viewBox: "0 0 100 100",
|
|
191
199
|
width: sizes[size],
|
|
192
200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
193
|
-
children: /* @__PURE__ */ jsxs3("g", { className: clsx2("spinner_V8m1",
|
|
201
|
+
children: /* @__PURE__ */ jsxs3("g", { className: clsx2("spinner_V8m1", className), children: [
|
|
194
202
|
/* @__PURE__ */ jsx3("circle", { cx: "50", cy: "50", fill: "none", opacity: "0.25", r: "35", stroke: "currentColor", strokeWidth: "10" }),
|
|
195
203
|
/* @__PURE__ */ jsx3(
|
|
196
204
|
"circle",
|
|
@@ -233,7 +241,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
233
241
|
TooltipPrimitive.Content,
|
|
234
242
|
{
|
|
235
243
|
className: cn(
|
|
236
|
-
|
|
244
|
+
`bg-tooltip text-tooltip-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ${zPopover} overflow-hidden rounded-md px-3 py-1.5 text-sm font-semibold shadow-sm`,
|
|
237
245
|
className
|
|
238
246
|
),
|
|
239
247
|
ref,
|
|
@@ -340,13 +348,13 @@ var Button = React2.forwardRef(
|
|
|
340
348
|
Button.displayName = "Button";
|
|
341
349
|
|
|
342
350
|
// src/components/command.tsx
|
|
343
|
-
import { MagnifyingGlassIcon } from "@
|
|
351
|
+
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
344
352
|
import { Command as CommandPrimitive } from "cmdk";
|
|
345
353
|
import * as React4 from "react";
|
|
346
354
|
|
|
347
355
|
// src/components/dialog.tsx
|
|
356
|
+
import { XIcon } from "@phosphor-icons/react";
|
|
348
357
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
349
|
-
import { Cross2Icon } from "@radix-ui/react-icons";
|
|
350
358
|
import * as React3 from "react";
|
|
351
359
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
352
360
|
var Dialog = DialogPrimitive.Root;
|
|
@@ -357,7 +365,7 @@ var DialogOverlay = React3.forwardRef(({ className, isAbsolute = false, ...props
|
|
|
357
365
|
DialogPrimitive.Overlay,
|
|
358
366
|
{
|
|
359
367
|
className: cn(
|
|
360
|
-
|
|
368
|
+
`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-foreground/10 ${zDialogOverlay} backdrop-blur-xs`,
|
|
361
369
|
isAbsolute ? "absolute inset-0" : "fixed inset-0",
|
|
362
370
|
className
|
|
363
371
|
),
|
|
@@ -375,7 +383,7 @@ var DialogContent = React3.forwardRef(
|
|
|
375
383
|
DialogPrimitive.Content,
|
|
376
384
|
{
|
|
377
385
|
className: cn(
|
|
378
|
-
|
|
386
|
+
`bg-surface data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ${zDialogContent} grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl p-6 shadow-lg duration-200 outline-none`,
|
|
379
387
|
isAbsolute ? "absolute top-[50%] left-[50%]" : "fixed top-[50%] left-[50%]",
|
|
380
388
|
className
|
|
381
389
|
),
|
|
@@ -384,7 +392,7 @@ var DialogContent = React3.forwardRef(
|
|
|
384
392
|
children: [
|
|
385
393
|
children,
|
|
386
394
|
isCloseIcon && /* @__PURE__ */ jsxs6(DialogPrimitive.Close, { className: "data-[state=open]:text-muted ring-offset-surface focus:ring-ring data-[state=open]:bg-hover hover:bg-hover absolute top-5 right-5 flex h-8 w-8 min-w-8 cursor-pointer items-center justify-center rounded-full bg-transparent opacity-70 transition-all hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
|
|
387
|
-
/* @__PURE__ */ jsx6(
|
|
395
|
+
/* @__PURE__ */ jsx6(XIcon, { className: "text-body h-4 w-4" }),
|
|
388
396
|
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: closeLabel ?? t("dialog.close") })
|
|
389
397
|
] })
|
|
390
398
|
]
|
|
@@ -561,7 +569,7 @@ FormMessage.displayName = "FormMessage";
|
|
|
561
569
|
|
|
562
570
|
// src/components/form-fields/input-field.tsx
|
|
563
571
|
import { useState } from "react";
|
|
564
|
-
import { EyeIcon, EyeSlashIcon, XIcon } from "@phosphor-icons/react";
|
|
572
|
+
import { EyeIcon, EyeSlashIcon, XIcon as XIcon2 } from "@phosphor-icons/react";
|
|
565
573
|
|
|
566
574
|
// src/components/input.tsx
|
|
567
575
|
import * as React6 from "react";
|
|
@@ -622,8 +630,32 @@ var LabelField = ({ label, labelClassName, name, visualRequired }) => {
|
|
|
622
630
|
);
|
|
623
631
|
};
|
|
624
632
|
|
|
625
|
-
// src/components/form-fields/
|
|
633
|
+
// src/components/form-fields/form-field-shell.tsx
|
|
626
634
|
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
635
|
+
var FormFieldShell = ({
|
|
636
|
+
children,
|
|
637
|
+
hasError,
|
|
638
|
+
label,
|
|
639
|
+
labelClassName,
|
|
640
|
+
mainClassName,
|
|
641
|
+
name,
|
|
642
|
+
visualRequired
|
|
643
|
+
}) => /* @__PURE__ */ jsxs9(FormItem, { className: cn("flex flex-col", mainClassName), children: [
|
|
644
|
+
/* @__PURE__ */ jsx12(
|
|
645
|
+
LabelField,
|
|
646
|
+
{
|
|
647
|
+
label,
|
|
648
|
+
labelClassName: cn(labelClassName, hasError && "text-destructive"),
|
|
649
|
+
name,
|
|
650
|
+
visualRequired
|
|
651
|
+
}
|
|
652
|
+
),
|
|
653
|
+
/* @__PURE__ */ jsx12(FormControl, { children }),
|
|
654
|
+
/* @__PURE__ */ jsx12(FormMessage, {})
|
|
655
|
+
] });
|
|
656
|
+
|
|
657
|
+
// src/components/form-fields/input-field.tsx
|
|
658
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
627
659
|
var InputField = ({
|
|
628
660
|
clearLabel,
|
|
629
661
|
control,
|
|
@@ -648,67 +680,68 @@ var InputField = ({
|
|
|
648
680
|
};
|
|
649
681
|
const isPassword = type === "password";
|
|
650
682
|
const inputType = isPassword ? isPasswordVisible ? "text" : "password" : type;
|
|
651
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx13(
|
|
652
684
|
FormField,
|
|
653
685
|
{
|
|
654
686
|
control,
|
|
655
687
|
name,
|
|
656
688
|
render: ({ field, fieldState }) => {
|
|
657
689
|
const hasError = !!fieldState.error;
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
Input,
|
|
671
|
-
{
|
|
672
|
-
...field,
|
|
673
|
-
autoComplete: isPassword ? "current-password" : void 0,
|
|
674
|
-
className: cn(
|
|
675
|
-
inputClassName,
|
|
676
|
-
hasError && "border-destructive",
|
|
677
|
-
isPassword && "pr-10 [&::-ms-reveal]:hidden"
|
|
678
|
-
),
|
|
679
|
-
"data-no-password-toggle": true,
|
|
680
|
-
disabled,
|
|
681
|
-
min: type === "number" ? 0 : void 0,
|
|
682
|
-
placeholder,
|
|
683
|
-
type: inputType,
|
|
684
|
-
value: field.value ?? ""
|
|
685
|
-
}
|
|
686
|
-
),
|
|
687
|
-
/* @__PURE__ */ jsxs9("div", { className: "absolute inset-y-0 right-0 flex items-center space-x-2 pr-2", children: [
|
|
688
|
-
field.value && isClearable && /* @__PURE__ */ jsx12(
|
|
689
|
-
"button",
|
|
690
|
+
return /* @__PURE__ */ jsx13(
|
|
691
|
+
FormFieldShell,
|
|
692
|
+
{
|
|
693
|
+
hasError,
|
|
694
|
+
label,
|
|
695
|
+
labelClassName,
|
|
696
|
+
mainClassName,
|
|
697
|
+
name,
|
|
698
|
+
visualRequired,
|
|
699
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "relative", children: [
|
|
700
|
+
/* @__PURE__ */ jsx13(
|
|
701
|
+
Input,
|
|
690
702
|
{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
703
|
+
...field,
|
|
704
|
+
autoComplete: isPassword ? "current-password" : void 0,
|
|
705
|
+
className: cn(
|
|
706
|
+
inputClassName,
|
|
707
|
+
hasError && "border-destructive",
|
|
708
|
+
isPassword && "pr-10 [&::-ms-reveal]:hidden"
|
|
709
|
+
),
|
|
710
|
+
"data-1p-ignore": isPassword || void 0,
|
|
711
|
+
"data-bwignore": isPassword || void 0,
|
|
712
|
+
"data-lpignore": isPassword || void 0,
|
|
713
|
+
disabled,
|
|
714
|
+
min: type === "number" ? 0 : void 0,
|
|
715
|
+
placeholder,
|
|
716
|
+
type: inputType,
|
|
717
|
+
value: field.value ?? ""
|
|
696
718
|
}
|
|
697
719
|
),
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
720
|
+
/* @__PURE__ */ jsxs10("div", { className: "absolute inset-y-0 right-0 flex items-center space-x-2 pr-2", children: [
|
|
721
|
+
field.value && isClearable && /* @__PURE__ */ jsx13(
|
|
722
|
+
"button",
|
|
723
|
+
{
|
|
724
|
+
className: "focus:outline-none",
|
|
725
|
+
onClick: onClear,
|
|
726
|
+
title: clearLabel ?? t("inputField.clear"),
|
|
727
|
+
type: "button",
|
|
728
|
+
children: /* @__PURE__ */ jsx13(XIcon2, { size: 18 })
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
type === "password" && /* @__PURE__ */ jsx13(
|
|
732
|
+
"button",
|
|
733
|
+
{
|
|
734
|
+
className: "focus:outline-none",
|
|
735
|
+
onClick: togglePasswordVisibility,
|
|
736
|
+
title: isPasswordVisible ? hidePasswordLabel ?? t("inputField.hidePassword") : showPasswordLabel ?? t("inputField.showPassword"),
|
|
737
|
+
type: "button",
|
|
738
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx13(EyeIcon, { size: 18 }) : /* @__PURE__ */ jsx13(EyeSlashIcon, { size: 20 })
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
] })
|
|
708
742
|
] })
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
] });
|
|
743
|
+
}
|
|
744
|
+
);
|
|
712
745
|
}
|
|
713
746
|
}
|
|
714
747
|
);
|
|
@@ -745,6 +778,7 @@ function useGoogleMapPicker({
|
|
|
745
778
|
locationZoom,
|
|
746
779
|
onAddressResolved,
|
|
747
780
|
onChange,
|
|
781
|
+
onError,
|
|
748
782
|
value
|
|
749
783
|
}) {
|
|
750
784
|
const placesLib = useMapsLibrary("places");
|
|
@@ -752,11 +786,13 @@ function useGoogleMapPicker({
|
|
|
752
786
|
const map = useMap(PICKER_MAP_ID);
|
|
753
787
|
const onChangeRef = useRef(onChange);
|
|
754
788
|
const onResolvedRef = useRef(onAddressResolved);
|
|
789
|
+
const onErrorRef = useRef(onError);
|
|
755
790
|
const geocoder = useMemo(
|
|
756
791
|
() => geocodingLib ? new geocodingLib.Geocoder() : null,
|
|
757
792
|
[geocodingLib]
|
|
758
793
|
);
|
|
759
794
|
const debounceRef = useRef(null);
|
|
795
|
+
const blurTimeoutRef = useRef(null);
|
|
760
796
|
const [inputValue, setInputValue] = useState2(value);
|
|
761
797
|
const [suggestions, setSuggestions] = useState2([]);
|
|
762
798
|
const [showDropdown, setShowDropdown] = useState2(false);
|
|
@@ -765,7 +801,15 @@ function useGoogleMapPicker({
|
|
|
765
801
|
useEffect(() => {
|
|
766
802
|
onChangeRef.current = onChange;
|
|
767
803
|
onResolvedRef.current = onAddressResolved;
|
|
804
|
+
onErrorRef.current = onError;
|
|
768
805
|
});
|
|
806
|
+
useEffect(
|
|
807
|
+
() => () => {
|
|
808
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
809
|
+
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
810
|
+
},
|
|
811
|
+
[]
|
|
812
|
+
);
|
|
769
813
|
useEffect(() => {
|
|
770
814
|
setInputValue(value);
|
|
771
815
|
}, [value]);
|
|
@@ -786,7 +830,7 @@ function useGoogleMapPicker({
|
|
|
786
830
|
setSessionToken(new placesLib.AutocompleteSessionToken());
|
|
787
831
|
}, [placesLib]);
|
|
788
832
|
useEffect(() => {
|
|
789
|
-
if (!geocoder || !locationQuery || !map) return;
|
|
833
|
+
if (!geocoder || !locationQuery || !map || position) return;
|
|
790
834
|
const g = geocoder;
|
|
791
835
|
const ctrl = { cancelled: false };
|
|
792
836
|
void (async () => {
|
|
@@ -796,14 +840,17 @@ function useGoogleMapPicker({
|
|
|
796
840
|
const loc = results[0].geometry.location;
|
|
797
841
|
map.panTo({ lat: loc.lat(), lng: loc.lng() });
|
|
798
842
|
map.setZoom(locationZoom ?? CITY_ZOOM);
|
|
799
|
-
} catch {
|
|
800
|
-
|
|
843
|
+
} catch (error) {
|
|
844
|
+
if (!ctrl.cancelled) {
|
|
845
|
+
console.error("[GoogleMapPicker] geocode by query failed", error);
|
|
846
|
+
onErrorRef.current?.(error);
|
|
847
|
+
}
|
|
801
848
|
}
|
|
802
849
|
})();
|
|
803
850
|
return () => {
|
|
804
851
|
ctrl.cancelled = true;
|
|
805
852
|
};
|
|
806
|
-
}, [geocoder, locationQuery, locationZoom, map]);
|
|
853
|
+
}, [geocoder, locationQuery, locationZoom, map, position]);
|
|
807
854
|
const fetchSuggestions = useCallback(
|
|
808
855
|
async (input) => {
|
|
809
856
|
if (!placesLib || input.length < 2) {
|
|
@@ -818,7 +865,9 @@ function useGoogleMapPicker({
|
|
|
818
865
|
});
|
|
819
866
|
setSuggestions(result.suggestions);
|
|
820
867
|
setShowDropdown(true);
|
|
821
|
-
} catch {
|
|
868
|
+
} catch (error) {
|
|
869
|
+
console.error("[GoogleMapPicker] fetchAutocompleteSuggestions failed", error);
|
|
870
|
+
onErrorRef.current?.(error);
|
|
822
871
|
setSuggestions([]);
|
|
823
872
|
}
|
|
824
873
|
},
|
|
@@ -839,8 +888,9 @@ function useGoogleMapPicker({
|
|
|
839
888
|
);
|
|
840
889
|
onResolvedRef.current?.({ address, lat: latLng.lat, lng: latLng.lng, ...parts });
|
|
841
890
|
}
|
|
842
|
-
} catch {
|
|
843
|
-
|
|
891
|
+
} catch (error) {
|
|
892
|
+
console.error("[GoogleMapPicker] reverse geocode failed", error);
|
|
893
|
+
onErrorRef.current?.(error);
|
|
844
894
|
}
|
|
845
895
|
},
|
|
846
896
|
[geocoder]
|
|
@@ -874,7 +924,8 @@ function useGoogleMapPicker({
|
|
|
874
924
|
if (placesLib) setSessionToken(new placesLib.AutocompleteSessionToken());
|
|
875
925
|
};
|
|
876
926
|
const handleBlur = () => {
|
|
877
|
-
|
|
927
|
+
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
928
|
+
blurTimeoutRef.current = setTimeout(() => setShowDropdown(false), 150);
|
|
878
929
|
};
|
|
879
930
|
const handleMapClick = useCallback(
|
|
880
931
|
(e) => {
|
|
@@ -910,10 +961,10 @@ function useGoogleMapPicker({
|
|
|
910
961
|
}
|
|
911
962
|
|
|
912
963
|
// src/components/google-map-picker.tsx
|
|
913
|
-
import { jsx as
|
|
964
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
914
965
|
var DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
|
|
915
966
|
var MapPickerContent = (props) => {
|
|
916
|
-
const { disabled, hasError, placeholder } = props;
|
|
967
|
+
const { disabled, hasError, mapId, placeholder } = props;
|
|
917
968
|
const {
|
|
918
969
|
handleBlur,
|
|
919
970
|
handleInputChange,
|
|
@@ -926,9 +977,9 @@ var MapPickerContent = (props) => {
|
|
|
926
977
|
showDropdown,
|
|
927
978
|
suggestions
|
|
928
979
|
} = useGoogleMapPicker(props);
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-3", children: [
|
|
981
|
+
/* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
982
|
+
/* @__PURE__ */ jsx14(
|
|
932
983
|
"input",
|
|
933
984
|
{
|
|
934
985
|
className: cn(inputBase, inputFocus, hasError && "border-destructive"),
|
|
@@ -941,7 +992,7 @@ var MapPickerContent = (props) => {
|
|
|
941
992
|
value: inputValue
|
|
942
993
|
}
|
|
943
994
|
),
|
|
944
|
-
showDropdown && suggestions.length > 0 && /* @__PURE__ */
|
|
995
|
+
showDropdown && suggestions.length > 0 && /* @__PURE__ */ jsx14("ul", { className: cn("border-border bg-surface absolute mt-1 w-full overflow-hidden rounded-[10px] border shadow-md", zPopover), children: suggestions.map((suggestion) => /* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
|
|
945
996
|
"button",
|
|
946
997
|
{
|
|
947
998
|
className: "text-foreground hover:bg-hover w-full px-4 py-3 text-left text-sm transition-colors",
|
|
@@ -951,7 +1002,7 @@ var MapPickerContent = (props) => {
|
|
|
951
1002
|
}
|
|
952
1003
|
) }, suggestion.placePrediction?.placeId ?? suggestion.placePrediction?.text.text)) })
|
|
953
1004
|
] }),
|
|
954
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ jsx14("div", { className: "border-border h-59 overflow-hidden rounded-[10px] border md:h-87.5", children: /* @__PURE__ */ jsx14(
|
|
955
1006
|
Map2,
|
|
956
1007
|
{
|
|
957
1008
|
defaultCenter: DEFAULT_CENTER,
|
|
@@ -959,18 +1010,26 @@ var MapPickerContent = (props) => {
|
|
|
959
1010
|
disableDefaultUI: true,
|
|
960
1011
|
gestureHandling: "cooperative",
|
|
961
1012
|
id: PICKER_MAP_ID,
|
|
962
|
-
mapId: import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
|
|
1013
|
+
mapId: mapId ?? import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
|
|
963
1014
|
onClick: handleMapClick,
|
|
964
1015
|
style: { height: "100%", width: "100%" },
|
|
965
|
-
children: position && /* @__PURE__ */
|
|
1016
|
+
children: position && /* @__PURE__ */ jsx14(AdvancedMarker, { draggable: !disabled, onDragEnd: handleMarkerDragEnd, position })
|
|
966
1017
|
}
|
|
967
1018
|
) })
|
|
968
1019
|
] });
|
|
969
1020
|
};
|
|
970
|
-
var GoogleMapPicker = (props) => /* @__PURE__ */
|
|
1021
|
+
var GoogleMapPicker = (props) => /* @__PURE__ */ jsx14(
|
|
1022
|
+
APIProvider,
|
|
1023
|
+
{
|
|
1024
|
+
apiKey: props.apiKey ?? import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? "",
|
|
1025
|
+
language: "es",
|
|
1026
|
+
region: "CO",
|
|
1027
|
+
children: /* @__PURE__ */ jsx14(MapPickerContent, { ...props })
|
|
1028
|
+
}
|
|
1029
|
+
);
|
|
971
1030
|
|
|
972
1031
|
// src/components/form-fields/map-picker-field.tsx
|
|
973
|
-
import { jsx as
|
|
1032
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
974
1033
|
var MapPickerField = ({
|
|
975
1034
|
control,
|
|
976
1035
|
label,
|
|
@@ -979,45 +1038,44 @@ var MapPickerField = ({
|
|
|
979
1038
|
name,
|
|
980
1039
|
visualRequired,
|
|
981
1040
|
...pickerProps
|
|
982
|
-
}) => /* @__PURE__ */
|
|
1041
|
+
}) => /* @__PURE__ */ jsx15(
|
|
983
1042
|
FormField,
|
|
984
1043
|
{
|
|
985
1044
|
control,
|
|
986
1045
|
name,
|
|
987
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
] })
|
|
1046
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx15(
|
|
1047
|
+
FormFieldShell,
|
|
1048
|
+
{
|
|
1049
|
+
hasError: !!fieldState.error,
|
|
1050
|
+
label,
|
|
1051
|
+
labelClassName,
|
|
1052
|
+
mainClassName,
|
|
1053
|
+
name,
|
|
1054
|
+
visualRequired,
|
|
1055
|
+
children: /* @__PURE__ */ jsx15(
|
|
1056
|
+
GoogleMapPicker,
|
|
1057
|
+
{
|
|
1058
|
+
...pickerProps,
|
|
1059
|
+
hasError: !!fieldState.error,
|
|
1060
|
+
onChange: field.onChange,
|
|
1061
|
+
value: field.value ?? ""
|
|
1062
|
+
}
|
|
1063
|
+
)
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1008
1066
|
}
|
|
1009
1067
|
);
|
|
1010
1068
|
|
|
1011
1069
|
// src/components/otp-input.tsx
|
|
1012
1070
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1013
1071
|
import React8 from "react";
|
|
1014
|
-
import { jsx as
|
|
1072
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1015
1073
|
function InputOTP({
|
|
1016
1074
|
className,
|
|
1017
1075
|
containerClassName,
|
|
1018
1076
|
...props
|
|
1019
1077
|
}) {
|
|
1020
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ jsx16(
|
|
1021
1079
|
OTPInput,
|
|
1022
1080
|
{
|
|
1023
1081
|
className: cn("disabled:cursor-not-allowed", className),
|
|
@@ -1028,7 +1086,7 @@ function InputOTP({
|
|
|
1028
1086
|
);
|
|
1029
1087
|
}
|
|
1030
1088
|
function InputOTPGroup({ className, ...props }) {
|
|
1031
|
-
return /* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ jsx16("div", { className: cn("flex items-center gap-2", className), "data-slot": "input-otp-group", ...props });
|
|
1032
1090
|
}
|
|
1033
1091
|
function InputOTPSlot({
|
|
1034
1092
|
className,
|
|
@@ -1052,14 +1110,14 @@ function InputOTPSlot({
|
|
|
1052
1110
|
...props,
|
|
1053
1111
|
children: [
|
|
1054
1112
|
char,
|
|
1055
|
-
hasFakeCaret && /* @__PURE__ */
|
|
1113
|
+
hasFakeCaret && /* @__PURE__ */ jsx16("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx16("div", { className: "animate-caret-blink bg-foreground h-6 w-px duration-1000" }) })
|
|
1056
1114
|
]
|
|
1057
1115
|
}
|
|
1058
1116
|
);
|
|
1059
1117
|
}
|
|
1060
1118
|
|
|
1061
1119
|
// src/components/form-fields/otp-field.tsx
|
|
1062
|
-
import { jsx as
|
|
1120
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1063
1121
|
function OTPField({
|
|
1064
1122
|
autoFocus,
|
|
1065
1123
|
className,
|
|
@@ -1069,16 +1127,25 @@ function OTPField({
|
|
|
1069
1127
|
label,
|
|
1070
1128
|
labelClassName,
|
|
1071
1129
|
name,
|
|
1072
|
-
otpLength = 6
|
|
1130
|
+
otpLength = 6,
|
|
1131
|
+
visualRequired
|
|
1073
1132
|
}) {
|
|
1074
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ jsx17(
|
|
1075
1134
|
FormField,
|
|
1076
1135
|
{
|
|
1077
1136
|
control,
|
|
1078
1137
|
name,
|
|
1079
1138
|
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs13(FormItem, { className: cn("flex flex-col", className), children: [
|
|
1080
|
-
label ? /* @__PURE__ */
|
|
1081
|
-
|
|
1139
|
+
label ? /* @__PURE__ */ jsx17(
|
|
1140
|
+
LabelField,
|
|
1141
|
+
{
|
|
1142
|
+
label,
|
|
1143
|
+
labelClassName: cn(labelClassName, fieldState.invalid && "text-destructive"),
|
|
1144
|
+
name,
|
|
1145
|
+
visualRequired
|
|
1146
|
+
}
|
|
1147
|
+
) : null,
|
|
1148
|
+
/* @__PURE__ */ jsx17(FormControl, { children: /* @__PURE__ */ jsx17(
|
|
1082
1149
|
InputOTP,
|
|
1083
1150
|
{
|
|
1084
1151
|
"aria-invalid": fieldState.invalid || void 0,
|
|
@@ -1093,31 +1160,31 @@ function OTPField({
|
|
|
1093
1160
|
onPaste: (e) => field.onChange(e.clipboardData.getData("text")),
|
|
1094
1161
|
pattern: "[0-9]*",
|
|
1095
1162
|
value: field.value ?? "",
|
|
1096
|
-
children: /* @__PURE__ */
|
|
1163
|
+
children: /* @__PURE__ */ jsx17(InputOTPGroup, { children: Array.from({ length: otpLength }).map((_, i) => /* @__PURE__ */ jsx17(InputOTPSlot, { "aria-invalid": fieldState.invalid || void 0, index: i }, i)) })
|
|
1097
1164
|
}
|
|
1098
1165
|
) }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ jsx17(FormMessage, {})
|
|
1100
1167
|
] })
|
|
1101
1168
|
}
|
|
1102
1169
|
);
|
|
1103
1170
|
}
|
|
1104
1171
|
|
|
1105
1172
|
// src/components/select-input.tsx
|
|
1106
|
-
import { CaretDownIcon, CaretUpIcon, ClockIcon, XIcon as
|
|
1107
|
-
import { cloneElement, useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1173
|
+
import { CaretDownIcon, CaretUpIcon, ClockIcon, XIcon as XIcon3 } from "@phosphor-icons/react";
|
|
1174
|
+
import { cloneElement, useCallback as useCallback2, useEffect as useEffect3, useId as useId2, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1108
1175
|
|
|
1109
1176
|
// src/components/popover.tsx
|
|
1110
1177
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1111
1178
|
import * as React9 from "react";
|
|
1112
|
-
import { jsx as
|
|
1179
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1113
1180
|
var Popover = PopoverPrimitive.Root;
|
|
1114
1181
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1115
|
-
var PopoverContent = React9.forwardRef(({ align = "center", className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
1182
|
+
var PopoverContent = React9.forwardRef(({ align = "center", className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx18(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx18(
|
|
1116
1183
|
PopoverPrimitive.Content,
|
|
1117
1184
|
{
|
|
1118
1185
|
align,
|
|
1119
1186
|
className: cn(
|
|
1120
|
-
|
|
1187
|
+
`text-foreground bg-surface data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ${zPopover} w-72 rounded-md border p-4 shadow-md outline-none`,
|
|
1121
1188
|
className
|
|
1122
1189
|
),
|
|
1123
1190
|
ref,
|
|
@@ -1163,7 +1230,7 @@ function usePopoverWidth() {
|
|
|
1163
1230
|
}
|
|
1164
1231
|
|
|
1165
1232
|
// src/components/select-input.tsx
|
|
1166
|
-
import { Fragment as Fragment3, jsx as
|
|
1233
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1167
1234
|
var SelectInput = (props) => {
|
|
1168
1235
|
const t = useUiT();
|
|
1169
1236
|
const {
|
|
@@ -1189,6 +1256,7 @@ var SelectInput = (props) => {
|
|
|
1189
1256
|
valueKey = "value"
|
|
1190
1257
|
} = props;
|
|
1191
1258
|
const resolvedPlaceholder = placeholder ?? t("selectInput.placeholder");
|
|
1259
|
+
const listboxId = useId2();
|
|
1192
1260
|
const [open, setOpen] = useState4(false);
|
|
1193
1261
|
const [valueItem, setValueItem] = useState4(value);
|
|
1194
1262
|
const { ref: divRef, width } = usePopoverWidth();
|
|
@@ -1225,95 +1293,102 @@ var SelectInput = (props) => {
|
|
|
1225
1293
|
useEffect3(() => {
|
|
1226
1294
|
setValueItem(value);
|
|
1227
1295
|
}, [value]);
|
|
1228
|
-
return /* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1296
|
+
return /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ jsxs14("div", { className: "relative flex flex-col justify-center", children: [
|
|
1297
|
+
/* @__PURE__ */ jsxs14(Popover, { onOpenChange: setOpen, open, children: [
|
|
1298
|
+
/* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
1299
|
+
Button,
|
|
1300
|
+
{
|
|
1301
|
+
"aria-controls": listboxId,
|
|
1302
|
+
"aria-expanded": open,
|
|
1303
|
+
"aria-haspopup": "listbox",
|
|
1304
|
+
className: buttonClassName,
|
|
1305
|
+
disabled,
|
|
1306
|
+
isLoading: loading,
|
|
1307
|
+
onBlur,
|
|
1308
|
+
ref: divRef,
|
|
1309
|
+
role: "combobox",
|
|
1310
|
+
variant: "primary",
|
|
1311
|
+
children: loading ? /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1312
|
+
loadingLabel ?? t("selectInput.loading"),
|
|
1313
|
+
" ",
|
|
1314
|
+
/* @__PURE__ */ jsx19(Spinner, {})
|
|
1315
|
+
] }) : /* @__PURE__ */ jsxs14("div", { className: "relative flex h-5 w-full items-center", children: [
|
|
1316
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex w-full max-w-[90%] items-center truncate", children: [
|
|
1317
|
+
leftIcon && /* @__PURE__ */ jsx19("span", { className: "mr-2 shrink-0", children: cloneElement(leftIcon, { size: 20, strokeWidth: 1 }) }),
|
|
1318
|
+
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */ jsx19("span", { className: cn(inputPlaceholder, placeholderClassName), children: resolvedPlaceholder })
|
|
1319
|
+
] }),
|
|
1320
|
+
timeField ? /* @__PURE__ */ jsx19("div", { className: "absolute top-0.5 right-0", children: /* @__PURE__ */ jsx19(ClockIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }) }) : /* @__PURE__ */ jsxs14("div", { className: "absolute top-0.5 right-0 flex gap-2", children: [
|
|
1321
|
+
ableDeleteOption && /* @__PURE__ */ jsx19("div", { "aria-hidden": true, className: "h-4 w-4 shrink-0" }),
|
|
1322
|
+
!open ? /* @__PURE__ */ jsx19(CaretDownIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }) : /* @__PURE__ */ jsx19(CaretUpIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1323
|
+
] })
|
|
1324
|
+
] })
|
|
1325
|
+
}
|
|
1326
|
+
) }),
|
|
1327
|
+
/* @__PURE__ */ jsx19(
|
|
1328
|
+
PopoverContent,
|
|
1329
|
+
{
|
|
1330
|
+
className: cn("bg-surface border-border rounded-sm p-1", zPopoverAboveDialog),
|
|
1331
|
+
id: listboxId,
|
|
1332
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1333
|
+
style: { maxWidth: "auto", minWidth: `${width}px`, width: `${width}px` },
|
|
1334
|
+
children: /* @__PURE__ */ jsxs14(Command, { className: "flex w-full flex-col gap-2", children: [
|
|
1335
|
+
search && /* @__PURE__ */ jsx19(
|
|
1336
|
+
Input,
|
|
1252
1337
|
{
|
|
1253
|
-
className: "
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
onChange?.("");
|
|
1258
|
-
onValueChange("");
|
|
1259
|
-
setValueItem("");
|
|
1260
|
-
setQuery("");
|
|
1261
|
-
setOpen(false);
|
|
1262
|
-
}
|
|
1338
|
+
className: "mb-1 rounded-sm",
|
|
1339
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1340
|
+
placeholder: searchPlaceholder ?? t("selectInput.search"),
|
|
1341
|
+
value: query
|
|
1263
1342
|
}
|
|
1264
1343
|
),
|
|
1265
|
-
|
|
1344
|
+
/* @__PURE__ */ jsx19(CommandEmpty, { className: "text-center", children: noResultsLabel ?? t("selectInput.noResults") }),
|
|
1345
|
+
/* @__PURE__ */ jsx19(CommandList, { children: /* @__PURE__ */ jsx19(CommandGroup, { className: "p-0", children: filteredOptions.map((item) => {
|
|
1346
|
+
const labelValue = item[labelKey];
|
|
1347
|
+
const valueValue = item[valueKey];
|
|
1348
|
+
return /* @__PURE__ */ jsx19(
|
|
1349
|
+
CommandItem,
|
|
1350
|
+
{
|
|
1351
|
+
className: cn(
|
|
1352
|
+
"hover:bg-hover mt-0.5 mb-0.5 flex cursor-pointer items-center gap-2 rounded-sm py-2 pl-3",
|
|
1353
|
+
valueValue === value && "bg-inactive"
|
|
1354
|
+
),
|
|
1355
|
+
onSelect: (currentValue) => {
|
|
1356
|
+
onChange?.(currentValue);
|
|
1357
|
+
onValueChange(currentValue);
|
|
1358
|
+
setOpen(false);
|
|
1359
|
+
setTimeout(() => setQuery(""), 100);
|
|
1360
|
+
},
|
|
1361
|
+
value: valueValue,
|
|
1362
|
+
children: labelValue.trim()
|
|
1363
|
+
},
|
|
1364
|
+
valueValue
|
|
1365
|
+
);
|
|
1366
|
+
}) }) })
|
|
1266
1367
|
] })
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
|
|
1368
|
+
}
|
|
1369
|
+
)
|
|
1370
|
+
] }),
|
|
1371
|
+
ableDeleteOption && !loading && !timeField && /* @__PURE__ */ jsx19(
|
|
1372
|
+
"button",
|
|
1272
1373
|
{
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
),
|
|
1286
|
-
/* @__PURE__ */ jsx18(CommandEmpty, { className: "text-center", children: noResultsLabel ?? t("selectInput.noResults") }),
|
|
1287
|
-
/* @__PURE__ */ jsx18(CommandList, { children: /* @__PURE__ */ jsx18(CommandGroup, { className: "p-0", children: filteredOptions.map((item) => {
|
|
1288
|
-
const labelValue = item[labelKey];
|
|
1289
|
-
const valueValue = item[valueKey];
|
|
1290
|
-
return /* @__PURE__ */ jsx18(
|
|
1291
|
-
CommandItem,
|
|
1292
|
-
{
|
|
1293
|
-
className: cn(
|
|
1294
|
-
"hover:bg-hover mt-0.5 mb-0.5 flex cursor-pointer items-center gap-2 rounded-sm py-2 pl-3",
|
|
1295
|
-
valueValue === value && "bg-inactive"
|
|
1296
|
-
),
|
|
1297
|
-
onSelect: (currentValue) => {
|
|
1298
|
-
onChange?.(currentValue);
|
|
1299
|
-
onValueChange(currentValue);
|
|
1300
|
-
setOpen(false);
|
|
1301
|
-
setTimeout(() => setQuery(""), 100);
|
|
1302
|
-
},
|
|
1303
|
-
value: valueValue,
|
|
1304
|
-
children: labelValue.trim()
|
|
1305
|
-
},
|
|
1306
|
-
valueValue
|
|
1307
|
-
);
|
|
1308
|
-
}) }) })
|
|
1309
|
-
] })
|
|
1374
|
+
"aria-label": t("selectInput.clear"),
|
|
1375
|
+
className: "absolute top-1/2 right-9 z-10 flex h-4 w-4 -translate-y-1/2 items-center justify-center",
|
|
1376
|
+
onClick: () => {
|
|
1377
|
+
onChange?.("");
|
|
1378
|
+
onValueChange("");
|
|
1379
|
+
setValueItem("");
|
|
1380
|
+
setQuery("");
|
|
1381
|
+
setOpen(false);
|
|
1382
|
+
},
|
|
1383
|
+
type: "button",
|
|
1384
|
+
children: /* @__PURE__ */ jsx19(XIcon3, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1310
1385
|
}
|
|
1311
1386
|
)
|
|
1312
|
-
] }) })
|
|
1387
|
+
] }) });
|
|
1313
1388
|
};
|
|
1314
1389
|
|
|
1315
1390
|
// src/components/form-fields/select-field.tsx
|
|
1316
|
-
import { jsx as
|
|
1391
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1317
1392
|
var SelectField = ({
|
|
1318
1393
|
ableDeleteOption,
|
|
1319
1394
|
className,
|
|
@@ -1323,44 +1398,47 @@ var SelectField = ({
|
|
|
1323
1398
|
labelClassName,
|
|
1324
1399
|
mainClassName,
|
|
1325
1400
|
name,
|
|
1401
|
+
onChange,
|
|
1326
1402
|
options,
|
|
1327
1403
|
placeholder,
|
|
1328
1404
|
search,
|
|
1329
1405
|
visualRequired
|
|
1330
1406
|
}) => {
|
|
1331
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsx20(
|
|
1332
1408
|
FormField,
|
|
1333
1409
|
{
|
|
1334
1410
|
control,
|
|
1335
1411
|
name,
|
|
1336
1412
|
render: ({ field, fieldState }) => {
|
|
1337
1413
|
const hasError = !!fieldState.error;
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1414
|
+
return /* @__PURE__ */ jsx20(
|
|
1415
|
+
FormFieldShell,
|
|
1416
|
+
{
|
|
1417
|
+
hasError,
|
|
1418
|
+
label,
|
|
1419
|
+
labelClassName,
|
|
1420
|
+
mainClassName,
|
|
1421
|
+
name,
|
|
1422
|
+
visualRequired,
|
|
1423
|
+
children: /* @__PURE__ */ jsx20(
|
|
1424
|
+
SelectInput,
|
|
1425
|
+
{
|
|
1426
|
+
ableDeleteOption,
|
|
1427
|
+
className,
|
|
1428
|
+
disabled,
|
|
1429
|
+
error: fieldState.error,
|
|
1430
|
+
items: options,
|
|
1431
|
+
onChange: (...args) => {
|
|
1432
|
+
field.onChange(...args);
|
|
1433
|
+
onChange?.(...args);
|
|
1434
|
+
},
|
|
1435
|
+
placeholder,
|
|
1436
|
+
search,
|
|
1437
|
+
value: typeof field.value === "number" ? `${field.value}` : field.value
|
|
1438
|
+
}
|
|
1439
|
+
)
|
|
1440
|
+
}
|
|
1441
|
+
);
|
|
1364
1442
|
}
|
|
1365
1443
|
}
|
|
1366
1444
|
);
|
|
@@ -1368,13 +1446,13 @@ var SelectField = ({
|
|
|
1368
1446
|
|
|
1369
1447
|
// src/components/password-checklist.tsx
|
|
1370
1448
|
import { CheckCircleIcon as CheckCircleIcon2, XCircleIcon } from "@phosphor-icons/react";
|
|
1371
|
-
import { jsx as
|
|
1449
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1372
1450
|
var PasswordChecklist = ({ className, rules, value }) => {
|
|
1373
1451
|
if (rules.length === 0) return null;
|
|
1374
|
-
return /* @__PURE__ */
|
|
1452
|
+
return /* @__PURE__ */ jsx21("ul", { className: cn("flex flex-col gap-1", className), children: rules.map((rule) => {
|
|
1375
1453
|
const isMet = rule.test(value);
|
|
1376
1454
|
const Icon = isMet ? CheckCircleIcon2 : XCircleIcon;
|
|
1377
|
-
return /* @__PURE__ */
|
|
1455
|
+
return /* @__PURE__ */ jsxs15(
|
|
1378
1456
|
"li",
|
|
1379
1457
|
{
|
|
1380
1458
|
className: cn(
|
|
@@ -1382,8 +1460,8 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1382
1460
|
isMet ? "text-success" : "text-inactive-text"
|
|
1383
1461
|
),
|
|
1384
1462
|
children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ jsx21(Icon, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }),
|
|
1464
|
+
/* @__PURE__ */ jsx21("span", { children: rule.label })
|
|
1387
1465
|
]
|
|
1388
1466
|
},
|
|
1389
1467
|
rule.key
|
|
@@ -1392,22 +1470,22 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1392
1470
|
};
|
|
1393
1471
|
|
|
1394
1472
|
// src/components/step-header.tsx
|
|
1395
|
-
import { jsx as
|
|
1396
|
-
var StepHeader = ({ subtitle, subtitleClassName, title }) => /* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
subtitle !== void 0 && /* @__PURE__ */
|
|
1473
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1474
|
+
var StepHeader = ({ subtitle, subtitleClassName, title }) => /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1", children: [
|
|
1475
|
+
/* @__PURE__ */ jsx22("h1", { className: "text-title text-2xl font-bold", children: title }),
|
|
1476
|
+
subtitle !== void 0 && /* @__PURE__ */ jsx22("p", { className: cn("text-subtitle text-sm", subtitleClassName), children: subtitle })
|
|
1399
1477
|
] });
|
|
1400
1478
|
|
|
1401
1479
|
// src/components/stepper.tsx
|
|
1402
1480
|
import { CheckIcon } from "@phosphor-icons/react";
|
|
1403
|
-
import { jsx as
|
|
1481
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1404
1482
|
var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
1405
|
-
return /* @__PURE__ */
|
|
1483
|
+
return /* @__PURE__ */ jsx23("div", { className: cn("flex w-full items-start", className), children: steps.map((step, index) => {
|
|
1406
1484
|
const isCompleted = intermediate ? index <= activeIndex : index < activeIndex;
|
|
1407
1485
|
const isActive = !intermediate && index === activeIndex;
|
|
1408
|
-
return /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-1 flex-col items-center", children: [
|
|
1487
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center", children: [
|
|
1488
|
+
/* @__PURE__ */ jsx23(
|
|
1411
1489
|
"div",
|
|
1412
1490
|
{
|
|
1413
1491
|
className: cn(
|
|
@@ -1417,7 +1495,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1417
1495
|
)
|
|
1418
1496
|
}
|
|
1419
1497
|
),
|
|
1420
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ jsx23(
|
|
1421
1499
|
"div",
|
|
1422
1500
|
{
|
|
1423
1501
|
"aria-current": isActive ? "step" : void 0,
|
|
@@ -1427,10 +1505,10 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1427
1505
|
isActive && "bg-primary border-primary text-inverse",
|
|
1428
1506
|
!isCompleted && !isActive && "bg-inactive border-inactive text-surface"
|
|
1429
1507
|
),
|
|
1430
|
-
children: isCompleted ? /* @__PURE__ */
|
|
1508
|
+
children: isCompleted ? /* @__PURE__ */ jsx23(CheckIcon, { className: "h-4 w-4" }) : index + 1
|
|
1431
1509
|
}
|
|
1432
1510
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ jsx23(
|
|
1434
1512
|
"div",
|
|
1435
1513
|
{
|
|
1436
1514
|
className: cn(
|
|
@@ -1438,7 +1516,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1438
1516
|
isCompleted ? "bg-primary" : "bg-inactive",
|
|
1439
1517
|
index === steps.length - 1 && "rounded-r-full"
|
|
1440
1518
|
),
|
|
1441
|
-
children: index === 0 && /* @__PURE__ */
|
|
1519
|
+
children: index === 0 && /* @__PURE__ */ jsx23(
|
|
1442
1520
|
"div",
|
|
1443
1521
|
{
|
|
1444
1522
|
className: cn(
|
|
@@ -1450,18 +1528,18 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1450
1528
|
}
|
|
1451
1529
|
)
|
|
1452
1530
|
] }),
|
|
1453
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ jsx23("span", { className: cn("mt-1 text-xs font-normal", isCompleted || isActive ? "text-primary" : "text-muted"), children: step.label })
|
|
1454
1532
|
] }, step.label);
|
|
1455
1533
|
}) });
|
|
1456
1534
|
};
|
|
1457
1535
|
|
|
1458
1536
|
// src/components/toast/toast.tsx
|
|
1459
|
-
import { CheckIcon as CheckIcon2, FileLockIcon, InfoIcon as InfoIcon2, WarningIcon as WarningIcon2, XIcon as
|
|
1537
|
+
import { CheckIcon as CheckIcon2, FileLockIcon, InfoIcon as InfoIcon2, WarningIcon as WarningIcon2, XIcon as XIcon4 } from "@phosphor-icons/react";
|
|
1460
1538
|
import { useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
|
|
1461
|
-
import { jsx as
|
|
1539
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1462
1540
|
var EXIT_ANIMATION_MS = 200;
|
|
1463
1541
|
var typeIcons = {
|
|
1464
|
-
destructive:
|
|
1542
|
+
destructive: XIcon4,
|
|
1465
1543
|
info: InfoIcon2,
|
|
1466
1544
|
success: CheckIcon2,
|
|
1467
1545
|
wait: FileLockIcon,
|
|
@@ -1495,11 +1573,11 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1495
1573
|
if (exitRef.current) clearTimeout(exitRef.current);
|
|
1496
1574
|
};
|
|
1497
1575
|
}, [id, duration, onClose]);
|
|
1498
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ jsxs18(
|
|
1499
1577
|
"div",
|
|
1500
1578
|
{
|
|
1501
1579
|
"aria-live": "polite",
|
|
1502
|
-
className:
|
|
1580
|
+
className: cn(
|
|
1503
1581
|
"relative",
|
|
1504
1582
|
leaving ? "absolute top-0 right-0 left-0" : "",
|
|
1505
1583
|
"flex w-108.5 max-w-[calc(100vw-2rem)] items-center justify-between",
|
|
@@ -1510,20 +1588,16 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1510
1588
|
"transition-all duration-200 ease-out",
|
|
1511
1589
|
styles.border,
|
|
1512
1590
|
leaving ? "translate-y-2 opacity-0" : "translate-y-0 opacity-100"
|
|
1513
|
-
|
|
1591
|
+
),
|
|
1514
1592
|
role: "status",
|
|
1515
1593
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
subtitle ? /* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx24("div", { className: "min-w-0 pr-4", children: /* @__PURE__ */ jsx24("h4", { className: cn("text-[16px] leading-normal font-semibold", "text-foreground", "line-clamp-2"), children: title }) }),
|
|
1595
|
+
subtitle ? /* @__PURE__ */ jsx24("div", { className: "shrink-0 pr-4 text-left", children: /* @__PURE__ */ jsx24("div", { className: cn("max-w-28 text-[14px] leading-[19.5px] font-normal", "text-body"), children: subtitle }) }) : null,
|
|
1596
|
+
/* @__PURE__ */ jsx24(
|
|
1519
1597
|
"div",
|
|
1520
1598
|
{
|
|
1521
|
-
className:
|
|
1522
|
-
|
|
1523
|
-
"flex h-8 w-8 min-w-8 items-center justify-center rounded-full border-2",
|
|
1524
|
-
styles.iconBorder
|
|
1525
|
-
].join(" "),
|
|
1526
|
-
children: /* @__PURE__ */ jsx23(Icon, { className: ["h-5 w-5", styles.icon].join(" ") })
|
|
1599
|
+
className: cn("shrink-0", "flex h-8 w-8 min-w-8 items-center justify-center rounded-full border-2", styles.iconBorder),
|
|
1600
|
+
children: /* @__PURE__ */ jsx24(Icon, { className: cn("h-5 w-5", styles.icon) })
|
|
1527
1601
|
}
|
|
1528
1602
|
)
|
|
1529
1603
|
]
|
|
@@ -1533,7 +1607,7 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1533
1607
|
|
|
1534
1608
|
// src/components/toast/toast-provider.tsx
|
|
1535
1609
|
import { useCallback as useCallback3, useEffect as useEffect5, useLayoutEffect, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
1536
|
-
import { Fragment as Fragment4, jsx as
|
|
1610
|
+
import { Fragment as Fragment4, jsx as jsx25 } from "react/jsx-runtime";
|
|
1537
1611
|
function ToastProvider() {
|
|
1538
1612
|
const [toasts, setToasts] = useState6([]);
|
|
1539
1613
|
const itemRefs = useRef4(/* @__PURE__ */ new Map());
|
|
@@ -1594,7 +1668,7 @@ function ToastProvider() {
|
|
|
1594
1668
|
itemRefs.current.set(id, el);
|
|
1595
1669
|
};
|
|
1596
1670
|
}, []);
|
|
1597
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ jsx25(Fragment4, { children: Object.entries(grouped).map(([position, list]) => /* @__PURE__ */ jsx25("div", { className: `fixed ${zToast} ${getPositionClass(position)}`, children: /* @__PURE__ */ jsx25("div", { className: "relative flex flex-col gap-3", children: list.map((toast2) => /* @__PURE__ */ jsx25("div", { ref: setItemRef(toast2.id), children: /* @__PURE__ */ jsx25(
|
|
1598
1672
|
Toast,
|
|
1599
1673
|
{
|
|
1600
1674
|
duration: toast2.duration,
|
|
@@ -1622,9 +1696,9 @@ function getPositionClass(position) {
|
|
|
1622
1696
|
}
|
|
1623
1697
|
|
|
1624
1698
|
// src/components/wrapper.tsx
|
|
1625
|
-
import { jsx as
|
|
1699
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1626
1700
|
var Wrapper = ({ children, className }) => {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ jsx26("div", { className: cn("mx-auto h-full w-full", className), children });
|
|
1628
1702
|
};
|
|
1629
1703
|
export {
|
|
1630
1704
|
Alert,
|