diff --git a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart index 028f42b6..628d57a6 100644 --- a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart +++ b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart @@ -6,30 +6,23 @@ import '../../utils/scaffold.dart'; Widget notificationListItemUseCase(BuildContext context) => WidgetbookScaffold( builder: (context, _) => Padding( - padding: EdgeInsets.symmetric( - horizontal: - context.knobs.list(label: "Size", options: [100, 200, 400])), + padding: EdgeInsets.symmetric(horizontal: context.knobs.list(label: "Size", options: [100, 200, 400])), child: ZetaNotificationListItem( body: Text( "New urgent message " * 300, maxLines: 2, overflow: TextOverflow.ellipsis, ), - attachment: - context.knobs.boolean(label: "Attachment", initialValue: false) - ? Text("Spring-Donation-Drive.pdf") - : null, - title: context.knobs - .string(label: "Title", initialValue: "Urgent Notification"), - notificationTime: context.knobs.stringOrNull( - label: "Notification Time", initialValue: "Just Now"), - notificationRead: context.knobs - .boolean(label: "Notification Read", initialValue: false), + attachment: context.knobs.boolean(label: "Attachment", initialValue: false) + ? Text("Spring-Donation-Drive.pdf") + : null, + title: context.knobs.string(label: "Title", initialValue: "Urgent Notification"), + notificationTime: context.knobs.stringOrNull(label: "Notification Time", initialValue: "Just Now"), + notificationRead: context.knobs.boolean(label: "Notification Read", initialValue: false), leading: context.knobs.list( label: 'Badge', options: [ - ZetaNotificationBadge.avatar( - avatar: ZetaAvatar.initials(initials: "JS")), + ZetaNotificationBadge.avatar(avatar: ZetaAvatar.initials(initials: "JS")), ZetaNotificationBadge.icon(icon: ZetaIcons.check_circle), ZetaNotificationBadge.image( image: Image.network( @@ -41,19 +34,16 @@ Widget notificationListItemUseCase(BuildContext context) => WidgetbookScaffold( ? "Icon" : "Image", ), - action: - context.knobs.boolean(label: "Show action", initialValue: true) - ? ZetaButton.outline( - label: "User Action", - onPressed: () {}, - size: ZetaWidgetSize.small, - borderType: ZetaWidgetBorder.rounded, - ) - : null, - showDivider: - context.knobs.boolean(label: "Show Divider", initialValue: false), - showBellIcon: context.knobs - .boolean(label: "Show Bell Icon", initialValue: true), + action: context.knobs.boolean(label: "Show action", initialValue: true) + ? ZetaButton.outline( + label: "User Action", + onPressed: () {}, + size: ZetaWidgetSize.small, + borderType: ZetaWidgetBorder.rounded, + ) + : null, + showDivider: context.knobs.boolean(label: "Show Divider", initialValue: false), + showBellIcon: context.knobs.boolean(label: "Show Bell Icon", initialValue: true), ), ), ); diff --git a/lib/generated/tokens/primitives.g.dart b/lib/generated/tokens/primitives.g.dart index ce0ca7e7..aafdaeec 100644 --- a/lib/generated/tokens/primitives.g.dart +++ b/lib/generated/tokens/primitives.g.dart @@ -8,6 +8,26 @@ import 'package:zeta_flutter/zeta_flutter.dart'; /// Interface used for zeta color primitives abstract interface class ZetaPrimitives { + const ZetaPrimitives({ + ZetaColorSwatch? primary, + ZetaColorSwatch? secondary, + required this.brightness, + }) : _primary = primary, + _secondary = secondary; + + final ZetaColorSwatch? _primary; + + final ZetaColorSwatch? _secondary; + + /// Primary color + ZetaColorSwatch get primary => _primary ?? blue; + + /// Secondary color + ZetaColorSwatch get secondary => _secondary ?? yellow; + + /// The brightness of the primitives + final Brightness brightness; + /// Blue /// /// {@macro zeta-colors-swatch} @@ -134,281 +154,208 @@ abstract interface class ZetaPrimitives { } /// Light primitives -final class ZetaPrimitivesLight implements ZetaPrimitives { - /// Blue - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch blue = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFf1f8ff), - 20: Color(0xFFe2f1ff), - 30: Color(0xFFb7dbff), - 40: Color(0xFF7ebeff), - 50: Color(0xFF599fe5), - 60: Color(0xFF0073e6), - 70: Color(0xFF0061c2), - 80: Color(0xFF004d99), - 90: Color(0xFF002c58), - 100: Color(0xFF101b25), - }, - primary: 0xFF0073e6, - ); - - /// Cool - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch cool = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFf8fbff), - 20: Color(0xFFf3f6fa), - 30: Color(0xFFe0e3e9), - 40: Color(0xFFced2db), - 50: Color(0xFF8d95a3), - 60: Color(0xFF7a8190), - 70: Color(0xFF545963), - 80: Color(0xFF2c2f36), - 90: Color(0xFF1d1e23), - 100: Color(0xFF0c0d0e), - }, - primary: 0xFF7a8190, - ); - - /// Green - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch green = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFecfff7), - 20: Color(0xFFd8ffef), - 30: Color(0xFFbeefdb), - 40: Color(0xFF84dab6), - 50: Color(0xFF67b796), - 60: Color(0xFF00864f), - 70: Color(0xFF006d3f), - 80: Color(0xFF005f38), - 90: Color(0xFF00331e), - 100: Color(0xFF081711), - }, - primary: 0xFF00864f, - ); - - /// Orange - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch orange = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFfef2e2), - 20: Color(0xFFffe7c6), - 30: Color(0xFFffd292), - 40: Color(0xFFffb348), - 50: Color(0xFFf5a230), - 60: Color(0xFFae6500), - 70: Color(0xFF965802), - 80: Color(0xFF764502), - 90: Color(0xFF402600), - 100: Color(0xFF1e1100), - }, - primary: 0xFFae6500, - ); - - /// Pink - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch pink = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFfff7fc), - 20: Color(0xFFffe3f5), - 30: Color(0xFFffbee7), - 40: Color(0xFFff94d8), - 50: Color(0xFFee78c3), - 60: Color(0xFFd30589), - 70: Color(0xFFab006d), - 80: Color(0xFF840054), - 90: Color(0xFF640040), - 100: Color(0xFF2e001e), - }, - primary: 0xFFd30589, - ); - - /// Pure - /// - /// {@macro zeta-colors-swatch} - @override - ZetaPureColorSwatch pure = const ZetaPureColorSwatch( - swatch: { - 0: Color(0xFFffffff), - 500: Color(0xFF151519), - 1000: Color(0xFF151519), - }, - primary: 0xFF151519, - ); - - /// Purple - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch purple = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFf7f0ff), - 20: Color(0xFFefe1ff), - 30: Color(0xFFdcc1fb), - 40: Color(0xFFcea4ff), - 50: Color(0xFF9b71df), - 60: Color(0xFF7e0cff), - 70: Color(0xFF6400d6), - 80: Color(0xFF43008f), - 90: Color(0xFF260052), - 100: Color(0xFF180f22), - }, - primary: 0xFF7e0cff, - ); - - /// Red - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch red = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFfff0f1), - 20: Color(0xFFffe1e4), - 30: Color(0xFFffb3bb), - 40: Color(0xFFf98c97), - 50: Color(0xFFf36170), - 60: Color(0xFFd70015), - 70: Color(0xFFb50012), - 80: Color(0xFF8f000e), - 90: Color(0xFF520008), - 100: Color(0xFF220f11), - }, - primary: 0xFFd70015, - ); - - /// Teal - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch teal = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFecffff), - 20: Color(0xFFd9ffff), - 30: Color(0xFFbcfbfb), - 40: Color(0xFF91e1e1), - 50: Color(0xFF65c4c4), - 60: Color(0xFF1a8080), - 70: Color(0xFF017474), - 80: Color(0xFF005b5b), - 90: Color(0xFF003535), - 100: Color(0xFF0a1616), - }, - primary: 0xFF1a8080, - ); - - /// Warm - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch warm = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFfafafa), - 20: Color(0xFFf6f6f6), - 30: Color(0xFFececec), - 40: Color(0xFFdedede), - 50: Color(0xFFb9b9b9), - 60: Color(0xFF858585), - 70: Color(0xFF585858), - 80: Color(0xFF313131), - 90: Color(0xFF1d1e23), - 100: Color(0xFF151519), - }, - primary: 0xFF858585, - ); - - /// Yellow - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch yellow = const ZetaColorSwatch( - swatch: { - 10: Color(0xFFfff7d4), - 20: Color(0xFFffea89), - 30: Color(0xFFf3d961), - 40: Color(0xFFdbb91c), - 50: Color(0xFFc2a728), - 60: Color(0xFF8d7400), - 70: Color(0xFF766200), - 80: Color(0xFF564908), - 90: Color(0xFF352b00), - 100: Color(0xFF181400), - }, - primary: 0xFF8d7400, - ); - - /// 0dp space +final class ZetaPrimitivesLight extends ZetaPrimitives { + /// Constructs a new ZetaPrimitivesLight instance with the (optional) primary and secondary colors. + const ZetaPrimitivesLight({super.primary, super.secondary}) : super(brightness: Brightness.light); + @override + ZetaColorSwatch get blue => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFf1f8ff), + 20: Color(0xFFe2f1ff), + 30: Color(0xFFb7dbff), + 40: Color(0xFF7ebeff), + 50: Color(0xFF599fe5), + 60: Color(0xFF0073e6), + 70: Color(0xFF0061c2), + 80: Color(0xFF004d99), + 90: Color(0xFF002c58), + 100: Color(0xFF101b25), + }, + primary: 0xFF0073e6, + ); + @override + ZetaColorSwatch get cool => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFf8fbff), + 20: Color(0xFFf3f6fa), + 30: Color(0xFFe0e3e9), + 40: Color(0xFFced2db), + 50: Color(0xFF8d95a3), + 60: Color(0xFF7a8190), + 70: Color(0xFF545963), + 80: Color(0xFF2c2f36), + 90: Color(0xFF1d1e23), + 100: Color(0xFF0c0d0e), + }, + primary: 0xFF7a8190, + ); + @override + ZetaColorSwatch get green => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFecfff7), + 20: Color(0xFFd8ffef), + 30: Color(0xFFbeefdb), + 40: Color(0xFF84dab6), + 50: Color(0xFF67b796), + 60: Color(0xFF00864f), + 70: Color(0xFF006d3f), + 80: Color(0xFF005f38), + 90: Color(0xFF00331e), + 100: Color(0xFF081711), + }, + primary: 0xFF00864f, + ); + @override + ZetaColorSwatch get orange => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFfef2e2), + 20: Color(0xFFffe7c6), + 30: Color(0xFFffd292), + 40: Color(0xFFffb348), + 50: Color(0xFFf5a230), + 60: Color(0xFFae6500), + 70: Color(0xFF965802), + 80: Color(0xFF764502), + 90: Color(0xFF402600), + 100: Color(0xFF1e1100), + }, + primary: 0xFFae6500, + ); + @override + ZetaColorSwatch get pink => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFfff7fc), + 20: Color(0xFFffe3f5), + 30: Color(0xFFffbee7), + 40: Color(0xFFff94d8), + 50: Color(0xFFee78c3), + 60: Color(0xFFd30589), + 70: Color(0xFFab006d), + 80: Color(0xFF840054), + 90: Color(0xFF640040), + 100: Color(0xFF2e001e), + }, + primary: 0xFFd30589, + ); + @override + ZetaPureColorSwatch get pure => const ZetaPureColorSwatch( + swatch: { + 0: Color(0xFFffffff), + 500: Color(0xFF151519), + 1000: Color(0xFF151519), + }, + primary: 0xFF151519, + ); + @override + ZetaColorSwatch get purple => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFf7f0ff), + 20: Color(0xFFefe1ff), + 30: Color(0xFFdcc1fb), + 40: Color(0xFFcea4ff), + 50: Color(0xFF9b71df), + 60: Color(0xFF7e0cff), + 70: Color(0xFF6400d6), + 80: Color(0xFF43008f), + 90: Color(0xFF260052), + 100: Color(0xFF180f22), + }, + primary: 0xFF7e0cff, + ); + @override + ZetaColorSwatch get red => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFfff0f1), + 20: Color(0xFFffe1e4), + 30: Color(0xFFffb3bb), + 40: Color(0xFFf98c97), + 50: Color(0xFFf36170), + 60: Color(0xFFd70015), + 70: Color(0xFFb50012), + 80: Color(0xFF8f000e), + 90: Color(0xFF520008), + 100: Color(0xFF220f11), + }, + primary: 0xFFd70015, + ); + @override + ZetaColorSwatch get teal => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFecffff), + 20: Color(0xFFd9ffff), + 30: Color(0xFFbcfbfb), + 40: Color(0xFF91e1e1), + 50: Color(0xFF65c4c4), + 60: Color(0xFF1a8080), + 70: Color(0xFF017474), + 80: Color(0xFF005b5b), + 90: Color(0xFF003535), + 100: Color(0xFF0a1616), + }, + primary: 0xFF1a8080, + ); + @override + ZetaColorSwatch get warm => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFfafafa), + 20: Color(0xFFf6f6f6), + 30: Color(0xFFececec), + 40: Color(0xFFdedede), + 50: Color(0xFFb9b9b9), + 60: Color(0xFF858585), + 70: Color(0xFF585858), + 80: Color(0xFF313131), + 90: Color(0xFF1d1e23), + 100: Color(0xFF151519), + }, + primary: 0xFF858585, + ); + @override + ZetaColorSwatch get yellow => const ZetaColorSwatch( + swatch: { + 10: Color(0xFFfff7d4), + 20: Color(0xFFffea89), + 30: Color(0xFFf3d961), + 40: Color(0xFFdbb91c), + 50: Color(0xFFc2a728), + 60: Color(0xFF8d7400), + 70: Color(0xFF766200), + 80: Color(0xFF564908), + 90: Color(0xFF352b00), + 100: Color(0xFF181400), + }, + primary: 0xFF8d7400, + ); @override double get x0 => 0; - - /// 4dp space @override double get x1 => 4; - - /// 8dp space @override double get x2 => 8; - - /// 12dp space @override double get x3 => 12; - - /// 16dp space @override double get x4 => 16; - - /// 20dp space @override double get x5 => 20; - - /// 24dp space @override double get x6 => 24; - - /// 28dp space @override double get x7 => 28; - - /// 32dp space @override double get x8 => 32; - - /// 36dp space @override double get x9 => 36; - - /// 40dp space @override double get x10 => 40; - - /// 44dp space @override double get x11 => 44; - - /// 48dp space @override double get x12 => 48; - - /// 64dp space @override double get x13 => 64; - - /// 80dp space @override double get x14 => 80; - - /// 96dp space @override double get x15 => 96; @override @@ -428,281 +375,208 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { } /// Dark primitives -final class ZetaPrimitivesDark implements ZetaPrimitives { - /// Blue - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch blue = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF101b25), - 20: Color(0xFF002c58), - 30: Color(0xFF004d99), - 40: Color(0xFF0061c2), - 50: Color(0xFF0073e6), - 60: Color(0xFF599fe5), - 70: Color(0xFF7ebeff), - 80: Color(0xFFb7dbff), - 90: Color(0xFFe2f1ff), - 100: Color(0xFFf1f8ff), - }, - primary: 0xFF599fe5, - ); - - /// Cool - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch cool = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF0c0d0e), - 20: Color(0xFF1d1e23), - 30: Color(0xFF2c2f36), - 40: Color(0xFF545963), - 50: Color(0xFF7a8190), - 60: Color(0xFF8d95a3), - 70: Color(0xFFbbc1cb), - 80: Color(0xFFe0e3e9), - 90: Color(0xFFf3f6fa), - 100: Color(0xFFf8fbff), - }, - primary: 0xFF8d95a3, - ); - - /// Green - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch green = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF081711), - 20: Color(0xFF00331e), - 30: Color(0xFF005f38), - 40: Color(0xFF006d3f), - 50: Color(0xFF00864f), - 60: Color(0xFF67b796), - 70: Color(0xFF84dab6), - 80: Color(0xFFbeefdb), - 90: Color(0xFFd8ffef), - 100: Color(0xFFecfff7), - }, - primary: 0xFF67b796, - ); - - /// Orange - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch orange = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF1e1100), - 20: Color(0xFF402600), - 30: Color(0xFF764502), - 40: Color(0xFF965802), - 50: Color(0xFFae6500), - 60: Color(0xFFd78d26), - 70: Color(0xFFffb348), - 80: Color(0xFFffd292), - 90: Color(0xFFffe7c6), - 100: Color(0xFFfef2e2), - }, - primary: 0xFFd78d26, - ); - - /// Pink - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch pink = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF2e001e), - 20: Color(0xFF640040), - 30: Color(0xFF840054), - 40: Color(0xFFab006d), - 50: Color(0xFFd30589), - 60: Color(0xFFee78c3), - 70: Color(0xFFff94d8), - 80: Color(0xFFffbee7), - 90: Color(0xFFffe3f5), - 100: Color(0xFFfff7fc), - }, - primary: 0xFFee78c3, - ); - - /// Pure - /// - /// {@macro zeta-colors-swatch} - @override - ZetaPureColorSwatch pure = const ZetaPureColorSwatch( - swatch: { - 0: Color(0xFF151519), - 500: Color(0xFF1d1e23), - 1000: Color(0xFFffffff), - }, - primary: 0xFF1d1e23, - ); - - /// Purple - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch purple = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF180f22), - 20: Color(0xFF260052), - 30: Color(0xFF43008f), - 40: Color(0xFF6400d6), - 50: Color(0xFF7e0cff), - 60: Color(0xFF9b71df), - 70: Color(0xFFcea4ff), - 80: Color(0xFFdcc1fb), - 90: Color(0xFFefe1ff), - 100: Color(0xFFf7f0ff), - }, - primary: 0xFF9b71df, - ); - - /// Red - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch red = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF220f11), - 20: Color(0xFF520008), - 30: Color(0xFF8f000e), - 40: Color(0xFFb50012), - 50: Color(0xFFd70015), - 60: Color(0xFFf36170), - 70: Color(0xFFf98c97), - 80: Color(0xFFffb3bb), - 90: Color(0xFFffe1e4), - 100: Color(0xFFfff0f1), - }, - primary: 0xFFf36170, - ); - - /// Teal - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch teal = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF0a1616), - 20: Color(0xFF003535), - 30: Color(0xFF005b5b), - 40: Color(0xFF017474), - 50: Color(0xFF1a8080), - 60: Color(0xFF65c4c4), - 70: Color(0xFF91e1e1), - 80: Color(0xFFbcfbfb), - 90: Color(0xFFd9ffff), - 100: Color(0xFFecffff), - }, - primary: 0xFF65c4c4, - ); - - /// Warm - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch warm = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF151519), - 20: Color(0xFF1d1e23), - 30: Color(0xFF313131), - 40: Color(0xFF585858), - 50: Color(0xFF858585), - 60: Color(0xFFb9b9b9), - 70: Color(0xFFdedede), - 80: Color(0xFFececec), - 90: Color(0xFFf6f6f6), - 100: Color(0xFFfafafa), - }, - primary: 0xFFb9b9b9, - ); - - /// Yellow - /// - /// {@macro zeta-colors-swatch} - @override - ZetaColorSwatch yellow = const ZetaColorSwatch( - swatch: { - 10: Color(0xFF181400), - 20: Color(0xFF352b00), - 30: Color(0xFF564908), - 40: Color(0xFF766200), - 50: Color(0xFF8d7400), - 60: Color(0xFFc2a728), - 70: Color(0xFFdbb91c), - 80: Color(0xFFf3d961), - 90: Color(0xFFffea89), - 100: Color(0xFFfff7d4), - }, - primary: 0xFFc2a728, - ); - - /// 0dp space +final class ZetaPrimitivesDark extends ZetaPrimitives { + /// Constructs a new ZetaPrimitivesDark instance with the (optional) primary and secondary colors. + const ZetaPrimitivesDark({super.primary, super.secondary}) : super(brightness: Brightness.dark); + @override + ZetaColorSwatch get blue => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF101b25), + 20: Color(0xFF002c58), + 30: Color(0xFF004d99), + 40: Color(0xFF0061c2), + 50: Color(0xFF0073e6), + 60: Color(0xFF599fe5), + 70: Color(0xFF7ebeff), + 80: Color(0xFFb7dbff), + 90: Color(0xFFe2f1ff), + 100: Color(0xFFf1f8ff), + }, + primary: 0xFF599fe5, + ); + @override + ZetaColorSwatch get cool => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF0c0d0e), + 20: Color(0xFF1d1e23), + 30: Color(0xFF2c2f36), + 40: Color(0xFF545963), + 50: Color(0xFF7a8190), + 60: Color(0xFF8d95a3), + 70: Color(0xFFbbc1cb), + 80: Color(0xFFe0e3e9), + 90: Color(0xFFf3f6fa), + 100: Color(0xFFf8fbff), + }, + primary: 0xFF8d95a3, + ); + @override + ZetaColorSwatch get green => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF081711), + 20: Color(0xFF00331e), + 30: Color(0xFF005f38), + 40: Color(0xFF006d3f), + 50: Color(0xFF00864f), + 60: Color(0xFF67b796), + 70: Color(0xFF84dab6), + 80: Color(0xFFbeefdb), + 90: Color(0xFFd8ffef), + 100: Color(0xFFecfff7), + }, + primary: 0xFF67b796, + ); + @override + ZetaColorSwatch get orange => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF1e1100), + 20: Color(0xFF402600), + 30: Color(0xFF764502), + 40: Color(0xFF965802), + 50: Color(0xFFae6500), + 60: Color(0xFFd78d26), + 70: Color(0xFFffb348), + 80: Color(0xFFffd292), + 90: Color(0xFFffe7c6), + 100: Color(0xFFfef2e2), + }, + primary: 0xFFd78d26, + ); + @override + ZetaColorSwatch get pink => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF2e001e), + 20: Color(0xFF640040), + 30: Color(0xFF840054), + 40: Color(0xFFab006d), + 50: Color(0xFFd30589), + 60: Color(0xFFee78c3), + 70: Color(0xFFff94d8), + 80: Color(0xFFffbee7), + 90: Color(0xFFffe3f5), + 100: Color(0xFFfff7fc), + }, + primary: 0xFFee78c3, + ); + @override + ZetaPureColorSwatch get pure => const ZetaPureColorSwatch( + swatch: { + 0: Color(0xFF151519), + 500: Color(0xFF1d1e23), + 1000: Color(0xFFffffff), + }, + primary: 0xFF1d1e23, + ); + @override + ZetaColorSwatch get purple => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF180f22), + 20: Color(0xFF260052), + 30: Color(0xFF43008f), + 40: Color(0xFF6400d6), + 50: Color(0xFF7e0cff), + 60: Color(0xFF9b71df), + 70: Color(0xFFcea4ff), + 80: Color(0xFFdcc1fb), + 90: Color(0xFFefe1ff), + 100: Color(0xFFf7f0ff), + }, + primary: 0xFF9b71df, + ); + @override + ZetaColorSwatch get red => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF220f11), + 20: Color(0xFF520008), + 30: Color(0xFF8f000e), + 40: Color(0xFFb50012), + 50: Color(0xFFd70015), + 60: Color(0xFFf36170), + 70: Color(0xFFf98c97), + 80: Color(0xFFffb3bb), + 90: Color(0xFFffe1e4), + 100: Color(0xFFfff0f1), + }, + primary: 0xFFf36170, + ); + @override + ZetaColorSwatch get teal => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF0a1616), + 20: Color(0xFF003535), + 30: Color(0xFF005b5b), + 40: Color(0xFF017474), + 50: Color(0xFF1a8080), + 60: Color(0xFF65c4c4), + 70: Color(0xFF91e1e1), + 80: Color(0xFFbcfbfb), + 90: Color(0xFFd9ffff), + 100: Color(0xFFecffff), + }, + primary: 0xFF65c4c4, + ); + @override + ZetaColorSwatch get warm => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF151519), + 20: Color(0xFF1d1e23), + 30: Color(0xFF313131), + 40: Color(0xFF585858), + 50: Color(0xFF858585), + 60: Color(0xFFb9b9b9), + 70: Color(0xFFdedede), + 80: Color(0xFFececec), + 90: Color(0xFFf6f6f6), + 100: Color(0xFFfafafa), + }, + primary: 0xFFb9b9b9, + ); + @override + ZetaColorSwatch get yellow => const ZetaColorSwatch( + swatch: { + 10: Color(0xFF181400), + 20: Color(0xFF352b00), + 30: Color(0xFF564908), + 40: Color(0xFF766200), + 50: Color(0xFF8d7400), + 60: Color(0xFFc2a728), + 70: Color(0xFFdbb91c), + 80: Color(0xFFf3d961), + 90: Color(0xFFffea89), + 100: Color(0xFFfff7d4), + }, + primary: 0xFFc2a728, + ); @override double get x0 => 0; - - /// 4dp space @override double get x1 => 4; - - /// 8dp space @override double get x2 => 8; - - /// 12dp space @override double get x3 => 12; - - /// 16dp space @override double get x4 => 16; - - /// 20dp space @override double get x5 => 20; - - /// 24dp space @override double get x6 => 24; - - /// 28dp space @override double get x7 => 28; - - /// 32dp space @override double get x8 => 32; - - /// 36dp space @override double get x9 => 36; - - /// 40dp space @override double get x10 => 40; - - /// 44dp space @override double get x11 => 44; - - /// 48dp space @override double get x12 => 48; - - /// 64dp space @override double get x13 => 64; - - /// 80dp space @override double get x14 => 80; - - /// 96dp space @override double get x15 => 96; @override diff --git a/lib/generated/tokens/semantics.g.dart b/lib/generated/tokens/semantics.g.dart index 14e9f0a0..475c4a5e 100644 --- a/lib/generated/tokens/semantics.g.dart +++ b/lib/generated/tokens/semantics.g.dart @@ -339,9 +339,9 @@ class ZetaSemanticColorsAA implements ZetaSemanticColors { @override Color get mainSubtle => primitives.cool.shade70; @override - Color get mainPrimary => primitives.blue.shade60; + Color get mainPrimary => primitives.primary.shade60; @override - Color get mainSecondary => primitives.yellow.shade60; + Color get mainSecondary => primitives.secondary.shade60; @override Color get mainPositive => primitives.green.shade60; @override @@ -369,11 +369,11 @@ class ZetaSemanticColorsAA implements ZetaSemanticColors { @override Color get borderPure => primitives.pure.shade0; @override - Color get borderPrimaryMain => primitives.blue.shade60; + Color get borderPrimaryMain => primitives.primary.shade60; @override - Color get borderPrimary => primitives.blue.shade50; + Color get borderPrimary => primitives.primary.shade50; @override - Color get borderSecondary => primitives.yellow.shade50; + Color get borderSecondary => primitives.secondary.shade50; @override Color get borderPositive => primitives.green.shade50; @override @@ -399,11 +399,11 @@ class ZetaSemanticColorsAA implements ZetaSemanticColors { @override Color get surfaceWarm => primitives.warm.shade10; @override - Color get surfacePrimary => primitives.blue.shade60; + Color get surfacePrimary => primitives.primary.shade60; @override - Color get surfacePrimarySubtle => primitives.blue.shade10; + Color get surfacePrimarySubtle => primitives.primary.shade10; @override - Color get surfaceSecondary => primitives.yellow.shade60; + Color get surfaceSecondary => primitives.secondary.shade60; @override Color get surfaceAvatarBlue => primitives.blue.shade80; @override @@ -419,7 +419,7 @@ class ZetaSemanticColorsAA implements ZetaSemanticColors { @override Color get surfaceAvatarYellow => primitives.yellow.shade50; @override - Color get surfaceSecondarySubtle => primitives.yellow.shade10; + Color get surfaceSecondarySubtle => primitives.secondary.shade10; @override Color get surfacePositive => primitives.green.shade60; @override @@ -447,21 +447,21 @@ class ZetaSemanticColorsAA implements ZetaSemanticColors { @override Color get stateDefaultFocus => primitives.pure.shade0; @override - Color get statePrimaryEnabled => primitives.blue.shade60; + Color get statePrimaryEnabled => primitives.primary.shade60; @override - Color get statePrimaryHover => primitives.blue.shade50; + Color get statePrimaryHover => primitives.primary.shade50; @override - Color get statePrimarySelected => primitives.blue.shade70; + Color get statePrimarySelected => primitives.primary.shade70; @override - Color get statePrimaryFocus => primitives.blue.shade60; + Color get statePrimaryFocus => primitives.primary.shade60; @override - Color get stateSecondaryEnabled => primitives.yellow.shade40; + Color get stateSecondaryEnabled => primitives.secondary.shade40; @override - Color get stateSecondaryHover => primitives.yellow.shade30; + Color get stateSecondaryHover => primitives.secondary.shade30; @override - Color get stateSecondarySelected => primitives.yellow.shade50; + Color get stateSecondarySelected => primitives.secondary.shade50; @override - Color get stateSecondaryFocus => primitives.yellow.shade40; + Color get stateSecondaryFocus => primitives.secondary.shade40; @override Color get stateNegativeEnabled => primitives.red.shade60; @override @@ -507,9 +507,9 @@ class ZetaSemanticColorsAAA implements ZetaSemanticColors { @override Color get mainSubtle => primitives.cool.shade90; @override - Color get mainPrimary => primitives.blue.shade80; + Color get mainPrimary => primitives.primary.shade80; @override - Color get mainSecondary => primitives.yellow.shade80; + Color get mainSecondary => primitives.secondary.shade80; @override Color get mainPositive => primitives.green.shade80; @override @@ -537,11 +537,11 @@ class ZetaSemanticColorsAAA implements ZetaSemanticColors { @override Color get borderPure => primitives.pure.shade0; @override - Color get borderPrimaryMain => primitives.blue.shade80; + Color get borderPrimaryMain => primitives.primary.shade80; @override - Color get borderPrimary => primitives.blue.shade70; + Color get borderPrimary => primitives.primary.shade70; @override - Color get borderSecondary => primitives.yellow.shade70; + Color get borderSecondary => primitives.secondary.shade70; @override Color get borderPositive => primitives.green.shade70; @override @@ -567,11 +567,11 @@ class ZetaSemanticColorsAAA implements ZetaSemanticColors { @override Color get surfaceWarm => primitives.warm.shade10; @override - Color get surfacePrimary => primitives.blue.shade80; + Color get surfacePrimary => primitives.primary.shade80; @override - Color get surfacePrimarySubtle => primitives.blue.shade10; + Color get surfacePrimarySubtle => primitives.primary.shade10; @override - Color get surfaceSecondary => primitives.yellow.shade80; + Color get surfaceSecondary => primitives.secondary.shade80; @override Color get surfaceAvatarBlue => primitives.blue.shade80; @override @@ -587,7 +587,7 @@ class ZetaSemanticColorsAAA implements ZetaSemanticColors { @override Color get surfaceAvatarYellow => primitives.yellow.shade50; @override - Color get surfaceSecondarySubtle => primitives.yellow.shade10; + Color get surfaceSecondarySubtle => primitives.secondary.shade10; @override Color get surfacePositive => primitives.green.shade80; @override @@ -615,21 +615,21 @@ class ZetaSemanticColorsAAA implements ZetaSemanticColors { @override Color get stateDefaultFocus => primitives.pure.shade0; @override - Color get statePrimaryEnabled => primitives.blue.shade80; + Color get statePrimaryEnabled => primitives.primary.shade80; @override - Color get statePrimaryHover => primitives.blue.shade70; + Color get statePrimaryHover => primitives.primary.shade70; @override - Color get statePrimarySelected => primitives.blue.shade90; + Color get statePrimarySelected => primitives.primary.shade90; @override - Color get statePrimaryFocus => primitives.blue.shade80; + Color get statePrimaryFocus => primitives.primary.shade80; @override - Color get stateSecondaryEnabled => primitives.yellow.shade80; + Color get stateSecondaryEnabled => primitives.secondary.shade80; @override - Color get stateSecondaryHover => primitives.yellow.shade70; + Color get stateSecondaryHover => primitives.secondary.shade70; @override - Color get stateSecondarySelected => primitives.yellow.shade90; + Color get stateSecondarySelected => primitives.secondary.shade90; @override - Color get stateSecondaryFocus => primitives.yellow.shade80; + Color get stateSecondaryFocus => primitives.secondary.shade80; @override Color get stateNegativeEnabled => primitives.red.shade80; @override diff --git a/lib/src/components/list_item/notification_list_item.dart b/lib/src/components/list_item/notification_list_item.dart index a82b3948..1ea51c95 100644 --- a/lib/src/components/list_item/notification_list_item.dart +++ b/lib/src/components/list_item/notification_list_item.dart @@ -77,7 +77,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { final extend = actionWith / maxScreenWidth; if (extend.clamp(0, maxButtonWidth).toDouble() > 1) { return 1; - } + } return extend.clamp(0, maxButtonWidth).toDouble(); } @@ -148,8 +148,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ MergeSemantics( child: Row( @@ -160,9 +159,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { size: ZetaWidgetSize.small, ), SizedBox( - width: Zeta.of(context) - .spacing - .minimum, + width: Zeta.of(context).spacing.minimum, ), Text( title, @@ -176,8 +173,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { if (notificationTime != null) Text( notificationTime!, - style: - ZetaTextStyles.bodySmall.apply( + style: ZetaTextStyles.bodySmall.apply( color: colors.textDisabled, ), ), @@ -186,15 +182,12 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { padding: const EdgeInsets.all(2), decoration: BoxDecoration( color: colors.surfaceNegative, - borderRadius: - Zeta.of(context).radius.full, + borderRadius: Zeta.of(context).radius.full, ), child: ZetaIcon( ZetaIcons.important_notification, color: colors.white, - size: Zeta.of(context) - .spacing - .large, + size: Zeta.of(context).spacing.large, ), ), ].gap(Zeta.of(context).spacing.minimum), @@ -205,8 +198,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { if (attachment != null) Container( padding: EdgeInsets.symmetric( - vertical: - Zeta.of(context).spacing.minimum, + vertical: Zeta.of(context).spacing.minimum, ), child: Row( children: [ @@ -216,8 +208,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { color: colors.primary, ), DefaultTextStyle( - style: ZetaTextStyles.bodyXSmall - .apply(color: colors.primary), + style: ZetaTextStyles.bodyXSmall.apply(color: colors.primary), child: attachment!, ), ], @@ -228,9 +219,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { ), ].gap(Zeta.of(context).spacing.small), ), - if (action != null) - Container( - alignment: Alignment.bottomRight, child: action), + if (action != null) Container(alignment: Alignment.bottomRight, child: action), ], ).paddingAll(Zeta.of(context).spacing.small), ), diff --git a/lib/src/utils/zeta.dart b/lib/src/utils/zeta.dart index 511706b5..ad6b5be5 100644 --- a/lib/src/utils/zeta.dart +++ b/lib/src/utils/zeta.dart @@ -83,7 +83,8 @@ class Zeta extends InheritedWidget { /// Gets the [ZetaPrimitives] instance based on the current brightness setting. /// /// This is a temporary function used whilst the full implementation of tokens is taking place. - ZetaPrimitives get _primitives => brightness == Brightness.light ? ZetaPrimitivesLight() : ZetaPrimitivesDark(); + ZetaPrimitives get _primitives => + brightness == Brightness.light ? const ZetaPrimitivesLight() : const ZetaPrimitivesDark(); /// Gets the [ZetaSemantics] instance based on the current contrast setting. /// diff --git a/test/src/components/tooltip/tooltip_test.dart b/test/src/components/tooltip/tooltip_test.dart index 45880a98..71961158 100644 --- a/test/src/components/tooltip/tooltip_test.dart +++ b/test/src/components/tooltip/tooltip_test.dart @@ -18,7 +18,7 @@ import 'tooltip_test.mocks.dart'; ]) void main() { final mockZeta = MockZeta(); - when(mockZeta.radius).thenReturn(ZetaRadiiAA(primitives: ZetaPrimitivesLight())); + when(mockZeta.radius).thenReturn(const ZetaRadiiAA(primitives: ZetaPrimitivesLight())); setUpAll(() { final testUri = Uri.parse(getCurrentPath('tooltip')); diff --git a/test/src/utils/rounded_test.dart b/test/src/utils/rounded_test.dart index 84409953..ebfae397 100644 --- a/test/src/utils/rounded_test.dart +++ b/test/src/utils/rounded_test.dart @@ -16,7 +16,7 @@ void main() { testWidgets('Global round inherited', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); - when(mockZeta.radius).thenReturn(ZetaRadiiAA(primitives: ZetaPrimitivesLight())); + when(mockZeta.radius).thenReturn(const ZetaRadiiAA(primitives: ZetaPrimitivesLight())); await tester.pumpWidget( TestApp( rounded: true,