-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(atomic): add result action bar on hover (#3002)
* feat(atomic): add result action bar on hover * feat(atomic): change action bar css * feat(atomic): change result background color * feat(atomic): change action bar marging * feat(atomic): change to tailwind classes and small refacto * feat(atomic): update css to not change parent element css * feat(atomic): change prop name and update typo * feat(atomic): add css color variable * feat(atomic): remove important from css * feat(atomic): add extra padding for first element * embrace CSS (#3019) * use CSS for hover * handle first with CSS * always relative --------- Co-authored-by: Louis Bompart <[email protected]>
- Loading branch information
1 parent
04f6b72
commit d2ed389
Showing
12 changed files
with
188 additions
and
1 deletion.
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
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
19 changes: 19 additions & 0 deletions
19
...components/insight/atomic-insight-result-action-bar/atomic-insight-result-action-bar.pcss
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,19 @@ | ||
@import '../../../global/global.pcss'; | ||
|
||
atomic-insight-result-action-bar { | ||
@apply flex absolute invisible right-6 top-[-1rem]; | ||
|
||
> atomic-insight-result-action:not(:last-child) { | ||
button { | ||
@apply rounded-r-none border-r-0; | ||
&:hover { | ||
@apply border-r; | ||
} | ||
} | ||
} | ||
> atomic-insight-result-action:not(:first-child) { | ||
button { | ||
@apply rounded-tl-none rounded-bl-none; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../components/insight/atomic-insight-result-action-bar/atomic-insight-result-action-bar.tsx
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,17 @@ | ||
import {Component, Element} from '@stencil/core'; | ||
import {hideEmptySection} from '../../../utils/result-section-utils'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
@Component({ | ||
tag: 'atomic-insight-result-action-bar', | ||
styleUrl: 'atomic-insight-result-action-bar.pcss', | ||
}) | ||
export class AtomicInsightResultActionBar { | ||
@Element() private host!: HTMLElement; | ||
|
||
public componentDidRender() { | ||
hideEmptySection(this.host); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...mic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.pcss
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,8 @@ | ||
@import '../../../global/global.pcss'; | ||
|
||
:host { | ||
&::part(result-action-button) { | ||
@apply flex items-center justify-center; | ||
@apply h-8 w-8; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...omic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.tsx
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,41 @@ | ||
import {Component, Prop, State, h} from '@stencil/core'; | ||
import Quickview from '../../../images/quickview.svg'; | ||
import { | ||
InitializableComponent, | ||
InitializeBindings, | ||
} from '../../../utils/initialization-utils'; | ||
import {IconButton} from '../../common/iconButton'; | ||
import {Bindings} from '../../search/atomic-search-interface/atomic-search-interface'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
@Component({ | ||
tag: 'atomic-insight-result-action', | ||
styleUrl: 'atomic-insight-result-action.pcss', | ||
}) | ||
export class AtomicInsightResultAction implements InitializableComponent { | ||
@InitializeBindings() public bindings!: Bindings; | ||
@State() public error!: Error; | ||
|
||
/** | ||
* Specify the result action icon to display. | ||
*/ | ||
@Prop({mutable: true}) public icon = Quickview; | ||
|
||
/** | ||
* The text tooltip to show on the result action icon | ||
*/ | ||
@Prop({mutable: true}) public tooltip = ''; | ||
|
||
public render() { | ||
return ( | ||
<IconButton | ||
partPrefix="result-action" | ||
style="outline-neutral" | ||
icon={this.icon} | ||
title={this.tooltip} | ||
/> | ||
); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
@import '../styles/list-display.pcss'; | ||
|
||
.list-root { | ||
padding: 1.5rem 1.5rem 0 1.5rem; | ||
@apply p-0; | ||
} |
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 |
---|---|---|
|
@@ -18,4 +18,8 @@ | |
} | ||
|
||
@mixin atomic-list-with-dividers; | ||
|
||
.result-component[part~='outline']::before { | ||
@apply my-0 mx-6; | ||
} | ||
} |
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