@nexub/react 4.8.0 → 4.9.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.8.0",
2
+ "version": "4.9.0",
3
3
  "standard": "WCAG 2.2 Level AA",
4
4
  "method": {
5
5
  "automated": "axe-core rules tagged wcag2a, wcag2aa, wcag21a, wcag21aa and wcag22aa, run on every Storybook story in light and dark on every pull request; a new violation fails the build.",
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { warnOnce } from "../../utils/deprecated.js";
3
4
  import * as React from "react";
4
5
  import { useIsomorphicLayoutEffect } from "../../hooks/useIsomorphicLayoutEffect.js";
5
6
  const GLASS_MODES = ["clear", "balanced", "tinted", "off"];
@@ -107,6 +108,14 @@ function ThemeProvider({
107
108
  seedTarget = "primary"
108
109
  }) {
109
110
  useSeedTheme(seed, seedTarget);
111
+ React.useEffect(() => {
112
+ if (React.version.startsWith("18.")) warnOnce("react-18", "React 18 support is deprecated; 5.0 requires React 19.");
113
+ if (!document.documentElement.closest("[data-expression]") && !document.querySelector("[data-expression]"))
114
+ warnOnce(
115
+ "expression-default",
116
+ `In 5.0 the Vivid expression becomes the default. Set data-expression="calm" on <html> to keep today's look, or data-expression="vivid" to opt in now.`
117
+ );
118
+ }, []);
110
119
  const [theme, setThemeState] = React.useState(defaultTheme);
111
120
  const [systemTheme, setSystemTheme] = React.useState("light");
112
121
  const [glass, setGlassState] = React.useState(defaultGlass);
@@ -4,3 +4,5 @@
4
4
  * Bundlers replace `process.env.NODE_ENV`, so production builds drop the call's body.
5
5
  */
6
6
  export declare function warnDeprecated(name: string, replacement: string): void;
7
+ /** Warns once per key, outside production (same rules as warnDeprecated). Used for 4.9 → 5.0 notices. */
8
+ export declare function warnOnce(key: string, message: string): void;
@@ -11,6 +11,17 @@ function warnDeprecated(name, replacement) {
11
11
  `[@nexub/react] ${name} is deprecated and will be removed in 3.0. Use ${replacement} instead.`
12
12
  );
13
13
  }
14
+ function warnOnce(key, message) {
15
+ try {
16
+ if (process.env.NODE_ENV === "production") return;
17
+ } catch {
18
+ return;
19
+ }
20
+ if (warned.has(key)) return;
21
+ warned.add(key);
22
+ console.warn(`[@nexub/react] ${message}`);
23
+ }
14
24
  export {
15
- warnDeprecated
25
+ warnDeprecated,
26
+ warnOnce
16
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/react",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "React component library for Nexub Design System — 90+ accessible, themeable UI components built on Radix UI primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -81,13 +81,13 @@
81
81
  "date-fns": "^4.4.0",
82
82
  "react-day-picker": "^10.0.2",
83
83
  "tailwind-merge": "^3.7.0",
84
- "@nexub/core": "4.8.0",
85
- "@nexub/icons": "4.8.0"
84
+ "@nexub/core": "4.9.0",
85
+ "@nexub/icons": "4.9.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": ">=18 <20",
89
89
  "react-dom": ">=18 <20",
90
- "@nexub/tokens": "^4.8.0"
90
+ "@nexub/tokens": "^4.9.0"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@playwright/test": "1.64.0",
@@ -113,8 +113,8 @@
113
113
  "vaul": "1.1.2",
114
114
  "vite": "^8.3.5",
115
115
  "vitest": "^5.0.5",
116
- "@nexub/themes": "4.8.0",
117
- "@nexub/tokens": "4.8.0"
116
+ "@nexub/themes": "4.9.0",
117
+ "@nexub/tokens": "4.9.0"
118
118
  },
119
119
  "scripts": {
120
120
  "build": "rm -rf dist && tsup && tsc -p tsconfig.build.json && rm -f dist/vendor/*.d.ts && node scripts/check-dts.mjs && tailwindcss -i src/styles.css -o dist/styles.css --minify && cp -R ../themes/src/fonts dist/fonts",