Skip to content
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(core/dropdown): enable shadow dom #552

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
134 changes: 121 additions & 13 deletions packages/core/component-doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependents": [
"my-component"
],
"dependencies": [
"ix-icon",
"ix-dropdown",
Expand All @@ -388,6 +390,9 @@
],
"ix-dropdown-item": [
"ix-icon"
],
"my-component": [
"ix-breadcrumb"
]
},
"props": [
Expand Down Expand Up @@ -480,9 +485,15 @@
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependents": [
"my-component"
],
"dependencies": [],
"dependencyGraph": {},
"dependencyGraph": {
"my-component": [
"ix-breadcrumb-item"
]
},
"props": [
{
"name": "icon",
Expand Down Expand Up @@ -2256,7 +2267,8 @@
"ix-menu",
"ix-menu-avatar",
"ix-select",
"ix-split-button"
"ix-split-button",
"my-component"
],
"dependencies": [],
"dependencyGraph": {
Expand All @@ -2283,6 +2295,9 @@
],
"ix-split-button": [
"ix-dropdown"
],
"my-component": [
"ix-dropdown"
]
},
"props": [
Expand Down Expand Up @@ -2562,6 +2577,12 @@
"target": "window",
"capture": false,
"passive": false
},
{
"event": "keydown",
"target": "window",
"capture": false,
"passive": false
}
]
},
Expand All @@ -2583,7 +2604,9 @@
}
],
"encapsulation": "scoped",
"dependents": [],
"dependents": [
"my-component"
],
"dependencies": [
"ix-button",
"ix-icon",
Expand All @@ -2599,6 +2622,9 @@
],
"ix-icon-button": [
"ix-icon"
],
"my-component": [
"ix-dropdown-button"
]
},
"props": [
Expand Down Expand Up @@ -2743,14 +2769,15 @@
"usage": {},
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"encapsulation": "shadow",
"dependents": [
"ix-breadcrumb",
"ix-group-dropdown-item",
"ix-menu-avatar-item",
"ix-select",
"ix-select-item",
"ix-split-button-item"
"ix-split-button-item",
"my-component"
],
"dependencies": [
"ix-icon"
Expand All @@ -2776,6 +2803,9 @@
],
"ix-split-button-item": [
"ix-dropdown-item"
],
"my-component": [
"ix-dropdown-item"
]
},
"props": [
Expand Down Expand Up @@ -7195,7 +7225,8 @@
"docsTags": [],
"encapsulation": "scoped",
"dependents": [
"ix-pagination"
"ix-pagination",
"my-component"
],
"dependencies": [
"ix-select-item",
Expand Down Expand Up @@ -7228,6 +7259,9 @@
],
"ix-pagination": [
"ix-select"
],
"my-component": [
"ix-select"
]
},
"props": [
Expand Down Expand Up @@ -7497,7 +7531,8 @@
"encapsulation": "scoped",
"dependents": [
"ix-pagination",
"ix-select"
"ix-select",
"my-component"
],
"dependencies": [
"ix-dropdown-item"
Expand All @@ -7514,6 +7549,9 @@
],
"ix-select": [
"ix-select-item"
],
"my-component": [
"ix-select-item"
]
},
"props": [
Expand Down Expand Up @@ -7674,7 +7712,9 @@
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependents": [
"my-component"
],
"dependencies": [
"ix-icon",
"ix-dropdown"
Expand All @@ -7683,6 +7723,9 @@
"ix-split-button": [
"ix-icon",
"ix-dropdown"
],
"my-component": [
"ix-split-button"
]
},
"props": [
Expand Down Expand Up @@ -7936,7 +7979,9 @@
"docs": "",
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependents": [
"my-component"
],
"dependencies": [
"ix-dropdown-item"
],
Expand All @@ -7946,6 +7991,9 @@
],
"ix-dropdown-item": [
"ix-icon"
],
"my-component": [
"ix-split-button-item"
]
},
"props": [
Expand Down Expand Up @@ -10154,8 +10202,68 @@
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependencies": [],
"dependencyGraph": {},
"dependencies": [
"ix-dropdown",
"ix-dropdown-item",
"ix-breadcrumb",
"ix-breadcrumb-item",
"ix-select",
"ix-select-item",
"ix-dropdown-button",
"ix-split-button",
"ix-split-button-item"
],
"dependencyGraph": {
"my-component": [
"ix-dropdown",
"ix-dropdown-item",
"ix-breadcrumb",
"ix-breadcrumb-item",
"ix-select",
"ix-select-item",
"ix-dropdown-button",
"ix-split-button",
"ix-split-button-item"
],
"ix-dropdown-item": [
"ix-icon"
],
"ix-breadcrumb": [
"ix-icon",
"ix-dropdown",
"ix-dropdown-item"
],
"ix-select": [
"ix-select-item",
"ix-filter-chip",
"ix-icon-button",
"ix-icon",
"ix-dropdown",
"ix-dropdown-item"
],
"ix-select-item": [
"ix-dropdown-item"
],
"ix-filter-chip": [
"ix-icon"
],
"ix-icon-button": [
"ix-icon"
],
"ix-dropdown-button": [
"ix-button",
"ix-icon",
"ix-icon-button",
"ix-dropdown"
],
"ix-split-button": [
"ix-icon",
"ix-dropdown"
],
"ix-split-button-item": [
"ix-dropdown-item"
]
},
"props": [],
"methods": [],
"events": [],
Expand Down
1 change: 1 addition & 0 deletions packages/core/scss/components/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
padding: 0 $x-large-space;
border: 1px solid transparent;
color: var(--theme-menu-item--color);
background-color: transparent;

&:focus-visible {
background-color: var(--theme-menu-item--background);
Expand Down
64 changes: 41 additions & 23 deletions packages/core/src/components/dropdown-item/dropdown-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,15 @@
*/

@import 'common-variables';
@import 'fonts';
@import 'components/dropdown';
@import 'mixins/hover';
@import 'mixins/text-truncation';

:host {
display: block;

&.icon-only {
min-width: 0;

.dropdown-item > .glyph {
margin-inline-end: 0;
}

.dropdown-item {
padding: $tiny-space $small-space;

@include focus-visible {
border-color: #199fff;
}
}
}

:focus {
@include focus-visible {
background-color: transparent;
color: var(--theme-menu-item--color);
}
Expand All @@ -40,16 +26,48 @@
left: $small-space;
}

&.checked {
background-color: var(--theme-select-list-item--background--selected);
}

.label {
@include ellipsis;
@include text-default;
}

ix-icon {
margin-inline-end: $small-space;
transition: color 0;
}

.dropdown-item {
width: 100%;
}
}

:host(.icon-only) {
min-width: 0;

.dropdown-item > ix-icon {
margin-inline-end: 0;
}

.dropdown-item {
padding: $tiny-space $small-space;

@include focus-visible {
border-color: var(--color-focus-bdr);
}
}
}

:host(.checked) {
background-color: var(--theme-select-list-item--background--selected);
}

:host(.disabled) {
pointer-events: none;
}

&.disabled {
pointer-events: none;
:host(:hover:not(.disabled)) {
ix-icon {
color: var(--theme-color-std-text) !important;
}
}

Expand Down
Loading