Shopify Markets country/language selectors. Both consume storeContext, so they need a
Shopify Markets country/language selectors. Both consume storeContext, so they need a
<storesynk-store> ancestor (SSK-101). They have two modes, detected from the author’s
markup (the same contract as change-option):
- select (default) - the picker adopts an author-provided child
<select>or auto-creates one, and fills its<option>s from the shop’s localization data. Zero markup required; a named native<select>is already accessible. - template (pill) - if the first child is a
locale-value, that element is the per-entry template: the picker clones it per country/language into its parent container, fills theshow-locale-name/show-locale-currencyleaves, and applies the APG radiogroup contract (see the a11y section). Detection order: a<select>beats alocale-valuebeats auto-create.
Either way the picker dispatches the pick up to the store, which owns the actual switch (the
pickers only reflect state). The localization query is loaded lazily the first time a picker
mounts - a store with no pickers never pays for it. On a single-market shop (≤1 option) a
picker hides itself (hidden + [ss-empty]), so it is safe to leave in.
change-country
Section titled “change-country”- Purpose: country/market picker. Populates its
<select>fromlocalization.availableCountries; selecting one dispatchessf:country-change, and the store re-prices the cart + reformats money for that market. ExtendsLitElement(light DOM). - Attributes:
label : string = ""- accessible name for the generated<select>when the author gives it none (viaaria-label/<label>). Defaults to"Country".show-currency : boolean (presence)- in select mode, append each country’s currency to its option text, e.g."Germany (EUR €)"; in template mode, place ashow-locale-currencyleaf.
- Required ancestor / context:
storesynk-store(consumesstoreContext). - Children: select mode - optionally one
<select>(else it creates one; the engine owns its<option>s). Template mode - a first-childlocale-valuepill template (see below). - Events: emits
sf:country-change(bubbles, composed;detail = { country }). - State it sets:
[ss-empty](+hidden) when there is ≤1 country (single-market shop);[ss-loading](+aria-busy="true"+ a disabled<select>, oraria-disabledpills in template mode) while a switch is in flight. Also injects a visually-hiddenrole="status"live region that announces the settled market to AT.
change-language
Section titled “change-language”- Purpose: language picker for the active country. Populates its
<select>from that country’savailableLanguages(option text is each language’s endonym), so its list repopulates automatically when the country switches. Selecting one dispatchessf:language-change. ExtendsLitElement(light DOM). - Attributes:
label : string = ""- accessible name for the generated<select>(select mode) / pill radiogroup (template mode) when the author gives none. Defaults to"Language". (Noshow-currency- that is country-only; ashow-locale-currencyleaf inside a language picker is simply left empty.)
- Required ancestor / context:
storesynk-store(consumesstoreContext). - Children: select mode - optionally one
<select>(else it creates one). Template mode - a first-childlocale-valuepill template (itsshow-locale-nameshows the endonym). - Events: emits
sf:language-change(bubbles, composed;detail = { language }). - State it sets:
[ss-empty](+hidden) when the active country has ≤1 language;[ss-loading](+aria-busy="true"+ a disabled<select>, oraria-disabledpills) during a switch; plus the same visually-hiddenrole="status"announcement.
locale-value
Section titled “locale-value”- Purpose: styleable pill container for one country/language in a Markets picker’s template mode. The first one is the clone template; the picker removes it, clones it per entry into its parent container, and marks the active one. A logic-free styleable element - no logic.
- Attributes:
value : string- ENGINE-SET (the country/language ISO code). Do not author.
- Required ancestor / context:
change-countryorchange-language(SSK-108). - Children: optionally
show-locale-nameand/or (country picker)show-locale-currency. - Events / state: none of its own; receives
value,[ss-active],role="radio",aria-checked, rovingtabindex, and (mid-switch)aria-disabledfrom the picker.
show-locale-name
Section titled “show-locale-name”- Purpose: invisible (
display:contents) text holder inside alocale-value; the engine writes the country name (country picker) or language endonym (language picker) into it. A logic-free invisible element. Set deterministically every update. - Attributes: none.
- Required ancestor / context:
locale-valuewithin a picker (SSK-108). - Events / state: none.
show-locale-currency
Section titled “show-locale-currency”- Purpose: invisible (
display:contents) text holder inside alocale-value; the engine writes the country’s currency (e.g."EUR €"). A logic-free invisible element. Country picker only - in achange-languageit is written empty. - Attributes: none.
- Required ancestor / context:
locale-valuewithinchange-country(SSK-108). - Events / state: none.
Imported from the Storesynk skill v0.1.0 (references/component-reference.md). To change this page, change it there.