Skip to content

Commit

Permalink
added tabs to samples (#52)
Browse files Browse the repository at this point in the history
* added tabs to samples

* Commit from GitHub Actions (Forui Samples Presubmit)

* change card title size, tabs sample restyle

* update golden tests

* update dialog golden tests

* Update typography_test.dart

---------

Co-authored-by: Daviiddoo <[email protected]>
  • Loading branch information
Daviiddoo and Daviiddoo authored Jun 25, 2024
1 parent ae95a5b commit 2465f82
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 68 deletions.
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/card/card_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ final class FCardContentStyle with Diagnosticable {

/// Creates a [FCardContentStyle] that inherits its properties from [colorScheme] and [typography].
FCardContentStyle.inherit({required FColorScheme colorScheme, required FTypography typography})
: titleTextStyle = typography.base.copyWith(
: titleTextStyle = typography.xl2.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.foreground,
),
Expand Down
Binary file modified forui/test/golden/card/zinc-dark-raw-card-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forui/test/golden/card/zinc-dark-text-card-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forui/test/golden/card/zinc-light-raw-card-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forui/test/golden/card/zinc-light-text-card-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forui/test/golden/tabs/zinc-dark-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forui/test/golden/tabs/zinc-light-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 15 additions & 12 deletions forui/test/src/theme/typography_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,21 @@ void main() {
typography = FTypography.inherit(colorScheme: colorScheme);

expect(typography.defaultFontFamily, 'packages/forui/Inter');
expect(typography.xs, TextStyle(color: colorScheme.foreground, fontSize: 12, height: 1));
expect(typography.sm, TextStyle(color: colorScheme.foreground, fontSize: 14, height: 1.25));
expect(typography.base, TextStyle(color: colorScheme.foreground, fontSize: 16, height: 1.5));
expect(typography.lg, TextStyle(color: colorScheme.foreground, fontSize: 18, height: 1.75));
expect(typography.xl, TextStyle(color: colorScheme.foreground, fontSize: 20, height: 1.75));
expect(typography.xl2, TextStyle(color: colorScheme.foreground, fontSize: 22, height: 2));
expect(typography.xl3, TextStyle(color: colorScheme.foreground, fontSize: 30, height: 2.25));
expect(typography.xl4, TextStyle(color: colorScheme.foreground, fontSize: 36, height: 2.5));
expect(typography.xl5, TextStyle(color: colorScheme.foreground, fontSize: 48, height: 1));
expect(typography.xl6, TextStyle(color: colorScheme.foreground, fontSize: 60, height: 1));
expect(typography.xl7, TextStyle(color: colorScheme.foreground, fontSize: 72, height: 1));
expect(typography.xl8, TextStyle(color: colorScheme.foreground, fontSize: 96, height: 1));
expect(
typography.xs,
TextStyle(
color: colorScheme.foreground, fontFamily: typography.defaultFontFamily, fontSize: 12, height: 1,));
expect(typography.sm, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily,fontSize: 14, height: 1.25,));
expect(typography.base, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily,fontSize: 16, height: 1.5));
expect(typography.lg, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily, fontSize: 18, height: 1.75));
expect(typography.xl, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily,fontSize: 20, height: 1.75));
expect(typography.xl2, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily,fontSize: 22, height: 2));
expect(typography.xl3, TextStyle(color: colorScheme.foreground,fontFamily: typography.defaultFontFamily, fontSize: 30, height: 2.25));
expect(typography.xl4, TextStyle(color: colorScheme.foreground,fontFamily: typography.defaultFontFamily, fontSize: 36, height: 2.5));
expect(typography.xl5, TextStyle(color: colorScheme.foreground,fontFamily: typography.defaultFontFamily, fontSize: 48, height: 1));
expect(typography.xl6, TextStyle(color: colorScheme.foreground,fontFamily: typography.defaultFontFamily, fontSize: 60, height: 1));
expect(typography.xl7, TextStyle(color: colorScheme.foreground,fontFamily: typography.defaultFontFamily, fontSize: 72, height: 1));
expect(typography.xl8, TextStyle(color: colorScheme.foreground, fontFamily: typography.defaultFontFamily,fontSize: 96, height: 1));
});

test(
Expand Down
4 changes: 4 additions & 0 deletions samples/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class _AppRouter extends $_AppRouter {
path: '/header',
page: HeaderRoute.page,
),
AutoRoute(
path: '/tabs',
page: TabsRoute.page,
),
AutoRoute(
path: '/text-field',
page: TextFieldRoute.page,
Expand Down
Loading

0 comments on commit 2465f82

Please sign in to comment.