ecabs-components 1.1.92 → 1.1.94

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.
Files changed (36) hide show
  1. package/README.md +12 -0
  2. package/esm2022/lib/base/consts/badge.consts.mjs +2 -2
  3. package/esm2022/lib/base/directives/action-menu-trigger.directive.mjs +1 -1
  4. package/esm2022/lib/base/directives/badge.directive.mjs +106 -0
  5. package/esm2022/lib/base/directives/badge.directive.module.mjs +18 -0
  6. package/esm2022/lib/base/directives/tooltip-if-truncated.directive.module.mjs +6 -5
  7. package/esm2022/lib/base/models/action-menu.models.mjs +1 -1
  8. package/esm2022/lib/ecabs-action-menu/ecabs-action-menu.component.mjs +12 -7
  9. package/esm2022/lib/ecabs-action-menu/ecabs-action-menu.module.mjs +1 -1
  10. package/esm2022/lib/ecabs-badge/ecabs-badge.component.mjs +12 -13
  11. package/esm2022/lib/ecabs-badge/ecabs-badge.module.mjs +16 -3
  12. package/esm2022/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.mjs +19 -12
  13. package/esm2022/lib/ecabs-expansion-panel/ecabs-expansion-panel.module.mjs +7 -7
  14. package/esm2022/lib/ecabs-table/ecabs-table-filter-wrapper/ecabs-table-filter-wrapper.component.mjs +1 -1
  15. package/esm2022/public-api.mjs +3 -1
  16. package/fesm2022/ecabs-components.mjs +366 -231
  17. package/fesm2022/ecabs-components.mjs.map +1 -1
  18. package/lib/base/consts/badge.consts.d.ts +1 -0
  19. package/lib/base/directives/badge.directive.d.ts +26 -0
  20. package/lib/base/directives/badge.directive.module.d.ts +8 -0
  21. package/lib/base/directives/tooltip-if-truncated.directive.module.d.ts +2 -1
  22. package/lib/ecabs-action-menu/ecabs-action-menu.component.d.ts +5 -3
  23. package/lib/ecabs-badge/ecabs-badge.component.d.ts +2 -3
  24. package/lib/ecabs-badge/ecabs-badge.module.d.ts +5 -4
  25. package/lib/ecabs-expansion-panel/ecabs-expansion-panel.component.d.ts +3 -2
  26. package/lib/ecabs-expansion-panel/ecabs-expansion-panel.module.d.ts +3 -3
  27. package/package.json +1 -1
  28. package/public-api.d.ts +2 -0
  29. package/src/assets/styles/material/overrides/_badge.scss +107 -0
  30. package/src/assets/styles/material/overrides/_expansion.scss +43 -1
  31. package/src/assets/styles/material/overrides/_menu.scss +61 -61
  32. package/src/assets/styles/scss/modules/_badge.scss +26 -9
  33. package/src/assets/styles/scss/modules/_button.scss +1 -0
  34. package/src/assets/styles/scss/modules/_menu.scss +48 -48
  35. package/src/assets/styles/scss/modules/index.scss +25 -25
  36. package/src/assets/styles/tailwind/index.scss +1 -1
@@ -2,3 +2,4 @@ import { PhosphorIconWeight } from './icon.consts';
2
2
  export declare type BadgeVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
3
3
  export declare type BadgeSize = 'small' | 'medium' | 'large';
4
4
  export declare type BadgeIconWeight = PhosphorIconWeight;
