@kadoui/react 1.9.0 → 1.9.1

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.
@@ -2,5 +2,5 @@ import { HTMLAttributes, ReactNode } from "react";
2
2
  export type AccordionTogglePropsT = HTMLAttributes<HTMLButtonElement> & {
3
3
  icon?: ReactNode;
4
4
  };
5
- export declare function AccordionToggle({ className, onClick, ...props }: AccordionTogglePropsT): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AccordionToggle({ onClick, ...props }: AccordionTogglePropsT): import("react/jsx-runtime").JSX.Element;
6
6
  //# sourceMappingURL=AccordionToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACtE,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAgBtF"}
1
+ {"version":3,"file":"AccordionToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACtE,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAa3E"}
@@ -1,12 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
- import { cn } from "../../utils";
5
4
  import { AccordionContext } from "./AccordionContext";
6
- export function AccordionToggle({ className, onClick, ...props }) {
5
+ export function AccordionToggle({ onClick, ...props }) {
7
6
  const { isOpen, setOpen } = use(AccordionContext);
8
- return (_jsx("button", { onClick: ev => {
7
+ return (_jsx("button", { "data-state": isOpen, onClick: (ev) => {
9
8
  onClick?.(ev);
10
- setOpen(prev => !prev);
11
- }, className: cn(isOpen ? "accordion-active" : null, className), ...props }));
9
+ setOpen((prev) => !prev);
10
+ }, ...props }));
12
11
  }
@@ -1,4 +1,4 @@
1
1
  import { HTMLAttributes } from "react";
2
2
  export type AffixPropsT = HTMLAttributes<HTMLButtonElement>;
3
- export declare const Affix: ({ className, onClick, ...p }: AffixPropsT) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Affix: ({ onClick, ...p }: AffixPropsT) => import("react/jsx-runtime").JSX.Element;
4
4
  //# sourceMappingURL=Affix.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Affix.d.ts","sourceRoot":"","sources":["../../../src/components/Affix/Affix.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5D,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,KAAK,GAAI,8BAA8B,WAAW,4CA8C9D,CAAA"}
1
+ {"version":3,"file":"Affix.d.ts","sourceRoot":"","sources":["../../../src/components/Affix/Affix.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,KAAK,GAAI,mBAAmB,WAAW,4CA2CnD,CAAC"}
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useState, useEffect } from "react";
4
- import { cn } from "../../utils";
5
- export const Affix = ({ className, onClick, ...p }) => {
4
+ export const Affix = ({ onClick, ...p }) => {
6
5
  const [isVisible, setIsVisible] = useState(false);
7
6
  const [lastScrollY, setLastScrollY] = useState(0);
8
7
  useEffect(() => {
@@ -19,18 +18,18 @@ export const Affix = ({ className, onClick, ...p }) => {
19
18
  setLastScrollY(currentScrollY);
20
19
  };
21
20
  window.addEventListener("scroll", handleScroll, {
22
- passive: true
21
+ passive: true,
23
22
  });
24
23
  return () => window.removeEventListener("scroll", handleScroll);
25
24
  }, [lastScrollY]);
26
25
  const scrollToTop = () => {
27
26
  window.scrollTo({
28
27
  top: 0,
29
- behavior: "smooth"
28
+ behavior: "smooth",
30
29
  });
31
30
  };
32
- return (_jsx("button", { onClick: ev => {
31
+ return (_jsx("button", { "data-state": isVisible, onClick: (ev) => {
33
32
  onClick?.(ev);
34
33
  scrollToTop();
35
- }, className: cn(isVisible ? "affix-active" : null, className), ...p }));
34
+ }, ...p }));
36
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadoui/react",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Kadoui primitive components for React",
5
5
  "author": "FarzadVav",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "scripts": {
13
13
  "build": "tsc",
14
- "push": "tsc && git push && npm publish"
14
+ "publish": "tsc && npm publish"
15
15
  },
16
16
  "exports": {
17
17
  ".": "./dist/index.js",