Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

feat(tag popover): tag popover component implementation #3

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5d87c33
feat(tag-popover): added component files, locale, styles
Klimonov-Kirill Aug 31, 2020
292eb83
feat(tag-popover): rename component
Klimonov-Kirill Aug 31, 2020
9b44014
feat(tag-popover): write tag and select tag functionality
Klimonov-Kirill Sep 1, 2020
15ede0c
feat(tag-popover): finish component logic
Sep 2, 2020
6308ba8
feat(tag-popover): add tests
Sep 2, 2020
e9e3879
feat(tag): add tag component
Klimonov Sep 4, 2020
53cb16c
fix(tag): update package.json
Klimonov Sep 4, 2020
186b5d1
fix(tag): update package-lock.json
Klimonov Sep 4, 2020
2b7fb8e
fix(tag): add tests
Klimonov Sep 4, 2020
f7ecef0
fix(tag-component): resolve conflicts, update readme.md
Klimonov Sep 8, 2020
3ce41f3
fix(tag-popover): implement tag component
Klimonov Sep 9, 2020
ff0792b
fix(tag-component): add component attributes
Klimonov Sep 9, 2020
2291570
fix(tag-component): rename tag in the components-spec
Klimonov Sep 9, 2020
3133597
fix(tag-popover): add remove tag method
Klimonov Sep 9, 2020
1dc6801
fix(tag-popover): refactoring
Klimonov Sep 9, 2020
24e0956
fix(tag-popover): update readme files
Klimonov Sep 9, 2020
4c67348
fix(tag-popover): fix delete tag method bug
Klimonov Sep 9, 2020
2134ddd
fix(tag-component): remove unnecessary properties
Klimonov Sep 9, 2020
9f4e064
Merge branch 'master' into tag-popover
Klimonov Sep 14, 2020
6649c00
fix(tag-component): remove options, add click event
Klimonov Sep 14, 2020
506b89b
fix(tag-component): remove unnecessary tests
Klimonov Sep 14, 2020
ceba54d
fix(tag-popover): update tag component
Klimonov Sep 14, 2020
7890a1e
fix(tag-component): add index prop for delete tag
Klimonov Sep 14, 2020
ca3a5f6
fix(tag-popover): restart tests
Klimonov Sep 15, 2020
22765d7
fix(tag-component): restart tests
Klimonov Sep 15, 2020
b31eafa
fix(tag popover): add position atribute, update disable option
Klimonov Sep 16, 2020
de5ffbe
fix(tag popover): small style fixes
Klimonov Sep 18, 2020
67c4d7b
fix(tag popover): update tests
Klimonov Sep 18, 2020
ce435d7
fix(tag component): add tabindex to delete tag button
Klimonov Sep 21, 2020
28dd3d7
fix(tag component): update color prop
Klimonov Sep 21, 2020
af9e902
fix(tag component): add attributes to components-spec
Klimonov Sep 21, 2020
dc3bd88
fix(tag component): rename index prop to tagId
Klimonov Sep 23, 2020
f699bf2
fix(tag component): use local scss variable instead of removed global…
Klimonov Sep 23, 2020
f3f889c
fix(tag-popover): update tag component
Klimonov Sep 23, 2020
e04cb96
Merge branch 'master' into tag-popover
Klimonov Sep 24, 2020
1b37d1b
fix(tag popover): use new color variables
Klimonov Sep 25, 2020
3362fc6
fix(tag popover component): implement gux-dropdown component
Klimonov Oct 5, 2020
89832e2
fix(tag popover): update tests
Klimonov Oct 5, 2020
2028005
style(tag popover): fix lint errors
Klimonov Oct 5, 2020
44708a7
fix(tag popover): change variable type
Klimonov Oct 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/src/components-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,33 @@
"icon-name": "text"
}
},

