Skip to content
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
3 changes: 2 additions & 1 deletion docs/styler-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ final fluent = CardStyler().color(Colors.blue);
| Alias of a canonical operation | Do not add one. A canonical operation has exactly one spelling. |
| Slot-forwarding convenience (`titleColor`, `labelFontSize`) | Keep it fluent-only. It names a child slot rather than duplicating a canonical operation. |
| Styler lifecycle or composition (`animate`, `variants`, `wrap`, `modifier`, `merge`) | Keep it fluent-only because it configures or combines an existing parent styler. |
| Generic variant or callable widget helper | Keep it as an extension method; it operates on an existing styler. |
| Generic variant helper | Keep it as an extension method; it operates on an existing styler. |
| Callable widget helper | Generate it with `@MixableSpec(target: RemixWidget.new)` so it stays aligned with the widget constructor. |
| Name conflict | Give the component-specific behavior a descriptive name and reserve the canonical name for the generated surface. |

Factories are generated from each component spec. Do not add public methods
Expand Down
5 changes: 5 additions & 0 deletions packages/remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 1.0.0-beta.4

- **BREAKING**: Replace handwritten component `Styler.call(...)` extensions
with generator-owned instance methods. Ordinary `.call(...)` and callable
styler syntax remain source-compatible, but explicit references to the old
`Remix*StylerRemixHelpers` call extensions are removed.
- **FEAT**: Add a generated callable widget surface to `DataTableStyler`.
- **BREAKING**: `RemixSelectTrigger` gains `collapsedIcon` and `expandedIcon`,
replacing the hardcoded trigger chevron. Each state falls back independently,
so a trigger that only sets one keeps the default for the other.
Expand Down
41 changes: 41 additions & 0 deletions packages/remix/lib/src/components/accordion/accordion.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
part of 'accordion.dart';

/// Resolved visual properties for a [RemixAccordion].
@MixableSpec(extraStylerMixins: [RemixBoxStylerMixin])
@MixableSpec(
target: RemixAccordion.new,
extraStylerMixins: [RemixBoxStylerMixin],
)
class AccordionSpec with _$AccordionSpec {
/// Outer panel: radius, border, fill, and clipping shared by [trigger] and
/// [content].
Expand Down
43 changes: 0 additions & 43 deletions packages/remix/lib/src/components/accordion/accordion_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,47 +103,4 @@ extension RemixAccordionStylerRemixHelpers on AccordionStyler {
value,
);
}

/// Creates a [RemixAccordion] widget with this style applied.
RemixAccordion<T> call<T>({
Key? key,
required T value,
required Widget child,
String? title,
IconData? leadingIcon,
IconData? trailingIcon,
NakedAccordionTriggerBuilder<T>? builder,
bool enabled = true,
MouseCursor mouseCursor = SystemMouseCursors.click,
bool enableFeedback = true,
bool autofocus = false,
FocusNode? focusNode,
ValueChanged<bool>? onFocusChange,
ValueChanged<bool>? onHoverChange,
ValueChanged<bool>? onPressChange,
String? semanticLabel,
Widget Function(Widget, Animation<double>)? transitionBuilder,
}) {
return RemixAccordion(
key: key,
value: value,
title: title,
leadingIcon: leadingIcon,
trailingIcon: trailingIcon,
enabled: enabled,
mouseCursor: mouseCursor,
enableFeedback: enableFeedback,
autofocus: autofocus,
focusNode: focusNode,
onFocusChange: onFocusChange,
onHoverChange: onHoverChange,
onPressChange: onPressChange,
semanticLabel: semanticLabel,
transitionBuilder:
transitionBuilder ?? RemixAccordion.defaultAccordionTransitionBuilder,
style: this,
child: child,
builder: builder,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ class RemixAccordion<T> extends StatelessWidget {
this.onHoverChange,
this.onPressChange,
this.semanticLabel,
this.transitionBuilder = defaultAccordionTransitionBuilder,
Widget Function(Widget, Animation<double>)? transitionBuilder,
this.style = const AccordionStyler.create(),
this.styleSpec,
}) : assert(
}) : transitionBuilder =
transitionBuilder ?? defaultAccordionTransitionBuilder,
assert(
title != null || builder != null,
'Either title or builder must be provided',
);
Expand Down
1 change: 0 additions & 1 deletion packages/remix/lib/src/components/avatar/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ import '../../style/style.dart';
import '../../utilities/remix_style.dart';

part 'avatar_spec.dart';
part 'avatar_style.dart';
part 'avatar_widget.dart';
part 'avatar.g.dart';
27 changes: 27 additions & 0 deletions packages/remix/lib/src/components/avatar/avatar.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/remix/lib/src/components/avatar/avatar_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ part of 'avatar.dart';

/// Resolved visual properties for a [RemixAvatar].
@MixableSpec(
target: RemixAvatar.new,
extraStylerMixins: [RemixBoxStylerMixin, LabelStyleMixin, IconStyleMixin],
)
class AvatarSpec with _$AvatarSpec {
Expand Down
32 changes: 0 additions & 32 deletions packages/remix/lib/src/components/avatar/avatar_style.dart

This file was deleted.

1 change: 0 additions & 1 deletion packages/remix/lib/src/components/badge/badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ import '../../utilities/remix_style.dart';
import '../../rendering/remix_box_effects.dart';

part 'badge_spec.dart';
part 'badge_style.dart';
part 'badge_widget.dart';
part 'badge.g.dart';
15 changes: 15 additions & 0 deletions packages/remix/lib/src/components/badge/badge.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/remix/lib/src/components/badge/badge_spec.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
part of 'badge.dart';

/// Resolved visual properties for a [RemixBadge].
@MixableSpec(extraStylerMixins: [RemixBoxStylerMixin, LabelStyleMixin])
@MixableSpec(
target: RemixBadge.new,
extraStylerMixins: [RemixBoxStylerMixin, LabelStyleMixin],
)
class BadgeSpec with _$BadgeSpec {
@override
@MixableField(forwardStyler: true)
Expand Down
18 changes: 0 additions & 18 deletions packages/remix/lib/src/components/badge/badge_style.dart

This file was deleted.

1 change: 0 additions & 1 deletion packages/remix/lib/src/components/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ import '../../utilities/remix_style.dart';
import '../spinner/spinner.dart';

part 'button_spec.dart';
part 'button_style.dart';
part 'button_widget.dart';
part 'button.g.dart';
45 changes: 45 additions & 0 deletions packages/remix/lib/src/components/button/button.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/remix/lib/src/components/button/button_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum RemixIconAlignment { start, end }
/// - [RemixButton] for the widget implementation
/// - [Spec] for the base specification pattern
@MixableSpec(
target: RemixButton.new,
extraStylerMixins: [
RemixBoxStylerMixin,
LabelStyleMixin,
Expand Down
Loading
Loading