@threadlabs/looma 0.13.2 → 0.13.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.
@@ -25,6 +25,7 @@ export const icons = {
25
25
  "heading-1": [["path",{"d":"M4 12h8"}],["path",{"d":"M4 18V6"}],["path",{"d":"M12 18V6"}],["path",{"d":"m17 12 3-2v8"}]],
26
26
  "heading-2": [["path",{"d":"M4 12h8"}],["path",{"d":"M4 18V6"}],["path",{"d":"M12 18V6"}],["path",{"d":"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"}]],
27
27
  "heading-3": [["path",{"d":"M4 12h8"}],["path",{"d":"M4 18V6"}],["path",{"d":"M12 18V6"}],["path",{"d":"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"}],["path",{"d":"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"}]],
28
+ "help": [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{"d":"M12 17h.01"}]],
28
29
  "highlighter": [["path",{"d":"m9 11-6 6v3h9l3-3"}],["path",{"d":"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"}]],
29
30
  "image": [["rect",{"width":"18","height":"18","x":"3","y":"3","rx":"2","ry":"2"}],["circle",{"cx":"9","cy":"9","r":"2"}],["path",{"d":"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]],
30
31
  "info": [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M12 16v-4"}],["path",{"d":"M12 8h.01"}]],
@@ -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;
@@ -6,6 +6,9 @@
6
6
  <prop name="align" type="start | center | end | stretch"
7
7
  >How items line up within each row: center (the default) aligns their middles, start their tops, end their bottoms, and stretch makes every item as tall as
8
8
  its row.</prop>
9
+ <prop name="justify" type="start | center | end | between"
10
+ >Where items sit along each row: start (the default), center, end, or between, which pushes the first and last items to the ends of the row and spreads the
11
+ spare space between them, as for a title with its actions.</prop>
9
12
  </defs>
10
13
  <div><slot></slot></div>
11
14
  <style>
@@ -50,6 +53,15 @@
50
53
  :host-state([align="stretch"]) {
51
54
  align-items: stretch;
52
55
  }
56
+ :host-state([justify="center"]) {
57
+ justify-content: center;
58
+ }
59
+ :host-state([justify="end"]) {
60
+ justify-content: flex-end;
61
+ }
62
+ :host-state([justify="between"]) {
63
+ justify-content: space-between;
64
+ }
53
65
 
54
66
  /* A component that sets its display still honours the hidden attribute on its root. */
55
67
  :host[hidden] {
@@ -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;
@@ -265,6 +265,10 @@
265
265
 
266
266
  :host {
267
267
  --_icon-button-icon-default: var(--ui-icon-size-md);
268
+ /* A slotted ui-icon is its own component, out of reach of the svg rule below; these are its
269
+ defaults, which its own --ui-icon-* hooks still override. */
270
+ --_ui-default-icon-size: var(--_ui-icon-button-icon-size, var(--_icon-button-icon-default));
271
+ --_ui-default-icon-stroke-width: var(--_ui-icon-button-icon-stroke-width, 1.75);
268
272
  }
269
273
 
270
274
  :host-state([size="sm"]) {
@@ -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);