"gux-tag-popover": {
"attributes": {
"position": ["left", "right"],
"color": "text"
},
"events": { "deleteTag": "delete tag" }
},
"gux-tag": {
"attributes": {
"color": [
"navy",
"blue",
"electric-purple",
"aqua-green",
"fuscha",
"dark-purple",
"bubblegum-pink",
"olive-green",
"lilac",
"yellow-green"
]
},
"events": {
"deleteTag": "Click on delete tag button"
}
},
"gux-text-field": {
"attributes": {
"value": "text",
Expand Down
30 changes: 30 additions & 0 deletions src/components/beta/gux-tag-popover/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

<gux-tag-popover-beta position="right">
<gux-option>American English</gux-option>
<gux-option>Latin American Spanish</gux-option>
<gux-option>European Spanish</gux-option>
<gux-option>UK English</gux-option>
<gux-option>Canadian French</gux-option>
<gux-option>European French</gux-option>
<gux-option>Dutch</gux-option>
</gux-tag-popover-beta>
<br />
<gux-tag-popover-beta color="dark-blue" position="left">
<gux-option>American English</gux-option>
<gux-option>Latin American Spanish</gux-option>
<gux-option>European Spanish</gux-option>
<gux-option>UK English</gux-option>
<gux-option>Canadian French</gux-option>
<gux-option>European French</gux-option>
<gux-option>Dutch</gux-option>
</gux-tag-popover-beta>
<br />
<gux-tag-popover-beta color="dark-purple" position="left">
<gux-option>American English</gux-option>
<gux-option>Latin American Spanish</gux-option>
<gux-option>European Spanish</gux-option>
<gux-option>UK English</gux-option>
<gux-option>Canadian French</gux-option>
<gux-option>European French</gux-option>
<gux-option>Dutch</gux-option>
</gux-tag-popover-beta>
302 changes: 302 additions & 0 deletions src/components/beta/gux-tag-popover/gux-tag-popover.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
@import (reference) '../../../style/color.less';

// Variables part
@grey: #222529;

@menu-background-color: @gux-off-white;
@menu-border-color: #dae1eb;

@border-radius: 2px;

// Style
gux-tag-popover-beta {
div.gux-tag-popover {
position: relative;
margin: 4px 0;

&.right {
.gux-tag-popover-container {
text-align: right;
}
.arrow {
margin-right: 19px;
right: 0;
}
}

&.left {
.gux-tag-popover-container {
text-align: left;
}
.arrow {
margin-left: 19px;
left: 0;
}
}

.gux-tag-popover-container {
position: relative;
height: 32px;
width: 100%;

.gux-tag-popover-button {
button {
font-size: 16px;
}

&.has-tags > button {
color: @gux-dark-blue;
}

&:focus {
outline: none;
box-shadow: 0 0 0 3px fade(@gux-blue, 50%);
}
}
}

.gux-tag-popover-menu {
display: none;
box-shadow: 0 0 2px fade(@grey, 24%);
margin-top: 8px;
position: relative;
width: 100%;

.arrow,
.arrow::after {
position: absolute;
content: ' ';
height: 0;
width: 0;
border-style: solid;
border-color: transparent;
}
.arrow {
border-width: 6px;
border-bottom-color: @gux-border;
margin-top: -12px;
}
.arrow::after {
border-width: 4px;
border-bottom-color: @gux-off-white;
margin-top: -2px;
margin-left: -4px;
}

.gux-tag-popover-menu-container {
padding: 8px;
background: @gux-off-white;

.gux-tag-popover-options-container {
display: flex;

.gux-tag-popover-title {
padding: 0 5px;
white-space: nowrap;
display: flex;
flex-direction: column;
justify-content: center;
}

.gux-tag-popover-chip-container {
margin-left: 7px;
padding: 2px 5px;
display: flex;
border-radius: @border-radius;
border: 1px solid @gux-charcoal-grey;
flex: 1 1 auto;
flex-wrap: wrap;
&.active {
border-color: @gux-dark-blue;
}
}

.gux-tag-popover-chip {
display: flex;
margin: 4px 0;
}

.gux-tag-popover-chip-text,
.gux-tag-popover-chip-close-icon-wrap {
background-color: @gux-charcoal-grey;
height: 24px;
border-radius: @border-radius;
color: white;
margin-right: 8px;
font-weight: bold;
text-align: center;
}

.gux-tag-popover-chip-text {
display: flex;
white-space: nowrap;
padding: 0 8px;
line-height: 24px;
}

.gux-tag-popover-chip:hover {
.gux-tag-popover-chip-text {
margin-right: 1px;
border-radius: @border-radius 0 0 @border-radius;
}
.gux-tag-popover-chip-close-icon-wrap {
display: flex;
border-radius: 0 @border-radius @border-radius 0;
}
}

.gux-tag-popover-chip-close-icon-wrap {
width: 24px;
box-sizing: border-box;
display: none;
cursor: pointer;
flex-direction: column;
justify-content: center;
}

.gux-tag-popover-chip-icon-wrap {
display: flex;
flex-direction: column;
justify-content: center;
padding-right: 8px;
}

.gux-tag-popover-chip-close-icon {
margin: 0 auto;
}

// GUX-DROPDOWN component
gux-dropdown input {
height: 24px;
background-color: transparent;
padding: 0;
outline: 0;
border: none;
width: 100%;
}

gux-dropdown input:focus {
border: none !important;
box-shadow: none !important;
}

gux-dropdown div.gux-dropdown .select-field {
height: 24px;
}

gux-dropdown div.gux-dropdown .select-field .ghost {
background-color: transparent;
color: transparent;
border: none;
}

gux-text-field > div > div.gux-field {
height: 24px;
}

gux-dropdown div.gux-dropdown .select-field button.dropdown-indicator {
display: none;
}


.gux-tag-popover-tags-container {
display: flex;
flex-wrap: wrap;
}

.gux-tag-popover-input-container {
position: relative;
flex: 1 1 auto;
}
}

}

&.opened {
display: block;
}
}

.gux-tag-popover-options {
display: none;
position: absolute;
margin: 0;
margin-top: 12px;
padding: 8px 0;
background: @menu-background-color;
border: 1px solid @menu-border-color;
box-shadow: none;
z-index: 1;
color: @gux-charcoal-grey;

&.opened {
display: block;
}

> gux-tag-popover-option {
position: relative;
height: 32px;
line-height: 32px;
padding: 0 16px;
display: flex;
cursor: pointer;

& {
&[selected] {
background: @gux-text-selection;
color: @gux-charcoal-grey;
}

&:hover,
&:focus {
background: @gux-dark-blue;
color: @gux-off-white;
}
}
}
}
}
}

// Theming

// Dark
.gux-tag-popover-dark-theme {
color: @gux-off-white;

div.gux-tag-popover {
.gux-tag-popover-title {
color: @gux-charcoal-grey;
}
}
}

.gux-dark-theme {
gux-tag-popover-beta {
.gux-tag-popover-dark-theme();
}
}

gux-tag-popover-beta.gux-dark-theme {
.gux-tag-popover-dark-theme();
}

// Light
.gux-tag-popover-light-theme {
color: @gux-charcoal-grey;
}

.gux-light-theme {
gux-tag-popover-beta {
.gux-tag-popover-light-theme();
}
}

gux-tag-popover-beta.gux-light-theme {
.gux-tag-popover-light-theme();
}

// Default Theme
gux-tag-popover-beta {
.gux-tag-popover-light-theme();
}
Loading