sinwan-ui-core 1.2.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this package are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package uses [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## [1.2.1]
6
+
7
+ ### Fixed
8
+
9
+ - `ThemeProvider` (`theme`): switching the theme no longer replays entrance animations. The transition lock used to set `animation: none` as well, and lifting it restarts every CSS animation on the page, so `animate-in` blocks faded in again after each switch. The lock now only turns transitions off.
10
+ - The transition lock now actually stops themed colors from transitioning. It released on the next animation frame without computing styles first, and a browser runs that callback before the frame's style pass, so the new theme and the release were applied together and every `transition-colors` element still faded through the old theme. The lock now reads a computed style while transitions are off and releases before `setTheme` returns.
11
+
5
12
  ## [1.2.0]
6
13
 
7
14
  ### Added
@@ -53,13 +53,11 @@ function getSystemTheme() {
53
53
  }
54
54
  function disableTransitionsTemporarily() {
55
55
  const style = document.createElement("style");
56
- style.appendChild(document.createTextNode("*,*::before,*::after{transition:none!important;animation:none!important}"));
56
+ style.appendChild(document.createTextNode("*,*::before,*::after{transition:none!important}"));
57
57
  document.head.appendChild(style);
58
58
  return () => {
59
- window.getComputedStyle(document.body);
60
- requestAnimationFrame(() => {
61
- style.parentNode?.removeChild(style);
62
- });
59
+ window.getComputedStyle(document.body).opacity;
60
+ style.parentNode?.removeChild(style);
63
61
  };
64
62
  }
65
63
  function writeDomTheme(next, attribute) {
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ import {
89
89
  ThemeProvider2,
90
90
  useTheme2,
91
91
  ThemeToggle2
92
- } from "./chunks/chunk-33f19xws.js";
92
+ } from "./chunks/chunk-rrvtbvbh.js";
93
93
  export {
94
94
  AccordionContent2 as AccordionContent,
95
95
  AccordionItem2 as AccordionItem,
package/dist/theme.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ThemeProvider2,
4
4
  useTheme2,
5
5
  ThemeToggle2
6
- } from "./chunks/chunk-33f19xws.js";
6
+ } from "./chunks/chunk-rrvtbvbh.js";
7
7
  export {
8
8
  ThemeKey2 as ThemeKey,
9
9
  ThemeProvider2 as ThemeProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinwan-ui-core",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Headless behaviour primitives for Sinwan UI components: overlays, floating positioning, dismiss layers, controls, slots, theme and direction.",
5
5
  "author": "Mohammed Ben Cheikh",
6
6
  "license": "MIT",