7 class ButtonStyleShowcaseWidget extends OOUI\Widget {
9 protected static $styles = [
12 'flags' => [ 'progressive' ],
15 'flags' => [ 'constructive' ],
18 'flags' => [ 'destructive' ],
21 'flags' => [ 'primary', 'progressive' ],
24 'flags' => [ 'primary', 'constructive' ],
27 'flags' => [ 'primary', 'destructive' ],
30 protected static $states = [
41 'indicator' => 'down',
45 'title' => "Title text",
48 'indicator' => 'down',
52 'indicator' => 'down',
60 'title' => "Title text",
64 'indicator' => 'down',
69 public function __construct( array $config = [] ) {
70 parent::__construct( $config );
72 $this->addClasses( [ 'demo-buttonStyleShowcaseWidget' ] );
74 foreach ( self::$styles as $style ) {
75 $buttonRow = new OOUI\Tag( 'div' );
76 foreach ( self::$states as $state ) {
77 $buttonRow->appendContent(
78 new OOUI\ButtonWidget( array_merge( $style, $state ) )
81 $this->appendContent( $buttonRow );
85 protected function getJavaScriptClassName() {
86 return 'Demo.ButtonStyleShowcaseWidget';