@pagamio/frontend-commons-lib 0.8.246 → 0.8.248

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.
@@ -10,7 +10,7 @@ export function AuthPageLayout({ title, subtitle, errorMessage, showLogo = true,
10
10
  }, renderInAppLayout = false, className = '', horizontal = true, children, appLabel, sideContent, sideContentClass = 'bg-gradient-to-br from-primary-600 to-primary-800' /* TODO: migrate gradient */, footer, }) {
11
11
  // Split-screen layout for when sideContent is provided
12
12
  if (sideContent) {
13
- return (_jsxs("div", { className: `flex h-screen overflow-hidden bg-background ${className}`, children: [_jsx("div", { className: "flex flex-1 flex-col px-4 py-8 sm:px-6 lg:w-1/2 lg:flex-none lg:px-16 xl:px-24 bg-background overflow-y-auto", children: _jsxs("div", { className: "flex flex-col justify-center mx-auto w-full max-w-sm lg:w-[420px] my-auto", children: [_jsxs("div", { className: "flex flex-col items-center text-center", children: [showLogo && logo && (_jsxs("div", { className: "flex flex-col items-center mb-8", children: [_jsx("img", { src: logo.src, alt: logo.alt, width: 180, height: 160, className: `mb-4${logo.darkSrc ? ' dark:hidden' : ''}` }), logo.darkSrc && (_jsx("img", { src: logo.darkSrc, alt: logo.alt, width: 180, height: 160, className: "mb-4 hidden dark:block" })), appLabel && _jsx(AppBanner, { text: appLabel })] })), _jsx("h2", { "data-testid": "auth-page-title", className: "text-2xl font-bold tracking-tight text-neutral-900 sm:text-3xl", children: title }), _jsx("p", { "data-testid": "auth-page-subtitle", className: "mt-2 text-sm text-neutral-600 dark:text-neutral-400", children: subtitle })] }), errorMessage && (_jsx("div", { "data-testid": "login-error-alert", className: "mt-6 rounded-md bg-red-50 p-4 text-sm text-red-700", children: errorMessage })), _jsx("div", { className: "mt-8", children: children }), footer && _jsx("div", { className: "mt-8", children: footer })] }) }), _jsx("div", { className: `relative hidden w-0 flex-1 lg:block lg:w-1/2 overflow-hidden ${sideContentClass}`, children: sideContent })] }));
13
+ return (_jsxs("div", { className: `flex h-screen overflow-hidden bg-background ${className}`, children: [_jsx("div", { className: "flex flex-1 flex-col px-4 py-8 sm:px-6 lg:w-1/2 lg:flex-none lg:px-16 xl:px-24 bg-background overflow-y-auto", children: _jsxs("div", { className: "flex flex-col justify-center mx-auto w-full max-w-sm lg:w-[420px] my-auto", children: [_jsxs("div", { className: "flex flex-col items-center text-center", children: [showLogo && logo && (_jsxs("div", { className: "flex flex-col items-center mb-8", children: [_jsx("img", { src: logo.src, alt: logo.alt, width: 180, height: 160, className: `mb-4${logo.darkSrc ? ' dark:hidden' : ''}` }), logo.darkSrc && (_jsx("img", { src: logo.darkSrc, alt: logo.alt, width: 180, height: 160, className: "mb-4 hidden dark:block" })), appLabel && _jsx(AppBanner, { text: appLabel })] })), _jsx("h2", { "data-testid": "auth-page-title", className: "text-2xl font-bold tracking-tight text-foreground sm:text-3xl", children: title }), _jsx("p", { "data-testid": "auth-page-subtitle", className: "mt-2 text-sm text-muted-foreground", children: subtitle })] }), errorMessage && (_jsx("div", { "data-testid": "login-error-alert", className: "mt-6 rounded-md bg-destructive/10 p-4 text-sm text-destructive", children: errorMessage })), _jsx("div", { className: "mt-8", children: children }), footer && _jsx("div", { className: "mt-8", children: footer })] }) }), _jsx("div", { className: `relative hidden w-0 flex-1 lg:block lg:w-1/2 overflow-hidden ${sideContentClass}`, children: sideContent })] }));
14
14
  }
15
15
  // Original Centered Card Layout
16
16
  return (_jsxs("div", { className: `-my-4 mx-auto flex w-full max-w-[640px] flex-col items-center justify-center px-4 py-8 sm:px-6 ${renderInAppLayout ? 'h-[calc(100vh-64px)]' : 'min-h-screen md:h-screen'} ${className}`, children: [showLogo && logo && (_jsxs("div", { className: "flex flex-col items-center mb-5", children: [_jsx("img", { src: logo.src, alt: logo.alt, width: logo.width, height: logo.height, className: logo.darkSrc ? 'dark:hidden' : undefined }), logo.darkSrc && (_jsx("img", { src: logo.darkSrc, alt: logo.alt, width: logo.width, height: logo.height, className: "hidden dark:block" })), _jsx(AppBanner, { text: appLabel })] })), _jsxs(AuthCard, { className: "p-2 sm:p-3", horizontal: horizontal, children: [_jsxs("div", { children: [_jsx("h2", { "data-testid": "auth-page-title", className: "text-[1.5em] font-bold text-foreground sm:text-[1.875em]", children: title }), _jsx("h2", { "data-testid": "auth-page-subtitle", className: "text-[1em] font-medium text-muted-foreground sm:text-[1em]", children: subtitle })] }), errorMessage && (_jsx("div", { "data-testid": "login-error-alert", className: "mt-4 rounded border border-red-400 bg-red-100 p-2 text-red-700", children: errorMessage })), children] })] }));
@@ -130,7 +130,7 @@ const NavbarV2EnvironmentBanner = ({ show = false, text, bgColor = 'red', color
130
130
  * Uses useSidebar() hook to control sidebar state.
131
131
  * Supports slots, custom renderers, and extensive styling options.
132
132
  */
133
- const NavbarV2 = ({ dashboardLink = '/dashboard', brandImage, linkComponent: LinkComp = 'a', showThemeToggler = true, appLabel, onSelectChangePassword, onSelectProfile, onLogout, hideSidebarToggle = false, navBarActionComponents = [], environmentBanner = { show: false }, navbarBackground = { light: 'bg-[#b45dae]', dark: 'dark:bg-[#b45dae]' }, navbarTextColors = { brand: 'text-white', general: 'text-white' }, slots = {}, renderToggle, renderUserDropdown, renderBrand, renderThemeToggle, fixed = true, zIndex = 100, className, style, showBorder = true, borderColor = { light: 'border-border', dark: '' }, additionalMenuItems, userInfo, }) => {
133
+ const NavbarV2 = ({ dashboardLink = '/dashboard', brandImage, linkComponent: LinkComp = 'a', showThemeToggler = true, appLabel, onSelectChangePassword, onSelectProfile, onLogout, hideSidebarToggle = false, navBarActionComponents = [], environmentBanner = { show: false }, navbarBackground = { light: 'bg-navbar-bg', dark: '' }, navbarTextColors = { brand: 'text-white', general: 'text-white' }, slots = {}, renderToggle, renderUserDropdown, renderBrand, renderThemeToggle, fixed = true, zIndex = 100, className, style, showBorder = true, borderColor = { light: 'border-border', dark: '' }, additionalMenuItems, userInfo, }) => {
134
134
  const { openMobile, isMobile, open, toggleSidebar, config } = useSidebar();
135
135
  const { t } = useTranslation();
136
136
  // Determine toggle state based on viewport
@@ -31,7 +31,7 @@ function CardImage({ imgSrc, imgAlt = '', renderImage, horizontal, }) {
31
31
  return (_jsx("img", { src: imgSrc, alt: imgAlt, className: horizontal ? cardImageClasses.horizontal : cardImageClasses.vertical }));
32
32
  }
33
33
  // ─── Card ─────────────────────────────────────────────────────────────────────
34
- const BASE = 'rounded-xl border border-border bg-background text-foreground shadow-sm ' + 'transition-shadow hover:shadow';
34
+ const BASE = 'rounded-xl border border-border bg-card text-card-foreground shadow-sm ' + 'transition-shadow hover:shadow';
35
35
  const CLICKABLE = 'cursor-pointer hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring';
36
36
  export const Card = React.forwardRef(({ className, children, horizontal = false, href, imgSrc, imgAlt, renderImage, ...rest }, ref) => {
37
37
  const hasImage = !!(imgSrc || renderImage);
@@ -149,8 +149,8 @@ const DateRangePickerWithPresets = ({ value, onChange, presets = defaultDatePres
149
149
  e.stopPropagation();
150
150
  onChange?.(undefined, undefined);
151
151
  };
152
- return (_jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", disabled: disabled, className: cn('w-auto justify-start text-left font-normal', !value && 'text-muted-foreground', className), children: [_jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), _jsx("span", { children: displayText }), showClearButton && value?.from && (_jsx(X, { className: "ml-2 h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer", onClick: handleClear }))] }) }), _jsx(PopoverContent, { className: "w-auto p-0 bg-background border border-border shadow-lg", align: "start", sideOffset: 8, children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "border-r border-border p-2 min-w-[140px] bg-background", children: _jsx("div", { className: "flex flex-col gap-1", children: presets.map((preset) => (_jsx(Button, { type: "button", variant: "ghost", onClick: () => handlePresetSelect(preset), className: cn('text-left px-3 py-2 text-sm rounded-md transition-colors', 'hover:bg-accent hover:text-accent-foreground', tempPreset === preset.value &&
153
- 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground'), children: preset.label }, preset.value))) }) }), tempPreset === 'custom' && (_jsxs("div", { className: "p-3 bg-background", children: [_jsx(Calendar, { mode: "range", defaultMonth: tempRange?.from || new Date(), selected: tempRange, onSelect: handleCalendarSelect, numberOfMonths: numberOfMonths, disabled: (date) => {
152
+ return (_jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", disabled: disabled, className: cn('w-auto justify-start text-left font-normal', !value && 'text-muted-foreground', className), children: [_jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), _jsx("span", { children: displayText }), showClearButton && value?.from && (_jsx(X, { className: "ml-2 h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer", onClick: handleClear }))] }) }), _jsx(PopoverContent, { className: "w-auto p-0 bg-popover text-popover-foreground border border-border shadow-lg", align: "start", sideOffset: 8, children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "border-r border-border p-2 min-w-[140px]", children: _jsx("div", { className: "flex flex-col gap-1", children: presets.map((preset) => (_jsx(Button, { type: "button", variant: "ghost", onClick: () => handlePresetSelect(preset), className: cn('text-left px-3 py-2 text-sm rounded-md transition-colors', 'hover:bg-accent hover:text-accent-foreground', tempPreset === preset.value &&
153
+ 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground'), children: preset.label }, preset.value))) }) }), tempPreset === 'custom' && (_jsxs("div", { className: "p-3", children: [_jsx(Calendar, { mode: "range", defaultMonth: tempRange?.from || new Date(), selected: tempRange, onSelect: handleCalendarSelect, numberOfMonths: numberOfMonths, disabled: (date) => {
154
154
  if (minDate && date < minDate)
155
155
  return true;
156
156
  if (maxDate && date > maxDate)
@@ -9,9 +9,9 @@ const DialogPortal = DialogPrimitive.Portal;
9
9
  const DialogClose = DialogPrimitive.Close;
10
10
  const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 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
11
  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-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background 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
- backgroundColor: 'var(--background, hsl(0 0% 100%))',
14
- borderColor: 'var(--border, hsl(240 5.9% 90%))',
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-50 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
+ backgroundColor: 'hsl(var(--popover))',
14
+ borderColor: 'hsl(var(--border))',
15
15
  }, ...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" })] })] })] })));
16
16
  DialogContent.displayName = DialogPrimitive.Content.displayName;
17
17
  const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Button from './Button';
3
3
  const Card = ({ title, description, children, className = '', showButton, buttonText, buttonVariant = 'primary', handleButtonClick, headerElement, }) => {
4
- return (_jsxs("div", { className: `bg-background border rounded-[10px] shadow-sm ${className}`, children: [(title || description || showButton || headerElement) && (_jsx("div", { className: "p-6", children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4", children: [_jsxs("div", { children: [title && (_jsx("h2", { className: "text-[1.5rem] font-semibold leading-[1] tracking-[-0.025em] text-foreground", children: title })), description && (_jsx("p", { className: "mt-2 text-[0.875rem] leading-[1.25rem] text-muted-foreground", children: description }))] }), headerElement && _jsx("div", { children: headerElement }), showButton && (_jsx("div", { children: _jsx(Button, { onClick: handleButtonClick, variant: buttonVariant, className: buttonVariant, style: { height: 39 }, children: buttonText ?? 'Add' }) }))] }) })), _jsx("div", { className: "p-6 pt-0", children: children })] }));
4
+ return (_jsxs("div", { className: `bg-card text-card-foreground border rounded-[10px] shadow-sm ${className}`, children: [(title || description || showButton || headerElement) && (_jsx("div", { className: "p-6", children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4", children: [_jsxs("div", { children: [title && (_jsx("h2", { className: "text-[1.5rem] font-semibold leading-[1] tracking-[-0.025em] text-foreground", children: title })), description && (_jsx("p", { className: "mt-2 text-[0.875rem] leading-[1.25rem] text-muted-foreground", children: description }))] }), headerElement && _jsx("div", { children: headerElement }), showButton && (_jsx("div", { children: _jsx(Button, { onClick: handleButtonClick, variant: buttonVariant, className: buttonVariant, style: { height: 39 }, children: buttonText ?? 'Add' }) }))] }) })), _jsx("div", { className: "p-6 pt-0", children: children })] }));
5
5
  };
6
6
  export default Card;
@@ -49,7 +49,7 @@ const MultiSelect = forwardRef(({ options, value, defaultValue = [], disabled, o
49
49
  }
50
50
  }, children: [_jsxs("div", { id: field?.name, className: "flex items-center w-full px-4 py-2 border rounded-md", style: { minHeight: '41px' }, children: [_jsx("div", { className: "flex-1 text-left", children: tagPosition === 'inside' ? (_jsx(TagsList, { selectedOptions: selectedOptions, removeTag: removeTag, placeholder: field?.placeholder })) : (_jsx("span", { className: "truncate", children: selectedOptions.length === 0
51
51
  ? (field?.placeholder ?? placeholder ?? 'Select options')
52
- : `${selectedOptions.length} selected` })) }), _jsx(ChevronDownIcon, { className: "ml-2 flex-shrink-0" })] }), tagPosition === 'bottom' && selectedOptions.length > 0 && (_jsx("div", { className: "mt-2", children: _jsx(TagsList, { selectedOptions: selectedOptions, removeTag: removeTag, placeholder: field?.placeholder }) }))] }) }), _jsxs(Popover.Content, { className: "p-2 bg-background border rounded shadow-md w-full z-50", align: "start", sideOffset: 5, onOpenAutoFocus: (e) => e.preventDefault(), children: [_jsx("input", { type: "text", placeholder: "Search...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full px-2 py-1 mb-2 border rounded", onClick: (e) => e.stopPropagation() }), _jsx("div", { className: "max-h-60 overflow-auto", children: filteredOptions.length > 0 ? (filteredOptions.map((option) => (_jsxs("div", { className: "flex items-center gap-2 px-2 py-1 cursor-pointer hover:bg-accent", children: [_jsx(Checkbox.Root, { type: "button", checked: internalValues.includes(option.value), onCheckedChange: () => handleToggle(option.value), className: "w-4 h-4 border rounded", children: _jsx(Checkbox.Indicator, { children: _jsx(CheckIcon, { className: "w-4 h-4 text-primary" }) }) }), _jsx(Button, { type: "button", variant: "ghost", onClick: () => handleToggle(option.value), onKeyDown: (e) => {
52
+ : `${selectedOptions.length} selected` })) }), _jsx(ChevronDownIcon, { className: "ml-2 flex-shrink-0" })] }), tagPosition === 'bottom' && selectedOptions.length > 0 && (_jsx("div", { className: "mt-2", children: _jsx(TagsList, { selectedOptions: selectedOptions, removeTag: removeTag, placeholder: field?.placeholder }) }))] }) }), _jsxs(Popover.Content, { className: "p-2 bg-popover text-popover-foreground border rounded shadow-md w-full z-50", align: "start", sideOffset: 5, onOpenAutoFocus: (e) => e.preventDefault(), children: [_jsx("input", { type: "text", placeholder: "Search...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full px-2 py-1 mb-2 border rounded", onClick: (e) => e.stopPropagation() }), _jsx("div", { className: "max-h-60 overflow-auto", children: filteredOptions.length > 0 ? (filteredOptions.map((option) => (_jsxs("div", { className: "flex items-center gap-2 px-2 py-1 cursor-pointer hover:bg-accent", children: [_jsx(Checkbox.Root, { type: "button", checked: internalValues.includes(option.value), onCheckedChange: () => handleToggle(option.value), className: "w-4 h-4 border rounded", children: _jsx(Checkbox.Indicator, { children: _jsx(CheckIcon, { className: "w-4 h-4 text-primary" }) }) }), _jsx(Button, { type: "button", variant: "ghost", onClick: () => handleToggle(option.value), onKeyDown: (e) => {
53
53
  if (e.key === 'Enter' || e.key === ' ') {
54
54
  e.preventDefault();
55
55
  handleToggle(option.value);
@@ -29,14 +29,14 @@ const containedTheme = {
29
29
  default: {
30
30
  base: 'rounded-t-lg',
31
31
  active: {
32
- on: 'text-foreground bg-background active shadow-sm',
32
+ on: 'text-foreground bg-card active shadow-sm',
33
33
  off: 'border-b-2 border-transparent text-foreground/70',
34
34
  },
35
35
  },
36
36
  fullWidth: {
37
37
  base: '',
38
38
  active: {
39
- on: 'text-foreground bg-background active shadow-sm',
39
+ on: 'text-foreground bg-card active shadow-sm',
40
40
  off: 'text-foreground/70',
41
41
  },
42
42
  },
@@ -84,10 +84,10 @@ function VerticalTabs({ tabs, activeIndex, onSelect, variant, className, tabPane
84
84
  }
85
85
  // default / fullWidth
86
86
  return isActive
87
- ? `${base} text-foreground bg-background shadow-sm border border-border`
87
+ ? `${base} text-foreground bg-card shadow-sm border border-border`
88
88
  : `${base} text-foreground/70 bg-muted hover:text-foreground hover:bg-accent`;
89
89
  };
90
- return (_jsxs("div", { className: `flex flex-col md:flex-row gap-4 ${className ?? ''}`, children: [_jsx("div", { className: "md:w-64 flex-shrink-0", children: _jsx("ul", { className: "flex flex-row md:flex-col space-x-2 md:space-x-0 md:space-y-2 text-sm font-medium text-muted-foreground overflow-x-auto md:overflow-x-visible", children: tabs.map((tab, index) => (_jsx("li", { className: "flex-shrink-0", children: _jsxs(Button, { type: "button", variant: "ghost", onClick: () => !tab.disabled && onSelect(index), disabled: tab.disabled, className: getItemClasses(activeIndex === index), children: [tab.icon && (_jsx("span", { className: `w-4 h-4 me-2 ${activeIndex === index ? 'text-current' : 'text-muted-foreground'}`, children: _jsx(tab.icon, {}) })), tab.title] }) }, tab.id))) }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsx("div", { className: `bg-background border border-border rounded-lg p-6 ${tabPanelClassName ?? ''}`, children: tabs[activeIndex]?.content }) })] }));
90
+ return (_jsxs("div", { className: `flex flex-col md:flex-row gap-4 ${className ?? ''}`, children: [_jsx("div", { className: "md:w-64 flex-shrink-0", children: _jsx("ul", { className: "flex flex-row md:flex-col space-x-2 md:space-x-0 md:space-y-2 text-sm font-medium text-muted-foreground overflow-x-auto md:overflow-x-visible", children: tabs.map((tab, index) => (_jsx("li", { className: "flex-shrink-0", children: _jsxs(Button, { type: "button", variant: "ghost", onClick: () => !tab.disabled && onSelect(index), disabled: tab.disabled, className: getItemClasses(activeIndex === index), children: [tab.icon && (_jsx("span", { className: `w-4 h-4 me-2 ${activeIndex === index ? 'text-current' : 'text-muted-foreground'}`, children: _jsx(tab.icon, {}) })), tab.title] }) }, tab.id))) }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsx("div", { className: `bg-card border border-border rounded-lg p-6 ${tabPanelClassName ?? ''}`, children: tabs[activeIndex]?.content }) })] }));
91
91
  }
92
92
  // ─── PagamioTabs Component ───────────────────────────────────────────
93
93
  const PagamioTabs = ({ tabs, variant = 'default', orientation = 'horizontal', activeTab: controlledTab, defaultTab = 0, onTabChange, isSticky = false, isFullWidth = true, title, description, className = '', tabListClassName = '', tabPanelClassName = '', theme: customTheme, }) => {
@@ -43,7 +43,7 @@ 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('z-[110] relative min-w-[8rem] overflow-hidden rounded-md border bg-background 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' &&
46
+ return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('z-[110] 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
47
  '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
48
  e.stopPropagation();
49
49
  } }) }), _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, {})] }) }));
@@ -38,10 +38,10 @@ const statCardVariants = cva('relative overflow-hidden rounded-xl transition-all
38
38
  dark: 'bg-gradient-to-r from-gray-800 to-gray-900 text-white',
39
39
  primary: 'bg-gradient-to-r from-primary to-primary/90 text-white',
40
40
  // Light variants (bottom row in DreamPOS)
41
- light: 'bg-background border border-border text-foreground',
42
- 'light-orange': 'bg-background border border-orange-100 text-foreground',
43
- 'light-teal': 'bg-background border border-teal-100 text-foreground',
44
- 'light-green': 'bg-background border border-emerald-100 text-foreground',
41
+ light: 'bg-card border border-border text-card-foreground',
42
+ 'light-orange': 'bg-card border border-orange-100 text-card-foreground',
43
+ 'light-teal': 'bg-card border border-teal-100 text-card-foreground',
44
+ 'light-green': 'bg-card border border-emerald-100 text-card-foreground',
45
45
  },
46
46
  size: {
47
47
  sm: 'p-3',
@@ -21,6 +21,6 @@ const variantStyles = {
21
21
  };
22
22
  const Toast = ({ id, title, message, variant = 'info', onClose }) => {
23
23
  const currentVariant = variantStyles[variant];
24
- return (_jsx("div", { className: "w-full max-w-xs overflow-hidden rounded-lg bg-background shadow", role: "alert", children: _jsxs("div", { className: `flex items-center space-x-4 p-4 ${currentVariant.bg} ${currentVariant.text}`, children: [_jsx("div", { className: "shrink-0", children: currentVariant.icon }), _jsxs("div", { className: "flex-1", children: [title && _jsx("p", { className: `text-sm font-semibold ${currentVariant.text}`, children: title }), _jsx("p", { className: "text-sm", children: message })] }), _jsx(Button, { type: "button", size: "icon", variant: "ghost", onClick: () => onClose(id), className: "inline-flex items-center justify-center rounded-lg bg-transparent p-1 text-muted-foreground hover:bg-accent hover:text-foreground", "aria-label": "Close", children: _jsx(AiOutlineClose, { className: "h-5 w-5" }) })] }) }));
24
+ return (_jsx("div", { className: "w-full max-w-xs overflow-hidden rounded-lg bg-card shadow", role: "alert", children: _jsxs("div", { className: `flex items-center space-x-4 p-4 ${currentVariant.bg} ${currentVariant.text}`, children: [_jsx("div", { className: "shrink-0", children: currentVariant.icon }), _jsxs("div", { className: "flex-1", children: [title && _jsx("p", { className: `text-sm font-semibold ${currentVariant.text}`, children: title }), _jsx("p", { className: "text-sm", children: message })] }), _jsx(Button, { type: "button", size: "icon", variant: "ghost", onClick: () => onClose(id), className: "inline-flex items-center justify-center rounded-lg bg-transparent p-1 text-muted-foreground hover:bg-accent hover:text-foreground", "aria-label": "Close", children: _jsx(AiOutlineClose, { className: "h-5 w-5" }) })] }) }));
25
25
  };
26
26
  export default Toast;
@@ -116,6 +116,9 @@ export const getDefaultChartOptions = (type) => ({
116
116
  axisTicks: {
117
117
  show: false,
118
118
  },
119
+ crosshairs: {
120
+ show: false,
121
+ },
119
122
  },
120
123
  yaxis: {
121
124
  labels: {
@@ -226,6 +229,12 @@ containerClassName, loadingClassName, errorClassName, emptyClassName, iconClassN
226
229
  const fillSeriesColor = callerFillSeriesColor ?? (isNonAxisChart ? false : undefined);
227
230
  return {
228
231
  ...merged,
232
+ chart: {
233
+ ...merged.chart,
234
+ // Force transparent background so the chart inherits the card's
235
+ // bg-card surface instead of ApexCharts' default dark-mode #424242.
236
+ background: 'transparent',
237
+ },
229
238
  // Stamp theme.mode so the SVG paper background and foreground colours
230
239
  // match the app colour mode (separate from tooltip.theme).
231
240
  theme: {
@@ -4,6 +4,6 @@ import { Button, Icon, Input } from '../../../../components';
4
4
  const PasswordInput = React.forwardRef(({ field, error, ...props }, ref) => {
5
5
  const [showPassword, setShowPassword] = useState(false);
6
6
  const handleShowPassword = () => setShowPassword(!showPassword);
7
- return (_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-foreground", children: field.label }), _jsxs("div", { className: "relative", children: [_jsx(Input, { type: showPassword ? 'text' : 'password', ...props, ref: ref, id: field.name, placeholder: field.placeholder, className: `mt-1 block w-full ${error ? 'border-red-500' : ''}` }), _jsx(Button, { className: "absolute inset-y-0 right-2 pr-3 flex items-center", type: "button", size: "icon", variant: "ghost", onClick: handleShowPassword, children: showPassword ? _jsx(Icon, { name: 'FaEye', size: 20 }) : _jsx(Icon, { name: 'FaEyeSlash', size: 20 }) })] }), error && _jsx("p", { className: "mt-2 text-sm text-red-500", children: error.message })] }));
7
+ return (_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-foreground", children: field.label }), _jsxs("div", { className: "relative mt-1", children: [_jsx(Input, { type: showPassword ? 'text' : 'password', ...props, ref: ref, id: field.name, placeholder: field.placeholder, className: `block w-full pr-10 ${error ? 'border-red-500' : ''}` }), _jsx(Button, { className: "absolute right-1 top-1/2 -translate-y-1/2", type: "button", size: "icon", variant: "ghost", onClick: handleShowPassword, children: showPassword ? _jsx(Icon, { name: 'FaEye', size: 18 }) : _jsx(Icon, { name: 'FaEyeSlash', size: 18 }) })] }), error && _jsx("p", { className: "mt-2 text-sm text-red-500", children: error.message })] }));
8
8
  });
9
9
  export default PasswordInput;
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Drawer } from 'flowbite-react';
3
3
  import Button from '../../components/ui/Button';
4
4
  const BaseDrawer = ({ title, isOpen, marginTop = '0px', onClose, children }) => {
5
- return (_jsxs(Drawer, { open: isOpen, onClose: onClose, backdrop: false, position: "right", className: "flex flex-col px-0 bg-background border-l-2 border-border w-full md:w-[420px]", style: {
5
+ return (_jsxs(Drawer, { open: isOpen, onClose: onClose, backdrop: false, position: "right", className: "flex flex-col px-0 bg-card border-l-2 border-border w-full md:w-[420px]", style: {
6
6
  marginTop,
7
7
  height: `calc(100vh - ${marginTop})`,
8
8
  paddingTop: '0px',
9
- }, children: [_jsxs("div", { className: "sticky top-0 flex items-center h-12 border-b border-border", style: { zIndex: 100 }, children: [_jsx("div", { className: "flex items-center justify-start pl-6 h-full bg-muted py-5", style: { width: '88%' }, children: _jsx("h2", { className: "text-lg font-semibold text-foreground truncate", children: title }) }), _jsx(Button, { type: "button", variant: "ghost", className: "hover:text-foreground/70 hover:bg-accent bg-background", onClick: onClose, style: { width: '12%', height: '3rem' }, children: "x" })] }), children] }));
9
+ }, children: [_jsxs("div", { className: "sticky top-0 flex items-center h-12 border-b border-border", style: { zIndex: 100 }, children: [_jsx("div", { className: "flex items-center justify-start pl-6 h-full bg-muted py-5", style: { width: '88%' }, children: _jsx("h2", { className: "text-lg font-semibold text-foreground truncate", children: title }) }), _jsx(Button, { type: "button", variant: "ghost", className: "hover:text-foreground/70 hover:bg-accent bg-card", onClick: onClose, style: { width: '12%', height: '3rem' }, children: "x" })] }), children] }));
10
10
  };
11
11
  export default BaseDrawer;
@@ -30,6 +30,6 @@ export function getDefaultTableOptions() {
30
30
  mantineLoadingOverlayProps: {
31
31
  children: _jsx(LoaderComponent, { size: "lg" }),
32
32
  },
33
- renderEmptyRowsFallback: () => (_jsxs("div", { style: { textAlign: 'center', padding: '20px', color: '#888' }, children: [_jsx("p", { children: "No data available" }), _jsx("p", { children: "Please adjust your filters or try again later." })] })),
33
+ renderEmptyRowsFallback: () => (_jsxs("div", { style: { textAlign: 'center', padding: '20px' }, className: "text-muted-foreground", children: [_jsx("p", { children: "No data available" }), _jsx("p", { children: "Please adjust your filters or try again later." })] })),
34
34
  };
35
35
  }
package/lib/styles.css CHANGED
@@ -507,24 +507,24 @@ video {
507
507
  ═══════════════════════════════════════════════════════════════ */
508
508
 
509
509
  /* Surfaces */
510
- --background: 0 0% 100%;
511
- --foreground: 240 10% 3.9%;
510
+ --background: 220 14% 96%;
511
+ --foreground: 224 71% 4%;
512
512
  --card: 0 0% 100%;
513
- --card-foreground: 240 10% 3.9%;
513
+ --card-foreground: 224 71% 4%;
514
514
  --popover: 0 0% 100%;
515
- --popover-foreground: 240 10% 3.9%;
515
+ --popover-foreground: 224 71% 4%;
516
516
 
517
517
  /* Brand */
518
518
  --primary: 255 56% 12%;
519
519
  --primary-foreground: 0 0% 100%;
520
520
 
521
521
  /* Semantic surfaces */
522
- --secondary: 240 4.8% 95.9%;
523
- --secondary-foreground: 240 5.9% 10%;
524
- --muted: 240 4.8% 95.9%;
525
- --muted-foreground: 240 3.8% 46.1%;
526
- --accent: 240 4.8% 95.9%;
527
- --accent-foreground: 240 5.9% 10%;
522
+ --secondary: 220 13% 91%;
523
+ --secondary-foreground: 224 71% 4%;
524
+ --muted: 220 13% 91%;
525
+ --muted-foreground: 220 9% 46%;
526
+ --accent: 220 13% 91%;
527
+ --accent-foreground: 224 71% 4%;
528
528
 
529
529
  /* Status */
530
530
  --destructive: 0 84.2% 60.2%;
@@ -541,8 +541,8 @@ video {
541
541
  --info-text: 197 71% 25%;
542
542
 
543
543
  /* Boundaries */
544
- --border: 240 5.9% 90%;
545
- --input: 240 5.9% 90%;
544
+ --border: 220 13% 86%;
545
+ --input: 220 13% 86%;
546
546
  --ring: 255 56% 12%;
547
547
  --radius: 0.5rem;
548
548
 
@@ -565,31 +565,31 @@ video {
565
565
 
566
566
  /* Sidebar */
567
567
  --sidebar: 0 0% 100%;
568
- --sidebar-foreground: 240 10% 3.9%;
569
- --sidebar-border: 240 5.9% 90%;
568
+ --sidebar-foreground: 224 71% 4%;
569
+ --sidebar-border: 220 13% 86%;
570
570
  --sidebar-accent: 255 56% 95%;
571
- --sidebar-accent-foreground: 240 5.9% 10%;
571
+ --sidebar-accent-foreground: 224 71% 4%;
572
572
  --sidebar-primary: 255 56% 12%;
573
573
  --sidebar-primary-foreground: 0 0% 100%;
574
574
  }
575
575
 
576
576
  .dark {
577
577
  /* DEV FALLBACKS — dark mode. Consumer's globals.css provides real values. */
578
- --background: 240 10% 3.9%;
579
- --foreground: 0 0% 98%;
580
- --card: 240 6% 10%;
581
- --card-foreground: 0 0% 98%;
582
- --popover: 240 6% 10%;
583
- --popover-foreground: 0 0% 98%;
584
- --primary: 255 56% 60%;
585
- --primary-foreground: 240 10% 3.9%;
586
- --secondary: 240 5% 15%;
587
- --secondary-foreground: 0 0% 98%;
588
- --muted: 240 5% 15%;
589
- --muted-foreground: 240 5% 64.9%;
590
- --accent: 240 5% 15%;
591
- --accent-foreground: 0 0% 98%;
592
- --destructive: 0 62.8% 30.6%;
578
+ --background: 222 47% 11%;
579
+ --foreground: 210 40% 98%;
580
+ --card: 220 30% 16%;
581
+ --card-foreground: 210 40% 98%;
582
+ --popover: 220 30% 16%;
583
+ --popover-foreground: 210 40% 98%;
584
+ --primary: 263 70% 71%;
585
+ --primary-foreground: 0 0% 100%;
586
+ --secondary: 220 25% 21%;
587
+ --secondary-foreground: 210 40% 98%;
588
+ --muted: 220 25% 21%;
589
+ --muted-foreground: 218 11% 65%;
590
+ --accent: 220 25% 21%;
591
+ --accent-foreground: 210 40% 98%;
592
+ --destructive: 0 72% 51%;
593
593
  --destructive-foreground: 0 0% 98%;
594
594
  --destructive-text: 0 84.2% 70%;
595
595
  --success: 142 71% 45%;
@@ -598,19 +598,19 @@ video {
598
598
  --warning: 43 96% 56%;
599
599
  --warning-foreground: 0 0% 0%;
600
600
  --warning-text: 43 96% 70%;
601
- --info: 197 71% 52%;
601
+ --info: 199 89% 48%;
602
602
  --info-foreground: 0 0% 100%;
603
603
  --info-text: 197 71% 70%;
604
- --border: 240 4% 22%;
605
- --input: 240 4% 22%;
606
- --ring: 255 56% 60%;
607
- --sidebar: 240 10% 3.9%;
608
- --sidebar-foreground: 0 0% 98%;
609
- --sidebar-border: 240 4% 22%;
610
- --sidebar-accent: 255 56% 10%;
611
- --sidebar-accent-foreground: 0 0% 98%;
612
- --sidebar-primary: 255 56% 60%;
613
- --sidebar-primary-foreground: 240 10% 3.9%;
604
+ --border: 220 15% 28%;
605
+ --input: 220 15% 28%;
606
+ --ring: 263 70% 71%;
607
+ --sidebar: 222 47% 11%;
608
+ --sidebar-foreground: 210 40% 98%;
609
+ --sidebar-border: 220 15% 28%;
610
+ --sidebar-accent: 260 30% 14%;
611
+ --sidebar-accent-foreground: 210 40% 98%;
612
+ --sidebar-primary: 263 70% 71%;
613
+ --sidebar-primary-foreground: 0 0% 100%;
614
614
  }
615
615
  * {
616
616
  border-color: hsl(var(--border));
@@ -2177,10 +2177,6 @@ video {
2177
2177
  .\!bg-transparent {
2178
2178
  background-color: transparent !important;
2179
2179
  }
2180
- .bg-\[\#b45dae\] {
2181
- --tw-bg-opacity: 1;
2182
- background-color: rgb(180 93 174 / var(--tw-bg-opacity, 1));
2183
- }
2184
2180
  .bg-accent {
2185
2181
  background-color: hsl(var(--accent));
2186
2182
  }
@@ -2979,6 +2975,9 @@ video {
2979
2975
  --tw-text-opacity: 1;
2980
2976
  color: rgb(30 66 159 / var(--tw-text-opacity, 1));
2981
2977
  }
2978
+ .text-card-foreground {
2979
+ color: hsl(var(--card-foreground));
2980
+ }
2982
2981
  .text-current {
2983
2982
  color: currentColor;
2984
2983
  }
@@ -3110,14 +3109,6 @@ video {
3110
3109
  .text-muted-foreground {
3111
3110
  color: hsl(var(--muted-foreground));
3112
3111
  }
3113
- .text-neutral-600 {
3114
- --tw-text-opacity: 1;
3115
- color: rgb(82 82 82 / var(--tw-text-opacity, 1));
3116
- }
3117
- .text-neutral-900 {
3118
- --tw-text-opacity: 1;
3119
- color: rgb(23 23 23 / var(--tw-text-opacity, 1));
3120
- }
3121
3112
  .text-orange-600 {
3122
3113
  --tw-text-opacity: 1;
3123
3114
  color: rgb(208 56 1 / var(--tw-text-opacity, 1));
@@ -3592,6 +3583,27 @@ video {
3592
3583
  .\[scrollbar-width\:none\] {
3593
3584
  scrollbar-width: none;
3594
3585
  }
3586
+
3587
+ /* ApexCharts dark-mode overrides — force tooltip and crosshair to use
3588
+ CSS custom properties so they match the active theme. */
3589
+ .dark .apexcharts-tooltip {
3590
+ background: hsl(var(--popover)) !important;
3591
+ color: hsl(var(--popover-foreground)) !important;
3592
+ border-color: hsl(var(--border)) !important;
3593
+ }
3594
+ .dark .apexcharts-tooltip .apexcharts-tooltip-title {
3595
+ background: hsl(var(--muted)) !important;
3596
+ border-color: hsl(var(--border)) !important;
3597
+ }
3598
+ .dark .apexcharts-xaxistooltip {
3599
+ background: hsl(var(--popover)) !important;
3600
+ color: hsl(var(--popover-foreground)) !important;
3601
+ border-color: hsl(var(--border)) !important;
3602
+ }
3603
+ .dark .apexcharts-xaxistooltip-bottom::before,
3604
+ .dark .apexcharts-xaxistooltip-bottom::after {
3605
+ border-bottom-color: hsl(var(--border)) !important;
3606
+ }
3595
3607
  .file\:-ms-4::file-selector-button {
3596
3608
  margin-inline-start: -1rem;
3597
3609
  }
@@ -4905,10 +4917,6 @@ video {
4905
4917
  --tw-border-opacity: 1;
4906
4918
  border-color: rgb(114 59 19 / var(--tw-border-opacity, 1));
4907
4919
  }
4908
- .dark\:bg-\[\#b45dae\]:is(.dark *) {
4909
- --tw-bg-opacity: 1;
4910
- background-color: rgb(180 93 174 / var(--tw-bg-opacity, 1));
4911
- }
4912
4920
  .dark\:bg-amber-900\/30:is(.dark *) {
4913
4921
  background-color: rgb(120 53 15 / 0.3);
4914
4922
  }
@@ -5253,10 +5261,6 @@ video {
5253
5261
  --tw-text-opacity: 1;
5254
5262
  color: rgb(54 83 20 / var(--tw-text-opacity, 1));
5255
5263
  }
5256
- .dark\:text-neutral-400:is(.dark *) {
5257
- --tw-text-opacity: 1;
5258
- color: rgb(163 163 163 / var(--tw-text-opacity, 1));
5259
- }
5260
5264
  .dark\:text-pink-500:is(.dark *) {
5261
5265
  --tw-text-opacity: 1;
5262
5266
  color: rgb(231 70 148 / var(--tw-text-opacity, 1));
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.246",
4
+ "version": "0.8.248",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false