From cde0905d64ceb00e8561616f58f0ebeec6f90aba Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 24 May 2024 15:31:36 +0100 Subject: [PATCH] deps: zeta_flutter 0.10.0 fix: Updated zetaColors. --- example/lib/pages/theme/colors.dart | 8 ++++---- example/lib/pages/utils/theme_color_switch.dart | 9 ++++++++- example/macos/Podfile.lock | 2 +- lib/src/components/atoms/button.dart | 2 +- lib/src/components/atoms/card.dart | 2 +- lib/src/components/atoms/circle_icon_button.dart | 4 ++-- lib/src/components/atoms/icon_text_button.dart | 2 +- lib/src/components/molecules/bottom_sheet.dart | 4 +++- .../components/molecules/date_time_picker.dart | 2 +- .../components/molecules/information_bar.dart | 14 +++++++------- lib/src/components/molecules/tag.dart | 6 +++--- lib/src/components/molecules/toast.dart | 12 ++++++------ .../organisms/chat/message_body/reacts_tags.dart | 16 ++++++++++++++-- .../organisms/chat/message_body/text.dart | 5 ++++- .../components/organisms/chat/message_input.dart | 6 +++++- lib/src/components/organisms/list_tile.dart | 2 +- lib/src/utils/theme/theme_data.dart | 5 +++-- pubspec.yaml | 2 +- 18 files changed, 66 insertions(+), 37 deletions(-) diff --git a/example/lib/pages/theme/colors.dart b/example/lib/pages/theme/colors.dart index 1af3ed3..3bda32e 100644 --- a/example/lib/pages/theme/colors.dart +++ b/example/lib/pages/theme/colors.dart @@ -129,22 +129,22 @@ class ColorsDemo extends StatelessWidget { ]; final alertColors = [ { - 'color': Zeta.of(context).colors.positive, + 'color': Zeta.of(context).colors.surfacePositive, 'name': 'Positive', 'subtitle': 'Zeta.of(context).colors.positive', }, { - 'color': Zeta.of(context).colors.negative, + 'color': Zeta.of(context).colors.surfaceNegative, 'name': 'Negative', 'subtitle': 'Zeta.of(context).colors.negative', }, { - 'color': Zeta.of(context).colors.warning, + 'color': Zeta.of(context).colors.surfaceWarning, 'name': 'Warning', 'subtitle': 'Zeta.of(context).colors.warning', }, { - 'color': Zeta.of(context).colors.info, + 'color': Zeta.of(context).colors.surfaceInfo, 'name': 'Info', 'subtitle': 'Zeta.of(context).colors.info', }, diff --git a/example/lib/pages/utils/theme_color_switch.dart b/example/lib/pages/utils/theme_color_switch.dart index 5c24e7e..5a70ee0 100644 --- a/example/lib/pages/utils/theme_color_switch.dart +++ b/example/lib/pages/utils/theme_color_switch.dart @@ -5,22 +5,29 @@ class ZetaThemeColorSwitch extends StatelessWidget { ZetaThemeColorSwitch({super.key}); late final _themes = { - "default": ZetaThemeData(), + "default": ZetaThemeData( + primary: ZetaColorBase.blue, + secondary: ZetaColorBase.blue, + ), "teal": ZetaThemeData( identifier: 'teal', primary: ZetaColorBase.teal, + secondary: ZetaColorBase.teal, ), "yellow": ZetaThemeData( identifier: 'yellow', primary: ZetaColorBase.yellow, + secondary: ZetaColorBase.yellow, ), "red": ZetaThemeData( identifier: 'red', primary: ZetaColorBase.red, + secondary: ZetaColorBase.red, ), "purple": ZetaThemeData( identifier: 'purple', primary: ZetaColorBase.purple, + secondary: ZetaColorBase.purple, ), }; diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 833a392..2f3ddb8 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -133,4 +133,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 813f07c89880cd0ec4c0da55108415b820f8783a -COCOAPODS: 1.15.1 +COCOAPODS: 1.15.2 diff --git a/lib/src/components/atoms/button.dart b/lib/src/components/atoms/button.dart index 0ff486a..6bff388 100644 --- a/lib/src/components/atoms/button.dart +++ b/lib/src/components/atoms/button.dart @@ -248,7 +248,7 @@ class ZdsButton extends StatelessWidget { final EdgeInsetsGeometry tp = textPadding ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 6); // Determine the default background color. - final Color defaultBackground = customColor ?? (isDangerButton ? zetaColors.negative : zetaColors.secondary); + final Color defaultBackground = customColor ?? (isDangerButton ? zetaColors.surfaceNegative : zetaColors.secondary); // Common textStyle for all variants. final textStyle = WidgetStateProperty.all(textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w500)); diff --git a/lib/src/components/atoms/card.dart b/lib/src/components/atoms/card.dart index 3ba5713..64899ba 100644 --- a/lib/src/components/atoms/card.dart +++ b/lib/src/components/atoms/card.dart @@ -152,7 +152,7 @@ class ZdsCard extends StatelessWidget { wrapperBuilder: (child) { return InkWell( splashColor: zetaColors.surfaceSelected, - hoverColor: zetaColors.surfaceSelectedHovered, + hoverColor: zetaColors.surfaceSelectedHover.withOpacity(0.1), onTap: onTap, child: child, ); diff --git a/lib/src/components/atoms/circle_icon_button.dart b/lib/src/components/atoms/circle_icon_button.dart index d054821..cda4b32 100644 --- a/lib/src/components/atoms/circle_icon_button.dart +++ b/lib/src/components/atoms/circle_icon_button.dart @@ -36,9 +36,9 @@ extension on CircleButtonType { ZetaColorSwatch color(ZetaColors colors) { switch (this) { case CircleButtonType.positive: - return colors.positive; + return colors.surfacePositive; case CircleButtonType.negative: - return colors.negative; + return colors.surfaceNegative; case CircleButtonType.alert: return ZetaColorSwatch.fromColor(Colors.white); case CircleButtonType.base: diff --git a/lib/src/components/atoms/icon_text_button.dart b/lib/src/components/atoms/icon_text_button.dart index be53dd9..ab297d4 100644 --- a/lib/src/components/atoms/icon_text_button.dart +++ b/lib/src/components/atoms/icon_text_button.dart @@ -64,7 +64,7 @@ class ZdsIconTextButton extends StatelessWidget with Diagnosticable { borderRadius: borderRadius, color: backgroundColor ?? zetaColors.primary, boxShadow: [ - BoxShadow(blurRadius: 4, color: zetaColors.shadow.withOpacity(0.5)), + BoxShadow(blurRadius: 4, color: Theme.of(context).colorScheme.shadow), ], ), child: Material( diff --git a/lib/src/components/molecules/bottom_sheet.dart b/lib/src/components/molecules/bottom_sheet.dart index ab528bf..e3dc066 100644 --- a/lib/src/components/molecules/bottom_sheet.dart +++ b/lib/src/components/molecules/bottom_sheet.dart @@ -337,7 +337,9 @@ class _BottomSheetHeader extends StatelessWidget implements PreferredSizeWidget final zetaColors = Zeta.of(context).colors; return DecoratedBox( decoration: BoxDecoration( - border: bottom != null ? Border(bottom: BorderSide(color: zetaColors.shadow)) : null, + border: bottom != null + ? Border(bottom: BorderSide(color: Theme.of(context).colorScheme.shadow.withOpacity(0.1))) + : null, ), child: Column( children: [ diff --git a/lib/src/components/molecules/date_time_picker.dart b/lib/src/components/molecules/date_time_picker.dart index f442b9e..2129c1c 100644 --- a/lib/src/components/molecules/date_time_picker.dart +++ b/lib/src/components/molecules/date_time_picker.dart @@ -276,7 +276,7 @@ class ZdsDateTimePickerState extends State { color: Colors.transparent, child: InkWell( splashColor: zetaColors.surfaceSelected, - hoverColor: zetaColors.surfaceSelectedHovered, + hoverColor: zetaColors.surfaceSelectedHover, radius: MediaQuery.of(context).size.width, onTap: () { if (!widget.readOnly) unawaited(onShowPicker(context, _dateTime)); diff --git a/lib/src/components/molecules/information_bar.dart b/lib/src/components/molecules/information_bar.dart index 85af01b..00e502c 100644 --- a/lib/src/components/molecules/information_bar.dart +++ b/lib/src/components/molecules/information_bar.dart @@ -119,23 +119,23 @@ Color _getBarColor(ZdsInformationBarTheme color, ZetaColors colors) { case ZdsInformationBarTheme.neutral: return colors.cool.surface; case ZdsInformationBarTheme.positive: - return colors.green.surface; + return colors.surfacePositiveSubtle; case ZdsInformationBarTheme.inProgress: - return colors.secondary.surface; + return colors.surfaceSecondarySubtle; case ZdsInformationBarTheme.negative: - return colors.negative.surface; + return colors.surfaceNegativeSubtle; } } Color _getIconColor(ZdsInformationBarTheme color, ZetaColors colors) { switch (color) { case ZdsInformationBarTheme.neutral: - return colors.cool.icon; + return colors.iconDefault; case ZdsInformationBarTheme.positive: - return colors.green.icon; + return colors.borderPositive; case ZdsInformationBarTheme.inProgress: - return colors.secondary.icon; + return colors.surfaceSecondary; case ZdsInformationBarTheme.negative: - return colors.negative.icon; + return colors.surfaceNegative; } } diff --git a/lib/src/components/molecules/tag.dart b/lib/src/components/molecules/tag.dart index 8549ff1..dd7913f 100644 --- a/lib/src/components/molecules/tag.dart +++ b/lib/src/components/molecules/tag.dart @@ -203,15 +203,15 @@ class ZdsTag extends StatelessWidget { Color _resolveFgColor(ZetaColors zetaColors, ZdsTagColor tagColor) { switch (tagColor) { case ZdsTagColor.error: - return zetaColors.negative; + return zetaColors.surfaceNegative; case ZdsTagColor.alert: - return zetaColors.warning; + return zetaColors.surfaceWarning; case ZdsTagColor.primary: return zetaColors.primary; case ZdsTagColor.secondary: return zetaColors.secondary; case ZdsTagColor.success: - return zetaColors.positive; + return zetaColors.surfacePositive; case ZdsTagColor.basic: return zetaColors.warm.shade80; } diff --git a/lib/src/components/molecules/toast.dart b/lib/src/components/molecules/toast.dart index 9b05bfa..7436c18 100644 --- a/lib/src/components/molecules/toast.dart +++ b/lib/src/components/molecules/toast.dart @@ -100,15 +100,15 @@ class ZdsToast extends StatelessWidget implements PreferredSizeWidget { Color _backgroundColor(ZetaColors colors, ZdsToastColors toastColor) { switch (toastColor) { case ZdsToastColors.success: - return colors.positive.shade10; + return colors.surfacePositiveSubtle; case ZdsToastColors.warning: - return colors.warning.shade10; + return colors.surfaceWarningSubtle; case ZdsToastColors.info: - return colors.info.shade10; + return colors.surfaceInfoSubtle; case ZdsToastColors.error: - return colors.error.shade10; + return colors.surfaceNegativeSubtle; case ZdsToastColors.primary: - return colors.primary.shade10; + return colors.surfacePrimarySubtle; case ZdsToastColors.dark: return colors.textDefault; } @@ -121,7 +121,7 @@ class ZdsToast extends StatelessWidget implements PreferredSizeWidget { case ZdsToastColors.warning: return colors.orange.shade60; case ZdsToastColors.info: - return colors.info.shade60; + return colors.purple.shade60; case ZdsToastColors.error: return colors.error.shade60; case ZdsToastColors.primary: diff --git a/lib/src/components/organisms/chat/message_body/reacts_tags.dart b/lib/src/components/organisms/chat/message_body/reacts_tags.dart index 577ac88..2a78a29 100644 --- a/lib/src/components/organisms/chat/message_body/reacts_tags.dart +++ b/lib/src/components/organisms/chat/message_body/reacts_tags.dart @@ -107,7 +107,13 @@ class _ChatReactionsPill extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(10)), - boxShadow: [BoxShadow(color: zetaColors.shadow, blurRadius: 1, offset: const Offset(0, 1))], + boxShadow: [ + BoxShadow( + color: Theme.of(context).colorScheme.shadow.withOpacity(0.1), + blurRadius: 1, + offset: const Offset(0, 1), + ), + ], color: zetaColors.surfacePrimary, border: Border.all(color: zetaColors.borderSubtle), ), @@ -209,7 +215,13 @@ class _ChatTagsPill extends StatelessWidget { decoration: BoxDecoration( border: Border.all(width: 2, color: zetaColors.surfacePrimary), borderRadius: const BorderRadius.all(Radius.circular(10)), - boxShadow: [BoxShadow(color: zetaColors.shadow, blurRadius: 1, offset: const Offset(0, 1))], + boxShadow: [ + BoxShadow( + color: Theme.of(context).colorScheme.shadow.withOpacity(0.1), + blurRadius: 1, + offset: const Offset(0, 1), + ), + ], color: zetaColors.secondary, ), child: Padding( diff --git a/lib/src/components/organisms/chat/message_body/text.dart b/lib/src/components/organisms/chat/message_body/text.dart index bcf39db..ff8a30e 100644 --- a/lib/src/components/organisms/chat/message_body/text.dart +++ b/lib/src/components/organisms/chat/message_body/text.dart @@ -44,7 +44,10 @@ class ZdsChatTextMessage extends StatelessWidget { final zetaColors = Zeta.of(context).colors; final wordsMapping = Map.fromEntries( [...urls].map((e) { - return MapEntry(e, HighlightedWord(textStyle: textStyle?.apply(color: zetaColors.link), onTap: onLinkTapped)); + return MapEntry( + e, + HighlightedWord(textStyle: textStyle?.apply(color: zetaColors.blue.shade70), onTap: onLinkTapped), + ); }), ); diff --git a/lib/src/components/organisms/chat/message_input.dart b/lib/src/components/organisms/chat/message_input.dart index b3b72b3..d025dba 100644 --- a/lib/src/components/organisms/chat/message_input.dart +++ b/lib/src/components/organisms/chat/message_input.dart @@ -256,7 +256,11 @@ class ZdsMessageInputState extends State with SingleTickerProvi constraints: const BoxConstraints(minHeight: 72, maxHeight: 150), decoration: BoxDecoration( boxShadow: [ - BoxShadow(offset: const Offset(0, -1), color: zetaColors.shadow, blurRadius: 2), + BoxShadow( + offset: const Offset(0, -1), + color: Theme.of(context).colorScheme.shadow.withOpacity(0.1), + blurRadius: 2, + ), BoxShadow(offset: const Offset(0, 1), color: zetaColors.surfacePrimary, blurRadius: 2), ], ), diff --git a/lib/src/components/organisms/list_tile.dart b/lib/src/components/organisms/list_tile.dart index 8dcefbb..346088e 100644 --- a/lib/src/components/organisms/list_tile.dart +++ b/lib/src/components/organisms/list_tile.dart @@ -211,7 +211,7 @@ class ZdsListTile extends StatelessWidget { tile = InkWell( onTap: onTap, splashColor: zetaColors.surfaceSelected, - hoverColor: zetaColors.surfaceHovered, + hoverColor: zetaColors.surfaceHover, child: (bottom != null) ? Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/src/utils/theme/theme_data.dart b/lib/src/utils/theme/theme_data.dart index 4fe5c86..cbb59a0 100644 --- a/lib/src/utils/theme/theme_data.dart +++ b/lib/src/utils/theme/theme_data.dart @@ -19,7 +19,7 @@ class _ZdsBaseColors { var error = (json?['error'] as String?)?.toColor(); if (error == null && isShadeOfRed(primary)) { - error = ZetaColorBase.greyWarm; + error = ZetaColorBase.warm; } else { error = ZetaColorBase.red; } @@ -188,7 +188,8 @@ class ZdsThemeData { /// /// Returns a new [ZdsThemeData] object from JSON data. factory ZdsThemeData.fromJsonString(String json) { - return ZdsThemeData.fromJson(_parseJson(json)); + final x = ZdsThemeData.fromJson(_parseJson(json)); + return x; } /// Asynchronously creates an instance of [ZdsThemeData] from the JSON file at the given [path]. diff --git a/pubspec.yaml b/pubspec.yaml index 3a81774..c142994 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,7 +72,7 @@ dependencies: video_compress: ^3.1.2 video_player: ^2.8.6 vsc_quill_delta_to_html: ^1.0.4 - zeta_flutter: ^0.9.1 + zeta_flutter: ^0.10.0 dev_dependencies: flutter_test: