-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5914 from veroglez/LPD-45714
feat(@clayui/language-picker): LPD-45714 Add security margin
- Loading branch information
Showing
7 changed files
with
935 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
294 changes: 294 additions & 0 deletions
294
packages/clay-core/src/language-picker/__tests__/__snapshots__/index.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,294 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`LanguagePicker renders 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders a class name for the trigger 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="trigger-class form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders a small picker 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="form-control form-control-select form-control-select-secondary form-control-sm" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders hidding the trigger text 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="form-control form-control-select form-control-select-secondary hidden-label" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders the picker with id 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="form-control form-control-select form-control-select-secondary" | ||
id="pickerId" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders with a default selected locale 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: Spanish (Spain)." | ||
class="trigger-class form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-es-es" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#es-es" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
es-ES | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders with a selected locale 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: French (France)." | ||
class="trigger-class form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-fr-fr" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#fr-fr" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
fr-FR | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders with custom labels 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Trigger Label" | ||
class="form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`LanguagePicker renders with translations 1`] = ` | ||
<div> | ||
<button | ||
aria-activedescendant="" | ||
aria-expanded="false" | ||
aria-haspopup="listbox" | ||
aria-label="Select a language, current language: English (United States)." | ||
class="form-control form-control-select form-control-select-secondary" | ||
role="combobox" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<span | ||
class="inline-item-before" | ||
> | ||
<svg | ||
class="lexicon-icon lexicon-icon-en-us" | ||
role="presentation" | ||
> | ||
<use | ||
href="/path/to/svg#en-us" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="inline-item-before" | ||
> | ||
en-US | ||
</span> | ||
</button> | ||
</div> | ||
`; |
Oops, something went wrong.