@pagamio/frontend-commons-lib 0.8.273 → 0.8.275

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.
@@ -38,6 +38,6 @@ const TextField = ({ value, placeholder, name, type = 'text', label, error = fal
38
38
  const [showPassword, setShowPassword] = useState(false);
39
39
  // Determine the input type based on whether it's a password field and visibility toggle state
40
40
  const inputType = type === 'password' && showPassword ? 'text' : type;
41
- return (_jsxs("div", { className: "flex flex-col gap-y-2", children: [_jsx(Label, { htmlFor: name, children: label }), _jsxs("div", { className: "relative", children: [_jsx(TextInput, { id: name, color: error ? 'failure' : 'gray', name: name, placeholder: placeholder, type: inputType, required: true, value: value, onChange: (e) => setValue(e.target.value), onBlur: onBlur, onKeyDown: onKeyDown }), helperText && _jsx("span", { className: "text-sm text-red-500 mt-1", children: helperText }), type === 'password' && (_jsx(Button, { type: "button", size: "icon", variant: "ghost", onClick: () => setShowPassword(!showPassword), className: "absolute right-3 top-[0.625rem] text-foreground/70 hover:text-foreground", children: showPassword ? _jsx(HiEyeOff, { className: "h-5 w-5" }) : _jsx(HiEye, { className: "h-5 w-5" }) }))] })] }));
41
+ return (_jsxs("div", { className: "flex flex-col gap-y-2", children: [_jsx(Label, { htmlFor: name, children: label }), _jsxs("div", { className: "relative", children: [_jsx(TextInput, { id: name, color: error ? 'failure' : 'gray', name: name, placeholder: placeholder, type: inputType, required: true, value: value, onChange: (e) => setValue(e.target.value), onBlur: onBlur, onKeyDown: onKeyDown }), helperText && _jsx("span", { className: "text-sm text-red-500 mt-1", children: helperText }), type === 'password' && (_jsx(Button, { type: "button", size: "icon", variant: "ghost", onClick: () => setShowPassword(!showPassword), className: "absolute right-1 top-1/2 -translate-y-1/2 text-foreground/70 hover:text-foreground", children: showPassword ? _jsx(HiEyeOff, { className: "h-5 w-5" }) : _jsx(HiEye, { className: "h-5 w-5" }) }))] })] }));
42
42
  };
43
43
  export default TextField;
@@ -12,9 +12,18 @@ const MultiFormEngineDrawerProviderContext = createContext(undefined);
12
12
  export const MultiFormEngineDrawerProvider = ({ pathname, children }) => {
13
13
  const [drawerStates, setDrawerStates] = useState(new Map());
14
14
  const formDataRef = useRef(new Map());
15
+ const prevPathnameRef = useRef(pathname);
15
16
  useEffect(() => {
16
17
  setupInputRegistry();
17
18
  }, []);
19
+ // Clear drawers synchronously during render when pathname changes
20
+ // (useEffect fires too late, causing the new page to render with compressed layout)
21
+ if (prevPathnameRef.current !== pathname) {
22
+ prevPathnameRef.current = pathname;
23
+ if (drawerStates.size > 0) {
24
+ setDrawerStates(new Map());
25
+ }
26
+ }
18
27
  const handleOpenDrawer = useCallback((key) => {
19
28
  setDrawerStates((prev) => new Map(prev).set(key, true));
20
29
  }, []);
@@ -51,9 +60,6 @@ export const MultiFormEngineDrawerProvider = ({ pathname, children }) => {
51
60
  const hasFormData = useCallback((key) => {
52
61
  return formDataRef.current.has(key);
53
62
  }, []);
54
- useEffect(() => {
55
- setDrawerStates(new Map());
56
- }, [pathname]);
57
63
  const contextValue = useMemo(() => ({
58
64
  isOpen,
59
65
  isAnyDrawerOpen,
package/lib/styles.css CHANGED
@@ -800,9 +800,6 @@ video {
800
800
  .top-4 {
801
801
  top: 1rem;
802
802
  }
803
- .top-\[0\.625rem\] {
804
- top: 0.625rem;
805
- }
806
803
  .top-\[50\%\] {
807
804
  top: 50%;
808
805
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.273",
4
+ "version": "0.8.275",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false