@metropolle/design-system 1.2026.0-1.2.1231 → 1.2026.0-1.3.119
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/dist/react/components/react/DataTable/DataTable.d.ts.map +1 -1
- package/dist/react/components/react/DataTable/TableHeader.d.ts.map +1 -1
- package/dist/react/components/react/DataTable/TableRow.d.ts.map +1 -1
- package/dist/react/components/react/DataTable/types.d.ts +1 -0
- package/dist/react/components/react/DataTable/types.d.ts.map +1 -1
- package/dist/react/components/react/DetailModal/DetailModal.d.ts +55 -0
- package/dist/react/components/react/DetailModal/DetailModal.d.ts.map +1 -0
- package/dist/react/components/react/DetailModal/index.d.ts +3 -0
- package/dist/react/components/react/DetailModal/index.d.ts.map +1 -0
- package/dist/react/components/react/FormField/FormField.d.ts +26 -0
- package/dist/react/components/react/FormField/FormField.d.ts.map +1 -0
- package/dist/react/components/react/FormField/index.d.ts +3 -0
- package/dist/react/components/react/FormField/index.d.ts.map +1 -0
- package/dist/react/components/react/FormGrid/FormGrid.d.ts +20 -0
- package/dist/react/components/react/FormGrid/FormGrid.d.ts.map +1 -0
- package/dist/react/components/react/FormGrid/index.d.ts +3 -0
- package/dist/react/components/react/FormGrid/index.d.ts.map +1 -0
- package/dist/react/components/react/FormModal/FormModal.d.ts +58 -0
- package/dist/react/components/react/FormModal/FormModal.d.ts.map +1 -0
- package/dist/react/components/react/FormModal/index.d.ts +3 -0
- package/dist/react/components/react/FormModal/index.d.ts.map +1 -0
- package/dist/react/components/react/FormSection/FormSection.d.ts +20 -0
- package/dist/react/components/react/FormSection/FormSection.d.ts.map +1 -0
- package/dist/react/components/react/FormSection/index.d.ts +3 -0
- package/dist/react/components/react/FormSection/index.d.ts.map +1 -0
- package/dist/react/components/react/GlassCard/GlassCard.d.ts +10 -0
- package/dist/react/components/react/GlassCard/GlassCard.d.ts.map +1 -1
- package/dist/react/components/react/GlassCard/index.d.ts +1 -1
- package/dist/react/components/react/GlassCard/index.d.ts.map +1 -1
- package/dist/react/components/react/InfoBox/InfoBox.d.ts +46 -0
- package/dist/react/components/react/InfoBox/InfoBox.d.ts.map +1 -0
- package/dist/react/components/react/InfoBox/index.d.ts +3 -0
- package/dist/react/components/react/InfoBox/index.d.ts.map +1 -0
- package/dist/react/components/react/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/react/components/react/index.d.ts +12 -0
- package/dist/react/components/react/index.d.ts.map +1 -1
- package/dist/react/index.d.ts +12 -0
- package/dist/react/index.esm.js +357 -37
- package/dist/react/index.esm.js.map +1 -1
- package/dist/react/index.js +363 -36
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1387,14 +1387,26 @@ function cn(...classes) {
|
|
|
1387
1387
|
* </GlassCard>
|
|
1388
1388
|
* ```
|
|
1389
1389
|
*/
|
|
1390
|
-
const GlassCard = require$$0.forwardRef(({ glassStyle = 'liquid', intensity = 'md', theme, variant = 'light', blur, opacity, children, className, enableHover = true, style, ...props }, ref) => {
|
|
1390
|
+
const GlassCard = require$$0.forwardRef(({ glassStyle = 'liquid', intensity = 'md', theme, variant = 'light', blur, opacity, children, className, enableHover = true, cardVariant = 'default', style, ...props }, ref) => {
|
|
1391
1391
|
// Resolve theme from new prop or deprecated variant
|
|
1392
1392
|
const resolvedTheme = theme ?? variant;
|
|
1393
1393
|
// =====================
|
|
1394
1394
|
// LIQUID GLASS MODE
|
|
1395
1395
|
// =====================
|
|
1396
1396
|
if (glassStyle === 'liquid') {
|
|
1397
|
-
|
|
1397
|
+
// PROC-007: Card variant styles
|
|
1398
|
+
const variantStyles = {
|
|
1399
|
+
default: {},
|
|
1400
|
+
highlight: {
|
|
1401
|
+
borderLeft: '4px solid var(--mds-color-brand-primary, #0055FF)',
|
|
1402
|
+
boxShadow: '0 4px 20px rgba(0, 85, 255, 0.15)'
|
|
1403
|
+
},
|
|
1404
|
+
subtle: {
|
|
1405
|
+
background: 'rgba(255, 255, 255, 0.02)',
|
|
1406
|
+
border: '1px solid rgba(255, 255, 255, 0.05)'
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
return (jsxRuntimeExports.jsx("div", { ref: ref, className: cn('mds-liquid-glass', `mds-liquid-glass--${intensity}`, `mds-liquid-glass--${cardVariant}`, !enableHover && 'mds-liquid-glass--no-hover', className), style: { ...variantStyles[cardVariant], ...style }, ...props, children: children }));
|
|
1398
1410
|
}
|
|
1399
1411
|
// =====================
|
|
1400
1412
|
// GLASS MODE (legacy)
|
|
@@ -1829,36 +1841,43 @@ function ThemeToggle({ size = 'md', className = '', disabled = false, onChange,
|
|
|
1829
1841
|
return (jsxRuntimeExports.jsx("button", { onClick: toggleTheme, className: buttonClasses, disabled: disabled, type: "button", "aria-pressed": isDark, "aria-label": `Switch to ${isDark ? 'light' : 'dark'} mode`, title: `Switch to ${isDark ? 'light' : 'dark'} mode`, "data-theme": isDark ? 'dark' : 'light', style: buttonStyle }));
|
|
1830
1842
|
}
|
|
1831
1843
|
|
|
1832
|
-
const TableHeader = ({ columns, gridTemplate, onSort, sortColumn, sortDirection }) => {
|
|
1833
|
-
return (jsxRuntimeExports.
|
|
1844
|
+
const TableHeader = ({ columns, gridTemplate, onSort, sortColumn, sortDirection, hasActions = false }) => {
|
|
1845
|
+
return (jsxRuntimeExports.jsxs("div", { role: "rowgroup", style: {
|
|
1834
1846
|
display: 'grid',
|
|
1835
1847
|
gridTemplateColumns: gridTemplate,
|
|
1836
1848
|
gap: '16px',
|
|
1837
1849
|
padding: '16px 20px',
|
|
1838
1850
|
borderBottom: '1px solid var(--border-color)',
|
|
1839
1851
|
backgroundColor: 'rgba(255, 255, 255, 0.05)'
|
|
1840
|
-
}, children: columns.map((column) => (jsxRuntimeExports.jsxs("div", { role: "columnheader", style: {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1852
|
+
}, children: [columns.map((column) => (jsxRuntimeExports.jsxs("div", { role: "columnheader", style: {
|
|
1853
|
+
color: 'var(--text-primary)',
|
|
1854
|
+
fontWeight: '500',
|
|
1855
|
+
fontSize: '14px',
|
|
1856
|
+
display: 'flex',
|
|
1857
|
+
alignItems: 'center',
|
|
1858
|
+
justifyContent: column.align === 'center' ? 'center' :
|
|
1859
|
+
column.align === 'right' ? 'flex-end' : 'flex-start',
|
|
1860
|
+
cursor: column.sortable && onSort ? 'pointer' : 'default',
|
|
1861
|
+
gap: '4px',
|
|
1862
|
+
transition: 'color 0.2s ease'
|
|
1863
|
+
}, onClick: () => column.sortable && onSort && onSort(column.key), onMouseEnter: (e) => {
|
|
1864
|
+
if (column.sortable && onSort) {
|
|
1865
|
+
e.currentTarget.style.color = '#ffffff';
|
|
1866
|
+
}
|
|
1867
|
+
}, onMouseLeave: (e) => {
|
|
1868
|
+
e.currentTarget.style.color = 'var(--text-primary)';
|
|
1869
|
+
}, children: [column.label, column.sortable && onSort && (jsxRuntimeExports.jsx("span", { style: {
|
|
1870
|
+
fontSize: '12px',
|
|
1871
|
+
opacity: sortColumn === column.key ? 1 : 0.5
|
|
1872
|
+
}, children: sortColumn === column.key ?
|
|
1873
|
+
(sortDirection === 'asc' ? '↑' : '↓') : '↕' }))] }, column.key))), hasActions && (jsxRuntimeExports.jsx("div", { role: "columnheader", style: {
|
|
1874
|
+
color: 'var(--text-primary)',
|
|
1875
|
+
fontWeight: '500',
|
|
1876
|
+
fontSize: '14px',
|
|
1877
|
+
display: 'flex',
|
|
1878
|
+
alignItems: 'center',
|
|
1879
|
+
justifyContent: 'center'
|
|
1880
|
+
}, children: "Actions" }))] }));
|
|
1862
1881
|
};
|
|
1863
1882
|
|
|
1864
1883
|
const TableRow = ({ item, index, columns, actions = [], gridTemplate, isLast, variant, onActionClick }) => {
|
|
@@ -1896,10 +1915,9 @@ const TableRow = ({ item, index, columns, actions = [], gridTemplate, isLast, va
|
|
|
1896
1915
|
const isLoading = action.loading?.(item) || false;
|
|
1897
1916
|
return (jsxRuntimeExports.jsxs("button", { onClick: () => !isDisabled && !isLoading && onActionClick(action, item), disabled: isDisabled || isLoading, style: {
|
|
1898
1917
|
background: 'none',
|
|
1899
|
-
border:
|
|
1900
|
-
'1px solid var(--border-color)',
|
|
1918
|
+
border: 'none',
|
|
1901
1919
|
borderRadius: '6px',
|
|
1902
|
-
padding: '6px
|
|
1920
|
+
padding: '6px 8px',
|
|
1903
1921
|
color: action.variant === 'danger' ? '#f87171' : 'var(--text-primary)',
|
|
1904
1922
|
fontSize: '12px',
|
|
1905
1923
|
cursor: isDisabled || isLoading ? 'not-allowed' : 'pointer',
|
|
@@ -1913,18 +1931,14 @@ const TableRow = ({ item, index, columns, actions = [], gridTemplate, isLast, va
|
|
|
1913
1931
|
if (!isDisabled && !isLoading) {
|
|
1914
1932
|
if (action.variant === 'danger') {
|
|
1915
1933
|
e.currentTarget.style.backgroundColor = 'rgba(239, 68, 68, 0.1)';
|
|
1916
|
-
e.currentTarget.style.borderColor = 'rgba(239, 68, 68, 0.5)';
|
|
1917
1934
|
}
|
|
1918
1935
|
else {
|
|
1919
1936
|
e.currentTarget.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
|
|
1920
|
-
e.currentTarget.style.borderColor = 'var(--text-primary)';
|
|
1921
1937
|
}
|
|
1922
1938
|
}
|
|
1923
1939
|
}, onMouseLeave: (e) => {
|
|
1924
1940
|
if (!isDisabled && !isLoading) {
|
|
1925
1941
|
e.currentTarget.style.backgroundColor = 'transparent';
|
|
1926
|
-
e.currentTarget.style.borderColor = action.variant === 'danger' ?
|
|
1927
|
-
'rgba(239, 68, 68, 0.3)' : 'var(--border-color)';
|
|
1928
1942
|
}
|
|
1929
1943
|
}, children: [action.icon && action.icon, action.label] }, action.key));
|
|
1930
1944
|
}) }))] }));
|
|
@@ -2024,7 +2038,7 @@ const DataTable = ({ data, columns, loading = false, searchTerm = '', actions =
|
|
|
2024
2038
|
color: 'var(--text-secondary)',
|
|
2025
2039
|
fontSize: '14px',
|
|
2026
2040
|
borderBottom: '1px solid var(--border-color)'
|
|
2027
|
-
}, children: ["Mostrando", ' ', jsxRuntimeExports.jsx("span", { style: { fontWeight: '500', color: 'var(--text-primary)' }, children: filteredData.length }), ' ', "de", ' ', jsxRuntimeExports.jsx("span", { style: { fontWeight: '500', color: 'var(--text-primary)' }, children: data.length }), ' ', "itens"] })), jsxRuntimeExports.jsx(TableHeader, { columns: columns, gridTemplate: gridTemplate, onSort: onSort ? handleSort : undefined, sortColumn: sortColumn, sortDirection: sortDirection }), jsxRuntimeExports.jsx("div", { role: "rowgroup", style: {
|
|
2041
|
+
}, children: ["Mostrando", ' ', jsxRuntimeExports.jsx("span", { style: { fontWeight: '500', color: 'var(--text-primary)' }, children: filteredData.length }), ' ', "de", ' ', jsxRuntimeExports.jsx("span", { style: { fontWeight: '500', color: 'var(--text-primary)' }, children: data.length }), ' ', "itens"] })), jsxRuntimeExports.jsx(TableHeader, { columns: columns, gridTemplate: gridTemplate, onSort: onSort ? handleSort : undefined, sortColumn: sortColumn, sortDirection: sortDirection, hasActions: actions.length > 0 }), jsxRuntimeExports.jsx("div", { role: "rowgroup", style: {
|
|
2028
2042
|
maxHeight,
|
|
2029
2043
|
overflowY: 'auto'
|
|
2030
2044
|
}, children: filteredData.map((item, index) => (jsxRuntimeExports.jsx(TableRow, { item: item, index: index, columns: columns, actions: actions, gridTemplate: gridTemplate, isLast: index === filteredData.length - 1, variant: variant, onActionClick: handleActionClick }, item.id || index))) })] }));
|
|
@@ -2432,6 +2446,157 @@ const getTableConfig = (type) => {
|
|
|
2432
2446
|
}
|
|
2433
2447
|
};
|
|
2434
2448
|
|
|
2449
|
+
/**
|
|
2450
|
+
* FormField - Normalized wrapper for form inputs
|
|
2451
|
+
*
|
|
2452
|
+
* Pattern extracted from AdminUserModal.tsx (backoffice/users)
|
|
2453
|
+
* Provides consistent label, error, and helper text styling
|
|
2454
|
+
*/
|
|
2455
|
+
function FormField({ label, required = false, error, helper, disabled = false, children, className = '' }) {
|
|
2456
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-form-field ${className}`, style: { opacity: disabled ? 0.6 : 1 }, children: [jsxRuntimeExports.jsxs("label", { style: {
|
|
2457
|
+
display: 'block',
|
|
2458
|
+
marginBottom: '6px',
|
|
2459
|
+
color: 'var(--mds-color-text-primary, var(--text-primary))',
|
|
2460
|
+
fontSize: '0.9rem',
|
|
2461
|
+
fontWeight: 500
|
|
2462
|
+
}, children: [label, required && (jsxRuntimeExports.jsx("span", { style: { color: 'var(--mds-color-error, #ef4444)', marginLeft: '4px' }, children: "*" }))] }), children, error && (jsxRuntimeExports.jsx("span", { style: {
|
|
2463
|
+
color: 'var(--mds-color-error, #ef4444)',
|
|
2464
|
+
fontSize: '0.8rem',
|
|
2465
|
+
marginTop: '4px',
|
|
2466
|
+
display: 'block'
|
|
2467
|
+
}, children: error })), helper && !error && (jsxRuntimeExports.jsx("span", { style: {
|
|
2468
|
+
color: 'var(--mds-color-text-secondary, var(--text-secondary))',
|
|
2469
|
+
fontSize: '0.75rem',
|
|
2470
|
+
marginTop: '4px',
|
|
2471
|
+
display: 'block'
|
|
2472
|
+
}, children: helper }))] }));
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
const gapValues = {
|
|
2476
|
+
sm: '12px',
|
|
2477
|
+
md: '16px',
|
|
2478
|
+
lg: '24px'
|
|
2479
|
+
};
|
|
2480
|
+
/**
|
|
2481
|
+
* FormGrid - Normalized grid layout for form fields
|
|
2482
|
+
*
|
|
2483
|
+
* Pattern extracted from AdminUserModal.tsx (backoffice/users)
|
|
2484
|
+
* Provides consistent 1 or 2 column layouts with proper gap
|
|
2485
|
+
*/
|
|
2486
|
+
function FormGrid({ columns = 1, gap = 'md', children, className = '' }) {
|
|
2487
|
+
return (jsxRuntimeExports.jsx("div", { className: `mds-form-grid ${className}`, style: {
|
|
2488
|
+
display: 'grid',
|
|
2489
|
+
gridTemplateColumns: columns === 2 ? 'repeat(2, 1fr)' : '1fr',
|
|
2490
|
+
gap: gapValues[gap]
|
|
2491
|
+
}, children: children }));
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* FormSection - Normalized section wrapper for grouping form fields
|
|
2496
|
+
*
|
|
2497
|
+
* Pattern extracted from AdminUserModal.tsx (backoffice/users)
|
|
2498
|
+
* Provides consistent section headers and spacing
|
|
2499
|
+
*/
|
|
2500
|
+
function FormSection({ title, description, children, className = '' }) {
|
|
2501
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-form-section ${className}`, style: {
|
|
2502
|
+
marginBottom: '24px'
|
|
2503
|
+
}, children: [title && (jsxRuntimeExports.jsx("h4", { style: {
|
|
2504
|
+
margin: '0 0 8px 0',
|
|
2505
|
+
color: 'var(--mds-color-text-primary, var(--text-primary))',
|
|
2506
|
+
fontSize: '1rem',
|
|
2507
|
+
fontWeight: 600,
|
|
2508
|
+
letterSpacing: '-0.02em'
|
|
2509
|
+
}, children: title })), description && (jsxRuntimeExports.jsx("p", { style: {
|
|
2510
|
+
margin: '0 0 16px 0',
|
|
2511
|
+
color: 'var(--mds-color-text-secondary, var(--text-secondary))',
|
|
2512
|
+
fontSize: '0.85rem',
|
|
2513
|
+
lineHeight: 1.5
|
|
2514
|
+
}, children: description })), jsxRuntimeExports.jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' }, children: children })] }));
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
const variantColors = {
|
|
2518
|
+
default: {
|
|
2519
|
+
bg: 'rgba(255, 255, 255, 0.03)',
|
|
2520
|
+
border: 'rgba(255, 255, 255, 0.1)',
|
|
2521
|
+
accent: 'var(--mds-color-text-secondary, #888)'
|
|
2522
|
+
},
|
|
2523
|
+
info: {
|
|
2524
|
+
bg: 'rgba(59, 130, 246, 0.1)',
|
|
2525
|
+
border: 'rgba(59, 130, 246, 0.2)',
|
|
2526
|
+
accent: 'var(--mds-color-info, #3b82f6)'
|
|
2527
|
+
},
|
|
2528
|
+
success: {
|
|
2529
|
+
bg: 'rgba(16, 185, 129, 0.1)',
|
|
2530
|
+
border: 'rgba(16, 185, 129, 0.2)',
|
|
2531
|
+
accent: 'var(--mds-color-success, #10b981)'
|
|
2532
|
+
},
|
|
2533
|
+
warning: {
|
|
2534
|
+
bg: 'rgba(245, 158, 11, 0.1)',
|
|
2535
|
+
border: 'rgba(245, 158, 11, 0.2)',
|
|
2536
|
+
accent: 'var(--mds-color-warning, #f59e0b)'
|
|
2537
|
+
},
|
|
2538
|
+
danger: {
|
|
2539
|
+
bg: 'rgba(239, 68, 68, 0.1)',
|
|
2540
|
+
border: 'rgba(239, 68, 68, 0.2)',
|
|
2541
|
+
accent: 'var(--mds-color-error, #ef4444)'
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
/**
|
|
2545
|
+
* InfoBox - Normalized info/alert box for read-only information
|
|
2546
|
+
*
|
|
2547
|
+
* Pattern extracted from AdminUserModal.tsx (backoffice/users)
|
|
2548
|
+
* Provides consistent info boxes for alerts, status displays, and read-only data
|
|
2549
|
+
*
|
|
2550
|
+
* @example
|
|
2551
|
+
* // Alert style (with accent)
|
|
2552
|
+
* <InfoBox variant="info" accent>
|
|
2553
|
+
* An invitation email will be sent...
|
|
2554
|
+
* </InfoBox>
|
|
2555
|
+
*
|
|
2556
|
+
* @example
|
|
2557
|
+
* // Status display (default)
|
|
2558
|
+
* <InfoBox title="User Information">
|
|
2559
|
+
* <InfoRow label="Status" value="Active" />
|
|
2560
|
+
* <InfoRow label="Created" value="Jan 1, 2024" />
|
|
2561
|
+
* </InfoBox>
|
|
2562
|
+
*/
|
|
2563
|
+
function InfoBox({ title, variant = 'default', accent = false, copyable = false, children, className = '' }) {
|
|
2564
|
+
const colors = variantColors[variant];
|
|
2565
|
+
const handleCopy = () => {
|
|
2566
|
+
if (!copyable)
|
|
2567
|
+
return;
|
|
2568
|
+
const text = typeof children === 'string' ? children : '';
|
|
2569
|
+
if (text) {
|
|
2570
|
+
navigator.clipboard.writeText(text);
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-info-box ${className}`, style: {
|
|
2574
|
+
padding: '12px 16px',
|
|
2575
|
+
backgroundColor: colors.bg,
|
|
2576
|
+
borderRadius: '8px',
|
|
2577
|
+
border: `1px solid ${colors.border}`,
|
|
2578
|
+
borderLeft: accent ? `4px solid ${colors.accent}` : `1px solid ${colors.border}`,
|
|
2579
|
+
cursor: copyable ? 'pointer' : 'default'
|
|
2580
|
+
}, onClick: copyable ? handleCopy : undefined, title: copyable ? 'Click to copy' : undefined, children: [title && (jsxRuntimeExports.jsx("div", { style: {
|
|
2581
|
+
color: 'var(--mds-color-text-secondary, var(--text-secondary))',
|
|
2582
|
+
fontSize: '0.85rem',
|
|
2583
|
+
marginBottom: '8px',
|
|
2584
|
+
fontWeight: 500
|
|
2585
|
+
}, children: title })), jsxRuntimeExports.jsx("div", { style: {
|
|
2586
|
+
color: 'var(--mds-color-text-primary, var(--text-primary))',
|
|
2587
|
+
fontSize: '0.9rem',
|
|
2588
|
+
lineHeight: 1.5
|
|
2589
|
+
}, children: children })] }));
|
|
2590
|
+
}
|
|
2591
|
+
function InfoRow({ label, value, valueColor }) {
|
|
2592
|
+
return (jsxRuntimeExports.jsxs("div", { style: {
|
|
2593
|
+
display: 'flex',
|
|
2594
|
+
justifyContent: 'space-between',
|
|
2595
|
+
fontSize: '0.85rem',
|
|
2596
|
+
padding: '2px 0'
|
|
2597
|
+
}, children: [jsxRuntimeExports.jsxs("span", { style: { color: 'var(--mds-color-text-secondary, var(--text-secondary))' }, children: [label, ":"] }), jsxRuntimeExports.jsx("span", { style: { color: valueColor || 'var(--mds-color-text-primary, var(--text-primary))' }, children: value })] }));
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2435
2600
|
/**
|
|
2436
2601
|
* Theme-aware styles generator - Liquid Glass pattern
|
|
2437
2602
|
*
|
|
@@ -2551,6 +2716,160 @@ function Modal({ open, onClose, closeOnOverlay = true, children, className, styl
|
|
|
2551
2716
|
return reactDom.createPortal(content, document.body);
|
|
2552
2717
|
}
|
|
2553
2718
|
|
|
2719
|
+
const sizeMap$1 = {
|
|
2720
|
+
sm: '400px',
|
|
2721
|
+
md: '480px',
|
|
2722
|
+
lg: '600px',
|
|
2723
|
+
xl: '800px'
|
|
2724
|
+
};
|
|
2725
|
+
/**
|
|
2726
|
+
* FormModal - Normalized template for CRUD modal forms
|
|
2727
|
+
*
|
|
2728
|
+
* Pattern extracted from AdminUserModal.tsx (backoffice/users)
|
|
2729
|
+
* Provides consistent structure for create/edit entity modals
|
|
2730
|
+
*
|
|
2731
|
+
* @example
|
|
2732
|
+
* <FormModal
|
|
2733
|
+
* open={showModal}
|
|
2734
|
+
* onClose={() => setShowModal(false)}
|
|
2735
|
+
* onSubmit={handleSubmit}
|
|
2736
|
+
* title="Edit User"
|
|
2737
|
+
* info="Changes will be saved immediately."
|
|
2738
|
+
* infoVariant="info"
|
|
2739
|
+
* loading={isSaving}
|
|
2740
|
+
* submitText="Save"
|
|
2741
|
+
* >
|
|
2742
|
+
* <FormField label="Name" required error={errors.name}>
|
|
2743
|
+
* <input className="mds-input" value={name} onChange={...} />
|
|
2744
|
+
* </FormField>
|
|
2745
|
+
* </FormModal>
|
|
2746
|
+
*/
|
|
2747
|
+
function FormModal({ open, onClose, onSubmit, title, icon, subtitle, info, infoVariant = 'info', children, submitText = 'Save', cancelText = 'Cancel', loading = false, submitDisabled = false, size = 'md', className = '' }) {
|
|
2748
|
+
const handleSubmit = (e) => {
|
|
2749
|
+
e.preventDefault();
|
|
2750
|
+
onSubmit(e);
|
|
2751
|
+
};
|
|
2752
|
+
return (jsxRuntimeExports.jsxs(Modal, { open: open, onClose: onClose, closeOnOverlay: !loading, className: className, style: {
|
|
2753
|
+
maxWidth: sizeMap$1[size],
|
|
2754
|
+
maxHeight: '90vh',
|
|
2755
|
+
overflowY: 'auto',
|
|
2756
|
+
padding: '24px'
|
|
2757
|
+
}, children: [jsxRuntimeExports.jsxs("div", { style: {
|
|
2758
|
+
display: 'flex',
|
|
2759
|
+
alignItems: 'center',
|
|
2760
|
+
justifyContent: 'space-between',
|
|
2761
|
+
marginBottom: subtitle ? '8px' : '24px'
|
|
2762
|
+
}, children: [jsxRuntimeExports.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: [icon && (jsxRuntimeExports.jsx("div", { style: {
|
|
2763
|
+
display: 'flex',
|
|
2764
|
+
alignItems: 'center',
|
|
2765
|
+
justifyContent: 'center',
|
|
2766
|
+
width: 32,
|
|
2767
|
+
height: 32,
|
|
2768
|
+
fontSize: '1.25rem',
|
|
2769
|
+
lineHeight: 0,
|
|
2770
|
+
opacity: 0.5
|
|
2771
|
+
}, children: icon })), jsxRuntimeExports.jsx(Typography, { variant: "h3", color: "primary", style: { margin: 0 }, children: title })] }), jsxRuntimeExports.jsx("button", { type: "button", onClick: onClose, disabled: loading, style: {
|
|
2772
|
+
background: 'none',
|
|
2773
|
+
border: 'none',
|
|
2774
|
+
padding: '8px',
|
|
2775
|
+
cursor: loading ? 'not-allowed' : 'pointer',
|
|
2776
|
+
color: 'var(--mds-color-text-secondary)',
|
|
2777
|
+
opacity: loading ? 0.5 : 1,
|
|
2778
|
+
borderRadius: '6px',
|
|
2779
|
+
display: 'flex',
|
|
2780
|
+
alignItems: 'center',
|
|
2781
|
+
justifyContent: 'center',
|
|
2782
|
+
transition: 'all 0.2s ease'
|
|
2783
|
+
}, onMouseEnter: (e) => {
|
|
2784
|
+
if (!loading)
|
|
2785
|
+
e.currentTarget.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
|
|
2786
|
+
}, onMouseLeave: (e) => {
|
|
2787
|
+
e.currentTarget.style.backgroundColor = 'transparent';
|
|
2788
|
+
}, "aria-label": "Close modal", children: jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), jsxRuntimeExports.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), subtitle && (jsxRuntimeExports.jsx(Typography, { variant: "body", color: "secondary", style: { marginBottom: '24px', fontSize: '0.9rem' }, children: subtitle })), info && (jsxRuntimeExports.jsx("div", { style: { marginBottom: '20px' }, children: jsxRuntimeExports.jsx(InfoBox, { variant: infoVariant, accent: true, children: info }) })), jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, style: { display: 'flex', flexDirection: 'column', gap: '16px' }, children: [children, jsxRuntimeExports.jsxs("div", { style: {
|
|
2789
|
+
display: 'flex',
|
|
2790
|
+
gap: '12px',
|
|
2791
|
+
justifyContent: 'flex-end',
|
|
2792
|
+
marginTop: '16px',
|
|
2793
|
+
paddingTop: '16px',
|
|
2794
|
+
borderTop: '1px solid rgba(255, 255, 255, 0.1)'
|
|
2795
|
+
}, children: [jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "sm", type: "button", onClick: onClose, disabled: loading, children: cancelText }), jsxRuntimeExports.jsx(Button, { variant: "primary", size: "sm", type: "submit", disabled: loading || submitDisabled, children: loading ? 'Saving...' : submitText })] })] })] }));
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
const sizeMap = {
|
|
2799
|
+
sm: '400px',
|
|
2800
|
+
md: '480px',
|
|
2801
|
+
lg: '600px',
|
|
2802
|
+
xl: '800px'
|
|
2803
|
+
};
|
|
2804
|
+
/**
|
|
2805
|
+
* DetailModal - Normalized template for read-only detail modals
|
|
2806
|
+
*
|
|
2807
|
+
* Pattern extracted from GeographyDetailsModal, AuditLogDetailModal (backoffice)
|
|
2808
|
+
* Provides consistent structure for viewing entity details
|
|
2809
|
+
*
|
|
2810
|
+
* @example
|
|
2811
|
+
* <DetailModal
|
|
2812
|
+
* open={showDetails}
|
|
2813
|
+
* onClose={() => setShowDetails(false)}
|
|
2814
|
+
* title="User Details"
|
|
2815
|
+
* subtitle="Created on Jan 1, 2024"
|
|
2816
|
+
* action={{
|
|
2817
|
+
* label: 'Edit',
|
|
2818
|
+
* onClick: handleEdit,
|
|
2819
|
+
* variant: 'primary'
|
|
2820
|
+
* }}
|
|
2821
|
+
* >
|
|
2822
|
+
* <InfoBox title="Basic Information">
|
|
2823
|
+
* <InfoRow label="Name" value={user.name} />
|
|
2824
|
+
* <InfoRow label="Email" value={user.email} />
|
|
2825
|
+
* </InfoBox>
|
|
2826
|
+
* </DetailModal>
|
|
2827
|
+
*/
|
|
2828
|
+
function DetailModal({ open, onClose, title, icon, subtitle, children, closeText = 'Close', action, size = 'md', className = '' }) {
|
|
2829
|
+
return (jsxRuntimeExports.jsxs(Modal, { open: open, onClose: onClose, closeOnOverlay: true, className: className, style: {
|
|
2830
|
+
maxWidth: sizeMap[size],
|
|
2831
|
+
maxHeight: '90vh',
|
|
2832
|
+
overflowY: 'auto',
|
|
2833
|
+
padding: '24px'
|
|
2834
|
+
}, children: [jsxRuntimeExports.jsxs("div", { style: {
|
|
2835
|
+
display: 'flex',
|
|
2836
|
+
alignItems: 'center',
|
|
2837
|
+
justifyContent: 'space-between',
|
|
2838
|
+
marginBottom: subtitle ? '8px' : '24px'
|
|
2839
|
+
}, children: [jsxRuntimeExports.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: [icon && (jsxRuntimeExports.jsx("div", { style: {
|
|
2840
|
+
display: 'flex',
|
|
2841
|
+
alignItems: 'center',
|
|
2842
|
+
justifyContent: 'center',
|
|
2843
|
+
width: 32,
|
|
2844
|
+
height: 32,
|
|
2845
|
+
fontSize: '1.25rem',
|
|
2846
|
+
lineHeight: 0,
|
|
2847
|
+
opacity: 0.5
|
|
2848
|
+
}, children: icon })), jsxRuntimeExports.jsx(Typography, { variant: "h3", color: "primary", style: { margin: 0 }, children: title })] }), jsxRuntimeExports.jsx("button", { type: "button", onClick: onClose, style: {
|
|
2849
|
+
background: 'none',
|
|
2850
|
+
border: 'none',
|
|
2851
|
+
padding: '8px',
|
|
2852
|
+
cursor: 'pointer',
|
|
2853
|
+
color: 'var(--mds-color-text-secondary)',
|
|
2854
|
+
borderRadius: '6px',
|
|
2855
|
+
display: 'flex',
|
|
2856
|
+
alignItems: 'center',
|
|
2857
|
+
justifyContent: 'center',
|
|
2858
|
+
transition: 'all 0.2s ease'
|
|
2859
|
+
}, onMouseEnter: (e) => {
|
|
2860
|
+
e.currentTarget.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
|
|
2861
|
+
}, onMouseLeave: (e) => {
|
|
2862
|
+
e.currentTarget.style.backgroundColor = 'transparent';
|
|
2863
|
+
}, "aria-label": "Close modal", children: jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), jsxRuntimeExports.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), subtitle && (jsxRuntimeExports.jsx(Typography, { variant: "body", color: "secondary", style: { marginBottom: '24px', fontSize: '0.9rem' }, children: subtitle })), jsxRuntimeExports.jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' }, children: children }), jsxRuntimeExports.jsxs("div", { style: {
|
|
2864
|
+
display: 'flex',
|
|
2865
|
+
gap: '12px',
|
|
2866
|
+
justifyContent: 'flex-end',
|
|
2867
|
+
marginTop: '24px',
|
|
2868
|
+
paddingTop: '16px',
|
|
2869
|
+
borderTop: '1px solid rgba(255, 255, 255, 0.1)'
|
|
2870
|
+
}, children: [jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "sm", onClick: onClose, children: closeText }), action && (jsxRuntimeExports.jsx(Button, { variant: action.variant || 'primary', size: "sm", onClick: action.onClick, disabled: action.disabled, children: action.label }))] })] }));
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2554
2873
|
function ModalHeader({ title, icon, onClose, closeAriaLabel = 'Fechar', align = 'center' }) {
|
|
2555
2874
|
const CloseIcon = (jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: jsxRuntimeExports.jsx("path", { d: "M18.3 5.71a1 1 0 00-1.41 0L12 10.59 7.11 5.7A1 1 0 105.7 7.11L10.59 12l-4.9 4.89a1 1 0 101.42 1.42L12 13.41l4.89 4.9a1 1 0 001.42-1.42L13.41 12l4.9-4.89a1 1 0 000-1.4z" }) }));
|
|
2556
2875
|
if (align === 'center') {
|
|
@@ -2565,7 +2884,8 @@ function ModalHeader({ title, icon, onClose, closeAriaLabel = 'Fechar', align =
|
|
|
2565
2884
|
alignItems: 'center',
|
|
2566
2885
|
justifyContent: 'center',
|
|
2567
2886
|
fontSize: '1.25rem',
|
|
2568
|
-
lineHeight: 0
|
|
2887
|
+
lineHeight: 0,
|
|
2888
|
+
opacity: 0.5
|
|
2569
2889
|
};
|
|
2570
2890
|
const closeBox = {
|
|
2571
2891
|
position: 'absolute',
|
|
@@ -2597,7 +2917,7 @@ function ModalHeader({ title, icon, onClose, closeAriaLabel = 'Fechar', align =
|
|
|
2597
2917
|
padding: '16px 24px',
|
|
2598
2918
|
marginBottom: 16,
|
|
2599
2919
|
borderBottom: '1px solid var(--border-color)'
|
|
2600
|
-
}, children: [icon && (jsxRuntimeExports.jsx("div", { "aria-hidden": true, style: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 32, height: 32, fontSize: '1.25rem', lineHeight: 0 }, children: icon })), jsxRuntimeExports.jsx("div", { style: { margin: 0, fontSize: '1.125rem', fontWeight: 600, flex: 1 }, children: typeof title === 'string' ? (jsxRuntimeExports.jsx("h3", { style: { margin: 0 }, children: title })) : (title) }), onClose && (jsxRuntimeExports.jsx("button", { type: "button", "aria-label": closeAriaLabel, onClick: onClose, style: { marginLeft: 'auto', background: 'transparent', border: 'none', width: 32, height: 32, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', lineHeight: 0 }, children: CloseIcon }))] }));
|
|
2920
|
+
}, children: [icon && (jsxRuntimeExports.jsx("div", { "aria-hidden": true, style: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 32, height: 32, fontSize: '1.25rem', lineHeight: 0, opacity: 0.5 }, children: icon })), jsxRuntimeExports.jsx("div", { style: { margin: 0, fontSize: '1.125rem', fontWeight: 600, flex: 1 }, children: typeof title === 'string' ? (jsxRuntimeExports.jsx("h3", { style: { margin: 0 }, children: title })) : (title) }), onClose && (jsxRuntimeExports.jsx("button", { type: "button", "aria-label": closeAriaLabel, onClick: onClose, style: { marginLeft: 'auto', background: 'transparent', border: 'none', width: 32, height: 32, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', lineHeight: 0 }, children: CloseIcon }))] }));
|
|
2601
2921
|
}
|
|
2602
2922
|
|
|
2603
2923
|
function ModalBody({ children, style, className }) {
|
|
@@ -2629,7 +2949,14 @@ exports.Button = Button;
|
|
|
2629
2949
|
exports.CellRenderers = CellRenderers;
|
|
2630
2950
|
exports.ConfirmDialog = ConfirmDialog;
|
|
2631
2951
|
exports.DataTable = DataTable;
|
|
2952
|
+
exports.DetailModal = DetailModal;
|
|
2953
|
+
exports.FormField = FormField;
|
|
2954
|
+
exports.FormGrid = FormGrid;
|
|
2955
|
+
exports.FormModal = FormModal;
|
|
2956
|
+
exports.FormSection = FormSection;
|
|
2632
2957
|
exports.GlassCard = GlassCard;
|
|
2958
|
+
exports.InfoBox = InfoBox;
|
|
2959
|
+
exports.InfoRow = InfoRow;
|
|
2633
2960
|
exports.Modal = Modal;
|
|
2634
2961
|
exports.ModalBody = ModalBody;
|
|
2635
2962
|
exports.ModalFooter = ModalFooter;
|