Replaces the Material 3 screens with the Noo design system: warm neutrals, one violet accent, pill controls, Schibsted Grotesk/ Instrument Sans, Lucide icons, no gradients/shadows. - New lib/widgets/noo/ component kit (core, lists, files, media, nav, overlays) plus lib/theme/design_tokens.dart for the color/type/space/ radius/motion tokens. - Rebuilt the app shell (top/bottom bars, drawer, desktop sidebar and toolbar), every tab (Files/Offline, Photos, Favorites, Recent, Activity, Trash, Shares), Settings, the lock and login screens, the media viewer, search, the details/share sheets, and the share-upload and move/copy destination pickers. - Added a design canvas (linked from DESIGN_SYSTEM.md) covering the screens the spec didn't already describe, with matching Android and iOS chrome; wrote up the approved recipes into DESIGN_SYSTEM.md §4. - Removed now-dead legacy widgets (media_grid_tile, swipeable_item, sync_status_badge, selectable_thumbnail) and updated architecture.md/styling.md/standards.md to describe the new structure and component/testing conventions. - Added widget tests for the noo/ component kit. This is a UI-only rework: no provider/model/service behavior changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
48 lines
1.9 KiB
Dart
48 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../theme/design_tokens.dart';
|
|
|
|
enum NooBadgeTone { success, danger, accent, warning, info }
|
|
|
|
/// Small status pill, e.g. "Connected" in settings (Noo Design System
|
|
/// project, `components/core/Badge.jsx`).
|
|
class NooBadge extends StatelessWidget {
|
|
final NooBadgeTone tone;
|
|
final Widget child;
|
|
|
|
const NooBadge({super.key, this.tone = NooBadgeTone.success, required this.child});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colors = context.nooColors;
|
|
final (bg, fg) = switch (tone) {
|
|
NooBadgeTone.success => (colors.successSoft, colors.success),
|
|
NooBadgeTone.danger => (colors.dangerSoft, colors.danger),
|
|
NooBadgeTone.accent => (colors.accentSoft, colors.accentText),
|
|
NooBadgeTone.warning => (colors.warningSoft, colors.warning),
|
|
NooBadgeTone.info => (colors.infoSoft, colors.info),
|
|
};
|
|
return Container(
|
|
height: 24,
|
|
// Centering the text vertically within the fixed 24px height needs
|
|
// *some* alignment mechanism, but Container's own `alignment:` (with
|
|
// a height but no width) would expand to fill all available
|
|
// *bounded* width instead of shrink-wrapping (see NooFab's doc
|
|
// comment) - a Row with mainAxisSize.min sidesteps that entirely:
|
|
// it shrink-wraps horizontally regardless of incoming constraints,
|
|
// while its default crossAxisAlignment.center still centers the
|
|
// text within the Container's tight 24px height.
|
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
decoration: BoxDecoration(color: bg, borderRadius: BorderRadius.circular(NooRadii.pill)),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
DefaultTextStyle(
|
|
style: NooText.label.copyWith(fontSize: 12, height: 1, color: fg),
|
|
child: child,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|