@metropolle/design-system 1.0.0-beta.2025.10.2.27.2a6f231 → 1.0.0-beta.2025.12.10.2347.96d02e7
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/css/components.css +45 -3
- package/dist/css/liquid-glass.css +496 -0
- package/dist/css/tokens.css +20 -6
- package/dist/react/components/react/GlassCard/GlassCard.d.ts +46 -6
- package/dist/react/components/react/GlassCard/GlassCard.d.ts.map +1 -1
- package/dist/react/index.esm.js +37 -10
- package/dist/react/index.esm.js.map +1 -1
- package/dist/react/index.js +37 -10
- package/dist/react/index.js.map +1 -1
- package/dist/tokens/colors.json +100 -18
- package/dist/tokens/index.js +20 -6
- package/dist/tokens/index.json +100 -18
- package/package.json +4 -2
package/dist/react/index.js
CHANGED
|
@@ -1372,12 +1372,35 @@ function cn(...classes) {
|
|
|
1372
1372
|
/**
|
|
1373
1373
|
* Glass Card Component
|
|
1374
1374
|
*
|
|
1375
|
-
* Componente de cartão com efeito glassmorphism
|
|
1376
|
-
*
|
|
1375
|
+
* Componente de cartão com efeito glassmorphism ou Liquid Glass (iOS 26 style).
|
|
1376
|
+
*
|
|
1377
|
+
* @example
|
|
1378
|
+
* ```tsx
|
|
1379
|
+
* // Liquid Glass (novo padrão)
|
|
1380
|
+
* <GlassCard glassStyle="liquid" intensity="md">
|
|
1381
|
+
* Content here
|
|
1382
|
+
* </GlassCard>
|
|
1383
|
+
*
|
|
1384
|
+
* // Glassmorphism tradicional (retrocompatível)
|
|
1385
|
+
* <GlassCard glassStyle="glass" variant="dark">
|
|
1386
|
+
* Content here
|
|
1387
|
+
* </GlassCard>
|
|
1388
|
+
* ```
|
|
1377
1389
|
*/
|
|
1378
|
-
const GlassCard = require$$0.forwardRef(({
|
|
1390
|
+
const GlassCard = require$$0.forwardRef(({ glassStyle = 'liquid', intensity = 'md', theme, variant = 'light', blur, opacity, children, className, enableHover = true, style, ...props }, ref) => {
|
|
1391
|
+
// Resolve theme from new prop or deprecated variant
|
|
1392
|
+
const resolvedTheme = theme ?? variant;
|
|
1393
|
+
// =====================
|
|
1394
|
+
// LIQUID GLASS MODE
|
|
1395
|
+
// =====================
|
|
1396
|
+
if (glassStyle === 'liquid') {
|
|
1397
|
+
return (jsxRuntimeExports.jsx("div", { ref: ref, className: cn('mds-liquid-glass', `mds-liquid-glass--${intensity}`, !enableHover && 'mds-liquid-glass--no-hover', className), style: style, ...props, children: children }));
|
|
1398
|
+
}
|
|
1399
|
+
// =====================
|
|
1400
|
+
// GLASS MODE (legacy)
|
|
1401
|
+
// =====================
|
|
1379
1402
|
// Default opacities baseadas no design existente
|
|
1380
|
-
const defaultOpacity =
|
|
1403
|
+
const defaultOpacity = resolvedTheme === 'light' ? 0.15 : 0.8;
|
|
1381
1404
|
const finalOpacity = opacity ?? defaultOpacity;
|
|
1382
1405
|
// Use CSS classes for base styles to avoid hydration mismatches
|
|
1383
1406
|
const baseStyles = {
|
|
@@ -1385,12 +1408,16 @@ const GlassCard = require$$0.forwardRef(({ variant = 'light', blur = 20, opacity
|
|
|
1385
1408
|
};
|
|
1386
1409
|
// Only apply custom styles for non-default values
|
|
1387
1410
|
const customStyles = {};
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1411
|
+
// Support legacy blur prop or convert from intensity
|
|
1412
|
+
const resolvedBlur = blur ?? (intensity ? {
|
|
1413
|
+
xs: 2, sm: 4, md: 6, lg: 8, xl: 12
|
|
1414
|
+
}[intensity] : 20);
|
|
1415
|
+
if (resolvedBlur !== 20) {
|
|
1416
|
+
customStyles.backdropFilter = `blur(${resolvedBlur}px)`;
|
|
1417
|
+
customStyles.WebkitBackdropFilter = `blur(${resolvedBlur}px)`;
|
|
1391
1418
|
}
|
|
1392
1419
|
if (opacity !== undefined) {
|
|
1393
|
-
customStyles.background =
|
|
1420
|
+
customStyles.background = resolvedTheme === 'light'
|
|
1394
1421
|
? `rgba(255, 255, 255, ${finalOpacity})`
|
|
1395
1422
|
: `rgba(60, 60, 60, ${finalOpacity})`;
|
|
1396
1423
|
}
|
|
@@ -1405,7 +1432,7 @@ const GlassCard = require$$0.forwardRef(({ variant = 'light', blur = 20, opacity
|
|
|
1405
1432
|
borderColor: 'rgba(255, 255, 255, 0.2)',
|
|
1406
1433
|
background: opacity !== undefined ? `rgba(70, 70, 70, ${finalOpacity})` : undefined,
|
|
1407
1434
|
}
|
|
1408
|
-
}[
|
|
1435
|
+
}[resolvedTheme] : {};
|
|
1409
1436
|
const handleMouseEnter = (e) => {
|
|
1410
1437
|
if (!enableHover)
|
|
1411
1438
|
return;
|
|
@@ -1423,7 +1450,7 @@ const GlassCard = require$$0.forwardRef(({ variant = 'light', blur = 20, opacity
|
|
|
1423
1450
|
});
|
|
1424
1451
|
props.onMouseLeave?.(e);
|
|
1425
1452
|
};
|
|
1426
|
-
return (jsxRuntimeExports.jsx("div", { ref: ref, className: cn('mds-glass-card', `mds-glass-card--${
|
|
1453
|
+
return (jsxRuntimeExports.jsx("div", { ref: ref, className: cn('mds-glass-card', `mds-glass-card--${resolvedTheme}`, !enableHover && 'mds-glass-card--no-hover', className), style: {
|
|
1427
1454
|
...baseStyles,
|
|
1428
1455
|
...customStyles,
|
|
1429
1456
|
...style
|