@kadoui/react 1.7.9 → 1.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.
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren, ReactNode } from "react";
2
+ export type LinkLoaderPropsT = PropsWithChildren & {
3
+ loader: ReactNode;
4
+ };
5
+ export declare function LinkLoader({ loader, children }: LinkLoaderPropsT): ReactNode;
6
+ //# sourceMappingURL=LinkLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkLoader.d.ts","sourceRoot":"","sources":["../../../src/next/LinkLoader/LinkLoader.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,MAAM,EAAE,SAAS,CAAC;CACnB,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,aAIhE"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { useLinkStatus } from "next/link";
3
+ export function LinkLoader({ loader, children }) {
4
+ const { pending } = useLinkStatus();
5
+ return pending ? loader : children;
6
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ThemeAdapter(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=ThemeAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeAdapter.d.ts","sourceRoot":"","sources":["../../../src/next/ThemeAdapter/ThemeAdapter.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,YAAY,4CAE3B"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const themeScript = `
3
+ (function() {
4
+ try {
5
+ const themeHandler = (ev) => {
6
+ const theme = ev.matches ? "dark" : "light";
7
+ document.querySelector("html").setAttribute("data-theme", theme);
8
+ };
9
+
10
+ const darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)");
11
+
12
+ darkModeQuery.addEventListener("change", themeHandler)
13
+
14
+ themeHandler(darkModeQuery)
15
+ } catch (err) {
16
+ console.log(err)
17
+ }
18
+ })();
19
+ `;
20
+ export function ThemeAdapter() {
21
+ return _jsx("script", { dangerouslySetInnerHTML: { __html: themeScript } });
22
+ }
package/dist/next.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./next/LinkLoader/LinkLoader";
2
+ export * from "./next/ThemeAdapter/ThemeAdapter";
3
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
package/dist/next.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./next/LinkLoader/LinkLoader";
2
+ export * from "./next/ThemeAdapter/ThemeAdapter";
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "name": "@kadoui/react",
3
- "version": "1.7.9",
3
+ "version": "1.9.0",
4
4
  "description": "Kadoui primitive components for React",
5
5
  "author": "FarzadVav",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "repository": "https://github.com/FarzadVav/kadoui-react",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
9
12
  "scripts": {
10
13
  "build": "tsc",
11
- "push": "npm run build && git push && npm publish"
14
+ "push": "tsc && git push && npm publish"
12
15
  },
13
16
  "exports": {
14
17
  ".": "./dist/index.js",
15
- "./utils": "./dist/utils.js"
18
+ "./utils": "./dist/utils.js",
19
+ "./next": "./dist/next.js"
16
20
  },
17
21
  "keywords": [
18
22
  "@kadoui/react",