@zazz-ui/core 0.14.3 → 0.15.1

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/AUTHORING.md CHANGED
@@ -147,6 +147,8 @@ A region whose content depends on the page, such as a section sidebar, should no
147
147
  </html>
148
148
  ```
149
149
 
150
+ If the page also runs htmx or a client router, put `data-ui-navigation="off"` on the regions that library drives (the nearest `data-ui-navigation` ancestor wins), and call `Zazz.refresh(element)` after it inserts markup (`htmx.onLoad((el) => Zazz.refresh(el))`). Back and Forward into or out of an entry the page pushed with `history.pushState()`, or to one a script gave `history.state` (htmx's `{ htmx: true }`), are left to the page.
151
+
150
152
  `<ui-debug>` lists the persisted elements on each page and warns about a missing or duplicate id, nested persisted elements, and `data-ui-persist` on a page without the opt-in. It checks `data-ui-persist-scroll` the same way, and flags one that sits on or inside a `data-ui-persist` element, which already keeps its scroll.
151
153
 
152
154
  ## Theme
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  Notable changes to `@zazz-ui/core`, grouped by primitive or base scope under each version. The grouping is load-bearing: the `zazz-ui` CLI's `update` and `diff` print only the slice that touches the files you've vendored. Breaking entries are flagged **BREAKING** with a one-line migration note. During 0.x, a minor bump means at least one breaking entry (ADR-0010 has the full definition of "breaking").
2
2
 
3
+ ## 0.15.1 (2026-11-23)
4
+
5
+ ### tooltip
6
+
7
+ - On a touch screen the tooltip hides only its content, not the whole `ui-tooltip`. Since 0.11.0 the trigger inside it was hidden too, so an icon button with a tooltip disappeared on phones.
8
+
9
+ ## 0.15.0 (2026-11-18)
10
+
11
+ ### base
12
+
13
+ - **BREAKING** With `data-ui-navigation="swap"`, Back and Forward swap only between entries the swap made. An entry the page pushed with `history.pushState()` (htmx's `hx-push-url` and `hx-boost`, a client router) is left to the page, going into it and coming out of it, and so is any entry a script gave `history.state` (htmx stamps the first entry it swaps on with `{ htmx: true }`). Swapping those raced the library's own restore. A page that pushes URLs without restoring them on `popstate` must now restore them itself.
14
+ - `data-ui-navigation="off"` on an ancestor of a link or form leaves its navigation to the browser (a full load, unless another library handles the click first). The nearest `data-ui-navigation` ancestor decides, so `swap` inside an opted-out region opts back in. It needs `NavigateEvent.sourceElement`; without it the attribute has no effect.
15
+ - New `Zazz.refresh(element)`, also `window.Zazz` and a named export of the entry module: runs the refresh hooks (reveal, attribute-form carousels, select-all checkboxes, sticky states, the drawer page indent) over markup another library inserted, the element itself included. With no argument it refreshes the whole body. For htmx: `htmx.onLoad((el) => Zazz.refresh(el))`.
16
+ - The swap remembers its history entries in `sessionStorage` (`zazz:navigation-entries`), so Back and Forward between swapped pages still swap after a reload.
17
+
3
18
  ## 0.14.3 (2026-11-18)
4
19
 
5
20
  ### base
package/README.md CHANGED
@@ -4,7 +4,7 @@ Zazz is a CSS and vanilla JavaScript UI kit that does not require a build step.
4
4
 
5
5
  Docs: <https://zazz.sh> (guides, a [quick start](https://zazz.sh/docs/quick-start/), and an [API reference](https://zazz.sh/api/) generated from this package's data).
6
6
 
7
- **Zazz is in alpha (0.14).** The markup contract can change in any minor release before 1.0, and 0.5 and later are not compatible with 0.4; see [`CHANGELOG.md`](./CHANGELOG.md) for every breaking change and its migration note.
7
+ **Zazz is in alpha (0.15).** The markup contract can change in any minor release before 1.0, and 0.5 and later are not compatible with 0.4; see [`CHANGELOG.md`](./CHANGELOG.md) for every breaking change and its migration note.
8
8
 
9
9
  ## Install
10
10
 
@@ -20,7 +20,7 @@ import "@zazz-ui/core"; // custom elements and shared behaviors
20
20
  From a CDN, the script needs an import map for its one dependency and the Interest Invokers polyfill:
21
21
 
22
22
  ```html
