hydrateless 0.6.0 → 0.7.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/tokens.css CHANGED
@@ -143,7 +143,7 @@
143
143
  --hl-font-semibold: 600;
144
144
  --hl-font-bold: 700;
145
145
 
146
- /* Elevation (shadows) — tuned for light surfaces */
146
+ /* Elevation (shadows), tuned for light surfaces */
147
147
  --hl-shadow-xs: 0 1px 2px 0 hsla(222, 47%, 11%, 0.05);
148
148
  --hl-shadow-sm: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
149
149
  --hl-shadow-md:
@@ -187,7 +187,7 @@
187
187
  /**
188
188
  * Semantic tokens map the raw palette to roles (surface, text, border, intent
189
189
  * colors). Components reference only these, so theming and dark mode are a
190
- * matter of remapping a couple dozen variables — never touching component CSS.
190
+ * matter of remapping a couple dozen variables, never touching component CSS.
191
191
  *
192
192
  * Light is the default in `:root`. Dark applies automatically via
193
193
  * `prefers-color-scheme` (unless `[data-theme="light"]` opts out) and always
package/dist/tooltip.css CHANGED
@@ -1,23 +1,49 @@
1
+ /**
2
+ * Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
3
+ * trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
4
+ * (the tip must be the trigger's next sibling). When the enhancer runs it marks
5
+ * the trigger `data-hl-tooltip-managed` and drives visibility through
6
+ * `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
7
+ * Escape-to-dismiss.
8
+ */
1
9
  @layer components {
2
10
  [role='tooltip'] {
11
+ /* Fallback placement: the JS positioner writes inline position/inset on
12
+ engines without CSS anchor positioning. */
3
13
  position: absolute;
4
14
  z-index: var(--hl-z-tooltip);
5
- top: auto;
6
- right: auto;
7
- bottom: auto;
8
- left: 0;
9
- translate: 0 -0.25rem;
15
+ width: -moz-max-content;
16
+ width: max-content;
17
+ max-width: 32ch;
18
+ margin: 0;
10
19
  padding: var(--hl-space-1) var(--hl-space-2);
11
20
  border-radius: var(--hl-radius-sm);
12
21
  background: var(--hl-fg);
13
22
  color: var(--hl-surface);
14
23
  font-size: var(--hl-text-sm);
15
- max-width: 32ch;
16
- width: -moz-max-content;
17
- width: max-content;
18
24
  }
19
25
 
20
26
  [role='tooltip'][hidden] {
21
27
  display: none;
22
28
  }
29
+
30
+ /* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
31
+ Suppressed once the enhancer takes over (trigger gains -managed). */
32
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
33
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):focus-visible + [role='tooltip'] {
34
+ display: block;
35
+ }
36
+
37
+ /* Modern placement: pin above the trigger via the anchor-name the enhancer
38
+ sets, flipping below when there's no room. */
39
+ @supports (anchor-name: --x) {
40
+ [role='tooltip'] {
41
+ position: fixed;
42
+ inset-area: block-start;
43
+ position-area: block-start;
44
+ position-try-fallbacks: flip-block;
45
+ margin-top: var(--hl-space-1);
46
+ margin-bottom: var(--hl-space-1);
47
+ }
48
+ }
23
49
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hydrateless",
3
- "version": "0.6.0",
4
- "description": "Accessible, themeable UI primitives — semantic HTML + modern CSS first, optional JS enhancers.",
3
+ "version": "0.7.0",
4
+ "description": "Accessible, themeable UI primitives: semantic HTML and modern CSS first, optional JS enhancers.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",