-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(web-twig): Introduce
alignment
to Dropdown
component #DS-1411
- Loading branch information
Showing
6 changed files
with
91 additions
and
4 deletions.
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
29 changes: 28 additions & 1 deletion
29
packages/web-twig/src/Resources/components/Dropdown/Dropdown.twig
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
7 changes: 7 additions & 0 deletions
7
packages/web-twig/src/Resources/components/Dropdown/__tests__/__fixtures__/dropdown.twig
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 |
---|---|---|
@@ -1 +1,8 @@ | ||
<Dropdown>content</Dropdown> | ||
|
||
<Dropdown | ||
alignmentX="{{ { mobile: 'right', tablet: 'left', desktop: 'center' } }}" | ||
alignmentY="center" | ||
> | ||
content | ||
</Dropdown> |
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
21 changes: 21 additions & 0 deletions
21
packages/web-twig/src/Resources/components/Dropdown/stories/DropdownAlignment.twig
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,21 @@ | ||
<Grid cols="2"> | ||
<Dropdown | ||
alignmentX="{{ { mobile: 'right', tablet: 'left', desktop: 'center' } }}" | ||
alignmentY="center" | ||
> | ||
<Button | ||
data-spirit-toggle="dropdown" | ||
data-spirit-target="#dropdown-alignment" | ||
> | ||
Button as anchor | ||
</Button> | ||
<DropdownPopover id="dropdown-alignment"> | ||
<Item elementType="a" href="#" label="Action" /> | ||
<Item elementType="a" href="#" label="Another action" /> | ||
<Item elementType="a" href="#" label="Something else here" /> | ||
</DropdownPopover> | ||
</Dropdown> | ||
<div class="px-800 py-1700 bg-tertiary text-center"> | ||
This a big unrelated box | ||
</div> | ||
</Grid> |