@1024pix/pix-ui 46.10.3 → 46.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="pix-tooltip"
|
|
2
|
+
class="pix-tooltip {{if this.isTooltipVisible 'pix-tooltip--visible' ''}}"
|
|
3
3
|
{{on-escape-action this.hideTooltip}}
|
|
4
4
|
{{on "mouseover" this.showTooltip}}
|
|
5
5
|
{{on "mouseleave" this.hideTooltipOnMouseOut}}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
id={{@id}}
|
|
20
20
|
role="tooltip"
|
|
21
21
|
class="pix-tooltip__content pix-tooltip__content--{{this.position}}
|
|
22
|
-
{{if this.isVisible 'pix-tooltip__content--visible'}}
|
|
23
22
|
{{if @isInline 'pix-tooltip__content--inline'}}
|
|
24
23
|
{{if @isLight 'pix-tooltip__content--light'}}
|
|
25
24
|
{{if @isWide 'pix-tooltip__content--wide'}}"
|
|
@@ -3,7 +3,7 @@ import { action } from '@ember/object';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
|
|
5
5
|
export default class PixTooltip extends Component {
|
|
6
|
-
@tracked
|
|
6
|
+
@tracked isTooltipVisible = false;
|
|
7
7
|
|
|
8
8
|
get position() {
|
|
9
9
|
const correctsPosition = [
|
|
@@ -25,12 +25,12 @@ export default class PixTooltip extends Component {
|
|
|
25
25
|
|
|
26
26
|
@action
|
|
27
27
|
showTooltip() {
|
|
28
|
-
this.
|
|
28
|
+
this.isTooltipVisible = true;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@action
|
|
32
32
|
hideTooltip() {
|
|
33
|
-
this.
|
|
33
|
+
this.isTooltipVisible = false;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
@action
|
|
@@ -8,6 +8,27 @@
|
|
|
8
8
|
display: block;
|
|
9
9
|
width: 100%;
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
&__trigger-element:hover + .pix-tooltip__content {
|
|
13
|
+
visibility: visible;
|
|
14
|
+
opacity: 1;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@supports selector(:has(*)) {
|
|
19
|
+
.pix-tooltip--visible:has(.pix-tooltip__trigger-element :focus-visible) {
|
|
20
|
+
.pix-tooltip__content {
|
|
21
|
+
visibility: visible;
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@supports not selector(:has(*)) {
|
|
28
|
+
.pix-tooltip--visible .pix-tooltip__trigger-element:focus-within + .pix-tooltip__content {
|
|
29
|
+
visibility: visible;
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
11
32
|
}
|
|
12
33
|
|
|
13
34
|
.pix-tooltip__content {
|
|
@@ -16,22 +37,17 @@
|
|
|
16
37
|
position: absolute;
|
|
17
38
|
left: auto;
|
|
18
39
|
z-index: 100;
|
|
19
|
-
display: none;
|
|
20
40
|
padding: var(--pix-spacing-2x) var(--pix-spacing-4x);
|
|
21
41
|
color: var(--pix-neutral-0);
|
|
22
42
|
font-size: 0.875rem;
|
|
23
43
|
line-height: 1.4rem;
|
|
24
44
|
background-color: var(--pix-neutral-900);
|
|
25
45
|
border-radius: 6px;
|
|
46
|
+
visibility: hidden;
|
|
26
47
|
opacity: 0;
|
|
27
48
|
transition: opacity 0.3s;
|
|
28
49
|
pointer-events: none;
|
|
29
50
|
|
|
30
|
-
&--visible {
|
|
31
|
-
display: block;
|
|
32
|
-
opacity: 1;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
51
|
&--inline {
|
|
36
52
|
white-space: nowrap;
|
|
37
53
|
}
|
|
@@ -118,6 +118,23 @@ const TemplateWithIconElement = (args) => {
|
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
const TemplateWithInputElement = (args) => {
|
|
122
|
+
return {
|
|
123
|
+
template: hbs`<PixTooltip @id={{this.id}} @isInline='true'>
|
|
124
|
+
<:triggerElement>
|
|
125
|
+
<PixInput @id='some-id'>
|
|
126
|
+
<:label>{{this.label}}</:label>
|
|
127
|
+
</PixInput>
|
|
128
|
+
</:triggerElement>
|
|
129
|
+
|
|
130
|
+
<:tooltip>
|
|
131
|
+
{{this.text}}
|
|
132
|
+
</:tooltip>
|
|
133
|
+
</PixTooltip>`,
|
|
134
|
+
context: args,
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
|
|
121
138
|
export const Default = Template.bind({});
|
|
122
139
|
Default.args = {
|
|
123
140
|
text: 'Hello World',
|
|
@@ -184,6 +201,12 @@ WithIcon.args = {
|
|
|
184
201
|
label: 'À survoler pour voir la tooltip',
|
|
185
202
|
};
|
|
186
203
|
|
|
204
|
+
export const WithInput = TemplateWithInputElement.bind({});
|
|
205
|
+
WithInput.args = {
|
|
206
|
+
text: 'Hello World',
|
|
207
|
+
label: 'À survoler pour voir la tooltip',
|
|
208
|
+
};
|
|
209
|
+
|
|
187
210
|
export const hide = Template.bind({});
|
|
188
211
|
hide.args = {
|
|
189
212
|
label: "Survoler ici n'affiche pas tooltip",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1024pix/pix-ui",
|
|
3
|
-
"version": "46.10.
|
|
3
|
+
"version": "46.10.5",
|
|
4
4
|
"description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"ember-load-initializers": "^2.1.2",
|
|
99
99
|
"ember-page-title": "^8.0.0",
|
|
100
100
|
"ember-qunit": "^8.0.0",
|
|
101
|
-
"ember-resolver": "^
|
|
101
|
+
"ember-resolver": "^12.0.0",
|
|
102
102
|
"ember-sinon": "^5.0.0",
|
|
103
103
|
"ember-source": "^4.0.1",
|
|
104
104
|
"ember-source-channel-url": "^3.0.0",
|