@kadoui/react 1.2.4 → 1.2.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/Popover.d.ts +2 -2
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/PopoverBody.d.ts +6 -0
- package/dist/components/Popover/PopoverBody.d.ts.map +1 -0
- package/dist/components/Popover/PopoverBody.js +13 -0
- package/dist/components/Popover/PopoverBody.jsx +12 -0
- package/dist/components/Popover/PopoverContext.d.ts +1 -1
- 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/PopoverRoot.jsx +4 -4
- 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 +2 -2
- package/tsconfig.json +1 -1
|
@@ -2,5 +2,5 @@ import { HTMLAttributes } from "react";
|
|
|
2
2
|
export type AccessNavigationPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
direction?: "y" | "x";
|
|
4
4
|
};
|
|
5
|
-
export declare function AccessNavigation({ direction, dir, onKeyDown, ...p }: AccessNavigationPropsT): import("react").JSX.Element;
|
|
5
|
+
export declare function AccessNavigation({ direction, dir, onKeyDown, ...p }: AccessNavigationPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=AccessNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/AccessNavigation/AccessNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAItD,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,SAAe,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB
|
|
1
|
+
{"version":3,"file":"AccessNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/AccessNavigation/AccessNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAItD,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,SAAe,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB,2CAoCjG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { selectAccessibleChildren } from "../../utils";
|
|
4
|
+
export function AccessNavigation({ direction = "y", dir, onKeyDown, ...p }) {
|
|
5
|
+
const handleKeyDown = (ev) => {
|
|
6
|
+
const focusableChildren = selectAccessibleChildren(ev.currentTarget);
|
|
7
|
+
if (!focusableChildren.length) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const currentDir = (dir || document.documentElement.getAttribute("dir") || "ltr");
|
|
11
|
+
const currentIndex = focusableChildren.findIndex((item) => item === document.activeElement);
|
|
12
|
+
if (ev.key === (direction === "y" ? "ArrowDown" : (currentDir === "ltr" ? "ArrowRight" : "ArrowLeft"))) {
|
|
13
|
+
ev.preventDefault();
|
|
14
|
+
const nextIndex = currentIndex === -1 || currentIndex === focusableChildren.length - 1 ? 0 : currentIndex + 1;
|
|
15
|
+
focusableChildren[nextIndex]?.focus();
|
|
16
|
+
}
|
|
17
|
+
if (ev.key === (direction === "y" ? "ArrowUp" : (currentDir === "ltr" ? "ArrowLeft" : "ArrowRight"))) {
|
|
18
|
+
ev.preventDefault();
|
|
19
|
+
const prevIndex = currentIndex <= 0 ? focusableChildren.length - 1 : currentIndex - 1;
|
|
20
|
+
focusableChildren[prevIndex]?.focus();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsx("div", { dir: dir, onKeyDown: ev => {
|
|
24
|
+
onKeyDown?.(ev);
|
|
25
|
+
handleKeyDown(ev);
|
|
26
|
+
}, ...p }));
|
|
27
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type AccordionBodyPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function AccordionBody({ children, ...props }: AccordionBodyPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function AccordionBody({ children, ...props }: AccordionBodyPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=AccordionBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAIzE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEzD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB
|
|
1
|
+
{"version":3,"file":"AccordionBody.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAIzE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEzD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAiBxE"}
|
|
@@ -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 { AccordionContext } from "./AccordionContext";
|
|
6
|
+
export function AccordionBody({ children, ...props }) {
|
|
7
|
+
const { isOpen } = use(AccordionContext);
|
|
8
|
+
return (_jsx(AnimatePresence, { children: isOpen ?
|
|
9
|
+
_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, ...props, children: children })
|
|
10
|
+
: null }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
export type AccordionRootPropsT = PropsWithChildren;
|
|
3
|
-
export declare function AccordionRoot({ children }: AccordionRootPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function AccordionRoot({ children }: AccordionRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=AccordionRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAIpD,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB
|
|
1
|
+
{"version":3,"file":"AccordionRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAIpD,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAQ9D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { AccordionContext } from "./AccordionContext";
|
|
5
|
+
export function AccordionRoot({ children }) {
|
|
6
|
+
const [isOpen, setOpen] = useState(false);
|
|
7
|
+
return (_jsx(AccordionContext, { value: { isOpen, setOpen }, children: children }));
|
|
8
|
+
}
|
|
@@ -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.Element;
|
|
5
|
+
export declare function AccordionToggle({ className, 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
|
|
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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import { AccordionContext } from "./AccordionContext";
|
|
6
|
+
export function AccordionToggle({ className, onClick, ...props }) {
|
|
7
|
+
const { isOpen, setOpen } = use(AccordionContext);
|
|
8
|
+
return (_jsx("button", { onClick: ev => {
|
|
9
|
+
onClick?.(ev);
|
|
10
|
+
setOpen(prev => !prev);
|
|
11
|
+
}, className: cn(isOpen ? "accordion-active" : null, className), ...props }));
|
|
12
|
+
}
|
|
@@ -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.Element;
|
|
3
|
+
export declare const Affix: ({ className, 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,
|
|
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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
export const Affix = ({ className, onClick, ...p }) => {
|
|
6
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
7
|
+
const [lastScrollY, setLastScrollY] = useState(0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const handleScroll = () => {
|
|
10
|
+
const currentScrollY = window.scrollY;
|
|
11
|
+
const viewportHeight = window.innerHeight;
|
|
12
|
+
const scrollThreshold = viewportHeight * 0.5;
|
|
13
|
+
if (currentScrollY > scrollThreshold && currentScrollY > lastScrollY) {
|
|
14
|
+
setIsVisible(true);
|
|
15
|
+
}
|
|
16
|
+
else if (currentScrollY < lastScrollY && currentScrollY < scrollThreshold) {
|
|
17
|
+
setIsVisible(false);
|
|
18
|
+
}
|
|
19
|
+
setLastScrollY(currentScrollY);
|
|
20
|
+
};
|
|
21
|
+
window.addEventListener("scroll", handleScroll, {
|
|
22
|
+
passive: true
|
|
23
|
+
});
|
|
24
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
25
|
+
}, [lastScrollY]);
|
|
26
|
+
const scrollToTop = () => {
|
|
27
|
+
window.scrollTo({
|
|
28
|
+
top: 0,
|
|
29
|
+
behavior: "smooth"
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return (_jsx("button", { onClick: ev => {
|
|
33
|
+
onClick?.(ev);
|
|
34
|
+
scrollToTop();
|
|
35
|
+
}, className: cn(isVisible ? "affix-active" : null, className), ...p }));
|
|
36
|
+
};
|
|
@@ -2,5 +2,5 @@ import { type HTMLAttributes } from "react";
|
|
|
2
2
|
export type BreadcrumbsItemPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
isLast?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function BreadcrumbsItem({ isLast, children, ...p }: BreadcrumbsItemPropsT): import("react").JSX.Element;
|
|
5
|
+
export declare function BreadcrumbsItem({ isLast, children, ...p }: BreadcrumbsItemPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=BreadcrumbsItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbsItem.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAc,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"BreadcrumbsItem.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAc,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CASxF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { BreadcrumbsContext } from "./BreadcrumbsContext";
|
|
5
|
+
export function BreadcrumbsItem({ isLast = false, children, ...p }) {
|
|
6
|
+
const { separator } = use(BreadcrumbsContext);
|
|
7
|
+
return (_jsxs("div", { ...p, children: [children, !isLast && separator] }));
|
|
8
|
+
}
|
|
@@ -2,5 +2,5 @@ import type { HTMLAttributes, ReactNode } from "react";
|
|
|
2
2
|
export type BreadcrumbsRootPropsT = HTMLAttributes<HTMLElement> & {
|
|
3
3
|
separator?: ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare function BreadcrumbsRoot({ separator, ...p }: BreadcrumbsRootPropsT): import("react").JSX.Element;
|
|
5
|
+
export declare function BreadcrumbsRoot({ separator, ...p }: BreadcrumbsRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=BreadcrumbsRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbsRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAChE,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAe,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"BreadcrumbsRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAChE,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAe,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAM/E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { BreadcrumbsContext } from "./BreadcrumbsContext";
|
|
4
|
+
export function BreadcrumbsRoot({ separator = "/", ...p }) {
|
|
5
|
+
return (_jsx(BreadcrumbsContext, { value: { separator }, children: _jsx("nav", { ...p }) }));
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type CarouselContainerPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function CarouselContainer({ children, ...p }: CarouselContainerPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function CarouselContainer({ children, ...p }: CarouselContainerPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=CarouselContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB
|
|
1
|
+
{"version":3,"file":"CarouselContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB,2CAQ5E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { CarouselContext } from "./CarouselContext";
|
|
5
|
+
export function CarouselContainer({ children, ...p }) {
|
|
6
|
+
const { scrollRef } = use(CarouselContext);
|
|
7
|
+
return (_jsx("div", { ref: scrollRef, ...p, children: children }));
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
type CarouselLeftFadePropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function CarouselLeftFade({ style, ...p }: CarouselLeftFadePropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function CarouselLeftFade({ style, ...p }: CarouselLeftFadePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=CarouselLeftFade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselLeftFade.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselLeftFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,KAAK,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB
|
|
1
|
+
{"version":3,"file":"CarouselLeftFade.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselLeftFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,KAAK,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB,2CAYvE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { CarouselContext } from "./CarouselContext";
|
|
5
|
+
export function CarouselLeftFade({ style, ...p }) {
|
|
6
|
+
const { leftOpacity } = use(CarouselContext);
|
|
7
|
+
return (_jsx("div", { style: {
|
|
8
|
+
opacity: leftOpacity,
|
|
9
|
+
...style
|
|
10
|
+
}, ...p }));
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
type CarouselRightFadePropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function CarouselRightFade({ style, ...p }: CarouselRightFadePropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function CarouselRightFade({ style, ...p }: CarouselRightFadePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=CarouselRightFade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselRightFade.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselRightFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,KAAK,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE9D,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB
|
|
1
|
+
{"version":3,"file":"CarouselRightFade.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselRightFade.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,KAAK,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE9D,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,uBAAuB,2CAYzE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { CarouselContext } from "./CarouselContext";
|
|
5
|
+
export function CarouselRightFade({ style, ...p }) {
|
|
6
|
+
const { rightOpacity } = use(CarouselContext);
|
|
7
|
+
return (_jsx("div", { style: {
|
|
8
|
+
opacity: rightOpacity,
|
|
9
|
+
...style
|
|
10
|
+
}, ...p }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type CarouselRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function CarouselRoot(p: CarouselRootPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function CarouselRoot(p: CarouselRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=CarouselRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB
|
|
1
|
+
{"version":3,"file":"CarouselRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,2CA+CjD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { CarouselContext } from "./CarouselContext";
|
|
5
|
+
export function CarouselRoot(p) {
|
|
6
|
+
const scrollRef = useRef(null);
|
|
7
|
+
const [leftOpacity, setLeftOpacity] = useState(0);
|
|
8
|
+
const [rightOpacity, setRightOpacity] = useState(1);
|
|
9
|
+
const updateFade = () => {
|
|
10
|
+
const el = scrollRef.current;
|
|
11
|
+
if (!el)
|
|
12
|
+
return;
|
|
13
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
14
|
+
const maxScroll = scrollWidth - clientWidth;
|
|
15
|
+
if (maxScroll <= 0) {
|
|
16
|
+
setLeftOpacity(0);
|
|
17
|
+
setRightOpacity(0);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const scrollRatio = Math.abs(+(scrollLeft / maxScroll));
|
|
21
|
+
const left = Math.min(1, scrollRatio * 2);
|
|
22
|
+
const right = Math.min(1, (1 - scrollRatio) * 2);
|
|
23
|
+
setLeftOpacity(+left.toFixed(1));
|
|
24
|
+
setRightOpacity(+right.toFixed(1));
|
|
25
|
+
};
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const el = scrollRef.current;
|
|
28
|
+
if (!el)
|
|
29
|
+
return;
|
|
30
|
+
updateFade();
|
|
31
|
+
el.addEventListener("scroll", updateFade);
|
|
32
|
+
window.addEventListener("resize", updateFade);
|
|
33
|
+
return () => {
|
|
34
|
+
el.removeEventListener("scroll", updateFade);
|
|
35
|
+
window.removeEventListener("resize", updateFade);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return (_jsx(CarouselContext, { value: { scrollRef, leftOpacity, rightOpacity }, children: _jsx("div", { ...p }) }));
|
|
39
|
+
}
|
|
@@ -4,5 +4,5 @@ export type ClipboardPropsT = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
4
4
|
timeout?: number;
|
|
5
5
|
copiedChildren?: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare function Clipboard({ copiedChildren, onClick, children, text, timeout, ...props }: ClipboardPropsT): import("react").JSX.Element;
|
|
7
|
+
export declare function Clipboard({ copiedChildren, onClick, children, text, timeout, ...props }: ClipboardPropsT): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=Clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/Clipboard/Clipboard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe
|
|
1
|
+
{"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/Clipboard/Clipboard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBhH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useClipboard } from "@mantine/hooks";
|
|
4
|
+
export function Clipboard({ copiedChildren, onClick, children, text, timeout = 3_000, ...props }) {
|
|
5
|
+
const { copy, copied } = useClipboard({ timeout });
|
|
6
|
+
const handleClick = (ev) => {
|
|
7
|
+
onClick?.(ev);
|
|
8
|
+
copy(text.trim());
|
|
9
|
+
};
|
|
10
|
+
return (_jsx("button", { "aria-label": text, onClick: handleClick, ...props, children: copiedChildren && copied ? copiedChildren : children }));
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type ContextMenuContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ContextMenuContent({ onContextMenu, className, ...p }: ContextMenuContentPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function ContextMenuContent({ onContextMenu, className, ...p }: ContextMenuContentPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ContextMenuContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAMvD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,wBAAwB
|
|
1
|
+
{"version":3,"file":"ContextMenuContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAMvD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,wBAAwB,2CAuC9F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use, useEffect } from "react";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import { selectAccessibleChildren } from "../../utils";
|
|
6
|
+
import { ContextMenuContext } from "./ContextMenuContext";
|
|
7
|
+
export function ContextMenuContent({ onContextMenu, className, ...p }) {
|
|
8
|
+
const { contentRef, position, isOpen } = use(ContextMenuContext);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!contentRef.current) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (isOpen) {
|
|
14
|
+
const children = selectAccessibleChildren(contentRef.current);
|
|
15
|
+
const firstChild = children[0];
|
|
16
|
+
if (!firstChild) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
firstChild.focus();
|
|
20
|
+
}
|
|
21
|
+
}, [isOpen, position, contentRef]);
|
|
22
|
+
return (_jsx("div", { ref: contentRef, onContextMenu: ev => {
|
|
23
|
+
ev.stopPropagation();
|
|
24
|
+
ev.preventDefault();
|
|
25
|
+
onContextMenu?.(ev);
|
|
26
|
+
}, className: cn(isOpen ? "context-menu-active" : null, className), style: {
|
|
27
|
+
top: position?.y,
|
|
28
|
+
left: position?.x,
|
|
29
|
+
}, ...p }));
|
|
30
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export type ContextMenuRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ContextMenuRoot({ onContextMenu, ...p }: ContextMenuRootPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function ContextMenuRoot({ onContextMenu, ...p }: ContextMenuRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ContextMenuRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwD,MAAM,OAAO,CAAC;AAK7F,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwD,MAAM,OAAO,CAAC;AAK7F,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAqE7E"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { getBrowserScrollbarWith } from "../../utils";
|
|
5
|
+
import { ContextMenuContext } from "./ContextMenuContext";
|
|
6
|
+
export function ContextMenuRoot({ onContextMenu, ...p }) {
|
|
7
|
+
const [position, setPosition] = useState(undefined);
|
|
8
|
+
const [isOpen, setOpen] = useState(false);
|
|
9
|
+
const contentRef = useRef(null);
|
|
10
|
+
const handleClickOutside = useCallback((ev) => {
|
|
11
|
+
if (!contentRef.current?.contains(ev.target)) {
|
|
12
|
+
setOpen(false);
|
|
13
|
+
setPosition(undefined);
|
|
14
|
+
}
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
document.addEventListener("click", handleClickOutside);
|
|
18
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
19
|
+
}, [handleClickOutside]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
22
|
+
if (isOpen) {
|
|
23
|
+
document.body.style.overflow = "hidden";
|
|
24
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
document.body.style.overflow = "unset";
|
|
28
|
+
document.body.style.paddingRight = "0px";
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
}, [isOpen]);
|
|
32
|
+
const handleContextMenu = (ev) => {
|
|
33
|
+
if (!contentRef.current)
|
|
34
|
+
return;
|
|
35
|
+
ev.preventDefault();
|
|
36
|
+
const viewportWidth = window.innerWidth;
|
|
37
|
+
const viewportHeight = window.innerHeight;
|
|
38
|
+
const menuWidth = contentRef.current.scrollWidth;
|
|
39
|
+
const menuHeight = contentRef.current.scrollHeight;
|
|
40
|
+
let x = ev.clientX;
|
|
41
|
+
let y = ev.clientY;
|
|
42
|
+
if (x + menuWidth > viewportWidth) {
|
|
43
|
+
x = viewportWidth - menuWidth - 10;
|
|
44
|
+
}
|
|
45
|
+
if (y + menuHeight > viewportHeight) {
|
|
46
|
+
y = viewportHeight - menuHeight - 10;
|
|
47
|
+
}
|
|
48
|
+
setPosition({ x, y });
|
|
49
|
+
setOpen(true);
|
|
50
|
+
};
|
|
51
|
+
return (_jsx(ContextMenuContext, { value: { contentRef, isOpen, position }, children: _jsx("div", { onContextMenu: ev => {
|
|
52
|
+
onContextMenu?.(ev);
|
|
53
|
+
handleContextMenu(ev);
|
|
54
|
+
}, ...p }) }));
|
|
55
|
+
}
|
|
@@ -2,5 +2,5 @@ import { HTMLMotionProps } from "framer-motion";
|
|
|
2
2
|
export type DrawerBodyPropsT = HTMLMotionProps<"div"> & {
|
|
3
3
|
position?: "top" | "right" | "bottom" | "left";
|
|
4
4
|
};
|
|
5
|
-
export declare function DrawerBody({ position, dir, children, ...p }: DrawerBodyPropsT): import("react").JSX.Element;
|
|
5
|
+
export declare function DrawerBody({ position, dir, children, ...p }: DrawerBodyPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=DrawerBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerBody.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,eAAe,EAAE,MAAM,eAAe,CAAC;AAKxD,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG;IACtD,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,gBAAgB
|
|
1
|
+
{"version":3,"file":"DrawerBody.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,eAAe,EAAE,MAAM,eAAe,CAAC;AAKxD,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG;IACtD,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,gBAAgB,2CAqD7E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import { use, useEffect, useRef } from "react";
|
|
5
|
+
import { DrawerContext } from "./DrawerContext";
|
|
6
|
+
export function DrawerBody({ position, dir, children, ...p }) {
|
|
7
|
+
const { isOpen } = use(DrawerContext);
|
|
8
|
+
const bodyRef = useRef(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (isOpen) {
|
|
11
|
+
const indexElement = bodyRef.current?.querySelector("[data-drawer='index']");
|
|
12
|
+
indexElement?.focus();
|
|
13
|
+
}
|
|
14
|
+
;
|
|
15
|
+
}, [isOpen]);
|
|
16
|
+
const currentDir = (dir || document.documentElement.getAttribute("dir") || "ltr");
|
|
17
|
+
const currentPosition = position || (currentDir === "ltr" ? "left" : "right");
|
|
18
|
+
const direction = ["right", "left"].includes(currentPosition) ? "y" : "x";
|
|
19
|
+
const width = direction === "y" ? "clamp(300px,30%,30%)" : undefined;
|
|
20
|
+
const height = direction === "y" ? undefined : "50%";
|
|
21
|
+
return (_jsx(motion.div, { ref: bodyRef, onClick: ev => ev.stopPropagation(), initial: direction === "y"
|
|
22
|
+
? { x: currentPosition === "left" ? "-100%" : "100%" }
|
|
23
|
+
: { y: currentPosition === "top" ? "-100%" : "100%" }, animate: { y: 0, x: 0 }, exit: direction === "y"
|
|
24
|
+
? { x: currentPosition === "left" ? "-100%" : "100%" }
|
|
25
|
+
: { y: currentPosition === "top" ? "-100%" : "100%" }, style: {
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
...(currentPosition === "top"
|
|
29
|
+
? { top: 0, left: 0, right: 0 }
|
|
30
|
+
: currentPosition === "right"
|
|
31
|
+
? { top: 0, bottom: 0, right: 0 }
|
|
32
|
+
: currentPosition === "bottom"
|
|
33
|
+
? { bottom: 0, left: 0, right: 0 }
|
|
34
|
+
: { top: 0, bottom: 0, left: 0 })
|
|
35
|
+
}, transition: { ease: "easeInOut" }, ...p, children: children }));
|
|
36
|
+
}
|
|
37
|
+
;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type DrawerPortalPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function DrawerPortal({ onClick, ...p }: DrawerPortalPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function DrawerPortal({ onClick, ...p }: DrawerPortalPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=DrawerPortal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerPortal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,eAAe,EAAE,MAAM,eAAe,CAAC;AAMzE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAExD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB
|
|
1
|
+
{"version":3,"file":"DrawerPortal.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerPortal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,eAAe,EAAE,MAAM,eAAe,CAAC;AAMzE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAExD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAuBjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
5
|
+
import { Portal } from "../Portal/Portal";
|
|
6
|
+
import { DrawerContext } from "./DrawerContext";
|
|
7
|
+
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
8
|
+
export function DrawerPortal({ onClick, ...p }) {
|
|
9
|
+
const { isOpen, setOpen } = use(DrawerContext);
|
|
10
|
+
return (_jsx(ClientOnly, { children: _jsx(Portal, { children: _jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: ev => {
|
|
11
|
+
onClick?.(ev);
|
|
12
|
+
setOpen(false);
|
|
13
|
+
}, ...p })) : null }) }) }));
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
export type DrawerRootPropsT = PropsWithChildren;
|
|
3
|
-
export declare function DrawerRoot({ children }: DrawerRootPropsT): import("react").JSX.Element;
|
|
3
|
+
export declare function DrawerRoot({ children }: DrawerRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=DrawerRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/D,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB
|
|
1
|
+
{"version":3,"file":"DrawerRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/D,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAmCxD"}
|