@pagamio/frontend-commons-lib 0.8.346 → 0.8.348
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/lib/components/ui/Dialog.js +6 -2
- package/lib/components/ui/Popover.js +5 -1
- package/lib/components/ui/Select.js +7 -1
- package/lib/components/ui/Sheet.js +5 -2
- package/lib/components/ui/Tooltip.js +4 -1
- package/lib/form-engine/components/inputs/searchable-combobox/SearchableComboboxInput.js +1 -1
- package/lib/form-engine/components/inputs/searchable-multi-combobox/SearchableMultiComboboxInput.js +1 -1
- package/lib/styles.css +6 -3
- package/package.json +1 -1
|
@@ -7,9 +7,13 @@ const Dialog = DialogPrimitive.Root;
|
|
|
7
7
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
8
|
const DialogPortal = DialogPrimitive.Portal;
|
|
9
9
|
const DialogClose = DialogPrimitive.Close;
|
|
10
|
-
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn(
|
|
10
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn(
|
|
11
|
+
// z-[210] so a Dialog opened from inside a Modal (z-[200]) renders
|
|
12
|
+
// above it. Overlay + content paired at the same layer; DOM order
|
|
13
|
+
// puts content above overlay within the same stacking context.
|
|
14
|
+
'fixed inset-0 z-[210] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
|
|
11
15
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
12
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-
|
|
16
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-[210] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-popover text-popover-foreground p-6 shadow-lg duration-200 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%] sm:rounded-lg', className), style: {
|
|
13
17
|
backgroundColor: 'hsl(var(--popover))',
|
|
14
18
|
borderColor: 'hsl(var(--border))',
|
|
15
19
|
}, ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(Cross2Icon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
@@ -5,7 +5,11 @@ import { cn } from '../../helpers';
|
|
|
5
5
|
const Popover = PopoverPrimitive.Root;
|
|
6
6
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
7
7
|
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
8
|
-
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn(
|
|
8
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn(
|
|
9
|
+
// z-[210] keeps the popover above modals (z-[200] on Modal.tsx)
|
|
10
|
+
// when used inside one. Without this, opening a Popover from a
|
|
11
|
+
// modal renders the popover beneath the modal layer.
|
|
12
|
+
'z-[210] w-72 rounded-md border p-4 shadow-md outline-none', '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', className), style: {
|
|
9
13
|
backgroundColor: 'hsl(var(--popover, 0 0% 100%))',
|
|
10
14
|
color: 'hsl(var(--popover-foreground, 240 10% 3.9%))',
|
|
11
15
|
borderColor: 'hsl(var(--border, 240 5.9% 90%))',
|
|
@@ -43,7 +43,13 @@ const SelectContent = React.forwardRef(({ className, children, position = 'poppe
|
|
|
43
43
|
};
|
|
44
44
|
setFilteredChildren(filterChildren(children));
|
|
45
45
|
}, [searchTerm, children]);
|
|
46
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn(
|
|
46
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn(
|
|
47
|
+
// z-[210] keeps the dropdown above modals (z-[200] on Modal.tsx).
|
|
48
|
+
// Without this, a Select used inside a Modal portals correctly
|
|
49
|
+
// but its popper renders beneath the modal layer — the dropdown
|
|
50
|
+
// is open but invisible. NavbarV2 sits at z-100, so this also
|
|
51
|
+
// remains above the navbar in non-modal contexts.
|
|
52
|
+
'z-[210] relative min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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', position === 'popper' &&
|
|
47
53
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), style: {}, position: position, ...props, children: [_jsx("div", { className: "p-2 border-b border-border", children: _jsx("input", { type: "text", placeholder: "Search...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full px-2 py-1 text-sm border border-input rounded bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring", onKeyDown: (e) => {
|
|
48
54
|
e.stopPropagation();
|
|
49
55
|
} }) }), _jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1 max-h-[200px] overflow-y-auto', position === 'popper' && 'w-full min-w-[var(--radix-select-trigger-width)]'), children: filteredChildren.length > 0 ? (filteredChildren) : (_jsx("div", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: "No options found" })) }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
@@ -9,9 +9,12 @@ const SheetTrigger = SheetPrimitive.Trigger;
|
|
|
9
9
|
const SheetRoot = SheetPrimitive.Root;
|
|
10
10
|
const SheetClose = SheetPrimitive.Close;
|
|
11
11
|
const SheetPortal = SheetPrimitive.Portal;
|
|
12
|
-
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Overlay, { className: cn(
|
|
12
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Overlay, { className: cn(
|
|
13
|
+
// z-[210] so a Sheet opened from inside a Modal (z-[200]) renders
|
|
14
|
+
// above it. Overlay + content paired at the same layer.
|
|
15
|
+
'fixed inset-0 z-[210] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props, ref: ref })));
|
|
13
16
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
14
|
-
const sheetVariants = cva('fixed z-
|
|
17
|
+
const sheetVariants = cva('fixed z-[210] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out', {
|
|
15
18
|
variants: {
|
|
16
19
|
side: {
|
|
17
20
|
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
@@ -5,6 +5,9 @@ import { cn } from '../../helpers/utils';
|
|
|
5
5
|
const TooltipProvider = TooltipPrimitive.Provider;
|
|
6
6
|
const Tooltip = TooltipPrimitive.Root;
|
|
7
7
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
8
|
-
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn(
|
|
8
|
+
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn(
|
|
9
|
+
// z-[210] keeps the tooltip above modals (z-[200] on Modal.tsx)
|
|
10
|
+
// when triggered from inside one.
|
|
11
|
+
'z-[210] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md', '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', className), ...props }) })));
|
|
9
12
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
10
13
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -34,7 +34,7 @@ const SearchableComboboxInput = forwardRef(({ field, value, onChange }, ref) =>
|
|
|
34
34
|
debounceMs: source.debounceMs,
|
|
35
35
|
restoreIds,
|
|
36
36
|
});
|
|
37
|
-
return (
|
|
37
|
+
return (_jsxs("div", { ref: ref, children: [field.label && (_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-foreground mb-1", children: field.label })), _jsx(PagamioSearchableCombobox, { combobox: combobox, value: value ?? null, onChange: (id) => onChange?.(id), placeholder: field.placeholder, disabled: field.disabled, required: field.validation?.required ? true : undefined, name: field.name, getLabel: source.getLabel })] }));
|
|
38
38
|
});
|
|
39
39
|
SearchableComboboxInput.displayName = 'SearchableComboboxInput';
|
|
40
40
|
export default SearchableComboboxInput;
|
package/lib/form-engine/components/inputs/searchable-multi-combobox/SearchableMultiComboboxInput.js
CHANGED
|
@@ -32,7 +32,7 @@ const SearchableMultiComboboxInput = forwardRef(({ field, value, onChange }, ref
|
|
|
32
32
|
debounceMs: source.debounceMs,
|
|
33
33
|
restoreIds,
|
|
34
34
|
});
|
|
35
|
-
return (
|
|
35
|
+
return (_jsxs("div", { ref: ref, children: [field.label && (_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-foreground mb-1", children: field.label })), _jsx(PagamioSearchableMultiCombobox, { combobox: combobox, value: value ?? [], onChange: (ids) => onChange?.(ids), placeholder: field.placeholder, disabled: field.disabled, required: field.validation?.required ? true : undefined, name: field.name, getLabel: source.getLabel })] }));
|
|
36
36
|
});
|
|
37
37
|
SearchableMultiComboboxInput.displayName = 'SearchableMultiComboboxInput';
|
|
38
38
|
export default SearchableMultiComboboxInput;
|
package/lib/styles.css
CHANGED
|
@@ -848,12 +848,15 @@ video {
|
|
|
848
848
|
.z-\[110\] {
|
|
849
849
|
z-index: 110;
|
|
850
850
|
}
|
|
851
|
+
.z-\[200\] {
|
|
852
|
+
z-index: 200;
|
|
853
|
+
}
|
|
854
|
+
.z-\[210\] {
|
|
855
|
+
z-index: 210;
|
|
856
|
+
}
|
|
851
857
|
.z-\[60\] {
|
|
852
858
|
z-index: 60;
|
|
853
859
|
}
|
|
854
|
-
.z-\[70\] {
|
|
855
|
-
z-index: 70;
|
|
856
|
-
}
|
|
857
860
|
.z-\[9999\] {
|
|
858
861
|
z-index: 9999;
|
|
859
862
|
}
|
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.
|
|
4
|
+
"version": "0.8.348",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|