5
+ export declare const CHIP_LABEL_CLASS = "mdc-evolution-chip__text-label";
@@ -0,0 +1,26 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { MatChip } from '@angular/material/chips';
3
+ import { MatMenuTrigger } from '@angular/material/menu';
4
+ import { BadgeSize, BadgeVariant } from '../consts/badge.consts';
5
+ import { EcabsTooltipIfTruncatedDirective } from './tooltip-if-truncated.directive';
6
+ import * as i0 from "@angular/core";
7
+ export declare class EcabsBadgeDirective {
8
+ private readonly elementRef;
9
+ private readonly chip?;
10
+ private readonly truncationTooltip?;
11
+ variant: BadgeVariant;
12
+ size: BadgeSize;
13
+ set bordered(value: boolean | string);
14
+ set disableRipple(value: boolean | string);
15
+ set interactive(value: boolean | string);
16
+ get badgeClasses(): string;
17
+ private hasBorder;
18
+ private rippleDisabled?;
19
+ private isInteractive;
20
+ private get noRipple();
21
+ private syncChip;
22
+ constructor(elementRef: ElementRef<HTMLElement>, menuTrigger?: MatMenuTrigger, chip?: MatChip, truncationTooltip?: EcabsTooltipIfTruncatedDirective);
23
+ onKeydown(event: KeyboardEvent): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<EcabsBadgeDirective, [null, { optional: true; self: true; }, { optional: true; }, { optional: true; }]>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<EcabsBadgeDirective, "[ecabsBadge]", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "bordered": { "alias": "bordered"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "interactive": { "alias": "interactive"; "required": false; }; }, {}, never, never, false, never>;
26
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./badge.directive";
3
+ import * as i2 from "@angular/common";
4
+ export declare class EcabsBadgeDirectiveModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<EcabsBadgeDirectiveModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsBadgeDirectiveModule, [typeof i1.EcabsBadgeDirective], [typeof i2.CommonModule], [typeof i1.EcabsBadgeDirective]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<EcabsBadgeDirectiveModule>;
8
+ }
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./tooltip-if-truncated.directive";
3
3
  import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/material/tooltip";
4
5
  export declare class EcabsTooltipIfTruncatedDirectiveModule {
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsTooltipIfTruncatedDirectiveModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsTooltipIfTruncatedDirectiveModule, [typeof i1.EcabsTooltipIfTruncatedDirective], [typeof i2.CommonModule], [typeof i1.EcabsTooltipIfTruncatedDirective]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsTooltipIfTruncatedDirectiveModule, [typeof i1.EcabsTooltipIfTruncatedDirective], [typeof i2.CommonModule, typeof i3.MatTooltipModule], [typeof i1.EcabsTooltipIfTruncatedDirective, typeof i3.MatTooltipModule]>;
7
8
  static ɵinj: i0.ɵɵInjectorDeclaration<EcabsTooltipIfTruncatedDirectiveModule>;
8
9
  }
@@ -1,4 +1,4 @@
1
- import { MenuPositionX } from '@angular/material/menu';
1
+ import { MatMenu, MenuPositionX } from '@angular/material/menu';
2
2
  import { PhosphorIconWeight } from '../base/consts/icon.consts';
3
3
  import { EcabsActionMenuTriggerDirective } from '../base/directives/action-menu-trigger.directive';
4
4
  import { ActionMenuGroup, ActionMenuItem } from '../base/models/action-menu.models';
@@ -11,14 +11,16 @@ export declare class EcabsActionMenuComponent {
11
11
  xPosition: MenuPositionX;
12
12
  menuClass: string;
13
13
  triggerFocusable: boolean;
14
+ showTrigger: boolean;
14
15
  readonly customTrigger?: EcabsActionMenuTriggerDirective;
16
+ readonly menu: MatMenu;
15
17
  private readonly menuTrigger?;
16
18
  get panelClass(): string;
17
19
  get triggerSvgIcon(): string;
18
20
  itemSvgIcon(item: ActionMenuItem): string;
19
- onTriggerKeydown(event: Event): void;
21
+ triggerKeydown(event: Event): void;
20
22
  trackByGroup(index: number): number;
21
23
  trackByItem(_: number, item: ActionMenuItem): string;
22
24
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsActionMenuComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<EcabsActionMenuComponent, "ecabs-action-menu", never, { "groups": { "alias": "groups"; "required": false; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; }; "triggerIconWeight": { "alias": "triggerIconWeight"; "required": false; }; "triggerAriaLabel": { "alias": "triggerAriaLabel"; "required": false; }; "xPosition": { "alias": "xPosition"; "required": false; }; "menuClass": { "alias": "menuClass"; "required": false; }; "triggerFocusable": { "alias": "triggerFocusable"; "required": false; }; }, {}, ["customTrigger"], never, false, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<EcabsActionMenuComponent, "ecabs-action-menu", never, { "groups": { "alias": "groups"; "required": false; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; }; "triggerIconWeight": { "alias": "triggerIconWeight"; "required": false; }; "triggerAriaLabel": { "alias": "triggerAriaLabel"; "required": false; }; "xPosition": { "alias": "xPosition"; "required": false; }; "menuClass": { "alias": "menuClass"; "required": false; }; "triggerFocusable": { "alias": "triggerFocusable"; "required": false; }; "showTrigger": { "alias": "showTrigger"; "required": false; }; }, {}, ["customTrigger"], never, false, never>;
24
26
  }
