diff --git a/assets/fonts/Roboto-Black.ttf b/assets/fonts/Roboto-Black.ttf new file mode 100644 index 0000000..d51221a Binary files /dev/null and b/assets/fonts/Roboto-Black.ttf differ diff --git a/assets/fonts/Roboto-Bold.ttf b/assets/fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..9d7cf22 Binary files /dev/null and b/assets/fonts/Roboto-Bold.ttf differ diff --git a/assets/fonts/Roboto-ExtraBold.ttf b/assets/fonts/Roboto-ExtraBold.ttf new file mode 100644 index 0000000..7092a88 Binary files /dev/null and b/assets/fonts/Roboto-ExtraBold.ttf differ diff --git a/assets/fonts/Roboto-ExtraLight.ttf b/assets/fonts/Roboto-ExtraLight.ttf new file mode 100644 index 0000000..75608c6 Binary files /dev/null and b/assets/fonts/Roboto-ExtraLight.ttf differ diff --git a/assets/fonts/Roboto-Light.ttf b/assets/fonts/Roboto-Light.ttf new file mode 100644 index 0000000..6fcd5f9 Binary files /dev/null and b/assets/fonts/Roboto-Light.ttf differ diff --git a/assets/fonts/Roboto-Medium.ttf b/assets/fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..d629e98 Binary files /dev/null and b/assets/fonts/Roboto-Medium.ttf differ diff --git a/assets/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..7e3bb2f Binary files /dev/null and b/assets/fonts/Roboto-Regular.ttf differ diff --git a/assets/fonts/Roboto-SemiBold.ttf b/assets/fonts/Roboto-SemiBold.ttf new file mode 100644 index 0000000..3f34834 Binary files /dev/null and b/assets/fonts/Roboto-SemiBold.ttf differ diff --git a/assets/fonts/Roboto-Thin.ttf b/assets/fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..6ee97b8 Binary files /dev/null and b/assets/fonts/Roboto-Thin.ttf differ diff --git a/assets/fonts/RobotoFlex.ttf b/assets/fonts/RobotoFlex.ttf deleted file mode 100644 index 2e5c2a2..0000000 Binary files a/assets/fonts/RobotoFlex.ttf and /dev/null differ diff --git a/example/lib/storybook.dart b/example/lib/storybook.dart index cf290b0..e6ed625 100644 --- a/example/lib/storybook.dart +++ b/example/lib/storybook.dart @@ -12,6 +12,7 @@ class StorybookApp extends StatelessWidget { return UtilsMaterialWrapper(widget: widget); }, stories: [ + ChipsButtonWidget.story, BigButtonWidget.story, SmallButtonWidget.story, BubbleButtonWidget.story, diff --git a/lib/src/presentation/theme/styles.dart b/lib/src/presentation/theme/styles.dart index 6d9c9b1..1992717 100644 --- a/lib/src/presentation/theme/styles.dart +++ b/lib/src/presentation/theme/styles.dart @@ -4,7 +4,7 @@ import 'package:matule_uikit/matule_uikit.dart'; class Styles { final Palette palette; - final String _family = "RobotoFlex"; + final String _family = "Roboto"; final String _package = "matule_uikit"; Styles({required this.palette}); @@ -152,4 +152,13 @@ class Styles { height: 20 / 12, letterSpacing: 0, ); + + TextStyle get textMedium15Old => TextStyle( + fontFamily: _family, + package: _package, + fontWeight: FontWeight.w500, + fontSize: 15.sp, + height: 20 / 15, + letterSpacing: 0, + ); } diff --git a/lib/src/presentation/widgets/button_widget.dart b/lib/src/presentation/widgets/button_widget.dart index ac581ac..3100cc4 100644 --- a/lib/src/presentation/widgets/button_widget.dart +++ b/lib/src/presentation/widgets/button_widget.dart @@ -48,7 +48,7 @@ abstract class BaseStateButtonWidget extends StatelessWidget { final CustomTheme theme; final Function()? onTap; final Color backgroundColor; - final Color disabledBackgroundColor; + final Color? disabledBackgroundColor; final Color strokeColor; final String text; final Color textColor; @@ -64,7 +64,7 @@ abstract class BaseStateButtonWidget extends StatelessWidget { required this.strokeColor, }); - double get _width; + double? get _width; double get _height; @@ -360,3 +360,56 @@ class SmallButtonWidget extends BigButtonWidget { }, ); } + +class ChipsButtonWidget extends BaseStateButtonWidget { + final bool active; + + ChipsButtonWidget({ + super.key, + required super.theme, + required this.active, + required super.onTap, + required super.text, + }) : super( + textColor: active + ? theme.palette.whiteOld + : theme.palette.descriptionOld, + backgroundColor: active + ? theme.palette.accentOld + : theme.palette.inputBackgroundOld, + disabledBackgroundColor: null, + strokeColor: Colors.transparent, + ); + + @override + double get _height => 48.h; + + @override + double? get _width => null; + + @override + EdgeInsets get _padding => + EdgeInsets.symmetric(horizontal: 20.w, vertical: 14.h); + + @override + TextStyle get _textStyle => theme.styles.textMedium15Old; + + static Story get story => Story( + name: "ChipsButton", + builder: (BuildContext context) { + var theme = CustomTheme.of(context); + onTap() { + debugPrint("ChipsButton pressed!"); + } + + String text = context.knobs.text(label: "Text", initial: "Добавить"); + bool active = context.knobs.boolean(label: "Active", initial: true); + return ChipsButtonWidget( + theme: theme, + active: active, + onTap: onTap, + text: text, + ); + }, + ); +} diff --git a/pubspec.yaml b/pubspec.yaml index c6d8f46..7bfede4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,6 +27,24 @@ flutter: - assets/icons/ fonts: - - family: RobotoFlex + - family: Roboto fonts: - - asset: assets/fonts/RobotoFlex.ttf + - asset: assets/fonts/Roboto-Thin.ttf + weight: 100 + - asset: assets/fonts/Roboto-ExtraLight.ttf + weight: 200 + - asset: assets/fonts/Roboto-Light.ttf + weight: 300 + - asset: assets/fonts/Roboto-Regular.ttf + weight: 400 + - asset: assets/fonts/Roboto-Medium.ttf + weight: 500 + - asset: assets/fonts/Roboto-SemiBold.ttf + weight: 600 + - asset: assets/fonts/Roboto-Bold.ttf + weight: 700 + - asset: assets/fonts/Roboto-ExtraBold.ttf + weight: 800 + - asset: assets/fonts/Roboto-Black.ttf + weight: 900 +