Part of #1331. Needs the standard and the metrics issues.
Scope
lib/shared/widgets/querya_button.dart, exported from widgets.dart:
QueryaButton.primary(label: 'Save', onPressed: _save)
QueryaButton.secondary(label: 'Explain', icon: Icons.account_tree_outlined, onPressed: _explain)
QueryaButton.ghost(label: 'Cancel', onPressed: _close)
QueryaButton.destructive(label: 'Delete', onPressed: _delete) // filled
QueryaButton.secondary(label: 'Rollback', tone: QueryaButtonTone.destructive, ...) // red text
QueryaButton.icon(icon: Icons.refresh, tooltip: 'Refresh', onPressed: _reload) // = QueryaIconButton
Common parameters: size (sm / md / lg, default from QueryaControlScope), icon, trailing, shortcutHint, loading, tooltip, isActive, compact (icon-only on narrow toolbars, label becomes the tooltip), autofocus, semanticLabel.
- Built on
Focus + MouseRegion + GestureDetector / InkResponse, no shadcn_flutter import.
- States and colours exactly as in the standard (hover / pressed / keyboard focus ring / disabled / loading / selected); colours from
context.workbench; motion from QueryaMotion, instant under reduced motion.
- Loading reserves the width of the label; the spinner is
QueryaSpinner of the matching size.
- Keyboard: Enter and Space activate, focus ring only for keyboard focus; semantics: button, label, enabled, busy.
QueryaActionButton stays as a thin deprecated wrapper so the migration can go file by file.
Acceptance
Part of #1331. Needs the standard and the metrics issues.
Scope
lib/shared/widgets/querya_button.dart, exported fromwidgets.dart:Common parameters:
size(sm/md/lg, default fromQueryaControlScope),icon,trailing,shortcutHint,loading,tooltip,isActive,compact(icon-only on narrow toolbars, label becomes the tooltip),autofocus,semanticLabel.Focus+MouseRegion+GestureDetector/InkResponse, noshadcn_flutterimport.context.workbench; motion fromQueryaMotion, instant under reduced motion.QueryaSpinnerof the matching size.QueryaActionButtonstays as a thin deprecated wrapper so the migration can go file by file.Acceptance
kQueryaTooltipWait.