@kadoui/react 1.4.10 → 1.5.12
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/package.json +4 -8
- package/dist/components/AccessNavigation/AccessNavigation.jsx +0 -26
- package/dist/components/Accordion/AccordionBody.jsx +0 -14
- package/dist/components/Accordion/AccordionRoot.jsx +0 -9
- package/dist/components/Accordion/AccordionToggle.jsx +0 -11
- package/dist/components/Affix/Affix.jsx +0 -35
- package/dist/components/Breadcrumbs/BreadcrumbsItem.jsx +0 -10
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.jsx +0 -7
- package/dist/components/Carousel/CarouselContainer.jsx +0 -9
- package/dist/components/Carousel/CarouselLeftFade.jsx +0 -10
- package/dist/components/Carousel/CarouselRightFade.jsx +0 -10
- package/dist/components/Carousel/CarouselRoot.jsx +0 -40
- package/dist/components/ClientOnly/ClientOnly.jsx +0 -6
- package/dist/components/Clipboard/Clipboard.jsx +0 -12
- package/dist/components/ContextMenu/ContextMenuContent.jsx +0 -29
- package/dist/components/ContextMenu/ContextMenuRoot.jsx +0 -56
- package/dist/components/Drawer/DrawerBody.jsx +0 -38
- package/dist/components/Drawer/DrawerPortal.jsx +0 -19
- package/dist/components/Drawer/DrawerRoot.jsx +0 -35
- package/dist/components/Drawer/DrawerToggle.jsx +0 -10
- package/dist/components/Dropdown/Dropdown.d.ts +0 -8
- package/dist/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/Dropdown/Dropdown.js +0 -7
- package/dist/components/Dropdown/DropdownContext.d.ts +0 -9
- package/dist/components/Dropdown/DropdownContext.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownContext.js +0 -2
- package/dist/components/Dropdown/DropdownMenu.d.ts +0 -6
- package/dist/components/Dropdown/DropdownMenu.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownMenu.jsx +0 -12
- package/dist/components/Dropdown/DropdownRoot.d.ts +0 -6
- package/dist/components/Dropdown/DropdownRoot.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownRoot.jsx +0 -63
- package/dist/components/Dropdown/DropdownToggle.d.ts +0 -4
- package/dist/components/Dropdown/DropdownToggle.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownToggle.jsx +0 -11
- package/dist/components/LoaderLink/LoaderLink.jsx +0 -6
- package/dist/components/Modal/ModalBody.jsx +0 -21
- package/dist/components/Modal/ModalContent.jsx +0 -3
- package/dist/components/Modal/ModalHeader.jsx +0 -3
- package/dist/components/Modal/ModalPortal.jsx +0 -19
- package/dist/components/Modal/ModalRoot.jsx +0 -35
- package/dist/components/Modal/ModalTrigger.jsx +0 -10
- package/dist/components/Otp/OtpHiddenInput.jsx +0 -7
- package/dist/components/Otp/OtpInputs.jsx +0 -54
- package/dist/components/Otp/OtpRoot.jsx +0 -15
- package/dist/components/Pagination/PaginationContext.jsx +0 -2
- package/dist/components/Pagination/PaginationCounts.jsx +0 -9
- package/dist/components/Pagination/PaginationNextBtn.jsx +0 -10
- package/dist/components/Pagination/PaginationPrevBtn.jsx +0 -10
- package/dist/components/Pagination/PaginationSearchParamsRoot.jsx +0 -30
- package/dist/components/Pagination/PaginationStateRoot.jsx +0 -11
- package/dist/components/PasswordInput/PasswordInputContext.jsx +0 -2
- package/dist/components/PasswordInput/PasswordInputField.jsx +0 -7
- package/dist/components/PasswordInput/PasswordInputRoot.jsx +0 -9
- package/dist/components/PasswordInput/PasswordInputToggle.jsx +0 -12
- package/dist/components/Popover/PopoverBody.jsx +0 -12
- package/dist/components/Popover/PopoverMenu.d.ts +0 -6
- package/dist/components/Popover/PopoverMenu.d.ts.map +0 -1
- package/dist/components/Popover/PopoverMenu.jsx +0 -12
- package/dist/components/Popover/PopoverRoot.jsx +0 -75
- package/dist/components/Popover/PopoverToggle.jsx +0 -13
- package/dist/components/Portal/Portal.jsx +0 -7
- package/dist/components/Progress/ProgressBar.jsx +0 -11
- package/dist/components/Progress/ProgressRoot.jsx +0 -7
- package/dist/components/QrCode/QrCode.jsx +0 -14
- package/dist/components/Rating/RatingItems.jsx +0 -14
- package/dist/components/Rating/RatingRoot.jsx +0 -9
- package/dist/components/Sheet/SheetBody.jsx +0 -20
- package/dist/components/Sheet/SheetContent.jsx +0 -3
- package/dist/components/Sheet/SheetHeader.jsx +0 -10
- package/dist/components/Sheet/SheetPortal.jsx +0 -16
- package/dist/components/Sheet/SheetRoot.jsx +0 -36
- package/dist/components/Sheet/SheetToggle.jsx +0 -10
- package/dist/components/ShowMore/ShowMoreContent.jsx +0 -20
- package/dist/components/ShowMore/ShowMoreFade.jsx +0 -7
- package/dist/components/ShowMore/ShowMoreRoot.jsx +0 -22
- package/dist/components/ShowMore/ShowMoreTrigger.jsx +0 -13
- package/dist/components/Slide/Slide.d.ts +0 -12
- package/dist/components/Slide/Slide.d.ts.map +0 -1
- package/dist/components/Slide/Slide.js +0 -11
- package/dist/components/Slide/SlideBody.d.ts +0 -4
- package/dist/components/Slide/SlideBody.d.ts.map +0 -1
- package/dist/components/Slide/SlideBody.jsx +0 -3
- package/dist/components/Slide/SlideContext.d.ts +0 -7
- package/dist/components/Slide/SlideContext.d.ts.map +0 -1
- package/dist/components/Slide/SlideContext.js +0 -5
- package/dist/components/Slide/SlideHeader.d.ts +0 -4
- package/dist/components/Slide/SlideHeader.d.ts.map +0 -1
- package/dist/components/Slide/SlideHeader.jsx +0 -3
- package/dist/components/Slide/SlidePortal.d.ts +0 -4
- package/dist/components/Slide/SlidePortal.d.ts.map +0 -1
- package/dist/components/Slide/SlidePortal.jsx +0 -11
- package/dist/components/Slide/SlideRoot.d.ts +0 -6
- package/dist/components/Slide/SlideRoot.d.ts.map +0 -1
- package/dist/components/Slide/SlideRoot.jsx +0 -35
- package/dist/components/Slide/SlideToggle.d.ts +0 -4
- package/dist/components/Slide/SlideToggle.d.ts.map +0 -1
- package/dist/components/Slide/SlideToggle.jsx +0 -10
- package/dist/components/Spoiler/SpoilerBlur.jsx +0 -8
- package/dist/components/Spoiler/SpoilerRoot.jsx +0 -10
- package/dist/components/Steps/StepsContext.jsx +0 -2
- package/dist/components/Steps/StepsControls.d.ts +0 -4
- package/dist/components/Steps/StepsControls.d.ts.map +0 -1
- package/dist/components/Steps/StepsControls.jsx +0 -34
- package/dist/components/Steps/StepsIndexBtn.jsx +0 -10
- package/dist/components/Steps/StepsNextBtn.jsx +0 -10
- package/dist/components/Steps/StepsPrevBtn.jsx +0 -10
- package/dist/components/Steps/StepsRender.jsx +0 -7
- package/dist/components/Steps/StepsSearchParamsRoot.jsx +0 -30
- package/dist/components/Steps/StepsStateRoot.jsx +0 -11
- package/dist/components/Swap/SwapItem.jsx +0 -5
- package/dist/components/Swap/SwapRoot.jsx +0 -16
- package/dist/components/Swap/SwapTrigger.jsx +0 -16
- package/dist/components/Tabs/TabsList.jsx +0 -4
- package/dist/components/Tabs/TabsPanel.jsx +0 -8
- package/dist/components/Tabs/TabsRoot.jsx +0 -7
- package/dist/components/Tabs/TabsTab.jsx +0 -10
- package/dist/components/Toast/Toast.d.ts +0 -4
- package/dist/components/Toast/Toast.d.ts.map +0 -1
- package/dist/components/Toast/Toast.js +0 -3
- package/dist/components/Toast/ToastBox.d.ts +0 -6
- package/dist/components/Toast/ToastBox.d.ts.map +0 -1
- package/dist/components/Toast/ToastBox.jsx +0 -32
- package/dist/components/Toast/ToastRoot.d.ts +0 -15
- package/dist/components/Toast/ToastRoot.d.ts.map +0 -1
- package/dist/components/Toast/ToastRoot.jsx +0 -38
- package/dist/components/Toast/toastStore.d.ts +0 -11
- package/dist/components/Toast/toastStore.d.ts.map +0 -1
- package/dist/components/Toast/toastStore.js +0 -10
- package/dist/components/Toggle/Toggle.d.ts +0 -6
- package/dist/components/Toggle/Toggle.d.ts.map +0 -1
- package/dist/components/Toggle/Toggle.js +0 -5
- package/dist/components/Toggle/ToggleContext.d.ts +0 -8
- package/dist/components/Toggle/ToggleContext.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleContext.js +0 -2
- package/dist/components/Toggle/ToggleRoot.d.ts +0 -8
- package/dist/components/Toggle/ToggleRoot.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleRoot.jsx +0 -13
- package/dist/components/Toggle/ToggleSwitch.d.ts +0 -4
- package/dist/components/Toggle/ToggleSwitch.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleSwitch.jsx +0 -23
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SlideRoot } from "./SlideRoot";
|
|
2
|
-
import { SlideHeader } from "./SlideHeader";
|
|
3
|
-
import { SlidePortal } from "./SlidePortal";
|
|
4
|
-
import { SlideToggle } from "./SlideToggle";
|
|
5
|
-
import { SlideBody } from "./SlideBody";
|
|
6
|
-
export declare const Slide: typeof SlideRoot & {
|
|
7
|
-
Portal: typeof SlidePortal;
|
|
8
|
-
Toggle: typeof SlideToggle;
|
|
9
|
-
Header: typeof SlideHeader;
|
|
10
|
-
Body: typeof SlideBody;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=Slide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/Slide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,KAAK;;;;;CAKhB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SlideRoot } from "./SlideRoot";
|
|
2
|
-
import { SlideHeader } from "./SlideHeader";
|
|
3
|
-
import { SlidePortal } from "./SlidePortal";
|
|
4
|
-
import { SlideToggle } from "./SlideToggle";
|
|
5
|
-
import { SlideBody } from "./SlideBody";
|
|
6
|
-
export const Slide = Object.assign(SlideRoot, {
|
|
7
|
-
Portal: SlidePortal,
|
|
8
|
-
Toggle: SlideToggle,
|
|
9
|
-
Header: SlideHeader,
|
|
10
|
-
Body: SlideBody
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideBody.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlideBody.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE7D,wBAAgB,SAAS,CAAC,CAAC,EAAE,eAAe,+BAE3C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
export type SlideContextT = {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
5
|
-
};
|
|
6
|
-
export declare const SlideContext: import("react").Context<SlideContextT>;
|
|
7
|
-
//# sourceMappingURL=SlideContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideContext.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlideContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C,CAAA;AAED,eAAO,MAAM,YAAY,wCAGvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlideHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAA;AAElE,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,+BAE/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlidePortal.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlidePortal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAM5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAcrE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
import { Portal } from "../Portal/Portal";
|
|
5
|
-
import { SlideContext } from "./SlideContext";
|
|
6
|
-
export function SlidePortal({ className, ...props }) {
|
|
7
|
-
const { isOpen } = use(SlideContext);
|
|
8
|
-
return (<Portal>
|
|
9
|
-
<div className={cn(isOpen ? "slide-active" : "", className)} {...props}/>
|
|
10
|
-
</Portal>);
|
|
11
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
export type SlideRootPropsT = PropsWithChildren & {
|
|
3
|
-
defaultDuration?: number;
|
|
4
|
-
};
|
|
5
|
-
export declare function SlideRoot({ defaultDuration, children }: SlideRootPropsT): import("react").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=SlideRoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlideRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAI/D,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,eAAqB,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAoC7E"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { SlideContext } from "./SlideContext";
|
|
4
|
-
export function SlideRoot({ defaultDuration = 500, children }) {
|
|
5
|
-
const [isOpen, setOpen] = useState(false);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
const rootElem = document.getElementById("root");
|
|
8
|
-
if (!rootElem) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
;
|
|
12
|
-
rootElem.style.transition = `${defaultDuration}ms ease-in-out`;
|
|
13
|
-
const bodyElem = document.body;
|
|
14
|
-
const removeStyles = () => {
|
|
15
|
-
rootElem.style.translate = "unset";
|
|
16
|
-
setTimeout(() => {
|
|
17
|
-
bodyElem.style.overflow = "unset";
|
|
18
|
-
}, defaultDuration);
|
|
19
|
-
};
|
|
20
|
-
if (isOpen) {
|
|
21
|
-
bodyElem.style.overflow = "hidden";
|
|
22
|
-
rootElem.style.translate = "100% 0";
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
removeStyles();
|
|
26
|
-
}
|
|
27
|
-
;
|
|
28
|
-
return () => {
|
|
29
|
-
removeStyles();
|
|
30
|
-
};
|
|
31
|
-
}, [isOpen]);
|
|
32
|
-
return (<SlideContext value={{ isOpen, setOpen }}>
|
|
33
|
-
{children}
|
|
34
|
-
</SlideContext>);
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideToggle.d.ts","sourceRoot":"","sources":["../../../src/components/Slide/SlideToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAInD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAElE,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,qBAYnE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React, { use } from "react";
|
|
3
|
-
import { SlideContext } from "./SlideContext";
|
|
4
|
-
export function SlideToggle({ onClick, ...props }) {
|
|
5
|
-
const { setOpen } = use(SlideContext);
|
|
6
|
-
return (<button onClick={ev => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
setOpen(prev => !prev);
|
|
9
|
-
}} {...props}/>);
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
import { SpoilerContext } from "./SpoilerContext";
|
|
5
|
-
export function SpoilerBlur({ className, ...p }) {
|
|
6
|
-
const { isOpen } = use(SpoilerContext);
|
|
7
|
-
return (<span className={cn(isOpen ? "spoiler-active" : null, className)} {...p}/>);
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { cn } from "../../utils";
|
|
4
|
-
import { SpoilerContext } from "./SpoilerContext";
|
|
5
|
-
export function SpoilerRoot({ className, ...p }) {
|
|
6
|
-
const [isOpen, setOpen] = useState(false);
|
|
7
|
-
return (<SpoilerContext value={{ isOpen, setOpen }}>
|
|
8
|
-
<span onClick={() => setOpen(true)} className={cn(isOpen ? "spoiler-active" : null, className)} {...p}/>
|
|
9
|
-
</SpoilerContext>);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepsControls.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsControls.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BA8CzE"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn } from "../../utils";
|
|
3
|
-
import { use } from "react";
|
|
4
|
-
import { StepsContext } from "./StepsContext";
|
|
5
|
-
export function StepsControls({ className, ...props }) {
|
|
6
|
-
const { step, steps, setStep } = use(StepsContext);
|
|
7
|
-
return (<>
|
|
8
|
-
<div className={cn("f-align mb-[calc(1.5rem+0.75rem+0.375rem)]", className)} {...props}>
|
|
9
|
-
{steps.map((item, index) => (<div key={index} className={`${index + 1 < steps.length ? "w-full" : "w-max"} f-align justify-between`}>
|
|
10
|
-
<div className="f-center relative flex-col">
|
|
11
|
-
<button onClick={() => step > index + 1 && setStep(index + 1)} className={`${step >= index + 1 ? "btn-fill" : "btn-ghost"} btn-square rounded-full`}>
|
|
12
|
-
<span className="text-sm">{(index + 1)}</span>
|
|
13
|
-
</button>
|
|
14
|
-
<span className={`
|
|
15
|
-
f-align mt-1.5 h-3 w-max text-center text-xs absolute top-full
|
|
16
|
-
${step === index + 1 ? "font-bold" : ""}
|
|
17
|
-
${index === 0 ? "ltr:left-0 rtl:right-0" : index + 1 === steps.length ? "ltr:right-0 rtl:left-0" : ""}
|
|
18
|
-
`}>
|
|
19
|
-
{item.name}
|
|
20
|
-
</span>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
{index + 1 < steps.length ? (<div key={index} className="bg-foreground/10 flex h-1.5 flex-1 shrink-0">
|
|
24
|
-
<div className={`
|
|
25
|
-
bg-primary w-full ltr:origin-left rtl:origin-right h-full
|
|
26
|
-
${step > index + 1 ? "scale-x-100" : step === index + 1 ? "scale-x-[50%]" : "scale-x-0"}
|
|
27
|
-
`}/>
|
|
28
|
-
</div>) : null}
|
|
29
|
-
</div>))}
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
{steps.find((_, index) => index + 1 === step)?.component}
|
|
33
|
-
</>);
|
|
34
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { StepsContext } from "./StepsContext";
|
|
4
|
-
export function StepsIndexBtn({ index, onClick, ...p }) {
|
|
5
|
-
const { step, setStep } = use(StepsContext);
|
|
6
|
-
return (<button disabled={step < index} onClick={ev => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
setStep(index);
|
|
9
|
-
}} {...p}/>);
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { StepsContext } from "./StepsContext";
|
|
4
|
-
export function StepsNextBtn({ onClick, disabled, ...p }) {
|
|
5
|
-
const { step, steps, nextStep } = use(StepsContext);
|
|
6
|
-
return (<button disabled={disabled || step === steps.length} onClick={ev => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
nextStep();
|
|
9
|
-
}} {...p}/>);
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { StepsContext } from "./StepsContext";
|
|
4
|
-
export function StepsPrevBtn({ onClick, disabled, ...p }) {
|
|
5
|
-
const { step, prevStep } = use(StepsContext);
|
|
6
|
-
return (<button disabled={disabled || step === 1} onClick={ev => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
prevStep();
|
|
9
|
-
}} {...p}/>);
|
|
10
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useRouter, useSearchParams } from "next/navigation";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { StepsContext } from "./StepsContext";
|
|
5
|
-
export function StepsSearchParamsRoot({ children, steps, stepKey }) {
|
|
6
|
-
const router = useRouter();
|
|
7
|
-
const searchParams = useSearchParams();
|
|
8
|
-
const [currentStep, setCurrentStep] = useState(1);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setCurrentStep(+(searchParams.get(stepKey || "step") || "1"));
|
|
11
|
-
}, [stepKey, searchParams]);
|
|
12
|
-
const pushRouter = (page) => {
|
|
13
|
-
const params = new URLSearchParams(searchParams.toString());
|
|
14
|
-
params.set(stepKey || "step", page.toString());
|
|
15
|
-
router.push("?" + params.toString());
|
|
16
|
-
};
|
|
17
|
-
const nextStep = () => {
|
|
18
|
-
if (currentStep < steps.length) {
|
|
19
|
-
pushRouter(currentStep + 1);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const prevStep = () => {
|
|
23
|
-
if (currentStep > 1) {
|
|
24
|
-
pushRouter(currentStep - 1);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return (<StepsContext.Provider value={{ step: currentStep, setStep: setCurrentStep, steps, nextStep, prevStep }}>
|
|
28
|
-
{children}
|
|
29
|
-
</StepsContext.Provider>);
|
|
30
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { StepsContext } from "./StepsContext";
|
|
4
|
-
export function StepsStateRoot({ children, steps }) {
|
|
5
|
-
const [step, setStep] = useState(1);
|
|
6
|
-
const nextStep = () => setStep(prev => prev + 1);
|
|
7
|
-
const prevStep = () => setStep(prev => prev - 1);
|
|
8
|
-
return (<StepsContext.Provider value={{ step, setStep, steps, nextStep, prevStep }}>
|
|
9
|
-
{children}
|
|
10
|
-
</StepsContext.Provider>);
|
|
11
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { AnimatePresence } from "framer-motion";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { SwapContext } from "./SwapContext";
|
|
5
|
-
export function SwapRoot({ items, defaultItem, onSwap, ...p }) {
|
|
6
|
-
const [activeItem, setActiveItem] = useState(defaultItem || items[1]);
|
|
7
|
-
const handleSwap = (newItem) => {
|
|
8
|
-
setActiveItem(newItem);
|
|
9
|
-
onSwap?.(newItem);
|
|
10
|
-
};
|
|
11
|
-
return (<SwapContext value={{ items, activeItem, handleSwap }}>
|
|
12
|
-
<AnimatePresence mode="wait">
|
|
13
|
-
<div {...p}/>
|
|
14
|
-
</AnimatePresence>
|
|
15
|
-
</SwapContext>);
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { SwapContext } from "./SwapContext";
|
|
4
|
-
export function SwapTrigger({ item, onClick, ...p }) {
|
|
5
|
-
const { items, activeItem, handleSwap } = use(SwapContext);
|
|
6
|
-
return (activeItem === item ? (<button onClick={ev => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
{
|
|
9
|
-
const nextIndex = items.indexOf(item) + 1 >= items.length ? 0 : items.indexOf(item) + 1;
|
|
10
|
-
const nextItem = items[nextIndex];
|
|
11
|
-
if (nextItem !== undefined) {
|
|
12
|
-
handleSwap(nextItem);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}} {...p}/>) : null);
|
|
16
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { TabsContext } from "./TabsContext";
|
|
4
|
-
export function TabsPanel({ value, ...p }) {
|
|
5
|
-
const { activeTab } = use(TabsContext);
|
|
6
|
-
const isActive = activeTab === value;
|
|
7
|
-
return isActive ? <div {...p}/> : null;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { use } from "react";
|
|
3
|
-
import { TabsContext } from "./TabsContext";
|
|
4
|
-
export function TabsTab({ value, onClick, ...props }) {
|
|
5
|
-
const { setActiveTab } = use(TabsContext);
|
|
6
|
-
return (<button onClick={(ev) => {
|
|
7
|
-
onClick?.(ev);
|
|
8
|
-
setActiveTab(value);
|
|
9
|
-
}} {...props}/>);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToastBox.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastBox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,cAAc,+BAwCjD"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../utils";
|
|
2
|
-
import { CheckIcon, CircleAlertIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
3
|
-
export function ToastBox({ toast }) {
|
|
4
|
-
let toastIcon = null;
|
|
5
|
-
switch (toast.status) {
|
|
6
|
-
case "info": {
|
|
7
|
-
toastIcon = <CircleAlertIcon className="toast-icon-info"/>;
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
10
|
-
case "success": {
|
|
11
|
-
toastIcon = <CheckIcon className="toast-icon-success"/>;
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
case "warning": {
|
|
15
|
-
toastIcon = <TriangleAlertIcon className="toast-icon-warning"/>;
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
case "error": {
|
|
19
|
-
toastIcon = <XIcon className="toast-icon-error"/>;
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
default: {
|
|
23
|
-
toastIcon = null;
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return (<div className={cn(toast.variant || "toast-fill", toast.size)}>
|
|
28
|
-
{toastIcon}
|
|
29
|
-
{toast.data}
|
|
30
|
-
{toast.action}
|
|
31
|
-
</div>);
|
|
32
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export type ToastT = {
|
|
3
|
-
id: string;
|
|
4
|
-
data: ReactNode;
|
|
5
|
-
status?: "info" | "success" | "warning" | "error";
|
|
6
|
-
variant?: "toast-fill" | "toast-glass";
|
|
7
|
-
size?: "toast-sm" | "toast-lg";
|
|
8
|
-
action?: ReactNode;
|
|
9
|
-
duration?: number;
|
|
10
|
-
};
|
|
11
|
-
export type ToastRootT = {
|
|
12
|
-
defaultDuration?: ToastT["duration"];
|
|
13
|
-
};
|
|
14
|
-
export declare function ToastRoot({ defaultDuration }: ToastRootT): import("react").ReactPortal | null;
|
|
15
|
-
//# sourceMappingURL=ToastRoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToastRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/ToastRoot.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAM7C,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAClD,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;IACvC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;CACtC,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,eAAe,EAAE,EAAE,UAAU,sCA8CxD"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { useMounted } from "@mantine/hooks";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
6
|
-
import { ToastBox } from "./ToastBox";
|
|
7
|
-
import { useToastStore } from "./toastStore";
|
|
8
|
-
export function ToastRoot({ defaultDuration }) {
|
|
9
|
-
const mounted = useMounted();
|
|
10
|
-
const toasts = useToastStore(store => store.toasts);
|
|
11
|
-
const remove = useToastStore(store => store.remove);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (!toasts.length) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
;
|
|
17
|
-
const lastToast = toasts[toasts.length - 1];
|
|
18
|
-
if (lastToast) {
|
|
19
|
-
const duration = lastToast?.duration || defaultDuration || 2_000;
|
|
20
|
-
setTimeout(() => {
|
|
21
|
-
remove(lastToast.id);
|
|
22
|
-
}, duration);
|
|
23
|
-
}
|
|
24
|
-
}, [toasts]);
|
|
25
|
-
if (!mounted) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
;
|
|
29
|
-
return createPortal(<>
|
|
30
|
-
<div className="max-h-screen py-3 space-y-3 fixed top-0 left-center w-fit">
|
|
31
|
-
<AnimatePresence>
|
|
32
|
-
{toasts.toReversed().map(item => (<motion.div key={item.id} className="origin-top" initial={{ opacity: 0, y: -10, scale: 0 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, y: -10, scale: 0 }}>
|
|
33
|
-
<ToastBox toast={item}/>
|
|
34
|
-
</motion.div>))}
|
|
35
|
-
</AnimatePresence>
|
|
36
|
-
</div>
|
|
37
|
-
</>, document.body);
|
|
38
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ToastT } from "./ToastRoot";
|
|
2
|
-
type NewToastT = Omit<ToastT, "id">;
|
|
3
|
-
type UseToastStoreT = {
|
|
4
|
-
toasts: ToastT[];
|
|
5
|
-
add: (newToast: NewToastT) => void;
|
|
6
|
-
remove: (id: ToastT["id"]) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const useToastStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UseToastStoreT>>;
|
|
9
|
-
export declare const addToast: (newToast: NewToastT) => void;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=toastStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toastStore.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/toastStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,KAAK,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEpC,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,aAAa,6EAIvB,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAAI,UAAU,SAAS,SAE3C,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { nanoid } from "nanoid";
|
|
2
|
-
import { create } from "zustand";
|
|
3
|
-
export const useToastStore = create((set) => ({
|
|
4
|
-
toasts: [],
|
|
5
|
-
add: (newToast) => set(prev => ({ toasts: [...prev.toasts, { id: nanoid(), ...newToast }] })),
|
|
6
|
-
remove: id => set(prev => ({ toasts: prev.toasts.filter(item => item.id !== id) })),
|
|
7
|
-
}));
|
|
8
|
-
export const addToast = (newToast) => {
|
|
9
|
-
useToastStore.getState().add(newToast);
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/Toggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,MAAM;;CAEjB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
export type ToggleContextT = {
|
|
3
|
-
isToggled: boolean;
|
|
4
|
-
setToggled: Dispatch<SetStateAction<boolean>>;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const ToggleContext: import("react").Context<ToggleContextT>;
|
|
8
|
-
//# sourceMappingURL=ToggleContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleContext.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/ToggleContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,aAAa,yCAAsD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
export type ToggleRootPropsT = PropsWithChildren & {
|
|
3
|
-
defaultToggled?: boolean;
|
|
4
|
-
onChange?: (toggled: boolean) => void;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function ToggleRoot({ children, defaultToggled, disabled, onChange }: ToggleRootPropsT): import("react").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=ToggleRoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Toggle/ToggleRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAY,MAAM,OAAO,CAAA;AAInD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAsB,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAa5G"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { ToggleContext } from "./ToggleContext";
|
|
4
|
-
export function ToggleRoot({ children, defaultToggled = false, disabled = false, onChange }) {
|
|
5
|
-
const [isToggled, setToggled] = useState(defaultToggled);
|
|
6
|
-
const handleToggle = (newValue) => {
|
|
7
|
-
setToggled(newValue);
|
|
8
|
-
onChange?.(newValue);
|
|
9
|
-
};
|
|
10
|
-
return (<ToggleContext value={{ isToggled, disabled, setToggled: () => handleToggle }}>
|
|
11
|
-
{children}
|
|
12
|
-
</ToggleContext>);
|
|
13
|
-
}
|