diff --git a/bundlesize.config.json b/bundlesize.config.json index 5cccda9..edac214 100644 --- a/bundlesize.config.json +++ b/bundlesize.config.json @@ -5,7 +5,7 @@ }, { "resourceModule": "skins.vector.styles", - "maxSize": "9.8 kB" + "maxSize": "10.1 kB" }, { "resourceModule": "skins.vector.legacy.js", diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 0bc56d6..739d184 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -411,7 +411,9 @@ class SkinVector extends SkinMustache { $commonSkinData['data-search-box'] = $this->getSearchData( $commonSkinData['data-search-box'], - !$this->isLegacy() + !$this->isLegacy(), + true, + 'searchform' ); return $commonSkinData; @@ -422,22 +424,31 @@ class SkinVector extends SkinMustache { * * @param array $searchBoxData * @param bool $isCollapsible + * @param bool $isPrimary + * @param string $formId * @return array modified version of $searchBoxData */ - private function getSearchData( array $searchBoxData, bool $isCollapsible ) { - $searchClass = 'vector-search-box'; + private function getSearchData( array $searchBoxData, bool $isCollapsible, bool $isPrimary, string $formId ) { + $searchClass = ''; + + // Determine the search widget treatment to send to the user + if ( VectorServices::getFeatureManager()->isFeatureEnabled( Constants::FEATURE_USE_WVUI_SEARCH ) ) { + $searchClass .= 'vector-search-box-vue '; + } if ( $isCollapsible ) { - $searchClass .= ' vector-search-box-collapses'; + $searchClass .= ' vector-search-box-collapses '; } if ( $this->shouldSearchExpand() ) { - $searchClass .= " " . self::SEARCH_EXPANDING_CLASS; + $searchClass .= ' ' . self::SEARCH_EXPANDING_CLASS; } // Annotate search box with a component class. - $searchBoxData['class'] = $searchClass; + $searchBoxData['class'] = trim( $searchClass ); $searchBoxData['is-collapsible'] = $isCollapsible; + $searchBoxData['is-primary'] = $isPrimary; + $searchBoxData['form-id'] = $formId; // At lower resolutions the search input is hidden search and only the submit button is shown. // It should behave like a form submit link (e.g. submit the form with no input value). diff --git a/includes/templates/SearchBox.mustache b/includes/templates/SearchBox.mustache index 52c36ed..9231856 100644 --- a/includes/templates/SearchBox.mustache +++ b/includes/templates/SearchBox.mustache @@ -1,16 +1,20 @@ {{! See @typedef SearchData }} -