-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(components): post-language-switch web component #4044
Merged
Merged
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9100dd4
create web component
leagrdv d6c4f7f
Merge branch 'main' into 3633-component-language-switch
leagrdv 4fa3087
add story and connect to language-option
leagrdv 6ba7241
wip add post-menu
leagrdv 848a2c7
wip language switch
leagrdv f5fc61a
wip language switch, set web components in post-language-option-switch
leagrdv d679f5d
Merge branch 'main' into 3633-component-language-switch
leagrdv b16b764
fix switch between types + start styling
leagrdv 2b9c7fb
Merge branch 'main' into 3633-component-language-switch
leagrdv 79cb196
finish design of post-language-option-switch + links
leagrdv 62c034b
Add changeset and fix tests
leagrdv 0f3601d
add tests
leagrdv 7b57d13
Merge branch 'main' into 3633-component-language-switch
leagrdv fa71f9e
Merge branch 'main' into 3633-component-language-switch
leagrdv d0529b3
update snapshot with schemes
leagrdv 2828efd
rename ID
leagrdv f564157
Merge branch 'main' into 3633-component-language-switch
leagrdv 57d4026
proposal for a new internal structure
gfellerph 6120984
Merge branch 'main' into 3633-component-language-switch
leagrdv 66dc8cb
rename post-language-switch to post-language-switch-2 and post-langua…
leagrdv 03c02dc
add styling
leagrdv b340b17
fix markup issue + add pointer
leagrdv 3e70518
Merge branch 'main' into 3633-component-language-switch
leagrdv dd011a7
fix code smells
leagrdv cefc0bf
update language switch, delete unused code, dynamically set variant a…
leagrdv e897f77
Merge branch 'main' into 3633-component-language-switch
gfellerph 3826d13
chore: update header sample markup (#4185)
gfellerph 22ff9a9
Merge branch 'main' into 3633-component-language-switch
leagrdv 84c761b
Merge branch 'main' into 3633-component-language-switch
leagrdv fe0265d
remove generated prop
gfellerph c15960d
remove name prop and use nanoid
gfellerph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@swisspost/design-system-documentation': minor | ||
'@swisspost/design-system-components': minor | ||
--- | ||
|
||
Added the `post-language-switch` component that enables users to change the language of a page. |
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
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
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
40 changes: 40 additions & 0 deletions
40
packages/components/src/components/post-language-switch/post-language-switch.scss
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,40 @@ | ||
@use '@swisspost/design-system-styles/tokens/components'; | ||
@use '@swisspost/design-system-styles/functions/tokens'; | ||
@use '@swisspost/design-system-styles/mixins/button' as button-mx; | ||
@use '@swisspost/design-system-styles/mixins/utilities' as utilities-mx; | ||
|
||
tokens.$default-map: components.$post-button; | ||
|
||
:host { | ||
display: block; | ||
} | ||
|
||
.post-language-switch-dropdown-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.post-language-switch-trigger { | ||
cursor: pointer; | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-width: tokens.get('button-border-width'); | ||
border-radius: tokens.get('button-border-radius-round'); | ||
background-color: transparent; | ||
font-family: inherit; | ||
font-weight: tokens.get('button-label-font-weight'); | ||
@include button-mx.button-size(sm); | ||
|
||
&:disabled { | ||
border-style: tokens.get('button-border-style-disabled'); | ||
@include button-mx.button-variant-def('disabled', 'tertiary'); | ||
} | ||
|
||
@include utilities-mx.focus-style; | ||
@include button-mx.button-variant-def('enabled', 'tertiary'); | ||
|
||
@include utilities-mx.not-disabled-hover() { | ||
@include button-mx.button-variant-def('hover', 'tertiary'); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary any more.