feat: video letterboxing, card badge styling, component updates

- Add object-fit: contain + black background for video in DTMediaFrame
- Style .dt-card-badge with mode-colored background, padding, and
  bevel-aware positioning (negative right offset for clean diagonal clip)
- Restore DTStaggerContainer in react-native (was incorrectly deleted)
- Update DTGallery, DTModal, DTMobileFilterOverlay, DTMediaFrame components
- Refresh showcase pages for desktop and mobile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
michael
2026-03-24 11:18:49 -07:00
parent d1e2bf1964
commit 195c47602d
24 changed files with 351 additions and 185 deletions

View File

@@ -251,7 +251,6 @@ const styles = StyleSheet.create({
title: {
fontWeight: '600',
letterSpacing: 0.5,
textTransform: 'uppercase',
fontSize: 14,
},
contentWrapper: {},

View File

@@ -243,6 +243,5 @@ const styles = StyleSheet.create({
label: {
fontWeight: '600',
letterSpacing: 1,
textTransform: 'uppercase',
},
});

View File

@@ -49,6 +49,11 @@ interface DTCardProps {
* @default 0
*/
progress?: number;
/**
* Which area expands when the card grows to fill space
* @default 'body'
*/
growArea?: 'body' | 'title';
/**
* Additional styles for the card container
*/
@@ -81,6 +86,10 @@ interface DTCardProps {
* Background color (defaults to theme background)
*/
backgroundColor?: string;
/**
* Element rendered at the right edge of the header
*/
headerRight?: ReactNode;
/**
* Press handler
*/
@@ -215,6 +224,7 @@ export function DTCard({
title,
showHeader,
progress = 0,
growArea = 'body',
style,
contentStyle,
padding = 16,
@@ -222,6 +232,7 @@ export function DTCard({
bevelSize = 32,
bevelSizeSmall = 16,
backgroundColor,
headerRight,
onPress,
}: DTCardProps) {
const theme = useDTTheme();
@@ -327,7 +338,7 @@ export function DTCard({
)}
<View style={[styles.innerContainer, useBevels && {paddingLeft: bevelSizeSmall - borderWidth}]}>
{shouldShowHeader && (
<View style={[styles.header, {backgroundColor: accentColor}]}>
<View style={[styles.header, {backgroundColor: accentColor}, growArea === 'title' && {flex: 1}, !!(title && headerRight) && styles.headerRow]}>
{title && (
<Text
variant="titleMedium"
@@ -335,9 +346,10 @@ export function DTCard({
{title}
</Text>
)}
{headerRight}
</View>
)}
<View style={[styles.content, {padding}, contentStyle]}>{children}</View>
<View style={[styles.content, {padding}, growArea === 'body' && {flex: 1}, contentStyle]}>{children}</View>
</View>
{/* Frame overlay (above content) — beveled mode only.
Uses evenodd with 3 sub-paths: outer + inner + progressArea.
@@ -400,12 +412,18 @@ const styles = StyleSheet.create({
position: 'relative',
zIndex: 1,
overflow: 'hidden',
flex: 1,
},
header: {
paddingLeft: 8,
paddingRight: 16,
paddingVertical: 12,
},
headerRow: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
headerText: {
fontWeight: '700',
letterSpacing: 0.5,

View File

@@ -109,7 +109,6 @@ const styles = StyleSheet.create({
headerText: {
fontWeight: '700',
letterSpacing: 0.5,
textTransform: 'uppercase',
},
grid: {
flexDirection: 'row',

View File

@@ -79,6 +79,11 @@ interface DTGalleryProps {
* @default 3
*/
borderWidth?: number;
/**
* Aspect ratio (width / height) for the display area
* @default 1
*/
aspectRatio?: number;
/**
* Additional styles
*/
@@ -108,6 +113,7 @@ export function DTGallery({
thumbnailSize = 64,
bevelSize = 24,
borderWidth = 3,
aspectRatio = 1,
style,
}: DTGalleryProps) {
const theme = useDTTheme();
@@ -276,6 +282,7 @@ export function DTGallery({
<View
style={[
styles.mainImageContainer,
{ aspectRatio },
!useBevels && {
borderWidth,
borderColor: accentColor,
@@ -355,7 +362,6 @@ const styles = StyleSheet.create({
gap: 12,
},
mainImageContainer: {
aspectRatio: 1,
position: 'relative',
},
mainImageContent: {

View File

@@ -341,7 +341,6 @@ const styles = StyleSheet.create({
menuItemTitle: {
fontWeight: '600',
letterSpacing: 0.5,
textTransform: 'uppercase',
fontSize: 14,
},
chevron: {

View File

@@ -9,8 +9,8 @@
* - Content in beveled card container
*/
import {StyleSheet, ViewStyle, StyleProp, KeyboardAvoidingView, Platform} from 'react-native';
import {Portal, Modal} from 'react-native-paper';
import {StyleSheet, ViewStyle, StyleProp, KeyboardAvoidingView, Platform, Pressable} from 'react-native';
import {Portal, Modal, Text} from 'react-native-paper';
import {useDTTheme} from '../theme/DTThemeProvider';
import {type DTVariant} from '../utils/variantColors';
import {DTCard} from './DTCard';
@@ -97,6 +97,17 @@ export function DTModal({
mode={variant}
title={title}
showHeader={!!title}
headerRight={dismissable ? (
<Pressable
onPress={onDismiss}
hitSlop={8}
accessibilityLabel="Close"
accessibilityRole="button">
<Text style={{ color: theme.colors.onPrimary, fontSize: 18, lineHeight: 18 }}>
{'\u2715'}
</Text>
</Pressable>
) : undefined}
contentStyle={contentStyle}>
{children}
</DTCard>