Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [MDS-1260] Change font weight from 500 to 600 and remove caption #429

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class BottomSheetStory extends StatelessWidget {
? MediaQuery.of(context).size.height * heightKnob
: MediaQuery.of(context).size.height * 0.7,
closeProgressThreshold: closeProgressThresholdKnob,
borderRadius: borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
borderRadius: borderRadiusKnob != null
? BorderRadius.circular(borderRadiusKnob.toDouble())
: null,
builder: (BuildContext context) => Column(
children: [
Container(
Expand All @@ -84,7 +86,7 @@ class BottomSheetStory extends StatelessWidget {
child: Center(
child: Text(
'Pick your choice!',
style: MoonTypography.typography.heading.text16,
style: MoonTypography.typography.body.text16,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/storybook/stories/primitives/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class DrawerStory extends StatelessWidget {
borderRadius: BorderRadiusDirectional.horizontal(
end: Radius.circular(borderRadiusKnob?.toDouble() ?? 0),
),
width:
drawerWidthKnob?.toDouble() ?? MediaQuery.of(context).size.width,
width: drawerWidthKnob?.toDouble() ??
MediaQuery.of(context).size.width * 0.8,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class LinearProgressStory extends StatelessWidget {
options: colorOptions,
);

final backgroundColor = colorTable(context)[progressBackgroundColorKnob ?? 40];
final backgroundColor =
colorTable(context)[progressBackgroundColorKnob ?? 40];

final pinColorKnob = context.knobs.nullable.options(
label: "pinColor",
Expand Down Expand Up @@ -116,13 +117,15 @@ class LinearProgressStory extends StatelessWidget {

return Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 64, horizontal: 16),
padding: const EdgeInsets.symmetric(vertical: 64, horizontal: 20),
child: MoonLinearProgress(
linearProgressSize: progressSizeKnob,
value: linearProgressValueKnob,
color: color,
backgroundColor: backgroundColor,
borderRadius: borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
borderRadius: borderRadiusKnob != null
? BorderRadius.circular(borderRadiusKnob.toDouble())
: null,
showMinLabel: showMinLabelKnob,
showMaxLabel: showMaxLabelKnob,
showPin: showPinKnob,
Expand Down
28 changes: 16 additions & 12 deletions example/lib/src/storybook/storybook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ class StorybookPage extends StatelessWidget {
tokens: MoonTokens.light.copyWith(
colors: mdsLightColors,
typography: MoonTypography.typography.copyWith(
heading: MoonTypography.typography.heading
.apply(fontFamily: "DMSans"),
body: MoonTypography.typography.body
.apply(fontFamily: "DMSans"),
caption: MoonTypography.typography.caption
.apply(fontFamily: "DMSans"),
heading: MoonTypography.typography.heading.apply(
fontFamily: "DMSans",
fontWeightDelta: -1,
fontVariations: [const FontVariation('wght', 500)],
),
body: MoonTypography.typography.body.apply(
fontFamily: "DMSans",
),
),
),
),
Expand All @@ -55,12 +57,14 @@ class StorybookPage extends StatelessWidget {
tokens: MoonTokens.dark.copyWith(
colors: mdsDarkColors,
typography: MoonTypography.typography.copyWith(
heading: MoonTypography.typography.heading
.apply(fontFamily: "DMSans"),
body: MoonTypography.typography.body
.apply(fontFamily: "DMSans"),
caption: MoonTypography.typography.caption
.apply(fontFamily: "DMSans"),
heading: MoonTypography.typography.heading.apply(
fontFamily: "DMSans",
fontWeightDelta: -1,
fontVariations: [const FontVariation('wght', 500)],
),
body: MoonTypography.typography.body.apply(
fontFamily: "DMSans",
),
),
),
),
Expand Down
10 changes: 7 additions & 3 deletions lib/src/theme/breadcrumb/breadcrumb_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:moon_design/src/theme/breadcrumb/breadcrumb_colors.dart';
import 'package:moon_design/src/theme/breadcrumb/breadcrumb_properties.dart';

@immutable
class MoonBreadcrumbTheme extends ThemeExtension<MoonBreadcrumbTheme> with DiagnosticableTreeMixin {
class MoonBreadcrumbTheme extends ThemeExtension<MoonBreadcrumbTheme>
with DiagnosticableTreeMixin {
/// The tokens of the Moon Design System.
final MoonTokens tokens;

Expand Down Expand Up @@ -33,7 +34,7 @@ class MoonBreadcrumbTheme extends ThemeExtension<MoonBreadcrumbTheme> with Diagn
transitionCurve: tokens.transitions.defaultTransitionCurve,
itemTextStyle: tokens.typography.body.textDefault,
currentItemTextStyle: tokens.typography.body.textDefault,
showMoreItemTextStyle: tokens.typography.caption.textDefault,
showMoreItemTextStyle: tokens.typography.body.textDefault,
);

@override
Expand All @@ -50,7 +51,10 @@ class MoonBreadcrumbTheme extends ThemeExtension<MoonBreadcrumbTheme> with Diagn
}

@override
MoonBreadcrumbTheme lerp(ThemeExtension<MoonBreadcrumbTheme>? other, double t) {
MoonBreadcrumbTheme lerp(
ThemeExtension<MoonBreadcrumbTheme>? other,
double t,
) {
if (other is! MoonBreadcrumbTheme) return this;

return MoonBreadcrumbTheme(
Expand Down
18 changes: 11 additions & 7 deletions lib/src/theme/progress/linear_progress/linear_progress_sizes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:moon_design/src/theme/progress/linear_progress/linear_progress_s
import 'package:moon_design/src/theme/tokens/tokens.dart';

@immutable
class MoonLinearProgressSizes extends ThemeExtension<MoonLinearProgressSizes> with DiagnosticableTreeMixin {
class MoonLinearProgressSizes extends ThemeExtension<MoonLinearProgressSizes>
with DiagnosticableTreeMixin {
/// The tokens of the Moon Design System.
final MoonTokens tokens;

Expand Down Expand Up @@ -37,39 +38,39 @@ class MoonLinearProgressSizes extends ThemeExtension<MoonLinearProgressSizes> wi
progressHeight: tokens.sizes.x6s,
thumbSizeValue: tokens.sizes.x3s,
verticalGap: tokens.sizes.x4s,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
),
x5s = x5s ??
MoonLinearProgressSizeProperties(
borderRadius: tokens.borders.surfaceXs,
progressHeight: tokens.sizes.x5s,
thumbSizeValue: tokens.sizes.x3s,
verticalGap: tokens.sizes.x4s,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
),
x4s = x4s ??
MoonLinearProgressSizeProperties(
borderRadius: tokens.borders.surfaceSm,
progressHeight: tokens.sizes.x4s,
thumbSizeValue: tokens.sizes.x3s,
verticalGap: 6,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
),
x3s = x3s ??
MoonLinearProgressSizeProperties(
borderRadius: tokens.borders.surfaceMd,
progressHeight: tokens.sizes.x3s,
thumbSizeValue: tokens.sizes.x2s,
verticalGap: 6,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
),
x2s = x2s ??
MoonLinearProgressSizeProperties(
borderRadius: tokens.borders.surfaceLg,
progressHeight: tokens.sizes.x2s,
thumbSizeValue: tokens.sizes.x2s,
verticalGap: tokens.sizes.x5s,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
);

@override
Expand All @@ -92,7 +93,10 @@ class MoonLinearProgressSizes extends ThemeExtension<MoonLinearProgressSizes> wi
}

@override
MoonLinearProgressSizes lerp(ThemeExtension<MoonLinearProgressSizes>? other, double t) {
MoonLinearProgressSizes lerp(
ThemeExtension<MoonLinearProgressSizes>? other,
double t,
) {
if (other is! MoonLinearProgressSizes) return this;

return MoonLinearProgressSizes(
Expand Down
17 changes: 13 additions & 4 deletions lib/src/theme/progress_pin/progress_pin_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:moon_design/src/theme/progress_pin/progress_pin_properties.dart'
import 'package:moon_design/src/theme/tokens/tokens.dart';

@immutable
class MoonProgressPinTheme extends ThemeExtension<MoonProgressPinTheme> with DiagnosticableTreeMixin {
class MoonProgressPinTheme extends ThemeExtension<MoonProgressPinTheme>
with DiagnosticableTreeMixin {
/// The tokens of the Moon Design System.
final MoonTokens tokens;

Expand Down Expand Up @@ -36,7 +37,7 @@ class MoonProgressPinTheme extends ThemeExtension<MoonProgressPinTheme> with Dia
pinWidth: 36,
pinBorderWidth: tokens.sizes.x6s,
shadowElevation: 6,
textStyle: tokens.typography.caption.text10,
textStyle: tokens.typography.body.text10,
);

@override
Expand All @@ -53,7 +54,10 @@ class MoonProgressPinTheme extends ThemeExtension<MoonProgressPinTheme> with Dia
}

@override
MoonProgressPinTheme lerp(ThemeExtension<MoonProgressPinTheme>? other, double t) {
MoonProgressPinTheme lerp(
ThemeExtension<MoonProgressPinTheme>? other,
double t,
) {
if (other is! MoonProgressPinTheme) return this;

return MoonProgressPinTheme(
Expand All @@ -70,6 +74,11 @@ class MoonProgressPinTheme extends ThemeExtension<MoonProgressPinTheme> with Dia
..add(DiagnosticsProperty("type", "MoonProgressPinTheme"))
..add(DiagnosticsProperty<MoonTokens>("tokens", tokens))
..add(DiagnosticsProperty<MoonProgressPinColors>("colors", colors))
..add(DiagnosticsProperty<MoonProgressPinProperties>("properties", properties));
..add(
DiagnosticsProperty<MoonProgressPinProperties>(
"properties",
properties,
),
);
}
}
12 changes: 8 additions & 4 deletions lib/src/theme/switch/switch_sizes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:moon_design/src/theme/switch/switch_size_properties.dart';
import 'package:moon_design/src/theme/tokens/tokens.dart';

@immutable
class MoonSwitchSizes extends ThemeExtension<MoonSwitchSizes> with DiagnosticableTreeMixin {
class MoonSwitchSizes extends ThemeExtension<MoonSwitchSizes>
with DiagnosticableTreeMixin {
/// The tokens of the Moon Design System.
final MoonTokens tokens;

Expand All @@ -30,7 +31,8 @@ class MoonSwitchSizes extends ThemeExtension<MoonSwitchSizes> with Diagnosticabl
thumbSizeValue: tokens.sizes.x3s,
iconSizeValue: tokens.sizes.x3s,
padding: EdgeInsets.all(tokens.sizes.x6s),
textStyle: tokens.typography.caption.text6.copyWith(letterSpacing: 0),
textStyle:
tokens.typography.body.text6.copyWith(letterSpacing: 0),
),
xs = xs ??
MoonSwitchSizeProperties(
Expand All @@ -39,7 +41,8 @@ class MoonSwitchSizes extends ThemeExtension<MoonSwitchSizes> with Diagnosticabl
thumbSizeValue: tokens.sizes.x2s,
iconSizeValue: tokens.sizes.x2s,
padding: EdgeInsets.all(tokens.sizes.x5s),
textStyle: tokens.typography.caption.text8.copyWith(letterSpacing: 0.1),
textStyle:
tokens.typography.body.text8.copyWith(letterSpacing: 0.1),
),
sm = sm ??
MoonSwitchSizeProperties(
Expand All @@ -48,7 +51,8 @@ class MoonSwitchSizes extends ThemeExtension<MoonSwitchSizes> with Diagnosticabl
thumbSizeValue: tokens.sizes.xs,
iconSizeValue: tokens.sizes.xs,
padding: EdgeInsets.all(tokens.sizes.x5s),
textStyle: tokens.typography.caption.text10.copyWith(letterSpacing: 0.1),
textStyle:
tokens.typography.body.text10.copyWith(letterSpacing: 0.1),
);

@override
Expand Down
Loading