@eagami/ui 5.76.0 → 5.78.0

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": "@eagami/ui",
3
- "version": "5.76.0",
3
+ "version": "5.78.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -11,19 +11,20 @@ $target-size-min: 24px;
11
11
  // transparent, so it reads the same on any surface, however coloured. Pass a full
12
12
  // box-shadow value to draw a halo instead, such as an error ring; box-shadow is
13
13
  // dropped in forced-colors (Windows High Contrast) mode, so a real outline stands
14
- // in for it there.
15
- @mixin focus-ring($ring: null) {
14
+ // in for it there. Pass `$offset` to move the outline's gap, which a negative
15
+ // value turns inward.
16
+ @mixin focus-ring($ring: null, $offset: 2px) {
16
17
  @if $ring {
17
18
  outline: none;
18
19
  box-shadow: $ring;
19
20
  } @else {
20
21
  outline: var(--border-width-medium) solid var(--color-border-focus);
21
- outline-offset: 2px;
22
+ outline-offset: $offset;
22
23
  }
23
24
 
24
25
  @media (forced-colors: active) {
25
26
  outline: 2px solid Highlight;
26
- outline-offset: 2px;
27
+ outline-offset: $offset;
27
28
  }
28
29
  }
29
30
 
@@ -39,6 +40,31 @@ $target-size-min: 24px;
39
40
  }
40
41
  }
41
42
 
43
+ // The inset ring for an element that can carry a solid fill of its own, such as a
44
+ // filled button or a selected day, where a ring in the focus colour alone could all
45
+ // but vanish into the fill. A band of the page colour runs just inside the ring to
46
+ // set it apart. `$offset` moves the ring and the band follows it, and `$shadow`
47
+ // keeps a shadow the element already wears.
48
+ @mixin focus-ring-inset-banded(
49
+ $offset: calc(-1 * var(--border-width-medium)),
50
+ $shadow: null
51
+ ) {
52
+ $band: inset 0 0 0 calc(var(--border-width-medium) - #{$offset}) var(--color-bg-base);
53
+
54
+ outline: var(--border-width-medium) solid var(--color-border-focus);
55
+ outline-offset: $offset;
56
+
57
+ @if $shadow {
58
+ box-shadow: $band, $shadow;
59
+ } @else {
60
+ box-shadow: $band;
61
+ }
62
+
63
+ @media (forced-colors: active) {
64
+ outline-color: Highlight;
65
+ }
66
+ }
67
+
42
68
  // Floating surfaces (menus, dialogs, popovers, toasts) lean on elevation shadow
43
69
  // for their boundary, but shadows are dropped in forced-colors mode. Add a
44
70
  // hairline border there so the surface stays separated from the content behind.
@@ -1967,7 +1967,10 @@ export type ButtonAlign = 'start' | 'center' | 'end';
1967
1967
  * while preserving the rendered width. Chrome is tunable per instance via
1968
1968
  * `--ea-button-padding`, `--ea-button-min-height` and `--ea-button-radius`,
1969
1969
  * which is how an icon-only button comes down to little more than its glyph
1970
- * and how a call-to-action becomes a pill. For navigation, put
1970
+ * and how a call-to-action becomes a pill. The focus ring is drawn just inside
1971
+ * the button over a band of the page colour, so it never overlaps a neighbour
1972
+ * and stands out on any fill; `--ea-button-focus-ring-offset` moves it, and a
1973
+ * positive length draws it outside instead. For navigation, put
1971
1974
  * `ButtonLinkComponent` on an anchor instead (`<a eaButtonLink href="...">`):
1972
1975
  * it takes the same styling inputs and keeps real link behaviour.
1973
1976
  */