@energycap/components 0.46.16 → 0.46.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.46.16",
3
+ "version": "0.46.17",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "dependencies": {
6
6
  "tslib": "^2.0.0"
@@ -37,11 +37,16 @@ $button-padding-x: 0.5rem;
37
37
  }
38
38
 
39
39
  &:focus {
40
- outline: none;
40
+ outline: 2px solid transparent;
41
+ outline-offset: 2px;
41
42
  position: relative;
42
43
  z-index: 1;
43
44
  }
44
45
 
46
+ &:focus-visible {
47
+ outline-color: var(--ec-border-color-focus);
48
+ }
49
+
45
50
  &:disabled {
46
51
  background-color: var(--ec-background-color-disabled);
47
52
  border: 1px solid var(--ec-form-control-border-color-disabled);
@@ -125,6 +125,8 @@ $checkbox-indicator-size: $form-control-icon-size;
125
125
  } @else if $state == focus {
126
126
  border-color: var(--ec-form-control-border-color-focus);
127
127
  box-shadow: var(--ec-form-control-box-shadow-focus);
128
+ outline: 2px solid transparent;
129
+ outline-offset: 2px;
128
130
  position: relative;
129
131
  z-index: 1;
130
132
 
@@ -342,7 +344,14 @@ $checkbox-indicator-size: $form-control-icon-size;
342
344
  textarea:focus,
343
345
  input:focus,
344
346
  select:focus {
345
- outline: none;
347
+ outline: 2px solid transparent;
348
+ outline-offset: 2px;
349
+ }
350
+
351
+ textarea:focus-visible,
352
+ input:focus-visible,
353
+ select:focus-visible {
354
+ outline-color: var(--ec-border-color-focus);
346
355
  }
347
356
 
348
357
  .sr-only {
@@ -62,6 +62,7 @@
62
62
 
63
63
  #{$form-submit-button-selector} {
64
64
  --ec-button-color-primary: var(--ec-color-brand-green);
65
+ --ec-button-color-active: var(--ec-color-primary-dark);
65
66
  margin-left: auto;
66
67
  }
67
68
 
@@ -68,12 +68,17 @@ $menu-item-padding: get-item-padding($menu-item-height, $menu-item-line-height);
68
68
  }
69
69
 
70
70
  &:focus .item-wrapper{
71
- outline: none;
72
- background-color: var(--ec-color-disabled-dark);
71
+ outline: 2px solid transparent;
72
+ outline-offset: -2px;
73
+ background-color: var(--ec-background-color-selected);
73
74
  position: relative;
74
75
  z-index: 1;
75
76
  }
76
77
 
78
+ &:focus-visible .item-wrapper{
79
+ outline-color: var(--ec-border-color-focus);
80
+ }
81
+
77
82
  &.is-disabled .item-wrapper {
78
83
  color: var(--ec-color-disabled-dark);
79
84
  opacity: var(--ec-form-control-opacity-disabled);
@@ -17,6 +17,21 @@
17
17
  }
18
18
  }
19
19
 
20
+ /// Hover/focus treatment for a tab. Exposed separately from `tab` so a host can re-apply it when
21
+ /// the pointer is over something overlaying the tab (e.g. the closable tab's close button).
22
+ @mixin tab-hover($style: tabs) {
23
+ @if $style =='pills' or $style =='tiles' {
24
+ border-color: var(--ec-tab-border-color-active, var(--ec-border-color-focus));
25
+ box-shadow: 0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));
26
+ position: relative;
27
+ z-index: 1;
28
+ }
29
+
30
+ @else {
31
+ border-color: var(--ec-tab-border-color-active, var(--ec-border-color-focus));
32
+ }
33
+ }
34
+
20
35
  @mixin tab($style: tabs) {
21
36
  $height: 2rem;
22
37
 
@@ -61,28 +76,18 @@
61
76
 
62
77
  &:hover,
63
78
  &:focus {
64
- // Override the default browser focus ring
65
- outline: none;
66
-
67
- @if $style =='pills' {
68
- border-color: var(--ec-tab-border-color-active, var(--ec-border-color-focus));
69
- box-shadow: 0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));
70
- position: relative;
71
- z-index: 1;
72
-
73
- }
74
-
75
- @else if $style =='tiles' {
76
- border-color: var(--ec-tab-border-color-active, var(--ec-border-color-focus));
77
- box-shadow: 0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));
78
- position: relative;
79
- z-index: 1;
79
+ @include tab-hover($style);
80
+ }
80
81
 
81
- }
82
+ // Transparent outline only on actual focus (not hover) so forced-colors doesn't
83
+ // promote it to a visible ring on hover; keyboard ring set in &:focus-visible below.
84
+ &:focus {
85
+ outline: 2px solid transparent;
86
+ outline-offset: -2px;
87
+ }
82
88
 
83
- @else {
84
- border-color: var(--ec-tab-border-color-active, var(--ec-border-color-focus));
85
- }
89
+ &:focus-visible {
90
+ outline-color: var(--ec-border-color-focus);
86
91
  }
87
92
 
88
93
  &.is-disabled {
@@ -83,7 +83,11 @@
83
83
  }
84
84
 
85
85
  &:focus {
86
- outline: none;
87
- text-decoration: underline;
86
+ outline: 2px solid transparent;
87
+ outline-offset: 2px;
88
+ }
89
+
90
+ &:focus-visible {
91
+ outline-color: var(--ec-border-color-focus);
88
92
  }
89
93
  }
@@ -211,6 +211,10 @@ interface NavItem extends LinkItem {
211
211
  * Controls badge visibility. If undefined or true, badge will show (if badge property is set)
212
212
  */
213
213
  badgeVisible?: boolean;
214
+ /**
215
+ * Displays a button that allows the tab to be closed
216
+ */
217
+ closable?: boolean;
214
218
  }
215
219
 
216
220
  declare class NavGroup {
@@ -247,6 +251,8 @@ declare class TabsComponent {
247
251
  tabStyle: 'tabs' | 'pills' | 'tiles';
248
252
  /** The tabs group */
249
253
  tabs: NavGroup;
254
+ /** Emits the removed tab when its close button is clicked */
255
+ tabClosed: EventEmitter<NavItem>;
250
256
  constructor();
251
257
  /**
252
258
  * Set the selected tab to the one the user clicked on pressed enter
@@ -254,8 +260,10 @@ declare class TabsComponent {
254
260
  * has a link, navigate to that link.
255
261
  */
256
262
  selectTab(event: Event, tab: NavItem): void;
263
+ /** Remove a closable tab and select its nearest neighbor when necessary */
264
+ closeTab(event: Event, tab: NavItem): void;
257
265
  static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent, never>;
258
- static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent, "ec-tabs", never, { "id": { "alias": "id"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "tabStyle": { "alias": "tabStyle"; "required": false; }; "tabs": { "alias": "tabGroup"; "required": false; }; }, {}, never, never, false, never>;
266
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent, "ec-tabs", never, { "id": { "alias": "id"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "tabStyle": { "alias": "tabStyle"; "required": false; }; "tabs": { "alias": "tabGroup"; "required": false; }; }, { "tabClosed": "tabClosed"; }, never, never, false, never>;
259
267
  }
260
268
 
261
269
  /**