@threadlabs/looma 0.13.2 → 0.13.3

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.
@@ -1,6 +1,9 @@
1
1
  <template component="ui-affordance-scope" controller="./ui-affordance-scope.js">
2
2
  <defs>
3
3
  <prop name="nearRadius" type="number" default="16">How close, in pixels, the pointer must come to reveal an affordance.</prop>
4
+ <prop name="guide" type="dot | none" default="dot"
5
+ >What marks an anticipatory control at rest. dot shows a small guide dot where it will appear; none shows nothing until the pointer nears it, it is hovered,
6
+ or it takes focus. Every guide inside the scope follows it, including a sidebar's resize line and the editor table's handles.</prop>
4
7
  <state name="engaged" :value="false"></state>
5
8
  </defs>
6
9
  <span><slot></slot></span>
@@ -8,12 +11,18 @@
8
11
  :host {
9
12
  display: contents;
10
13
  --ui-affordance-scope-engaged: 0;
14
+ --ui-affordance-scope-guide: 1;
11
15
  }
12
16
 
13
17
  :host-state([engaged]) {
14
18
  --ui-affordance-scope-engaged: 1;
15
19
  }
16
20
 
21
+ /* Published to descendants: each guide multiplies its opacity by it, so none reaches them all. */
22
+ :host-state([guide="none"]) {
23
+ --ui-affordance-scope-guide: 0;
24
+ }
25
+
17
26
  /* A component that sets its display still honours the hidden attribute on its root. */
18
27
  :host[hidden] {
19
28
  display: none;
@@ -265,7 +265,7 @@
265
265
  height: var(--ui-affordance-guide-size);
266
266
  border-radius: var(--ui-radius-round);
267
267
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
268
- opacity: var(--ui-affordance-guide-opacity);
268
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
269
269
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
270
270
  }
271
271
 
@@ -354,7 +354,7 @@
354
354
  inset: 50% auto auto 50%;
355
355
  border-radius: var(--ui-radius-round);
356
356
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
357
- opacity: var(--ui-affordance-guide-opacity);
357
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
358
358
  transform: translate(-50%, -50%);
359
359
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
360
360
  pointer-events: none;
@@ -112,7 +112,7 @@
112
112
  block-size: var(--ui-affordance-guide-size);
113
113
  border-radius: var(--ui-radius-round);
114
114
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
115
- opacity: var(--ui-affordance-guide-opacity);
115
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
116
116
  transform: translate(-50%, -50%);
117
117
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
118
118
  pointer-events: none;
@@ -130,7 +130,7 @@
130
130
  inset-inline-start: 3px;
131
131
  inline-size: 2px;
132
132
  background: color-mix(in srgb, var(--ui-affordance-guide-color, var(--ui-border-strong)) 45%, transparent);
133
- opacity: var(--ui-affordance-guide-opacity);
133
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
134
134
  transition:
135
135
  background-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
136
136
  opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);