@salesforce-ux/design-system
Version:
Salesforce Lightning Design System
1 lines • 67.3 kB
JavaScript
var SLDS="object"==typeof SLDS?SLDS:{};SLDS["__internal/chunked/docs/ui/components/combobox/docs.mdx.js"]=function(e){function t(t){for(var i,l,a=t[0],c=t[1],r=t[2],p=0,u=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(n,l)&&n[l]&&u.push(n[l][0]),n[l]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(d&&d(t);u.length;)u.shift()();return s.push.apply(s,r||[]),o()}function o(){for(var e,t=0;t<s.length;t++){for(var o=s[t],i=!0,a=1;a<o.length;a++){var c=o[a];0!==n[c]&&(i=!1)}i&&(s.splice(t--,1),e=l(l.s=o[0]))}return e}var i={},n={22:0},s=[];function l(t){if(i[t])return i[t].exports;var o=i[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,l),o.l=!0,o.exports}l.m=e,l.c=i,l.d=function(e,t,o){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(l.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)l.d(o,i,function(t){return e[t]}.bind(null,i));return o},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/assets/scripts/bundle/";var a=this.webpackJsonpSLDS___internal_chunked_docs=this.webpackJsonpSLDS___internal_chunked_docs||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var r=0;r<a.length;r++)t(a[r]);var d=c;return s.push([214,0]),o()}({0:function(e,t){e.exports=React},18:function(e,t){e.exports=JSBeautify},19:function(e,t){e.exports=ReactDOM},214:function(e,t,o){"use strict";o.r(t),o.d(t,"getElement",(function(){return X})),o.d(t,"getContents",(function(){return Z}));var i=o(0),n=o.n(i),s=o(4),l=o(1),a=o(23),c=o(14),r=(o(11),o(24)),d=o(49),p=o(25),u=o(56),m=o(7),h=o(12),b=o(32),x=o(21),g=o(29),y=o(2),E=o(27),f=function(e){return n.a.createElement(x.c,{listboxClassName:"slds-dropdown slds-dropdown_fluid",vertical:!0,id:"listbox-unique-id"},n.a.createElement(x.d,null,n.a.createElement(x.b,{id:"listbox-option-unique-id-01",entityTitle:"Acme",entityMeta:!0,focused:e.focused})),n.a.createElement(x.d,null,n.a.createElement(x.b,{id:"listbox-option-unique-id-02",entityTitle:"Salesforce.com, Inc.",entityMeta:!0})))},O=n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-1",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-1",snapshot:E.g,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox",hasInteractions:!0}),_=[{id:"focused",label:"Focused",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-4",readonly:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-4",snapshot:E.h,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox",hasFocus:!0})},{id:"focused-open",label:"Focused - Opened",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-4",readonly:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-4",snapshot:E.g,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"highlighting-an-option",label:"Highlighting an option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-4",readonly:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-4",snapshot:E.h,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox","aria-activedescendant":"option1",isOpen:!0,hasFocus:!0})},{id:"selecting-a-single-option",label:"Selecting a single option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-6",readonly:!0,value:"Accounts",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-6",snapshot:E.k,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox","aria-activedescendant":"option1",isOpen:!0,hasFocus:!0})},{id:"selected-an-option-closed",label:"Selected an option - Closed",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-5",readonly:!0,value:"Accounts",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-5",snapshot:E.k,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox"})},{id:"selecting-multiple-options",label:"Selecting multiple options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-7",readonly:!0,value:"2 Options Selected",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-7",snapshot:E.i,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"selected-multiple-options-closed",label:"Selected multiple options-closed",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-8",readonly:!0,value:"2 Options Selected",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-8",snapshot:E.i,type:"plain",count:8,visualSelection:!0}),resultsType:"listbox",listboxOfSelections:n.a.createElement(u.a,{snapshot:E.j,count:2})})},{id:"loading-options",label:"Loading more options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-222",readonly:!0,value:"Accounts",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-222",snapshot:E.g,type:"plain",count:3,visualSelection:!0,loading:!0}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"grouped-options",label:"Grouped options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-3",readonly:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.c,{id:"listbox-id-3",className:"slds-dropdown slds-dropdown_fluid"},n.a.createElement(p.b,{"aria-label":"Group One",snapshot:E.o,count:3}),n.a.createElement(p.b,{"aria-label":"Group Two",snapshot:E.p,count:3})),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"deprecated-closed",label:"Deprecated - Closed",element:n.a.createElement("div",{className:"demo-only",style:{height:"10rem"}},n.a.createElement(x.a,{autocomplete:!0,inputIcon:"right",inputIconRightSymbol:"search",listbox:n.a.createElement(f,null)}))},{id:"deprecated-focused",label:"Deprecated - Focused",element:n.a.createElement("div",{className:"demo-only",style:{height:"10rem"}},n.a.createElement(x.a,{isOpen:!0,autocomplete:!0,inputIcon:"right",inputIconRightSymbol:"search",listbox:n.a.createElement(f,null)}))},{id:"deprecated-open-item-focused",label:"Deprecated - Open - Item Focused",element:n.a.createElement("div",{className:"demo-only",style:{height:"10rem"}},n.a.createElement(x.a,{isOpen:!0,autocomplete:!0,inputIcon:"right",inputIconRightSymbol:"search",listbox:n.a.createElement(f,{focused:!0}),"aria-activedescendant":"listbox-option-unique-id-01"}))},{id:"deprecated-closed-options-selected",label:"Deprecated - Option(s) Selected",element:n.a.createElement("div",{className:"demo-only",style:{height:"10rem"}},n.a.createElement(x.a,{inputIcon:"right",inputIconRightSymbol:"search",autocomplete:!0,listbox:n.a.createElement(f,null)},n.a.createElement(g.b,{className:"slds-p-top_xxx-small"},n.a.createElement(g.c,null,n.a.createElement(g.a,{label:"Acme",tabIndex:"0"},n.a.createElement(b.a,{containerClassName:"slds-pill__icon_container",title:"Account",assistiveText:"Account"}))),n.a.createElement(g.c,null,n.a.createElement(g.a,{label:"Salesforce.com, Inc."},n.a.createElement(b.a,{containerClassName:"slds-pill__icon_container",title:"Account",assistiveText:"Account"}))))))}],v=n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-9",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-9",snapshot:E.m,type:"plain",count:3}),resultsType:"listbox",hasInteractions:!0}),I=[{id:"focused-open",label:"Focused - Open",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-10",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-10",snapshot:E.m,type:"plain",count:3}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"lookup-focused-open",label:"Lookup - Focused - Open",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-15",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-15",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"typeahead",label:"Typeahead",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-11",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),value:"opp",results:n.a.createElement(p.e,{id:"listbox-id-11",snapshot:E.r,term:"opp",type:"plain",count:4}),resultsType:"listbox",isOpen:!0,hasFocus:!0})},{id:"lookup-typeahead",label:"Lookup - Typeahead",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-16",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),value:"salesforce",results:n.a.createElement(p.e,{id:"listbox-id-16",snapshot:E.d,term:"salesforce",type:"entity",count:4}),resultsType:"listbox","aria-activedescendant":"option0",isOpen:!0,hasFocus:!0})},{id:"highlighting-an-option",label:"Highlighting an option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-12",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-12",snapshot:E.n,type:"plain",count:3}),resultsType:"listbox","aria-activedescendant":"option1",isOpen:!0,hasFocus:!0})},{id:"lookup-highlighting-an-option",label:"Lookup - Highlighting an option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-17",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-17",snapshot:E.c,type:"entity",count:2}),resultsType:"listbox","aria-activedescendant":"option1",isOpen:!0,hasFocus:!0})},{id:"selected-an-option",label:"Selected an option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-unique-id-03",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(m.b,{className:"slds-input__icon slds-input__icon_right",symbol:"clear",title:"Clear the text input",assistiveText:"Clear the text input"}),results:n.a.createElement(p.e,{id:"listbox-unique-id-03",snapshot:E.m,type:"entity",count:3}),resultsType:"listbox",value:"GenePoint",hasSelection:!0,readonly:!0})},{id:"lookup-selected-an-option",label:"Lookup - Selected an option",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-18",inputIconPosition:"left-right",leftInputIcon:n.a.createElement(b.a,{symbol:"account",className:"slds-icon_small",containerClassName:"slds-combobox__input-entity-icon",assistiveText:"Account",title:"Account"}),rightInputIcon:n.a.createElement(m.b,{className:"slds-input__icon slds-input__icon_right",symbol:"close",title:"Remove selected option",assistiveText:"Remove selected option"}),results:n.a.createElement(p.e,{id:"listbox-id-18",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",hasSelection:!0,value:"Salesforce.com, Inc.",readonly:!0})},{id:"selected-multiple-options",label:"Selected multiple options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-13",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-13",snapshot:E.m,type:"entity",count:3}),resultsType:"listbox",hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.q,count:2})})},{id:"lookup-multiple-options",label:"Lookup - Selected multiple options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-19",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-19",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:2})})}],w=[{id:"lookup",label:"Lookup",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-14",autocomplete:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),results:n.a.createElement(p.e,{id:"listbox-id-14",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",hasInteractions:!0})}],j=y.c.uniqueId("combobox-id-"),T=y.c.uniqueId("primary-combobox-id-"),C=y.c.uniqueId("listbox-id-"),S=n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-20",comboboxID:"primary-combobox-id-1",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-20",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",hasInteractions:!0,comboboxAriaControls:"primary-combobox-id-1"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),hasInteractions:!0}),P=[{id:"focused-open",label:"Focused - Open",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-21",comboboxID:"primary-combobox-id-2",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-21",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",isOpen:!0,hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-2"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1})})},{id:"typeahead",label:"Typeahead",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-activedescendant":"option0","aria-controls":"listbox-id-22",comboboxID:"primary-combobox-id-2",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-22",snapshot:E.d,term:"salesforce",type:"entity",count:4}),resultsType:"listbox",value:"salesforce",isOpen:!0,hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-2"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1})})},{id:"typeahead-loading",label:"Typeahead - Loading",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-activedescendant":"option0","aria-controls":"listbox-id-23",comboboxID:"primary-combobox-id-2",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-23",snapshot:E.d,term:"salesforce",type:"entity",count:4}),resultsType:"listbox",value:"salesforce",isOpen:!0,showCloseButton:!0,isLoading:!0,hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-2"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"group-right"})},{id:"selected-options",label:"Selected Options",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-24",comboboxID:"primary-combobox-id-3",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-24",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-3"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:2})})},{id:"selected-options-open",label:"Selected Options - Open",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-25",comboboxID:"primary-combobox-id-4",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-25",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",isOpen:!0,hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-4"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:2})})},{id:"overflow-collapsed",label:"Selections in container - Overflowed - Collapsed",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-26",comboboxID:"primary-combobox-id-5",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-26",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-5"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:8})})},{id:"overflow-expanded",label:"Selections in container - Overflowed - Expanded",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-27",comboboxID:"primary-combobox-id-6",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-27",snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",hasFocus:!0,addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-6"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),hasSelection:!0,listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:8,isExpanded:!0})})},{id:"non-grouped-overflow-collapsed",label:"Selections - Collapsed",element:n.a.createElement(r.b,{id:j,"aria-controls":C,comboboxID:T,autocomplete:!0,results:n.a.createElement(p.e,{id:C,snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",hasSelection:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:8})})},{id:"non-grouped-overflow-expanded",label:"Selections - Expanded",element:n.a.createElement(r.b,{id:j,"aria-controls":C,comboboxID:T,autocomplete:!0,results:n.a.createElement(p.e,{id:C,snapshot:E.b,type:"entity",count:4}),resultsType:"listbox",hasSelection:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),listboxOfSelections:n.a.createElement(u.a,{snapshot:E.e,count:8,isExpanded:!0})})},{id:"scoping-results-focused",label:"Scoping results - Focused",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-28",comboboxID:"primary-combobox-id-7",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-28",snapshot:E.b,type:"entity",count:2}),addon:n.a.createElement(d.b,{id:y.c.uniqueId("combobox-id-"),value:"Accounts",addonPosition:"start",isOpen:!0,hasFocus:!0,comboboxAriaControls:"primary-combobox-id-7"}),resultsType:"listbox",addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1})})},{id:"scoping-results-icon",label:"Scoping results - Icon variant",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-29",comboboxID:"primary-combobox-id-9",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-29",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",addon:n.a.createElement(d.a,{id:y.c.uniqueId("combobox-id-"),value:"Apex",filteredSymbol:"apex",addonPosition:"start",comboboxAriaControls:"primary-combobox-id-9"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1})})},{id:"scoping-results-icon-focused",label:"Scoping results - Icon variant - Focused",element:n.a.createElement(r.a,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"listbox-id-30",comboboxID:"primary-combobox-id-8",autocomplete:!0,results:n.a.createElement(p.e,{id:"listbox-id-30",snapshot:E.b,type:"entity",count:2}),resultsType:"listbox",addon:n.a.createElement(d.a,{id:y.c.uniqueId("combobox-id-"),value:"Apex",filteredSymbol:"apex",addonPosition:"start",isOpen:!0,hasFocus:!0,comboboxAriaControls:"primary-combobox-id-8"}),addonPosition:"start",comboboxPosition:"end",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"search",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1})})}],N=o(34),k=o(13),q=o(8),A=o(30),D=function(){var e=y.c.uniqueId("popover-id-");return n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":e,label:"Languages",readonly:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:e,title:"Language Options",isFullWidth:!0,isHidden:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,null),n.a.createElement(k.a,null))},n.a.createElement("div",null,"Any content can go here in this Dialog"))})},F=n.a.createElement(D,null),L=[{id:"open",label:"Open",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-01",label:"Languages",readonly:!0,isOpen:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-01",title:"Language Options",isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement("div",null,"Any content can go here in this Dialog"))})}],M=[{id:"with-checkbox-group",label:"With Checkbox Group",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-02",label:"Languages",readonly:!0,isOpen:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-02",title:"Language Options",isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German"}),n.a.createElement(A.a,{label:"Tobagonian Creole English"}),n.a.createElement(A.a,{label:"Spanish"})))})},{id:"selecting-options",label:"Selecting Options",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-03",label:"Languages",readonly:!0,isOpen:!0,inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-03",title:"Language Options",isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German",checked:!0}),n.a.createElement(A.a,{label:"Tobagonian Creole English",checked:!0}),n.a.createElement(A.a,{label:"Spanish"})))})},{id:"open-one-option-selected",label:"Open - One Option Selected ",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-04",label:"Languages",readonly:!0,isOpen:!0,value:"German",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-04",title:"Language Options",isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German",checked:!0}),n.a.createElement(A.a,{label:"Tobagonian Creole English"}),n.a.createElement(A.a,{label:"Spanish"})))})},{id:"closed-one-option-selected",label:"Closed - One Option Selected",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-05",label:"Languages",readonly:!0,value:"German",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-05",title:"Language Options",isHidden:!0,isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German",checked:!0}),n.a.createElement(A.a,{label:"Tobagonian Creole English"}),n.a.createElement(A.a,{label:"Spanish"})))})},{id:"open-two-or-more-options-selected",label:"Open - Two or More Options Selected",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-06",label:"Languages",readonly:!0,isOpen:!0,value:"2 options selected",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-06",title:"Language Options",isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German",checked:!0}),n.a.createElement(A.a,{label:"Tobagonian Creole English",checked:!0}),n.a.createElement(A.a,{label:"Spanish"})))})},{id:"closed-two-or-more-options-selected",label:"Closed - Two or More Options Selected",element:n.a.createElement(r.b,{id:y.c.uniqueId("combobox-id-"),"aria-controls":"popover-unique-id-07",label:"Languages",readonly:!0,value:"2 options selected",inputIconPosition:"right",rightInputIcon:n.a.createElement(h.a,{symbol:"down",className:"slds-icon slds-icon_x-small slds-icon-text-default",containerClassName:"slds-input__icon slds-input__icon_right",assistiveText:!1,title:!1}),resultsType:"dialog",results:n.a.createElement(N.a,{popoverId:"popover-unique-id-07",title:"Language Options",isHidden:!0,isFullWidth:!0,hasFormFooter:!0,size:"small",footer:n.a.createElement(n.a.Fragment,null,n.a.createElement(k.a,{isNeutral:!0},"Cancel"),n.a.createElement(k.a,{isBrand:!0},"Done"))},n.a.createElement(q.a,{label:"Select up to 2"},n.a.createElement(A.a,{label:"English"}),n.a.createElement(A.a,{label:"German",checked:!0}),n.a.createElement(A.a,{label:"Tobagonian Creole English",checked:!0}),n.a.createElement(A.a,{label:"Spanish"})))})}],W=o(33),B=s.c.a,G=s.c.code,R=s.c.em,U=s.c.h2,z=s.c.h3,H=s.c.h4,K=s.c.h5,J=s.c.li,Y=s.c.p,Q=s.c.strong,V=s.c.ul,X=function(){return Object(i.createElement)(s.b,{},Object(i.createElement)("div",{className:"lead doc"},"A widget that provides a user with an input field that is either an autocomplete or readonly, accompanied by a listbox of options."),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"focused-open")),U({id:"Base-Combobox"},"Base Combobox"),Y({},"A Base Combobox is a readonly text ",G({},"input")," that allows a user to select an option from a pre-defined list of options. It does not allow free form user input, nor does it allow the user to modify the selected value."),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},O),z({id:"Combobox-markup"},"Combobox markup"),V({},J({},"A Combobox must come with an associated ",G({},"label")," element, with an appropriate ",G({},"for")," attribute"),J({},G({},"slds-combobox")," acts as the root node to the composite Combobox widget. It takes the ",G({},'role="combobox"')," attribute as a result",V({},J({},G({},'aria-haspopup="listbox"')," attribute is then applied to indicate the Combobox will display a popup, of type ",G({},"listbox")),J({},G({},'aria-expanded="true|false"')," attribute is applied to describe whether the popup of ",G({},"listbox")," is currently visible or not"))),J({},"The element ",G({},"slds-combobox__form-element")," between the ",G({},"combobox")," and its ",G({},"input")," must have ",G({},'role="none"'))),z({id:"Input-markup"},"Input markup"),V({},J({},"The ",G({},"input")," is an ",G({},"input")," with a role of ",G({},"textbox"),". The role is implicit on inputs, but in this case it doesn't hurt to be explicit"),J({},"The ",G({},"input")," has the following attributes:",V({},J({},G({},'autocomplete="off"')," to remove the browsers' suggestions from the ",G({},"input")),J({},G({},'aria-controls=""')," which points to the ID of the ",G({},"listbox"),". It informs assistive technology what DOM node the ",G({},"input")," controls, in terms of visibility and / or content"),J({},G({},"type")," attribute set to be ",G({},"text")," as it's not a search field"),J({},G({},"readonly"))))),z({id:"Mobile"},"Mobile"),Object(i.createElement)(W.a,{patternSpecificText:"comboboxes and the available options will have an increased size to accommodate tapping with a finger instead of the more precise mouse cursor"}),Object(i.createElement)(l.a,{frameStyles:{height:"20rem"},frameOnly:!0},Object(y.e)(_,"focused-open")),z({id:"Displaying-options"},"Displaying options"),Y({},"To toggle visibility of the ",G({},"listbox"),", add the class ",G({},"slds-is-open")," to the ",G({},"slds-dropdown-trigger")," element."),Y({},"It is most common to expand the ",G({},"listbox")," of options when a user clicks on the Combobox. For a more detailed description of interaction behaviors, see the ",B({href:"#Interaction"},"Interaction")," section."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Requirement"},Object(i.createElement)("p",null,"When toggling visibility of the Combobox, the ",Object(i.createElement)("code",null,"aria-expanded")," ","attribute needs to be toggled to ",Object(i.createElement)("code",null,"true"),". Set it to"," ",Object(i.createElement)("code",null,"false")," again when the options are hidden.")),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Note"},Object(i.createElement)("p",null,"The ",Object(i.createElement)("code",null,"listbox")," of options must be an ",Object(i.createElement)("b",null,"owned")," child of the"," ",Object(i.createElement)("code",null,"combobox"),". If it cannot be a direct child of the"," ",Object(i.createElement)("code",null,"combobox")," element, then ",Object(i.createElement)("code",null,"aria-owns")," must be placed on the ",Object(i.createElement)("code",null,"combobox")," and point to the ID of the ",Object(i.createElement)("code",null,"listbox")," ","instead.")),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"focused-open")),H({id:"Listbox-markup"},"Listbox markup"),V({},J({},"The ",G({},"listbox")," has ",G({},'role="listbox"')," applied"),J({},"The ",G({},"listbox")," can have child ",G({},"option"),"s. We place ",G({},'role="option"')," on a ",G({},"div")," element, inside a list item. As such the list item ",G({},"li")," needs to be removed from the Accessibility Tree with ",G({},'role="presentation"')),J({},"A ",G({},"listbox")," has the ability to group options together under a visual heading or label. This means the ",G({},'role="listbox"')," attribute is placed on a common parent element, which can wrap multiple lists (or groups) of options",V({},J({},"When a ",G({},"listbox")," has no option groups, the ",G({},"ul")," element has ",G({},'role="presentation"')," to remove it from the Accessibility Tree"))),J({},"Every ",G({},"option")," has ",G({},'aria-selected="false"')," by default"),J({},"Disabled ",G({},"option"),"s should have ",G({},'aria-disabled="true"')," applied along with ",B({href:"#Disabled-listbox-items"},"a class on the icon in an entity option"),".")),H({id:"Loading-more-options"},"Loading more options"),Y({},"If you are dynamically loading in more items to the listbox, the very last ",G({},"<li>")," of the ",G({},"<ul>")," should receive the ",G({},'role="presentation"')," attribute and have the ",B({href:"/components/spinners/"},"Spinner component")," injected into it."),Y({},"For layout purposes, wrap the spinner in a ",G({},"<div>")," with the class ",G({},"slds-align_absolute-center")," to position the spinner in the middle of the list item, as well as ",G({},"slds-p-top_medium")," to provide the appropriate amount of space for the spinner to be visible."),Object(i.createElement)(l.a,{demoStyles:"height: 14rem;"},Object(y.e)(_,"loading-options")),z({id:"Grouped-options"},"Grouped options"),Y({},"Options within a ",G({},"listbox")," can be grouped together under meaningful headings. This is useful if you wish to create separation between 2 or more sets of options within a single ",G({},"listbox"),"."),Object(i.createElement)(l.a,{demoStyles:"height: 18rem;"},Object(y.e)(_,"grouped-options")),H({id:"Grouped-listbox-markup"},"Grouped listbox markup"),V({},J({},"When a ",G({},"listbox")," has option groups, each group gets a visual label. Exactly like ",G({},"optgroup")," in a ",G({},"select")," element",V({},J({},"The ",G({},"ul")," element in this case has ",G({},'role="group"')," with an ",G({},"aria-label")," that matches the visible label"),J({},"Display the group label visually, but due to the way a ",G({},"listbox")," works it can only be marked as ",G({},'role="presentation"'),", as a ",G({},"listbox")," can only have ",G({},"option")," children. This allows us to communicate the group label visually and programmatically to a screen reader")))),z({id:"Styling-choices-for-options"},"Styling choices for options"),Y({},"The options in the ",G({},"listbox")," can have a left icon and/or metatext."),Object(i.createElement)(l.a,{demoStyles:"position: relative; height: 12rem;"},Object(i.createElement)(p.e,{id:"listbox-id-2",snapshot:E.s,type:"plain",count:4})),H({id:"Disabled-listbox-items"},"Disabled listbox items"),Y({},"Options in a listbox that are disabled require these accessibility and styling considerations:"),V({},J({},G({},'aria-disabled="true"')," must be applied to ",G({},"slds-listbox__option")),J({},"if using an entity icon, apply ",G({},"slds-icon_disabled")," to ",G({},"slds-icon_container"))),Y({},R({},"Plain options: Example shows two disabled options with one enabled one")),Object(i.createElement)(l.a,{demoStyles:"position: relative; height: 9rem;"},Object(i.createElement)(p.e,{id:y.c.uniqueId("listbox-id-"),snapshot:E.l,type:"plain",count:3})),Y({},R({},"Entity options: Example shows two disabled entity options with one enabled one")),Object(i.createElement)(l.a,{demoStyles:"position: relative; height: 9rem;"},Object(i.createElement)(p.e,{id:y.c.uniqueId("listbox-id-"),snapshot:E.a,type:"entity",count:3})),z({id:"Interaction"},"Interaction"),Y({},"At its most basic, the ",G({},"listbox")," of options should be displayed when a user interacts with the Combobox. When the user leaves the combobox the options are hidden. However, there are some differences when interacting with a Combobox with a mouse versus with a keyboard."),H({id:"Expanding-the-Combobox"},"Expanding the Combobox"),Y({},"A mouse or pointer device user can click on a Combobox and the ",G({},"listbox")," will display automatically whilst focus is placed inside the Combobox input field."),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"focused-open")),Y({},"If using a keyboard, placing focus into the Combobox input field ",R({},"will not")," display the ",G({},"listbox")," of options automatically."),Object(i.createElement)(l.a,null,Object(y.e)(_,"focused")),Y({},"After focusing inside the Combobox with the keyboard, pressing the ",G({},"Down")," or ",G({},"Enter")," key will expand the collapsed Combobox and display the ",G({},"listbox")," options. Be sure to update ",G({},"aria-expanded")," to be true. This will also highlight the first option in the listbox."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Requirement"},Object(i.createElement)("p",null,"Update ",Object(i.createElement)("code",null,"aria-expanded"),' to "true" when the Combobox is expanded.')),H({id:"Highlighting-an-option"},"Highlighting an option"),Y({},"To Highlight an option in the ",G({},"Listbox")," use the ",G({},"Up")," and ",G({},"Down")," arrow keys to cycle through all the available options in the list."),V({},J({},"Each press of the arrow key ",Q({},"must")," update the ",G({},"input")," value to reflect the currently selected option"),J({},"It is common to loop the selected option to the first option when you get to the last option in the list. Similarly, loop to the last option when you reach the first option.")),Y({},"When an option from the ",G({},"listbox"),' is "in focus", user focus never leaves the ',G({},"input"),' field, since we manually create a programmatic or "faux focus" state that highlights the selected option and associates it to the ',G({},"input"),"."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Requirement"},Object(i.createElement)("p",null,'When highlighting an option with "faux focus", the'," ",Object(i.createElement)("code",null,"aria-activedescendant")," attribute on the ",Object(i.createElement)("code",null,"input")," needs to be set to the value of the ID of the highlighted option. The highlighted option must also have ",Object(i.createElement)("code",null,'aria-selected="true"'),". When no option is highlighted, ",Object(i.createElement)("code",null,"aria-activedescendant")," must be removed.")),Y({},"By typing the first letter of an option name, the first matching option will highlight. When the letter doesn't match an option, highlighting doesn't move."),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"highlighting-an-option")),H({id:"Collapsing-the-Combobox"},"Collapsing the Combobox"),Y({},"To collapse the Combobox the user should be able to press the ",G({},"Escape")," key on their keyboard or click anywhere outside of the Combobox."),Y({},"Pressing the ",G({},"Enter")," key whilst an option is highlighted will select the option as the current value and collapse the Combobox."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Requirement"},Object(i.createElement)("p",null,"Update ",Object(i.createElement)("code",null,"aria-expanded"),' to "false" when the Combobox is collapsed.')),z({id:"Selecting-an-option"},"Selecting an option"),Y({},"A user selects an option by using their mouse to click the option they require, or pressing the ",G({},"Enter")," key once they have arrowed to the desired option."),Y({},"Upon selection the Combobox collapses, only showing the ",G({},"input")," field. The value of the ",G({},"input")," inside the Combobox is set to match the selected option name so the user can see what was previously selected from the ",G({},"listbox")," of options."),Object(i.createElement)(l.a,null,Object(y.e)(_,"selected-an-option-closed")),H({id:"Single-selection"},"Single selection"),Y({},"When an option becomes selected, the class ",G({},"slds-is-selected")," should be applied to the ",G({},"slds-listbox__option")," element with the ",G({},'role="option"'),". This will provide visual feedback that the user has selected that element."),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"selecting-a-single-option")),K({id:"Re-opening-with-a-selection"},"Re-opening with a selection"),Y({},"When re-opening a Combobox that already has a selected value, the ",G({},"listbox")," should be displayed with the selected option already highlighted."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Requirement"},Object(i.createElement)("p",null,"Be sure to re-set the ",Object(i.createElement)("code",null,"aria-activedescendant")," attribute on the `input` to the value of the ID of the highlighted option. The highlighted option must also have ",Object(i.createElement)("code",null,'aria-selected="true"'),".")),H({id:"Multiple-selections"},"Multiple selections"),Y({},"When more than one option has been selected, the value of the ",G({},"input"),' should be updated with the total number of selected items, such as "3 options selected".'),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Note"},Object(i.createElement)("p",null,'The value of the Combobox is the only way you can communicate what option was selected to a screen reader. Given that the option names don\'t appear in the set value, adding "Current Selection:" to each selected option name allows a screen reader user to understand that the option was already selected from the list.')),Object(i.createElement)(a.a,{toggleCode:!1},Object(i.createElement)(p.d,{name:"Accounts",selected:!0})),Object(i.createElement)(l.a,{demoStyles:"height: 17rem;"},Object(y.e)(_,"selecting-multiple-options")),Y({},"When a Combobox with multiple selected options is closed, a ",B({href:"/components/pills/#Listbox-Of-Pill-Options"},"Listbox of Pills")," is also used to represent those selected options."),Y({},"The ",B({href:"/components/pills/#Listbox-Of-Pill-Options"},"Listbox of Pills")," is positioned below the read-only ",G({},"input"),", outside of the Combobox. Each pill represents a selected option. This allows a user to easily see and remove selected items from the Combobox without opening it again."),Object(i.createElement)(l.a,null,Object(y.e)(_,"selected-multiple-options-closed")),H({id:"Editing-multiple-selections"},"Editing multiple selections"),Y({},"The ",B({href:"/components/pills/#Listbox-Of-Pill-Options"},"Listbox of Pills"),' allows you to quickly remove selections without opening the Combobox by clicking the remove "x" or using your delete key.'),Y({},"The ",B({href:"/components/pills/#Listbox-Of-Pill-Options"},"Listbox of Pills")," acts as a single focusable element. Using the arrow keys whilst focused on the first pill will cycle the user through the pill options."),U({id:"Autocomplete-Combobox"},"Autocomplete Combobox"),Y({},"An autocomplete Combobox also allows a user to select an option from a list, but that list can be affected by what the user types into the ",G({},"input")," of the Combobox. This can be useful when the list of options is very large, as user input can start to display options that only match the text they have entered."),Y({},"If no option matches, the user can complete the value of the combobox by finishing their own text entry."),Object(i.createElement)(c.a,{type:"a11y",header:"Accessibility Difference"},Object(i.createElement)("p",null,"The difference between the ",Object(i.createElement)("strong",null,"Base Combobox")," and the"," ",Object(i.createElement)("strong",null,"Autocomplete Combobox"),", is that the text ",Object(