diff --git a/example/lib/home.dart b/example/lib/home.dart index 0b0c4c44..72fbbd44 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -190,8 +190,8 @@ class ExampleListTile extends StatelessWidget { (item) => ListTile( title: Text(item.name), onTap: () => context.go('/${item.name}'), - hoverColor: Zeta.of(context).colors.surface.hover, - tileColor: Zeta.of(context).colors.surface.defaultColor, + hoverColor: Zeta.of(context).colors.surfaceHover, + tileColor: Zeta.of(context).colors.surfaceDefault, ), ) .toList(), diff --git a/example/lib/pages/assets/icons_example.dart b/example/lib/pages/assets/icons_example.dart index f4a218e1..e33d29de 100644 --- a/example/lib/pages/assets/icons_example.dart +++ b/example/lib/pages/assets/icons_example.dart @@ -40,7 +40,7 @@ class _IconsExampleState extends State { height: 120, child: InkWell( borderRadius: Zeta.of(context).radius.rounded, - hoverColor: Zeta.of(context).colors.surface.hover, + hoverColor: Zeta.of(context).colors.surfaceHover, onTap: () async { await Clipboard.setData(ClipboardData(text: 'ZetaIcons.' + e.key)); ScaffoldMessenger.of(context).showMaterialBanner( diff --git a/example/lib/pages/components/avatar_example.dart b/example/lib/pages/components/avatar_example.dart index dc8d733f..dcc32b14 100644 --- a/example/lib/pages/components/avatar_example.dart +++ b/example/lib/pages/components/avatar_example.dart @@ -72,7 +72,7 @@ class AvatarExample extends StatelessWidget { ZetaAvatar.image( size: size, image: image, - borderColor: Zeta.of(context).colors.border.defaultColor, + borderColor: Zeta.of(context).colors.borderDefault, ), const SizedBox(height: 20), ], @@ -116,7 +116,7 @@ class AvatarExample extends StatelessWidget { .map((size) => Column( children: [ ZetaAvatar.initials( - backgroundColor: Zeta.of(context).colors.surface.avatar.pink, + backgroundColor: Zeta.of(context).colors.surfaceAvatarPink, size: size, initials: 'AB', ), @@ -133,8 +133,8 @@ class AvatarExample extends StatelessWidget { ZetaAvatar.initials( size: size, initials: 'AB', - borderColor: Zeta.of(context).colors.border.defaultColor, - backgroundColor: Zeta.of(context).colors.surface.avatar.teal, + borderColor: Zeta.of(context).colors.borderDefault, + backgroundColor: Zeta.of(context).colors.surfaceAvatarTeal, ), const SizedBox(height: 20), ], @@ -256,7 +256,7 @@ class AvatarExample extends StatelessWidget { ZetaAvatar.initials( size: size, initials: 'AB', - borderColor: Zeta.of(context).colors.main.positive, + borderColor: Zeta.of(context).colors.mainPositive, upperBadge: ZetaAvatarBadge.notification(value: 3), ), const SizedBox(height: 20), @@ -378,7 +378,7 @@ class AvatarExample extends StatelessWidget { ZetaAvatar.initials( size: size, initials: 'AB', - borderColor: Zeta.of(context).colors.main.positive, + borderColor: Zeta.of(context).colors.mainPositive, lowerBadge: ZetaAvatarBadge.icon(), ), const SizedBox(height: 20), @@ -443,8 +443,8 @@ class AvatarExample extends StatelessWidget { initials: 'AB', upperBadge: ZetaAvatarBadge.notification(value: 3), lowerBadge: ZetaAvatarBadge.icon(), - borderColor: Zeta.of(context).colors.border.defaultColor, - backgroundColor: Zeta.of(context).colors.surface.avatar.purple, + borderColor: Zeta.of(context).colors.borderDefault, + backgroundColor: Zeta.of(context).colors.surfaceAvatarPurple, ), const SizedBox(height: 20), ], diff --git a/example/lib/pages/components/chip_example.dart b/example/lib/pages/components/chip_example.dart index 6fb7e495..72a96407 100644 --- a/example/lib/pages/components/chip_example.dart +++ b/example/lib/pages/components/chip_example.dart @@ -80,7 +80,7 @@ class _ChipExampleState extends State { builder: (context, _, __) { return Container( padding: EdgeInsets.all(Zeta.of(context).spacing.medium), - color: colors.surface.selectedHover, + color: colors.surfaceSelectedHover, height: 100, width: 200, child: Center(child: Text('Last chip dragged here: $chipType')), diff --git a/example/lib/pages/components/dialog_example.dart b/example/lib/pages/components/dialog_example.dart index a51989d9..aa286591 100644 --- a/example/lib/pages/components/dialog_example.dart +++ b/example/lib/pages/components/dialog_example.dart @@ -22,7 +22,7 @@ class DialogExample extends StatelessWidget { title: 'Dialog Title', icon: ZetaIcon( ZetaIcons.warning, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: 'Lorem ipsum dolor sit amet, conse ctetur adipiscing elit, sed do eiusm od tempor incididunt ut labore et do lore magna aliqua.', @@ -37,7 +37,7 @@ class DialogExample extends StatelessWidget { title: 'Dialog Title', icon: ZetaIcon( ZetaIcons.warning, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: 'Lorem ipsum dolor sit amet, conse ctetur adipiscing elit, sed do eiusm od tempor incididunt ut labore et do lore magna aliqua.', @@ -53,7 +53,7 @@ class DialogExample extends StatelessWidget { title: 'Dialog Title', icon: ZetaIcon( ZetaIcons.warning, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: 'Lorem ipsum dolor sit amet, conse ctetur adipiscing elit, sed do eiusm od tempor incididunt ut labore et do lore magna aliqua.', @@ -71,7 +71,7 @@ class DialogExample extends StatelessWidget { title: 'Dialog Title', icon: ZetaIcon( ZetaIcons.warning, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: 'Lorem ipsum dolor sit amet, conse ctetur adipiscing elit, sed do eiusm od tempor incididunt ut labore et do lore magna aliqua.', diff --git a/example/lib/pages/components/list_item_example.dart b/example/lib/pages/components/list_item_example.dart index 720605cc..fa3a010a 100644 --- a/example/lib/pages/components/list_item_example.dart +++ b/example/lib/pages/components/list_item_example.dart @@ -26,7 +26,7 @@ class _ListItemExampleState extends State { return ExampleScaffold( name: ListItemExample.name, child: Container( - color: zetaColors.surface.warm, + color: zetaColors.surfaceWarm, child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(16), diff --git a/example/lib/pages/components/navigation_rail_example.dart b/example/lib/pages/components/navigation_rail_example.dart index 13bfb823..9c1c5101 100644 --- a/example/lib/pages/components/navigation_rail_example.dart +++ b/example/lib/pages/components/navigation_rail_example.dart @@ -63,7 +63,7 @@ class _NavigationRailExampleState extends State { _titles[_selectedIndex!], textAlign: TextAlign.center, style: ZetaTextStyles.titleMedium.copyWith( - color: zeta.colors.main.defaultColor, + color: zeta.colors.mainDefault, fontWeight: FontWeight.bold, ), ), diff --git a/example/lib/pages/components/top_app_bar_example.dart b/example/lib/pages/components/top_app_bar_example.dart index 9e1aa91b..7e6cea1b 100644 --- a/example/lib/pages/components/top_app_bar_example.dart +++ b/example/lib/pages/components/top_app_bar_example.dart @@ -43,7 +43,7 @@ class _TopAppBarExampleState extends State { return ExampleScaffold( name: TopAppBarExample.name, child: ColoredBox( - color: colors.surface.warm, + color: colors.surfaceWarm, child: SingleChildScrollView( child: Column( children: [ @@ -178,7 +178,7 @@ class _TopAppBarExampleState extends State { child: Container( width: 800, height: 800, - color: Zeta.of(context).colors.surface.selectedHover, + color: Zeta.of(context).colors.surfaceSelectedHover, child: CustomPaint( painter: Painter(zeta: Zeta.of(context)), size: Size(800, 800), @@ -220,7 +220,7 @@ class _TopAppBarExampleState extends State { child: Container( width: 800, height: 800, - color: Zeta.of(context).colors.surface.selectedHover, + color: Zeta.of(context).colors.surfaceSelectedHover, child: CustomPaint( painter: Painter(zeta: Zeta.of(context)), size: Size(800, 800), @@ -249,7 +249,7 @@ class Painter extends CustomPainter { var p1 = Offset(i, -10); var p2 = Offset(800 + i, 810); var paint = Paint() - ..color = zeta.colors.surface.defaultColor + ..color = zeta.colors.surfaceDefault ..strokeWidth = zeta.spacing.minimum; canvas.drawLine(p1, p2, paint); } diff --git a/example/lib/pages/theme/color_example.dart b/example/lib/pages/theme/color_example.dart index ea5c98cf..16a333e5 100644 --- a/example/lib/pages/theme/color_example.dart +++ b/example/lib/pages/theme/color_example.dart @@ -39,108 +39,108 @@ class _ColorExampleState extends State { }; final Map mainColors = { - 'defaultColor': colors.main.defaultColor, - 'subtle': colors.main.subtle, - 'light': colors.main.light, - 'inverse': colors.main.inverse, - 'disabled': colors.main.disabled, - 'primary': colors.main.primary, - 'secondary': colors.main.secondary, - 'positive': colors.main.positive, - 'warning': colors.main.warning, - 'negative': colors.main.negative, - 'info': colors.main.info, + 'defaultColor': colors.mainDefault, + 'subtle': colors.mainSubtle, + 'light': colors.mainLight, + 'inverse': colors.mainInverse, + 'disabled': colors.mainDisabled, + 'primary': colors.mainPrimary, + 'secondary': colors.mainSecondary, + 'positive': colors.mainPositive, + 'warning': colors.mainWarning, + 'negative': colors.mainNegative, + 'info': colors.mainInfo, }; final Map borderColors = { - 'defaultColor': colors.border.defaultColor, - 'subtle': colors.border.subtle, - 'hover': colors.border.hover, - 'selected': colors.border.selected, - 'disabled': colors.border.disabled, - 'pure': colors.border.pure, - 'primaryMain': colors.border.primaryMain, - 'primary': colors.border.primary, - 'secondary': colors.border.secondary, - 'positive': colors.border.positive, - 'warning': colors.border.warning, - 'negative': colors.border.negative, - 'info': colors.border.info, + 'defaultColor': colors.borderDefault, + 'subtle': colors.borderSubtle, + 'hover': colors.borderHover, + 'selected': colors.borderSelected, + 'disabled': colors.borderDisabled, + 'pure': colors.borderPure, + 'primaryMain': colors.borderPrimaryMain, + 'primary': colors.borderPrimary, + 'secondary': colors.borderSecondary, + 'positive': colors.borderPositive, + 'warning': colors.borderWarning, + 'negative': colors.borderNegative, + 'info': colors.borderInfo, }; final Map surfaceColors = { - 'defaultColor': colors.surface.defaultColor, - 'defaultInverse': colors.surface.defaultInverse, - 'hover': colors.surface.hover, - 'selected': colors.surface.selected, - 'selectedHover': colors.surface.selectedHover, - 'disabled': colors.surface.disabled, - 'cool': colors.surface.cool, - 'warm': colors.surface.warm, - 'primary': colors.surface.primary, - 'primarySubtle': colors.surface.primarySubtle, - 'secondary': colors.surface.secondary, - 'secondarySubtle': colors.surface.secondarySubtle, - 'positive': colors.surface.positive, - 'positiveSubtle': colors.surface.positiveSubtle, - 'warning': colors.surface.warning, - 'warningSubtle': colors.surface.warningSubtle, - 'negative': colors.surface.negative, - 'negativeSubtle': colors.surface.negativeSubtle, - 'info': colors.surface.info, - 'infoSubtle': colors.surface.infoSubtle, + 'defaultColor': colors.surfaceDefault, + 'defaultInverse': colors.surfaceDefaultInverse, + 'hover': colors.surfaceHover, + 'selected': colors.surfaceSelected, + 'selectedHover': colors.surfaceSelectedHover, + 'disabled': colors.surfaceDisabled, + 'cool': colors.surfaceCool, + 'warm': colors.surfaceWarm, + 'primary': colors.surfacePrimary, + 'primarySubtle': colors.surfacePrimarySubtle, + 'secondary': colors.surfaceSecondary, + 'secondarySubtle': colors.surfaceSecondarySubtle, + 'positive': colors.surfacePositive, + 'positiveSubtle': colors.surfacePositiveSubtle, + 'warning': colors.surfaceWarning, + 'warningSubtle': colors.surfaceWarningSubtle, + 'negative': colors.surfaceNegative, + 'negativeSubtle': colors.surfaceNegativeSubtle, + 'info': colors.surfaceInfo, + 'infoSubtle': colors.surfaceInfoSubtle, }; final Map avatarColors = { - 'blue': colors.surface.avatar.blue, - 'green': colors.surface.avatar.green, - 'orange': colors.surface.avatar.orange, - 'pink': colors.surface.avatar.pink, - 'purple': colors.surface.avatar.purple, - 'teal': colors.surface.avatar.teal, - 'yellow': colors.surface.avatar.yellow, + 'blue': colors.surfaceAvatarBlue, + 'green': colors.surfaceAvatarGreen, + 'orange': colors.surfaceAvatarOrange, + 'pink': colors.surfaceAvatarPink, + 'purple': colors.surfaceAvatarPurple, + 'teal': colors.surfaceAvatarTeal, + 'yellow': colors.surfaceAvatarYellow, }; final Map disabled = { - 'disabled': colors.state.disabled.disabled, + 'disabled': colors.stateDisabledDisabled, }; final Map defaultColors = { - 'enabled': colors.state.defaultColor.enabled, - 'hover': colors.state.defaultColor.hover, - 'selected': colors.state.defaultColor.selected, - 'focus': colors.state.defaultColor.focus, + 'enabled': colors.stateDefaultEnabled, + 'hover': colors.stateDefaultHover, + 'selected': colors.stateDefaultSelected, + 'focus': colors.stateDefaultFocus, }; final Map primary = { - 'enabled': colors.state.primary.enabled, - 'hover': colors.state.primary.hover, - 'selected': colors.state.primary.selected, - 'focus': colors.state.primary.focus, + 'enabled': colors.statePrimaryEnabled, + 'hover': colors.statePrimaryHover, + 'selected': colors.statePrimarySelected, + 'focus': colors.statePrimaryFocus, }; final Map secondary = { - 'enabled': colors.state.secondary.enabled, - 'hover': colors.state.secondary.hover, - 'selected': colors.state.secondary.selected, - 'focus': colors.state.secondary.focus, + 'enabled': colors.stateSecondaryEnabled, + 'hover': colors.stateSecondaryHover, + 'selected': colors.stateSecondarySelected, + 'focus': colors.stateSecondaryFocus, }; final Map positive = { - 'enabled': colors.state.positive.enabled, - 'hover': colors.state.positive.hover, - 'selected': colors.state.positive.selected, - 'focus': colors.state.positive.focus, + 'enabled': colors.statePositiveEnabled, + 'hover': colors.statePositiveHover, + 'selected': colors.statePositiveSelected, + 'focus': colors.statePositiveFocus, }; final Map negative = { - 'enabled': colors.state.negative.enabled, - 'hover': colors.state.negative.hover, - 'selected': colors.state.negative.selected, - 'focus': colors.state.negative.focus, + 'enabled': colors.stateNegativeEnabled, + 'hover': colors.stateNegativeHover, + 'selected': colors.stateNegativeSelected, + 'focus': colors.stateNegativeFocus, }; final Map info = { - 'enabled': colors.state.info.enabled, - 'hover': colors.state.info.hover, - 'selected': colors.state.info.selected, - 'focus': colors.state.info.focus, + 'enabled': colors.stateInfoEnabled, + 'hover': colors.stateInfoHover, + 'selected': colors.stateInfoSelected, + 'focus': colors.stateInfoFocus, }; final Map inverse = { - 'enabled': colors.state.inverse.enabled, - 'hover': colors.state.inverse.hover, - 'selected': colors.state.inverse.selected, - 'focus': colors.state.inverse.focus, + 'enabled': colors.stateInverseEnabled, + 'hover': colors.stateInverseHover, + 'selected': colors.stateInverseSelected, + 'focus': colors.stateInverseFocus, }; return ExampleScaffold( @@ -213,7 +213,7 @@ class _ColorExampleState extends State { // (e) => Expanded( // child: Container( // height: constraints.maxWidth / 10, - // color: e == 110 ? colors.surface.primary : value.value[e], + // color: e == 110 ? colors.surfacePrimary : value.value[e], // child: e == 110 // ? Nothing() // : FittedBox( diff --git a/example/lib/pages/theme/radius_example.dart b/example/lib/pages/theme/radius_example.dart index 2d8e7c1a..a95ef407 100644 --- a/example/lib/pages/theme/radius_example.dart +++ b/example/lib/pages/theme/radius_example.dart @@ -38,14 +38,14 @@ class RadiusExample extends StatelessWidget { child: Container( decoration: BoxDecoration( borderRadius: rad, - color: Zeta.of(context).colors.surface.defaultColor, + color: Zeta.of(context).colors.surfaceDefault, border: Border.all(color: colors.primitives.blue.shade50, width: 3), ), padding: EdgeInsets.all(Zeta.of(context).spacing.large), child: Text( rad.radiusString.split('.').last.capitalize(), style: ZetaTextStyles.titleMedium.apply( - color: Zeta.of(context).colors.main.defaultColor, + color: Zeta.of(context).colors.mainDefault, fontStyle: FontStyle.normal, decoration: TextDecoration.none, ), diff --git a/example/lib/pages/theme/spacing_example.dart b/example/lib/pages/theme/spacing_example.dart index 25464e99..f995631c 100644 --- a/example/lib/pages/theme/spacing_example.dart +++ b/example/lib/pages/theme/spacing_example.dart @@ -87,11 +87,11 @@ class _SpacingDemo extends StatelessWidget { return Container( margin: EdgeInsets.all(size.value), padding: EdgeInsets.all(Zeta.of(context).spacing.medium), - color: colors.surface.primary, + color: colors.surfacePrimary, child: Text( 'Zeta.of(context).spacing.' + size.key, style: ZetaTextStyles.titleMedium.apply( - color: Zeta.of(context).colors.main.defaultColor, + color: Zeta.of(context).colors.mainDefault, fontStyle: FontStyle.normal, decoration: TextDecoration.none, ), diff --git a/example/lib/utils/rounded_switch.dart b/example/lib/utils/rounded_switch.dart index 4f69ec81..3d555518 100644 --- a/example/lib/utils/rounded_switch.dart +++ b/example/lib/utils/rounded_switch.dart @@ -14,18 +14,18 @@ class ZetaRoundedSwitch extends StatelessWidget { padding: EdgeInsets.all(8), elevation: 0, icon: Nothing(), - dropdownColor: zeta.colors.border.disabled, + dropdownColor: zeta.colors.borderDisabled, items: [true, false].map((e) { return DropdownMenuItem( value: e, alignment: Alignment.center, child: ZetaAvatar( size: ZetaAvatarSize.xxs, - image: Icon(e ? Icons.circle : Icons.square, color: zeta.colors.main.primary), + image: Icon(e ? Icons.circle : Icons.square, color: zeta.colors.mainPrimary), initialTextStyle: TextStyle( fontSize: 28, letterSpacing: Zeta.of(context).spacing.none, - color: Zeta.of(context).colors.main.primary, + color: Zeta.of(context).colors.mainPrimary, fontWeight: FontWeight.w500, ), ), diff --git a/example/lib/utils/theme_color_switch.dart b/example/lib/utils/theme_color_switch.dart index 66dfca08..16c8bd0f 100644 --- a/example/lib/utils/theme_color_switch.dart +++ b/example/lib/utils/theme_color_switch.dart @@ -23,7 +23,7 @@ // elevation: 0, // padding: EdgeInsets.all(8), // icon: Nothing(), -// dropdownColor: zeta.colors.border.disabled, +// dropdownColor: zeta.colors.borderDisabled, // items: appThemes.entries.map((e) { // final zetaColors = primary(appThemes[e.key]!); // final color = zetaColors.primary; diff --git a/example/lib/utils/theme_constrast_switch.dart b/example/lib/utils/theme_constrast_switch.dart index 6957baf0..d2408ad8 100644 --- a/example/lib/utils/theme_constrast_switch.dart +++ b/example/lib/utils/theme_constrast_switch.dart @@ -19,7 +19,7 @@ class ZetaThemeContrastSwitch extends StatelessWidget { padding: EdgeInsets.all(8), elevation: 0, icon: Nothing(), - dropdownColor: zeta.colors.border.disabled, + dropdownColor: zeta.colors.borderDisabled, items: _themes.map((e) { final colors = e == ZetaContrast.aa ? ZetaSemanticColorsAA(primitives: Zeta.of(context).colors.primitives) @@ -29,12 +29,12 @@ class ZetaThemeContrastSwitch extends StatelessWidget { alignment: Alignment.center, child: ZetaAvatar( size: ZetaAvatarSize.xxs, - backgroundColor: colors.surface.defaultColor, + backgroundColor: colors.surfaceDefault, initials: e.name.toUpperCase(), initialTextStyle: TextStyle( fontSize: 14, letterSpacing: Zeta.of(context).spacing.none, - color: colors.main.primary, + color: colors.mainPrimary, fontWeight: FontWeight.w500, ), ), diff --git a/example/lib/utils/theme_mode_switch.dart b/example/lib/utils/theme_mode_switch.dart index 5df2a90c..f9f8d06e 100644 --- a/example/lib/utils/theme_mode_switch.dart +++ b/example/lib/utils/theme_mode_switch.dart @@ -20,7 +20,7 @@ class ZetaThemeModeSwitch extends StatelessWidget { value: zeta.themeMode, elevation: 0, icon: Nothing(), - dropdownColor: zeta.colors.border.disabled, + dropdownColor: zeta.colors.borderDisabled, items: _themes.map((e) { final colors = e == ThemeMode.dark ? ZetaSemanticColorsAA(primitives: ZetaPrimitivesDark()) @@ -30,14 +30,14 @@ class ZetaThemeModeSwitch extends StatelessWidget { alignment: Alignment.center, child: ZetaAvatar( size: ZetaAvatarSize.xxs, - backgroundColor: colors.surface.defaultColor, + backgroundColor: colors.surfaceDefault, image: ZetaIcon( e == ThemeMode.system ? Icons.system_security_update_good : e == ThemeMode.light ? Icons.light_mode : Icons.dark_mode, - color: colors.main.primary, + color: colors.mainPrimary, ), ), ); diff --git a/example/widgetbook/pages/assets/icon_widgetbook.dart b/example/widgetbook/pages/assets/icon_widgetbook.dart index d9088813..81c2ad68 100644 --- a/example/widgetbook/pages/assets/icon_widgetbook.dart +++ b/example/widgetbook/pages/assets/icon_widgetbook.dart @@ -27,7 +27,7 @@ Widget iconsUseCase(BuildContext context) { height: 140, child: InkWell( borderRadius: Zeta.of(context).radius.rounded, - hoverColor: Zeta.of(context).colors.surface.hover, + hoverColor: Zeta.of(context).colors.surfaceHover, onTap: () async { await Clipboard.setData(ClipboardData(text: 'ZetaIcons.' + e.key)); ScaffoldMessenger.of(context).showMaterialBanner( diff --git a/example/widgetbook/pages/components/avatar_widgetbook.dart b/example/widgetbook/pages/components/avatar_widgetbook.dart index 37b2ba84..2b37aa90 100644 --- a/example/widgetbook/pages/components/avatar_widgetbook.dart +++ b/example/widgetbook/pages/components/avatar_widgetbook.dart @@ -21,7 +21,7 @@ Widget avatarUseCase(BuildContext context) { ? ZetaAvatarBadge.icon( icon: ZetaIcons.close, color: context.knobs.colorOrNull(label: "Upper Badge Color", initialValue: colors.primitives.green) ?? - colors.main.defaultColor, + colors.mainDefault, ) : null, borderColor: context.knobs.colorOrNull(label: 'Outline', initialValue: colors.primitives.green), diff --git a/example/widgetbook/pages/components/dialog_widgetbook.dart b/example/widgetbook/pages/components/dialog_widgetbook.dart index 9ff56b1c..db88bf5a 100644 --- a/example/widgetbook/pages/components/dialog_widgetbook.dart +++ b/example/widgetbook/pages/components/dialog_widgetbook.dart @@ -42,7 +42,7 @@ Widget dialogUseCase(BuildContext context) { title: title, icon: ZetaIcon( iconData, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: message, primaryButtonLabel: 'Confirm', @@ -58,7 +58,7 @@ Widget dialogUseCase(BuildContext context) { title: title, icon: ZetaIcon( iconData, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: message, primaryButtonLabel: 'Confirm', @@ -75,7 +75,7 @@ Widget dialogUseCase(BuildContext context) { title: title, icon: ZetaIcon( iconData, - color: zeta.colors.surface.warning, + color: zeta.colors.surfaceWarning, ), message: message, primaryButtonLabel: 'Confirm', diff --git a/example/widgetbook/pages/components/navigation_rail_widgetbook.dart b/example/widgetbook/pages/components/navigation_rail_widgetbook.dart index 4b9b52f9..4b4016e5 100644 --- a/example/widgetbook/pages/components/navigation_rail_widgetbook.dart +++ b/example/widgetbook/pages/components/navigation_rail_widgetbook.dart @@ -48,7 +48,7 @@ Widget navigationRailUseCase(BuildContext context) { itemsList[selectedIndex!], textAlign: TextAlign.center, style: ZetaTextStyles.titleMedium.copyWith( - color: zeta.colors.main.defaultColor, + color: zeta.colors.mainDefault, fontWeight: FontWeight.bold, ), ), diff --git a/example/widgetbook/pages/components/top_app_bar_widgetbook.dart b/example/widgetbook/pages/components/top_app_bar_widgetbook.dart index 6476bb39..6baedba8 100644 --- a/example/widgetbook/pages/components/top_app_bar_widgetbook.dart +++ b/example/widgetbook/pages/components/top_app_bar_widgetbook.dart @@ -206,7 +206,7 @@ class _ExtendedSearchState extends State { child: Container( width: constraints.maxWidth, height: constraints.maxHeight * 4, - color: Zeta.of(context).colors.surface.secondary, + color: Zeta.of(context).colors.surfaceSecondary, child: CustomPaint( painter: Painter(context: context, constraints: constraints), size: Size(constraints.maxWidth, constraints.maxHeight * 4), @@ -232,7 +232,7 @@ class Painter extends CustomPainter { var p1 = Offset(i, -10); var p2 = Offset(constraints.maxHeight + i, constraints.maxHeight * 4); var paint = Paint() - ..color = Zeta.of(context).colors.main.primary + ..color = Zeta.of(context).colors.mainPrimary ..strokeWidth = Zeta.of(context).spacing.minimum; canvas.drawLine(p1, p2, paint); } diff --git a/example/widgetbook/pages/introduction.dart b/example/widgetbook/pages/introduction.dart index 11395985..fc05a5b2 100644 --- a/example/widgetbook/pages/introduction.dart +++ b/example/widgetbook/pages/introduction.dart @@ -42,7 +42,7 @@ class _IntroductionWidgetbookState extends State { children: [ Container( decoration: BoxDecoration( - color: colors.surface.hover, + color: colors.surfaceHover, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius), ), child: Padding( @@ -82,7 +82,7 @@ class _IntroductionWidgetbookState extends State { ), Container( decoration: BoxDecoration( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, borderRadius: BorderRadius.only(bottomLeft: radius, bottomRight: radius), ), width: double.infinity, @@ -97,7 +97,7 @@ class _IntroductionWidgetbookState extends State { configs: [ LinkConfig( style: TextStyle( - color: colors.main.primary, + color: colors.mainPrimary, decoration: TextDecoration.underline, ), onTap: (url) { @@ -151,7 +151,7 @@ class _CodeWrapperWidget extends StatelessWidget { return Stack( children: [ DefaultTextStyle( - style: GoogleFonts.ibmPlexMono(color: Zeta.of(context).colors.main.defaultColor), + style: GoogleFonts.ibmPlexMono(color: Zeta.of(context).colors.mainDefault), child: child, ), if (language.isNotEmpty) @@ -164,7 +164,7 @@ class _CodeWrapperWidget extends StatelessWidget { padding: EdgeInsets.symmetric( vertical: Zeta.of(context).spacing.minimum, horizontal: Zeta.of(context).spacing.medium), decoration: - BoxDecoration(color: colors.surface.selectedHover, borderRadius: Zeta.of(context).radius.rounded), + BoxDecoration(color: colors.surfaceSelectedHover, borderRadius: Zeta.of(context).radius.rounded), ), ), ), diff --git a/example/widgetbook/pages/theme/color_widgetbook.dart b/example/widgetbook/pages/theme/color_widgetbook.dart index 44eb554a..ec98f8ef 100644 --- a/example/widgetbook/pages/theme/color_widgetbook.dart +++ b/example/widgetbook/pages/theme/color_widgetbook.dart @@ -34,108 +34,108 @@ class ColorBody extends StatelessWidget { }; final Map mainColors = { - 'defaultColor': colors.main.defaultColor, - 'subtle': colors.main.subtle, - 'light': colors.main.light, - 'inverse': colors.main.inverse, - 'disabled': colors.main.disabled, - 'primary': colors.main.primary, - 'secondary': colors.main.secondary, - 'positive': colors.main.positive, - 'warning': colors.main.warning, - 'negative': colors.main.negative, - 'info': colors.main.info, + 'defaultColor': colors.mainDefault, + 'subtle': colors.mainSubtle, + 'light': colors.mainLight, + 'inverse': colors.mainInverse, + 'disabled': colors.mainDisabled, + 'primary': colors.mainPrimary, + 'secondary': colors.mainSecondary, + 'positive': colors.mainPositive, + 'warning': colors.mainWarning, + 'negative': colors.mainNegative, + 'info': colors.mainInfo, }; final Map borderColors = { - 'defaultColor': colors.border.defaultColor, - 'subtle': colors.border.subtle, - 'hover': colors.border.hover, - 'selected': colors.border.selected, - 'disabled': colors.border.disabled, - 'pure': colors.border.pure, - 'primaryMain': colors.border.primaryMain, - 'primary': colors.border.primary, - 'secondary': colors.border.secondary, - 'positive': colors.border.positive, - 'warning': colors.border.warning, - 'negative': colors.border.negative, - 'info': colors.border.info, + 'defaultColor': colors.borderDefault, + 'subtle': colors.borderSubtle, + 'hover': colors.borderHover, + 'selected': colors.borderSelected, + 'disabled': colors.borderDisabled, + 'pure': colors.borderPure, + 'primaryMain': colors.borderPrimaryMain, + 'primary': colors.borderPrimary, + 'secondary': colors.borderSecondary, + 'positive': colors.borderPositive, + 'warning': colors.borderWarning, + 'negative': colors.borderNegative, + 'info': colors.borderInfo, }; final Map surfaceColors = { - 'defaultColor': colors.surface.defaultColor, - 'defaultInverse': colors.surface.defaultInverse, - 'hover': colors.surface.hover, - 'selected': colors.surface.selected, - 'selectedHover': colors.surface.selectedHover, - 'disabled': colors.surface.disabled, - 'cool': colors.surface.cool, - 'warm': colors.surface.warm, - 'primary': colors.surface.primary, - 'primarySubtle': colors.surface.primarySubtle, - 'secondary': colors.surface.secondary, - 'secondarySubtle': colors.surface.secondarySubtle, - 'positive': colors.surface.positive, - 'positiveSubtle': colors.surface.positiveSubtle, - 'warning': colors.surface.warning, - 'warningSubtle': colors.surface.warningSubtle, - 'negative': colors.surface.negative, - 'negativeSubtle': colors.surface.negativeSubtle, - 'info': colors.surface.info, - 'infoSubtle': colors.surface.infoSubtle, + 'defaultColor': colors.surfaceDefault, + 'defaultInverse': colors.surfaceDefaultInverse, + 'hover': colors.surfaceHover, + 'selected': colors.surfaceSelected, + 'selectedHover': colors.surfaceSelectedHover, + 'disabled': colors.surfaceDisabled, + 'cool': colors.surfaceCool, + 'warm': colors.surfaceWarm, + 'primary': colors.surfacePrimary, + 'primarySubtle': colors.surfacePrimarySubtle, + 'secondary': colors.surfaceSecondary, + 'secondarySubtle': colors.surfaceSecondarySubtle, + 'positive': colors.surfacePositive, + 'positiveSubtle': colors.surfacePositiveSubtle, + 'warning': colors.surfaceWarning, + 'warningSubtle': colors.surfaceWarningSubtle, + 'negative': colors.surfaceNegative, + 'negativeSubtle': colors.surfaceNegativeSubtle, + 'info': colors.surfaceInfo, + 'infoSubtle': colors.surfaceInfoSubtle, }; final Map avatarColors = { - 'blue': colors.surface.avatar.blue, - 'green': colors.surface.avatar.green, - 'orange': colors.surface.avatar.orange, - 'pink': colors.surface.avatar.pink, - 'purple': colors.surface.avatar.purple, - 'teal': colors.surface.avatar.teal, - 'yellow': colors.surface.avatar.yellow, + 'blue': colors.surfaceAvatarBlue, + 'green': colors.surfaceAvatarGreen, + 'orange': colors.surfaceAvatarOrange, + 'pink': colors.surfaceAvatarPink, + 'purple': colors.surfaceAvatarPurple, + 'teal': colors.surfaceAvatarTeal, + 'yellow': colors.surfaceAvatarYellow, }; final Map disabled = { - 'disabled': colors.state.disabled.disabled, + 'disabled': colors.stateDisabledDisabled, }; final Map defaultColors = { - 'enabled': colors.state.defaultColor.enabled, - 'hover': colors.state.defaultColor.hover, - 'selected': colors.state.defaultColor.selected, - 'focus': colors.state.defaultColor.focus, + 'enabled': colors.stateDefaultEnabled, + 'hover': colors.stateDefaultHover, + 'selected': colors.stateDefaultSelected, + 'focus': colors.stateDefaultFocus, }; final Map primary = { - 'enabled': colors.state.primary.enabled, - 'hover': colors.state.primary.hover, - 'selected': colors.state.primary.selected, - 'focus': colors.state.primary.focus, + 'enabled': colors.statePrimaryEnabled, + 'hover': colors.statePrimaryHover, + 'selected': colors.statePrimarySelected, + 'focus': colors.statePrimaryFocus, }; final Map secondary = { - 'enabled': colors.state.secondary.enabled, - 'hover': colors.state.secondary.hover, - 'selected': colors.state.secondary.selected, - 'focus': colors.state.secondary.focus, + 'enabled': colors.stateSecondaryEnabled, + 'hover': colors.stateSecondaryHover, + 'selected': colors.stateSecondarySelected, + 'focus': colors.stateSecondaryFocus, }; final Map positive = { - 'enabled': colors.state.positive.enabled, - 'hover': colors.state.positive.hover, - 'selected': colors.state.positive.selected, - 'focus': colors.state.positive.focus, + 'enabled': colors.statePositiveEnabled, + 'hover': colors.statePositiveHover, + 'selected': colors.statePositiveSelected, + 'focus': colors.statePositiveFocus, }; final Map negative = { - 'enabled': colors.state.negative.enabled, - 'hover': colors.state.negative.hover, - 'selected': colors.state.negative.selected, - 'focus': colors.state.negative.focus, + 'enabled': colors.stateNegativeEnabled, + 'hover': colors.stateNegativeHover, + 'selected': colors.stateNegativeSelected, + 'focus': colors.stateNegativeFocus, }; final Map info = { - 'enabled': colors.state.info.enabled, - 'hover': colors.state.info.hover, - 'selected': colors.state.info.selected, - 'focus': colors.state.info.focus, + 'enabled': colors.stateInfoEnabled, + 'hover': colors.stateInfoHover, + 'selected': colors.stateInfoSelected, + 'focus': colors.stateInfoFocus, }; final Map inverse = { - 'enabled': colors.state.inverse.enabled, - 'hover': colors.state.inverse.hover, - 'selected': colors.state.inverse.selected, - 'focus': colors.state.inverse.focus, + 'enabled': colors.stateInverseEnabled, + 'hover': colors.stateInverseHover, + 'selected': colors.stateInverseSelected, + 'focus': colors.stateInverseFocus, }; return SingleChildScrollView( diff --git a/example/widgetbook/pages/theme/radius_widgetbook.dart b/example/widgetbook/pages/theme/radius_widgetbook.dart index 9f431b88..ba184653 100644 --- a/example/widgetbook/pages/theme/radius_widgetbook.dart +++ b/example/widgetbook/pages/theme/radius_widgetbook.dart @@ -34,14 +34,14 @@ Widget radiusUseCase(BuildContext context) { child: Container( decoration: BoxDecoration( borderRadius: rad, - color: Zeta.of(context).colors.surface.primary, + color: Zeta.of(context).colors.surfacePrimary, border: Border.all(color: colors.primitives.blue.shade50, width: 3), ), padding: EdgeInsets.all(Zeta.of(context).spacing.large), child: Text( rad.radiusString.split('.').last.capitalize(), style: ZetaTextStyles.titleMedium.apply( - color: Zeta.of(context).colors.main.defaultColor, + color: Zeta.of(context).colors.mainDefault, fontStyle: FontStyle.normal, decoration: TextDecoration.none, ), diff --git a/example/widgetbook/pages/theme/spacing_widgetbook.dart b/example/widgetbook/pages/theme/spacing_widgetbook.dart index 4f65182b..67e25ce3 100644 --- a/example/widgetbook/pages/theme/spacing_widgetbook.dart +++ b/example/widgetbook/pages/theme/spacing_widgetbook.dart @@ -74,11 +74,11 @@ class _SpacingDemo extends StatelessWidget { return Container( margin: EdgeInsets.all(size.value), padding: EdgeInsets.all(Zeta.of(context).spacing.medium), - color: colors.surface.primary, + color: colors.surfacePrimary, child: Text( 'Zeta.of(context).spacing.' + size.key, style: ZetaTextStyles.titleMedium.apply( - color: Zeta.of(context).colors.main.defaultColor, + color: Zeta.of(context).colors.mainDefault, fontStyle: FontStyle.normal, decoration: TextDecoration.none, ), diff --git a/example/widgetbook/pages/theme/typography_widgetbook.dart b/example/widgetbook/pages/theme/typography_widgetbook.dart index 067b6c2b..f29d8ec3 100644 --- a/example/widgetbook/pages/theme/typography_widgetbook.dart +++ b/example/widgetbook/pages/theme/typography_widgetbook.dart @@ -24,7 +24,7 @@ const Map allTypes = { }; Widget typographyUseCase(BuildContext context) => Container( - color: Zeta.of(context).colors.surface.primary, + color: Zeta.of(context).colors.surfacePrimary, padding: EdgeInsets.all(Zeta.of(context).spacing.xl_2), child: Text( context.knobs.string(label: 'Text', initialValue: 'The quick brown fox jumps over the lazy dog.'), @@ -35,7 +35,7 @@ Widget typographyUseCase(BuildContext context) => Container( options: allTypes.values.toList(), ) .apply( - color: Zeta.of(context).colors.main.defaultColor, + color: Zeta.of(context).colors.mainDefault, fontStyle: FontStyle.normal, decoration: TextDecoration.none, ), diff --git a/example/widgetbook/utils/scaffold.dart b/example/widgetbook/utils/scaffold.dart index 53d06aec..2dbaccdf 100644 --- a/example/widgetbook/utils/scaffold.dart +++ b/example/widgetbook/utils/scaffold.dart @@ -16,7 +16,7 @@ class WidgetbookScaffold extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: backgroundColor ?? Zeta.of(context).colors.surface.defaultColor, + backgroundColor: backgroundColor ?? Zeta.of(context).colors.surfaceDefault, body: LayoutBuilder(builder: (context, constraints) { return Center( child: ListView( diff --git a/lib/generated/tokens/primitives.g.dart b/lib/generated/tokens/primitives.g.dart index 733ec4b7..ce0ca7e7 100644 --- a/lib/generated/tokens/primitives.g.dart +++ b/lib/generated/tokens/primitives.g.dart @@ -8,60 +8,60 @@ import 'package:zeta_flutter/zeta_flutter.dart'; /// Interface used for zeta color primitives abstract interface class ZetaPrimitives { - /// Pure + /// Blue /// /// {@macro zeta-colors-swatch} - ZetaPureColorSwatch get pure; + ZetaColorSwatch get blue; /// Cool /// /// {@macro zeta-colors-swatch} ZetaColorSwatch get cool; - /// Warm - /// - /// {@macro zeta-colors-swatch} - ZetaColorSwatch get warm; - - /// Blue + /// Green /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get blue; + ZetaColorSwatch get green; - /// Green + /// Orange /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get green; + ZetaColorSwatch get orange; - /// Red + /// Pink /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get red; + ZetaColorSwatch get pink; - /// Orange + /// Pure /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get orange; + ZetaPureColorSwatch get pure; /// Purple /// /// {@macro zeta-colors-swatch} ZetaColorSwatch get purple; - /// Yellow + /// Red /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get yellow; + ZetaColorSwatch get red; /// Teal /// /// {@macro zeta-colors-swatch} ZetaColorSwatch get teal; - /// Pink + /// Warm /// /// {@macro zeta-colors-swatch} - ZetaColorSwatch get pink; + ZetaColorSwatch get warm; + + /// Yellow + /// + /// {@macro zeta-colors-swatch} + ZetaColorSwatch get yellow; /// 0dp space double get x0; @@ -135,17 +135,24 @@ abstract interface class ZetaPrimitives { /// Light primitives final class ZetaPrimitivesLight implements ZetaPrimitives { - /// Pure + /// Blue /// /// {@macro zeta-colors-swatch} @override - ZetaPureColorSwatch pure = const ZetaPureColorSwatch( + ZetaColorSwatch blue = const ZetaColorSwatch( swatch: { - 0: Color(0xFFffffff), - 500: Color(0xFF151519), - 1000: Color(0xFF151519), + 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: 0xFF151519, + primary: 0xFF0073e6, ); /// Cool @@ -168,46 +175,6 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { primary: 0xFF7a8190, ); - /// 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, - ); - - /// 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, - ); - /// Green /// /// {@macro zeta-colors-swatch} @@ -228,26 +195,6 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { primary: 0xFF00864f, ); - /// 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, - ); - /// Orange /// /// {@macro zeta-colors-swatch} @@ -268,6 +215,39 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { 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} @@ -288,24 +268,24 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { primary: 0xFF7e0cff, ); - /// Yellow + /// Red /// /// {@macro zeta-colors-swatch} @override - ZetaColorSwatch yellow = const ZetaColorSwatch( + ZetaColorSwatch red = 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), + 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: 0xFF8d7400, + primary: 0xFFd70015, ); /// Teal @@ -328,24 +308,44 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { primary: 0xFF1a8080, ); - /// Pink + /// Warm /// /// {@macro zeta-colors-swatch} @override - ZetaColorSwatch pink = const ZetaColorSwatch( + ZetaColorSwatch warm = 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), + 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: 0xFFd30589, + 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 @@ -429,17 +429,24 @@ final class ZetaPrimitivesLight implements ZetaPrimitives { /// Dark primitives final class ZetaPrimitivesDark implements ZetaPrimitives { - /// Pure + /// Blue /// /// {@macro zeta-colors-swatch} @override - ZetaPureColorSwatch pure = const ZetaPureColorSwatch( + ZetaColorSwatch blue = const ZetaColorSwatch( swatch: { - 0: Color(0xFF151519), - 500: Color(0xFF1d1e23), - 1000: Color(0xFFffffff), + 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: 0xFF1d1e23, + primary: 0xFF599fe5, ); /// Cool @@ -462,46 +469,6 @@ final class ZetaPrimitivesDark implements ZetaPrimitives { primary: 0xFF8d95a3, ); - /// 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, - ); - - /// 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, - ); - /// Green /// /// {@macro zeta-colors-swatch} @@ -522,26 +489,6 @@ final class ZetaPrimitivesDark implements ZetaPrimitives { primary: 0xFF67b796, ); - /// 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, - ); - /// Orange /// /// {@macro zeta-colors-swatch} @@ -562,6 +509,39 @@ final class ZetaPrimitivesDark implements ZetaPrimitives { 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} @@ -582,24 +562,24 @@ final class ZetaPrimitivesDark implements ZetaPrimitives { primary: 0xFF9b71df, ); - /// Yellow + /// Red /// /// {@macro zeta-colors-swatch} @override - ZetaColorSwatch yellow = const ZetaColorSwatch( + ZetaColorSwatch red = 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), + 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: 0xFFc2a728, + primary: 0xFFf36170, ); /// Teal @@ -622,24 +602,44 @@ final class ZetaPrimitivesDark implements ZetaPrimitives { primary: 0xFF65c4c4, ); - /// Pink + /// Warm /// /// {@macro zeta-colors-swatch} @override - ZetaColorSwatch pink = const ZetaColorSwatch( + ZetaColorSwatch warm = 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), + 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: 0xFFee78c3, + 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 diff --git a/lib/generated/tokens/semantics.g.dart b/lib/generated/tokens/semantics.g.dart index c024754a..14e9f0a0 100644 --- a/lib/generated/tokens/semantics.g.dart +++ b/lib/generated/tokens/semantics.g.dart @@ -4,367 +4,250 @@ import 'primitives.g.dart'; // This file is automatically generated by the zeta repository // DO NOT MODIFY -/// The semantic tokens for +/// Semantic tokens for Colors. abstract interface class ZetaSemanticColors { - /// The primitives for the colors + /// Primitives used to construct semantic colors ZetaPrimitives get primitives; - /// Main - ZetaSemanticMainColors get main; + /// Main Default color + Color get mainDefault; - /// Border - ZetaSemanticBorderColors get border; + /// Main Subtle color + Color get mainSubtle; - /// Surface - ZetaSemanticSurfaceColors get surface; + /// Main Primary color + Color get mainPrimary; - /// State - ZetaSemanticStateColors get state; -} - -/// The semantic tokens for Main -abstract interface class ZetaSemanticMainColors { - /// The primitives for the colors - ZetaPrimitives get primitives; - - /// Default Color - Color get defaultColor; - - /// Subtle - Color get subtle; + /// Main Secondary color + Color get mainSecondary; - /// Light - Color get light; + /// Main Positive color + Color get mainPositive; - /// Inverse - Color get inverse; + /// Main Warning color + Color get mainWarning; - /// Disabled - Color get disabled; + /// Main Negative color + Color get mainNegative; - /// Primary - Color get primary; + /// Main Info color + Color get mainInfo; - /// Secondary - Color get secondary; + /// Main Disabled color + Color get mainDisabled; - /// Positive - Color get positive; + /// Main Light color + Color get mainLight; - /// Warning - Color get warning; + /// Main Inverse color + Color get mainInverse; - /// Negative - Color get negative; - - /// Info - Color get info; -} - -/// The semantic tokens for Border -abstract interface class ZetaSemanticBorderColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Border Default color + Color get borderDefault; - /// Default Color - Color get defaultColor; + /// Border Selected color + Color get borderSelected; - /// Subtle - Color get subtle; + /// Border Hover color + Color get borderHover; - /// Hover - Color get hover; + /// Border Subtle color + Color get borderSubtle; - /// Selected - Color get selected; + /// Border Disabled color + Color get borderDisabled; - /// Disabled - Color get disabled; + /// Border Pure color + Color get borderPure; - /// Pure - Color get pure; + /// Border Primary Main color + Color get borderPrimaryMain; - /// Primary Main - Color get primaryMain; + /// Border Primary color + Color get borderPrimary; - /// Primary - Color get primary; - - /// Secondary - Color get secondary; - - /// Positive - Color get positive; - - /// Warning - Color get warning; - - /// Negative - Color get negative; - - /// Info - Color get info; -} - -/// The semantic tokens for Surface -abstract interface class ZetaSemanticSurfaceColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Border Secondary color + Color get borderSecondary; - /// Default Color - Color get defaultColor; + /// Border Positive color + Color get borderPositive; - /// Default Inverse - Color get defaultInverse; + /// Border Warning color + Color get borderWarning; - /// Hover - Color get hover; + /// Border Negative color + Color get borderNegative; - /// Selected - Color get selected; + /// Border Info color + Color get borderInfo; - /// Selected Hover - Color get selectedHover; + /// Surface Default color + Color get surfaceDefault; - /// Disabled - Color get disabled; - - /// Cool - Color get cool; - - /// Warm - Color get warm; - - /// Primary - Color get primary; - - /// Primary Subtle - Color get primarySubtle; - - /// Secondary - Color get secondary; - - /// Avatar - ZetaSemanticAvatarColors get avatar; - - /// Secondary Subtle - Color get secondarySubtle; - - /// Positive - Color get positive; - - /// Positive Subtle - Color get positiveSubtle; - - /// Warning - Color get warning; - - /// Warning Subtle - Color get warningSubtle; - - /// Negative - Color get negative; - - /// Negative Subtle - Color get negativeSubtle; - - /// Info - Color get info; - - /// Info Subtle - Color get infoSubtle; -} + /// Surface Default Inverse color + Color get surfaceDefaultInverse; -/// The semantic tokens for Avatar -abstract interface class ZetaSemanticAvatarColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Surface Hover color + Color get surfaceHover; - /// Blue - Color get blue; + /// Surface Selected color + Color get surfaceSelected; - /// Green - Color get green; + /// Surface Selected Hover color + Color get surfaceSelectedHover; - /// Orange - Color get orange; + /// Surface Disabled color + Color get surfaceDisabled; - /// Pink - Color get pink; + /// Surface Cool color + Color get surfaceCool; - /// Purple - Color get purple; + /// Surface Warm color + Color get surfaceWarm; - /// Teal - Color get teal; + /// Surface Primary color + Color get surfacePrimary; - /// Yellow - Color get yellow; -} + /// Surface Primary Subtle color + Color get surfacePrimarySubtle; -/// The semantic tokens for State -abstract interface class ZetaSemanticStateColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Surface Secondary color + Color get surfaceSecondary; - /// Disabled - ZetaSemanticDisabledColors get disabled; + /// Surface Avatar Blue color + Color get surfaceAvatarBlue; - /// Default - ZetaSemanticDefaultColors get defaultColor; + /// Surface Avatar Green color + Color get surfaceAvatarGreen; - /// Primary - ZetaSemanticPrimaryColors get primary; + /// Surface Avatar Orange color + Color get surfaceAvatarOrange; - /// Secondary - ZetaSemanticSecondaryColors get secondary; + /// Surface Avatar Pink color + Color get surfaceAvatarPink; - /// Positive - ZetaSemanticPositiveColors get positive; + /// Surface Avatar Purple color + Color get surfaceAvatarPurple; - /// Negative - ZetaSemanticNegativeColors get negative; + /// Surface Avatar Teal color + Color get surfaceAvatarTeal; - /// Info - ZetaSemanticInfoColors get info; + /// Surface Avatar Yellow color + Color get surfaceAvatarYellow; - /// Inverse - ZetaSemanticInverseColors get inverse; -} + /// Surface Secondary Subtle color + Color get surfaceSecondarySubtle; -/// The semantic tokens for Disabled -abstract interface class ZetaSemanticDisabledColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Surface Positive color + Color get surfacePositive; - /// Disabled - Color get disabled; -} + /// Surface Positive Subtle color + Color get surfacePositiveSubtle; -/// The semantic tokens for Default -abstract interface class ZetaSemanticDefaultColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Surface Warning color + Color get surfaceWarning; - /// Enabled - Color get enabled; + /// Surface Warning Subtle color + Color get surfaceWarningSubtle; - /// Hover - Color get hover; + /// Surface Negative color + Color get surfaceNegative; - /// Selected - Color get selected; + /// Surface Negative Subtle color + Color get surfaceNegativeSubtle; - /// Focus - Color get focus; -} + /// Surface Info color + Color get surfaceInfo; -/// The semantic tokens for Primary -abstract interface class ZetaSemanticPrimaryColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// Surface Info Subtle color + Color get surfaceInfoSubtle; - /// Enabled - Color get enabled; + /// State Disabled Disabled color + Color get stateDisabledDisabled; - /// Hover - Color get hover; + /// State Default Enabled color + Color get stateDefaultEnabled; - /// Selected - Color get selected; + /// State Default Hover color + Color get stateDefaultHover; - /// Focus - Color get focus; -} + /// State Default Selected color + Color get stateDefaultSelected; -/// The semantic tokens for Secondary -abstract interface class ZetaSemanticSecondaryColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// State Default Focus color + Color get stateDefaultFocus; - /// Enabled - Color get enabled; + /// State Primary Enabled color + Color get statePrimaryEnabled; - /// Hover - Color get hover; + /// State Primary Hover color + Color get statePrimaryHover; - /// Selected - Color get selected; + /// State Primary Selected color + Color get statePrimarySelected; - /// Focus - Color get focus; -} + /// State Primary Focus color + Color get statePrimaryFocus; -/// The semantic tokens for Positive -abstract interface class ZetaSemanticPositiveColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// State Secondary Enabled color + Color get stateSecondaryEnabled; - /// Enabled - Color get enabled; + /// State Secondary Hover color + Color get stateSecondaryHover; - /// Hover - Color get hover; + /// State Secondary Selected color + Color get stateSecondarySelected; - /// Selected - Color get selected; + /// State Secondary Focus color + Color get stateSecondaryFocus; - /// Focus - Color get focus; -} + /// State Negative Enabled color + Color get stateNegativeEnabled; -/// The semantic tokens for Negative -abstract interface class ZetaSemanticNegativeColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// State Negative Hover color + Color get stateNegativeHover; - /// Enabled - Color get enabled; + /// State Negative Selected color + Color get stateNegativeSelected; - /// Hover - Color get hover; + /// State Negative Focus color + Color get stateNegativeFocus; - /// Selected - Color get selected; + /// State Info Enabled color + Color get stateInfoEnabled; - /// Focus - Color get focus; -} + /// State Info Hover color + Color get stateInfoHover; -/// The semantic tokens for Info -abstract interface class ZetaSemanticInfoColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// State Info Selected color + Color get stateInfoSelected; - /// Enabled - Color get enabled; + /// State Info Focus color + Color get stateInfoFocus; - /// Hover - Color get hover; + /// State Inverse Enabled color + Color get stateInverseEnabled; - /// Selected - Color get selected; + /// State Inverse Hover color + Color get stateInverseHover; - /// Focus - Color get focus; -} + /// State Inverse Selected color + Color get stateInverseSelected; -/// The semantic tokens for Inverse -abstract interface class ZetaSemanticInverseColors { - /// The primitives for the colors - ZetaPrimitives get primitives; + /// State Inverse Focus color + Color get stateInverseFocus; - /// Enabled - Color get enabled; + /// State Positive Enabled color + Color get statePositiveEnabled; - /// Hover - Color get hover; + /// State Positive Hover color + Color get statePositiveHover; - /// Selected - Color get selected; + /// State Positive Selected color + Color get statePositiveSelected; - /// Focus - Color get focus; + /// State Positive Focus color + Color get statePositiveFocus; } /// Semantic tokens for Size. @@ -445,708 +328,340 @@ abstract interface class ZetaRadiiSemantics { BorderRadius get full; } -/// Implementation of ZetaSemanticColors -final class ZetaSemanticColorsAA implements ZetaSemanticColors { +/// The semantic colors for AA +class ZetaSemanticColorsAA implements ZetaSemanticColors { /// Constructor for ZetaSemanticColorsAA const ZetaSemanticColorsAA({required this.primitives}); - - /// The primitives for this sizes - @override - final ZetaPrimitives primitives; - - /// Main - @override - ZetaSemanticMainColors get main => ZetaSemanticMainColorsAA(primitives: primitives); - - /// Border - @override - ZetaSemanticBorderColors get border => ZetaSemanticBorderColorsAA(primitives: primitives); - - /// Surface - @override - ZetaSemanticSurfaceColors get surface => ZetaSemanticSurfaceColorsAA(primitives: primitives); - - /// State - @override - ZetaSemanticStateColors get state => ZetaSemanticStateColorsAA(primitives: primitives); -} - -/// Implementation of ZetaSemanticMainColors -final class ZetaSemanticMainColorsAA implements ZetaSemanticMainColors { - /// Constructor for ZetaSemanticMainColorsAA - const ZetaSemanticMainColorsAA({required this.primitives}); - - /// The primitives for this sizes @override final ZetaPrimitives primitives; @override - Color get defaultColor => primitives.cool.shade90; - @override - Color get subtle => primitives.cool.shade70; - @override - Color get light => primitives.cool.shade30; - @override - Color get inverse => primitives.cool.shade20; - @override - Color get disabled => primitives.cool.shade50; - @override - Color get primary => primitives.blue.shade60; - @override - Color get secondary => primitives.yellow.shade60; - @override - Color get positive => primitives.green.shade60; + Color get mainDefault => primitives.cool.shade90; @override - Color get warning => primitives.orange.shade60; - @override - Color get negative => primitives.red.shade60; - @override - Color get info => primitives.purple.shade60; -} - -/// Implementation of ZetaSemanticBorderColors -final class ZetaSemanticBorderColorsAA implements ZetaSemanticBorderColors { - /// Constructor for ZetaSemanticBorderColorsAA - const ZetaSemanticBorderColorsAA({required this.primitives}); - - /// The primitives for this sizes - @override - final ZetaPrimitives primitives; + Color get mainSubtle => primitives.cool.shade70; @override - Color get defaultColor => primitives.cool.shade40; + Color get mainPrimary => primitives.blue.shade60; @override - Color get subtle => primitives.cool.shade30; + Color get mainSecondary => primitives.yellow.shade60; @override - Color get hover => primitives.cool.shade90; - @override - Color get selected => primitives.cool.shade90; - @override - Color get disabled => primitives.cool.shade20; - @override - Color get pure => primitives.pure.shade0; - @override - Color get primaryMain => primitives.blue.shade60; - @override - Color get primary => primitives.blue.shade50; - @override - Color get secondary => primitives.yellow.shade50; - @override - Color get positive => primitives.green.shade50; - @override - Color get warning => primitives.orange.shade50; - @override - Color get negative => primitives.red.shade50; - @override - Color get info => primitives.purple.shade50; -} - -/// Implementation of ZetaSemanticSurfaceColors -final class ZetaSemanticSurfaceColorsAA implements ZetaSemanticSurfaceColors { - /// Constructor for ZetaSemanticSurfaceColorsAA - const ZetaSemanticSurfaceColorsAA({required this.primitives}); - - /// The primitives for this sizes - @override - final ZetaPrimitives primitives; + Color get mainPositive => primitives.green.shade60; @override - Color get defaultColor => primitives.pure.shade0; + Color get mainWarning => primitives.orange.shade60; @override - Color get defaultInverse => primitives.warm.shade100; + Color get mainNegative => primitives.red.shade60; @override - Color get hover => primitives.cool.shade20; + Color get mainInfo => primitives.purple.shade60; @override - Color get selected => primitives.blue.shade10; + Color get mainDisabled => primitives.cool.shade50; @override - Color get selectedHover => primitives.blue.shade20; + Color get mainLight => primitives.cool.shade30; @override - Color get disabled => primitives.cool.shade30; + Color get mainInverse => primitives.cool.shade20; @override - Color get cool => primitives.cool.shade10; + Color get borderDefault => primitives.cool.shade40; @override - Color get warm => primitives.warm.shade10; + Color get borderSelected => primitives.cool.shade90; @override - Color get primary => primitives.blue.shade60; + Color get borderHover => primitives.cool.shade90; @override - Color get primarySubtle => primitives.blue.shade10; + Color get borderSubtle => primitives.cool.shade30; @override - Color get secondary => primitives.yellow.shade60; - - /// Avatar + Color get borderDisabled => primitives.cool.shade20; @override - ZetaSemanticAvatarColors get avatar => ZetaSemanticAvatarColorsAA(primitives: primitives); + Color get borderPure => primitives.pure.shade0; @override - Color get secondarySubtle => primitives.yellow.shade10; + Color get borderPrimaryMain => primitives.blue.shade60; @override - Color get positive => primitives.green.shade60; + Color get borderPrimary => primitives.blue.shade50; @override - Color get positiveSubtle => primitives.green.shade10; + Color get borderSecondary => primitives.yellow.shade50; @override - Color get warning => primitives.orange.shade60; + Color get borderPositive => primitives.green.shade50; @override - Color get warningSubtle => primitives.orange.shade10; + Color get borderWarning => primitives.orange.shade50; @override - Color get negative => primitives.red.shade60; + Color get borderNegative => primitives.red.shade50; @override - Color get negativeSubtle => primitives.red.shade10; + Color get borderInfo => primitives.purple.shade50; @override - Color get info => primitives.purple.shade60; + Color get surfaceDefault => primitives.pure.shade0; @override - Color get infoSubtle => primitives.purple.shade10; -} - -/// Implementation of ZetaSemanticAvatarColors -final class ZetaSemanticAvatarColorsAA implements ZetaSemanticAvatarColors { - /// Constructor for ZetaSemanticAvatarColorsAA - const ZetaSemanticAvatarColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceDefaultInverse => primitives.warm.shade100; @override - final ZetaPrimitives primitives; + Color get surfaceHover => primitives.cool.shade20; @override - Color get blue => primitives.blue.shade80; + Color get surfaceSelected => primitives.blue.shade10; @override - Color get green => primitives.green.shade60; + Color get surfaceSelectedHover => primitives.blue.shade20; @override - Color get orange => primitives.orange.shade50; + Color get surfaceDisabled => primitives.cool.shade30; @override - Color get pink => primitives.pink.shade80; + Color get surfaceCool => primitives.cool.shade10; @override - Color get purple => primitives.purple.shade80; + Color get surfaceWarm => primitives.warm.shade10; @override - Color get teal => primitives.teal.shade80; + Color get surfacePrimary => primitives.blue.shade60; @override - Color get yellow => primitives.yellow.shade50; -} - -/// Implementation of ZetaSemanticStateColors -final class ZetaSemanticStateColorsAA implements ZetaSemanticStateColors { - /// Constructor for ZetaSemanticStateColorsAA - const ZetaSemanticStateColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfacePrimarySubtle => primitives.blue.shade10; @override - final ZetaPrimitives primitives; - - /// Disabled + Color get surfaceSecondary => primitives.yellow.shade60; @override - ZetaSemanticDisabledColors get disabled => ZetaSemanticDisabledColorsAA(primitives: primitives); - - /// Default + Color get surfaceAvatarBlue => primitives.blue.shade80; @override - ZetaSemanticDefaultColors get defaultColor => ZetaSemanticDefaultColorsAA(primitives: primitives); - - /// Primary + Color get surfaceAvatarGreen => primitives.green.shade60; @override - ZetaSemanticPrimaryColors get primary => ZetaSemanticPrimaryColorsAA(primitives: primitives); - - /// Secondary + Color get surfaceAvatarOrange => primitives.orange.shade50; @override - ZetaSemanticSecondaryColors get secondary => ZetaSemanticSecondaryColorsAA(primitives: primitives); - - /// Positive + Color get surfaceAvatarPink => primitives.pink.shade80; @override - ZetaSemanticPositiveColors get positive => ZetaSemanticPositiveColorsAA(primitives: primitives); - - /// Negative + Color get surfaceAvatarPurple => primitives.purple.shade80; @override - ZetaSemanticNegativeColors get negative => ZetaSemanticNegativeColorsAA(primitives: primitives); - - /// Info + Color get surfaceAvatarTeal => primitives.teal.shade80; @override - ZetaSemanticInfoColors get info => ZetaSemanticInfoColorsAA(primitives: primitives); - - /// Inverse + Color get surfaceAvatarYellow => primitives.yellow.shade50; @override - ZetaSemanticInverseColors get inverse => ZetaSemanticInverseColorsAA(primitives: primitives); -} - -/// Implementation of ZetaSemanticDisabledColors -final class ZetaSemanticDisabledColorsAA implements ZetaSemanticDisabledColors { - /// Constructor for ZetaSemanticDisabledColorsAA - const ZetaSemanticDisabledColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceSecondarySubtle => primitives.yellow.shade10; @override - final ZetaPrimitives primitives; + Color get surfacePositive => primitives.green.shade60; @override - Color get disabled => primitives.cool.shade30; -} - -/// Implementation of ZetaSemanticDefaultColors -final class ZetaSemanticDefaultColorsAA implements ZetaSemanticDefaultColors { - /// Constructor for ZetaSemanticDefaultColorsAA - const ZetaSemanticDefaultColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfacePositiveSubtle => primitives.green.shade10; @override - final ZetaPrimitives primitives; + Color get surfaceWarning => primitives.orange.shade60; @override - Color get enabled => primitives.pure.shade0; + Color get surfaceWarningSubtle => primitives.orange.shade10; @override - Color get hover => primitives.cool.shade20; + Color get surfaceNegative => primitives.red.shade60; @override - Color get selected => primitives.blue.shade10; + Color get surfaceNegativeSubtle => primitives.red.shade10; @override - Color get focus => primitives.pure.shade0; -} - -/// Implementation of ZetaSemanticPrimaryColors -final class ZetaSemanticPrimaryColorsAA implements ZetaSemanticPrimaryColors { - /// Constructor for ZetaSemanticPrimaryColorsAA - const ZetaSemanticPrimaryColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceInfo => primitives.purple.shade60; @override - final ZetaPrimitives primitives; + Color get surfaceInfoSubtle => primitives.purple.shade10; @override - Color get enabled => primitives.blue.shade60; + Color get stateDisabledDisabled => primitives.cool.shade30; @override - Color get hover => primitives.blue.shade50; + Color get stateDefaultEnabled => primitives.pure.shade0; @override - Color get selected => primitives.blue.shade70; + Color get stateDefaultHover => primitives.cool.shade20; @override - Color get focus => primitives.blue.shade60; -} - -/// Implementation of ZetaSemanticSecondaryColors -final class ZetaSemanticSecondaryColorsAA implements ZetaSemanticSecondaryColors { - /// Constructor for ZetaSemanticSecondaryColorsAA - const ZetaSemanticSecondaryColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateDefaultSelected => primitives.blue.shade10; @override - final ZetaPrimitives primitives; + Color get stateDefaultFocus => primitives.pure.shade0; @override - Color get enabled => primitives.yellow.shade40; + Color get statePrimaryEnabled => primitives.blue.shade60; @override - Color get hover => primitives.yellow.shade30; + Color get statePrimaryHover => primitives.blue.shade50; @override - Color get selected => primitives.yellow.shade50; + Color get statePrimarySelected => primitives.blue.shade70; @override - Color get focus => primitives.yellow.shade40; -} - -/// Implementation of ZetaSemanticPositiveColors -final class ZetaSemanticPositiveColorsAA implements ZetaSemanticPositiveColors { - /// Constructor for ZetaSemanticPositiveColorsAA - const ZetaSemanticPositiveColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get statePrimaryFocus => primitives.blue.shade60; @override - final ZetaPrimitives primitives; + Color get stateSecondaryEnabled => primitives.yellow.shade40; @override - Color get enabled => primitives.green.shade60; + Color get stateSecondaryHover => primitives.yellow.shade30; @override - Color get hover => primitives.green.shade50; + Color get stateSecondarySelected => primitives.yellow.shade50; @override - Color get selected => primitives.green.shade70; + Color get stateSecondaryFocus => primitives.yellow.shade40; @override - Color get focus => primitives.green.shade60; -} - -/// Implementation of ZetaSemanticNegativeColors -final class ZetaSemanticNegativeColorsAA implements ZetaSemanticNegativeColors { - /// Constructor for ZetaSemanticNegativeColorsAA - const ZetaSemanticNegativeColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateNegativeEnabled => primitives.red.shade60; @override - final ZetaPrimitives primitives; + Color get stateNegativeHover => primitives.red.shade50; @override - Color get enabled => primitives.red.shade60; + Color get stateNegativeSelected => primitives.red.shade70; @override - Color get hover => primitives.red.shade50; + Color get stateNegativeFocus => primitives.red.shade60; @override - Color get selected => primitives.red.shade70; + Color get stateInfoEnabled => primitives.purple.shade60; @override - Color get focus => primitives.red.shade60; -} - -/// Implementation of ZetaSemanticInfoColors -final class ZetaSemanticInfoColorsAA implements ZetaSemanticInfoColors { - /// Constructor for ZetaSemanticInfoColorsAA - const ZetaSemanticInfoColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateInfoHover => primitives.purple.shade50; @override - final ZetaPrimitives primitives; + Color get stateInfoSelected => primitives.purple.shade70; @override - Color get enabled => primitives.purple.shade60; + Color get stateInfoFocus => primitives.purple.shade60; @override - Color get hover => primitives.purple.shade50; + Color get stateInverseEnabled => primitives.cool.shade100; @override - Color get selected => primitives.purple.shade70; + Color get stateInverseHover => primitives.cool.shade90; @override - Color get focus => primitives.purple.shade60; -} - -/// Implementation of ZetaSemanticInverseColors -final class ZetaSemanticInverseColorsAA implements ZetaSemanticInverseColors { - /// Constructor for ZetaSemanticInverseColorsAA - const ZetaSemanticInverseColorsAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateInverseSelected => primitives.cool.shade100; @override - final ZetaPrimitives primitives; + Color get stateInverseFocus => primitives.cool.shade100; @override - Color get enabled => primitives.cool.shade100; + Color get statePositiveEnabled => primitives.green.shade60; @override - Color get hover => primitives.cool.shade90; + Color get statePositiveHover => primitives.green.shade50; @override - Color get selected => primitives.cool.shade100; + Color get statePositiveSelected => primitives.green.shade70; @override - Color get focus => primitives.cool.shade100; + Color get statePositiveFocus => primitives.green.shade60; } -/// Implementation of ZetaSemanticColors -final class ZetaSemanticColorsAAA implements ZetaSemanticColors { +/// The semantic colors for AAA +class ZetaSemanticColorsAAA implements ZetaSemanticColors { /// Constructor for ZetaSemanticColorsAAA const ZetaSemanticColorsAAA({required this.primitives}); - - /// The primitives for this sizes - @override - final ZetaPrimitives primitives; - - /// Main - @override - ZetaSemanticMainColors get main => ZetaSemanticMainColorsAAA(primitives: primitives); - - /// Border - @override - ZetaSemanticBorderColors get border => ZetaSemanticBorderColorsAAA(primitives: primitives); - - /// Surface - @override - ZetaSemanticSurfaceColors get surface => ZetaSemanticSurfaceColorsAAA(primitives: primitives); - - /// State - @override - ZetaSemanticStateColors get state => ZetaSemanticStateColorsAAA(primitives: primitives); -} - -/// Implementation of ZetaSemanticMainColors -final class ZetaSemanticMainColorsAAA implements ZetaSemanticMainColors { - /// Constructor for ZetaSemanticMainColorsAAA - const ZetaSemanticMainColorsAAA({required this.primitives}); - - /// The primitives for this sizes @override final ZetaPrimitives primitives; @override - Color get defaultColor => primitives.cool.shade100; - @override - Color get subtle => primitives.cool.shade90; - @override - Color get light => primitives.pure.shade0; - @override - Color get inverse => primitives.pure.shade0; - @override - Color get disabled => primitives.cool.shade60; - @override - Color get primary => primitives.blue.shade80; - @override - Color get secondary => primitives.yellow.shade80; - @override - Color get positive => primitives.green.shade80; - @override - Color get warning => primitives.orange.shade80; - @override - Color get negative => primitives.red.shade80; - @override - Color get info => primitives.purple.shade80; -} - -/// Implementation of ZetaSemanticBorderColors -final class ZetaSemanticBorderColorsAAA implements ZetaSemanticBorderColors { - /// Constructor for ZetaSemanticBorderColorsAAA - const ZetaSemanticBorderColorsAAA({required this.primitives}); - - /// The primitives for this sizes - @override - final ZetaPrimitives primitives; - @override - Color get defaultColor => primitives.cool.shade100; - @override - Color get subtle => primitives.cool.shade80; - @override - Color get hover => primitives.cool.shade90; - @override - Color get selected => primitives.cool.shade90; - @override - Color get disabled => primitives.cool.shade20; - @override - Color get pure => primitives.pure.shade0; - @override - Color get primaryMain => primitives.blue.shade80; - @override - Color get primary => primitives.blue.shade70; + Color get mainDefault => primitives.cool.shade100; @override - Color get secondary => primitives.yellow.shade70; + Color get mainSubtle => primitives.cool.shade90; @override - Color get positive => primitives.green.shade70; + Color get mainPrimary => primitives.blue.shade80; @override - Color get warning => primitives.orange.shade70; + Color get mainSecondary => primitives.yellow.shade80; @override - Color get negative => primitives.red.shade70; + Color get mainPositive => primitives.green.shade80; @override - Color get info => primitives.purple.shade70; -} - -/// Implementation of ZetaSemanticSurfaceColors -final class ZetaSemanticSurfaceColorsAAA implements ZetaSemanticSurfaceColors { - /// Constructor for ZetaSemanticSurfaceColorsAAA - const ZetaSemanticSurfaceColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get mainWarning => primitives.orange.shade80; @override - final ZetaPrimitives primitives; + Color get mainNegative => primitives.red.shade80; @override - Color get defaultColor => primitives.pure.shade0; + Color get mainInfo => primitives.purple.shade80; @override - Color get defaultInverse => primitives.pure.shade1000; + Color get mainDisabled => primitives.cool.shade60; @override - Color get hover => primitives.cool.shade20; + Color get mainLight => primitives.pure.shade0; @override - Color get selected => primitives.blue.shade10; + Color get mainInverse => primitives.pure.shade0; @override - Color get selectedHover => primitives.blue.shade20; + Color get borderDefault => primitives.cool.shade100; @override - Color get disabled => primitives.cool.shade30; + Color get borderSelected => primitives.cool.shade90; @override - Color get cool => primitives.cool.shade10; + Color get borderHover => primitives.cool.shade90; @override - Color get warm => primitives.warm.shade10; + Color get borderSubtle => primitives.cool.shade80; @override - Color get primary => primitives.blue.shade80; + Color get borderDisabled => primitives.cool.shade20; @override - Color get primarySubtle => primitives.blue.shade10; + Color get borderPure => primitives.pure.shade0; @override - Color get secondary => primitives.yellow.shade80; - - /// Avatar + Color get borderPrimaryMain => primitives.blue.shade80; @override - ZetaSemanticAvatarColors get avatar => ZetaSemanticAvatarColorsAAA(primitives: primitives); + Color get borderPrimary => primitives.blue.shade70; @override - Color get secondarySubtle => primitives.yellow.shade10; + Color get borderSecondary => primitives.yellow.shade70; @override - Color get positive => primitives.green.shade80; + Color get borderPositive => primitives.green.shade70; @override - Color get positiveSubtle => primitives.green.shade10; + Color get borderWarning => primitives.orange.shade70; @override - Color get warning => primitives.orange.shade80; + Color get borderNegative => primitives.red.shade70; @override - Color get warningSubtle => primitives.orange.shade10; + Color get borderInfo => primitives.purple.shade70; @override - Color get negative => primitives.red.shade80; + Color get surfaceDefault => primitives.pure.shade0; @override - Color get negativeSubtle => primitives.red.shade10; + Color get surfaceDefaultInverse => primitives.pure.shade1000; @override - Color get info => primitives.purple.shade80; + Color get surfaceHover => primitives.cool.shade20; @override - Color get infoSubtle => primitives.purple.shade10; -} - -/// Implementation of ZetaSemanticAvatarColors -final class ZetaSemanticAvatarColorsAAA implements ZetaSemanticAvatarColors { - /// Constructor for ZetaSemanticAvatarColorsAAA - const ZetaSemanticAvatarColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceSelected => primitives.blue.shade10; @override - final ZetaPrimitives primitives; + Color get surfaceSelectedHover => primitives.blue.shade20; @override - Color get blue => primitives.blue.shade80; + Color get surfaceDisabled => primitives.cool.shade30; @override - Color get green => primitives.green.shade60; + Color get surfaceCool => primitives.cool.shade10; @override - Color get orange => primitives.orange.shade50; + Color get surfaceWarm => primitives.warm.shade10; @override - Color get pink => primitives.pink.shade80; + Color get surfacePrimary => primitives.blue.shade80; @override - Color get purple => primitives.purple.shade80; + Color get surfacePrimarySubtle => primitives.blue.shade10; @override - Color get teal => primitives.teal.shade80; + Color get surfaceSecondary => primitives.yellow.shade80; @override - Color get yellow => primitives.yellow.shade50; -} - -/// Implementation of ZetaSemanticStateColors -final class ZetaSemanticStateColorsAAA implements ZetaSemanticStateColors { - /// Constructor for ZetaSemanticStateColorsAAA - const ZetaSemanticStateColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceAvatarBlue => primitives.blue.shade80; @override - final ZetaPrimitives primitives; - - /// Disabled + Color get surfaceAvatarGreen => primitives.green.shade60; @override - ZetaSemanticDisabledColors get disabled => ZetaSemanticDisabledColorsAAA(primitives: primitives); - - /// Default - @override - ZetaSemanticDefaultColors get defaultColor => ZetaSemanticDefaultColorsAAA(primitives: primitives); - - /// Primary - @override - ZetaSemanticPrimaryColors get primary => ZetaSemanticPrimaryColorsAAA(primitives: primitives); - - /// Secondary + Color get surfaceAvatarOrange => primitives.orange.shade50; @override - ZetaSemanticSecondaryColors get secondary => ZetaSemanticSecondaryColorsAAA(primitives: primitives); - - /// Positive + Color get surfaceAvatarPink => primitives.pink.shade80; @override - ZetaSemanticPositiveColors get positive => ZetaSemanticPositiveColorsAAA(primitives: primitives); - - /// Negative + Color get surfaceAvatarPurple => primitives.purple.shade80; @override - ZetaSemanticNegativeColors get negative => ZetaSemanticNegativeColorsAAA(primitives: primitives); - - /// Info + Color get surfaceAvatarTeal => primitives.teal.shade80; @override - ZetaSemanticInfoColors get info => ZetaSemanticInfoColorsAAA(primitives: primitives); - - /// Inverse + Color get surfaceAvatarYellow => primitives.yellow.shade50; @override - ZetaSemanticInverseColors get inverse => ZetaSemanticInverseColorsAAA(primitives: primitives); -} - -/// Implementation of ZetaSemanticDisabledColors -final class ZetaSemanticDisabledColorsAAA implements ZetaSemanticDisabledColors { - /// Constructor for ZetaSemanticDisabledColorsAAA - const ZetaSemanticDisabledColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceSecondarySubtle => primitives.yellow.shade10; @override - final ZetaPrimitives primitives; + Color get surfacePositive => primitives.green.shade80; @override - Color get disabled => primitives.cool.shade30; -} - -/// Implementation of ZetaSemanticDefaultColors -final class ZetaSemanticDefaultColorsAAA implements ZetaSemanticDefaultColors { - /// Constructor for ZetaSemanticDefaultColorsAAA - const ZetaSemanticDefaultColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfacePositiveSubtle => primitives.green.shade10; @override - final ZetaPrimitives primitives; + Color get surfaceWarning => primitives.orange.shade80; @override - Color get enabled => primitives.pure.shade0; + Color get surfaceWarningSubtle => primitives.orange.shade10; @override - Color get hover => primitives.cool.shade20; + Color get surfaceNegative => primitives.red.shade80; @override - Color get selected => primitives.blue.shade10; + Color get surfaceNegativeSubtle => primitives.red.shade10; @override - Color get focus => primitives.pure.shade0; -} - -/// Implementation of ZetaSemanticPrimaryColors -final class ZetaSemanticPrimaryColorsAAA implements ZetaSemanticPrimaryColors { - /// Constructor for ZetaSemanticPrimaryColorsAAA - const ZetaSemanticPrimaryColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get surfaceInfo => primitives.purple.shade80; @override - final ZetaPrimitives primitives; + Color get surfaceInfoSubtle => primitives.purple.shade10; @override - Color get enabled => primitives.blue.shade80; + Color get stateDisabledDisabled => primitives.cool.shade30; @override - Color get hover => primitives.blue.shade70; + Color get stateDefaultEnabled => primitives.pure.shade0; @override - Color get selected => primitives.blue.shade90; + Color get stateDefaultHover => primitives.cool.shade20; @override - Color get focus => primitives.blue.shade80; -} - -/// Implementation of ZetaSemanticSecondaryColors -final class ZetaSemanticSecondaryColorsAAA implements ZetaSemanticSecondaryColors { - /// Constructor for ZetaSemanticSecondaryColorsAAA - const ZetaSemanticSecondaryColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateDefaultSelected => primitives.blue.shade10; @override - final ZetaPrimitives primitives; + Color get stateDefaultFocus => primitives.pure.shade0; @override - Color get enabled => primitives.yellow.shade80; + Color get statePrimaryEnabled => primitives.blue.shade80; @override - Color get hover => primitives.yellow.shade70; + Color get statePrimaryHover => primitives.blue.shade70; @override - Color get selected => primitives.yellow.shade90; + Color get statePrimarySelected => primitives.blue.shade90; @override - Color get focus => primitives.yellow.shade80; -} - -/// Implementation of ZetaSemanticPositiveColors -final class ZetaSemanticPositiveColorsAAA implements ZetaSemanticPositiveColors { - /// Constructor for ZetaSemanticPositiveColorsAAA - const ZetaSemanticPositiveColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get statePrimaryFocus => primitives.blue.shade80; @override - final ZetaPrimitives primitives; + Color get stateSecondaryEnabled => primitives.yellow.shade80; @override - Color get enabled => primitives.green.shade80; + Color get stateSecondaryHover => primitives.yellow.shade70; @override - Color get hover => primitives.green.shade70; + Color get stateSecondarySelected => primitives.yellow.shade90; @override - Color get selected => primitives.green.shade90; + Color get stateSecondaryFocus => primitives.yellow.shade80; @override - Color get focus => primitives.green.shade80; -} - -/// Implementation of ZetaSemanticNegativeColors -final class ZetaSemanticNegativeColorsAAA implements ZetaSemanticNegativeColors { - /// Constructor for ZetaSemanticNegativeColorsAAA - const ZetaSemanticNegativeColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateNegativeEnabled => primitives.red.shade80; @override - final ZetaPrimitives primitives; + Color get stateNegativeHover => primitives.red.shade70; @override - Color get enabled => primitives.red.shade80; + Color get stateNegativeSelected => primitives.red.shade90; @override - Color get hover => primitives.red.shade70; + Color get stateNegativeFocus => primitives.red.shade80; @override - Color get selected => primitives.red.shade90; + Color get stateInfoEnabled => primitives.purple.shade80; @override - Color get focus => primitives.red.shade80; -} - -/// Implementation of ZetaSemanticInfoColors -final class ZetaSemanticInfoColorsAAA implements ZetaSemanticInfoColors { - /// Constructor for ZetaSemanticInfoColorsAAA - const ZetaSemanticInfoColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateInfoHover => primitives.purple.shade70; @override - final ZetaPrimitives primitives; + Color get stateInfoSelected => primitives.purple.shade90; @override - Color get enabled => primitives.purple.shade80; + Color get stateInfoFocus => primitives.purple.shade80; @override - Color get hover => primitives.purple.shade70; + Color get stateInverseEnabled => primitives.pure.shade1000; @override - Color get selected => primitives.purple.shade90; + Color get stateInverseHover => primitives.cool.shade90; @override - Color get focus => primitives.purple.shade80; -} - -/// Implementation of ZetaSemanticInverseColors -final class ZetaSemanticInverseColorsAAA implements ZetaSemanticInverseColors { - /// Constructor for ZetaSemanticInverseColorsAAA - const ZetaSemanticInverseColorsAAA({required this.primitives}); - - /// The primitives for this sizes + Color get stateInverseSelected => primitives.pure.shade1000; @override - final ZetaPrimitives primitives; + Color get stateInverseFocus => primitives.pure.shade1000; @override - Color get enabled => primitives.pure.shade1000; + Color get statePositiveEnabled => primitives.green.shade80; @override - Color get hover => primitives.cool.shade90; + Color get statePositiveHover => primitives.green.shade70; @override - Color get selected => primitives.pure.shade1000; + Color get statePositiveSelected => primitives.green.shade90; @override - Color get focus => primitives.pure.shade1000; + Color get statePositiveFocus => primitives.green.shade80; } /// The semantic sizes for AA diff --git a/lib/src/components/accordion/accordion.dart b/lib/src/components/accordion/accordion.dart index 16c1f8f8..16095819 100644 --- a/lib/src/components/accordion/accordion.dart +++ b/lib/src/components/accordion/accordion.dart @@ -96,10 +96,10 @@ class _ZetaAccordionState extends State with TickerProviderStateM @override Widget build(BuildContext context) { final zetaColors = Zeta.of(context).colors; - final borderColor = _disabled ? zetaColors.border.disabled : zetaColors.border.subtle; - final childTextStyle = ZetaTextStyles.h5.apply(color: zetaColors.main.defaultColor); + final borderColor = _disabled ? zetaColors.borderDisabled : zetaColors.borderSubtle; + final childTextStyle = ZetaTextStyles.h5.apply(color: zetaColors.mainDefault); final rounded = context.rounded; - final Color color = _disabled ? zetaColors.main.disabled : zetaColors.main.defaultColor; + final Color color = _disabled ? zetaColors.mainDisabled : zetaColors.mainDefault; return ZetaRoundedScope( rounded: rounded, child: DecoratedBox( @@ -121,10 +121,10 @@ class _ZetaAccordionState extends State with TickerProviderStateM ), overlayColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.hovered)) { - return zetaColors.surface.hover; + return zetaColors.surfaceHover; } if (states.contains(WidgetState.pressed)) { - return zetaColors.surface.selectedHover; + return zetaColors.surfaceSelectedHover; } if (states.contains(WidgetState.focused)) { @@ -135,7 +135,7 @@ class _ZetaAccordionState extends State with TickerProviderStateM }), side: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.focused)) { - return BorderSide(color: zetaColors.border.primary, width: 2); + return BorderSide(color: zetaColors.borderPrimary, width: 2); } return null; }), diff --git a/lib/src/components/avatars/avatar.dart b/lib/src/components/avatars/avatar.dart index 5d9a1299..1dde9530 100644 --- a/lib/src/components/avatars/avatar.dart +++ b/lib/src/components/avatars/avatar.dart @@ -216,14 +216,14 @@ class ZetaAvatar extends ZetaStatelessWidget { decoration: BoxDecoration( border: borderColor != null ? Border.all(color: borderColor!, width: 0) : null, borderRadius: Zeta.of(context).radius.full, - color: backgroundColor ?? (_showPlaceholder ? zetaColors.surface.primary : zetaColors.surface.warm), + color: backgroundColor ?? (_showPlaceholder ? zetaColors.surfacePrimary : zetaColors.surfaceWarm), ), child: borderColor != null ? Container( width: pSize, height: pSize, decoration: BoxDecoration( - color: backgroundColor ?? zetaColors.surface.hover, + color: backgroundColor ?? zetaColors.surfaceHover, border: Border.all(color: borderColor!, width: borderSize(context)), borderRadius: Zeta.of(context).radius.full, ), @@ -235,7 +235,7 @@ class ZetaAvatar extends ZetaStatelessWidget { : DecoratedBox( decoration: BoxDecoration( borderRadius: Zeta.of(context).radius.full, - color: backgroundColor ?? zetaColors.surface.hover, + color: backgroundColor ?? zetaColors.surfaceHover, ), child: ClipRRect( borderRadius: Zeta.of(context).radius.full, @@ -433,7 +433,7 @@ class ZetaAvatarBadge extends StatelessWidget { Widget build(BuildContext context) { final colors = Zeta.of(context).colors; final Color backgroundColor = - type == ZetaAvatarBadgeType.notification ? colors.surface.negative : (color ?? colors.main.primary); + type == ZetaAvatarBadgeType.notification ? colors.surfaceNegative : (color ?? colors.mainPrimary); final badgeSize = _getContainerSize(context); final borderSize = _getBorderSize(context); final paddedSize = badgeSize + Zeta.of(context).spacing.minimum; @@ -472,7 +472,7 @@ class ZetaAvatarBadge extends StatelessWidget { border: type != ZetaAvatarBadgeType.notification ? Border.all( width: borderSize, - color: Zeta.of(context).colors.surface.primary, + color: Zeta.of(context).colors.surfacePrimary, ) : null, ), diff --git a/lib/src/components/badges/indicator.dart b/lib/src/components/badges/indicator.dart index e3c4da18..339722d6 100644 --- a/lib/src/components/badges/indicator.dart +++ b/lib/src/components/badges/indicator.dart @@ -103,8 +103,8 @@ class ZetaIndicator extends ZetaStatelessWidget { Widget build(BuildContext context) { final zetaColors = Zeta.of(context).colors; final Color backgroundColor = - (type == ZetaIndicatorType.icon ? zetaColors.main.primary : zetaColors.surface.negative); - final Color foregroundColor = zetaColors.main.inverse; + (type == ZetaIndicatorType.icon ? zetaColors.mainPrimary : zetaColors.surfaceNegative); + final Color foregroundColor = zetaColors.mainInverse; final sizePixels = _getSizePixels(size, type, context); return Semantics( @@ -115,7 +115,7 @@ class ZetaIndicator extends ZetaStatelessWidget { decoration: BoxDecoration( border: Border.all( width: ZetaBorders.medium, - color: Zeta.of(context).colors.border.pure, + color: Zeta.of(context).colors.borderPure, ), color: (inverse ? foregroundColor : Colors.transparent), borderRadius: Zeta.of(context).radius.full, diff --git a/lib/src/components/badges/label.dart b/lib/src/components/badges/label.dart index 19e24e5b..1b2dfe2f 100644 --- a/lib/src/components/badges/label.dart +++ b/lib/src/components/badges/label.dart @@ -74,15 +74,15 @@ extension on ZetaWidgetStatus { final colors = Zeta.of(context).colors; switch (this) { case ZetaWidgetStatus.info: - return colors.surface.info; + return colors.surfaceInfo; case ZetaWidgetStatus.positive: - return colors.surface.positive; + return colors.surfacePositive; case ZetaWidgetStatus.warning: - return colors.surface.warning; + return colors.surfaceWarning; case ZetaWidgetStatus.negative: - return colors.surface.negative; + return colors.surfaceNegative; case ZetaWidgetStatus.neutral: - return colors.main.light; + return colors.mainLight; } } @@ -93,9 +93,9 @@ extension on ZetaWidgetStatus { case ZetaWidgetStatus.positive: case ZetaWidgetStatus.warning: case ZetaWidgetStatus.negative: - return colors.main.inverse; + return colors.mainInverse; case ZetaWidgetStatus.neutral: - return colors.main.defaultColor; + return colors.mainDefault; } } } diff --git a/lib/src/components/badges/priority_pill.dart b/lib/src/components/badges/priority_pill.dart index 45c7bfb8..a295b61e 100644 --- a/lib/src/components/badges/priority_pill.dart +++ b/lib/src/components/badges/priority_pill.dart @@ -34,13 +34,13 @@ extension on ZetaPriorityPillType { final colors = Zeta.of(context).colors; switch (this) { case ZetaPriorityPillType.urgent: - return colors.main.negative; + return colors.mainNegative; case ZetaPriorityPillType.high: - return colors.main.warning; + return colors.mainWarning; case ZetaPriorityPillType.medium: - return colors.main.primary; + return colors.mainPrimary; case ZetaPriorityPillType.low: - return colors.main.positive; + return colors.mainPositive; } } @@ -48,13 +48,13 @@ extension on ZetaPriorityPillType { final colors = Zeta.of(context).colors; switch (this) { case ZetaPriorityPillType.urgent: - return colors.surface.negativeSubtle; + return colors.surfaceNegativeSubtle; case ZetaPriorityPillType.high: - return colors.surface.warningSubtle; + return colors.surfaceWarningSubtle; case ZetaPriorityPillType.medium: - return colors.surface.primarySubtle; + return colors.surfacePrimarySubtle; case ZetaPriorityPillType.low: - return colors.surface.positiveSubtle; + return colors.surfacePositiveSubtle; } } } @@ -154,9 +154,9 @@ class ZetaPriorityPill extends ZetaStatelessWidget { ? ZetaTextStyles.labelSmall.copyWith( fontSize: 10, height: 13 / 10, - color: Zeta.of(context).colors.main.inverse, + color: Zeta.of(context).colors.mainInverse, ) - : ZetaTextStyles.labelMedium.apply(color: Zeta.of(context).colors.main.inverse), + : ZetaTextStyles.labelMedium.apply(color: Zeta.of(context).colors.mainInverse), ), ), if (!isBadge) diff --git a/lib/src/components/badges/status_label.dart b/lib/src/components/badges/status_label.dart index b3e59a93..e4c73313 100644 --- a/lib/src/components/badges/status_label.dart +++ b/lib/src/components/badges/status_label.dart @@ -39,7 +39,7 @@ class ZetaStatusLabel extends ZetaStatelessWidget { final Color backgroundColor = status.backgroundColor(colors); final Color borderColor = status.borderColor(colors); final Color iconColor = status.foregroundColor(colors); - final Color textColor = colors.main.defaultColor; + final Color textColor = colors.mainDefault; return Semantics( value: semanticLabel ?? label, @@ -93,15 +93,15 @@ extension on ZetaWidgetStatus { Color backgroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.surface.infoSubtle; + return colors.surfaceInfoSubtle; case ZetaWidgetStatus.positive: - return colors.surface.positiveSubtle; + return colors.surfacePositiveSubtle; case ZetaWidgetStatus.warning: - return colors.surface.warningSubtle; + return colors.surfaceWarningSubtle; case ZetaWidgetStatus.negative: - return colors.surface.negativeSubtle; + return colors.surfaceNegativeSubtle; case ZetaWidgetStatus.neutral: - return colors.main.light; + return colors.mainLight; } } @@ -109,15 +109,15 @@ extension on ZetaWidgetStatus { Color foregroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.main.info; + return colors.mainInfo; case ZetaWidgetStatus.positive: - return colors.main.positive; + return colors.mainPositive; case ZetaWidgetStatus.warning: - return colors.main.warning; + return colors.mainWarning; case ZetaWidgetStatus.negative: - return colors.main.negative; + return colors.mainNegative; case ZetaWidgetStatus.neutral: - return colors.main.subtle; + return colors.mainSubtle; } } @@ -125,15 +125,15 @@ extension on ZetaWidgetStatus { Color borderColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.border.info; + return colors.borderInfo; case ZetaWidgetStatus.positive: - return colors.border.positive; + return colors.borderPositive; case ZetaWidgetStatus.warning: - return colors.border.warning; + return colors.borderWarning; case ZetaWidgetStatus.negative: - return colors.border.negative; + return colors.borderNegative; case ZetaWidgetStatus.neutral: - return colors.border.defaultColor; + return colors.borderDefault; } } } diff --git a/lib/src/components/badges/tag.dart b/lib/src/components/badges/tag.dart index b3e2dc57..067e1945 100644 --- a/lib/src/components/badges/tag.dart +++ b/lib/src/components/badges/tag.dart @@ -59,7 +59,7 @@ class ZetaTag extends ZetaStatelessWidget { if (direction == ZetaTagDirection.left) _buildCustomPaint(context), Container( decoration: BoxDecoration( - color: Zeta.of(context).colors.main.light, + color: Zeta.of(context).colors.mainLight, borderRadius: _getBorderRadius(context), ), height: containerSize.height, @@ -97,7 +97,7 @@ class ZetaTag extends ZetaStatelessWidget { return CustomPaint( size: Size(Zeta.of(context).spacing.medium, Zeta.of(context).spacing.xl_3), painter: _TagPainter( - color: Zeta.of(context).colors.main.light, + color: Zeta.of(context).colors.mainLight, direction: direction, rounded: context.rounded, ), diff --git a/lib/src/components/banner/banner.dart b/lib/src/components/banner/banner.dart index 4dc84a74..0dab3419 100644 --- a/lib/src/components/banner/banner.dart +++ b/lib/src/components/banner/banner.dart @@ -64,7 +64,7 @@ class ZetaBanner extends MaterialBanner { content: () { final colors = Zeta.of(context).colors; final backgroundColor = type.backgroundColor(context); - final foregroundColor = colors.main.inverse; + final foregroundColor = colors.mainInverse; if (!kIsWeb && Platform.isAndroid && context.mounted) { // ignore: invalid_use_of_visible_for_testing_member @@ -110,7 +110,7 @@ class ZetaBanner extends MaterialBanner { backgroundColor: type.backgroundColor(context), actions: [ IconTheme( - data: IconThemeData(color: Zeta.of(context).colors.main.inverse), + data: IconThemeData(color: Zeta.of(context).colors.mainInverse), child: trailing ?? const Nothing(), ), ], @@ -122,13 +122,13 @@ extension on ZetaBannerStatus { final colors = Zeta.of(context).colors; switch (this) { case ZetaBannerStatus.primary: - return colors.surface.primary; + return colors.surfacePrimary; case ZetaBannerStatus.positive: - return colors.surface.positive; + return colors.surfacePositive; case ZetaBannerStatus.warning: - return colors.surface.warning; + return colors.surfaceWarning; case ZetaBannerStatus.negative: - return colors.surface.negative; + return colors.surfaceNegative; } } } diff --git a/lib/src/components/bottom sheets/bottom_sheet.dart b/lib/src/components/bottom sheets/bottom_sheet.dart index 6b745cfc..968c36e5 100644 --- a/lib/src/components/bottom sheets/bottom_sheet.dart +++ b/lib/src/components/bottom sheets/bottom_sheet.dart @@ -44,7 +44,7 @@ class ZetaBottomSheet extends ZetaStatelessWidget { Zeta.of(context).spacing.xl, ), decoration: BoxDecoration( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, borderRadius: BorderRadius.only( topLeft: Radius.circular(Zeta.of(context).spacing.xl_2), topRight: Radius.circular(Zeta.of(context).spacing.xl_2), @@ -61,7 +61,7 @@ class ZetaBottomSheet extends ZetaStatelessWidget { child: ZetaIcon( Icons.maximize, size: Zeta.of(context).spacing.xl_9, - color: colors.surface.disabled, + color: colors.surfaceDisabled, ), ), ), @@ -81,7 +81,7 @@ class ZetaBottomSheet extends ZetaStatelessWidget { ), ), Material( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, child: body ?? const Nothing(), ), ], diff --git a/lib/src/components/bottom sheets/menu_items.dart b/lib/src/components/bottom sheets/menu_items.dart index 31a31f7f..d840b72a 100644 --- a/lib/src/components/bottom sheets/menu_items.dart +++ b/lib/src/components/bottom sheets/menu_items.dart @@ -83,7 +83,7 @@ class ZetaMenuItem extends ZetaStatelessWidget { final colors = Zeta.of(context).colors; final Widget text = DefaultTextStyle( - style: ZetaTextStyles.labelLarge.apply(color: _enabled ? colors.main.defaultColor : colors.main.disabled), + style: ZetaTextStyles.labelLarge.apply(color: _enabled ? colors.mainDefault : colors.mainDisabled), child: label, ); @@ -152,7 +152,7 @@ class ZetaMenuItem extends ZetaStatelessWidget { } static IconThemeData _iconThemeData(ZetaSemanticColors colors, bool enabled, double size) => IconThemeData( - color: enabled ? colors.main.subtle : colors.main.disabled, + color: enabled ? colors.mainSubtle : colors.mainDisabled, size: size, ); diff --git a/lib/src/components/breadcrumbs/breadcrumbs.dart b/lib/src/components/breadcrumbs/breadcrumbs.dart index 6d2aa2b7..204feaeb 100644 --- a/lib/src/components/breadcrumbs/breadcrumbs.dart +++ b/lib/src/components/breadcrumbs/breadcrumbs.dart @@ -229,10 +229,10 @@ class _ZetaBreadCrumbState extends State { /// Get color of breadcrumb based on state. Color getColor(Set states, ZetaSemanticColors colors) { if (states.contains(WidgetState.hovered)) { - return colors.main.primary; + return colors.mainPrimary; } - if (widget.isSelected) return colors.main.defaultColor; - return colors.main.subtle; + if (widget.isSelected) return colors.mainDefault; + return colors.mainSubtle; } @override @@ -297,21 +297,21 @@ class _BreadCrumbsTruncatedState extends State<_BreadCrumbsTruncated> { style: ButtonStyle( backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.hovered)) { - return colors.surface.hover; + return colors.surfaceHover; } if (states.contains(WidgetState.pressed)) { - return colors.surface.selected; + return colors.surfaceSelected; } if (states.contains(WidgetState.disabled)) { - return colors.surface.disabled; + return colors.surfaceDisabled; } - return colors.surface.warm; + return colors.surfaceWarm; }), foregroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.main.disabled; + return colors.mainDisabled; } - return colors.main.defaultColor; + return colors.mainDefault; }), shape: WidgetStatePropertyAll( RoundedRectangleBorder( @@ -322,17 +322,17 @@ class _BreadCrumbsTruncatedState extends State<_BreadCrumbsTruncated> { if (states.contains(WidgetState.focused)) { return BorderSide( width: ZetaBorders.medium, - color: colors.border.primary, + color: colors.borderPrimary, ); } if (states.contains(WidgetState.hovered)) { - return BorderSide(color: colors.border.hover, width: ZetaBorders.small); + return BorderSide(color: colors.borderHover, width: ZetaBorders.small); } if (states.contains(WidgetState.pressed)) { - return BorderSide(color: colors.border.selected, width: ZetaBorders.small); + return BorderSide(color: colors.borderSelected, width: ZetaBorders.small); } - return BorderSide(color: colors.border.defaultColor, width: ZetaBorders.small); + return BorderSide(color: colors.borderDefault, width: ZetaBorders.small); }), padding: WidgetStateProperty.all(EdgeInsets.zero), minimumSize: WidgetStateProperty.all(Size.zero), diff --git a/lib/src/components/button_group/button_group.dart b/lib/src/components/button_group/button_group.dart index e6915d30..b06b5d33 100644 --- a/lib/src/components/button_group/button_group.dart +++ b/lib/src/components/button_group/button_group.dart @@ -239,13 +239,13 @@ class _ZetaGroupButtonState extends State { ) { // TODO(UX-1200): Focus border does not work as expected. if (_controller.value.contains(WidgetState.focused)) { - return BorderSide(color: colors.border.primary, width: ZetaBorders.medium); + return BorderSide(color: colors.borderPrimary, width: ZetaBorders.medium); } if (_controller.value.contains(WidgetState.disabled)) { - return BorderSide(color: colors.border.disabled); + return BorderSide(color: colors.borderDisabled); } return BorderSide( - color: finalButton ? colors.border.defaultColor : colors.border.subtle, + color: finalButton ? colors.borderDefault : colors.borderSubtle, ); } @@ -304,7 +304,7 @@ class _ZetaGroupButtonState extends State { left: borderSide, bottom: borderSide, right: _controller.value.contains(WidgetState.focused) - ? BorderSide(color: colors.border.primary, width: 2) + ? BorderSide(color: colors.borderPrimary, width: 2) : (widget.isFinal) ? borderSide : BorderSide.none, @@ -324,24 +324,24 @@ class _ZetaGroupButtonState extends State { ), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.surface.disabled; + return colors.surfaceDisabled; } if (states.contains(WidgetState.pressed)) { - return widget.isInverse ? colors.state.inverse.selected : colors.state.defaultColor.selected; + return widget.isInverse ? colors.stateInverseSelected : colors.stateDefaultSelected; } if (states.contains(WidgetState.hovered)) { - return widget.isInverse ? colors.state.inverse.hover : colors.surface.hover; + return widget.isInverse ? colors.stateInverseHover : colors.surfaceHover; } - if (widget.isInverse) return colors.state.inverse.enabled; + if (widget.isInverse) return colors.stateInverseEnabled; - return colors.surface.defaultColor; + return colors.surfaceDefault; }), foregroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.main.disabled; + return colors.mainDisabled; } - if (widget.isInverse) return colors.main.inverse; - return colors.main.defaultColor; + if (widget.isInverse) return colors.mainInverse; + return colors.mainDefault; }), elevation: WidgetStatePropertyAll(Zeta.of(context).spacing.none), padding: WidgetStateProperty.all(EdgeInsets.zero), diff --git a/lib/src/components/buttons/button_style.dart b/lib/src/components/buttons/button_style.dart index 452212ed..c8283da6 100644 --- a/lib/src/components/buttons/button_style.dart +++ b/lib/src/components/buttons/button_style.dart @@ -40,17 +40,17 @@ extension ButtonFunctions on ZetaButtonType { Color backgroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaButtonType.primary: - return colors.state.primary.enabled; + return colors.statePrimaryEnabled; case ZetaButtonType.secondary: - return colors.state.secondary.enabled; + return colors.stateSecondaryEnabled; case ZetaButtonType.positive: - return colors.state.positive.enabled; + return colors.statePositiveEnabled; case ZetaButtonType.negative: - return colors.state.negative.enabled; + return colors.stateNegativeEnabled; case ZetaButtonType.outline: case ZetaButtonType.outlineSubtle: case ZetaButtonType.text: - return colors.state.defaultColor.enabled; + return colors.stateDefaultEnabled; } } @@ -58,17 +58,17 @@ extension ButtonFunctions on ZetaButtonType { Color hoverColor(ZetaColorSemantics colors) { switch (this) { case ZetaButtonType.primary: - return colors.state.primary.hover; + return colors.statePrimaryHover; case ZetaButtonType.secondary: - return colors.state.secondary.hover; + return colors.stateSecondaryHover; case ZetaButtonType.positive: - return colors.state.positive.hover; + return colors.statePositiveHover; case ZetaButtonType.negative: - return colors.state.negative.hover; + return colors.stateNegativeHover; case ZetaButtonType.outline: case ZetaButtonType.outlineSubtle: case ZetaButtonType.text: - return colors.state.defaultColor.hover; + return colors.stateDefaultHover; } } @@ -76,17 +76,17 @@ extension ButtonFunctions on ZetaButtonType { Color pressedColor(ZetaColorSemantics colors) { switch (this) { case ZetaButtonType.primary: - return colors.state.primary.selected; + return colors.statePrimarySelected; case ZetaButtonType.secondary: - return colors.state.secondary.selected; + return colors.stateSecondarySelected; case ZetaButtonType.positive: - return colors.state.positive.selected; + return colors.statePositiveSelected; case ZetaButtonType.negative: - return colors.state.negative.selected; + return colors.stateNegativeSelected; case ZetaButtonType.outline: case ZetaButtonType.outlineSubtle: case ZetaButtonType.text: - return colors.state.defaultColor.selected; + return colors.stateDefaultSelected; } } @@ -131,7 +131,7 @@ ButtonStyle buttonStyle( backgroundColor: WidgetStateProperty.resolveWith( (states) { if (states.contains(WidgetState.disabled)) { - return colors.state.disabled.disabled; + return colors.stateDisabledDisabled; } if (states.contains(WidgetState.pressed)) { return backgroundColorPressed; @@ -145,19 +145,19 @@ ButtonStyle buttonStyle( foregroundColor: WidgetStateProperty.resolveWith( (states) { if (states.contains(WidgetState.disabled)) { - return colors.main.disabled; + return colors.mainDisabled; } switch (type) { case ZetaButtonType.outline: case ZetaButtonType.text: - return colors.main.primary; + return colors.mainPrimary; case ZetaButtonType.outlineSubtle: - return colors.main.defaultColor; + return colors.mainDefault; case ZetaButtonType.primary: case ZetaButtonType.secondary: case ZetaButtonType.positive: case ZetaButtonType.negative: - return colors.main.inverse; + return colors.mainInverse; } }, ), @@ -166,15 +166,15 @@ ButtonStyle buttonStyle( }), side: WidgetStateProperty.resolveWith((Set states) { if (type.border && states.contains(WidgetState.disabled)) { - return BorderSide(color: colors.border.disabled); + return BorderSide(color: colors.borderDisabled); } // TODO(UX-1134): This removes a defualt border when focused, rather than adding a second border when focused. if (states.contains(WidgetState.focused)) { - return BorderSide(color: colors.border.primary, width: ZetaBorders.medium); + return BorderSide(color: colors.borderPrimary, width: ZetaBorders.medium); } if (type.border) { return BorderSide( - color: type == ZetaButtonType.outline ? colors.border.primaryMain : colors.border.subtle, + color: type == ZetaButtonType.outline ? colors.borderPrimaryMain : colors.borderSubtle, ); } diff --git a/lib/src/components/buttons/input_icon_button.dart b/lib/src/components/buttons/input_icon_button.dart index 065f22f9..08fed6d0 100644 --- a/lib/src/components/buttons/input_icon_button.dart +++ b/lib/src/components/buttons/input_icon_button.dart @@ -66,7 +66,7 @@ class InputIconButton extends StatelessWidget { minHeight: iconSize * 2, minWidth: iconSize * 2, ), - color: !disabled ? color : colors.main.disabled, + color: !disabled ? color : colors.mainDisabled, onPressed: disabled ? null : onTap, iconSize: iconSize, icon: ZetaIcon(icon), diff --git a/lib/src/components/chat_item/chat_item.dart b/lib/src/components/chat_item/chat_item.dart index 1729db40..67270cc9 100644 --- a/lib/src/components/chat_item/chat_item.dart +++ b/lib/src/components/chat_item/chat_item.dart @@ -169,7 +169,7 @@ class ZetaChatItem extends ZetaStatelessWidget { : actions, ), child: ColoredBox( - color: highlighted ? colors.surface.selected : colors.surface.defaultColor, + color: highlighted ? colors.surfaceSelected : colors.surfaceDefault, child: Material( color: Colors.transparent, child: InkWell( @@ -199,7 +199,7 @@ class ZetaChatItem extends ZetaStatelessWidget { height: Zeta.of(context).spacing.small, width: Zeta.of(context).spacing.small, decoration: BoxDecoration( - color: colors.main.primary, + color: colors.mainPrimary, shape: BoxShape.circle, ), ), @@ -214,7 +214,7 @@ class ZetaChatItem extends ZetaStatelessWidget { style: (highlighted ? ZetaTextStyles.labelLarge : ZetaTextStyles.bodyMedium) - .copyWith(color: colors.main.defaultColor), + .copyWith(color: colors.mainDefault), child: title, ), ), @@ -239,7 +239,7 @@ class ZetaChatItem extends ZetaStatelessWidget { ), child: ZetaIcon( ZetaIcons.error, - color: colors.main.subtle, + color: colors.mainSubtle, ), ), if (enabledWarningIcon) @@ -249,7 +249,7 @@ class ZetaChatItem extends ZetaStatelessWidget { ), child: Icon( Icons.circle_notifications, - color: colors.surface.negative, + color: colors.surfaceNegative, ), ), if (_count != null) @@ -261,13 +261,13 @@ class ZetaChatItem extends ZetaStatelessWidget { horizontal: Zeta.of(context).spacing.small, ), decoration: BoxDecoration( - color: colors.main.primary, + color: colors.mainPrimary, borderRadius: Zeta.of(context).radius.full, ), child: Text( _count!, style: ZetaTextStyles.labelSmall.copyWith( - color: colors.main.inverse, + color: colors.mainInverse, ), ), ), @@ -290,7 +290,7 @@ class ZetaChatItem extends ZetaStatelessWidget { maxLines: 2, overflow: TextOverflow.ellipsis, style: ZetaTextStyles.bodySmall.copyWith( - color: colors.main.subtle, + color: colors.mainSubtle, ), child: subtitle!, ), @@ -302,7 +302,7 @@ class ZetaChatItem extends ZetaStatelessWidget { ), child: ZetaIcon( starred! ? ZetaIcons.star : ZetaIcons.star_outline, - color: starred! ? colors.main.secondary : null, + color: starred! ? colors.mainSecondary : null, ), ), ], @@ -354,15 +354,15 @@ extension on _ZetaSlidableActionType { final colors = Zeta.of(context).colors; switch (this) { case _ZetaSlidableActionType.menuMore: - return colors.surface.info; + return colors.surfaceInfo; case _ZetaSlidableActionType.call: - return colors.surface.positive; + return colors.surfacePositive; case _ZetaSlidableActionType.ptt: - return colors.surface.primary; + return colors.surfacePrimary; case _ZetaSlidableActionType.delete: - return colors.surface.negative; + return colors.surfaceNegative; case _ZetaSlidableActionType.custom: - return colors.surface.primary; + return colors.surfacePrimary; } } @@ -371,15 +371,15 @@ extension on _ZetaSlidableActionType { if (pale) { switch (this) { case _ZetaSlidableActionType.menuMore: - return colors.surface.infoSubtle; + return colors.surfaceInfoSubtle; case _ZetaSlidableActionType.call: - return colors.surface.positiveSubtle; + return colors.surfacePositiveSubtle; case _ZetaSlidableActionType.ptt: - return colors.surface.primarySubtle; + return colors.surfacePrimarySubtle; case _ZetaSlidableActionType.delete: - return colors.surface.negativeSubtle; + return colors.surfaceNegativeSubtle; case _ZetaSlidableActionType.custom: - return colors.surface.primarySubtle; + return colors.surfacePrimarySubtle; } } else { return _getMainColor(context); @@ -391,18 +391,18 @@ extension on _ZetaSlidableActionType { if (pale) { switch (this) { case _ZetaSlidableActionType.menuMore: - return colors.surface.info; + return colors.surfaceInfo; case _ZetaSlidableActionType.call: - return colors.surface.positive; + return colors.surfacePositive; case _ZetaSlidableActionType.ptt: - return colors.surface.primary; + return colors.surfacePrimary; case _ZetaSlidableActionType.delete: - return colors.surface.negative; + return colors.surfaceNegative; case _ZetaSlidableActionType.custom: - return colors.surface.primary; + return colors.surfacePrimary; } } else { - return colors.surface.defaultColor; + return colors.surfaceDefault; } } } @@ -529,7 +529,7 @@ class ZetaSlidableAction extends StatelessWidget { final Color foregroundColor = customForegroundColor ?? (color != null ? paleColor - ? Zeta.of(context).colors.surface.defaultColor + ? Zeta.of(context).colors.surfaceDefault : color!.shade10 : _type.getForegroundColor(context, pale: paleColor)); diff --git a/lib/src/components/checkbox/checkbox.dart b/lib/src/components/checkbox/checkbox.dart index 00237b0c..55f96721 100644 --- a/lib/src/components/checkbox/checkbox.dart +++ b/lib/src/components/checkbox/checkbox.dart @@ -219,7 +219,7 @@ class _CheckboxState extends State { ? const Nothing() : ZetaIcon( widget.useIndeterminate ? ZetaIcons.remove : ZetaIcons.check_mark, - color: widget.disabled ? theme.colors.main.disabled : theme.colors.main.inverse, + color: widget.disabled ? theme.colors.mainDisabled : theme.colors.mainInverse, size: 14, // TODO(UX-1202): ZetaSpacingBase ); @@ -235,7 +235,7 @@ class _CheckboxState extends State { BoxShadow( spreadRadius: 2, blurStyle: BlurStyle.solid, - color: theme.colors.border.primary, + color: theme.colors.borderPrimary, ), ], color: _getBackground(theme), @@ -258,11 +258,11 @@ class _CheckboxState extends State { } Color _getBackground(Zeta theme) { - if (widget.disabled) return theme.colors.surface.disabled; - if (!_checked) return theme.colors.surface.defaultColor; - if (_isHovered) return theme.colors.main.defaultColor; + if (widget.disabled) return theme.colors.surfaceDisabled; + if (!_checked) return theme.colors.surfaceDefault; + if (_isHovered) return theme.colors.mainDefault; - return theme.colors.main.primary; + return theme.colors.mainPrimary; } Color _getBorderColor(Zeta theme) { @@ -270,9 +270,9 @@ class _CheckboxState extends State { return _getBackground(theme); } if (_isHovered) { - return theme.colors.border.hover; + return theme.colors.borderHover; } - return theme.colors.main.subtle; + return theme.colors.mainSubtle; } } diff --git a/lib/src/components/chips/chip.dart b/lib/src/components/chips/chip.dart index bfeaad0d..c9fdf159 100644 --- a/lib/src/components/chips/chip.dart +++ b/lib/src/components/chips/chip.dart @@ -120,7 +120,7 @@ class _ZetaChipState extends State { @override Widget build(BuildContext context) { final colors = Zeta.of(context).colors; - final foregroundColor = selected ? colors.main.inverse : colors.main.defaultColor; + final foregroundColor = selected ? colors.mainInverse : colors.mainDefault; return ZetaRoundedScope( rounded: context.rounded, @@ -204,28 +204,26 @@ class _ZetaChipState extends State { decoration: BoxDecoration( color: () { if (states.contains(WidgetState.disabled)) { - return colors.surface.disabled; + return colors.surfaceDisabled; } if (selected) { if (states.contains(WidgetState.hovered)) { - return colors.border.hover; + return colors.borderHover; } - return colors.surface.defaultInverse; + return colors.surfaceDefaultInverse; } if (states.contains(WidgetState.pressed) || isDragging) { - return colors.surface.selected; + return colors.surfaceSelected; } if (states.contains(WidgetState.hovered)) { - return colors.surface.hover; + return colors.surfaceHover; } - return colors.surface.defaultColor; + return colors.surfaceDefault; }(), borderRadius: rounded ? Zeta.of(context).radius.full : Zeta.of(context).radius.none, border: Border.fromBorderSide( BorderSide( - color: _controller.value.contains(WidgetState.focused) - ? colors.border.primary - : colors.border.defaultColor, + color: _controller.value.contains(WidgetState.focused) ? colors.borderPrimary : colors.borderDefault, width: _controller.value.contains(WidgetState.focused) ? ZetaBorders.medium : !selected @@ -244,7 +242,7 @@ class _ZetaChipState extends State { child: (selected ? ZetaIcon( ZetaIcons.check_mark, - color: widget.selected! ? colors.main.inverse : Colors.transparent, + color: widget.selected! ? colors.mainInverse : Colors.transparent, ) : const Nothing()), ) diff --git a/lib/src/components/contact_item/contact_item.dart b/lib/src/components/contact_item/contact_item.dart index c04864cc..452eb06d 100644 --- a/lib/src/components/contact_item/contact_item.dart +++ b/lib/src/components/contact_item/contact_item.dart @@ -45,10 +45,10 @@ class ZetaContactItem extends ZetaStatelessWidget { button: true, child: SelectionContainer.disabled( child: Material( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, child: DecoratedBox( decoration: BoxDecoration( - border: enabledDivider ? Border(bottom: BorderSide(color: colors.border.disabled)) : null, + border: enabledDivider ? Border(bottom: BorderSide(color: colors.borderDisabled)) : null, ), child: InkWell( onTap: onTap, @@ -72,7 +72,7 @@ class ZetaContactItem extends ZetaStatelessWidget { children: [ DefaultTextStyle( style: ZetaTextStyles.bodyMedium.copyWith( - color: colors.main.defaultColor, + color: colors.mainDefault, ), maxLines: 1, overflow: TextOverflow.ellipsis, @@ -80,7 +80,7 @@ class ZetaContactItem extends ZetaStatelessWidget { ), DefaultTextStyle( style: ZetaTextStyles.bodySmall.copyWith( - color: colors.main.subtle, + color: colors.mainSubtle, ), maxLines: 1, overflow: TextOverflow.ellipsis, diff --git a/lib/src/components/date_input/date_input.dart b/lib/src/components/date_input/date_input.dart index a71e95b1..73b60599 100644 --- a/lib/src/components/date_input/date_input.dart +++ b/lib/src/components/date_input/date_input.dart @@ -65,7 +65,7 @@ class ZetaDateInput extends ZetaFormField { onTap: state.clear, disabled: disabled, size: size, - color: colors.main.subtle, + color: colors.mainSubtle, semanticLabel: clearSemanticLabel, ), InputIconButton( @@ -73,7 +73,7 @@ class ZetaDateInput extends ZetaFormField { onTap: state.pickDate, disabled: disabled, size: size, - color: colors.main.defaultColor, + color: colors.mainDefault, semanticLabel: datePickerSemanticLabel, ), ], @@ -233,14 +233,14 @@ class _ZetaDateInputState extends FormFieldState { builder: (BuildContext context, Widget? child) { return Theme( data: Theme.of(context).copyWith( - dividerTheme: DividerThemeData(color: colors.border.subtle), + dividerTheme: DividerThemeData(color: colors.borderSubtle), datePickerTheme: DatePickerThemeData( shape: RoundedRectangleBorder( borderRadius: rounded ? Zeta.of(context).radius.rounded : Zeta.of(context).radius.none, ), headerHeadlineStyle: ZetaTextStyles.titleLarge, headerHelpStyle: ZetaTextStyles.labelLarge, - dividerColor: colors.border.subtle, + dividerColor: colors.borderSubtle, dayStyle: ZetaTextStyles.bodyMedium, ), ), diff --git a/lib/src/components/dial_pad/dial_pad.dart b/lib/src/components/dial_pad/dial_pad.dart index 199b609f..c0245ef8 100644 --- a/lib/src/components/dial_pad/dial_pad.dart +++ b/lib/src/components/dial_pad/dial_pad.dart @@ -197,7 +197,7 @@ class ZetaDialPadButton extends StatelessWidget { height: Zeta.of(context).spacing.xl_9, decoration: ShapeDecoration( shape: const CircleBorder(), - color: colors.surface.warm, + color: colors.surfaceWarm, shadows: [BoxShadow(color: Colors.black.withOpacity(0.15), blurRadius: 4, offset: const Offset(0, 2))], ), child: Material( @@ -207,10 +207,10 @@ class ZetaDialPadButton extends StatelessWidget { borderRadius: Zeta.of(context).radius.full, overlayColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.pressed)) { - return colors.surface.selectedHover; + return colors.surfaceSelectedHover; } if (states.contains(WidgetState.hovered)) { - return colors.surface.hover; + return colors.surfaceHover; } return null; }), diff --git a/lib/src/components/dialog/dialog.dart b/lib/src/components/dialog/dialog.dart index 1efa8c1a..b985439b 100644 --- a/lib/src/components/dialog/dialog.dart +++ b/lib/src/components/dialog/dialog.dart @@ -99,7 +99,7 @@ class _ZetaDialog extends ZetaStatelessWidget { return ZetaRoundedScope( rounded: context.rounded, child: AlertDialog( - surfaceTintColor: zeta.colors.surface.defaultColor, + surfaceTintColor: zeta.colors.surfaceDefault, shape: RoundedRectangleBorder(borderRadius: Zeta.of(context).radius.large), title: icon != null || title != null ? Column( @@ -133,7 +133,7 @@ class _ZetaDialog extends ZetaStatelessWidget { top: Zeta.of(context).spacing.xl_2, ), titleTextStyle: zetaTextTheme.headlineSmall?.copyWith( - color: zeta.colors.main.defaultColor, + color: zeta.colors.mainDefault, ), content: Text(message), contentPadding: context.deviceType == DeviceType.mobilePortrait @@ -145,8 +145,8 @@ class _ZetaDialog extends ZetaStatelessWidget { bottom: Zeta.of(context).spacing.xl_2, ), contentTextStyle: context.deviceType == DeviceType.mobilePortrait - ? zetaTextTheme.bodySmall?.copyWith(color: zeta.colors.main.defaultColor) - : zetaTextTheme.bodyMedium?.copyWith(color: zeta.colors.main.defaultColor), + ? zetaTextTheme.bodySmall?.copyWith(color: zeta.colors.mainDefault) + : zetaTextTheme.bodyMedium?.copyWith(color: zeta.colors.mainDefault), actions: [ if (context.deviceType == DeviceType.mobilePortrait) Column( diff --git a/lib/src/components/dropdown/dropdown.dart b/lib/src/components/dropdown/dropdown.dart index 39606696..85edcdaa 100644 --- a/lib/src/components/dropdown/dropdown.dart +++ b/lib/src/components/dropdown/dropdown.dart @@ -488,7 +488,7 @@ class _DropdownItemState extends State<_DropdownItem> { Expanded( child: Text( widget.value.label, - style: ZetaTextStyles.bodyMedium.copyWith(color: colors.main.defaultColor, height: 1.5), + style: ZetaTextStyles.bodyMedium.copyWith(color: colors.mainDefault, height: 1.5), ), ), ], @@ -526,25 +526,25 @@ class _DropdownItemState extends State<_DropdownItem> { return ButtonStyle( backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.surface.disabled; + return colors.surfaceDisabled; } if (widget.selected) { - return colors.surface.selected; + return colors.surfaceSelected; } if (states.contains(WidgetState.pressed)) { - return colors.surface.selectedHover; + return colors.surfaceSelectedHover; } if (states.contains(WidgetState.hovered)) { - return colors.surface.hover; + return colors.surfaceHover; } - return colors.surface.defaultColor; + return colors.surfaceDefault; }), foregroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.main.disabled; + return colors.mainDisabled; } - return colors.main.defaultColor; + return colors.mainDefault; }), shape: WidgetStateProperty.all( RoundedRectangleBorder( @@ -553,7 +553,7 @@ class _DropdownItemState extends State<_DropdownItem> { ), side: WidgetStateBorderSide.resolveWith((states) { if (states.contains(WidgetState.focused)) { - return BorderSide(color: colors.border.primary, width: Zeta.of(context).spacing.xl); + return BorderSide(color: colors.borderPrimary, width: Zeta.of(context).spacing.xl); } return BorderSide.none; }), @@ -624,7 +624,7 @@ class _ZetaDropDownMenuState extends State<_ZetaDropDownMenu> { return Container( padding: EdgeInsets.all(Zeta.of(context).spacing.medium), decoration: BoxDecoration( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, borderRadius: context.rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, boxShadow: const [ BoxShadow(blurRadius: 2, color: Color.fromRGBO(40, 51, 61, 0.04)), diff --git a/lib/src/components/fabs/fab.dart b/lib/src/components/fabs/fab.dart index bc191b4a..a303db54 100644 --- a/lib/src/components/fabs/fab.dart +++ b/lib/src/components/fabs/fab.dart @@ -126,7 +126,7 @@ class _ZetaFABState extends State { ), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return colors.state.disabled.disabled; + return colors.stateDisabledDisabled; } if (states.contains(WidgetState.pressed)) { return backgroundColorSelected; @@ -140,7 +140,7 @@ class _ZetaFABState extends State { (Set states) { if (states.contains(WidgetState.focused)) { // TODO(UX-1134): This removes a defualt border when focused, rather than adding a second border when focused. - return BorderSide(color: Zeta.of(context).colors.border.primary, width: ZetaBorders.medium); + return BorderSide(color: Zeta.of(context).colors.borderPrimary, width: ZetaBorders.medium); } return null; }, @@ -180,43 +180,43 @@ extension on ZetaFabType { Color backgroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaFabType.primary: - return colors.state.primary.enabled; + return colors.statePrimaryEnabled; case ZetaFabType.secondary: - return colors.state.secondary.enabled; + return colors.stateSecondaryEnabled; case ZetaFabType.inverse: - return colors.state.inverse.enabled; + return colors.stateInverseEnabled; } } Color foregroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaFabType.secondary: - return colors.main.defaultColor; + return colors.mainDefault; case ZetaFabType.primary: case ZetaFabType.inverse: - return colors.main.inverse; + return colors.mainInverse; } } Color hoverColor(ZetaColorSemantics colors) { switch (this) { case ZetaFabType.primary: - return colors.state.primary.hover; + return colors.statePrimaryHover; case ZetaFabType.secondary: - return colors.state.secondary.hover; + return colors.stateSecondaryHover; case ZetaFabType.inverse: - return colors.state.inverse.hover; + return colors.stateInverseHover; } } Color selectedColor(ZetaColorSemantics colors) { switch (this) { case ZetaFabType.primary: - return colors.state.primary.selected; + return colors.statePrimarySelected; case ZetaFabType.secondary: - return colors.state.secondary.selected; + return colors.stateSecondarySelected; case ZetaFabType.inverse: - return colors.state.inverse.selected; + return colors.stateInverseSelected; } } } diff --git a/lib/src/components/filter_selection/filter_selection.dart b/lib/src/components/filter_selection/filter_selection.dart index d3e93ade..34e0a477 100644 --- a/lib/src/components/filter_selection/filter_selection.dart +++ b/lib/src/components/filter_selection/filter_selection.dart @@ -45,7 +45,7 @@ class ZetaFilterSelection extends ZetaStatelessWidget { enabled: onPressed != null, child: Container( height: Zeta.of(context).spacing.xl_7, - color: Zeta.of(context).colors.surface.defaultColor, + color: Zeta.of(context).colors.surfaceDefault, child: IconButton( visualDensity: VisualDensity.compact, onPressed: onPressed, diff --git a/lib/src/components/global_header/global_header.dart b/lib/src/components/global_header/global_header.dart index 58449708..895330f1 100644 --- a/lib/src/components/global_header/global_header.dart +++ b/lib/src/components/global_header/global_header.dart @@ -80,7 +80,7 @@ class _GlobalHeaderState extends State { vertical: Zeta.of(context).spacing.medium, horizontal: Zeta.of(context).spacing.large, ), - decoration: BoxDecoration(color: colors.surface.defaultColor), + decoration: BoxDecoration(color: colors.surfaceDefault), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -113,7 +113,7 @@ class _GlobalHeaderState extends State { ), if (widget.onAppsButton != null) ...[ Container( - color: colors.border.defaultColor, + color: colors.borderDefault, width: 1, height: Zeta.of(context).spacing.xl_2, margin: EdgeInsets.symmetric(horizontal: Zeta.of(context).spacing.minimum), diff --git a/lib/src/components/global_header/header_tab_item.dart b/lib/src/components/global_header/header_tab_item.dart index 1e2716c3..f6429f93 100644 --- a/lib/src/components/global_header/header_tab_item.dart +++ b/lib/src/components/global_header/header_tab_item.dart @@ -61,7 +61,7 @@ class _ZetaGlobalHeaderItemState extends State { Widget build(BuildContext context) { final colors = Zeta.of(context).colors; - final foregroundColor = widget.active! ? colors.main.primary : colors.main.subtle; + final foregroundColor = widget.active! ? colors.mainPrimary : colors.mainSubtle; return ZetaRoundedScope( rounded: context.rounded, diff --git a/lib/src/components/in_page_banner/in_page_banner.dart b/lib/src/components/in_page_banner/in_page_banner.dart index 7163a35d..2a64d242 100644 --- a/lib/src/components/in_page_banner/in_page_banner.dart +++ b/lib/src/components/in_page_banner/in_page_banner.dart @@ -88,7 +88,7 @@ class ZetaInPageBanner extends ZetaStatelessWidget { style: ZetaTextStyles.labelLarge.copyWith(height: 20 / 16), ).paddingBottom(Zeta.of(context).spacing.minimum), DefaultTextStyle( - style: ZetaTextStyles.bodySmall.apply(color: theme.colors.main.defaultColor), + style: ZetaTextStyles.bodySmall.apply(color: theme.colors.mainDefault), child: content, ), if (actions.isNotEmpty) @@ -154,15 +154,15 @@ extension on ZetaWidgetStatus { Color backgroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.surface.infoSubtle; + return colors.surfaceInfoSubtle; case ZetaWidgetStatus.positive: - return colors.surface.positiveSubtle; + return colors.surfacePositiveSubtle; case ZetaWidgetStatus.warning: - return colors.surface.warningSubtle; + return colors.surfaceWarningSubtle; case ZetaWidgetStatus.negative: - return colors.surface.negativeSubtle; + return colors.surfaceNegativeSubtle; case ZetaWidgetStatus.neutral: - return colors.surface.defaultColor; + return colors.surfaceDefault; } } @@ -170,15 +170,15 @@ extension on ZetaWidgetStatus { Color foregroundColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.main.info; + return colors.mainInfo; case ZetaWidgetStatus.positive: - return colors.main.positive; + return colors.mainPositive; case ZetaWidgetStatus.warning: - return colors.main.warning; + return colors.mainWarning; case ZetaWidgetStatus.negative: - return colors.main.negative; + return colors.mainNegative; case ZetaWidgetStatus.neutral: - return colors.main.defaultColor; + return colors.mainDefault; } } @@ -186,15 +186,15 @@ extension on ZetaWidgetStatus { Color borderColor(ZetaColorSemantics colors) { switch (this) { case ZetaWidgetStatus.info: - return colors.border.info; + return colors.borderInfo; case ZetaWidgetStatus.positive: - return colors.border.positive; + return colors.borderPositive; case ZetaWidgetStatus.warning: - return colors.border.warning; + return colors.borderWarning; case ZetaWidgetStatus.negative: - return colors.border.negative; + return colors.borderNegative; case ZetaWidgetStatus.neutral: - return colors.border.defaultColor; + return colors.borderDefault; } } } diff --git a/lib/src/components/list_item/dropdown_list_item.dart b/lib/src/components/list_item/dropdown_list_item.dart index 59f63845..6bace75b 100644 --- a/lib/src/components/list_item/dropdown_list_item.dart +++ b/lib/src/components/list_item/dropdown_list_item.dart @@ -128,7 +128,7 @@ class _ZetaDropdownListItemState extends State with Single decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: divide ? colors.border.defaultColor : Colors.transparent, + color: divide ? colors.borderDefault : Colors.transparent, ), ), ), @@ -147,7 +147,7 @@ class _ZetaDropdownListItemState extends State with Single duration: ZetaAnimationLength.fast, child: ZetaIcon( ZetaIcons.expand_more, - color: colors.main.subtle, + color: colors.mainSubtle, ), ), onPressed: _onTap, diff --git a/lib/src/components/list_item/list_item.dart b/lib/src/components/list_item/list_item.dart index 5410e3b5..7beb9973 100644 --- a/lib/src/components/list_item/list_item.dart +++ b/lib/src/components/list_item/list_item.dart @@ -169,7 +169,7 @@ class ZetaListItem extends ZetaStatelessWidget { return SelectionContainer.disabled( child: MergeSemantics( child: Material( - color: Zeta.of(context).colors.surface.defaultColor, + color: Zeta.of(context).colors.surfaceDefault, child: InkWell( onTap: onTap, excludeFromSemantics: true, @@ -178,7 +178,7 @@ class ZetaListItem extends ZetaStatelessWidget { decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: divide ? colors.border.defaultColor : Colors.transparent, + color: divide ? colors.borderDefault : Colors.transparent, ), ), ), diff --git a/lib/src/components/list_item/notification_list_item.dart b/lib/src/components/list_item/notification_list_item.dart index 0608dfc6..786cc70b 100644 --- a/lib/src/components/list_item/notification_list_item.dart +++ b/lib/src/components/list_item/notification_list_item.dart @@ -89,7 +89,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { children: [ if (!notificationRead) ZetaIndicator( - color: colors.main.primary, + color: colors.mainPrimary, size: ZetaWidgetSize.small, ), Text( @@ -104,17 +104,17 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { if (notificationTime != null) Text( notificationTime!, - style: ZetaTextStyles.bodySmall.apply(color: colors.main.disabled), + style: ZetaTextStyles.bodySmall.apply(color: colors.mainDisabled), ), Container( padding: const EdgeInsets.all(2), decoration: BoxDecoration( - color: colors.surface.negative, + color: colors.surfaceNegative, borderRadius: Zeta.of(context).radius.full, ), child: ZetaIcon( ZetaIcons.important_notification, - color: colors.main.inverse, + color: colors.mainInverse, size: Zeta.of(context).spacing.medium, ), ), @@ -140,10 +140,10 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { final colors = Zeta.of(context).colors; return BoxDecoration( - color: notificationRead ? colors.surface.primary : colors.surface.selected, + color: notificationRead ? colors.surfacePrimary : colors.surfaceSelected, borderRadius: Zeta.of(context).radius.rounded, border: (showDivider ?? false) - ? Border(bottom: BorderSide(width: Zeta.of(context).spacing.minimum, color: colors.main.primary)) + ? Border(bottom: BorderSide(width: Zeta.of(context).spacing.minimum, color: colors.mainPrimary)) : null, ); } diff --git a/lib/src/components/navigation bar/navigation_bar.dart b/lib/src/components/navigation bar/navigation_bar.dart index 5809fefd..849e9dd9 100644 --- a/lib/src/components/navigation bar/navigation_bar.dart +++ b/lib/src/components/navigation bar/navigation_bar.dart @@ -142,7 +142,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { _generateNavigationItemRow(leftItems, context), if (dividerIndex != null) Container( - color: colors.border.subtle, + color: colors.borderSubtle, width: _navigationItemBorderWidth, height: Zeta.of(context).spacing.xl_7, ), @@ -164,8 +164,8 @@ class ZetaNavigationBar extends ZetaStatelessWidget { return Container( padding: EdgeInsets.symmetric(horizontal: Zeta.of(context).spacing.medium), decoration: BoxDecoration( - color: colors.surface.defaultColor, - border: Border(top: BorderSide(color: colors.border.subtle)), + color: colors.surfaceDefault, + border: Border(top: BorderSide(color: colors.borderSubtle)), ), child: Semantics( child: child, @@ -206,7 +206,7 @@ class _NavigationItem extends ZetaStatelessWidget { right: Zeta.of(context).spacing.minimum, child: DecoratedBox( decoration: BoxDecoration( - color: colors.surface.primary, + color: colors.surfacePrimary, borderRadius: Zeta.of(context).radius.full, ), child: item.badge?.copyWith( @@ -224,10 +224,10 @@ class _NavigationItem extends ZetaStatelessWidget { @override Widget build(BuildContext context) { final colors = Zeta.of(context).colors; - final elementColor = selected ? colors.surface.primary : colors.main.subtle; + final elementColor = selected ? colors.surfacePrimary : colors.mainSubtle; return Material( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, child: InkWell( borderRadius: context.rounded ? Zeta.of(context).radius.rounded : Zeta.of(context).radius.none, onTap: onTap, diff --git a/lib/src/components/navigation_rail/navigation_rail.dart b/lib/src/components/navigation_rail/navigation_rail.dart index 1f10da35..ff9bb193 100644 --- a/lib/src/components/navigation_rail/navigation_rail.dart +++ b/lib/src/components/navigation_rail/navigation_rail.dart @@ -145,10 +145,10 @@ class _ZetaNavigationRailItemContent extends ZetaStatelessWidget { final zeta = Zeta.of(context); final Color foregroundColor = disabled - ? zeta.colors.main.disabled + ? zeta.colors.mainDisabled : selected - ? zeta.colors.main.defaultColor - : zeta.colors.main.subtle; + ? zeta.colors.mainDefault + : zeta.colors.mainSubtle; return Semantics( button: true, enabled: !disabled, @@ -162,7 +162,7 @@ class _ZetaNavigationRailItemContent extends ZetaStatelessWidget { color: disabled ? null : selected - ? zeta.colors.state.defaultColor.selected + ? zeta.colors.stateDefaultSelected : null, borderRadius: context.rounded ? Zeta.of(context).radius.rounded : null, ), diff --git a/lib/src/components/pagination/pagination.dart b/lib/src/components/pagination/pagination.dart index 34bd0163..047adbdf 100644 --- a/lib/src/components/pagination/pagination.dart +++ b/lib/src/components/pagination/pagination.dart @@ -217,7 +217,7 @@ class _ZetaPaginationState extends State { height: Zeta.of(context).spacing.xl_6, decoration: BoxDecoration( - border: Border.all(color: colors.border.subtle), + border: Border.all(color: colors.borderSubtle), borderRadius: rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, ), // TODO(UX-1135): Replace with Zeta Dropdown @@ -228,7 +228,7 @@ class _ZetaPaginationState extends State { icon: const ZetaIcon(ZetaIcons.expand_more).paddingStart(Zeta.of(context).spacing.small), underline: const Nothing(), style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: colors.main.subtle, + color: colors.mainSubtle, ), padding: EdgeInsets.symmetric( horizontal: Zeta.of(context).spacing.medium, @@ -318,16 +318,16 @@ class _PaginationItem extends ZetaStatelessWidget { maxLines: 1, style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: disabled - ? colors.main.disabled + ? colors.mainDisabled : selected - ? colors.main.inverse - : colors.main.defaultColor, + ? colors.mainInverse + : colors.mainDefault, ), ); } else if (icon != null) { child = ZetaIcon( icon, - color: disabled ? colors.main.disabled : colors.main.defaultColor, + color: disabled ? colors.mainDisabled : colors.mainDefault, semanticLabel: semanticLabel, ); } @@ -347,14 +347,14 @@ class _PaginationItem extends ZetaStatelessWidget { child: Material( borderRadius: rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, color: disabled - ? colors.state.disabled.disabled + ? colors.stateDisabledDisabled : selected - ? colors.state.inverse.selected - : colors.state.defaultColor.enabled, + ? colors.stateInverseSelected + : colors.stateDefaultEnabled, child: InkWell( onTap: disabled ? null : onPressed, borderRadius: rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, - hoverColor: selected ? colors.state.inverse.hover : colors.state.defaultColor.hover, + hoverColor: selected ? colors.stateInverseHover : colors.stateDefaultHover, enableFeedback: false, child: Container( alignment: Alignment.center, diff --git a/lib/src/components/phone_input/phone_input.dart b/lib/src/components/phone_input/phone_input.dart index b401b1f7..4e6764bf 100644 --- a/lib/src/components/phone_input/phone_input.dart +++ b/lib/src/components/phone_input/phone_input.dart @@ -89,7 +89,7 @@ class ZetaPhoneInput extends ZetaFormField { items: state._dropdownItems, builder: (context, selectedItem, dropdowncontroller) { final borderSide = BorderSide( - color: disabled ? colors.border.defaultColor : colors.border.subtle, + color: disabled ? colors.borderDefault : colors.borderSubtle, ); return GestureDetector( @@ -110,7 +110,7 @@ class ZetaPhoneInput extends ZetaFormField { top: borderSide, bottom: borderSide, ), - color: disabled ? colors.surface.disabled : colors.surface.defaultColor, + color: disabled ? colors.surfaceDisabled : colors.surfaceDefault, ), child: Column( children: [ @@ -128,7 +128,7 @@ class ZetaPhoneInput extends ZetaFormField { ), ZetaIcon( !dropdowncontroller.isOpen ? ZetaIcons.expand_more : ZetaIcons.expand_less, - color: !disabled ? colors.main.defaultColor : colors.main.disabled, + color: !disabled ? colors.mainDefault : colors.mainDisabled, size: Zeta.of(context).spacing.xl, ), ], diff --git a/lib/src/components/progress/progress_bar.dart b/lib/src/components/progress/progress_bar.dart index ba6a8bd7..cc83675e 100644 --- a/lib/src/components/progress/progress_bar.dart +++ b/lib/src/components/progress/progress_bar.dart @@ -118,7 +118,7 @@ class _ZetaProgressBarState extends ZetaProgressState { borderRadius: context.rounded ? Zeta.of(context).radius.rounded : Zeta.of(context).radius.none, value: widget.type == ZetaProgressBarType.indeterminate ? null : animation.value, backgroundColor: - widget.type == ZetaProgressBarType.buffering ? colors.surface.disabled : Colors.transparent, + widget.type == ZetaProgressBarType.buffering ? colors.surfaceDisabled : Colors.transparent, ), ), ), @@ -142,7 +142,7 @@ class _ZetaProgressBarState extends ZetaProgressState { width: _weight, height: _weight, decoration: BoxDecoration( - color: colors.surface.disabled, + color: colors.surfaceDisabled, borderRadius: Zeta.of(context).radius.rounded, ), ), diff --git a/lib/src/components/progress/progress_circle.dart b/lib/src/components/progress/progress_circle.dart index 830afebb..6dbd1b23 100644 --- a/lib/src/components/progress/progress_circle.dart +++ b/lib/src/components/progress/progress_circle.dart @@ -126,7 +126,7 @@ class _ZetaProgressCircleState extends ZetaProgressState { borderRadius: Zeta.of(context).radius.full, child: Container( decoration: BoxDecoration( - color: colors.surface.hover, + color: colors.surfaceHover, borderRadius: Zeta.of(context).radius.full, ), padding: EdgeInsets.all(Zeta.of(context).spacing.small), @@ -200,7 +200,7 @@ class _CirclePainter extends CustomPainter { _paint ..strokeWidth = Zeta.of(context).spacing.minimum ..style = PaintingStyle.stroke - ..color = Zeta.of(context).colors.main.primary; + ..color = Zeta.of(context).colors.mainPrimary; const double fullCircle = 2 * math.pi; diff --git a/lib/src/components/radio/radio.dart b/lib/src/components/radio/radio.dart index 493c23f7..515c84b8 100644 --- a/lib/src/components/radio/radio.dart +++ b/lib/src/components/radio/radio.dart @@ -82,23 +82,23 @@ class _ZetaRadioState extends State> with TickerProviderStateMix ..inactiveReactionColor = Colors.transparent ..reactionColor = Colors.transparent ..hoverColor = Colors.transparent - ..focusColor = zetaColors.main.primary + ..focusColor = zetaColors.mainPrimary ..splashRadius = Zeta.of(context).spacing.medium ..downPosition = downPosition ..isFocused = states.contains(WidgetState.focused) ..isHovered = states.contains(WidgetState.hovered) ..activeColor = states.contains(WidgetState.hovered) - ? zetaColors.border.hover + ? zetaColors.borderHover : states.contains(WidgetState.disabled) - ? zetaColors.surface.disabled - : zetaColors.main.primary + ? zetaColors.surfaceDisabled + : zetaColors.mainPrimary ..inactiveColor = states.contains(WidgetState.hovered) - ? zetaColors.border.hover + ? zetaColors.borderHover : states.contains(WidgetState.disabled) - ? zetaColors.main.disabled + ? zetaColors.mainDisabled : states.contains(WidgetState.focused) - ? zetaColors.border.primary - : zetaColors.main.subtle, + ? zetaColors.borderPrimary + : zetaColors.mainSubtle, mouseCursor: WidgetStateProperty.all( states.contains(WidgetState.disabled) ? SystemMouseCursors.forbidden : SystemMouseCursors.click, ), @@ -106,9 +106,8 @@ class _ZetaRadioState extends State> with TickerProviderStateMix if (widget.label != null) DefaultTextStyle( style: ZetaTextStyles.bodyMedium.copyWith( - color: states.contains(WidgetState.disabled) - ? zetaColors.main.disabled - : zetaColors.main.defaultColor, + color: + states.contains(WidgetState.disabled) ? zetaColors.mainDisabled : zetaColors.mainDefault, height: 4 / 3, ), child: widget.label!, @@ -173,7 +172,7 @@ class _RadioPainter extends ToggleablePainter { // Background mask for focus final Paint paint = Paint() - ..color = colors.surface.primary + ..color = colors.surfacePrimary ..style = PaintingStyle.stroke ..strokeWidth = Zeta.of(context).spacing.small + ZetaBorders.medium; if (isFocused) canvas.drawCircle(center, _kInnerRadius, paint); @@ -181,7 +180,7 @@ class _RadioPainter extends ToggleablePainter { // Outer circle paint ..color = isHovered - ? colors.border.hover + ? colors.borderHover : position.isDismissed ? inactiveColor : activeColor diff --git a/lib/src/components/search_bar/search_bar.dart b/lib/src/components/search_bar/search_bar.dart index e1ecc2ef..a9a5f371 100644 --- a/lib/src/components/search_bar/search_bar.dart +++ b/lib/src/components/search_bar/search_bar.dart @@ -47,18 +47,18 @@ class ZetaSearchBar extends ZetaTextFormField { final defaultInputBorder = OutlineInputBorder( borderRadius: borderRadius, - borderSide: BorderSide(color: zeta.colors.border.defaultColor), + borderSide: BorderSide(color: zeta.colors.borderDefault), ); final focusedBorder = defaultInputBorder.copyWith( borderSide: BorderSide( - color: zeta.colors.border.primary, + color: zeta.colors.borderPrimary, width: zeta.spacing.minimum, ), ); final disabledborder = defaultInputBorder.copyWith( - borderSide: BorderSide(color: zeta.colors.border.disabled), + borderSide: BorderSide(color: zeta.colors.borderDisabled), ); late final double iconSize; @@ -99,13 +99,13 @@ class ZetaSearchBar extends ZetaTextFormField { ), hintText: hintText ?? 'Search', // TODO(UX-1003): Localize hintStyle: ZetaTextStyles.bodyMedium.copyWith( - color: !disabled ? zeta.colors.main.subtle : zeta.colors.main.disabled, + color: !disabled ? zeta.colors.mainSubtle : zeta.colors.mainDisabled, ), prefixIcon: Padding( padding: EdgeInsets.only(left: zeta.spacing.medium, right: zeta.spacing.small), child: ZetaIcon( ZetaIcons.search, - color: !disabled ? zeta.colors.main.subtle : zeta.colors.main.disabled, + color: !disabled ? zeta.colors.mainSubtle : zeta.colors.mainDisabled, size: iconSize, ), ), @@ -128,7 +128,7 @@ class ZetaSearchBar extends ZetaTextFormField { onTap: () => state.onChange(''), disabled: disabled, size: size, - color: zeta.colors.main.subtle, + color: zeta.colors.mainSubtle, key: const ValueKey('search-clear-btn'), ), ), @@ -136,7 +136,7 @@ class ZetaSearchBar extends ZetaTextFormField { SizedBox( height: iconSize, child: VerticalDivider( - color: zeta.colors.main.subtle, + color: zeta.colors.mainSubtle, width: 5, thickness: 1, ), @@ -154,7 +154,7 @@ class ZetaSearchBar extends ZetaTextFormField { key: const ValueKey('speech-to-text-btn'), disabled: disabled, size: size, - color: zeta.colors.main.defaultColor, + color: zeta.colors.mainDefault, ), ), ], @@ -165,7 +165,7 @@ class ZetaSearchBar extends ZetaTextFormField { minWidth: zeta.spacing.xl_2, ), filled: !disabled ? null : true, - fillColor: !disabled ? null : zeta.colors.surface.disabled, + fillColor: !disabled ? null : zeta.colors.surfaceDisabled, enabledBorder: defaultInputBorder, focusedBorder: focusedBorder, disabledBorder: disabledborder, diff --git a/lib/src/components/segmented_control/segmented_control.dart b/lib/src/components/segmented_control/segmented_control.dart index 9ba853c6..5b849bac 100644 --- a/lib/src/components/segmented_control/segmented_control.dart +++ b/lib/src/components/segmented_control/segmented_control.dart @@ -140,7 +140,7 @@ class _ZetaSegmentedControlState extends State> child: Container( padding: EdgeInsets.all(Zeta.of(context).spacing.minimum), decoration: BoxDecoration( - color: colors.surface.disabled, + color: colors.surfaceDisabled, borderRadius: rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, ), child: AnimatedBuilder( @@ -148,7 +148,7 @@ class _ZetaSegmentedControlState extends State> builder: (BuildContext context, Widget? child) { return _SegmentedControlRenderWidget( highlightedIndex: highlightedIndex, - thumbColor: colors.surface.defaultColor, + thumbColor: colors.surfaceDefault, thumbScale: _thumbScaleAnimation.value, rounded: rounded, state: this, @@ -228,7 +228,7 @@ class _SegmentState extends State<_Segment> with TickerProviderStateMixin< data: IconThemeData(size: Zeta.of(context).spacing.xl), child: DefaultTextStyle( style: ZetaTextStyles.labelMedium.copyWith( - color: colors.main.defaultColor, + color: colors.mainDefault, ), child: Padding( padding: EdgeInsets.symmetric( diff --git a/lib/src/components/select_input/select_input.dart b/lib/src/components/select_input/select_input.dart index d44f3533..4d9fe513 100644 --- a/lib/src/components/select_input/select_input.dart +++ b/lib/src/components/select_input/select_input.dart @@ -69,7 +69,7 @@ class ZetaSelectInput extends ZetaFormField { icon: controller.isOpen ? ZetaIcons.expand_less : ZetaIcons.expand_more, disabled: disabled, size: size, - color: colors.main.subtle, + color: colors.mainSubtle, onTap: () => state.onIconTapped(controller), ), ); diff --git a/lib/src/components/slider/slider.dart b/lib/src/components/slider/slider.dart index 388bbc44..6288ad9a 100644 --- a/lib/src/components/slider/slider.dart +++ b/lib/src/components/slider/slider.dart @@ -72,18 +72,18 @@ class _ZetaSliderState extends State { /// Active Track activeTrackColor: _activeColor, - disabledActiveTrackColor: colors.surface.disabled, + disabledActiveTrackColor: colors.surfaceDisabled, /// Inactive Track - inactiveTrackColor: colors.surface.infoSubtle, + inactiveTrackColor: colors.surfaceInfoSubtle, /// Ticks - activeTickMarkColor: colors.surface.defaultColor, - inactiveTickMarkColor: colors.surface.defaultColor, + activeTickMarkColor: colors.surfaceDefault, + inactiveTickMarkColor: colors.surfaceDefault, /// Thumb - thumbColor: colors.surface.defaultInverse, - disabledThumbColor: colors.surface.disabled, + thumbColor: colors.surfaceDefaultInverse, + disabledThumbColor: colors.surfaceDisabled, overlayShape: _SliderThumb( size: Zeta.of(context).spacing.xl / 2, rounded: context.rounded, @@ -120,9 +120,9 @@ class _ZetaSliderState extends State { Color get _activeColor { final colors = Zeta.of(context).colors; if (widget.onChange == null) { - return colors.surface.disabled; + return colors.surfaceDisabled; } - return _selected ? colors.main.primary : colors.surface.defaultInverse; + return _selected ? colors.mainPrimary : colors.surfaceDefaultInverse; } } diff --git a/lib/src/components/snack_bar/snack_bar.dart b/lib/src/components/snack_bar/snack_bar.dart index 73107791..e4633750 100644 --- a/lib/src/components/snack_bar/snack_bar.dart +++ b/lib/src/components/snack_bar/snack_bar.dart @@ -132,12 +132,12 @@ class ZetaSnackBar extends SnackBar { final colors = Zeta.of(context).colors; return switch (type) { - ZetaSnackBarType.positive => colors.surface.positiveSubtle, - ZetaSnackBarType.info => colors.surface.infoSubtle, - ZetaSnackBarType.warning => colors.surface.warningSubtle, - ZetaSnackBarType.deletion || ZetaSnackBarType.error => colors.surface.negativeSubtle, - ZetaSnackBarType.view => colors.surface.primarySubtle, - _ => colors.surface.defaultInverse, + ZetaSnackBarType.positive => colors.surfacePositiveSubtle, + ZetaSnackBarType.info => colors.surfaceInfoSubtle, + ZetaSnackBarType.warning => colors.surfaceWarningSubtle, + ZetaSnackBarType.deletion || ZetaSnackBarType.error => colors.surfaceNegativeSubtle, + ZetaSnackBarType.view => colors.surfacePrimarySubtle, + _ => colors.surfaceDefaultInverse, }; } } @@ -167,8 +167,8 @@ class _Content extends StatelessWidget { ZetaSnackBarType.deletion || ZetaSnackBarType.error || ZetaSnackBarType.view => - colors.main.defaultColor, - _ => colors.main.inverse, + colors.mainDefault, + _ => colors.mainInverse, }; } @@ -237,12 +237,12 @@ class _Action extends StatelessWidget { return switch (type) { ZetaSnackBarType.defaultType => _IconButton( onPressed: () => ScaffoldMessenger.of(context).removeCurrentSnackBar(), - color: colors.surface.defaultInverse, + color: colors.surfaceDefaultInverse, ), ZetaSnackBarType.action => _ActionButton( onPressed: onPressed, label: label, - color: colors.border.primaryMain, + color: colors.borderPrimaryMain, ), ZetaSnackBarType.positive || ZetaSnackBarType.info || @@ -250,22 +250,22 @@ class _Action extends StatelessWidget { ZetaSnackBarType.error => _IconButton( onPressed: () => ScaffoldMessenger.of(context).removeCurrentSnackBar(), - color: colors.main.defaultColor, + color: colors.mainDefault, ), ZetaSnackBarType.deletion => _ActionButton( onPressed: onPressed, label: label, - color: colors.main.defaultColor, + color: colors.mainDefault, ), ZetaSnackBarType.view => _ActionButton( onPressed: onPressed, label: label, - color: colors.main.defaultColor, + color: colors.mainDefault, ), _ => _ActionButton( onPressed: onPressed, label: label, - color: colors.border.primaryMain, + color: colors.borderPrimaryMain, ), }; }(), @@ -368,12 +368,12 @@ class _LeadingIcon extends StatelessWidget { Color _getIconColor(ZetaColorSemantics colors, ZetaSnackBarType? type) { return switch (type) { - ZetaSnackBarType.positive => colors.surface.positive, - ZetaSnackBarType.info => colors.surface.info, - ZetaSnackBarType.warning => colors.surface.warning, - ZetaSnackBarType.error || ZetaSnackBarType.deletion => colors.surface.negative, - ZetaSnackBarType.view => colors.main.primary, - _ => colors.main.inverse, + ZetaSnackBarType.positive => colors.surfacePositive, + ZetaSnackBarType.info => colors.surfaceInfo, + ZetaSnackBarType.warning => colors.surfaceWarning, + ZetaSnackBarType.error || ZetaSnackBarType.deletion => colors.surfaceNegative, + ZetaSnackBarType.view => colors.mainPrimary, + _ => colors.mainInverse, }; } diff --git a/lib/src/components/stepper/stepper.dart b/lib/src/components/stepper/stepper.dart index ac978306..0dd50501 100644 --- a/lib/src/components/stepper/stepper.dart +++ b/lib/src/components/stepper/stepper.dart @@ -103,12 +103,12 @@ class _ZetaStepperState extends State with TickerProviderStateMixin child: switch (widget.steps[index].type) { ZetaStepType.complete => ZetaIcon( ZetaIcons.check_mark, - color: _colors.main.inverse, + color: _colors.mainInverse, ), ZetaStepType.enabled || ZetaStepType.disabled => Text( (index + 1).toString(), style: ZetaTextStyles.labelLarge.copyWith( - color: _colors.main.inverse, + color: _colors.mainInverse, ), ), }, @@ -132,12 +132,12 @@ class _ZetaStepperState extends State with TickerProviderStateMixin child: switch (widget.steps[index].type) { ZetaStepType.complete => ZetaIcon( ZetaIcons.check_mark, - color: _colors.main.inverse, + color: _colors.mainInverse, ), ZetaStepType.enabled || ZetaStepType.disabled => Text( (index + 1).toString(), style: ZetaTextStyles.titleLarge.copyWith( - color: _colors.main.inverse, + color: _colors.mainInverse, ), ), }, @@ -154,10 +154,10 @@ class _ZetaStepperState extends State with TickerProviderStateMixin AnimatedDefaultTextStyle( style: switch (widget.steps[index].type) { ZetaStepType.enabled || ZetaStepType.complete => ZetaTextStyles.bodySmall.copyWith( - color: _colors.main.defaultColor, + color: _colors.mainDefault, ), ZetaStepType.disabled => ZetaTextStyles.bodySmall.copyWith( - color: _colors.main.disabled, + color: _colors.mainDisabled, ), }, maxLines: 1, @@ -211,10 +211,10 @@ class _ZetaStepperState extends State with TickerProviderStateMixin AnimatedDefaultTextStyle( style: switch (widget.steps[index].type) { ZetaStepType.enabled || ZetaStepType.complete => ZetaTextStyles.titleLarge.copyWith( - color: _colors.main.defaultColor, + color: _colors.mainDefault, ), ZetaStepType.disabled => ZetaTextStyles.titleLarge.copyWith( - color: _colors.main.disabled, + color: _colors.mainDisabled, ), }, maxLines: 1, @@ -249,9 +249,9 @@ class _ZetaStepperState extends State with TickerProviderStateMixin Color _getColorForType(ZetaStepType type) { return switch (type) { - ZetaStepType.complete => _colors.surface.positive, - ZetaStepType.disabled => _colors.main.disabled, - ZetaStepType.enabled => _colors.main.primary, + ZetaStepType.complete => _colors.surfacePositive, + ZetaStepType.disabled => _colors.mainDisabled, + ZetaStepType.enabled => _colors.mainPrimary, }; } @@ -362,9 +362,9 @@ class _ZetaStepperState extends State with TickerProviderStateMixin Color getLineColor(int index) { return switch (widget.steps[index].type) { - ZetaStepType.complete => _colors.border.positive, - ZetaStepType.disabled => _colors.border.defaultColor, - ZetaStepType.enabled => _colors.border.primary, + ZetaStepType.complete => _colors.borderPositive, + ZetaStepType.disabled => _colors.borderDefault, + ZetaStepType.enabled => _colors.borderPrimary, }; } } diff --git a/lib/src/components/stepper_input/stepper_input.dart b/lib/src/components/stepper_input/stepper_input.dart index 7989f862..3bc140af 100644 --- a/lib/src/components/stepper_input/stepper_input.dart +++ b/lib/src/components/stepper_input/stepper_input.dart @@ -128,7 +128,7 @@ class ZetaStepperInputState extends State { return OutlineInputBorder( borderSide: BorderSide( - color: !disabled ? colors.border.subtle : colors.border.disabled, + color: !disabled ? colors.borderSubtle : colors.borderDisabled, ), borderRadius: context.rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none, ); @@ -197,7 +197,7 @@ class ZetaStepperInputState extends State { textAlign: TextAlign.center, inputFormatters: [FilteringTextInputFormatter.digitsOnly], style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: disabled ? colors.main.disabled : null, + color: disabled ? colors.mainDisabled : null, ), onTapOutside: (_) { if (_controller.text.isEmpty) { @@ -206,7 +206,7 @@ class ZetaStepperInputState extends State { }, decoration: InputDecoration( filled: true, - fillColor: disabled ? colors.surface.disabled : null, + fillColor: disabled ? colors.surfaceDisabled : null, contentPadding: EdgeInsets.zero, constraints: BoxConstraints(maxHeight: _height), border: _border, diff --git a/lib/src/components/switch/zeta_switch.dart b/lib/src/components/switch/zeta_switch.dart index e3952966..6f85ca96 100644 --- a/lib/src/components/switch/zeta_switch.dart +++ b/lib/src/components/switch/zeta_switch.dart @@ -83,15 +83,15 @@ class ZetaSwitch extends StatelessWidget { trackOutlineColor: const WidgetStatePropertyAll(Colors.transparent), trackColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { - return zetaColors.surface.disabled; + return zetaColors.surfaceDisabled; } else if (states.contains(WidgetState.selected)) { - return zetaColors.main.primary; + return zetaColors.mainPrimary; } else { - return zetaColors.main.disabled; + return zetaColors.mainDisabled; } }), thumbColor: WidgetStateProperty.resolveWith( - (states) => states.contains(WidgetState.disabled) ? zetaColors.main.disabled : zetaColors.main.inverse, + (states) => states.contains(WidgetState.disabled) ? zetaColors.mainDisabled : zetaColors.mainInverse, ), value: value ?? false, onChanged: onChanged, diff --git a/lib/src/components/tabs/tab_bar.dart b/lib/src/components/tabs/tab_bar.dart index fe6c1cdc..471db232 100644 --- a/lib/src/components/tabs/tab_bar.dart +++ b/lib/src/components/tabs/tab_bar.dart @@ -21,17 +21,17 @@ class ZetaTabBar extends TabBar { labelPadding: isScrollable ? null : EdgeInsets.zero, indicator: UnderlineTabIndicator( borderSide: BorderSide( - color: Zeta.of(context).colors.main.primary, + color: Zeta.of(context).colors.mainPrimary, width: onTap != null ? Zeta.of(context).spacing.minimum : Zeta.of(context).spacing.none, ), borderRadius: Zeta.of(context).radius.none, ), splashFactory: null, labelStyle: ZetaTextStyles.labelLarge.copyWith( - color: onTap != null ? Zeta.of(context).colors.main.defaultColor : Zeta.of(context).colors.main.disabled, + color: onTap != null ? Zeta.of(context).colors.mainDefault : Zeta.of(context).colors.mainDisabled, ), unselectedLabelStyle: ZetaTextStyles.labelLarge.copyWith( - color: onTap != null ? Zeta.of(context).colors.main.subtle : Zeta.of(context).colors.main.disabled, + color: onTap != null ? Zeta.of(context).colors.mainSubtle : Zeta.of(context).colors.mainDisabled, ), ); } diff --git a/lib/src/components/text_input/hint_text.dart b/lib/src/components/text_input/hint_text.dart index 84ad9b8c..d7596725 100644 --- a/lib/src/components/text_input/hint_text.dart +++ b/lib/src/components/text_input/hint_text.dart @@ -30,12 +30,12 @@ class ZetaHintText extends ZetaStatelessWidget { final text = error && !disabled ? errorText : hintText; - Color elementColor = colors.main.subtle; + Color elementColor = colors.mainSubtle; if (disabled) { - elementColor = colors.main.disabled; + elementColor = colors.mainDisabled; } else if (error) { - elementColor = colors.main.negative; + elementColor = colors.mainNegative; } if (text == null || text.isEmpty) { diff --git a/lib/src/components/text_input/input_label.dart b/lib/src/components/text_input/input_label.dart index 1508f36d..79e62a58 100644 --- a/lib/src/components/text_input/input_label.dart +++ b/lib/src/components/text_input/input_label.dart @@ -35,13 +35,13 @@ class ZetaInputLabel extends ZetaStatelessWidget { if (requirementLevel == ZetaFormFieldRequirement.optional) { requirementWidget = Text( '(optional)', // TODO(UX-1003): needs localizing. - style: textStyle.copyWith(color: disabled ? colors.main.disabled : colors.main.subtle), + style: textStyle.copyWith(color: disabled ? colors.mainDisabled : colors.mainSubtle), ); } else if (requirementLevel == ZetaFormFieldRequirement.mandatory) { requirementWidget = Text( '*', style: ZetaTextStyles.labelIndicator.copyWith( - color: disabled ? colors.main.disabled : colors.main.negative, + color: disabled ? colors.mainDisabled : colors.mainNegative, ), ); } @@ -51,7 +51,7 @@ class ZetaInputLabel extends ZetaStatelessWidget { Text( label, style: textStyle.copyWith( - color: disabled ? colors.main.disabled : colors.main.defaultColor, + color: disabled ? colors.mainDisabled : colors.mainDefault, ), ), if (requirementWidget != null) requirementWidget.paddingStart(Zeta.of(context).spacing.minimum), diff --git a/lib/src/components/text_input/internal_text_input.dart b/lib/src/components/text_input/internal_text_input.dart index 09a60720..015f047b 100644 --- a/lib/src/components/text_input/internal_text_input.dart +++ b/lib/src/components/text_input/internal_text_input.dart @@ -170,12 +170,12 @@ class InternalTextInputState extends State { Color get _backgroundColor { if (widget.disabled) { - return _colors.surface.disabled; + return _colors.surfaceDisabled; } if (widget.errorText != null) { - return _colors.surface.negativeSubtle; + return _colors.surfaceNegativeSubtle; } - return _colors.surface.defaultColor; + return _colors.surfaceDefault; } TextStyle get _baseTextStyle { @@ -203,9 +203,9 @@ class InternalTextInputState extends State { } TextStyle get _affixStyle { - Color color = _colors.main.subtle; + Color color = _colors.mainSubtle; if (widget.disabled) { - color = _colors.main.disabled; + color = _colors.mainDisabled; } return _baseTextStyle.copyWith(color: color); } @@ -272,17 +272,15 @@ class InternalTextInputState extends State { OutlineInputBorder _baseBorder(bool rounded) => OutlineInputBorder( borderRadius: widget.borderRadius ?? (rounded ? Zeta.of(context).radius.minimal : Zeta.of(context).radius.none), borderSide: BorderSide( - color: !widget.disabled - ? (_hovered ? _colors.border.selected : _colors.border.subtle) - : _colors.border.defaultColor, + color: !widget.disabled ? (_hovered ? _colors.borderSelected : _colors.borderSubtle) : _colors.borderDefault, ), ); OutlineInputBorder _focusedBorder(bool rounded) => _baseBorder(rounded).copyWith( - borderSide: BorderSide(color: _colors.border.primary, width: ZetaBorders.medium), + borderSide: BorderSide(color: _colors.borderPrimary, width: ZetaBorders.medium), ); OutlineInputBorder _errorBorder(bool rounded) => _baseBorder(rounded).copyWith( - borderSide: BorderSide(color: _colors.border.negative, width: ZetaBorders.medium), + borderSide: BorderSide(color: _colors.borderNegative, width: ZetaBorders.medium), ); @override @@ -338,7 +336,7 @@ class InternalTextInputState extends State { onChanged: widget.onChange, onSubmitted: widget.onSubmit, style: _baseTextStyle, - cursorErrorColor: _colors.main.negative, + cursorErrorColor: _colors.mainNegative, obscureText: widget.obscureText, focusNode: widget.focusNode, decoration: InputDecoration( diff --git a/lib/src/components/time_input/time_input.dart b/lib/src/components/time_input/time_input.dart index d5df24e6..a587a200 100644 --- a/lib/src/components/time_input/time_input.dart +++ b/lib/src/components/time_input/time_input.dart @@ -67,7 +67,7 @@ class ZetaTimeInput extends ZetaFormField { onTap: state.clear, disabled: disabled, size: size, - color: colors.main.subtle, + color: colors.mainSubtle, ), InputIconButton( icon: ZetaIcons.clock_outline, @@ -75,7 +75,7 @@ class ZetaTimeInput extends ZetaFormField { onTap: state.pickTime, disabled: disabled, size: size, - color: colors.main.defaultColor, + color: colors.mainDefault, ), ], ), @@ -233,8 +233,8 @@ class _ZetaTimeInputState extends FormFieldState { return Theme( data: Theme.of(context).copyWith( timePickerTheme: TimePickerThemeData( - dialBackgroundColor: colors.surface.primarySubtle, - dayPeriodColor: colors.main.primary, + dialBackgroundColor: colors.surfacePrimarySubtle, + dayPeriodColor: colors.mainPrimary, shape: RoundedRectangleBorder( borderRadius: rounded ? Zeta.of(context).radius.rounded : Zeta.of(context).radius.none, ), diff --git a/lib/src/components/tooltip/tooltip.dart b/lib/src/components/tooltip/tooltip.dart index 907da82e..063cb895 100644 --- a/lib/src/components/tooltip/tooltip.dart +++ b/lib/src/components/tooltip/tooltip.dart @@ -50,14 +50,14 @@ class ZetaTooltip extends ZetaStatelessWidget { final EdgeInsets? padding; /// The color of the tooltip. - /// Default is `zeta.colors.main.defaultColor`. + /// Default is `zeta.colors.mainDefault`. final Color? color; /// The text style of the tooltip. /// Default is: /// ``` /// ZetaTextStyles.bodyXSmall.copyWith( - /// color: zeta.colors.main.inverse, + /// color: zeta.colors.mainInverse, /// fontWeight: FontWeight.w500, /// ), /// ``` @@ -73,7 +73,7 @@ class ZetaTooltip extends ZetaStatelessWidget { @override Widget build(BuildContext context) { final zeta = Zeta.of(context); - final color = this.color ?? zeta.colors.main.defaultColor; + final color = this.color ?? zeta.colors.mainDefault; final horizontalArrowWidth = [ZetaTooltipArrowDirection.left, ZetaTooltipArrowDirection.right].contains(arrowDirection) ? _horizontalArrowSize.width @@ -131,7 +131,7 @@ class ZetaTooltip extends ZetaStatelessWidget { child: DefaultTextStyle( style: textStyle ?? ZetaTextStyles.bodyXSmall.copyWith( - color: zeta.colors.main.inverse, + color: zeta.colors.mainInverse, fontWeight: FontWeight.w500, ), child: child, diff --git a/lib/src/components/top_app_bar/extended_top_app_bar.dart b/lib/src/components/top_app_bar/extended_top_app_bar.dart index 7b3c5eca..67f4e543 100644 --- a/lib/src/components/top_app_bar/extended_top_app_bar.dart +++ b/lib/src/components/top_app_bar/extended_top_app_bar.dart @@ -48,7 +48,7 @@ class ZetaExtendedAppBarDelegate extends SliverPersistentHeaderDelegate { return ConstrainedBox( constraints: BoxConstraints(minHeight: Zeta.of(context).spacing.xl_9, maxHeight: maxExtent), child: ColoredBox( - color: Zeta.of(context).colors.surface.defaultColor, + color: Zeta.of(context).colors.surfaceDefault, child: Stack( children: [ Positioned( diff --git a/lib/src/components/top_app_bar/search_top_app_bar.dart b/lib/src/components/top_app_bar/search_top_app_bar.dart index daf18de2..35629114 100644 --- a/lib/src/components/top_app_bar/search_top_app_bar.dart +++ b/lib/src/components/top_app_bar/search_top_app_bar.dart @@ -164,13 +164,13 @@ class _ZetaTopAppBarSearchFieldState extends State wit controller: widget.searchController?.textEditingController, focusNode: _textFocusNode, style: ZetaTextStyles.bodyMedium, - cursorColor: colors.main.defaultColor, + cursorColor: colors.mainDefault, decoration: InputDecoration( - iconColor: colors.main.defaultColor, + iconColor: colors.mainDefault, filled: true, border: InputBorder.none, hintStyle: ZetaTextStyles.bodyMedium.copyWith( - color: colors.main.disabled, + color: colors.mainDisabled, ), hintText: widget.hintText, ), diff --git a/lib/src/components/top_app_bar/top_app_bar.dart b/lib/src/components/top_app_bar/top_app_bar.dart index 0838ff01..de2c7fc6 100644 --- a/lib/src/components/top_app_bar/top_app_bar.dart +++ b/lib/src/components/top_app_bar/top_app_bar.dart @@ -159,7 +159,7 @@ class _ZetaTopAppBarState extends State { } return DefaultTextStyle( - style: (widget.titleTextStyle ?? ZetaTextStyles.bodyLarge).copyWith(color: colors.main.defaultColor), + style: (widget.titleTextStyle ?? ZetaTextStyles.bodyLarge).copyWith(color: colors.mainDefault), child: title ?? const Text(' '), ); } @@ -175,14 +175,14 @@ class _ZetaTopAppBarState extends State { mainAxisSize: MainAxisSize.min, children: [ IconButton( - color: colors.main.defaultColor, + color: colors.mainDefault, onPressed: () => widget.searchController?.clearText(), icon: const ZetaIcon(ZetaIcons.cancel), ), if (widget.onSearchMicrophoneIconPressed != null) ...[ SizedBox( height: Zeta.of(context).spacing.xl_2, - child: VerticalDivider(width: ZetaBorders.medium, color: colors.main.subtle), + child: VerticalDivider(width: ZetaBorders.medium, color: colors.mainSubtle), ), IconButton( onPressed: widget.onSearchMicrophoneIconPressed, @@ -230,7 +230,7 @@ class _ZetaTopAppBarState extends State { return ZetaRoundedScope( rounded: context.rounded, child: ColoredBox( - color: colors.surface.defaultColor, + color: colors.surfaceDefault, child: IconButtonTheme( data: IconButtonThemeData(style: IconButton.styleFrom(tapTargetSize: MaterialTapTargetSize.shrinkWrap)), child: Padding( @@ -238,15 +238,15 @@ class _ZetaTopAppBarState extends State { child: AppBar( elevation: 0, scrolledUnderElevation: 0, - iconTheme: IconThemeData(color: colors.main.defaultColor), + iconTheme: IconThemeData(color: colors.mainDefault), leadingWidth: Zeta.of(context).spacing.xl_6, leading: widget.leading, automaticallyImplyLeading: widget.automaticallyImplyLeading, surfaceTintColor: Colors.transparent, centerTitle: widget.type == ZetaTopAppBarType.centeredTitle, titleTextStyle: widget.titleTextStyle == null - ? ZetaTextStyles.bodyLarge.copyWith(color: colors.main.defaultColor) - : widget.titleTextStyle!.copyWith(color: colors.main.defaultColor), + ? ZetaTextStyles.bodyLarge.copyWith(color: colors.mainDefault) + : widget.titleTextStyle!.copyWith(color: colors.mainDefault), title: title, actions: actions, ), diff --git a/lib/src/temp_colors.dart b/lib/src/temp_colors.dart deleted file mode 100644 index 5226c918..00000000 --- a/lib/src/temp_colors.dart +++ /dev/null @@ -1,398 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../zeta_flutter.dart'; - -// TODO(UX-1144): Do this better - -/// Colors to be removed at v1.0.0 -@Deprecated('This has been deprecated as of 0.16.0') -extension TempColors on ZetaSemanticColors { - /// Primary color swatch. - /// - /// Defaults to [ZetaColorBase.blue]. - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get primary => primitives.blue; - - /// Secondary color used in app. - /// - /// Defaults to [ZetaColorBase.yellow] - /// - /// Maps to [ColorScheme.secondary]. - ZetaColorSwatch get secondary => primitives.yellow; - - /// Secondary color used in app. - /// - /// Defaults to `ZetaColors.red.60`. - /// - /// Maps to [ColorScheme.error]. - ZetaColorSwatch get error => primitives.red; - - /// Cool color swatch. - /// - /// Defaults to [ZetaColorBase.cool]. - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get cool => primitives.cool; - - /// Warm color swatch. - /// - /// Defaults to [ZetaColorBase.warm]. - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get warm => primitives.warm; - - /// Pure color swatch. - /// - /// Defaults to [ZetaColorBase.pure]. - /// - /// {@macro zeta-color-dark} - ZetaPureColorSwatch get pure => primitives.pure; - - /// White color. - /// - /// Maps to [ColorScheme.surface]. - /// - /// Defaults to [ZetaColorBase.white]. - Color get white => primitives.pure.shade0; - - /// Shadow color. - /// - /// Maps to [ColorScheme.surface]. - /// - /// Defaults to [ZetaColorBase.black]. - Color get black => primitives.pure.shade1000; - - /// Surface color. - /// - /// Maps to [ColorScheme.surface]. - /// - /// * Light mode: `ZetaColors.black` - /// * Dark mode: `ZetaColors.white`. - Color get surfacePrimary => surface.primary; - - /// Secondary surface color. - /// - /// * `ZetaColors.cool.10`. - Color get surfaceSecondary => surface.secondary; - - /// Tertiary surface color. - /// - /// Maps to [ColorScheme.surface] and [ThemeData.scaffoldBackgroundColor] - /// - /// * `ZetaColors.warm.10`. - Color get surfaceTertiary => primitives.warm.shade10; - - /// Default text /icon color. - /// - /// Defaults to `ZetaColors.cool.90`. - /// - /// {@template zeta-color-dark} - /// Color swatches are inverted if [ZetaColors.brightness] is Dark. - /// {@endtemplate} - Color get textDefault => main.defaultColor; - - /// Subtle text /icon color. - /// - /// Defaults to `ZetaColors.cool.70`. - /// - /// Maps to [ColorScheme.onSurface]. - /// - /// {@macro zeta-color-dark} - Color get textSubtle => main.subtle; - - /// Disabled text / icon color. - /// - /// Defaults to `ZetaColors.cool.50`. - /// - /// {@macro zeta-color-dark} - Color get textDisabled => main.disabled; - - /// Inverse text / icon color. - /// - /// Used for text that is not on [ColorScheme.surface] or [ThemeData.scaffoldBackgroundColor]. - /// - /// Defaults to `ZetaColors.cool.20`. - /// - /// {@macro zeta-color-dark} - Color get textInverse => main.inverse; - - /// Default icon color. - /// - /// Defaults to `ZetaColors.cool.90`. - /// - /// {@macro zeta-color-dark} - Color get iconDefault => main.defaultColor; - - /// Subtle icon color. - /// - /// Defaults to `ZetaColors.cool.70`. - /// - /// Maps to [ColorScheme.onSurface]. - /// - /// {@macro zeta-color-dark} - Color get iconSubtle => main.subtle; - - /// Disabled icon color. - /// - /// Defaults to `ZetaColors.cool.50`. - /// - /// {@macro zeta-color-dark} - Color get iconDisabled => main.disabled; - - /// Inverse icon color. - /// - /// Used for text that is not on [ColorScheme.surface] or [ThemeData.scaffoldBackgroundColor]. - /// - /// Defaults to `ZetaColors.cool.20`. - /// - /// {@macro zeta-color-dark} - Color get iconInverse => main.inverse; - - /// Default Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceDefault => surface.defaultColor; - - /// Default-inverse Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceDefaultInverse => surface.defaultInverse; - - /// Hover Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceHover => surface.hover; - - /// Selected Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceSelected => surface.selected; - - /// Selected-hover Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceSelectedHover => surface.selectedHover; - - /// Disabled Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceDisabled => surface.disabled; - - /// Cool Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceCool => surface.cool; - - /// Warm Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceWarm => surface.warm; - - /// Primary-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfacePrimarySubtle => surface.primarySubtle; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarBlue => surface.avatar.blue; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarGreen => surface.avatar.green; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarOrange => surface.avatar.orange; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarPink => surface.avatar.pink; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarPurple => surface.avatar.purple; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarTeal => surface.avatar.teal; - - /// Avatar Avatar Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceAvatarYellow => surface.avatar.yellow; - - /// Secondary-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceSecondarySubtle => surface.secondarySubtle; - - /// Positive Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfacePositive => surface.positive; - - /// Positive-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfacePositiveSubtle => surface.positiveSubtle; - - /// Warning Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceWarning => surface.warning; - - /// Warning-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceWarningSubtle => surface.warningSubtle; - - /// Negative Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceNegative => surface.negative; - - /// Negative-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceNegativeSubtle => surface.negativeSubtle; - - /// Info Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceInfo => surface.info; - - /// Info-subtle Surface Color - /// - /// {@macro zeta-color-dark} - Color get surfaceInfoSubtle => surface.infoSubtle; - - /// Default Border Color - /// - /// {@macro zeta-color-dark} - Color get borderDefault => border.defaultColor; - - /// Subtle Border Color - /// - /// {@macro zeta-color-dark} - Color get borderSubtle => border.subtle; - - /// Hover Border Color - /// - /// {@macro zeta-color-dark} - Color get borderHover => border.hover; - - /// Selected Border Color - /// - /// {@macro zeta-color-dark} - Color get borderSelected => border.selected; - - /// Disabled Border Color - /// - /// {@macro zeta-color-dark} - Color get borderDisabled => border.disabled; - - /// Pure Border Color - /// - /// {@macro zeta-color-dark} - Color get borderPure => border.pure; - - /// Primary-main Border Color - /// - /// {@macro zeta-color-dark} - Color get borderPrimaryMain => border.primaryMain; - - /// Primary Border Color - /// - /// {@macro zeta-color-dark} - Color get borderPrimary => border.primary; - - /// Secondary Border Color - /// - /// {@macro zeta-color-dark} - Color get borderSecondary => border.secondary; - - /// Positive Border Color - /// - /// {@macro zeta-color-dark} - Color get borderPositive => border.positive; - - /// Warning Border Color - /// - /// {@macro zeta-color-dark} - Color get borderWarning => border.warning; - - /// Negative Border Color - /// - /// {@macro zeta-color-dark} - Color get borderNegative => border.negative; - - /// Info Border Color - /// - /// {@macro zeta-color-dark} - Color get borderInfo => border.info; - - /// Blue color swatch - /// - /// Defaults to [ZetaColorBase.blue] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get blue => primitives.blue; - - /// Green color swatch - /// - /// Defaults to [ZetaColorBase.green] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get green => primitives.green; - - /// Red color swatch - /// - /// Defaults to [ZetaColorBase.red] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get red => primitives.red; - - /// Orange color swatch - /// - /// Defaults to [ZetaColorBase.orange] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get orange => primitives.orange; - - /// Purple color swatch - /// - /// Defaults to [ZetaColorBase.purple] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get purple => primitives.purple; - - /// Yellow color swatch - /// - /// Defaults to [ZetaColorBase.yellow] - /// - /// {@macro zeta-color-dark} - - ZetaColorSwatch get yellow => primitives.yellow; - - /// Teal color swatch - /// - /// Defaults to [ZetaColorBase.teal] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get teal => primitives.teal; - - /// Pink color swatch - /// - /// Defaults to [ZetaColorBase.pink] - /// - /// {@macro zeta-color-dark} - ZetaColorSwatch get pink => primitives.pink; -} diff --git a/lib/src/theme/colors.dart b/lib/src/theme/colors.dart index 87b5ffae..c225ec9c 100644 --- a/lib/src/theme/colors.dart +++ b/lib/src/theme/colors.dart @@ -215,11 +215,13 @@ class ZetaColors extends Equatable implements ZetaColorSemantics { /// /// * Light mode: `ZetaColors.black` /// * Dark mode: `ZetaColors.white`. + @override final Color surfacePrimary; /// Secondary surface color. /// /// * `ZetaColors.cool.10`. + @override final Color surfaceSecondary; /// Tertiary surface color. @@ -300,191 +302,229 @@ class ZetaColors extends Equatable implements ZetaColorSemantics { /// Default Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceDefault => pure.shade(0); /// Default-inverse Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceDefaultInverse => warm.shade(100); /// Hover Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceHover => cool.shade(20); /// Selected Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceSelected => primary.shade(10); /// Selected-hover Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceSelectedHover => primary.shade(20); /// Disabled Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceDisabled => cool.shade(30); /// Cool Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceCool => cool.shade(10); /// Warm Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceWarm => warm.shade(10); /// Primary-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfacePrimarySubtle => primary.shade(10); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarBlue => blue.shade(80); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get surfaceAvatarGreen => green; /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarOrange => orange.shade(50); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarPink => pink.shade(80); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarPurple => purple.shade(80); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarTeal => teal.shade(80); /// Avatar Avatar Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceAvatarYellow => yellow.shade(50); /// Secondary-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceSecondarySubtle => secondary.shade(10); /// Positive Surface Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get surfacePositive => green; /// Positive-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfacePositiveSubtle => green.shade(10); /// Warning Surface Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get surfaceWarning => orange; /// Warning-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceWarningSubtle => orange.shade(10); /// Negative Surface Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get surfaceNegative => red; /// Negative-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceNegativeSubtle => red.shade(10); /// Info Surface Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get surfaceInfo => purple; /// Info-subtle Surface Color /// /// {@macro zeta-color-dark} + @override Color get surfaceInfoSubtle => purple.shade(10); /// Default Border Color /// /// {@macro zeta-color-dark} + @override Color get borderDefault => cool.shade(40); /// Subtle Border Color /// /// {@macro zeta-color-dark} + @override Color get borderSubtle => cool.shade(30); /// Hover Border Color /// /// {@macro zeta-color-dark} + @override Color get borderHover => cool.shade(90); /// Selected Border Color /// /// {@macro zeta-color-dark} + @override Color get borderSelected => cool.shade(90); /// Disabled Border Color /// /// {@macro zeta-color-dark} + @override Color get borderDisabled => cool.shade(20); /// Pure Border Color /// /// {@macro zeta-color-dark} + @override Color get borderPure => pure.shade(0); /// Primary-main Border Color /// /// {@macro zeta-color-dark} + @override ZetaColorSwatch get borderPrimaryMain => primary; /// Primary Border Color /// /// {@macro zeta-color-dark} + @override Color get borderPrimary => primary.shade(50); /// Secondary Border Color /// /// {@macro zeta-color-dark} + @override Color get borderSecondary => secondary.shade(50); /// Positive Border Color /// /// {@macro zeta-color-dark} + @override Color get borderPositive => green.shade(50); /// Warning Border Color /// /// {@macro zeta-color-dark} + @override Color get borderWarning => orange.shade(50); /// Negative Border Color /// /// {@macro zeta-color-dark} + @override Color get borderNegative => red.shade(50); /// Info Border Color /// /// {@macro zeta-color-dark} + @override Color get borderInfo => purple.shade(50); /// Blue color swatch @@ -492,6 +532,7 @@ class ZetaColors extends Equatable implements ZetaColorSemantics { /// Defaults to [ZetaColorBase.blue] /// /// {@macro zeta-color-dark} + @Deprecated('Use `Zeta.of(context).primitives.blue` instead.') final ZetaColorSwatch blue; /// Green color swatch @@ -680,19 +721,207 @@ class ZetaColors extends Equatable implements ZetaColorSemantics { ]; @override - ZetaSemanticBorderColors get border => ZetaSemanticBorderColorsAA(primitives: primitives); + Color get mainDefault => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainDefault + : ZetaSemanticColorsAAA(primitives: primitives).mainDefault; @override - ZetaSemanticMainColors get main => ZetaSemanticMainColorsAA(primitives: primitives); + Color get mainDisabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainDisabled + : ZetaSemanticColorsAAA(primitives: primitives).mainDisabled; @override - ZetaPrimitives get primitives => brightness == Brightness.dark ? ZetaPrimitivesDark() : ZetaPrimitivesLight(); + Color get mainInfo => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainInfo + : ZetaSemanticColorsAAA(primitives: primitives).mainInfo; + + @override + Color get mainInverse => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainInverse + : ZetaSemanticColorsAAA(primitives: primitives).mainInverse; + + @override + Color get mainLight => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainLight + : ZetaSemanticColorsAAA(primitives: primitives).mainLight; + + @override + Color get mainNegative => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainNegative + : ZetaSemanticColorsAAA(primitives: primitives).mainNegative; + + @override + Color get mainPositive => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainPositive + : ZetaSemanticColorsAAA(primitives: primitives).mainPositive; + + @override + Color get mainPrimary => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainPrimary + : ZetaSemanticColorsAAA(primitives: primitives).mainPrimary; + + @override + Color get mainSecondary => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainSecondary + : ZetaSemanticColorsAAA(primitives: primitives).mainSecondary; + + @override + Color get mainSubtle => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainSubtle + : ZetaSemanticColorsAAA(primitives: primitives).mainSubtle; + + @override + Color get mainWarning => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).mainWarning + : ZetaSemanticColorsAAA(primitives: primitives).mainWarning; @override - ZetaSemanticStateColors get state => ZetaSemanticStateColorsAA(primitives: primitives); + Color get stateDefaultEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateDefaultEnabled + : ZetaSemanticColorsAAA(primitives: primitives).stateDefaultEnabled; @override - ZetaSemanticSurfaceColors get surface => ZetaSemanticSurfaceColorsAA(primitives: primitives); + Color get stateDefaultFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateDefaultFocus + : ZetaSemanticColorsAAA(primitives: primitives).stateDefaultFocus; + + @override + Color get stateDefaultHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateDefaultHover + : ZetaSemanticColorsAAA(primitives: primitives).stateDefaultHover; + + @override + Color get stateDefaultSelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateDefaultSelected + : ZetaSemanticColorsAAA(primitives: primitives).stateDefaultSelected; + + @override + Color get stateDisabledDisabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateDisabledDisabled + : ZetaSemanticColorsAAA(primitives: primitives).stateDisabledDisabled; + + @override + Color get stateInfoEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInfoEnabled + : ZetaSemanticColorsAAA(primitives: primitives).stateInfoEnabled; + + @override + Color get stateInfoFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInfoFocus + : ZetaSemanticColorsAAA(primitives: primitives).stateInfoFocus; + + @override + Color get stateInfoHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInfoHover + : ZetaSemanticColorsAAA(primitives: primitives).stateInfoHover; + + @override + Color get stateInfoSelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInfoSelected + : ZetaSemanticColorsAAA(primitives: primitives).stateInfoSelected; + + @override + Color get stateInverseEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInverseEnabled + : ZetaSemanticColorsAAA(primitives: primitives).stateInverseEnabled; + + @override + Color get stateInverseFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInverseFocus + : ZetaSemanticColorsAAA(primitives: primitives).stateInverseFocus; + + @override + Color get stateInverseHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInverseHover + : ZetaSemanticColorsAAA(primitives: primitives).stateInverseHover; + + @override + Color get stateInverseSelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateInverseSelected + : ZetaSemanticColorsAAA(primitives: primitives).stateInverseSelected; + + @override + Color get stateNegativeEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateNegativeEnabled + : ZetaSemanticColorsAAA(primitives: primitives).stateNegativeEnabled; + + @override + Color get stateNegativeFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateNegativeFocus + : ZetaSemanticColorsAAA(primitives: primitives).stateNegativeFocus; + + @override + Color get stateNegativeHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateNegativeHover + : ZetaSemanticColorsAAA(primitives: primitives).stateNegativeHover; + + @override + Color get stateNegativeSelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateNegativeSelected + : ZetaSemanticColorsAAA(primitives: primitives).stateNegativeSelected; + + @override + Color get statePositiveEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePositiveEnabled + : ZetaSemanticColorsAAA(primitives: primitives).statePositiveEnabled; + + @override + Color get statePositiveFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePositiveFocus + : ZetaSemanticColorsAAA(primitives: primitives).statePositiveFocus; + + @override + Color get statePositiveHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePositiveHover + : ZetaSemanticColorsAAA(primitives: primitives).statePositiveHover; + + @override + Color get statePositiveSelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePositiveSelected + : ZetaSemanticColorsAAA(primitives: primitives).statePositiveSelected; + + @override + Color get statePrimaryEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePrimaryEnabled + : ZetaSemanticColorsAAA(primitives: primitives).statePrimaryEnabled; + + @override + Color get statePrimaryFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePrimaryFocus + : ZetaSemanticColorsAAA(primitives: primitives).statePrimaryFocus; + + @override + Color get statePrimaryHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePrimaryHover + : ZetaSemanticColorsAAA(primitives: primitives).statePrimaryHover; + + @override + Color get statePrimarySelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).statePrimarySelected + : ZetaSemanticColorsAAA(primitives: primitives).statePrimarySelected; + + @override + Color get stateSecondaryEnabled => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateSecondaryEnabled + : ZetaSemanticColorsAAA(primitives: primitives).stateSecondaryEnabled; + + @override + Color get stateSecondaryFocus => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateSecondaryFocus + : ZetaSemanticColorsAAA(primitives: primitives).stateSecondaryFocus; + + @override + Color get stateSecondaryHover => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateSecondaryHover + : ZetaSemanticColorsAAA(primitives: primitives).stateSecondaryHover; + + @override + Color get stateSecondarySelected => contrast == ZetaContrast.aa + ? ZetaSemanticColorsAA(primitives: primitives).stateSecondarySelected + : ZetaSemanticColorsAAA(primitives: primitives).stateSecondarySelected; + + @override + ZetaPrimitives get primitives => brightness == Brightness.dark ? ZetaPrimitivesDark() : ZetaPrimitivesLight(); } enum _ZetaColorProperties { diff --git a/lib/src/utils/zeta_provider.dart b/lib/src/utils/zeta_provider.dart index 218ad17a..f8c5afc2 100644 --- a/lib/src/utils/zeta_provider.dart +++ b/lib/src/utils/zeta_provider.dart @@ -572,8 +572,8 @@ ThemeData generateZetaTheme({ iconTheme: IconThemeData( size: kZetaIconSize, color: (zetaThemeData != null - ? (zetaThemeData.semantics?.colors.main.defaultColor ?? - (brightness == Brightness.dark ? zetaThemeData.colorsDark : zetaThemeData.colorsLight).main.defaultColor) + ? (zetaThemeData.semantics?.colors.mainDefault ?? + (brightness == Brightness.dark ? zetaThemeData.colorsDark : zetaThemeData.colorsLight).mainDefault) : colorScheme.onSurface), ), ); diff --git a/lib/zeta_flutter.dart b/lib/zeta_flutter.dart index eeff2f0e..27172c51 100644 --- a/lib/zeta_flutter.dart +++ b/lib/zeta_flutter.dart @@ -3,6 +3,5 @@ library zeta_flutter; export 'generated/generated.dart'; export 'src/components/components.dart'; -export 'src/temp_colors.dart'; export 'src/theme/theme.dart'; export 'src/utils/utils.dart'; diff --git a/test/src/components/top_app_bar/extended_top_app_bar_test.dart b/test/src/components/top_app_bar/extended_top_app_bar_test.dart index 7ed3f4e8..379b2a14 100644 --- a/test/src/components/top_app_bar/extended_top_app_bar_test.dart +++ b/test/src/components/top_app_bar/extended_top_app_bar_test.dart @@ -33,7 +33,7 @@ void main() { child: Container( width: 800, height: 700, - color: Zeta.of(context).colors.surface.selectedHover, + color: Zeta.of(context).colors.surfaceSelectedHover, key: boxKey, ), ), @@ -89,7 +89,7 @@ void main() { child: Container( width: 800, height: 700, - color: Zeta.of(context).colors.surface.selectedHover, + color: Zeta.of(context).colors.surfaceSelectedHover, key: boxKey, ), ), @@ -135,7 +135,7 @@ void main() { child: Container( width: 800, height: 700, - color: Zeta.of(context).colors.surface.selectedHover, + color: Zeta.of(context).colors.surfaceSelectedHover, key: boxKey, ), ), diff --git a/test/src/theme/colors_test.dart b/test/src/theme/colors_test.dart index c3050f12..7bd3f630 100644 --- a/test/src/theme/colors_test.dart +++ b/test/src/theme/colors_test.dart @@ -19,8 +19,8 @@ void main() { expect(zetaColors.cool, isNotNull); expect(zetaColors.warm, isNotNull); expect(zetaColors.pure, isNotNull); - expect(zetaColors.surface.defaultColor, ZetaColorBase.white); - expect(zetaColors.surface.secondary, isNotNull); + expect(zetaColors.surfaceDefault, ZetaColorBase.white); + expect(zetaColors.surfaceSecondary, isNotNull); expect(zetaColors.surfaceTertiary, isNotNull); }); @@ -40,8 +40,8 @@ void main() { expect(zetaColors.cool, isNotNull); expect(zetaColors.warm, isNotNull); expect(zetaColors.pure, isNotNull); - expect(zetaColors.surface.defaultColor, ZetaColorBase.white); - expect(zetaColors.surface.secondary, isNotNull); + expect(zetaColors.surfaceDefault, ZetaColorBase.white); + expect(zetaColors.surfaceSecondary, isNotNull); expect(zetaColors.surfaceTertiary, isNotNull); }); @@ -61,8 +61,8 @@ void main() { expect(zetaColors.cool, isNotNull); expect(zetaColors.warm, isNotNull); expect(zetaColors.pure, isNotNull); - expect(zetaColors.surface.defaultColor, ZetaPrimitivesDark().pure.shade0); - expect(zetaColors.surface.secondary, isNotNull); + expect(zetaColors.surfaceDefault, ZetaPrimitivesDark().pure.shade0); + expect(zetaColors.surfaceSecondary, isNotNull); expect(zetaColors.surfaceTertiary, isNotNull); }); @@ -130,46 +130,46 @@ void main() { expect(scheme.brightness, zetaColors.brightness); expect(scheme.primary, zetaColors.primary.shade(zetaColors.contrast.primary)); expect(scheme.secondary, zetaColors.secondary.shade(zetaColors.contrast.primary)); - expect(scheme.surface, zetaColors.surface.defaultColor); + expect(scheme.surface, zetaColors.surfaceDefault); expect(scheme.error, zetaColors.error); }); test('Color getter returns correct values', () { final zetaColors = ZetaColors(); - expect(zetaColors.main.defaultColor, ZetaPrimitivesLight().cool.shade90); - expect(zetaColors.main.subtle, ZetaPrimitivesLight().cool.shade70); - expect(zetaColors.main.disabled, ZetaPrimitivesLight().cool.shade50); - expect(zetaColors.main.inverse, ZetaPrimitivesLight().cool.shade20); - expect(zetaColors.main.defaultColor, ZetaPrimitivesLight().cool.shade90); - expect(zetaColors.main.subtle, ZetaPrimitivesLight().cool.shade70); - expect(zetaColors.main.disabled, ZetaPrimitivesLight().cool.shade50); + expect(zetaColors.mainDefault, ZetaPrimitivesLight().cool.shade90); + expect(zetaColors.mainSubtle, ZetaPrimitivesLight().cool.shade70); + expect(zetaColors.mainDisabled, ZetaPrimitivesLight().cool.shade50); + expect(zetaColors.mainInverse, ZetaPrimitivesLight().cool.shade20); + expect(zetaColors.mainDefault, ZetaPrimitivesLight().cool.shade90); + expect(zetaColors.mainSubtle, ZetaPrimitivesLight().cool.shade70); + expect(zetaColors.mainDisabled, ZetaPrimitivesLight().cool.shade50); expect(zetaColors.iconInverse, ZetaPrimitivesLight().cool.shade20); - expect(zetaColors.surface.defaultColor, ZetaPrimitivesLight().pure.shade(0)); - expect(zetaColors.surface.defaultInverse, ZetaPrimitivesLight().warm.shade(100)); - expect(zetaColors.surface.hover, ZetaPrimitivesLight().cool.shade(20)); - expect(zetaColors.surface.selected, ZetaPrimitivesLight().blue.shade(10)); - expect(zetaColors.surface.selectedHover, ZetaPrimitivesLight().blue.shade(20)); - expect(zetaColors.surface.disabled, ZetaPrimitivesLight().cool.shade(30)); + expect(zetaColors.surfaceDefault, ZetaPrimitivesLight().pure.shade(0)); + expect(zetaColors.surfaceDefaultInverse, ZetaPrimitivesLight().warm.shade(100)); + expect(zetaColors.surfaceHover, ZetaPrimitivesLight().cool.shade(20)); + expect(zetaColors.surfaceSelected, ZetaPrimitivesLight().blue.shade(10)); + expect(zetaColors.surfaceSelectedHover, ZetaPrimitivesLight().blue.shade(20)); + expect(zetaColors.surfaceDisabled, ZetaPrimitivesLight().cool.shade(30)); expect(zetaColors.surfaceCool, ZetaPrimitivesLight().cool.shade(10)); expect(zetaColors.surfaceWarm, ZetaPrimitivesLight().warm.shade(10)); - expect(zetaColors.surface.primarySubtle, ZetaPrimitivesLight().blue.shade(10)); + expect(zetaColors.surfacePrimarySubtle, ZetaPrimitivesLight().blue.shade(10)); expect(zetaColors.surfaceAvatarBlue, ZetaPrimitivesLight().blue.shade(80)); expect(zetaColors.surfaceAvatarOrange, ZetaPrimitivesLight().orange.shade(50)); expect(zetaColors.surfaceAvatarPink, ZetaPrimitivesLight().pink.shade(80)); expect(zetaColors.surfaceAvatarPurple, ZetaPrimitivesLight().purple.shade(80)); expect(zetaColors.surfaceAvatarTeal, ZetaPrimitivesLight().teal.shade(80)); expect(zetaColors.surfaceAvatarYellow, ZetaPrimitivesLight().yellow.shade(50)); - expect(zetaColors.surface.secondarySubtle, ZetaPrimitivesLight().yellow.shade(10)); - expect(zetaColors.surface.positiveSubtle, ZetaPrimitivesLight().green.shade(10)); - expect(zetaColors.surface.warningSubtle, ZetaPrimitivesLight().orange.shade(10)); - expect(zetaColors.surface.negativeSubtle, ZetaPrimitivesLight().red.shade(10)); - expect(zetaColors.surface.infoSubtle, ZetaPrimitivesLight().purple.shade(10)); - expect(zetaColors.border.defaultColor, ZetaPrimitivesLight().cool.shade(40)); - expect(zetaColors.border.subtle, ZetaPrimitivesLight().cool.shade(30)); + expect(zetaColors.surfaceSecondarySubtle, ZetaPrimitivesLight().yellow.shade(10)); + expect(zetaColors.surfacePositiveSubtle, ZetaPrimitivesLight().green.shade(10)); + expect(zetaColors.surfaceWarningSubtle, ZetaPrimitivesLight().orange.shade(10)); + expect(zetaColors.surfaceNegativeSubtle, ZetaPrimitivesLight().red.shade(10)); + expect(zetaColors.surfaceInfoSubtle, ZetaPrimitivesLight().purple.shade(10)); + expect(zetaColors.borderDefault, ZetaPrimitivesLight().cool.shade(40)); + expect(zetaColors.borderSubtle, ZetaPrimitivesLight().cool.shade(30)); expect(zetaColors.borderHover, ZetaPrimitivesLight().cool.shade(90)); - expect(zetaColors.border.selected, ZetaPrimitivesLight().cool.shade(90)); - expect(zetaColors.border.disabled, ZetaPrimitivesLight().cool.shade(20)); + expect(zetaColors.borderSelected, ZetaPrimitivesLight().cool.shade(90)); + expect(zetaColors.borderDisabled, ZetaPrimitivesLight().cool.shade(20)); expect(zetaColors.borderPure, ZetaPrimitivesLight().pure.shade(0)); expect(zetaColors.borderPrimary, ZetaPrimitivesLight().blue.shade(50)); expect(zetaColors.borderSecondary, ZetaPrimitivesLight().yellow.shade(50)); @@ -177,11 +177,11 @@ void main() { expect(zetaColors.borderWarning, ZetaPrimitivesLight().orange.shade(50)); expect(zetaColors.borderNegative, ZetaPrimitivesLight().red.shade(50)); expect(zetaColors.borderInfo, ZetaPrimitivesLight().purple.shade(50)); - expect(zetaColors.surface.positive, ZetaPrimitivesLight().green.shade60); - expect(zetaColors.surface.warning, ZetaPrimitivesLight().orange.shade60); - expect(zetaColors.surface.negative, ZetaPrimitivesLight().red.shade60); + expect(zetaColors.surfacePositive, ZetaPrimitivesLight().green.shade60); + expect(zetaColors.surfaceWarning, ZetaPrimitivesLight().orange.shade60); + expect(zetaColors.surfaceNegative, ZetaPrimitivesLight().red.shade60); expect(zetaColors.surfaceAvatarGreen, ZetaPrimitivesLight().green); - expect(zetaColors.surface.info, ZetaPrimitivesLight().purple.shade60); + expect(zetaColors.surfaceInfo, ZetaPrimitivesLight().purple.shade60); expect(zetaColors.borderPrimaryMain, ZetaPrimitivesLight().blue); }); @@ -216,21 +216,21 @@ void main() { expect(themeData.colorScheme.secondarySwatch, zetaColors.secondary); expect(themeData.colorScheme.cool, zetaColors.cool); expect(themeData.colorScheme.warm, zetaColors.warm); - expect(themeData.colorScheme.textDefault, zetaColors.main.defaultColor); - expect(themeData.colorScheme.textSubtle, zetaColors.main.subtle); - expect(themeData.colorScheme.textDisabled, zetaColors.main.disabled); - expect(themeData.colorScheme.textInverse, zetaColors.main.inverse); - expect(themeData.colorScheme.surfacePrimary, zetaColors.surface.defaultColor); - expect(themeData.colorScheme.surfaceSecondary, zetaColors.surface.cool); + expect(themeData.colorScheme.textDefault, zetaColors.mainDefault); + expect(themeData.colorScheme.textSubtle, zetaColors.mainSubtle); + expect(themeData.colorScheme.textDisabled, zetaColors.mainDisabled); + expect(themeData.colorScheme.textInverse, zetaColors.mainInverse); + expect(themeData.colorScheme.surfacePrimary, zetaColors.surfaceDefault); + expect(themeData.colorScheme.surfaceSecondary, zetaColors.surfaceCool); expect(themeData.colorScheme.surfaceTertiary, zetaColors.surfaceTertiary); - expect(themeData.colorScheme.surfaceDisabled, zetaColors.surface.disabled); - expect(themeData.colorScheme.surfaceHover, zetaColors.surface.hover); - expect(themeData.colorScheme.surfaceSelected, zetaColors.surface.selected); - expect(themeData.colorScheme.surfaceSelectedHover, zetaColors.surface.selectedHover); - expect(themeData.colorScheme.borderDefault, zetaColors.border.defaultColor); - expect(themeData.colorScheme.borderSubtle, zetaColors.border.subtle); - expect(themeData.colorScheme.borderDisabled, zetaColors.border.disabled); - expect(themeData.colorScheme.borderSelected, zetaColors.border.selected); + expect(themeData.colorScheme.surfaceDisabled, zetaColors.surfaceDisabled); + expect(themeData.colorScheme.surfaceHover, zetaColors.surfaceHover); + expect(themeData.colorScheme.surfaceSelected, zetaColors.surfaceSelected); + expect(themeData.colorScheme.surfaceSelectedHover, zetaColors.surfaceSelectedHover); + expect(themeData.colorScheme.borderDefault, zetaColors.borderDefault); + expect(themeData.colorScheme.borderSubtle, zetaColors.borderSubtle); + expect(themeData.colorScheme.borderDisabled, zetaColors.borderDisabled); + expect(themeData.colorScheme.borderSelected, zetaColors.borderSelected); expect(themeData.colorScheme.blue, zetaColors.blue); expect(themeData.colorScheme.green, zetaColors.green); expect(themeData.colorScheme.red, zetaColors.red); diff --git a/test/src/utils/extensions_test.dart b/test/src/utils/extensions_test.dart index ece31f43..12e06809 100644 --- a/test/src/utils/extensions_test.dart +++ b/test/src/utils/extensions_test.dart @@ -208,11 +208,10 @@ void main() { mockZetaColors = MockZetaSemanticColors(); when(mockContext.dependOnInheritedWidgetOfExactType()).thenReturn(mockZeta as Zeta?); when(mockZeta.colors).thenReturn(mockZetaColors); - when(mockZetaColors.surface.info).thenReturn(ZetaPrimitivesLight().purple); - when(mockZetaColors.surface.positive).thenReturn(ZetaPrimitivesLight().green); - when(mockZetaColors.surface.warning).thenReturn(ZetaPrimitivesLight().orange); - when(mockZetaColors.surface.negative).thenReturn(ZetaPrimitivesLight().red); - when(mockZetaColors.cool).thenReturn(ZetaPrimitivesLight().cool); + when(mockZetaColors.surfaceInfo).thenReturn(ZetaPrimitivesLight().purple); + when(mockZetaColors.surfacePositive).thenReturn(ZetaPrimitivesLight().green); + when(mockZetaColors.surfaceWarning).thenReturn(ZetaPrimitivesLight().orange); + when(mockZetaColors.surfaceNegative).thenReturn(ZetaPrimitivesLight().red); }); }); diff --git a/test/src/zeta_provider_test.dart b/test/src/zeta_provider_test.dart index 0c2c6979..81dd39c7 100644 --- a/test/src/zeta_provider_test.dart +++ b/test/src/zeta_provider_test.dart @@ -372,7 +372,7 @@ void main() { zetaThemeData: initialThemeData, ); - expect(theme2.iconTheme.color, initialThemeData.colorsLight.main.defaultColor); + expect(theme2.iconTheme.color, initialThemeData.colorsLight.mainDefault); }); testWidgets('debugFillProperties works correctly', (WidgetTester tester) async {