@kadoui/react 1.9.3 → 1.9.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/Breadcrumbs/BreadcrumbsItem.d.ts +2 -2
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +3 -3
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.js +1 -1
- package/dist/components/Carousel/Carousel.d.ts +4 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +5 -1
- package/dist/components/Carousel/CarouselContext.d.ts +1 -0
- package/dist/components/Carousel/CarouselContext.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselNextBtn.d.ts +4 -0
- package/dist/components/Carousel/CarouselNextBtn.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselNextBtn.js +11 -0
- package/dist/components/Carousel/CarouselPrevBtn.d.ts +4 -0
- package/dist/components/Carousel/CarouselPrevBtn.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselPrevBtn.js +11 -0
- package/dist/components/Carousel/CarouselRoot.d.ts.map +1 -1
- package/dist/components/Carousel/CarouselRoot.js +17 -5
- 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 +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/components/ContextMenu/ContextMenuBody.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuBody.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenuBody.js +29 -0
- package/dist/components/LinkLoader/LinkLoader.d.ts +6 -0
- package/dist/components/LinkLoader/LinkLoader.d.ts.map +1 -0
- package/dist/components/LinkLoader/LinkLoader.js +6 -0
- package/dist/components/Otp/OtpRoot.d.ts +2 -2
- package/dist/components/Otp/OtpRoot.d.ts.map +1 -1
- package/dist/components/Otp/OtpRoot.js +3 -2
- package/dist/components/Pagination/Pagination.d.ts +3 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +3 -1
- package/dist/components/Pagination/PaginationContext.d.ts +5 -1
- package/dist/components/Pagination/PaginationContext.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationContext.js +1 -1
- package/dist/components/Pagination/PaginationCounts.d.ts +3 -3
- package/dist/components/Pagination/PaginationCounts.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationCounts.js +7 -4
- package/dist/components/Pagination/PaginationNextBtn.js +2 -2
- package/dist/components/Pagination/PaginationPages.d.ts +2 -0
- package/dist/components/Pagination/PaginationPages.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationPages.js +7 -0
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts +3 -4
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationSearchParamsRoot.js +16 -3
- package/dist/components/Pagination/PaginationStateRoot.d.ts +2 -5
- package/dist/components/Pagination/PaginationStateRoot.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationStateRoot.js +12 -4
- package/dist/components/Pagination/PaginationTypes.d.ts +17 -0
- package/dist/components/Pagination/PaginationTypes.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationTypes.js +1 -0
- package/dist/components/Portal/Portal.d.ts +1 -1
- package/dist/components/Portal/Portal.d.ts.map +1 -1
- package/dist/components/Portal/Portal.js +4 -0
- package/dist/components/QrCode/QrCode.d.ts +4 -4
- package/dist/components/QrCode/QrCode.d.ts.map +1 -1
- package/dist/components/QrCode/QrCode.js +2 -2
- package/dist/components/ShowMore/ShowMore.d.ts +2 -2
- package/dist/components/ShowMore/ShowMore.d.ts.map +1 -1
- package/dist/components/ShowMore/ShowMore.js +2 -2
- package/dist/components/ShowMore/ShowMoreRoot.js +1 -1
- package/dist/components/ShowMore/ShowMoreToggle.d.ts +4 -0
- package/dist/components/ShowMore/ShowMoreToggle.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreToggle.js +14 -0
- package/dist/components/Steps/Steps.d.ts +3 -3
- package/dist/components/Steps/Steps.d.ts.map +1 -1
- package/dist/components/Steps/Steps.js +3 -3
- package/dist/components/Steps/StepsCounts.d.ts +4 -0
- package/dist/components/Steps/StepsCounts.d.ts.map +1 -0
- package/dist/components/Steps/StepsCounts.js +11 -0
- package/dist/components/Swap/Swap.d.ts +2 -4
- package/dist/components/Swap/Swap.d.ts.map +1 -1
- package/dist/components/Swap/Swap.js +2 -4
- package/dist/components/Swap/SwapBtn.d.ts +6 -0
- package/dist/components/Swap/SwapBtn.d.ts.map +1 -0
- package/dist/components/Swap/SwapBtn.js +16 -0
- package/dist/components/Swap/SwapContext.d.ts +4 -3
- package/dist/components/Swap/SwapContext.d.ts.map +1 -1
- package/dist/components/Swap/SwapRoot.d.ts +6 -6
- package/dist/components/Swap/SwapRoot.d.ts.map +1 -1
- package/dist/components/Swap/SwapRoot.js +2 -9
- 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 +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +2 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "react";
|
|
2
2
|
export type BreadcrumbsItemPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
|
|
3
|
+
isLastItem?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function BreadcrumbsItem({
|
|
5
|
+
export declare function BreadcrumbsItem({ isLastItem, 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,
|
|
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,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,UAAkB,EAClB,QAAQ,EACR,GAAG,CAAC,EACL,EAAE,qBAAqB,2CAUvB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { BreadcrumbsContext } from "./BreadcrumbsContext";
|
|
5
|
-
export function BreadcrumbsItem({
|
|
5
|
+
export function BreadcrumbsItem({ isLastItem = false, children, ...p }) {
|
|
6
6
|
const { separator } = use(BreadcrumbsContext);
|
|
7
|
-
return (_jsxs("div", { ...p, children:
|
|
7
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ...p, children: children }), !isLastItem && separator] }));
|
|
8
8
|
}
|
|
@@ -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,
|
|
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,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,SAA0B,EAC1B,GAAG,CAAC,EACL,EAAE,qBAAqB,2CAMvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { BreadcrumbsContext } from "./BreadcrumbsContext";
|
|
4
|
-
export function BreadcrumbsRoot({ separator = "
|
|
4
|
+
export function BreadcrumbsRoot({ separator = _jsx("span", { children: "|" }), ...p }) {
|
|
5
5
|
return (_jsx(BreadcrumbsContext, { value: { separator }, children: _jsx("nav", { ...p }) }));
|
|
6
6
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CarouselRoot } from "./CarouselRoot";
|
|
2
|
+
import { CarouselNextBtn } from "./CarouselNextBtn";
|
|
3
|
+
import { CarouselPrevBtn } from "./CarouselPrevBtn";
|
|
2
4
|
import { CarouselLeftFade } from "./CarouselLeftFade";
|
|
3
5
|
import { CarouselContainer } from "./CarouselContainer";
|
|
4
6
|
import { CarouselRightFade } from "./CarouselRightFade";
|
|
@@ -6,5 +8,7 @@ export declare const Carousel: typeof CarouselRoot & {
|
|
|
6
8
|
Container: typeof CarouselContainer;
|
|
7
9
|
LeftFade: typeof CarouselLeftFade;
|
|
8
10
|
RightFade: typeof CarouselRightFade;
|
|
11
|
+
NextBtn: typeof CarouselNextBtn;
|
|
12
|
+
PrevBtn: typeof CarouselPrevBtn;
|
|
9
13
|
};
|
|
10
14
|
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,QAAQ;;;;;;CAMnB,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { CarouselRoot } from "./CarouselRoot";
|
|
2
|
+
import { CarouselNextBtn } from "./CarouselNextBtn";
|
|
3
|
+
import { CarouselPrevBtn } from "./CarouselPrevBtn";
|
|
2
4
|
import { CarouselLeftFade } from "./CarouselLeftFade";
|
|
3
5
|
import { CarouselContainer } from "./CarouselContainer";
|
|
4
6
|
import { CarouselRightFade } from "./CarouselRightFade";
|
|
5
7
|
export const Carousel = Object.assign(CarouselRoot, {
|
|
6
8
|
Container: CarouselContainer,
|
|
7
9
|
LeftFade: CarouselLeftFade,
|
|
8
|
-
RightFade: CarouselRightFade
|
|
10
|
+
RightFade: CarouselRightFade,
|
|
11
|
+
NextBtn: CarouselNextBtn,
|
|
12
|
+
PrevBtn: CarouselPrevBtn,
|
|
9
13
|
});
|
|
@@ -3,6 +3,7 @@ export type CarouselContextPropsT = {
|
|
|
3
3
|
scrollRef: RefObject<HTMLDivElement | null>;
|
|
4
4
|
leftOpacity: number;
|
|
5
5
|
rightOpacity: number;
|
|
6
|
+
childrenWidth: number;
|
|
6
7
|
};
|
|
7
8
|
export declare const CarouselContext: import("react").Context<CarouselContextPropsT>;
|
|
8
9
|
//# sourceMappingURL=CarouselContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselContext.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CarouselContext.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAA;AAED,eAAO,MAAM,eAAe,gDAAoE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export type CarouselNextBtnPropsT = HTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
export declare function CarouselNextBtn({ onClick, ...props }: CarouselNextBtnPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=CarouselNextBtn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselNextBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselNextBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAY3E"}
|
|
@@ -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 CarouselNextBtn({ onClick, ...props }) {
|
|
6
|
+
const { scrollRef, childrenWidth } = use(CarouselContext);
|
|
7
|
+
return (_jsx("button", { onClick: (ev) => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
scrollRef.current?.scrollTo(scrollRef.current.scrollLeft + childrenWidth, 0);
|
|
10
|
+
}, ...props }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export type CarouselPrevBtnPropsT = HTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
export declare function CarouselPrevBtn({ onClick, ...props }: CarouselPrevBtnPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=CarouselPrevBtn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselPrevBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/CarouselPrevBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAEtE,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAY3E"}
|
|
@@ -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 CarouselPrevBtn({ onClick, ...props }) {
|
|
6
|
+
const { scrollRef, childrenWidth } = use(CarouselContext);
|
|
7
|
+
return (_jsx("button", { onClick: (ev) => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
scrollRef.current?.scrollTo(scrollRef.current.scrollLeft - childrenWidth, 0);
|
|
10
|
+
}, ...props }));
|
|
11
|
+
}
|
|
@@ -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,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,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,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CA+D7D"}
|
|
@@ -5,7 +5,8 @@ import { CarouselContext } from "./CarouselContext";
|
|
|
5
5
|
export function CarouselRoot({ dir, ...p }) {
|
|
6
6
|
const scrollRef = useRef(null);
|
|
7
7
|
const [leftOpacity, setLeftOpacity] = useState(0);
|
|
8
|
-
const [rightOpacity, setRightOpacity] = useState(
|
|
8
|
+
const [rightOpacity, setRightOpacity] = useState(0);
|
|
9
|
+
const [childrenWidth, setChildrenWidth] = useState(0);
|
|
9
10
|
const updateFade = () => {
|
|
10
11
|
const el = scrollRef.current;
|
|
11
12
|
if (!el)
|
|
@@ -18,9 +19,11 @@ export function CarouselRoot({ dir, ...p }) {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
const scrollRatio = Math.abs(+(scrollLeft / maxScroll));
|
|
21
|
-
const left = +
|
|
22
|
-
const right = +
|
|
23
|
-
const currentDir = (dir ||
|
|
22
|
+
const left = +Math.min(1, scrollRatio * 2).toFixed(1);
|
|
23
|
+
const right = +Math.min(1, (1 - scrollRatio) * 2).toFixed(1);
|
|
24
|
+
const currentDir = (dir ||
|
|
25
|
+
document.documentElement.getAttribute("dir") ||
|
|
26
|
+
"ltr");
|
|
24
27
|
setLeftOpacity(currentDir === "ltr" ? right : left);
|
|
25
28
|
setRightOpacity(currentDir === "ltr" ? left : right);
|
|
26
29
|
};
|
|
@@ -28,6 +31,15 @@ export function CarouselRoot({ dir, ...p }) {
|
|
|
28
31
|
const el = scrollRef.current;
|
|
29
32
|
if (!el)
|
|
30
33
|
return;
|
|
34
|
+
// Finding children width
|
|
35
|
+
const children = Array.from(el.querySelectorAll(".carousel-children"));
|
|
36
|
+
const sumChildrenWidth = children
|
|
37
|
+
.map((child) => child.scrollWidth)
|
|
38
|
+
.reduce((acc, cur) => {
|
|
39
|
+
return acc + cur;
|
|
40
|
+
}, 0);
|
|
41
|
+
const findedChildrenWidth = sumChildrenWidth / children.length;
|
|
42
|
+
setChildrenWidth(findedChildrenWidth);
|
|
31
43
|
updateFade();
|
|
32
44
|
el.addEventListener("scroll", updateFade);
|
|
33
45
|
window.addEventListener("resize", updateFade);
|
|
@@ -36,5 +48,5 @@ export function CarouselRoot({ dir, ...p }) {
|
|
|
36
48
|
window.removeEventListener("resize", updateFade);
|
|
37
49
|
};
|
|
38
50
|
}, []);
|
|
39
|
-
return (_jsx(CarouselContext, { value: { scrollRef, leftOpacity, rightOpacity }, children: _jsx("div", { ...p }) }));
|
|
51
|
+
return (_jsx(CarouselContext, { value: { scrollRef, leftOpacity, rightOpacity, childrenWidth }, children: _jsx("div", { ...p }) }));
|
|
40
52
|
}
|
|
@@ -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-runtime").JSX.Element;
|
|
7
|
+
export declare function Clipboard({ copiedChildren, onClick, children, text, title, "aria-label": ariaLabel, 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,
|
|
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,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,cAAc,EACd,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,2CAiBjB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useClipboard } from "@mantine/hooks";
|
|
4
|
-
export function Clipboard({ copiedChildren, onClick, children, text, timeout = 3_000, ...props }) {
|
|
4
|
+
export function Clipboard({ copiedChildren, onClick, children, text, title, "aria-label": ariaLabel, timeout = 3_000, ...props }) {
|
|
5
5
|
const { copy, copied } = useClipboard({ timeout });
|
|
6
6
|
const handleClick = (ev) => {
|
|
7
7
|
onClick?.(ev);
|
|
8
8
|
copy(text.trim());
|
|
9
9
|
};
|
|
10
|
-
return (_jsx("button", { "aria-label": text, onClick: handleClick, ...props, children: copiedChildren && copied ? copiedChildren : children }));
|
|
10
|
+
return (_jsx("button", { "aria-label": ariaLabel || text, title: title || text, onClick: handleClick, ...props, children: copiedChildren && copied ? copiedChildren : children }));
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextMenuRoot } from "./ContextMenuRoot";
|
|
2
|
-
import {
|
|
2
|
+
import { ContextMenuBody } from "./ContextMenuBody";
|
|
3
3
|
export declare const ContextMenu: typeof ContextMenuRoot & {
|
|
4
|
-
|
|
4
|
+
Body: typeof ContextMenuBody;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,WAAW;;CAEtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextMenuRoot } from "./ContextMenuRoot";
|
|
2
|
-
import {
|
|
2
|
+
import { ContextMenuBody } from "./ContextMenuBody";
|
|
3
3
|
export const ContextMenu = Object.assign(ContextMenuRoot, {
|
|
4
|
-
|
|
4
|
+
Body: ContextMenuBody,
|
|
5
5
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export type ContextMenuBodyPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
export declare function ContextMenuBody({ onContextMenu, ...p }: ContextMenuBodyPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=ContextMenuBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuBody.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAoC7E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use, useEffect } from "react";
|
|
4
|
+
import { selectAccessibleChildren } from "../../utils";
|
|
5
|
+
import { ContextMenuContext } from "./ContextMenuContext";
|
|
6
|
+
export function ContextMenuBody({ onContextMenu, ...p }) {
|
|
7
|
+
const { contentRef, position, isOpen } = use(ContextMenuContext);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!contentRef.current) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (isOpen) {
|
|
13
|
+
const children = selectAccessibleChildren(contentRef.current);
|
|
14
|
+
const firstChild = children[0];
|
|
15
|
+
if (!firstChild) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
firstChild.focus();
|
|
19
|
+
}
|
|
20
|
+
}, [isOpen, position, contentRef]);
|
|
21
|
+
return (_jsx("div", { ref: contentRef, "data-state": isOpen, onContextMenu: (ev) => {
|
|
22
|
+
ev.stopPropagation();
|
|
23
|
+
ev.preventDefault();
|
|
24
|
+
onContextMenu?.(ev);
|
|
25
|
+
}, style: {
|
|
26
|
+
top: position?.y,
|
|
27
|
+
left: position?.x,
|
|
28
|
+
}, ...p }));
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkLoader.d.ts","sourceRoot":"","sources":["../../../src/components/LinkLoader/LinkLoader.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,MAAM,EAAE,SAAS,CAAC;CACnB,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,aAIhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type OtpRootPropsT =
|
|
1
|
+
import { AccessNavigationPropsT } from "../AccessNavigation/AccessNavigation";
|
|
2
|
+
export type OtpRootPropsT = Omit<AccessNavigationPropsT, "direction">;
|
|
3
3
|
export declare function OtpRoot(p: OtpRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=OtpRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OtpRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Otp/OtpRoot.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEL,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;AAEtE,wBAAgB,OAAO,CAAC,CAAC,EAAE,aAAa,2CAmBvC"}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { OtpContext } from "./OtpContext";
|
|
5
|
+
import { AccessNavigation, } from "../AccessNavigation/AccessNavigation";
|
|
5
6
|
export function OtpRoot(p) {
|
|
6
7
|
const inputs = useRef([]);
|
|
7
8
|
useEffect(() => {
|
|
8
9
|
inputs.current[0]?.focus();
|
|
9
10
|
}, []);
|
|
10
11
|
const getInputsValue = () => {
|
|
11
|
-
return inputs?.current.map(input => input?.value || "").join("") || "";
|
|
12
|
+
return inputs?.current.map((input) => input?.value || "").join("") || "";
|
|
12
13
|
};
|
|
13
|
-
return (_jsx(OtpContext, { value: { inputs, getInputsValue }, children: _jsx("
|
|
14
|
+
return (_jsx(OtpContext, { value: { inputs, getInputsValue }, children: _jsx(AccessNavigation, { direction: "x", ...p }) }));
|
|
14
15
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import { PaginationPages } from "./PaginationPages";
|
|
1
2
|
import { PaginationCounts } from "./PaginationCounts";
|
|
2
3
|
import { PaginationNextBtn } from "./PaginationNextBtn";
|
|
3
4
|
import { PaginationPrevBtn } from "./PaginationPrevBtn";
|
|
4
5
|
import { PaginationStateRoot } from "./PaginationStateRoot";
|
|
5
6
|
import { PaginationSearchParamsRoot } from "./PaginationSearchParamsRoot";
|
|
6
7
|
export declare const PaginationWithState: typeof PaginationStateRoot & {
|
|
8
|
+
Pages: typeof PaginationPages;
|
|
7
9
|
Counts: typeof PaginationCounts;
|
|
8
10
|
NextBtn: typeof PaginationNextBtn;
|
|
9
11
|
PrevBtn: typeof PaginationPrevBtn;
|
|
10
12
|
};
|
|
11
13
|
export declare const PaginationWithSearchParams: typeof PaginationSearchParamsRoot & {
|
|
14
|
+
Pages: typeof PaginationPages;
|
|
12
15
|
Counts: typeof PaginationCounts;
|
|
13
16
|
NextBtn: typeof PaginationNextBtn;
|
|
14
17
|
PrevBtn: typeof PaginationPrevBtn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAS1E,eAAO,MAAM,mBAAmB;;;;;CAAqD,CAAC;AAEtF,eAAO,MAAM,0BAA0B;;;;;CAGtC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { PaginationPages } from "./PaginationPages";
|
|
1
2
|
import { PaginationCounts } from "./PaginationCounts";
|
|
2
3
|
import { PaginationNextBtn } from "./PaginationNextBtn";
|
|
3
4
|
import { PaginationPrevBtn } from "./PaginationPrevBtn";
|
|
4
5
|
import { PaginationStateRoot } from "./PaginationStateRoot";
|
|
5
6
|
import { PaginationSearchParamsRoot } from "./PaginationSearchParamsRoot";
|
|
6
7
|
const baseComponents = {
|
|
8
|
+
Pages: PaginationPages,
|
|
7
9
|
Counts: PaginationCounts,
|
|
8
10
|
NextBtn: PaginationNextBtn,
|
|
9
|
-
PrevBtn: PaginationPrevBtn
|
|
11
|
+
PrevBtn: PaginationPrevBtn,
|
|
10
12
|
};
|
|
11
13
|
export const PaginationWithState = Object.assign(PaginationStateRoot, baseComponents);
|
|
12
14
|
export const PaginationWithSearchParams = Object.assign(PaginationSearchParamsRoot, baseComponents);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { PaginationPagesT } from "./PaginationTypes";
|
|
1
3
|
export type PaginationContextT = {
|
|
4
|
+
pages?: PaginationPagesT[];
|
|
5
|
+
pagesLength: number;
|
|
2
6
|
page: number;
|
|
3
|
-
|
|
7
|
+
setPage: Dispatch<SetStateAction<number>>;
|
|
4
8
|
nextPage: () => void;
|
|
5
9
|
prevPage: () => void;
|
|
6
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationContext.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaginationContext.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,6CAE7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createContext } from
|
|
1
|
+
import { createContext } from "react";
|
|
2
2
|
export const PaginationContext = createContext({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type PaginationCountsPropsT =
|
|
3
|
-
export declare function PaginationCounts(
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
|
+
export type PaginationCountsPropsT = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">;
|
|
3
|
+
export declare function PaginationCounts({ onClick, ...p }: PaginationCountsPropsT): import("react/jsx-runtime").JSX.Element[];
|
|
4
4
|
//# sourceMappingURL=PaginationCounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationCounts.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationCounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PaginationCounts.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationCounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,CACX,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB,6CAezE"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { PaginationContext } from "./PaginationContext";
|
|
5
|
-
export function PaginationCounts(
|
|
6
|
-
const { page,
|
|
7
|
-
return (
|
|
5
|
+
export function PaginationCounts({ onClick, ...p }) {
|
|
6
|
+
const { pagesLength, page, setPage } = use(PaginationContext);
|
|
7
|
+
return Array.from({ length: pagesLength }).map((_, index) => (_jsx("button", { "data-state": index + 1 === page, onClick: (ev) => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
setPage(index + 1);
|
|
10
|
+
}, ...p, children: index + 1 }, index)));
|
|
8
11
|
}
|
|
@@ -3,8 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { PaginationContext } from "./PaginationContext";
|
|
5
5
|
export function PaginationNextBtn({ onClick, disabled, ...p }) {
|
|
6
|
-
const { page,
|
|
7
|
-
return (_jsx("button", { disabled: disabled || page ===
|
|
6
|
+
const { page, pagesLength, nextPage } = use(PaginationContext);
|
|
7
|
+
return (_jsx("button", { disabled: disabled || page === pagesLength, onClick: ev => {
|
|
8
8
|
onClick?.(ev);
|
|
9
9
|
nextPage();
|
|
10
10
|
}, ...p }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPages.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationPages.tsx"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,8BAI9B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type PaginationSearchParamsRootPropsT =
|
|
1
|
+
import { PaginationPropsT } from "./PaginationTypes";
|
|
2
|
+
export type PaginationSearchParamsRootPropsT = PaginationPropsT & {
|
|
3
3
|
pageKey?: string;
|
|
4
|
-
pageLength: number;
|
|
5
4
|
};
|
|
6
|
-
export declare function PaginationSearchParamsRoot({
|
|
5
|
+
export declare function PaginationSearchParamsRoot({ pages, pagesLength, pageKey, ...p }: PaginationSearchParamsRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=PaginationSearchParamsRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationSearchParamsRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationSearchParamsRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaginationSearchParamsRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationSearchParamsRoot.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,GAAG;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,KAAK,EACL,WAAW,EACX,OAAO,EACP,GAAG,CAAC,EACL,EAAE,gCAAgC,2CAgDlC"}
|
|
@@ -3,10 +3,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { PaginationContext } from "./PaginationContext";
|
|
6
|
-
export function PaginationSearchParamsRoot({
|
|
6
|
+
export function PaginationSearchParamsRoot({ pages, pagesLength, pageKey, ...p }) {
|
|
7
7
|
const router = useRouter();
|
|
8
8
|
const searchParams = useSearchParams();
|
|
9
9
|
const [currentPage, setCurrentPage] = useState(1);
|
|
10
|
+
const correctPagesLength = (pages?.length || pagesLength);
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
setCurrentPage(+(searchParams.get(pageKey || "page") || "1"));
|
|
12
13
|
}, [pageKey, searchParams]);
|
|
@@ -15,8 +16,13 @@ export function PaginationSearchParamsRoot({ pageKey, pageLength, children }) {
|
|
|
15
16
|
params.set(pageKey || "page", page.toString());
|
|
16
17
|
router.push("?" + params.toString());
|
|
17
18
|
};
|
|
19
|
+
const setPage = (page) => {
|
|
20
|
+
if (page !== currentPage) {
|
|
21
|
+
pushRouter(page);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
18
24
|
const nextPage = () => {
|
|
19
|
-
if (currentPage <
|
|
25
|
+
if (currentPage < correctPagesLength) {
|
|
20
26
|
pushRouter(currentPage + 1);
|
|
21
27
|
}
|
|
22
28
|
};
|
|
@@ -25,5 +31,12 @@ export function PaginationSearchParamsRoot({ pageKey, pageLength, children }) {
|
|
|
25
31
|
pushRouter(currentPage - 1);
|
|
26
32
|
}
|
|
27
33
|
};
|
|
28
|
-
return (_jsx(PaginationContext.Provider, { value: {
|
|
34
|
+
return (_jsx(PaginationContext.Provider, { value: {
|
|
35
|
+
pages,
|
|
36
|
+
page: currentPage,
|
|
37
|
+
setPage,
|
|
38
|
+
pagesLength: correctPagesLength,
|
|
39
|
+
nextPage,
|
|
40
|
+
prevPage,
|
|
41
|
+
}, children: _jsx("div", { ...p }) }));
|
|
29
42
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
pageLength: number;
|
|
4
|
-
};
|
|
5
|
-
export declare function PaginationStateRoot({ pageLength, children }: PaginationStateRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { PaginationPropsT } from "./PaginationTypes";
|
|
2
|
+
export declare function PaginationStateRoot({ pages, pagesLength, ...p }: PaginationPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
//# sourceMappingURL=PaginationStateRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationStateRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationStateRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaginationStateRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationStateRoot.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,EAAE,gBAAgB,2CAsBjF"}
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { PaginationContext } from "./PaginationContext";
|
|
5
|
-
export function PaginationStateRoot({
|
|
5
|
+
export function PaginationStateRoot({ pages, pagesLength, ...p }) {
|
|
6
6
|
const [page, setPage] = useState(1);
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const correctPagesLength = (pages?.length || pagesLength);
|
|
8
|
+
const nextPage = () => setPage((prev) => (prev < correctPagesLength ? prev + 1 : prev));
|
|
9
|
+
const prevPage = () => setPage((prev) => (prev > 1 ? prev - 1 : prev));
|
|
10
|
+
return (_jsx(PaginationContext.Provider, { value: {
|
|
11
|
+
pages,
|
|
12
|
+
page,
|
|
13
|
+
setPage,
|
|
14
|
+
pagesLength: correctPagesLength,
|
|
15
|
+
nextPage,
|
|
16
|
+
prevPage,
|
|
17
|
+
}, children: _jsx("div", { ...p }) }));
|
|
10
18
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type PaginationPagesT = {
|
|
3
|
+
name: string;
|
|
4
|
+
component: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type PaginationWithLengthT = {
|
|
7
|
+
pagesLength: number;
|
|
8
|
+
pages?: never;
|
|
9
|
+
};
|
|
10
|
+
type PaginationWithPagesT = {
|
|
11
|
+
pages: PaginationPagesT[];
|
|
12
|
+
pagesLength?: never;
|
|
13
|
+
};
|
|
14
|
+
type MergedPaginationT = PaginationWithLengthT | PaginationWithPagesT;
|
|
15
|
+
export type PaginationPropsT = HTMLAttributes<HTMLDivElement> & MergedPaginationT;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=PaginationTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationTypes.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEF,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,5 +2,5 @@ import { PropsWithChildren } from "react";
|
|
|
2
2
|
export type PortalPropsT = PropsWithChildren & {
|
|
3
3
|
container?: Element;
|
|
4
4
|
};
|
|
5
|
-
export declare function Portal({ children, container }: PortalPropsT): import("react").ReactPortal;
|
|
5
|
+
export declare function Portal({ children, container }: PortalPropsT): import("react").ReactPortal | undefined;
|
|
6
6
|
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../src/components/Portal/Portal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../src/components/Portal/Portal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,2CAM3D"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
|
+
import { useMounted } from "@mantine/hooks";
|
|
4
5
|
export function Portal({ children, container }) {
|
|
6
|
+
const isMounted = useMounted();
|
|
7
|
+
if (!isMounted)
|
|
8
|
+
return;
|
|
5
9
|
return createPortal(_jsx(_Fragment, { children: children }), container || document.body);
|
|
6
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QRCodeRenderersOptions } from "qrcode";
|
|
2
|
-
import {
|
|
3
|
-
export type QrCodePropsT =
|
|
2
|
+
import { CanvasHTMLAttributes } from "react";
|
|
3
|
+
export type QrCodePropsT = CanvasHTMLAttributes<HTMLCanvasElement> & {
|
|
4
4
|
value: string;
|
|
5
|
-
options
|
|
5
|
+
options?: QRCodeRenderersOptions;
|
|
6
6
|
};
|
|
7
|
-
export declare function QrCode({ value, options, ...
|
|
7
|
+
export declare function QrCode({ value, options, ...p }: 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,OAAO,EAAE,oBAAoB,EAAqB,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAY,EAAE,GAAG,CAAC,EAAE,EAAE,YAAY,2CAgBjE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import QRCode from "qrcode";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
|
-
export function QrCode({ value, options, ...
|
|
5
|
+
export function QrCode({ value, options = {}, ...p }) {
|
|
6
6
|
const canvasRef = useRef(null);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
console.log(value);
|
|
@@ -11,5 +11,5 @@ export function QrCode({ value, options, ...props }) {
|
|
|
11
11
|
console.error(error);
|
|
12
12
|
});
|
|
13
13
|
}, [value, options]);
|
|
14
|
-
return _jsx("canvas", { ref: canvasRef, ...
|
|
14
|
+
return (_jsx("canvas", { ref: canvasRef, ...p }));
|
|
15
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ShowMoreRoot } from "./ShowMoreRoot";
|
|
2
2
|
import { ShowMoreFade } from "./ShowMoreFade";
|
|
3
3
|
import { ShowMoreContent } from "./ShowMoreContent";
|
|
4
|
-
import {
|
|
4
|
+
import { ShowMoreToggle } from "./ShowMoreToggle";
|
|
5
5
|
export declare const ShowMore: typeof ShowMoreRoot & {
|
|
6
6
|
Content: typeof ShowMoreContent;
|
|
7
|
-
|
|
7
|
+
Toggle: typeof ShowMoreToggle;
|
|
8
8
|
Fade: typeof ShowMoreFade;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=ShowMore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,QAAQ;;;;CAInB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ShowMoreRoot } from "./ShowMoreRoot";
|
|
2
2
|
import { ShowMoreFade } from "./ShowMoreFade";
|
|
3
3
|
import { ShowMoreContent } from "./ShowMoreContent";
|
|
4
|
-
import {
|
|
4
|
+
import { ShowMoreToggle } from "./ShowMoreToggle";
|
|
5
5
|
export const ShowMore = Object.assign(ShowMoreRoot, {
|
|
6
6
|
Content: ShowMoreContent,
|
|
7
|
-
|
|
7
|
+
Toggle: ShowMoreToggle,
|
|
8
8
|
Fade: ShowMoreFade
|
|
9
9
|
});
|
|
@@ -11,7 +11,7 @@ export function ShowMoreRoot({ maxLines, defaultExpanded = false, style, ...p })
|
|
|
11
11
|
if (contentRef.current) {
|
|
12
12
|
const element = contentRef.current;
|
|
13
13
|
const lineHeight = Number.parseInt(window.getComputedStyle(element).lineHeight);
|
|
14
|
-
const maxHeight = lineHeight *
|
|
14
|
+
const maxHeight = lineHeight * maxLines;
|
|
15
15
|
const actualHeight = element.scrollHeight;
|
|
16
16
|
setMaxHeight(maxHeight);
|
|
17
17
|
setShouldShowMore(actualHeight > maxHeight);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
|
+
export type ShowMoreTogglePropsT = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
export declare function ShowMoreToggle({ onClick, style, ...p }: ShowMoreTogglePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=ShowMoreToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShowMoreToggle.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreToggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE3E,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,oBAAoB,2CAgB5E"}
|
|
@@ -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 ShowMoreToggle({ 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,18 +1,18 @@
|
|
|
1
1
|
import { StepsRender } from "./StepsRender";
|
|
2
|
+
import { StepsCounts } from "./StepsCounts";
|
|
2
3
|
import { StepsPrevBtn } from "./StepsPrevBtn";
|
|
3
4
|
import { StepsNextBtn } from "./StepsNextBtn";
|
|
4
|
-
import { StepsIndexBtn } from "./StepsIndexBtn";
|
|
5
5
|
import { StepsStateRoot } from "./StepsStateRoot";
|
|
6
6
|
import { StepsSearchParamsRoot } from "./StepsSearchParamsRoot";
|
|
7
7
|
export declare const StepsWithState: typeof StepsStateRoot & {
|
|
8
8
|
Render: typeof StepsRender;
|
|
9
|
-
|
|
9
|
+
Counts: typeof StepsCounts;
|
|
10
10
|
PrevBtn: typeof StepsPrevBtn;
|
|
11
11
|
NextBtn: typeof StepsNextBtn;
|
|
12
12
|
};
|
|
13
13
|
export declare const StepsWithSearchParams: typeof StepsSearchParamsRoot & {
|
|
14
14
|
Render: typeof StepsRender;
|
|
15
|
-
|
|
15
|
+
Counts: typeof StepsCounts;
|
|
16
16
|
PrevBtn: typeof StepsPrevBtn;
|
|
17
17
|
NextBtn: typeof StepsNextBtn;
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAShE,eAAO,MAAM,cAAc;;;;;CAAgD,CAAC;AAE5E,eAAO,MAAM,qBAAqB;;;;;CAAuD,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { StepsRender } from "./StepsRender";
|
|
2
|
+
import { StepsCounts } from "./StepsCounts";
|
|
2
3
|
import { StepsPrevBtn } from "./StepsPrevBtn";
|
|
3
4
|
import { StepsNextBtn } from "./StepsNextBtn";
|
|
4
|
-
import { StepsIndexBtn } from "./StepsIndexBtn";
|
|
5
5
|
import { StepsStateRoot } from "./StepsStateRoot";
|
|
6
6
|
import { StepsSearchParamsRoot } from "./StepsSearchParamsRoot";
|
|
7
7
|
const baseComponents = {
|
|
8
8
|
Render: StepsRender,
|
|
9
|
-
|
|
9
|
+
Counts: StepsCounts,
|
|
10
10
|
PrevBtn: StepsPrevBtn,
|
|
11
|
-
NextBtn: StepsNextBtn
|
|
11
|
+
NextBtn: StepsNextBtn,
|
|
12
12
|
};
|
|
13
13
|
export const StepsWithState = Object.assign(StepsStateRoot, baseComponents);
|
|
14
14
|
export const StepsWithSearchParams = Object.assign(StepsSearchParamsRoot, baseComponents);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
|
+
export type StepsCountsPropsT = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">;
|
|
3
|
+
export declare function StepsCounts({ onClick, ...p }: StepsCountsPropsT): import("react/jsx-runtime").JSX.Element[];
|
|
4
|
+
//# sourceMappingURL=StepsCounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepsCounts.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsCounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;AAE1F,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,6CAe/D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { StepsContext } from "./StepsContext";
|
|
5
|
+
export function StepsCounts({ onClick, ...p }) {
|
|
6
|
+
const { steps, step, setStep } = use(StepsContext);
|
|
7
|
+
return Array.from({ length: steps.length }).map((_, index) => (_jsx("button", { "data-state": index + 1 === step, onClick: (ev) => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
setStep(index + 1);
|
|
10
|
+
}, ...p, children: index + 1 }, index)));
|
|
11
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SwapBtn } from "./SwapBtn";
|
|
2
2
|
import { SwapRoot } from "./SwapRoot";
|
|
3
|
-
import { SwapTrigger } from "./SwapTrigger";
|
|
4
3
|
export declare const Swap: typeof SwapRoot & {
|
|
5
|
-
|
|
6
|
-
Item: typeof SwapItem;
|
|
4
|
+
Btn: typeof SwapBtn;
|
|
7
5
|
};
|
|
8
6
|
//# sourceMappingURL=Swap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swap.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/Swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Swap.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/Swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI;;CAEf,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SwapBtn } from "./SwapBtn";
|
|
2
2
|
import { SwapRoot } from "./SwapRoot";
|
|
3
|
-
import { SwapTrigger } from "./SwapTrigger";
|
|
4
3
|
export const Swap = Object.assign(SwapRoot, {
|
|
5
|
-
|
|
6
|
-
Item: SwapItem
|
|
4
|
+
Btn: SwapBtn,
|
|
7
5
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export type SwapBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
btnKey: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function SwapBtn({ btnKey, onClick, children, ...p }: SwapBtnPropsT): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
//# sourceMappingURL=SwapBtn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwapBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/SwapBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC9D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,aAAa,kDAoBzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { SwapContext } from "./SwapContext";
|
|
5
|
+
export function SwapBtn({ btnKey, onClick, children, ...p }) {
|
|
6
|
+
const { keys, activeKey, setActiveKey } = use(SwapContext);
|
|
7
|
+
return btnKey === activeKey ? (_jsx("button", { onClick: (ev) => {
|
|
8
|
+
onClick?.(ev);
|
|
9
|
+
const nextKey = keys.indexOf(activeKey) + 1;
|
|
10
|
+
const currentNextKey = nextKey === keys.length ? 0 : nextKey;
|
|
11
|
+
const nextActiveKey = keys[currentNextKey];
|
|
12
|
+
if (nextActiveKey) {
|
|
13
|
+
setActiveKey(nextActiveKey);
|
|
14
|
+
}
|
|
15
|
+
}, ...p, children: children || keys.find((item) => item === btnKey) })) : null;
|
|
16
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
1
2
|
export type SwapContextT = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
keys: string[];
|
|
4
|
+
activeKey: string;
|
|
5
|
+
setActiveKey: Dispatch<SetStateAction<string>>;
|
|
5
6
|
};
|
|
6
7
|
export declare const SwapContext: import("react").Context<SwapContextT>;
|
|
7
8
|
//# sourceMappingURL=SwapContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapContext.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/SwapContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapContext.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/SwapContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,WAAW,uCAAkD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type SwapRootPropsT =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Dispatch, PropsWithChildren, SetStateAction } from "react";
|
|
2
|
+
export type SwapRootPropsT = PropsWithChildren & {
|
|
3
|
+
keys: string[];
|
|
4
|
+
activeKey: string;
|
|
5
|
+
setActiveKey: Dispatch<SetStateAction<string>>;
|
|
6
6
|
};
|
|
7
|
-
export declare function SwapRoot({
|
|
7
|
+
export declare function SwapRoot({ keys, activeKey, setActiveKey, children }: SwapRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=SwapRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/SwapRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Swap/SwapRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIpE,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC/C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,cAAc,2CAEnF"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { AnimatePresence } from "framer-motion";
|
|
4
|
-
import { useState } from "react";
|
|
5
3
|
import { SwapContext } from "./SwapContext";
|
|
6
|
-
export function SwapRoot({
|
|
7
|
-
|
|
8
|
-
const handleSwap = (newItem) => {
|
|
9
|
-
setActiveItem(newItem);
|
|
10
|
-
onSwap?.(newItem);
|
|
11
|
-
};
|
|
12
|
-
return (_jsx(SwapContext, { value: { items, activeItem, handleSwap }, children: _jsx(AnimatePresence, { mode: "wait", children: _jsx("div", { ...p }) }) }));
|
|
4
|
+
export function SwapRoot({ keys, activeKey, setActiveKey, children }) {
|
|
5
|
+
return _jsx(SwapContext, { value: { keys, activeKey, setActiveKey }, children: children });
|
|
13
6
|
}
|
|
@@ -2,5 +2,5 @@ import { type HTMLAttributes } from "react";
|
|
|
2
2
|
export type TabsTabPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
value: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function TabsTab({ value, onClick, ...
|
|
5
|
+
export declare function TabsTab({ value, onClick, ...p }: TabsTabPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=TabsTab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsTab.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/TabsTab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf,
|
|
1
|
+
{"version":3,"file":"TabsTab.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/TabsTab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,aAAa,2CAa9D"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { TabsContext } from "./TabsContext";
|
|
5
|
-
export function TabsTab({ value, onClick, ...
|
|
6
|
-
const { setActiveTab } = use(TabsContext);
|
|
7
|
-
return (_jsx("button", { onClick: (ev) => {
|
|
5
|
+
export function TabsTab({ value, onClick, ...p }) {
|
|
6
|
+
const { activeTab, setActiveTab } = use(TabsContext);
|
|
7
|
+
return (_jsx("button", { "data-state": value === activeTab, onClick: (ev) => {
|
|
8
8
|
onClick?.(ev);
|
|
9
9
|
setActiveTab(value);
|
|
10
|
-
}, ...
|
|
10
|
+
}, ...p }));
|
|
11
11
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,9 @@ export * from "./components/Rating/Rating";
|
|
|
19
19
|
export * from "./components/Sheet/Sheet";
|
|
20
20
|
export * from "./components/ShowMore/ShowMore";
|
|
21
21
|
export * from "./components/Spoiler/Spoiler";
|
|
22
|
-
export * from "./components/Steps/Steps";
|
|
23
22
|
export * from "./components/Swap/Swap";
|
|
24
23
|
export * from "./components/Tabs/Tabs";
|
|
25
24
|
export * from "./components/Submit/Submit";
|
|
25
|
+
export * from "./components/LinkLoader/LinkLoader";
|
|
26
|
+
export * from "./components/ThemeAdapter/ThemeAdapter";
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,8 @@ export * from "./components/Rating/Rating";
|
|
|
19
19
|
export * from "./components/Sheet/Sheet";
|
|
20
20
|
export * from "./components/ShowMore/ShowMore";
|
|
21
21
|
export * from "./components/Spoiler/Spoiler";
|
|
22
|
-
export * from "./components/Steps/Steps";
|
|
23
22
|
export * from "./components/Swap/Swap";
|
|
24
23
|
export * from "./components/Tabs/Tabs";
|
|
25
24
|
export * from "./components/Submit/Submit";
|
|
25
|
+
export * from "./components/LinkLoader/LinkLoader";
|
|
26
|
+
export * from "./components/ThemeAdapter/ThemeAdapter";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadoui/react",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.6",
|
|
4
4
|
"description": "Kadoui primitive components for React",
|
|
5
5
|
"author": "FarzadVav",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./dist/index.js",
|
|
17
|
-
"./utils": "./dist/utils.js"
|
|
18
|
-
"./next": "./dist/next.js"
|
|
17
|
+
"./utils": "./dist/utils.js"
|
|
19
18
|
},
|
|
20
19
|
"keywords": [
|
|
21
20
|
"@kadoui/react",
|