@nexub/react 4.8.0 → 5.0.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": "5.0.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.",
@@ -45,8 +45,10 @@ export interface ThemeProviderProps {
45
45
  seed?: string;
46
46
  /** Accent family the seed recolours: 'primary' (default) or 'tertiary' (product brand). */
47
47
  seedTarget?: 'primary' | 'tertiary';
48
+ /** Expression set on <html> when it has no data-expression. Needs `@nexub/themes/vivid` for Vivid. @default 'vivid' */
49
+ defaultExpression?: 'vivid' | 'calm';
48
50
  }
49
- export declare function ThemeProvider({ children, defaultTheme, storageKey, defaultGlass, glassStorageKey, seed, seedTarget, }: ThemeProviderProps): React.JSX.Element;
51
+ export declare function ThemeProvider({ children, defaultTheme, storageKey, defaultGlass, glassStorageKey, seed, seedTarget, defaultExpression, }: ThemeProviderProps): React.JSX.Element;
50
52
  export declare function useTheme(): ThemeContextValue;
51
53
  export interface ThemeScriptProps {
52
54
  /** Must match ThemeProvider's `storageKey`. Defaults to 'nexub-theme'. */
@@ -104,9 +104,14 @@ function ThemeProvider({
104
104
  defaultGlass = "balanced",
105
105
  glassStorageKey = "nexub-glass",
106
106
  seed,
107
- seedTarget = "primary"
107
+ seedTarget = "primary",
108
+ defaultExpression = "vivid"
108
109
  }) {
109
110
  useSeedTheme(seed, seedTarget);
111
+ useIsomorphicLayoutEffect(() => {
112
+ const html = document.documentElement;
113
+ if (!html.hasAttribute("data-expression")) html.setAttribute("data-expression", defaultExpression);
114
+ }, [defaultExpression]);
110
115
  const [theme, setThemeState] = React.useState(defaultTheme);
111
116
  const [systemTheme, setSystemTheme] = React.useState("light");
112
117
  const [glass, setGlassState] = React.useState(defaultGlass);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/react",
3
- "version": "4.8.0",
3
+ "version": "5.0.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": "5.0.0",
85
+ "@nexub/icons": "5.0.0"
86
86
  },
87
87
  "peerDependencies": {
88
- "react": ">=18 <20",
89
- "react-dom": ">=18 <20",
90
- "@nexub/tokens": "^4.8.0"
88
+ "react": ">=19 <20",
89
+ "react-dom": ">=19 <20",
90
+ "@nexub/tokens": "^5.0.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": "5.0.0",
117
+ "@nexub/tokens": "5.0.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",
@@ -1,6 +0,0 @@
1
- /**
2
- * Warns once per component, outside production, that it is deprecated and removed in 3.0
3
- * (GOVERNANCE.md: a removal needs a development warning in a 2.x minor first).
4
- * Bundlers replace `process.env.NODE_ENV`, so production builds drop the call's body.
5
- */
6
- export declare function warnDeprecated(name: string, replacement: string): void;
@@ -1,16 +0,0 @@
1
- const warned = /* @__PURE__ */ new Set();
2
- function warnDeprecated(name, replacement) {
3
- try {
4
- if (process.env.NODE_ENV === "production") return;
5
- } catch {
6
- return;
7
- }
8
- if (warned.has(name)) return;
9
- warned.add(name);
10
- console.warn(
11
- `[@nexub/react] ${name} is deprecated and will be removed in 3.0. Use ${replacement} instead.`
12
- );
13
- }
14
- export {
15
- warnDeprecated
16
- };