@kadoui/react 1.2.5 → 1.3.6
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.d.ts +1 -1
- package/dist/components/AccessNavigation/AccessNavigation.d.ts.map +1 -1
- package/dist/components/AccessNavigation/AccessNavigation.js +27 -0
- package/dist/components/Accordion/AccordionBody.d.ts +1 -1
- package/dist/components/Accordion/AccordionBody.d.ts.map +1 -1
- package/dist/components/Accordion/AccordionBody.js +11 -0
- package/dist/components/Accordion/AccordionRoot.d.ts +1 -1
- package/dist/components/Accordion/AccordionRoot.d.ts.map +1 -1
- package/dist/components/Accordion/AccordionRoot.js +8 -0
- package/dist/components/Accordion/AccordionToggle.d.ts +1 -1
- package/dist/components/Accordion/AccordionToggle.d.ts.map +1 -1
- package/dist/components/Accordion/AccordionToggle.js +12 -0
- package/dist/components/Affix/Affix.d.ts +1 -1
- package/dist/components/Affix/Affix.d.ts.map +1 -1
- package/dist/components/Affix/Affix.js +36 -0
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +8 -0
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.js +6 -0
- package/dist/components/Carousel/CarouselContainer.d.ts +1 -1
- package/dist/components/Carousel/CarouselContainer.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselContainer.js +8 -0
- package/dist/components/Carousel/CarouselLeftFade.d.ts +1 -1
- package/dist/components/Carousel/CarouselLeftFade.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselLeftFade.js +11 -0
- package/dist/components/Carousel/CarouselRightFade.d.ts +1 -1
- package/dist/components/Carousel/CarouselRightFade.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselRightFade.js +11 -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.js +39 -0
- package/dist/components/ClientOnly/ClientOnly.js +6 -0
- package/dist/components/Clipboard/Clipboard.d.ts +1 -1
- package/dist/components/Clipboard/Clipboard.d.ts.map +1 -1
- package/dist/components/Clipboard/Clipboard.js +11 -0
- package/dist/components/ContextMenu/ContextMenuContent.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenuContent.js +30 -0
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenuRoot.js +55 -0
- package/dist/components/Drawer/DrawerBody.d.ts +1 -1
- package/dist/components/Drawer/DrawerBody.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerBody.js +37 -0
- package/dist/components/Drawer/DrawerPortal.d.ts +1 -1
- package/dist/components/Drawer/DrawerPortal.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerPortal.js +14 -0
- package/dist/components/Drawer/DrawerRoot.d.ts +1 -1
- package/dist/components/Drawer/DrawerRoot.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerRoot.js +34 -0
- package/dist/components/Drawer/DrawerToggle.d.ts +1 -1
- package/dist/components/Drawer/DrawerToggle.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerToggle.js +11 -0
- package/dist/components/LoaderLink/LoaderLink.js +6 -0
- package/dist/components/Modal/ModalBody.d.ts +1 -1
- package/dist/components/Modal/ModalBody.d.ts.map +1 -1
- package/dist/components/Modal/ModalBody.js +20 -0
- package/dist/components/Modal/ModalContent.d.ts +1 -1
- package/dist/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/components/Modal/ModalContent.js +4 -0
- package/dist/components/Modal/ModalHeader.d.ts +1 -1
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/ModalHeader.js +4 -0
- package/dist/components/Modal/ModalPortal.d.ts +1 -1
- package/dist/components/Modal/ModalPortal.d.ts.map +1 -1
- package/dist/components/Modal/ModalPortal.js +14 -0
- package/dist/components/Modal/ModalRoot.d.ts +1 -1
- package/dist/components/Modal/ModalRoot.d.ts.map +1 -1
- package/dist/components/Modal/ModalRoot.js +34 -0
- package/dist/components/Modal/ModalTrigger.d.ts +1 -1
- package/dist/components/Modal/ModalTrigger.d.ts.map +1 -1
- package/dist/components/Modal/ModalTrigger.js +11 -0
- package/dist/components/Otp/OtpHiddenInput.d.ts +1 -1
- package/dist/components/Otp/OtpHiddenInput.d.ts.map +1 -1
- package/dist/components/Otp/OtpHiddenInput.js +8 -0
- package/dist/components/Otp/OtpInputs.d.ts +1 -1
- package/dist/components/Otp/OtpInputs.d.ts.map +1 -1
- package/dist/components/Otp/OtpInputs.js +55 -0
- package/dist/components/Otp/OtpRoot.d.ts +1 -1
- package/dist/components/Otp/OtpRoot.d.ts.map +1 -1
- package/dist/components/Otp/OtpRoot.js +14 -0
- package/dist/components/Pagination/PaginationContext.js +2 -0
- package/dist/components/Pagination/PaginationCounts.d.ts +1 -1
- package/dist/components/Pagination/PaginationCounts.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationCounts.js +8 -0
- package/dist/components/Pagination/PaginationNextBtn.d.ts +1 -1
- package/dist/components/Pagination/PaginationNextBtn.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationNextBtn.js +11 -0
- package/dist/components/Pagination/PaginationPrevBtn.d.ts +1 -1
- package/dist/components/Pagination/PaginationPrevBtn.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationPrevBtn.js +11 -0
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts +1 -1
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationSearchParamsRoot.js +29 -0
- package/dist/components/Pagination/PaginationStateRoot.d.ts +1 -1
- package/dist/components/Pagination/PaginationStateRoot.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationStateRoot.js +10 -0
- package/dist/components/PasswordInput/PasswordInputContext.js +2 -0
- package/dist/components/PasswordInput/PasswordInputField.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInputField.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInputField.js +8 -0
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInputRoot.js +8 -0
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInputToggle.js +11 -0
- package/dist/components/Popover/PopoverBody.d.ts +1 -1
- package/dist/components/Popover/PopoverBody.d.ts.map +1 -1
- package/dist/components/Popover/PopoverBody.js +13 -0
- package/dist/components/Popover/PopoverRoot.d.ts +1 -1
- package/dist/components/Popover/PopoverRoot.d.ts.map +1 -1
- package/dist/components/Popover/PopoverRoot.js +74 -0
- package/dist/components/Popover/PopoverToggle.d.ts +1 -1
- package/dist/components/Popover/PopoverToggle.d.ts.map +1 -1
- package/dist/components/Popover/PopoverToggle.js +14 -0
- package/dist/components/Portal/Portal.js +6 -0
- package/dist/components/Progress/ProgressBar.d.ts +1 -1
- package/dist/components/Progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/Progress/ProgressBar.js +10 -0
- package/dist/components/Progress/ProgressRoot.d.ts +1 -1
- package/dist/components/Progress/ProgressRoot.d.ts.map +1 -1
- package/dist/components/Progress/ProgressRoot.js +6 -0
- package/dist/components/QrCode/QrCode.d.ts +2 -2
- package/dist/components/QrCode/QrCode.d.ts.map +1 -1
- package/dist/components/QrCode/QrCode.js +15 -0
- package/dist/components/Rating/Rating.d.ts +1 -1
- package/dist/components/Rating/RatingItems.d.ts +1 -1
- package/dist/components/Rating/RatingItems.d.ts.map +1 -1
- package/dist/components/Rating/RatingItems.js +13 -0
- package/dist/components/Rating/RatingRoot.d.ts +1 -1
- package/dist/components/Rating/RatingRoot.d.ts.map +1 -1
- package/dist/components/Rating/RatingRoot.js +8 -0
- package/dist/components/Sheet/SheetBody.d.ts +1 -1
- package/dist/components/Sheet/SheetBody.d.ts.map +1 -1
- package/dist/components/Sheet/SheetBody.js +21 -0
- package/dist/components/Sheet/SheetContent.d.ts +1 -1
- package/dist/components/Sheet/SheetContent.d.ts.map +1 -1
- package/dist/components/Sheet/SheetContent.js +4 -0
- package/dist/components/Sheet/SheetHeader.d.ts +1 -1
- package/dist/components/Sheet/SheetHeader.d.ts.map +1 -1
- package/dist/components/Sheet/SheetHeader.js +11 -0
- package/dist/components/Sheet/SheetPortal.d.ts +1 -1
- package/dist/components/Sheet/SheetPortal.d.ts.map +1 -1
- package/dist/components/Sheet/SheetPortal.js +11 -0
- package/dist/components/Sheet/SheetRoot.d.ts +1 -1
- package/dist/components/Sheet/SheetRoot.d.ts.map +1 -1
- package/dist/components/Sheet/SheetRoot.js +35 -0
- package/dist/components/Sheet/SheetToggle.d.ts +1 -1
- package/dist/components/Sheet/SheetToggle.d.ts.map +1 -1
- package/dist/components/Sheet/SheetToggle.js +11 -0
- package/dist/components/ShowMore/ShowMoreContent.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreContent.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreContent.js +19 -0
- package/dist/components/ShowMore/ShowMoreFade.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreFade.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreFade.js +8 -0
- package/dist/components/ShowMore/ShowMoreRoot.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreRoot.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreRoot.js +21 -0
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts +1 -1
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMoreTrigger.js +14 -0
- package/dist/components/Spoiler/SpoilerBlur.d.ts +1 -1
- package/dist/components/Spoiler/SpoilerBlur.d.ts.map +1 -1
- package/dist/components/Spoiler/SpoilerBlur.js +9 -0
- package/dist/components/Spoiler/SpoilerRoot.d.ts +1 -1
- package/dist/components/Spoiler/SpoilerRoot.d.ts.map +1 -1
- package/dist/components/Spoiler/SpoilerRoot.js +9 -0
- package/dist/components/Steps/StepsIndexBtn.d.ts +1 -1
- package/dist/components/Steps/StepsIndexBtn.d.ts.map +1 -1
- package/dist/components/Steps/StepsIndexBtn.js +11 -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.js +11 -0
- package/dist/components/Steps/StepsPrevBtn.d.ts +1 -1
- package/dist/components/Steps/StepsPrevBtn.d.ts.map +1 -1
- package/dist/components/Steps/StepsPrevBtn.js +11 -0
- package/dist/components/Steps/StepsRender.js +7 -0
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts +1 -1
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts.map +1 -1
- package/dist/components/Steps/StepsSearchParamsRoot.js +29 -0
- package/dist/components/Steps/StepsStateRoot.d.ts +1 -1
- package/dist/components/Steps/StepsStateRoot.d.ts.map +1 -1
- package/dist/components/Steps/StepsStateRoot.js +10 -0
- package/dist/components/Swap/SwapItem.d.ts +1 -1
- package/dist/components/Swap/SwapItem.d.ts.map +1 -1
- package/dist/components/Swap/SwapItem.js +6 -0
- package/dist/components/Swap/SwapRoot.d.ts +1 -1
- package/dist/components/Swap/SwapRoot.d.ts.map +1 -1
- package/dist/components/Swap/SwapRoot.js +13 -0
- package/dist/components/Swap/SwapTrigger.d.ts +1 -1
- package/dist/components/Swap/SwapTrigger.d.ts.map +1 -1
- package/dist/components/Swap/SwapTrigger.js +17 -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.js +5 -0
- package/dist/components/Tabs/TabsPanel.d.ts +1 -1
- package/dist/components/Tabs/TabsPanel.d.ts.map +1 -1
- package/dist/components/Tabs/TabsPanel.js +9 -0
- package/dist/components/Tabs/TabsRoot.d.ts +1 -1
- package/dist/components/Tabs/TabsRoot.d.ts.map +1 -1
- package/dist/components/Tabs/TabsRoot.js +6 -0
- package/dist/components/Tabs/TabsTab.d.ts +1 -1
- package/dist/components/Tabs/TabsTab.d.ts.map +1 -1
- package/dist/components/Tabs/TabsTab.js +11 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverBody.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PopoverBody.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,kDAkB7E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { PopoverContext } from "./PopoverContext";
|
|
5
|
+
export function PopoverBody({ preventClose, onClick, ...p }) {
|
|
6
|
+
const { bodyRef, isOpen } = use(PopoverContext);
|
|
7
|
+
return (isOpen ? (_jsx("div", { ref: bodyRef, onClick: ev => {
|
|
8
|
+
if (preventClose) {
|
|
9
|
+
ev.stopPropagation();
|
|
10
|
+
}
|
|
11
|
+
onClick?.(ev);
|
|
12
|
+
}, ...p })) : null);
|
|
13
|
+
}
|
|
@@ -4,5 +4,5 @@ export type PopoverRootPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
|
4
4
|
mode?: PopoverContextT["mode"];
|
|
5
5
|
accessHorizontalArrows?: "ArrowRight" | "ArrowLeft";
|
|
6
6
|
};
|
|
7
|
-
export declare function PopoverRoot({ mode, accessHorizontalArrows, onKeyDown, onMouseEnter, onMouseLeave, ...p }: PopoverRootPropsT): import("react").JSX.Element;
|
|
7
|
+
export declare function PopoverRoot({ mode, accessHorizontalArrows, onKeyDown, onMouseEnter, onMouseLeave, ...p }: PopoverRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=PopoverRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA8C,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAkB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInE,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/D,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,sBAAsB,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrD,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAc,EAAE,sBAAsB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB
|
|
1
|
+
{"version":3,"file":"PopoverRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA8C,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAkB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInE,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/D,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,sBAAsB,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrD,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAc,EAAE,sBAAsB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,2CAwFrI"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { PopoverContext } from "./PopoverContext";
|
|
5
|
+
import { selectAccessibleChildren } from "../../utils";
|
|
6
|
+
export function PopoverRoot({ mode = "click", accessHorizontalArrows, onKeyDown, onMouseEnter, onMouseLeave, ...p }) {
|
|
7
|
+
const [isOpen, setOpen] = useState(false);
|
|
8
|
+
const toggleRef = useRef(null);
|
|
9
|
+
const bodyRef = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const closeHandler = () => {
|
|
12
|
+
setOpen(false);
|
|
13
|
+
};
|
|
14
|
+
window.addEventListener("click", closeHandler);
|
|
15
|
+
return () => window.removeEventListener("click", closeHandler);
|
|
16
|
+
}, []);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isOpen) {
|
|
19
|
+
selectFirstMenuChild();
|
|
20
|
+
}
|
|
21
|
+
}, [isOpen]);
|
|
22
|
+
const selectFirstMenuChild = () => {
|
|
23
|
+
if (!bodyRef.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const children = selectAccessibleChildren(bodyRef.current);
|
|
27
|
+
const firstChild = children[0];
|
|
28
|
+
if (!firstChild) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
firstChild.focus();
|
|
32
|
+
};
|
|
33
|
+
const handleKeyDown = (ev) => {
|
|
34
|
+
if (!accessHorizontalArrows) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (ev.key === "ArrowRight") {
|
|
38
|
+
if (accessHorizontalArrows === "ArrowRight") {
|
|
39
|
+
setOpen(true);
|
|
40
|
+
selectFirstMenuChild();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setOpen(false);
|
|
44
|
+
toggleRef.current?.focus();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (ev.key === "ArrowLeft") {
|
|
48
|
+
if (accessHorizontalArrows === "ArrowLeft") {
|
|
49
|
+
setOpen(true);
|
|
50
|
+
selectFirstMenuChild();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
setOpen(false);
|
|
54
|
+
toggleRef.current?.focus();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return (_jsx(PopoverContext, { value: { isOpen, setOpen, toggleRef, bodyRef, mode }, children: _jsx("div", { onKeyDown: ev => {
|
|
59
|
+
onKeyDown?.(ev);
|
|
60
|
+
handleKeyDown(ev);
|
|
61
|
+
}, onMouseEnter: ev => {
|
|
62
|
+
onMouseEnter?.(ev);
|
|
63
|
+
if (["hover", "both"].includes(mode)) {
|
|
64
|
+
ev.stopPropagation();
|
|
65
|
+
setOpen(true);
|
|
66
|
+
}
|
|
67
|
+
}, onMouseLeave: ev => {
|
|
68
|
+
onMouseLeave?.(ev);
|
|
69
|
+
if (["hover", "both"].includes(mode)) {
|
|
70
|
+
ev.stopPropagation();
|
|
71
|
+
setOpen(false);
|
|
72
|
+
}
|
|
73
|
+
}, ...p }) }));
|
|
74
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type PopoverTogglePropsT = HTMLAttributes<HTMLButtonElement>;
|
|
3
|
-
export declare function PopoverToggle({ onClick, ...props }: PopoverTogglePropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function PopoverToggle({ onClick, ...props }: PopoverTogglePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=PopoverToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAEpE,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB
|
|
1
|
+
{"version":3,"file":"PopoverToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/PopoverToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAEpE,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAgBvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { PopoverContext } from "./PopoverContext";
|
|
5
|
+
export function PopoverToggle({ onClick, ...props }) {
|
|
6
|
+
const { mode, toggleRef, setOpen } = use(PopoverContext);
|
|
7
|
+
return (_jsx("button", { ref: toggleRef, onClick: ev => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
ev.stopPropagation();
|
|
10
|
+
if (["click", "both"].includes(mode)) {
|
|
11
|
+
setOpen(prev => !prev);
|
|
12
|
+
}
|
|
13
|
+
}, ...props }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
export function Portal({ children, container }) {
|
|
5
|
+
return createPortal(_jsx(_Fragment, { children: children }), container || document.body);
|
|
6
|
+
}
|
|
@@ -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({ duration, children, ...p }: ProgressBarPropsT): import("react").JSX.Element;
|
|
5
|
+
export declare function ProgressBar({ duration, children, ...p }: ProgressBarPropsT): import("react/jsx-runtime").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":"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
|
|
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,2CAe1E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { ProgressContext } from "./ProgressContext";
|
|
6
|
+
export function ProgressBar({ duration, children, ...p }) {
|
|
7
|
+
const { value, maxValue } = use(ProgressContext);
|
|
8
|
+
const percentage = Math.min(100, Math.max(0, (value / maxValue) * 100));
|
|
9
|
+
return (_jsx(motion.div, { initial: { width: 0 }, whileInView: { width: `${percentage}%` }, transition: { duration: duration || 3 }, ...p, children: children || _jsxs("span", { className: "text-xs", children: [percentage, "%"] }) }));
|
|
10
|
+
}
|
|
@@ -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, ...p }: ProgressRootPropsT): import("react").JSX.Element;
|
|
6
|
+
export declare function ProgressRoot({ value, maxValue, ...p }: ProgressRootPropsT): import("react/jsx-runtime").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":"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
|
|
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,2CAM/E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ProgressContext } from "./ProgressContext";
|
|
4
|
+
export function ProgressRoot({ value, maxValue = 100, ...p }) {
|
|
5
|
+
return (_jsx(ProgressContext, { value: { value, maxValue }, children: _jsx("div", { ...p }) }));
|
|
6
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QRCodeRenderersOptions } from "qrcode";
|
|
2
|
-
import
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
3
|
export type QrCodePropsT = HTMLAttributes<HTMLCanvasElement> & {
|
|
4
4
|
value: string;
|
|
5
5
|
options: QRCodeRenderersOptions;
|
|
6
6
|
};
|
|
7
|
-
export declare function QrCode({ value, options, ...props }: QrCodePropsT):
|
|
7
|
+
export declare function QrCode({ value, options, ...props }: QrCodePropsT): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=QrCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCode.d.ts","sourceRoot":"","sources":["../../../src/components/QrCode/QrCode.tsx"],"names":[],"mappings":"AAEA,OAAe,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACxD,
|
|
1
|
+
{"version":3,"file":"QrCode.d.ts","sourceRoot":"","sources":["../../../src/components/QrCode/QrCode.tsx"],"names":[],"mappings":"AAEA,OAAe,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAc,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,sBAAsB,CAAC;CACjC,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAWhE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import QRCode from "qrcode";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
export function QrCode({ value, options, ...props }) {
|
|
6
|
+
const canvasRef = useRef(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
console.log(value);
|
|
9
|
+
QRCode.toCanvas(canvasRef.current, value, options, function (error) {
|
|
10
|
+
if (error)
|
|
11
|
+
console.error(error);
|
|
12
|
+
});
|
|
13
|
+
}, [value, options]);
|
|
14
|
+
return _jsx("canvas", { ref: canvasRef, ...props });
|
|
15
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RatingItems } from "./RatingItems";
|
|
2
|
-
export declare const Rating: ((p: import("./RatingRoot").RatingRootPropsT) => import("react").JSX.Element) & {
|
|
2
|
+
export declare const Rating: ((p: import("./RatingRoot").RatingRootPropsT) => import("react/jsx-runtime").JSX.Element) & {
|
|
3
3
|
Items: typeof RatingItems;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=Rating.d.ts.map
|
|
@@ -6,5 +6,5 @@ export type RatingItemsPropsT = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
6
6
|
element: ReactNode;
|
|
7
7
|
activeElement: ReactNode;
|
|
8
8
|
};
|
|
9
|
-
export declare function RatingItems({ count, value, onValueChange, element, activeElement, ...p }: RatingItemsPropsT): import("react").JSX.Element[];
|
|
9
|
+
export declare function RatingItems({ count, value, onValueChange, element, activeElement, ...p }: RatingItemsPropsT): import("react/jsx-runtime").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":"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,
|
|
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,6CA0B3G"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { RatingContext } from "./RatingContext";
|
|
5
|
+
export function RatingItems({ count, value, onValueChange, element, activeElement, ...p }) {
|
|
6
|
+
const { hoverValue, setHoverValue } = use(RatingContext);
|
|
7
|
+
const displayValue = hoverValue !== null ? hoverValue : value;
|
|
8
|
+
return (Array.from({ length: count }).map((_, index) => {
|
|
9
|
+
const itemValue = index + 1;
|
|
10
|
+
const isActive = itemValue <= displayValue;
|
|
11
|
+
return (_jsx("button", { role: "radio", type: "button", "aria-checked": itemValue === value, onClick: () => onValueChange(itemValue), onMouseEnter: () => setHoverValue(itemValue), "aria-label": `${itemValue} out of ${count} stars`, ...p, children: isActive ? activeElement : element }, index));
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type RatingRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare const RatingRoot: (p: RatingRootPropsT) => import("react").JSX.Element;
|
|
3
|
+
export declare const RatingRoot: (p: RatingRootPropsT) => import("react/jsx-runtime").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":"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,
|
|
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,4CAW7C,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { RatingContext } from "./RatingContext";
|
|
5
|
+
export const RatingRoot = (p) => {
|
|
6
|
+
const [hoverValue, setHoverValue] = useState(null);
|
|
7
|
+
return (_jsx(RatingContext, { value: { hoverValue, setHoverValue }, children: _jsx("div", { onMouseLeave: () => setHoverValue(null), ...p }) }));
|
|
8
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type SheetBodyPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function SheetBody(p: SheetBodyPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetBody(p: SheetBodyPropsT): import("react/jsx-runtime").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":"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
|
|
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,2CAiC3C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { SheetContext } from "./SheetContext";
|
|
6
|
+
export function SheetBody(p) {
|
|
7
|
+
const { controls, y, closeHandler: handleClose } = use(SheetContext);
|
|
8
|
+
return (_jsx(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
|
+
ease: "easeInOut",
|
|
10
|
+
}, onDragEnd: () => {
|
|
11
|
+
if ((y?.get() || 0) >= 100) {
|
|
12
|
+
handleClose();
|
|
13
|
+
}
|
|
14
|
+
}, dragConstraints: {
|
|
15
|
+
top: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
}, dragElastic: {
|
|
18
|
+
top: 0,
|
|
19
|
+
bottom: 0.5,
|
|
20
|
+
}, ...p }));
|
|
21
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SheetContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function SheetContent(p: SheetContentPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetContent(p: SheetContentPropsT): import("react/jsx-runtime").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":"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
|
|
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,2CAEjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SheetHeaderPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function SheetHeader({ onPointerDown, ...p }: SheetHeaderPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetHeader({ onPointerDown, ...p }: SheetHeaderPropsT): import("react/jsx-runtime").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":"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
|
|
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,2CAYrE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { SheetContext } from "./SheetContext";
|
|
5
|
+
export function SheetHeader({ onPointerDown, ...p }) {
|
|
6
|
+
const { controls } = use(SheetContext);
|
|
7
|
+
return (_jsx("div", { onPointerDown: (ev) => {
|
|
8
|
+
controls?.start(ev);
|
|
9
|
+
onPointerDown?.(ev);
|
|
10
|
+
}, ...p }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type SheetPortalPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function SheetPortal(p: SheetPortalPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetPortal(p: SheetPortalPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetPortal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetPortal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAMzE,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB
|
|
1
|
+
{"version":3,"file":"SheetPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetPortal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAMzE,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,2CAqB/C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
+
import { Portal } from "../Portal/Portal";
|
|
6
|
+
import { SheetContext } from "./SheetContext";
|
|
7
|
+
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
8
|
+
export function SheetPortal(p) {
|
|
9
|
+
const { isOpen, closeHandler: handleClose, scope } = use(SheetContext);
|
|
10
|
+
return (_jsx(ClientOnly, { children: _jsx(Portal, { children: _jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { ref: scope, onClick: handleClose, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, ...p })) : null }) }) }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
export type SheetRootPropsT = PropsWithChildren;
|
|
3
|
-
export declare function SheetRoot({ children }: SheetRootPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetRoot({ children }: SheetRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAS/D,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe
|
|
1
|
+
{"version":3,"file":"SheetRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAS/D,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAyCtD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useDragControls, useMotionValue, useAnimate, } from "framer-motion";
|
|
5
|
+
import { SheetContext } from "./SheetContext";
|
|
6
|
+
export function SheetRoot({ children }) {
|
|
7
|
+
const y = useMotionValue(0);
|
|
8
|
+
const controls = useDragControls();
|
|
9
|
+
const [scope, animate] = useAnimate();
|
|
10
|
+
const [isOpen, setOpen] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const bodyElem = document.body;
|
|
13
|
+
const removeOverflow = () => {
|
|
14
|
+
bodyElem.style.overflow = "unset";
|
|
15
|
+
};
|
|
16
|
+
if (isOpen) {
|
|
17
|
+
bodyElem.style.overflow = "hidden";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
removeOverflow();
|
|
21
|
+
}
|
|
22
|
+
return () => removeOverflow();
|
|
23
|
+
}, [isOpen]);
|
|
24
|
+
const closeHandler = async () => {
|
|
25
|
+
animate(scope.current, {
|
|
26
|
+
opacity: [1, 0],
|
|
27
|
+
});
|
|
28
|
+
const yStart = typeof y.get() === "number" ? y.get() : 0;
|
|
29
|
+
await animate("#sheet", {
|
|
30
|
+
y: [yStart, "100%"],
|
|
31
|
+
});
|
|
32
|
+
setOpen(false);
|
|
33
|
+
};
|
|
34
|
+
return (_jsx(SheetContext, { value: { isOpen, setOpen, closeHandler, scope, controls, y }, children: children }));
|
|
35
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SheetTogglePropsT = HTMLAttributes<HTMLButtonElement>;
|
|
3
|
-
export declare function SheetToggle({ onClick, ...props }: SheetTogglePropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetToggle({ onClick, ...props }: SheetTogglePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SheetToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAElE,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB
|
|
1
|
+
{"version":3,"file":"SheetToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAElE,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAYnE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { SheetContext } from "./SheetContext";
|
|
5
|
+
export function SheetToggle({ onClick, ...props }) {
|
|
6
|
+
const { setOpen } = use(SheetContext);
|
|
7
|
+
return (_jsx("button", { onClick: ev => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
setOpen(prev => !prev);
|
|
10
|
+
}, ...props }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type ShowMoreContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ShowMoreContent({ children, style, ...props }: ShowMoreContentPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function ShowMoreContent({ children, style, ...props }: ShowMoreContentPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ShowMoreContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMoreContent.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"ShowMoreContent.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAuBnF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { ShowMoreContext } from "./ShowMoreContext";
|
|
5
|
+
export function ShowMoreContent({ children, style, ...props }) {
|
|
6
|
+
const { contentRef, shouldShowMore, isShowMore, maxHeight } = use(ShowMoreContext);
|
|
7
|
+
return (_jsx("div", { ref: contentRef, style: {
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
transition: "all 150ms ease",
|
|
10
|
+
height: shouldShowMore
|
|
11
|
+
? isShowMore
|
|
12
|
+
? contentRef.current?.scrollHeight
|
|
13
|
+
? `${contentRef.current.scrollHeight}px`
|
|
14
|
+
: "auto"
|
|
15
|
+
: maxHeight
|
|
16
|
+
: "auto",
|
|
17
|
+
...style
|
|
18
|
+
}, ...props, children: children }));
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type ShowMoreFadePropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ShowMoreFade(p: ShowMoreFadePropsT): import("react").JSX.Element | null;
|
|
3
|
+
export declare function ShowMoreFade(p: ShowMoreFadePropsT): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
//# sourceMappingURL=ShowMoreFade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMoreFade.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ShowMoreFade.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,kDAQjD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { ShowMoreContext } from "./ShowMoreContext";
|
|
5
|
+
export function ShowMoreFade(p) {
|
|
6
|
+
const { shouldShowMore, isShowMore } = use(ShowMoreContext);
|
|
7
|
+
return (shouldShowMore && !isShowMore ? (_jsx("div", { ...p })) : null);
|
|
8
|
+
}
|
|
@@ -3,5 +3,5 @@ export type ShowMoreRootPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
|
3
3
|
maxLines: number;
|
|
4
4
|
defaultExpanded?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function ShowMoreRoot({ maxLines, defaultExpanded, style, ...p }: ShowMoreRootPropsT): import("react").JSX.Element;
|
|
6
|
+
export declare function ShowMoreRoot({ maxLines, defaultExpanded, style, ...p }: ShowMoreRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=ShowMoreRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMoreRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,eAAuB,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB
|
|
1
|
+
{"version":3,"file":"ShowMoreRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,eAAuB,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAwBlG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { ShowMoreContext } from "./ShowMoreContext";
|
|
5
|
+
export function ShowMoreRoot({ maxLines, defaultExpanded = false, style, ...p }) {
|
|
6
|
+
const [shouldShowMore, setShouldShowMore] = useState(false);
|
|
7
|
+
const [isShowMore, setIsShowMore] = useState(defaultExpanded);
|
|
8
|
+
const [maxHeight, setMaxHeight] = useState(0);
|
|
9
|
+
const contentRef = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (contentRef.current) {
|
|
12
|
+
const element = contentRef.current;
|
|
13
|
+
const lineHeight = Number.parseInt(window.getComputedStyle(element).lineHeight);
|
|
14
|
+
const maxHeight = lineHeight * (maxLines || 3);
|
|
15
|
+
const actualHeight = element.scrollHeight;
|
|
16
|
+
setMaxHeight(maxHeight);
|
|
17
|
+
setShouldShowMore(actualHeight > maxHeight);
|
|
18
|
+
}
|
|
19
|
+
}, [maxLines]);
|
|
20
|
+
return (_jsx(ShowMoreContext, { value: { contentRef, isShowMore, setIsShowMore, maxHeight, shouldShowMore }, children: _jsx("div", { style: { position: "relative", ...style }, ...p }) }));
|
|
21
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes } from "react";
|
|
2
2
|
export type ShowMoreTriggerPropsT = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
3
|
-
export declare function ShowMoreTrigger({ onClick, style, ...p }: ShowMoreTriggerPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function ShowMoreTrigger({ onClick, style, ...p }: ShowMoreTriggerPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ShowMoreTrigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMoreTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5E,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"ShowMoreTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5E,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAgB9E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { ShowMoreContext } from "./ShowMoreContext";
|
|
5
|
+
export function ShowMoreTrigger({ onClick, style, ...p }) {
|
|
6
|
+
const { setIsShowMore } = use(ShowMoreContext);
|
|
7
|
+
return (_jsx("button", { style: {
|
|
8
|
+
position: "relative",
|
|
9
|
+
...style
|
|
10
|
+
}, onClick: ev => {
|
|
11
|
+
onClick?.(ev);
|
|
12
|
+
setIsShowMore(prev => !prev);
|
|
13
|
+
}, ...p }));
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type SpoilerBlurPropsT = HTMLAttributes<HTMLSpanElement>;
|
|
3
|
-
export declare function SpoilerBlur({ className, ...p }: SpoilerBlurPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function SpoilerBlur({ className, ...p }: SpoilerBlurPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=SpoilerBlur.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpoilerBlur.d.ts","sourceRoot":"","sources":["../../../src/components/Spoiler/SpoilerBlur.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAEhE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB
|
|
1
|
+
{"version":3,"file":"SpoilerBlur.d.ts","sourceRoot":"","sources":["../../../src/components/Spoiler/SpoilerBlur.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAEhE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,2CAYjE"}
|