@threadlabs/looma 0.11.2 → 0.11.4

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.
@@ -98,6 +98,14 @@
98
98
  --_callout-icon: var(--ui-danger-solid);
99
99
  }
100
100
 
101
+ /* A link in the callout's text is underlined, so it reads as a link by more than colour. */
102
+ .content :slotted(a) {
103
+ color: var(--ui-accent-active);
104
+ text-decoration: underline;
105
+ text-decoration-thickness: 0.06em;
106
+ text-underline-offset: 0.18em;
107
+ }
108
+
101
109
  /* A component that sets its display still honours the hidden attribute on its root. */
102
110
  :host[hidden] {
103
111
  display: none;
@@ -48,9 +48,10 @@
48
48
  min-block-size: var(--ui-form-field-help-min-block-size, 0);
49
49
  }
50
50
 
51
+ /* An error reads in the danger colour, the one the invalid control's border takes. */
51
52
  .error,
52
53
  :slotted([role="alert"]) {
53
- color: var(--ui-accent-active);
54
+ color: var(--ui-danger);
54
55
  font-size: var(--ui-font-size-sm);
55
56
  }
56
57
 
@@ -56,13 +56,15 @@
56
56
  /* The app's invalid flag, or the browser's own verdict once the user has left an invalid field. */
57
57
  :host[aria-invalid="true"],
58
58
  :host:user-invalid {
59
- border-color: var(--ui-danger-solid);
59
+ border-color: var(--ui-input-invalid-border, var(--ui-danger-solid));
60
60
  }
61
61
 
62
62
  :host:is([aria-invalid="true"], :user-invalid):focus-visible {
63
- box-shadow:
63
+ box-shadow: var(
64
+ --ui-input-invalid-focus-shadow,
64
65
  var(--ui-control-inset),
65
- 0 0 0 3px color-mix(in srgb, var(--ui-danger-solid) 22%, transparent);
66
+ 0 0 0 3px color-mix(in srgb, var(--ui-danger-solid) 22%, transparent)
67
+ );
66
68
  }
67
69
 
68
70
  :host:disabled {
@@ -18,6 +18,8 @@
18
18
  --ui-input-border: transparent;
19
19
  --ui-input-border-hover: transparent;
20
20
  --ui-input-focus-border: transparent;
21
+ --ui-input-invalid-border: transparent;
22
+ --ui-input-invalid-focus-shadow: none;
21
23
  --ui-input-shadow: none;
22
24
  --ui-input-focus-shadow: none;
23
25
  --ui-input-radius: 0;
@@ -78,6 +78,15 @@
78
78
  font-family: var(--ui-font-family-mono);
79
79
  }
80
80
 
81
+ /* A link in running text is underlined, so it stands apart from the words around it by more than
82
+ colour. */
83
+ :host :slotted(a) {
84
+ color: var(--ui-accent-active);
85
+ text-decoration: underline;
86
+ text-decoration-thickness: 0.06em;
87
+ text-underline-offset: 0.18em;
88
+ }
89
+
81
90
  :host-state([truncate]) {
82
91
  overflow: hidden;
83
92
  text-overflow: ellipsis;
@@ -298,7 +298,7 @@
298
298
  /* A hovered row reads its whole name: the label slides far enough to show the end, waits
299
299
  there, and comes back. Only when it actually overflows — the controller measures by how
300
300
  much — after the controls have taken their place over its end — and hands over the distance
301
- and a duration from it, so a longer name travels no faster. */
301
+ and a duration from it, so every name moves at the same speed. */
302
302
  .row[data-ui-marquee] > .label > .label-text {
303
303
  /* Once, and it stays at the end while the pointer is there: a name that keeps sliding back
304
304
  and forth under the pointer is harder to read than one that arrives and holds. */
@@ -102,7 +102,7 @@ export default function controller(host) {
102
102
  * at its own width; it has to end where the fade before the controls begins, since the controls
103
103
  * overlay the label's end rather than taking width from it.
104
104
  */
105
- const MARQUEE_SPEED = 36; // CSS pixels per second.
105
+ const MARQUEE_SPEED = 36; // CSS pixels per second, for every name: a clamped duration made short slides crawl.
106
106
  // The tree sets this for its items; an item's own prop overrides it either way.
107
107
  const marqueeWanted = () => host.state.marquee
108
108
  || getComputedStyle(element).getPropertyValue("--ui-tree-item-marquee").trim() === "1";
@@ -121,10 +121,7 @@ export default function controller(host) {
121
121
  const lead = icon?.width ? (rightToLeft ? icon.right - cell.right : cell.left - icon.left) : 0;
122
122
  row.style.setProperty("--_marquee-lead", `${Math.max(0, lead)}px`);
123
123
  row.style.setProperty("--_marquee-distance", `${rightToLeft ? distance : -distance}px`);
124
- row.style.setProperty(
125
- "--_marquee-duration",
126
- `${Math.min(10, Math.max(1.4, distance / MARQUEE_SPEED)).toFixed(2)}s`
127
- );
124
+ row.style.setProperty("--_marquee-duration", `${(distance / MARQUEE_SPEED).toFixed(2)}s`);
128
125
  row.dataset.uiMarquee = "";
129
126
  };
130
127
  const stopMarquee = () => {