-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPEDE-3088] Add styles and visual tests for tags component (#1460)
- Loading branch information
1 parent
268bf00
commit c7098d4
Showing
19 changed files
with
258 additions
and
0 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
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
Binary file added
BIN
+5.32 KB
config/backstop_data/bitmaps_reference/non_responsive/tags_test-base_viewport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
..._data/bitmaps_reference/non_responsive/tags_test-with-tags-focused_viewport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...op_data/bitmaps_reference/non_responsive/tags_test-with-tags-hover_viewport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11 KB
...backstop_data/bitmaps_reference/non_responsive/tags_test-with-tags_viewport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
@import '_global-variables'; | ||
@import '_global-mixins'; | ||
|
||
.chi-tags { | ||
border: 0.0625rem solid $tags-border-color; | ||
border-radius: $tags-border-radius; | ||
color: $tags-text-color; | ||
display: flex; | ||
height: $tags-md-height; | ||
font-size: $tags-md-font-size; | ||
line-height: $tags-md-line-height; | ||
padding: $tags-md-padding; | ||
outline: none; | ||
transition: all 0.15s ease-in-out; | ||
width: 100%; | ||
align-items: center; | ||
margin: 0; | ||
background-color: white; | ||
|
||
&:focus-within, | ||
&.-focus { | ||
border-color: $tags-focus-border-color; | ||
box-shadow: 0 0 0 1px $tags-focus-border-color; | ||
} | ||
|
||
&:hover, | ||
&.-hover { | ||
border-color: $tags-hover-border-color; | ||
} | ||
|
||
li { | ||
list-style-type: none; | ||
height: fit-content; | ||
} | ||
|
||
.chi-tags__input { | ||
border: 0; | ||
outline: none; | ||
width: 100%; | ||
height: 100%; | ||
|
||
&::placeholder { | ||
color: $tags-input-placeholder-text-color; | ||
} | ||
} | ||
|
||
.chi-tag { | ||
margin-right: 0.5rem; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: Tags | ||
--- | ||
|
||
- var tags = ['Some tag', 'Another tag'] | ||
|
||
.test-base.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 Base | ||
ul.chi-tags | ||
li.-flex--grow1 | ||
input.chi-tags__input(type="text" placeholder="Add tag") | ||
|
||
.test-with-tags.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags | ||
ul.chi-tags | ||
each tag in tags | ||
li | ||
.chi-tag | ||
.chi-badge | ||
span=tag | ||
button(class=`chi-button -icon -close -xs`, aria-label='Close') | ||
.chi-button__content | ||
.chi-icon | ||
svg | ||
use(xlink:href='#icon-x') | ||
li.-flex--grow1 | ||
input.chi-tags__input(type="text" placeholder="Add tag") | ||
|
||
.test-with-tags-focused.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags focused | ||
ul.chi-tags.-focus | ||
each tag in tags | ||
li | ||
.chi-tag | ||
.chi-badge | ||
span=tag | ||
button(class=`chi-button -icon -close -xs`, aria-label='Close') | ||
.chi-button__content | ||
.chi-icon | ||
svg | ||
use(xlink:href='#icon-x') | ||
li.-flex--grow1 | ||
input.chi-tags__input(type="text" placeholder="Add tag") | ||
|
||
.test-with-tags-hover.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags hover | ||
ul.chi-tags.-hover | ||
each tag in tags | ||
li | ||
.chi-tag | ||
.chi-badge | ||
span=tag | ||
button(class=`chi-button -icon -close -xs`, aria-label='Close') | ||
.chi-button__content | ||
.chi-icon | ||
svg | ||
use(xlink:href='#icon-x') | ||
li.-flex--grow1 | ||
input.chi-tags__input(type="text" placeholder="Add tag") | ||
|
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,37 @@ | ||
--- | ||
title: Tags | ||
--- | ||
script(type='module' src='../../js/ce/ux-chi-ce/ux-chi-ce.esm.js') | ||
|
||
.test-base.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 Base | ||
chi-tags(placeholder="Add tag") | ||
|
||
.test-with-tags.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags | ||
chi-tags#with-tags(placeholder="Add tag") | ||
|
||
.test-with-tags-focused.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags focused | ||
chi-tags#with-tags-focused(placeholder="Add tag" _status="focus") | ||
|
||
.test-with-tags-hover.-w--50.-mb--2.-pb--1 | ||
span.-text--h2 With tags hover | ||
chi-tags#with-tags-hover(placeholder="Add tag" _status="hover") | ||
|
||
script. | ||
document.addEventListener('DOMContentLoaded', () => { | ||
[ | ||
'#with-tags', | ||
'#with-tags-focused', | ||
'#with-tags-hover', | ||
].forEach(id => { | ||
|
||
const element = document.querySelector(id); | ||
|
||
element.tags = [ | ||
{ name: 'Some tag'}, | ||
{ name: 'Another tag'}, | ||
] | ||
}) | ||
}); |