@nexub/react 7.2.0 → 7.4.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.
- package/accessibility.json +1 -1
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.js +28 -5
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.js +37 -7
- package/dist/components/DataTable/DataTable.d.ts +5 -1
- package/dist/components/DataTable/DataTable.js +6 -2
- package/dist/components/Motion/Collapse.d.ts +5 -4
- package/dist/components/Motion/Collapse.js +23 -53
- package/dist/components/Motion/motion.types.d.ts +2 -0
- package/dist/components/NavigationMenu/NavigationMenu.js +3 -1
- package/dist/components/Progress/Progress.d.ts +4 -0
- package/dist/components/Progress/Progress.js +74 -21
- package/dist/components/Skeleton/Skeleton.d.ts +9 -0
- package/dist/components/Skeleton/Skeleton.js +18 -1
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Skeleton/index.js +2 -1
- package/dist/components/Tabs/Tabs.js +13 -3
- package/dist/components/Toast/Toaster.js +68 -23
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/useToast.d.ts +18 -1
- package/dist/components/Toast/useToast.js +14 -0
- package/dist/hooks/useAsyncAction.d.ts +27 -0
- package/dist/hooks/useAsyncAction.js +36 -0
- package/dist/hooks/useSlidingIndicator.d.ts +1 -1
- package/dist/hooks/useSlidingIndicator.js +2 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +4 -1
- package/dist/styles.css +1 -1
- package/dist/utils/viewTransition.d.ts +4 -2
- package/dist/utils/viewTransition.js +10 -2
- package/package.json +6 -6
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Run a DOM update as a view transition (styles: @nexub/themes/view-transitions).
|
|
3
|
-
*
|
|
3
|
+
* React state set inside `update` is flushed synchronously, so the browser
|
|
4
|
+
* snapshots the new DOM rather than the stale one. Resolves when the transition
|
|
5
|
+
* has finished (or right after the update where the API is missing / on the server).
|
|
4
6
|
*/
|
|
5
|
-
export declare function startViewTransition(update: () => void | Promise<void>): void
|
|
7
|
+
export declare function startViewTransition(update: () => void | Promise<void>): Promise<void>;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { flushSync } from "react-dom";
|
|
1
2
|
function startViewTransition(update) {
|
|
3
|
+
const run = () => {
|
|
4
|
+
let result = void 0;
|
|
5
|
+
flushSync(() => {
|
|
6
|
+
result = update();
|
|
7
|
+
});
|
|
8
|
+
return result;
|
|
9
|
+
};
|
|
2
10
|
const doc = typeof document === "undefined" ? void 0 : document;
|
|
3
|
-
if (doc?.startViewTransition) doc.startViewTransition(
|
|
4
|
-
|
|
11
|
+
if (doc?.startViewTransition) return doc.startViewTransition(run).finished;
|
|
12
|
+
return Promise.resolve(run());
|
|
5
13
|
}
|
|
6
14
|
export {
|
|
7
15
|
startViewTransition
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.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",
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
"get-nonce": "^1.0.1",
|
|
87
87
|
"react-day-picker": "^10.0.2",
|
|
88
88
|
"tailwind-merge": "^3.7.0",
|
|
89
|
-
"@nexub/core": "7.
|
|
90
|
-
"@nexub/icons": "7.
|
|
89
|
+
"@nexub/core": "7.4.0",
|
|
90
|
+
"@nexub/icons": "7.4.0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"react": ">=19 <20",
|
|
94
94
|
"react-dom": ">=19 <20",
|
|
95
95
|
"@tanstack/react-virtual": "^3.14.22",
|
|
96
|
-
"@nexub/tokens": "^7.
|
|
96
|
+
"@nexub/tokens": "^7.4.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|
|
99
99
|
"@tanstack/react-virtual": {
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"vaul": "1.1.2",
|
|
126
126
|
"vite": "^8.3.5",
|
|
127
127
|
"vitest": "^5.0.5",
|
|
128
|
-
"@nexub/themes": "7.
|
|
129
|
-
"@nexub/tokens": "7.
|
|
128
|
+
"@nexub/themes": "7.4.0",
|
|
129
|
+
"@nexub/tokens": "7.4.0"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"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",
|