23
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.14.3/dist/zazz.css" />
23
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.15.1/dist/zazz.css" />
24
24
  <script type="importmap">
25
25
  {
26
26
  "imports": {
@@ -32,7 +32,7 @@ From a CDN, the script needs an import map for its one dependency and the Intere
32
32
  type="module"
33
33
  src="https://cdn.jsdelivr.net/npm/invokers@2.2.2/dist/esm/production/interest.js"
34
34
  ></script>
35
- <script type="module" src="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.14.3/dist/zazz.js"></script>
35
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.15.1/dist/zazz.js"></script>
36
36
  ```
37
37
 
38
38
  Use an exact version in CDN URLs. Under a strict `script-src`, give the import map and the theme script the response's nonce (`buildHead({ nonce })` does); the docs' [security page](https://zazz.sh/docs/install/security/) has the full policy, including `style-src-attr` for the utilities. The [installation guide](https://zazz.sh/docs/install/installation/) has the complete `<head>`, with fonts, the theme script, a per-primitive variant, and integrity hashes on every URL; `buildHead({ cdn: { version } })` from `@zazz-ui/core/head` returns the same markup. Each release also includes `dist/sri.json` with the SHA-384 hash of every published file.
@@ -0,0 +1 @@
1
+ import{a as e}from"./zazz-element-D1KYRPlU.js";const t=`data-ui-stuck`,n={top:`bottom`,right:`left`,bottom:`top`,left:`right`};let r=[],i,a=0;function o(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){let{overflowX:e,overflowY:n}=getComputedStyle(t);if(/auto|scroll|hidden/.test(e+n))return t}return null}function s(e,{writingMode:t,direction:r}){let i=!t.startsWith(`horizontal`),a=i?t.endsWith(`lr`)?`left`:`right`:`top`,o=i?r===`rtl`?`bottom`:`top`:r===`rtl`?`right`:`left`,s=[];return e===a&&s.push(`block-start`),e===n[a]&&s.push(`block-end`),e===o&&s.push(`inline-start`),e===n[o]&&s.push(`inline-end`),s}function c(e,t){if(t.position!==`sticky`)return[];let n=o(e),r=n??document.scrollingElement??document.documentElement,i=n?(()=>{let e=n.getBoundingClientRect(),t=e.top+n.clientTop,r=e.left+n.clientLeft;return{top:t,left:r,bottom:t+n.clientHeight,right:r+n.clientWidth}})():{top:0,left:0,bottom:innerHeight,right:innerWidth},a=e.getBoundingClientRect(),s=r.scrollHeight-r.clientHeight,c=r.scrollWidth-r.clientWidth,l=getComputedStyle(r).direction===`rtl`,u=r.scrollLeft,d={top:r.scrollTop>0,bottom:r.scrollTop<s-.5,left:l?u>-c+.5:u>0,right:l?u<0:u<c-.5},f={top:a.top-i.top,bottom:i.bottom-a.bottom,left:a.left-i.left,right:i.right-a.right};return Object.keys(f).filter(e=>{let n=t[e];return n!==`auto`&&d[e]&&Math.abs(f[e]-Number.parseFloat(n))<1})}function l(){a=0;for(let e of r){let n=getComputedStyle(e),r=c(e,n).flatMap(e=>[e,...s(e,n)]).join(` `);r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.removeAttribute(t)}}function u(){a||=requestAnimationFrame(l)}function d(){if(i){for(let e of r)e.isConnected||e.removeAttribute(t);r=[...document.querySelectorAll(`[style*=": sticky"], [style*="--stuck-state:"]`)].filter(e=>e.querySelector(`[style*="--stuck:"]`)),u()}}function f(){return typeof CSS<`u`&&CSS.supports(`container-type`,`scroll-state`)}function p({force:e=!1}={}){if(i||!e&&f())return;i=new AbortController;let t={passive:!0,capture:!0,signal:i.signal};document.addEventListener(`scroll`,u,t),window.addEventListener(`resize`,u,t),d()}typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>p(),{once:!0}):p(),e(d));export{};
package/dist/sri.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "dist/csp-LRx1fynI.js": "sha384-s1Kg/1/tQobRsTf5BpAR3XeNmA3AkU7xfe6xdKivdk22yxstCs1ets32NeMMp9Av",
3
- "dist/scroll-state-C8mA5gq6.js": "sha384-m9uzgIAkSnk8Es+jgCbChIYFu4rPyr00IB7lrAR/8dcsPc3u75VA7Wq5LIEAvXpT",
4
- "dist/zazz.css": "sha384-X3Ks/hnhbGlszTutdOp54Jq2DR4xYNU51XBFmwc8N5BAxaFaA41gFouYgyezeaup",
5
- "dist/zazz.js": "sha384-j8tXatpYHPHBIc5jA1Iic/VZOhkAHI8oQhJPsIlDn5OX6mhg+7l+tr5+Yz3Af+U+",
3
+ "dist/scroll-state-D5Q3aRca.js": "sha384-ndrmIXoKRAH28dhO0GfgC1PGvOsRfTGIxGVvir3SFMGSq3+bSR0fiLtlhqOjgKRW",
4
+ "dist/zazz-element-D1KYRPlU.js": "sha384-7y5TQT4cko75zxEEldC7svWQSBZLYA8mdqrpOfnjClJSsmFlng8LOxeHzNgGD0IB",
5
+ "dist/zazz.css": "sha384-Jj8oxVZbmz2q5Ax0f0D/EZUlRQMGhH1z4vOw8aomU0tNG0VZnJIWuHfzsAMTpn41",
6
+ "dist/zazz.js": "sha384-fdK7/zg68detgxrLnLQHvBtFgPxREpdyB679pQQRFJ1PxXW/ZZri1u1gN5Tmyerr",
6
7
  "src/base/_breakpoints.css": "sha384-vsvdoL+ZjTa5gyCiMp4DlNIbr9rxkLqfQjZ+W3YTp2Apuuu+1/Dd68ACtcBOip3v",
7
8
  "src/base/_defaults.css": "sha384-B0qvVNCJK5NWeEuEdB89lHXg9fIpKkU/wPCvONGtmhfFdEw8SclyssDYW2dWly3X",
8
9
  "src/base/_layers.css": "sha384-+muc9Umj4iangP79BNjiCidmgTfGe7w41/GR/ZW14yuBb+b5MnrPpWrYu99Ontr8",
@@ -62,7 +63,7 @@
62
63
  "src/base/gesture.js": "sha384-43cNAXoiBk1ThbxgglTRJryv3crJvbP+wUDcdWOp9YGJGnH/oG3CdEmjV0Ftfm72",
63
64
  "src/base/hotkeys.js": "sha384-THU0JbWwkM9QAVJ2BwF5rwGHOIhCPLKHxfhmixYyyCBU0eNRi9kz6VxfNGaj8D8O",
64
65
  "src/base/kit-styling.js": "sha384-9b+AADFSMagkBZnofRinoF5NX9jNI8lmIRt0x8iam7X/cTM1ecU13j+p9NBoufTM",
65
- "src/base/navigation.js": "sha384-JWy/CrNzTkdI/TIL2KtRTgq5fFajcAqAgf9wJbgVUnRM346ZGSbJ/xXHOc2A4hgU",
66
+ "src/base/navigation.js": "sha384-peFuwYvtmPEtZR/b4K4Dcej5zKmKl5wtoqYbSL7F3oG60LleUXC3LBcti4nQ1czJ",
66
67
  "src/base/reveal.js": "sha384-UYiDoNgXsINWTIabv/STaj1+zfP3OSe1vBgkxTWup51l0HQE1PgsRtQDpPAHOPHC",
67
68
  "src/base/scroll-state.js": "sha384-ql6E3qGCmO5nKrmORbRCrU9bVlbIpcYvQq+zr26VZhRNHdnqNuJGH9mK0hXy1vG1",
68
69
  "src/base/signals.js": "sha384-N4p17bKbP9wixbRP1y8qH7XQ+FGKNzyFLMd63FCDE8qz3UKRx8csEQTLGodDCRBi",
@@ -70,10 +71,10 @@
70
71
  "src/base/typeahead.js": "sha384-jh0mIkDn2KiL9y+7vBq8hPXymo+yXd0d4PG4dUHq29B3NEvOmnxinqaxTyoPWUiV",
71
72
  "src/base/utilities.js": "sha384-/bREfylmbbEKfS1OMLpBtTP8dZZ4YVgJuXmY5k7bT15b2G0m0ijJyni9bJu0YgaP",
72
73
  "src/base/utils.js": "sha384-LYgZQdVhTZM9VrjMl/pn8005MC3zL6kqOodJEs4Xi0fPysol71QaYnq9egqgrUfh",
73
- "src/base/zazz-element.js": "sha384-dTk+HZujh1qWzZBaxgcZA1t01lvr311gYirU4RGX8utXCpTEGWGfiE28XGjBIAos",
74
+ "src/base/zazz-element.js": "sha384-V1zlYqvu5n0tPt0Ts8I4N06v0pSpA0Sbl9V/ayxJH8PBDJoqsrFrziGKt+IXqOQn",
74
75
  "src/head.js": "sha384-qsFhpXZXDDB5uTe1cZoUHo+Swt85lXYGdPK8G0d9qRiSJBwNgfmSRjH10MJUEUxH",
75
76
  "src/index.css": "sha384-mLMa5WjyDJiRcvPK0LtP83sWR2GPTC7Koay4v7F1iR5NgU4o/T/q2Uab7GCJKLh9",
76
- "src/index.js": "sha384-tKxj7/ptI/LHsCebZAPCQPAtgmVoUEnwfTcBPRBlOfb86vQJM98GNaG4P+jtGR+S",
77
+ "src/index.js": "sha384-RgLYTG8W0pqY5mOitIFeqaoejabS/Je9uu7lDJopbddVtZbVOZ5A32mctNA80ArW",
77
78
  "src/manifest.js": "sha384-SK7NTDFsKfOYUSrAAPSat0MpAga/4RgGb0PnfVEB/wMLYlLGh6zW2VJCQRL4fycV",
78
79
  "src/primitives/accordion/accordion.css": "sha384-e3cqAIMjloFAooyyZ1eVKClJ3eJTziFpUcgqRe8q3ZjZVw6VpALzKFQhgh6nmdt2",
79
80
  "src/primitives/alert-dialog/alert-dialog.css": "sha384-9m0LO7yTIgUFeP4UV4NrrbHRmRpfsTobK6PU+FZ0QnWuPeiU+gXvAVGyzaCAB72M",
@@ -134,5 +135,5 @@
134
135
  "src/primitives/toaster/toaster.js": "sha384-weP7kweVZZxWUzswPEAa4T1kRE1PemB9nY2c4tPiFllqVdYDA+0q9gyTrHOpZnrf",
135
136
  "src/primitives/toggle-group/toggle-group.css": "sha384-v53Y/LcfZldgONI5Yux0lG4vMIth1y0c8EF1WFOu3f8yKcQ2LyNMV4NU2NLdkNWf",
136
137
  "src/primitives/toggle/toggle.css": "sha384-69B0X8ThHMsh42P5fJWlxmywYCz/hBxTODXRsAByqOxJk5RUtRm5EOYromemyORL",
137
- "src/primitives/tooltip/tooltip.css": "sha384-iF1CjFzQPh4fGqrNgfOW5Y57ETOJto7UL0qTgb9xsG3FarTQmMMESITOF91n/q4r"
138
+ "src/primitives/tooltip/tooltip.css": "sha384-46lSd34KLSClSHYQt3U7L/W8C9miahZE0krex3+lp7RqE0pS7ObkRgQp7wec4z64"
138
139
  }
@@ -0,0 +1 @@
1
+ var e=class extends HTMLElement{#e=null;connectedCallback(){this.#e||(this.#e=new AbortController,this.setup(this.#e.signal))}connectedMoveCallback(){}disconnectedCallback(){this.#e?.abort(),this.#e=null,this.teardown?.()}};function t(e,t){typeof window<`u`&&(customElements.get(e)||customElements.define(e,t))}const n=[];function r(e){n.push(e)}function i(e){for(let t of n)t(e)}function a(e){i(e?e.parentElement??e:document.body)}const o={refresh:a};typeof window<`u`&&(window.Zazz=o);export{r as a,i,e as n,t as r,o as t};