@progressio_resources/gravity-design-system 3.9.0 → 3.9.1

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.
@@ -17,6 +17,7 @@ export declare class GravityTooltipComponent implements OnInit {
17
17
  hostClassShadow: boolean;
18
18
  hostClassLight: boolean;
19
19
  hostClassNoPointer: boolean;
20
+ hostClassPersistent: boolean;
20
21
  transitionEnd(): void;
21
22
  set show(value: boolean);
22
23
  get show(): boolean;
@@ -38,4 +38,5 @@ export interface TooltipOptions {
38
38
  left: number;
39
39
  };
40
40
  'persistent'?: boolean;
41
+ 'isBanner'?: boolean;
41
42
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progressio_resources/gravity-design-system",
3
3
  "description": "Gravity Design System",
4
- "version": "3.9.0",
4
+ "version": "3.9.1",
5
5
  "license": "SEE LICENSE IN LIBRARY-LICENSE",
6
6
  "peerDependencies": {
7
7
  "@angular/common": "^16.2.12",
@@ -1,125 +1,128 @@
1
1
  @import "../../styles/foundations/z-index/z-index"
2
2
 
3
- \:host
3
+ :host
4
4
  position: absolute
5
5
  z-index: $z-index-elevated
6
6
  display: block
7
7
  opacity: 0
8
- -webkit-transition: opacity 300ms
9
- -moz-transition: opacity 300ms
10
- -o-transition: opacity 300ms
11
8
  transition: opacity 300ms
12
9
  top: 0
13
10
  left: 0
14
11
  border-radius: 5px
15
12
 
16
- \:host.tooltip-show
13
+ :host.tooltip-show
17
14
  opacity: 1
18
15
 
19
- \:host.tooltip-shadow
16
+ :host.tooltip-shadow
20
17
  box-shadow: 0 4px 10px 0 rgba(21, 28, 41, 0.22)
21
18
 
22
- \:host.tooltip-light.tooltip-shadow
19
+ :host.tooltip-light.tooltip-shadow
23
20
  box-shadow: 0 4px 10px 0 rgba(21, 28, 41, 0.22)
24
21
 
25
- \:host.tooltip-no-pointer
22
+ :host.tooltip-no-pointer
26
23
  pointer-events: none
27
24
 
28
- //Caret
29
- \:host.tooltip::after
25
+ // ==========================
26
+ // CARET BASE (5px default)
27
+ // ==========================
28
+
29
+ :host.tooltip::after
30
30
  content: ""
31
31
  position: absolute
32
32
  border-style: solid
33
33
 
34
- \:host.tooltip-top::after
34
+ :host.tooltip-top::after
35
35
  top: 100%
36
36
  left: 50%
37
37
  margin-left: -5px
38
38
  border-width: 5px
39
39
  border-color: var(--bg-tooltip-primary) transparent transparent transparent
40
40
 
41
- \:host.tooltip-top-left::after
41
+ :host.tooltip-top-left::after
42
42
  top: 100%
43
43
  left: 10%
44
44
  margin-left: -5px
45
45
  border-width: 5px
46
46
  border-color: var(--bg-tooltip-primary) transparent transparent transparent
47
47
 
48
- \:host.tooltip-top-right::after
48
+ :host.tooltip-top-right::after
49
49
  top: 100%
50
50
  left: 90%
51
51
  margin-left: -5px
52
52
  border-width: 5px
53
53
  border-color: var(--bg-tooltip-primary) transparent transparent transparent
54
54
 
55
- \:host.tooltip-bottom::after
55
+ :host.tooltip-bottom::after
56
56
  bottom: 100%
57
57
  left: 50%
58
58
  margin-left: -5px
59
59
  border-width: 5px
60
60
  border-color: transparent transparent var(--bg-tooltip-primary) transparent
61
61
 
62
- \:host.tooltip-bottom-left::after
62
+ :host.tooltip-bottom-left::after
63
63
  bottom: 100%
64
64
  left: 10%
65
65
  margin-left: -5px
66
66
  border-width: 5px
67
67
  border-color: transparent transparent var(--bg-tooltip-primary) transparent
68
68
 
69
- \:host.tooltip-bottom-right::after
69
+ :host.tooltip-bottom-right::after
70
70
  bottom: 100%
71
71
  left: 90%
72
72
  margin-left: -5px
73
73
  border-width: 5px
74
74
  border-color: transparent transparent var(--bg-tooltip-primary) transparent
75
75
 
76
- \:host.tooltip-left::after
76
+ :host.tooltip-left::after
77
77
  top: 50%
78
78
  left: 100%
79
79
  margin-top: -5px
80
80
  border-width: 5px
81
81
  border-color: transparent transparent transparent var(--bg-tooltip-primary)
82
82
 
83
- \:host.tooltip-left-top::after
83
+ :host.tooltip-left-top::after
84
84
  top: 10%
85
85
  left: 100%
86
86
  margin-top: -5px
87
87
  border-width: 5px
88
88
  border-color: transparent transparent transparent var(--bg-tooltip-primary)
89
89
 
90
- \:host.tooltip-left-bottom::after
90
+ :host.tooltip-left-bottom::after
91
91
  top: 90%
92
92
  left: 100%
93
93
  margin-top: -5px
94
94
  border-width: 5px
95
95
  border-color: transparent transparent transparent var(--bg-tooltip-primary)
96
96
 
97
- \:host.tooltip-right::after
97
+ :host.tooltip-right::after
98
98
  top: 50%
99
99
  right: 100%
100
100
  margin-top: -5px
101
101
  border-width: 5px
102
102
  border-color: transparent var(--bg-tooltip-primary) transparent transparent
103
103
 
104
- \:host.tooltip-right-top::after
104
+ :host.tooltip-right-top::after
105
105
  top: 10%
106
106
  right: 100%
107
107
  margin-top: -5px
108
108
  border-width: 5px
109
109
  border-color: transparent var(--bg-tooltip-primary) transparent transparent
110
110
 
111
- \:host.tooltip-right-bottom::after
111
+ :host.tooltip-right-bottom::after
112
112
  top: 90%
113
113
  right: 100%
114
114
  margin-top: -5px
115
115
  border-width: 5px
116
116
  border-color: transparent var(--bg-tooltip-primary) transparent transparent
117
117
 
118
- // Light
119
- \:host.tooltip-light::after
118
+ // ==========================
119
+ // LIGHT THEME (tu rombo)
120
+ // ==========================
121
+
122
+ :host.tooltip-light::after
120
123
  display: none
121
124
 
122
- \:host.tooltip-light
125
+ :host.tooltip-light
123
126
  border: 1px solid rgba(0, 0, 0, .06)
124
127
  background-color: #fff
125
128
  color: black
@@ -139,7 +142,7 @@
139
142
  width: 10px
140
143
  height: 10px
141
144
 
142
- \:host.tooltip-top.tooltip-light
145
+ :host.tooltip-top.tooltip-light
143
146
  margin-top: -2px
144
147
 
145
148
  .tooltip-arrow
@@ -153,7 +156,7 @@
153
156
  top: 1px
154
157
  right: 1px
155
158
 
156
- \:host.tooltip-bottom.tooltip-light
159
+ :host.tooltip-bottom.tooltip-light
157
160
  .tooltip-arrow
158
161
  bottom: 100%
159
162
  left: 50%
@@ -165,7 +168,7 @@
165
168
  top: -1px
166
169
  right: -1px
167
170
 
168
- \:host.tooltip-left.tooltip-light
171
+ :host.tooltip-left.tooltip-light
169
172
  .tooltip-arrow
170
173
  top: 50%
171
174
  left: 100%
@@ -177,7 +180,7 @@
177
180
  top: 1px
178
181
  right: -1px
179
182
 
180
- \:host.tooltip-right.tooltip-light
183
+ :host.tooltip-right.tooltip-light
181
184
  .tooltip-arrow
182
185
  top: 50%
183
186
  right: 100%
@@ -188,3 +191,43 @@
188
191
  .tooltip-arrow::after
189
192
  top: -1px
190
193
  right: 1px
194
+
195
+ // ==================================================
196
+ // CARET GRANDE SOLO CUANDO persistent = true
197
+ // ==================================================
198
+
199
+ :host.tooltip-persistent.tooltip::after
200
+ border-width: 24px
201
+
202
+ // Centrado general del caret grande
203
+ :host.tooltip-persistent.tooltip-top::after,
204
+ :host.tooltip-persistent.tooltip-bottom::after
205
+ margin-left: -24px
206
+
207
+ :host.tooltip-persistent.tooltip-left::after,
208
+ :host.tooltip-persistent.tooltip-right::after
209
+ margin-top: -24px
210
+
211
+ // ==================================================
212
+ // AJUSTES FINOS SOLO PARA LOS CASOS QUE MENCIONASTE
213
+ // ==================================================
214
+
215
+ /* ---- TOP-RIGHT ---- */
216
+ :host.tooltip-persistent.tooltip-top-right::after
217
+ left: 85%
218
+ margin-left: -24px
219
+
220
+ /* ---- BOTTOM-RIGHT ---- */
221
+ :host.tooltip-persistent.tooltip-bottom-right::after
222
+ left: 85%
223
+ margin-left: -24px
224
+
225
+ /* ---- RIGHT-BOTTOM ---- */
226
+ :host.tooltip-persistent.tooltip-right-bottom::after
227
+ top: 85%
228
+ margin-top: -24px
229
+
230
+ /* ---- LEFT-BOTTOM ---- */
231
+ :host.tooltip-persistent.tooltip-left-bottom::after
232
+ top: 85%
233
+ margin-top: -24px
@@ -24,6 +24,7 @@ export class GravityTooltipComponent implements OnInit {
24
24
  @HostBinding('class.tooltip-shadow') hostClassShadow!: boolean;
25
25
  @HostBinding('class.tooltip-light') hostClassLight!: boolean;
26
26
  @HostBinding('class.tooltip-no-pointer') hostClassNoPointer!: boolean;
27
+ @HostBinding('class.tooltip-persistent') hostClassPersistent!: boolean;
27
28
 
28
29
  @HostListener('transitionend', ['$event'])
29
30
  transitionEnd() {
@@ -70,9 +71,16 @@ export class GravityTooltipComponent implements OnInit {
70
71
  }
71
72
 
72
73
  get tooltipOffset(): number {
73
- return Number(this.data.options.offset);
74
+ const base = Number(this.data.options.offset);
75
+
76
+ if (this.options['persistent']) {
77
+ return base + 18;
78
+ }
79
+
80
+ return base;
74
81
  }
75
82
 
83
+
76
84
  get isThemeLight() {
77
85
  return this.options['theme'] === 'light';
78
86
  }
@@ -235,6 +243,7 @@ export class GravityTooltipComponent implements OnInit {
235
243
  this.hostStyleMaxWidth = this.options['maxWidth'];
236
244
  this.hostStyleWidth = this.options['width'] ? this.options['width'] : '';
237
245
  this.hostClassNoPointer = !this.options['persistent'];
246
+ this.hostClassPersistent = !!this.options['persistent'];
238
247
  }
239
248
 
240
249
  closeTooltip() {
@@ -35,4 +35,5 @@ export interface TooltipOptions {
35
35
  'pointerEvents'?: 'auto' | 'none';
36
36
  'position'?: { top: number, left: number };
37
37
  'persistent'?: boolean;
38
+ 'isBanner'?: boolean;
38
39
  }