@@ -3,7 +3,8 @@ import * as i0 from "@angular/core";
3
3
  export declare class EcabsBadgeComponent {
4
4
  variant: BadgeVariant;
5
5
  size: BadgeSize;
6
- bordered: boolean;
6
+ set bordered(value: boolean | string);
7
+ hasBorder: boolean;
7
8
  /**
8
9
  * Icon name, resolved through whichever icon set the library is on (Phosphor
9
10
  * today). Deliberately not named after the vendor so a future icon-set change
@@ -26,8 +27,6 @@ export declare class EcabsBadgeComponent {
26
27
  * tooltip binding stable instead of changing after the view is checked.
27
28
  */
28
29
  private readonly labelRef?;
29
- get variantClass(): string;
30
- get sizeClass(): string;
31
30
  get svgIcon(): string;
32
31
  /**
33
32
  * Tooltip message for a clipped label. Read from the DOM rather than an input
@@ -2,11 +2,12 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./ecabs-badge.component";
3
3
  import * as i2 from "../base/pipes/status-badge-variant.pipe";
4
4
  import * as i3 from "@angular/common";
5
- import * as i4 from "@angular/material/icon";
6
- import * as i5 from "@angular/material/tooltip";
7
- import * as i6 from "../base/directives/tooltip-if-truncated.directive.module";
5
+ import * as i4 from "../base/directives/badge.directive.module";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/tooltip";
8
+ import * as i7 from "../base/directives/tooltip-if-truncated.directive.module";
8
9
  export declare class EcabsBadgeModule {
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsBadgeModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsBadgeModule, [typeof i1.EcabsBadgeComponent, typeof i2.EcabsStatusBadgeVariantPipe], [typeof i3.CommonModule, typeof i4.MatIconModule, typeof i5.MatTooltipModule, typeof i6.EcabsTooltipIfTruncatedDirectiveModule], [typeof i1.EcabsBadgeComponent, typeof i2.EcabsStatusBadgeVariantPipe]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsBadgeModule, [typeof i1.EcabsBadgeComponent, typeof i2.EcabsStatusBadgeVariantPipe], [typeof i3.CommonModule, typeof i4.EcabsBadgeDirectiveModule, typeof i5.MatIconModule, typeof i6.MatTooltipModule, typeof i7.EcabsTooltipIfTruncatedDirectiveModule], [typeof i1.EcabsBadgeComponent, typeof i4.EcabsBadgeDirectiveModule, typeof i2.EcabsStatusBadgeVariantPipe, typeof i7.EcabsTooltipIfTruncatedDirectiveModule]>;
11
12
  static ɵinj: i0.ɵɵInjectorDeclaration<EcabsBadgeModule>;
12
13
  }
@@ -16,14 +16,15 @@ export declare class EcabsExpansionPanelComponent implements OnChanges {
16
16
  showCheckbox: boolean;
17
17
  showStatus: boolean;
18
18
  status: string;
19
- hideToggle: boolean;
19
+ collapsible: boolean;
20
20
  checked: EventEmitter<boolean>;
21
21
  opened: EventEmitter<void>;
22
22
  expansionPanel: MatExpansionPanel;
23
23
  toggle: boolean;
24
+ get statusLabel(): string;
24
25
  onOpened(): void;
25
26
  ngOnChanges(changes: SimpleChanges): void;
26
27
  toggleAction(event: Event): void;
27
28
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsExpansionPanelComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<EcabsExpansionPanelComponent, "ecabs-expansion-panel", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "actionTitle": { "alias": "actionTitle"; "required": false; }; "index": { "alias": "index"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "showErrorMessage": { "alias": "showErrorMessage"; "required": false; }; "closePanel": { "alias": "closePanel"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "showCheckbox": { "alias": "showCheckbox"; "required": false; }; "showStatus": { "alias": "showStatus"; "required": false; }; "status": { "alias": "status"; "required": false; }; "hideToggle": { "alias": "hideToggle"; "required": false; }; }, { "checked": "checked"; "opened": "opened"; }, never, ["*"], false, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<EcabsExpansionPanelComponent, "ecabs-expansion-panel", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "actionTitle": { "alias": "actionTitle"; "required": false; }; "index": { "alias": "index"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "showErrorMessage": { "alias": "showErrorMessage"; "required": false; }; "closePanel": { "alias": "closePanel"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "showCheckbox": { "alias": "showCheckbox"; "required": false; }; "showStatus": { "alias": "showStatus"; "required": false; }; "status": { "alias": "status"; "required": false; }; "collapsible": { "alias": "collapsible"; "required": false; }; }, { "checked": "checked"; "opened": "opened"; }, never, ["*"], false, never>;
29
30
  }
@@ -5,10 +5,10 @@ import * as i3 from "@angular/forms";
5
5
  import * as i4 from "@angular/material/button";
6
6
  import * as i5 from "@angular/material/expansion";
7
7
  import * as i6 from "@angular/material/icon";
8
- import * as i7 from "@angular/material/chips";
9
- import * as i8 from "../ecabs-checkbox-toggle/ecabs-checkbox-toggle.module";
8
+ import * as i7 from "../ecabs-checkbox-toggle/ecabs-checkbox-toggle.module";
9
+ import * as i8 from "../ecabs-badge/ecabs-badge.module";
10
10
  export declare class EcabsExpansionPanelModule {
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsExpansionPanelModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsExpansionPanelModule, [typeof i1.EcabsExpansionPanelComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MatButtonModule, typeof i5.MatExpansionModule, typeof i6.MatIconModule, typeof i7.MatChipsModule, typeof i8.EcabsCheckboxToggleModule], [typeof i1.EcabsExpansionPanelComponent]>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsExpansionPanelModule, [typeof i1.EcabsExpansionPanelComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MatButtonModule, typeof i5.MatExpansionModule, typeof i6.MatIconModule, typeof i7.EcabsCheckboxToggleModule, typeof i8.EcabsBadgeModule], [typeof i1.EcabsExpansionPanelComponent]>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<EcabsExpansionPanelModule>;
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecabs-components",
3
- "version": "1.1.92",
3
+ "version": "1.1.94",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.12",
6
6
  "@angular/common": "^16.2.12",
package/public-api.d.ts CHANGED
@@ -111,6 +111,8 @@ export * from './lib/base/directives/digits-only.directive.module';
111
111
  export * from './lib/base/directives/show-on-truncated.directive';
112
112
  export * from './lib/base/directives/show-on-truncated.directive.module';
113
113
  export * from './lib/base/directives/action-menu-trigger.directive';
114
+ export * from './lib/base/directives/badge.directive';
115
+ export * from './lib/base/directives/badge.directive.module';
114
116
  export * from './lib/ecabs-validation/ecabs-validation.module';
115
117
  export * from './lib/ecabs-validation/ecabs-validation.component';
116
118
  export * from './lib/ecabs-active-status-filter/ecabs-active-status-filter.component';
@@ -1,3 +1,6 @@
1
+ $badge-sizes: small, medium, large;
2
+ $badge-variants: default, success, warning, danger, info;
3
+
1
4
  .mat-icon {
2
5
  &.badge__icon,
3
6
  .badge__icon--slot > & {
@@ -11,3 +14,107 @@
11
14
  }
12
15
  }
13
16
  }
17
+
18
+ .mdc-evolution-chip.mat-mdc-chip.badge {
19
+ @extend .badge;
20
+
21
+ --mdc-chip-container-height: auto;
22
+ --mdc-chip-with-avatar-avatar-size: var(--badge-icon-size);
23
+
24
+ min-width: 0;
25
+ width: auto;
26
+ justify-content: flex-start;
27
+
28
+ @each $size in $badge-sizes {
29
+ &.badge--#{$size} {
30
+ @extend .badge--#{$size};
31
+ }
32
+ }
33
+
34
+ @each $variant in $badge-variants {
35
+ &.badge--#{$variant} {
36
+ @extend .badge--#{$variant};
37
+ }
38
+ }
39
+
40
+ &.badge--interactive {
41
+ @extend .badge--interactive;
42
+ }
43
+
44
+ &:hover {
45
+ border-color: var(--badge-border-color, transparent);
46
+ }
47
+
48
+ .mdc-evolution-chip__cell--primary,
49
+ .mdc-evolution-chip__action--primary {
50
+ min-width: 0;
51
+ }
52
+
53
+ .mdc-evolution-chip__action--primary {
54
+ padding: 0;
55
+ gap: var(--badge-gap);
56
+ }
57
+
58
+ .mdc-evolution-chip__graphic {
59
+ flex: none;
60
+ padding: 0;
61
+ width: auto;
62
+
63
+ > * {
64
+ width: var(--badge-icon-size);
65
+ height: var(--badge-icon-size);
66
+ font-size: var(--badge-icon-size);
67
+ line-height: var(--badge-icon-size);
68
+ color: inherit;
69
+ }
70
+ }
71
+
72
+ // #Trailing icon
73
+ &.mdc-evolution-chip--with-trailing-action {
74
+ --badge-trailing-allowance: calc(var(--badge-icon-size) + var(--badge-gap));
75
+
76
+ max-width: calc(
77
+ var(--badge-max-width, 100% - var(--badge-trailing-allowance)) +
78
+ var(--badge-trailing-allowance)
79
+ );
80
+
81
+ .mdc-evolution-chip__graphic {
82
+ padding: 0;
83
+ }
84
+
85
+ .mdc-evolution-chip__icon--trailing {
86
+ width: var(--badge-icon-size);
87
+ height: var(--badge-icon-size);
88
+ padding: 0;
89
+
90
+ font-size: var(--badge-icon-size);
91
+ line-height: var(--badge-icon-size);
92
+ color: inherit;
93
+
94
+ transition: transform 150ms ease;
95
+ }
96
+ }
97
+
98
+ &[aria-expanded='true'] .mdc-evolution-chip__icon--trailing {
99
+ transform: rotate(180deg);
100
+ }
101
+
102
+ &,
103
+ .mdc-evolution-chip__action {
104
+ cursor: inherit;
105
+ }
106
+
107
+ &.badge--no-ripple:hover .mat-mdc-chip-focus-overlay {
108
+ opacity: 0;
109
+ }
110
+
111
+
112
+ .mdc-evolution-chip__text-label {
113
+ @extend .badge__label;
114
+
115
+ font-family: inherit;
116
+ font-size: inherit;
117
+ font-weight: inherit;
118
+ letter-spacing: inherit;
119
+ }
120
+ }
@@ -1,4 +1,15 @@
1
- .example-headers-align .mat-expansion-panel-header-title {
1
+ ecabs-expansion-panel {
2
+ .mat-expansion-panel-header-description {
3
+ justify-content: flex-end;
4
+ align-items: center;
5
+ }
6
+
7
+ .mat-expansion-indicator::after {
8
+ border-color: var(--color-gray-500);
9
+ }
10
+ }
11
+
12
+ ecabs-expansion-panel .mat-expansion-panel-header-title {
2
13
  @include fontSize($font-heading-xs);
3
14
 
4
15
  color: var(--color-brand-dark);
@@ -22,6 +33,37 @@
22
33
  .mat-expansion-panel-body {
23
34
  padding: calc-rem(0 0 16 0);
24
35
  }
36
+
37
+ .ecabs-expansion-panel__heading {
38
+ box-sizing: border-box;
39
+ display: flex;
40
+ align-items: center;
41
+ height: var(--mat-expansion-header-expanded-state-height, #{calc-rem(64)});
42
+ padding: calc-rem(0 0 24 0);
43
+
44
+ // Matches the width the real header's content box gets once the toggle is accounted for.
45
+ .mat-content {
46
+ display: flex;
47
+ flex: 1;
48
+ flex-direction: row;
49
+ overflow: hidden;
50
+ margin-right: calc-rem(8);
51
+ }
52
+
53
+ .mat-expansion-panel-header-title,
54
+ .mat-expansion-panel-header-description {
55
+ display: flex;
56
+ align-items: center;
57
+ flex-grow: 1;
58
+ flex-basis: 0;
59
+ margin-right: calc-rem(16);
60
+ }
61
+
62
+ .mat-expansion-panel-header-description {
63
+ flex-grow: 2;
64
+ color: var(--mat-expansion-header-description-color);
65
+ }
66
+ }
25
67
  }
26
68
 
27
69
  .mat-expansion-panel:not([class*=mat-elevation-z]) {
@@ -1,61 +1,61 @@
1
- .mat-mdc-menu-panel {
2
- &.mat-mdc-elevation-specific.mat-elevation-z8 {
3
- box-shadow: $box-shadow-default;
4
- }
5
-
6
- &.action-menu-panel {
7
- min-width: var(--action-menu-min-width, 180px);
8
-
9
- &.action-menu-panel--compact {
10
- --action-menu-min-width: #{calc-rem(120px)};
11
- }
12
- }
13
- }
14
-
15
- /* Material's menu styles are injected at runtime, so they land after this
16
- stylesheet and win every tie. The selectors below are deliberately one class
17
- heavier than the Material rules they counter. */
18
- .mat-mdc-icon-button {
19
- .mat-icon.action-menu__trigger-icon {
20
- width: var(--action-menu-trigger-icon-size);
21
- height: var(--action-menu-trigger-icon-size);
22
- font-size: var(--action-menu-trigger-icon-size);
23
- line-height: var(--action-menu-trigger-icon-size);
24
- color: var(--action-menu-trigger-icon-color);
25
-
26
- &:hover {
27
- color: var(--action-menu-trigger-icon-color-hover);
28
- }
29
- }
30
-
31
- &:hover .mat-icon.action-menu__trigger-icon {
32
- color: var(--action-menu-trigger-icon-color-hover);
33
- }
34
- }
35
-
36
- .mat-mdc-menu-item {
37
- &.action-menu-item {
38
- color: var(--action-menu-item-color);
39
-
40
- .mat-icon.action-menu-item__icon {
41
- margin-right: var(--action-menu-item-icon-gap);
42
- width: var(--action-menu-item-icon-size);
43
- height: var(--action-menu-item-icon-size);
44
- font-size: var(--action-menu-item-icon-size);
45
- line-height: var(--action-menu-item-icon-size);
46
- color: inherit;
47
-
48
- &:hover {
49
- color: inherit;
50
- }
51
- }
52
-
53
- &.action-menu-item--destructive:not([disabled]):hover {
54
- background-color: var(--color-error-opacity);
55
- }
56
- }
57
- }
58
-
59
- .logout-btn {
60
- box-shadow: 0 -5px 10px -10px var(--color-gray-500);
61
- }
1
+ .mat-mdc-menu-panel {
2
+ &.mat-mdc-elevation-specific.mat-elevation-z8 {
3
+ box-shadow: $box-shadow-default;
4
+ }
5
+
6
+ &.action-menu-panel {
7
+ min-width: var(--action-menu-min-width, 180px);
8
+
9
+ &.action-menu-panel--compact {
10
+ --action-menu-min-width: #{calc-rem(120px)};
11
+ }
12
+ }
13
+ }
14
+
15
+ /* Material's menu styles are injected at runtime, so they land after this
16
+ stylesheet and win every tie. The selectors below are deliberately one class
17
+ heavier than the Material rules they counter. */
18
+ .mat-mdc-icon-button {
19
+ .mat-icon.action-menu__trigger-icon {
20
+ width: var(--action-menu-trigger-icon-size);
21
+ height: var(--action-menu-trigger-icon-size);
22
+ font-size: var(--action-menu-trigger-icon-size);
23
+ line-height: var(--action-menu-trigger-icon-size);
24
+ color: var(--action-menu-trigger-icon-color);
25
+
26
+ &:hover {
27
+ color: var(--action-menu-trigger-icon-color-hover);
28
+ }
29
+ }
30
+
31
+ &:hover .mat-icon.action-menu__trigger-icon {
32
+ color: var(--action-menu-trigger-icon-color-hover);
33
+ }
34
+ }
35
+
36
+ .mat-mdc-menu-item {
37
+ &.action-menu-item {
38
+ color: var(--action-menu-item-color);
39
+
40
+ .mat-icon.action-menu-item__icon {
41
+ margin-right: var(--action-menu-item-icon-gap);
42
+ width: var(--action-menu-item-icon-size);
43
+ height: var(--action-menu-item-icon-size);
44
+ font-size: var(--action-menu-item-icon-size);
45
+ line-height: var(--action-menu-item-icon-size);
46
+ color: inherit;
47
+
48
+ &:hover {
49
+ color: inherit;
50
+ }
51
+ }
52
+
53
+ &.action-menu-item--destructive:not([disabled]):hover {
54
+ background-color: var(--color-error-opacity);
55
+ }
56
+ }
57
+ }
58
+
59
+ .logout-btn {
60
+ box-shadow: 0 -5px 10px -10px var(--color-gray-500);
61
+ }
@@ -1,10 +1,12 @@
1
- .badge {
1
+ .badge {
2
+ --badge-gap: 0.25rem;
3
+
2
4
  display: inline-flex;
3
5
  align-items: center;
4
- gap: 0.25rem;
6
+ gap: var(--badge-gap);
5
7
 
6
8
  max-width: var(--badge-max-width, 100%);
7
- border: 1px solid transparent;
9
+ border: 1px solid var(--badge-border-color, transparent);
8
10
  border-radius: $border-radius-base;
9
11
  font-weight: $font-weight-medium;
10
12
  line-height: 1;
@@ -19,7 +21,6 @@
19
21
  font-size: var(--badge-icon-size);
20
22
  line-height: var(--badge-icon-size);
21
23
 
22
-
23
24
  @include m(slot) {
24
25
  display: inline-flex;
25
26
  align-items: center;
@@ -89,23 +90,39 @@
89
90
 
90
91
  @include m(bordered) {
91
92
  &.badge--default {
92
- border-color: var(--color-default-border);
93
+ --badge-border-color: var(--color-default-border);
93
94
  }
94
95
 
95
96
  &.badge--success {
96
- border-color: var(--color-success-border);
97
+ --badge-border-color: var(--color-success-border);
97
98
  }
98
99
 
99
100
  &.badge--warning {
100
- border-color: var(--color-warning-border);
101
+ --badge-border-color: var(--color-warning-border);
101
102
  }
102
103
 
103
104
  &.badge--danger {
104
- border-color: var(--color-error-border);
105
+ --badge-border-color: var(--color-error-border);
105
106
  }
106
107
 
107
108
  &.badge--info {
108
- border-color: var(--color-info-border);
109
+ --badge-border-color: var(--color-info-border);
110
+ }
111
+ }
112
+
113
+ /* #Interactive */
114
+ // A badge that can be clicked: a status label that opens a menu
115
+ @include m(interactive) {
116
+ cursor: pointer;
117
+
118
+ // Inset, so the ring is drawn inside the badge's own border box. An outset
119
+ // ring needs 4px of clear space on every side and gets shaved by any
120
+ // ancestor that clips, which in a table cell is routine: the badge sits
121
+ // flush against the cell's padding edge. Negative offset makes it immune to
122
+ // that everywhere instead of per container.
123
+ &:focus-visible {
124
+ outline: 2px solid var(--color-info);
125
+ outline-offset: -2px;
109
126
  }
110
127
  }
111
128
  }
@@ -1,6 +1,7 @@
1
1
  .btn {
2
2
  @include fontSize($font-size-base);
3
3
 
4
+ position: relative;
4
5
  border: 0;
5
6
  min-width: calc-rem(111px);
6
7
  min-height: calc-rem(42px);
@@ -1,48 +1,48 @@
1
- .action-menu {
2
- @include e(trigger) {
3
- display: inline-flex;
4
- align-items: center;
5
- cursor: pointer;
6
- }
7
-
8
- @include e(trigger-icon) {
9
- --action-menu-trigger-icon-size: #{calc-rem(16px)};
10
- --action-menu-trigger-icon-color: var(--color-gray-400);
11
- --action-menu-trigger-icon-color-hover: var(--color-brand-dark);
12
-
13
- width: var(--action-menu-trigger-icon-size);
14
- height: var(--action-menu-trigger-icon-size);
15
- font-size: var(--action-menu-trigger-icon-size);
16
- line-height: var(--action-menu-trigger-icon-size);
17
- color: var(--action-menu-trigger-icon-color);
18
- }
19
- }
20
-
21
- .action-menu-item {
22
- --action-menu-item-color: var(--color-gray-700);
23
- --action-menu-item-icon-size: #{calc-rem(16px)};
24
- --action-menu-item-icon-gap: #{calc-rem(8px)};
25
-
26
- display: flex;
27
- align-items: center;
28
- color: var(--action-menu-item-color);
29
-
30
- @include m(destructive) {
31
- --action-menu-item-color: var(--color-error);
32
- }
33
-
34
- @include e(icon) {
35
- flex: none;
36
-
37
- margin-right: var(--action-menu-item-icon-gap);
38
- width: var(--action-menu-item-icon-size);
39
- height: var(--action-menu-item-icon-size);
40
- font-size: var(--action-menu-item-icon-size);
41
- line-height: var(--action-menu-item-icon-size);
42
- color: inherit;
43
- }
44
-
45
- @include e(label) {
46
- @include fontSize($font-size-md);
47
- }
48
- }
1
+ .action-menu {
2
+ @include e(trigger) {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ cursor: pointer;
6
+ }
7
+
8
+ @include e(trigger-icon) {
9
+ --action-menu-trigger-icon-size: #{calc-rem(16px)};
10
+ --action-menu-trigger-icon-color: var(--color-gray-400);
11
+ --action-menu-trigger-icon-color-hover: var(--color-brand-dark);
12
+
13
+ width: var(--action-menu-trigger-icon-size);
14
+ height: var(--action-menu-trigger-icon-size);
15
+ font-size: var(--action-menu-trigger-icon-size);
16
+ line-height: var(--action-menu-trigger-icon-size);
17
+ color: var(--action-menu-trigger-icon-color);
18
+ }
19
+ }
20
+
21
+ .action-menu-item {
22
+ --action-menu-item-color: var(--color-gray-700);
23
+ --action-menu-item-icon-size: #{calc-rem(16px)};
24
+ --action-menu-item-icon-gap: #{calc-rem(8px)};
25
+
26
+ display: flex;
27
+ align-items: center;
28
+ color: var(--action-menu-item-color);
29
+
30
+ @include m(destructive) {
31
+ --action-menu-item-color: var(--color-error);
32
+ }
33
+
34
+ @include e(icon) {
35
+ flex: none;
36
+
37
+ margin-right: var(--action-menu-item-icon-gap);
38
+ width: var(--action-menu-item-icon-size);
39
+ height: var(--action-menu-item-icon-size);
40
+ font-size: var(--action-menu-item-icon-size);
41
+ line-height: var(--action-menu-item-icon-size);
42
+ color: inherit;
43
+ }
44
+
45
+ @include e(label) {
46
+ @include fontSize($font-size-md);
47
+ }
48
+ }