Skip to content

Commit

Permalink
chore(@clayui/core): LPD-41942 LanguagePicker Storybook add more lang…
Browse files Browse the repository at this point in the history
…uages to force overflow
  • Loading branch information
pat270 committed Jan 23, 2025
1 parent f9a43ee commit 305dbeb
Showing 1 changed file with 71 additions and 2 deletions.
73 changes: 71 additions & 2 deletions packages/clay-core/stories/LanguagePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,78 @@ Default.args = {
small: false,
};

const localesLong = [
{
id: 'en_US',
label: 'en-US',
name: 'English (United States)',
symbol: 'en-us',
},
{
id: 'ar_SA',
label: 'ar-SA',
name: 'Arabic (Saudi Arabia)',
symbol: 'ar-sa',
},
{
id: 'ca_ES',
label: 'ca-ES',
name: 'Catalan (Spain)',
symbol: 'ca-es',
},
{
id: 'cs-CZ',
label: 'cs-CZ',
name: 'Czech (Czech Republic)',
symbol: 'cs-cz',
},
{
id: 'da-DK',
label: 'da-DK',
name: 'Danish (Denmark)',
symbol: 'da-dk',
},
{
id: 'de-AT',
label: 'de-AT',
name: 'Geman (Austria)',
symbol: 'de-at',
},
{
id: 'de-CH',
label: 'de-CH',
name: 'German (Switzerland)',
symbol: 'de-ch',
},
{
id: 'de-DE',
label: 'de-DE',
name: 'German (Germany)',
symbol: 'de-de',
},
{
id: 'el-GR',
label: 'el-GR',
name: 'Greek (Greece)',
symbol: 'el-gr',
},
{
id: 'en-AU',
label: 'en-AU',
name: 'English (Australia)',
symbol: 'en-au',
},
{
id: 'nl_NL',
label: 'nl-NL',
name: 'Dutch (Netherlands)',
symbol: 'nl-nl',
},
];

export const LanguagePickerWithTranslations = (args: any) => {
const [selectedLocaleId, setSelectedLocaleId] = useState<any>(
locales[0]!.id
localesLong[0]!.id
);
const translations = {
'ca-ES': {total: 4, translated: 2},
Expand All @@ -74,7 +143,7 @@ export const LanguagePickerWithTranslations = (args: any) => {
<LanguagePicker
hideTriggerText={args.hideTriggerText}
id="languagePicker"
locales={locales}
locales={localesLong}
onSelectedLocaleChange={setSelectedLocaleId}
selectedLocaleId={selectedLocaleId}
small={args.small}
Expand Down

0 comments on commit 305dbeb

Please sign in to comment.