@waveinno/ui 1.0.2 → 1.0.3

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
@@ -6,6 +6,11 @@ prop, major = a renamed or removed export or prop.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 1.0.3 — 2026-10-03
10
+
11
+ - `themeBootScript(density, defaultTheme)`: a second argument, `"system"` (default, as before), `"light"` or `"dark"`, sets
12
+ the theme a first-time visitor sees. A saved choice still wins. The Wavi site now opens in light mode.
13
+
9
14
  ## 1.0.2 — 2026-10-03
10
15
 
11
16
  - `npx @waveinno/ui add` fetches Pro components from the new site address, https://wavi.waveinno.app (`--url` and
@@ -11,5 +11,7 @@ export declare const PANEL_KEY = "waveinno.panel";
11
11
  /**
12
12
  * Injected into <head>; runs before paint, so the theme never flashes.
13
13
  * `defaultDensity` lets the Admin portal start compact (doc 29 §4).
14
+ * `defaultTheme` is used until the visitor picks one: "system" (the default)
15
+ * follows the device's light or dark setting; "light" or "dark" ignores it.
14
16
  */
15
- export declare function themeBootScript(defaultDensity?: "compact" | "default" | "comfortable"): string;
17
+ export declare function themeBootScript(defaultDensity?: "compact" | "default" | "comfortable", defaultTheme?: "system" | "light" | "dark"): string;
@@ -1,12 +1,12 @@
1
- const e="waveinno.theme",a="waveinno.density",o="waveinno.panel";function r(t="default"){return`
1
+ const o="waveinno.theme",r="waveinno.density",c="waveinno.panel";function n(e="default",t="system"){const a=t==="system"?'matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"':`"${t}"`;return`
2
2
  (function(){try{
3
- var t=localStorage.getItem("${e}");
4
- if(!t)t=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";
5
- var d=localStorage.getItem("${a}")||"${t}";
3
+ var t=localStorage.getItem("${o}");
4
+ if(t!=="light"&&t!=="dark")t=${a};
5
+ var d=localStorage.getItem("${r}")||"${e}";
6
6
  var e=document.documentElement;
7
7
  e.setAttribute("data-theme",t);
8
8
  e.setAttribute("data-density",d);
9
9
  e.style.colorScheme=t;
10
- if(localStorage.getItem("${o}")==="1")e.setAttribute("data-panel-collapsed","");
10
+ if(localStorage.getItem("${c}")==="1")e.setAttribute("data-panel-collapsed","");
11
11
  }catch(_){}})();
12
- `}export{a as DENSITY_KEY,o as PANEL_KEY,e as THEME_KEY,r as themeBootScript};
12
+ `}export{r as DENSITY_KEY,c as PANEL_KEY,o as THEME_KEY,n as themeBootScript};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waveinno/ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Wavi: the React design system from Bangladesh. 100+ components, app shell, charts, and bKash/taka/Bangla-ready inputs for Next.js and Vite, with Tailwind CSS 4. Set up with npx @waveinno/ui init.",
5
5
  "keywords": [
6
6
  "waveinno",