@kadoui/react 1.0.1 → 1.1.2
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/dist/components/AccessNavigation/AccessNavigation.jsx +1 -1
- package/dist/components/Accordion/AccordionBody.d.ts +1 -1
- package/dist/components/Accordion/AccordionBody.d.ts.map +1 -1
- package/dist/components/Accordion/AccordionBody.jsx +3 -6
- package/dist/components/Accordion/AccordionToggle.d.ts +1 -1
- package/dist/components/Accordion/AccordionToggle.d.ts.map +1 -1
- package/dist/components/Accordion/AccordionToggle.jsx +3 -8
- package/dist/components/Affix/Affix.d.ts +1 -1
- package/dist/components/Affix/Affix.d.ts.map +1 -1
- package/dist/components/Affix/Affix.jsx +3 -6
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.jsx +2 -3
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.jsx +2 -3
- package/dist/components/Carousel/Carousel.d.ts +4 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +5 -1
- package/dist/components/Carousel/CarouselContainer.d.ts +1 -1
- package/dist/components/Carousel/CarouselContainer.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselContainer.jsx +2 -3
- package/dist/components/Carousel/CarouselContext.d.ts +2 -0
- package/dist/components/Carousel/CarouselContext.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselLeftFade.d.ts +5 -0
- package/dist/components/Carousel/CarouselLeftFade.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselLeftFade.jsx +10 -0
- package/dist/components/Carousel/CarouselRightFade.d.ts +5 -0
- package/dist/components/Carousel/CarouselRightFade.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselRightFade.jsx +10 -0
- package/dist/components/Carousel/CarouselRoot.d.ts +1 -1
- package/dist/components/Carousel/CarouselRoot.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselRoot.jsx +3 -16
- package/dist/components/Clipboard/Clipboard.d.ts +3 -2
- package/dist/components/Clipboard/Clipboard.d.ts.map +1 -1
- package/dist/components/Clipboard/Clipboard.jsx +2 -5
- package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenuContent.jsx +3 -3
- package/dist/components/ContextMenu/ContextMenuRoot.jsx +1 -1
- package/dist/components/Drawer/DrawerBody.d.ts +1 -1
- package/dist/components/Drawer/DrawerBody.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerBody.jsx +3 -4
- package/dist/components/Drawer/DrawerPortal.d.ts +1 -1
- package/dist/components/Drawer/DrawerPortal.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerPortal.jsx +2 -3
- package/dist/components/Drawer/DrawerRoot.jsx +1 -1
- package/dist/components/Dropdown/DropdownMenu.d.ts +1 -1
- package/dist/components/Dropdown/DropdownMenu.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownMenu.jsx +2 -3
- package/dist/components/Dropdown/DropdownRoot.d.ts +1 -1
- package/dist/components/Dropdown/DropdownRoot.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownRoot.jsx +4 -7
- package/dist/components/LoaderLink/LoaderLink.d.ts +6 -0
- package/dist/components/LoaderLink/LoaderLink.d.ts.map +1 -0
- package/dist/components/LoaderLink/LoaderLink.jsx +6 -0
- package/dist/components/Modal/Modal.d.ts +3 -3
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/ModalBody.d.ts +3 -3
- package/dist/components/Modal/ModalBody.d.ts.map +1 -1
- package/dist/components/Modal/ModalBody.jsx +20 -5
- package/dist/components/Modal/ModalContent.d.ts +3 -3
- package/dist/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/components/Modal/ModalContent.jsx +2 -21
- package/dist/components/Modal/ModalHeader.d.ts +1 -1
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/ModalHeader.jsx +2 -3
- package/dist/components/Modal/ModalPortal.d.ts +1 -1
- package/dist/components/Modal/ModalPortal.d.ts.map +1 -1
- package/dist/components/Modal/ModalPortal.jsx +2 -3
- package/dist/components/Modal/ModalRoot.jsx +1 -1
- package/dist/components/Otp/OtpInputs.d.ts +1 -1
- package/dist/components/Otp/OtpInputs.d.ts.map +1 -1
- package/dist/components/Otp/OtpInputs.jsx +2 -3
- package/dist/components/Otp/OtpRoot.d.ts +1 -1
- package/dist/components/Otp/OtpRoot.d.ts.map +1 -1
- package/dist/components/Otp/OtpRoot.jsx +2 -3
- package/dist/components/Pagination/PaginationNextBtn.d.ts +1 -1
- package/dist/components/Pagination/PaginationNextBtn.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationNextBtn.jsx +2 -5
- package/dist/components/Pagination/PaginationPrevBtn.d.ts +1 -1
- package/dist/components/Pagination/PaginationPrevBtn.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationPrevBtn.jsx +2 -5
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts +5 -3
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInputToggle.jsx +2 -10
- package/dist/components/Progress/ProgressBar.d.ts +1 -1
- package/dist/components/Progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/Progress/ProgressBar.jsx +2 -3
- package/dist/components/Progress/ProgressRoot.d.ts +1 -1
- package/dist/components/Progress/ProgressRoot.d.ts.map +1 -1
- package/dist/components/Progress/ProgressRoot.jsx +2 -3
- package/dist/components/Rating/Rating.d.ts +1 -1
- package/dist/components/Rating/RatingItems.d.ts +3 -3
- package/dist/components/Rating/RatingItems.d.ts.map +1 -1
- package/dist/components/Rating/RatingItems.jsx +3 -7
- package/dist/components/Rating/RatingRoot.d.ts +1 -1
- package/dist/components/Rating/RatingRoot.d.ts.map +1 -1
- package/dist/components/Rating/RatingRoot.jsx +2 -3
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/SheetBody.d.ts +1 -1
- package/dist/components/Sheet/SheetBody.d.ts.map +1 -1
- package/dist/components/Sheet/SheetBody.jsx +5 -6
- package/dist/components/Sheet/SheetContent.d.ts +1 -1
- package/dist/components/Sheet/SheetContent.d.ts.map +1 -1
- package/dist/components/Sheet/SheetContent.jsx +2 -3
- package/dist/components/Sheet/SheetContext.d.ts +1 -2
- package/dist/components/Sheet/SheetContext.d.ts.map +1 -1
- package/dist/components/Sheet/SheetHeader.d.ts +1 -1
- package/dist/components/Sheet/SheetHeader.d.ts.map +1 -1
- package/dist/components/Sheet/SheetHeader.jsx +5 -5
- package/dist/components/Sheet/SheetPortal.d.ts +1 -1
- package/dist/components/Sheet/SheetPortal.d.ts.map +1 -1
- package/dist/components/Sheet/SheetPortal.jsx +2 -3
- package/dist/components/Sheet/SheetRoot.d.ts.map +1 -1
- package/dist/components/Sheet/SheetRoot.jsx +6 -7
- package/dist/components/ShowMore/ShowMoreContent.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreContent.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreContent.jsx +6 -4
- package/dist/components/ShowMore/ShowMoreFade.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreFade.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreFade.jsx +2 -3
- package/dist/components/ShowMore/ShowMoreRoot.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreRoot.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreRoot.jsx +2 -3
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreTrigger.jsx +5 -3
- package/dist/components/Slide/Slide.d.ts +2 -2
- package/dist/components/Slide/Slide.d.ts.map +1 -1
- package/dist/components/Slide/Slide.js +2 -2
- package/dist/components/Slide/SlideBody.d.ts +4 -0
- package/dist/components/Slide/SlideBody.d.ts.map +1 -0
- package/dist/components/Slide/SlideBody.jsx +3 -0
- package/dist/components/Slide/SlideHeader.d.ts +1 -1
- package/dist/components/Slide/SlideHeader.d.ts.map +1 -1
- package/dist/components/Slide/SlideHeader.jsx +2 -3
- package/dist/components/Slide/SlidePortal.d.ts.map +1 -1
- package/dist/components/Slide/SlidePortal.jsx +2 -2
- package/dist/components/Slide/SlideRoot.d.ts +4 -2
- package/dist/components/Slide/SlideRoot.d.ts.map +1 -1
- package/dist/components/Slide/SlideRoot.jsx +12 -7
- package/dist/components/Spoiler/Spoiler.d.ts +4 -4
- package/dist/components/Spoiler/Spoiler.d.ts.map +1 -1
- package/dist/components/Spoiler/Spoiler.js +5 -0
- package/dist/components/Spoiler/SpoilerBlur.d.ts +4 -0
- package/dist/components/Spoiler/SpoilerBlur.d.ts.map +1 -0
- package/dist/components/Spoiler/SpoilerBlur.jsx +8 -0
- package/dist/components/Spoiler/SpoilerContext.d.ts +7 -0
- package/dist/components/Spoiler/SpoilerContext.d.ts.map +1 -0
- package/dist/components/Spoiler/SpoilerContext.js +2 -0
- package/dist/components/Spoiler/SpoilerRoot.d.ts +4 -0
- package/dist/components/Spoiler/SpoilerRoot.d.ts.map +1 -0
- package/dist/components/Spoiler/SpoilerRoot.jsx +10 -0
- package/dist/components/Steps/Steps.d.ts +6 -3
- package/dist/components/Steps/Steps.d.ts.map +1 -1
- package/dist/components/Steps/Steps.js +4 -2
- package/dist/components/Steps/StepsContext.d.ts.map +1 -1
- package/dist/components/Steps/StepsContext.js +2 -0
- package/dist/components/Steps/StepsControls.jsx +1 -1
- package/dist/components/Steps/StepsIndexBtn.d.ts +6 -0
- package/dist/components/Steps/StepsIndexBtn.d.ts.map +1 -0
- package/dist/components/Steps/StepsIndexBtn.jsx +10 -0
- package/dist/components/Steps/StepsNextBtn.d.ts +1 -1
- package/dist/components/Steps/StepsNextBtn.d.ts.map +1 -1
- package/dist/components/Steps/StepsNextBtn.jsx +2 -5
- package/dist/components/Steps/StepsPrevBtn.d.ts +1 -1
- package/dist/components/Steps/StepsPrevBtn.d.ts.map +1 -1
- package/dist/components/Steps/StepsPrevBtn.jsx +2 -5
- package/dist/components/Steps/StepsRender.d.ts +2 -0
- package/dist/components/Steps/StepsRender.d.ts.map +1 -0
- package/dist/components/Steps/StepsRender.jsx +7 -0
- package/dist/components/Tabs/TabsList.d.ts +1 -1
- package/dist/components/Tabs/TabsList.d.ts.map +1 -1
- package/dist/components/Tabs/TabsList.jsx +2 -3
- package/dist/components/Tabs/TabsPanel.d.ts +1 -1
- package/dist/components/Tabs/TabsPanel.d.ts.map +1 -1
- package/dist/components/Tabs/TabsPanel.jsx +2 -3
- package/dist/components/Toast/ToastBox.jsx +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -9
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +3 -0
- package/package.json +3 -2
- package/dist/components/LinkLoader/LinkLoader.d.ts +0 -6
- package/dist/components/LinkLoader/LinkLoader.d.ts.map +0 -1
- package/dist/components/LinkLoader/LinkLoader.jsx +0 -8
- package/dist/components/Slide/SlideContent.d.ts +0 -4
- package/dist/components/Slide/SlideContent.d.ts.map +0 -1
- package/dist/components/Slide/SlideContent.jsx +0 -4
- package/dist/components/Spoiler/Spoiler.jsx +0 -11
- /package/dist/components/Sheet/{Sheet.jsx → Sheet.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModalBody } from "./ModalBody";
|
|
2
1
|
import { ModalRoot } from "./ModalRoot";
|
|
2
|
+
import { ModalBody } from "./ModalBody";
|
|
3
3
|
import { ModalHeader } from "./ModalHeader";
|
|
4
4
|
import { ModalPortal } from "./ModalPortal";
|
|
5
5
|
import { ModalToggle } from "./ModalTrigger";
|
|
@@ -7,7 +7,7 @@ import { ModalContent } from "./ModalContent";
|
|
|
7
7
|
export const Modal = Object.assign(ModalRoot, {
|
|
8
8
|
Toggle: ModalToggle,
|
|
9
9
|
Portal: ModalPortal,
|
|
10
|
-
|
|
10
|
+
Body: ModalBody,
|
|
11
11
|
Header: ModalHeader,
|
|
12
|
-
|
|
12
|
+
Content: ModalContent
|
|
13
13
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ModalBodyPropsT =
|
|
3
|
-
export declare function ModalBody({
|
|
1
|
+
import { HTMLMotionProps } from "framer-motion";
|
|
2
|
+
export type ModalBodyPropsT = HTMLMotionProps<"div">;
|
|
3
|
+
export declare function ModalBody({ onClick, ...props }: ModalBodyPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAIzE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BA6B/D"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { use, useEffect, useRef } from "react";
|
|
3
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
+
import { ModalContext } from "./ModalContext";
|
|
5
|
+
export function ModalBody({ onClick, ...props }) {
|
|
6
|
+
const { isOpen } = use(ModalContext);
|
|
7
|
+
const contentRef = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (isOpen) {
|
|
10
|
+
const indexElement = contentRef.current?.querySelector("[data-modal='index']");
|
|
11
|
+
indexElement?.focus();
|
|
12
|
+
}
|
|
13
|
+
;
|
|
14
|
+
}, [isOpen]);
|
|
15
|
+
return (<AnimatePresence>
|
|
16
|
+
{isOpen ? (<motion.div ref={contentRef} initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.9 }} transition={{ ease: "easeInOut" }} onClick={ev => {
|
|
17
|
+
onClick?.(ev);
|
|
18
|
+
ev.stopPropagation();
|
|
19
|
+
}} {...props}/>) : null}
|
|
20
|
+
</AnimatePresence>);
|
|
6
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ModalContentPropsT =
|
|
3
|
-
export declare function ModalContent(
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export type ModalContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
export declare function ModalContent(p: ModalContentPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,+BAIjD"}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { use, useEffect, useRef } from "react";
|
|
4
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
-
import { ModalContext } from "./ModalContext";
|
|
6
|
-
export function ModalContent({ onClick, className, ...props }) {
|
|
7
|
-
const { isOpen } = use(ModalContext);
|
|
8
|
-
const contentRef = useRef(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (isOpen) {
|
|
11
|
-
const indexElement = contentRef.current?.querySelector("[data-modal='index']");
|
|
12
|
-
indexElement?.focus();
|
|
13
|
-
}
|
|
14
|
-
;
|
|
15
|
-
}, [isOpen]);
|
|
16
|
-
return (<AnimatePresence>
|
|
17
|
-
{isOpen ? (<motion.div ref={contentRef} initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.9 }} transition={{ ease: "easeInOut" }} onClick={ev => {
|
|
18
|
-
onClick?.(ev);
|
|
19
|
-
ev.stopPropagation();
|
|
20
|
-
}} className={cn("bg-background rounded-2xl w-max max-w-[90%] h-full max-h-[90%]", className)} {...props}/>) : null}
|
|
21
|
-
</AnimatePresence>);
|
|
1
|
+
export function ModalContent(p) {
|
|
2
|
+
return (<div {...p}/>);
|
|
22
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
2
|
export type ModalHeaderPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ModalHeader(
|
|
3
|
+
export declare function ModalHeader(p: ModalHeaderPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,+BAI/C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (<div className={cn("h-16 f-align px-3 bg-background rounded-t-2xl border-b border-separator sticky top-0", className)} {...props}/>);
|
|
1
|
+
export function ModalHeader(p) {
|
|
2
|
+
return (<div {...p}/>);
|
|
4
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type ModalPortalPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function ModalPortal({ onClick,
|
|
3
|
+
export declare function ModalPortal({ onClick, ...p }: ModalPortalPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalPortal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalPortal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalPortal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,eAAe,EAAE,MAAM,eAAe,CAAC;AAMzE,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,+BAuB/D"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { cn } from "../../utils/cn";
|
|
4
3
|
import { motion, AnimatePresence } from "framer-motion";
|
|
5
4
|
import { Portal } from "../Portal/Portal";
|
|
6
5
|
import { ModalContext } from "./ModalContext";
|
|
7
6
|
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
8
|
-
export function ModalPortal({ onClick,
|
|
7
|
+
export function ModalPortal({ onClick, ...p }) {
|
|
9
8
|
const { isOpen, setOpen } = use(ModalContext);
|
|
10
9
|
return (<ClientOnly>
|
|
11
10
|
<Portal>
|
|
@@ -13,7 +12,7 @@ export function ModalPortal({ onClick, className, ...props }) {
|
|
|
13
12
|
{isOpen ? (<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} onClick={ev => {
|
|
14
13
|
onClick?.(ev);
|
|
15
14
|
setOpen(false);
|
|
16
|
-
}}
|
|
15
|
+
}} {...p}/>) : null}
|
|
17
16
|
</AnimatePresence>
|
|
18
17
|
</Portal>
|
|
19
18
|
</ClientOnly>);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import { getBrowserScrollbarWith } from "../../utils
|
|
3
|
+
import { getBrowserScrollbarWith } from "../../utils";
|
|
4
4
|
import { ModalContext } from "./ModalContext";
|
|
5
5
|
export function ModalRoot({ children, defaultOpen = false }) {
|
|
6
6
|
const [isOpen, setOpen] = useState(defaultOpen);
|
|
@@ -3,5 +3,5 @@ export type OtpInputsPropsT = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
3
3
|
length: number;
|
|
4
4
|
onLastChange?: (otp: string) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare function OtpInputs({
|
|
6
|
+
export declare function OtpInputs({ name, length, onLastChange, ...props }: OtpInputsPropsT): import("react").JSX.Element[];
|
|
7
7
|
//# sourceMappingURL=OtpInputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpInputs.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpInputs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OtpInputs.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpInputs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,mBAAmB,EAAsB,MAAM,OAAO,CAAC;AAIhF,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,iCAwElF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
2
|
import { use } from "react";
|
|
4
3
|
import { OtpContext } from "./OtpContext";
|
|
5
|
-
export function OtpInputs({
|
|
4
|
+
export function OtpInputs({ name, length, onLastChange, ...props }) {
|
|
6
5
|
const { inputs, getInputsValue } = use(OtpContext);
|
|
7
6
|
const handlePaste = (ev, startIndex) => {
|
|
8
7
|
ev.preventDefault();
|
|
@@ -47,7 +46,7 @@ export function OtpInputs({ className, name, length, onLastChange, ...props }) {
|
|
|
47
46
|
inputs?.current[index - 1]?.focus();
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
|
-
return Array.from({ length }).map((_, index) => (<input key={index} autoComplete="off" name={`${name || "otp"}-${index}`} onPaste={ev => handlePaste(ev, index)} onKeyDown={ev => handleBackspace(ev, index)} onChange={ev => handleInputChange(ev.target.value, index)}
|
|
49
|
+
return Array.from({ length }).map((_, index) => (<input key={index} autoComplete="off" name={`${name || "otp"}-${index}`} onPaste={ev => handlePaste(ev, index)} onKeyDown={ev => handleBackspace(ev, index)} onChange={ev => handleInputChange(ev.target.value, index)} ref={el => {
|
|
51
50
|
if (inputs) {
|
|
52
51
|
inputs.current[index] = el;
|
|
53
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type OtpRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function OtpRoot(
|
|
3
|
+
export declare function OtpRoot(p: OtpRootPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=OtpRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OtpRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAI1D,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE3D,wBAAgB,OAAO,CAAC,CAAC,EAAE,aAAa,+BAgBvC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
2
|
import { useEffect, useRef } from "react";
|
|
4
3
|
import { OtpContext } from "./OtpContext";
|
|
5
|
-
export function OtpRoot(
|
|
4
|
+
export function OtpRoot(p) {
|
|
6
5
|
const inputs = useRef([]);
|
|
7
6
|
useEffect(() => {
|
|
8
7
|
inputs.current[0]?.focus();
|
|
@@ -11,6 +10,6 @@ export function OtpRoot({ className, ...props }) {
|
|
|
11
10
|
return inputs?.current.map(input => input?.value || "").join("") || "";
|
|
12
11
|
};
|
|
13
12
|
return (<OtpContext value={{ inputs, getInputsValue }}>
|
|
14
|
-
<div
|
|
13
|
+
<div {...p}/>
|
|
15
14
|
</OtpContext>);
|
|
16
15
|
}
|
|
@@ -2,5 +2,5 @@ import { HTMLAttributes } from "react";
|
|
|
2
2
|
export type PaginationNextBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function PaginationNextBtn({ onClick, disabled,
|
|
5
|
+
export declare function PaginationNextBtn({ onClick, disabled, ...p }: PaginationNextBtnPropsT): import("react").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=PaginationNextBtn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationNextBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationNextBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PaginationNextBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationNextBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB,+BAarF"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { ChevronRightIcon } from "lucide-react";
|
|
4
3
|
import { PaginationContext } from "./PaginationContext";
|
|
5
|
-
export function PaginationNextBtn({ onClick, disabled,
|
|
4
|
+
export function PaginationNextBtn({ onClick, disabled, ...p }) {
|
|
6
5
|
const { page, pageLength, nextPage } = use(PaginationContext);
|
|
7
6
|
return (<button disabled={disabled || page === pageLength} onClick={ev => {
|
|
8
7
|
onClick?.(ev);
|
|
9
8
|
nextPage();
|
|
10
|
-
}} {...
|
|
11
|
-
{children || <ChevronRightIcon className="compatible-icon"/>}
|
|
12
|
-
</button>);
|
|
9
|
+
}} {...p}/>);
|
|
13
10
|
}
|
|
@@ -2,5 +2,5 @@ import { HTMLAttributes } from "react";
|
|
|
2
2
|
export type PaginationPrevBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function PaginationPrevBtn({ onClick, disabled,
|
|
5
|
+
export declare function PaginationPrevBtn({ onClick, disabled, ...p }: PaginationPrevBtnPropsT): import("react").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=PaginationPrevBtn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationPrevBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationPrevBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PaginationPrevBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationPrevBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB,+BAarF"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { ChevronLeftIcon } from "lucide-react";
|
|
4
3
|
import { PaginationContext } from "./PaginationContext";
|
|
5
|
-
export function PaginationPrevBtn({ onClick, disabled,
|
|
4
|
+
export function PaginationPrevBtn({ onClick, disabled, ...p }) {
|
|
6
5
|
const { page, prevPage } = use(PaginationContext);
|
|
7
6
|
return (<button disabled={disabled || page === 1} onClick={ev => {
|
|
8
7
|
onClick?.(ev);
|
|
9
8
|
prevPage();
|
|
10
|
-
}} {...
|
|
11
|
-
{children || <ChevronLeftIcon className="compatible-icon"/>}
|
|
12
|
-
</button>);
|
|
9
|
+
}} {...p}/>);
|
|
13
10
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from "react";
|
|
2
|
-
export type PasswordInputTogglePropsT = ButtonHTMLAttributes<HTMLButtonElement
|
|
3
|
-
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type PasswordInputTogglePropsT = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
visibleChildren: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function PasswordInputToggle({ visibleChildren, onClick, children, ...props }: PasswordInputTogglePropsT): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=PasswordInputToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInputToggle.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordInput/PasswordInputToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PasswordInputToggle.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordInput/PasswordInputToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAI7D,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAChF,eAAe,EAAE,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,yBAAyB,+BAe9G"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { EyeClosedIcon, EyeIcon } from "lucide-react";
|
|
4
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
5
3
|
import { PasswordInputContext } from "./PasswordInputContext";
|
|
6
|
-
export function PasswordInputToggle({ onClick, children, ...props }) {
|
|
4
|
+
export function PasswordInputToggle({ visibleChildren, onClick, children, ...props }) {
|
|
7
5
|
const { isVisible, setIsVisible } = use(PasswordInputContext);
|
|
8
6
|
return (<button type="button" onClick={ev => {
|
|
9
7
|
setIsVisible(prev => !prev);
|
|
10
8
|
onClick?.(ev);
|
|
11
9
|
}} {...props}>
|
|
12
|
-
{
|
|
13
|
-
{isVisible ? (<motion.div key="visible" className="compatible-icon" initial={{ opacity: 0, y: "-25%" }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: "25%" }} transition={{ duration: 0.1 }}>
|
|
14
|
-
<EyeIcon className="size-full"/>
|
|
15
|
-
</motion.div>) : (<motion.div key="hidden" className="compatible-icon" initial={{ opacity: 0, y: "-25%" }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: "25%" }} transition={{ duration: 0.1 }}>
|
|
16
|
-
<EyeClosedIcon className="size-full"/>
|
|
17
|
-
</motion.div>)}
|
|
18
|
-
</AnimatePresence>)}
|
|
10
|
+
{isVisible ? visibleChildren : children}
|
|
19
11
|
</button>);
|
|
20
12
|
}
|
|
@@ -2,5 +2,5 @@ import { HTMLMotionProps } from "framer-motion";
|
|
|
2
2
|
export type ProgressBarPropsT = HTMLMotionProps<"div"> & {
|
|
3
3
|
duration?: number;
|
|
4
4
|
};
|
|
5
|
-
export declare function ProgressBar({
|
|
5
|
+
export declare function ProgressBar({ duration, children, ...p }: ProgressBarPropsT): import("react").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/ProgressBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/ProgressBar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAU,MAAM,eAAe,CAAC;AAIxD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,+BAe1E"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { cn } from "../../utils/cn";
|
|
4
3
|
import { motion } from "framer-motion";
|
|
5
4
|
import { ProgressContext } from "./ProgressContext";
|
|
6
|
-
export function ProgressBar({
|
|
5
|
+
export function ProgressBar({ duration, children, ...p }) {
|
|
7
6
|
const { value, maxValue } = use(ProgressContext);
|
|
8
7
|
const percentage = Math.min(100, Math.max(0, (value / maxValue) * 100));
|
|
9
|
-
return (<motion.div
|
|
8
|
+
return (<motion.div initial={{ width: 0 }} whileInView={{ width: `${percentage}%` }} transition={{ duration: duration || 3 }} {...p}>
|
|
10
9
|
{children || <span className="text-xs">{percentage}%</span>}
|
|
11
10
|
</motion.div>);
|
|
12
11
|
}
|
|
@@ -3,5 +3,5 @@ export type ProgressRootPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
|
3
3
|
value: number;
|
|
4
4
|
maxValue?: number;
|
|
5
5
|
};
|
|
6
|
-
export declare function ProgressRoot({ value, maxValue,
|
|
6
|
+
export declare function ProgressRoot({ value, maxValue, ...p }: ProgressRootPropsT): import("react").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=ProgressRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/ProgressRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProgressRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/ProgressRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAc,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,+BAM/E"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
2
|
import { ProgressContext } from "./ProgressContext";
|
|
4
|
-
export function ProgressRoot({ value, maxValue = 100,
|
|
3
|
+
export function ProgressRoot({ value, maxValue = 100, ...p }) {
|
|
5
4
|
return (<ProgressContext value={{ value, maxValue }}>
|
|
6
|
-
<div
|
|
5
|
+
<div {...p}/>
|
|
7
6
|
</ProgressContext>);
|
|
8
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RatingItems } from "./RatingItems";
|
|
2
|
-
export declare const Rating: ((
|
|
2
|
+
export declare const Rating: ((p: import("./RatingRoot").RatingRootPropsT) => import("react").JSX.Element) & {
|
|
3
3
|
Items: typeof RatingItems;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=Rating.d.ts.map
|
|
@@ -3,8 +3,8 @@ export type RatingItemsPropsT = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
3
3
|
count: number;
|
|
4
4
|
value: number;
|
|
5
5
|
onValueChange: (newValue: number) => void;
|
|
6
|
-
element
|
|
7
|
-
activeElement
|
|
6
|
+
element: ReactNode;
|
|
7
|
+
activeElement: ReactNode;
|
|
8
8
|
};
|
|
9
|
-
export declare function RatingItems({ count, value, onValueChange, element, activeElement,
|
|
9
|
+
export declare function RatingItems({ count, value, onValueChange, element, activeElement, ...p }: RatingItemsPropsT): import("react").JSX.Element[];
|
|
10
10
|
//# sourceMappingURL=RatingItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingItems.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/RatingItems.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RatingItems.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/RatingItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAI7D,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,EAAE,SAAS,CAAC;CAC1B,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,iCA0B3G"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
|
-
import { StarIcon } from "lucide-react";
|
|
4
2
|
import { use } from "react";
|
|
5
3
|
import { RatingContext } from "./RatingContext";
|
|
6
|
-
export function RatingItems({ count, value, onValueChange, element, activeElement,
|
|
4
|
+
export function RatingItems({ count, value, onValueChange, element, activeElement, ...p }) {
|
|
7
5
|
const { hoverValue, setHoverValue } = use(RatingContext);
|
|
8
|
-
const defaultElement = element || <StarIcon className="icon-size-3 text-palette"/>;
|
|
9
|
-
const defaultActiveElement = activeElement || <StarIcon className="icon-size-3 text-palette fill-palette"/>;
|
|
10
6
|
const displayValue = hoverValue !== null ? hoverValue : value;
|
|
11
7
|
return (Array.from({ length: count }).map((_, index) => {
|
|
12
8
|
const itemValue = index + 1;
|
|
13
9
|
const isActive = itemValue <= displayValue;
|
|
14
|
-
return (<button key={index} role="radio" type="button"
|
|
15
|
-
{isActive ?
|
|
10
|
+
return (<button key={index} role="radio" type="button" aria-checked={itemValue === value} onClick={() => onValueChange(itemValue)} onMouseEnter={() => setHoverValue(itemValue)} aria-label={`${itemValue} out of ${count} stars`} {...p}>
|
|
11
|
+
{isActive ? activeElement : element}
|
|
16
12
|
</button>);
|
|
17
13
|
}));
|
|
18
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type RatingRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare const RatingRoot: (
|
|
3
|
+
export declare const RatingRoot: (p: RatingRootPropsT) => import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=RatingRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/RatingRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RatingRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/RatingRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAA;AAE7D,eAAO,MAAM,UAAU,GAAI,GAAG,gBAAgB,gCAW7C,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { RatingContext } from "./RatingContext";
|
|
5
|
-
export const RatingRoot = (
|
|
4
|
+
export const RatingRoot = (p) => {
|
|
6
5
|
const [hoverValue, setHoverValue] = useState(null);
|
|
7
6
|
return (<RatingContext value={{ hoverValue, setHoverValue }}>
|
|
8
|
-
<div
|
|
7
|
+
<div onMouseLeave={() => setHoverValue(null)} {...p}/>
|
|
9
8
|
</RatingContext>);
|
|
10
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,KAAK;;;;;;CAMhB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type SheetBodyPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function SheetBody(
|
|
3
|
+
export declare function SheetBody(p: SheetBodyPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAU,MAAM,eAAe,CAAC;AAIxD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,wBAAgB,SAAS,CAAC,CAAC,EAAE,eAAe,+BAiC3C"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { use } from "react";
|
|
3
|
-
import { cn } from "../../utils/cn";
|
|
4
3
|
import { motion } from "framer-motion";
|
|
5
4
|
import { SheetContext } from "./SheetContext";
|
|
6
|
-
export function SheetBody(
|
|
7
|
-
const {
|
|
8
|
-
return (<motion.div id="
|
|
5
|
+
export function SheetBody(p) {
|
|
6
|
+
const { controls, y, closeHandler: handleClose } = use(SheetContext);
|
|
7
|
+
return (<motion.div id="sheet" onClick={(ev) => ev.stopPropagation()} initial={{ y: "100%" }} animate={{ y: "0%" }} exit={{ y: "100%" }} style={{ y }} drag="y" dragControls={controls} dragListener={false} transition={{
|
|
9
8
|
ease: "easeInOut",
|
|
10
|
-
}}
|
|
9
|
+
}} onDragEnd={() => {
|
|
11
10
|
if ((y?.get() || 0) >= 100) {
|
|
12
11
|
handleClose();
|
|
13
12
|
}
|
|
@@ -17,5 +16,5 @@ export function SheetBody({ className, ...props }) {
|
|
|
17
16
|
}} dragElastic={{
|
|
18
17
|
top: 0,
|
|
19
18
|
bottom: 0.5,
|
|
20
|
-
}} {...
|
|
19
|
+
}} {...p}/>);
|
|
21
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SheetContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function SheetContent(
|
|
3
|
+
export declare function SheetContent(p: SheetContentPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContent.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SheetContent.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,+BAEjD"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
1
2
|
import { AnimationScope, DragControls, MotionValue } from "framer-motion";
|
|
2
|
-
import { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
3
|
export type SheetContextT = {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
6
|
closeHandler: () => void;
|
|
7
|
-
drawerRef?: RefObject<HTMLDivElement>;
|
|
8
7
|
scope?: AnimationScope<any>;
|
|
9
8
|
controls?: DragControls;
|
|
10
9
|
y?: MotionValue<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetContext.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzB,CAAA;AAED,eAAO,MAAM,YAAY,wCAAoD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SheetHeaderPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function SheetHeader({
|
|
3
|
+
export declare function SheetHeader({ onPointerDown, ...p }: SheetHeaderPropsT): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SheetHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,+BAYrE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn";
|
|
3
2
|
import { use } from "react";
|
|
4
3
|
import { SheetContext } from "./SheetContext";
|
|
5
|
-
export function SheetHeader({
|
|
4
|
+
export function SheetHeader({ onPointerDown, ...p }) {
|
|
6
5
|
const { controls } = use(SheetContext);
|
|
7
|
-
return (<div
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
return (<div onPointerDown={(ev) => {
|
|
7
|
+
controls?.start(ev);
|
|
8
|
+
onPointerDown?.(ev);
|
|
9
|
+
}} {...p}/>);
|
|
10
10
|
}
|