"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var example_app_base_1 = require("@uifabric/example-app-base");
var SearchBox_Small_Example_1 = require("./examples/SearchBox.Small.Example");
var SearchBox_FullSize_Example_1 = require("./examples/SearchBox.FullSize.Example");
var Styling_1 = require("../../Styling");
var ComponentStatus_1 = require("../../demo/ComponentStatus/ComponentStatus");
var SearchBox_checklist_1 = require("./SearchBox.checklist");
var SearchBoxSmallExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/SearchBox/examples/SearchBox.Small.Example.tsx');
var SearchBoxFullSizeExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/SearchBox/examples/SearchBox.FullSize.Example.tsx');
var SearchBoxPage = (function (_super) {
    tslib_1.__extends(SearchBoxPage, _super);
    function SearchBoxPage() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SearchBoxPage.prototype.render = function () {
        return (React.createElement(example_app_base_1.ComponentPage, { title: 'SearchBox', componentName: 'SearchBoxExample', exampleCards: React.createElement("div", null,
                React.createElement(example_app_base_1.ExampleCard, { title: 'Default SearchBox', code: SearchBoxSmallExampleCode },
                    React.createElement(SearchBox_Small_Example_1.SearchBoxSmallExample, null)),
                React.createElement(example_app_base_1.ExampleCard, { title: 'SearchBox with no parent container', code: SearchBoxFullSizeExampleCode },
                    React.createElement(SearchBox_FullSize_Example_1.SearchBoxFullSizeExample, null))), propertiesTables: React.createElement(example_app_base_1.PropertiesTableSet, { sources: [
                    require('!raw-loader!office-ui-fabric-react/src/components/SearchBox/SearchBox.Props.ts')
                ] }), overview: React.createElement("div", null,
                React.createElement("p", null, "SearchBoxes provide an input field for searching through content, allowing users to locate specific items within the website or app."),
                React.createElement("h2", { className: Styling_1.FontClassNames.xLarge }, "Zero input state "),
                React.createElement("p", null, "When the user has clicked into the SearchBox, but has not entered any text, there is an opportunity to display \"hint text\" within the input field, explaining what a user can do next. This could prompt a user to search for specific type content, or explain the scope of the search. Examples include \"type to search\", \"try searching for <x>\", \"search for a place\" or \"type to search in <x location>\"."),
                React.createElement("h2", { className: Styling_1.FontClassNames.xLarge }, "Autocomplete suggestions"),
                React.createElement("p", null, "As the user enters a query string, they are provided with a dropdown of autocomplete suggestions or disambiguation options. This will help them expedite the input process and formulate an effective query. Recent search history, trending searches, contextual search suggestions, hints and tips are all good candidates for autocomplete content. In general, autocomplete suggestions have the user's input highlighted in some way (generally bolded) to indicate why it's being displayed. As the user enters more keystrokes, the suggestions update continuously/in real time. To see autocomplete suggestions, the user does not need to hit enter (execute a full search), as it is a lightweight way to get quick suggestions or results. If there are mixed result types within the autocomplete suggestions, provide visual indicators or grouping to help organize the information, making it easier to parse."),
                React.createElement("h2", { className: Styling_1.FontClassNames.xLarge }, "Full search"),
                React.createElement("p", null, "If a user hits \"enter\" after entering input, a full search is executed. Full searches often go to another \"results\" page, or change/filter the content of the current page to show only applicable content. The results can appear in any form that best communicates the content."),
                React.createElement("p", null, "As a general guideline, results should be displayed in context with the query that was typed, with immediate access to edit the query or enter a new one. One method to enable efficient access to both edit the previous query and enter a new query is to highlight the previous query when the field is reactivated. This way, any keystroke will replace the previous string, but the string is maintained so that the user can position a cursor to edit or append the previous string."),
                React.createElement("h2", { className: Styling_1.FontClassNames.xLarge }, "Search scopes"),
                React.createElement("p", null, "Although search entry points tend to be similarly visualized, they can provide access to results that range from broad to narrow. By effectively communicating the scope of a search, you can help to ensure that the user expectation will be met by the capabilities of the search you are performing, which will reduce the possibility of frustration. The search entry point should be juxtaposed with the content being searched."),
                React.createElement("p", null, "Some common search scopes include:"),
                React.createElement("ul", null,
                    React.createElement("li", null,
                        React.createElement("strong", null, "Global:"),
                        " Search across multiple sources of cloud and local content. Varied results include URLs, documents, media, actions, apps, and more."),
                    React.createElement("li", null,
                        React.createElement("strong", null, "Web:"),
                        " Search a web index. Results include pages, entities, and answers."),
                    React.createElement("li", null,
                        React.createElement("strong", null, "My stuff:"),
                        " Search across device(s), cloud, social graphs, and more. Results are varied, but are constrained by the connection to user account(s).")),
                React.createElement("h2", { className: Styling_1.FontClassNames.xLarge }, "SearchBox with no parent container"),
                React.createElement("p", null, "Use a SearchBox without a parent container when it is not restricted to a certain width to accommodate other content. This search box will span the entire width of the space it's in.")), bestPractices: React.createElement("div", null), dos: React.createElement("div", null,
                React.createElement("ul", null,
                    React.createElement("li", null, "Use placeholder text in the SearchBox to describe what users can search for."),
                    React.createElement("li", null, "Example: \"Search\"; \"Search files\"; \"Search site\""),
                    React.createElement("li", null, "Once the user has clicked into the SearchBox but hasn\u2019t entered input yet, use \"hint text\" to communicate search scope."),
                    React.createElement("li", null, "Examples: \"Try searching for a PDFs\"; \"Search contacts list\"; \"Type to find <content type>\""),
                    React.createElement("li", null, "Provide autocomplete suggestions to help the user search quickly. These suggestions can be from past searches or auto-completions of the user's query text."),
                    React.createElement("li", null, "Provide autocomplete suggestions where there are strong matches to the user's query that the user may want to view immediately."),
                    React.createElement("li", null, "Use a visual separator to define a group of a similar or conceptually aligned autocomplete suggestions."),
                    React.createElement("li", null, "If possible, provide a preview (e.g. image, title, etc.) for autocomplete suggestions to help the user quickly determine if the suggested result is what they were searching for."))), donts: React.createElement("div", null,
                React.createElement("ul", null,
                    React.createElement("li", null, "Don't leave the SearchBox blank because it's too ambiguous."),
                    React.createElement("li", null, "Don't have lengthy and unclear hint text. It should be used to clarify and set expectations."),
                    React.createElement("li", null, "Don't provide too many autocomplete suggestions, as that will overwhelm the user."),
                    React.createElement("li", null, "Don't provide inaccurate matches or bad predictions, as it will make search seem unreliable and will result in user frustration."),
                    React.createElement("li", null, "Don\u2019t provide too much information or metadata in the suggestions list; it\u2019s intended to be lightweight."),
                    React.createElement("li", null, "Don\u2019t use an autocomplete dropdown for something that has one choice; there must be more than one item."),
                    React.createElement("li", null, "Don't build a custom search control based on the default text box or any other control."),
                    React.createElement("li", null, "Don't use SearchBox if you cannot reliably provide accurate results."))), isHeaderVisible: this.props.isHeaderVisible, componentStatus: React.createElement(ComponentStatus_1.ComponentStatus, tslib_1.__assign({}, SearchBox_checklist_1.SearchBoxStatus)) }));
    };
    return SearchBoxPage;
}(React.Component));
exports.SearchBoxPage = SearchBoxPage;
//# sourceMappingURL=SearchBoxPage.js.map