Skip to content

Commit

Permalink
revert: Reverts class based semantic colors
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 30, 2024
1 parent 858541d commit 3b84f60
Show file tree
Hide file tree
Showing 90 changed files with 1,396 additions and 2,057 deletions.
4 changes: 2 additions & 2 deletions example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/assets/icons_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _IconsExampleState extends State<IconsExample> {
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(
Expand Down
16 changes: 8 additions & 8 deletions example/lib/pages/components/avatar_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
Expand Down Expand Up @@ -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',
),
Expand All @@ -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),
],
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
],
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/components/chip_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _ChipExampleState extends State<ChipExample> {
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')),
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/components/dialog_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand All @@ -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.',
Expand All @@ -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.',
Expand All @@ -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.',
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/components/list_item_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class _ListItemExampleState extends State<ListItemExample> {
return ExampleScaffold(
name: ListItemExample.name,
child: Container(
color: zetaColors.surface.warm,
color: zetaColors.surfaceWarm,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/components/navigation_rail_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class _NavigationRailExampleState extends State<NavigationRailExample> {
_titles[_selectedIndex!],
textAlign: TextAlign.center,
style: ZetaTextStyles.titleMedium.copyWith(
color: zeta.colors.main.defaultColor,
color: zeta.colors.mainDefault,
fontWeight: FontWeight.bold,
),
),
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/components/top_app_bar_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _TopAppBarExampleState extends State<TopAppBarExample> {
return ExampleScaffold(
name: TopAppBarExample.name,
child: ColoredBox(
color: colors.surface.warm,
color: colors.surfaceWarm,
child: SingleChildScrollView(
child: Column(
children: [
Expand Down Expand Up @@ -178,7 +178,7 @@ class _TopAppBarExampleState extends State<TopAppBarExample> {
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),
Expand Down Expand Up @@ -220,7 +220,7 @@ class _TopAppBarExampleState extends State<TopAppBarExample> {
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),
Expand Down Expand Up @@ -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);
}
Expand Down
162 changes: 81 additions & 81 deletions example/lib/pages/theme/color_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,108 +39,108 @@ class _ColorExampleState extends State<ColorExample> {
};

final Map<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> disabled = {
'disabled': colors.state.disabled.disabled,
'disabled': colors.stateDisabledDisabled,
};
final Map<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> 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<String, Color> 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(
Expand Down Expand Up @@ -213,7 +213,7 @@ class _ColorExampleState extends State<ColorExample> {
// (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(
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/theme/radius_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
Loading

0 comments on commit 3b84f60

Please sign in to comment.