Skip to content

Commit

Permalink
Move packages into a packages folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasilverentand committed Jan 13, 2025
1 parent 7dd7491 commit 95eff4c
Show file tree
Hide file tree
Showing 197 changed files with 687 additions and 275 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
- name: Install dependencies
run: flutter pub get
working-directory: oui
working-directory: packages/oui

- name: Run tests with coverage
run: flutter test --coverage
working-directory: oui
working-directory: packages/oui

- name: Upload coverage to Codecov
if: github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: oui/coverage/lcov.info
files: packages/oui/coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
31 changes: 0 additions & 31 deletions oui/lib/src/components/label.dart

This file was deleted.

39 changes: 0 additions & 39 deletions oui/lib/src/core/interpolation.dart

This file was deleted.

23 changes: 0 additions & 23 deletions oui/lib/src/core/typography.dart

This file was deleted.

71 changes: 0 additions & 71 deletions oui/test/src/components/aligner_test.dart

This file was deleted.

1 change: 0 additions & 1 deletion oui/test/src/core/colors/palette/color_palette_test.dart

This file was deleted.

20 changes: 0 additions & 20 deletions oui/test/src/core/screen/screen_testing_utils.dart

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions packages/oui/lib/src/components/label.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import 'package:flutter/widgets.dart' show Text, Widget;
import 'package:oui/src/core/text.dart';

import '../core/_index.dart';

class Label extends Component<Label>
with
ModifiableMaxLines<Label>,
ModifiableTextAlign<Label>,
ModifiableSoftWrap<Label>,
ModifiableTextOverflow<Label>,
ModifiableTextScaler<Label>,
ModifiableTextWidthMode<Label>,
ModifiableTextHeightBehavior<Label>,
ModifiableSemanticsLabel<Label> {
final String text;

const Label(
this.text, {
super.key,
super.modifiers,
});

@override
Label copyWith({ComponentModifiers? modifiers}) {
return Label(
text,
key: key,
modifiers: modifiers ?? this.modifiers,
);
}

@override
Widget buildWithModifiers(
ComponentContext context, [
Widget? child,
]) {
Text label = Text(text);

for (final modifier in modifiers) {
if (modifier is LabelModifier) {
label = modifier.modify(label, context);
}
}

return label;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
103 changes: 71 additions & 32 deletions oui/lib/src/core/colors.dart → packages/oui/lib/src/core/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1225,38 +1225,77 @@ class BoxColors {
});

static BoxColors generate(Color base, [BoxColors? previous]) {
return BoxColors(
content: AccentableColor.generate(
base,
base,
base,
),
surface: AccentableColor.generate(
base,
base,
base,
),
decoration: AccentableColor.generate(
base,
base,
base,
),
shadow: AccentableColor.generate(
(previous?.content.normal ?? base).darken(0.1),
(previous?.content.normal ?? base).darken(0.15),
(previous?.content.normal ?? base).darken(0.15),
),
edge: AccentableColor.generate(
(base).darken(0.1),
base.darken(0.1),
base.darken(0.1),
),
placeholder: AccentableColor.generate(
base,
base,
base,
),
);
if (base.isLight) {
final surface =
base.clampingSaturation(0, 0.01).clampingLightness(0, 0.1);
return BoxColors(
content: AccentableColor.generate(
base,
base,
base,
),
surface: AccentableColor.generate(
surface,
surface,
surface,
),
decoration: AccentableColor.generate(
base,
base,
base,
),
shadow: AccentableColor.generate(
(previous?.content.normal ?? base).darken(0.1),
(previous?.content.normal ?? base).darken(0.15),
(previous?.content.normal ?? base).darken(0.15),
),
edge: AccentableColor.generate(
(base).darken(0.1),
base.darken(0.1),
base.darken(0.1),
),
placeholder: AccentableColor.generate(
base,
base,
base,
),
);
} else {
final surface =
base.clampingSaturation(0, 0.01).clampingLightness(0, 0.1);
return BoxColors(
content: AccentableColor.generate(
base,
base,
base,
),
surface: AccentableColor.generate(
surface,
surface,
surface,
),
decoration: AccentableColor.generate(
base,
base,
base,
),
shadow: AccentableColor.generate(
(previous?.content.normal ?? base).darken(0.1),
(previous?.content.normal ?? base).darken(0.15),
(previous?.content.normal ?? base).darken(0.15),
),
edge: AccentableColor.generate(
(base).darken(0.1),
base.darken(0.1),
base.darken(0.1),
),
placeholder: AccentableColor.generate(
base,
base,
base,
),
);
}
}

@override
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ class AlignmentModifier extends ComponentModifier with ChildModifier {
}

mixin ModifiableAlignment<Type extends Component> on Component<Type> {
Type get centerContent => alignment(Alignment.center);

Type get centered => alignment(Alignment.center);

Type alignment(Alignment alignment) {
Expand Down
Loading

0 comments on commit 95eff4c

Please sign in to comment.