hydrateless 0.9.0 → 0.10.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/dist/tooltip.css CHANGED
@@ -9,7 +9,8 @@
9
9
  * `hidden`), and drives visibility through `data-hl-tooltip-open` with show
10
10
  * and hide delays, a grace period, and Escape to dismiss.
11
11
  * data-hl-tooltip: the trigger
12
- * data-hl-placement: top (default) | bottom | left | right, on the trigger
12
+ * data-hl-placement: top (default) | bottom | start | end, on the trigger
13
+ * data-hl-side: the resolved side, set on the tip by the enhancer
13
14
  * data-hl-tooltip-managed: set on the trigger by the enhancer
14
15
  * data-hl-tooltip-open: set on the tip while shown
15
16
  */
@@ -58,8 +59,10 @@
58
59
  }
59
60
  }
60
61
 
61
- /* Modern placement: pin above the trigger via the anchor-name the enhancer
62
- sets, flipping below when there's no room. */
62
+ /* Modern placement: pin to the requested side of the trigger via the
63
+ anchor-name the enhancer sets, flipping when there's no room. The side
64
+ comes from `data-hl-side` on the tip (enhanced) or `data-hl-placement` on
65
+ the preceding trigger (no-JS baseline). */
63
66
  @supports (anchor-name: --x) {
64
67
  [role='tooltip'] {
65
68
  position: fixed;
@@ -68,6 +71,30 @@
68
71
  position-try-fallbacks: flip-block;
69
72
  margin-block: var(--hl-space-1);
70
73
  }
74
+
75
+ [role='tooltip'][data-hl-side='bottom'],
76
+ [data-hl-tooltip][data-hl-placement^='bottom'] + [role='tooltip'] {
77
+ position-area: block-end;
78
+ }
79
+
80
+ [role='tooltip']:is([data-hl-side='start'], [data-hl-side='end']),
81
+ [data-hl-tooltip]:is([data-hl-placement^='start'], [data-hl-placement^='end'])
82
+ + [role='tooltip'] {
83
+ position-try-fallbacks: flip-inline;
84
+ margin-block: 0;
85
+ margin-inline: var(--hl-space-1);
86
+ translate: 0 0;
87
+ }
88
+
89
+ [role='tooltip'][data-hl-side='start'],
90
+ [data-hl-tooltip][data-hl-placement^='start'] + [role='tooltip'] {
91
+ position-area: inline-start;
92
+ }
93
+
94
+ [role='tooltip'][data-hl-side='end'],
95
+ [data-hl-tooltip][data-hl-placement^='end'] + [role='tooltip'] {
96
+ position-area: inline-end;
97
+ }
71
98
  }
72
99
 
73
100
  /* Inverted colors flatten away; keep a visible edge on the system canvas. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hydrateless",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Accessible, themeable UI primitives: semantic HTML and modern CSS first, optional JS enhancers.",
5
5
  "license": "MIT",
6
6
  "repository": {