@kadoui/react 1.10.15 → 1.11.16

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.
Files changed (70) hide show
  1. package/README.md +679 -679
  2. package/dist/components/Choice/Choice.d.ts +6 -0
  3. package/dist/components/Choice/Choice.d.ts.map +1 -0
  4. package/dist/components/Choice/Choice.js +5 -0
  5. package/dist/components/Choice/ChoiceContext.d.ts +18 -0
  6. package/dist/components/Choice/ChoiceContext.d.ts.map +1 -0
  7. package/dist/components/Choice/ChoiceContext.js +3 -0
  8. package/dist/components/Choice/ChoiceRoot.d.ts +6 -0
  9. package/dist/components/Choice/ChoiceRoot.d.ts.map +1 -0
  10. package/dist/components/Choice/ChoiceRoot.js +6 -0
  11. package/dist/components/Choice/ChoiceTrigger.d.ts +7 -0
  12. package/dist/components/Choice/ChoiceTrigger.d.ts.map +1 -0
  13. package/dist/components/Choice/ChoiceTrigger.js +33 -0
  14. package/dist/components/ThemeAdapter/ThemeAdapter.js +17 -17
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/utils/browser.js +6 -6
  19. package/package.json +48 -48
  20. package/dist/components/ContextMenu/ContextMenuContent.d.ts +0 -4
  21. package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +0 -1
  22. package/dist/components/ContextMenu/ContextMenuContent.js +0 -30
  23. package/dist/components/LoaderLink/LoaderLink.d.ts +0 -6
  24. package/dist/components/LoaderLink/LoaderLink.d.ts.map +0 -1
  25. package/dist/components/LoaderLink/LoaderLink.js +0 -6
  26. package/dist/components/ShowMore/ShowMoreTrigger.d.ts +0 -4
  27. package/dist/components/ShowMore/ShowMoreTrigger.d.ts.map +0 -1
  28. package/dist/components/ShowMore/ShowMoreTrigger.js +0 -14
  29. package/dist/components/Steps/Steps.d.ts +0 -19
  30. package/dist/components/Steps/Steps.d.ts.map +0 -1
  31. package/dist/components/Steps/Steps.js +0 -14
  32. package/dist/components/Steps/StepsContext.d.ts +0 -14
  33. package/dist/components/Steps/StepsContext.d.ts.map +0 -1
  34. package/dist/components/Steps/StepsContext.js +0 -2
  35. package/dist/components/Steps/StepsCounts.d.ts +0 -4
  36. package/dist/components/Steps/StepsCounts.d.ts.map +0 -1
  37. package/dist/components/Steps/StepsCounts.js +0 -11
  38. package/dist/components/Steps/StepsIndexBtn.d.ts +0 -6
  39. package/dist/components/Steps/StepsIndexBtn.d.ts.map +0 -1
  40. package/dist/components/Steps/StepsIndexBtn.js +0 -11
  41. package/dist/components/Steps/StepsNextBtn.d.ts +0 -6
  42. package/dist/components/Steps/StepsNextBtn.d.ts.map +0 -1
  43. package/dist/components/Steps/StepsNextBtn.js +0 -11
  44. package/dist/components/Steps/StepsPrevBtn.d.ts +0 -6
  45. package/dist/components/Steps/StepsPrevBtn.d.ts.map +0 -1
  46. package/dist/components/Steps/StepsPrevBtn.js +0 -11
  47. package/dist/components/Steps/StepsRender.d.ts +0 -2
  48. package/dist/components/Steps/StepsRender.d.ts.map +0 -1
  49. package/dist/components/Steps/StepsRender.js +0 -7
  50. package/dist/components/Steps/StepsSearchParamsRoot.d.ts +0 -8
  51. package/dist/components/Steps/StepsSearchParamsRoot.d.ts.map +0 -1
  52. package/dist/components/Steps/StepsSearchParamsRoot.js +0 -29
  53. package/dist/components/Steps/StepsStateRoot.d.ts +0 -7
  54. package/dist/components/Steps/StepsStateRoot.d.ts.map +0 -1
  55. package/dist/components/Steps/StepsStateRoot.js +0 -10
  56. package/dist/components/Swap/SwapItem.d.ts +0 -4
  57. package/dist/components/Swap/SwapItem.d.ts.map +0 -1
  58. package/dist/components/Swap/SwapItem.js +0 -6
  59. package/dist/components/Swap/SwapTrigger.d.ts +0 -6
  60. package/dist/components/Swap/SwapTrigger.d.ts.map +0 -1
  61. package/dist/components/Swap/SwapTrigger.js +0 -17
  62. package/dist/next/LinkLoader/LinkLoader.d.ts +0 -6
  63. package/dist/next/LinkLoader/LinkLoader.d.ts.map +0 -1
  64. package/dist/next/LinkLoader/LinkLoader.js +0 -6
  65. package/dist/next/ThemeAdapter/ThemeAdapter.d.ts +0 -2
  66. package/dist/next/ThemeAdapter/ThemeAdapter.d.ts.map +0 -1
  67. package/dist/next/ThemeAdapter/ThemeAdapter.js +0 -22
  68. package/dist/next.d.ts +0 -3
  69. package/dist/next.d.ts.map +0 -1
  70. package/dist/next.js +0 -2
@@ -0,0 +1,6 @@
1
+ import { ChoiceRoot } from "./ChoiceRoot";
2
+ import { ChoiceTrigger } from "./ChoiceTrigger";
3
+ export declare const Choice: typeof ChoiceRoot & {
4
+ Trigger: typeof ChoiceTrigger;
5
+ };
6
+ //# sourceMappingURL=Choice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/Choice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,eAAO,MAAM,MAAM;;CAEjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ChoiceRoot } from "./ChoiceRoot";
2
+ import { ChoiceTrigger } from "./ChoiceTrigger";
3
+ export const Choice = Object.assign(ChoiceRoot, {
4
+ Trigger: ChoiceTrigger,
5
+ });
@@ -0,0 +1,18 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ type MultiModeT = {
3
+ multiple: true;
4
+ activeChoice: string[];
5
+ setActiveChoice: Dispatch<SetStateAction<string[]>>;
6
+ };
7
+ type SingleModeT = {
8
+ multiple?: false;
9
+ activeChoice: string | null;
10
+ setActiveChoice: Dispatch<SetStateAction<string | null>>;
11
+ };
12
+ type MergedModeT = SingleModeT | MultiModeT;
13
+ export type ChoiceContextT = MergedModeT & {
14
+ requiredOne?: boolean;
15
+ };
16
+ export declare const ChoiceContext: import("react").Context<ChoiceContextT>;
17
+ export {};
18
+ //# sourceMappingURL=ChoiceContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceContext.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/ChoiceContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,KAAK,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,yCAAsD,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import { createContext } from "react";
3
+ export const ChoiceContext = createContext({});
@@ -0,0 +1,6 @@
1
+ import { ComponentProps } from "react";
2
+ import { ChoiceContextT } from "./ChoiceContext";
3
+ type ChoiceRootPropsT = ComponentProps<"div"> & ChoiceContextT;
4
+ export declare function ChoiceRoot({ multiple, activeChoice, setActiveChoice, requiredOne, ...p }: ChoiceRootPropsT): import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=ChoiceRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/ChoiceRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAiB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC;AAE/D,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,WAAW,EACX,GAAG,CAAC,EACL,EAAE,gBAAgB,2CAOlB"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { ChoiceContext } from "./ChoiceContext";
4
+ export function ChoiceRoot({ multiple, activeChoice, setActiveChoice, requiredOne, ...p }) {
5
+ return (_jsx(ChoiceContext, { value: { multiple, activeChoice, setActiveChoice, requiredOne }, children: _jsx("div", { ...p }) }));
6
+ }
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ type ChoiceTriggerPropsT = ComponentProps<"button"> & {
3
+ choiceName: string;
4
+ };
5
+ export declare function ChoiceTrigger({ choiceName, onClick, ...p }: ChoiceTriggerPropsT): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ChoiceTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/ChoiceTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,KAAK,mBAAmB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACpD,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,OAAO,EACP,GAAG,CAAC,EACL,EAAE,mBAAmB,2CAiCrB"}
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { use } from "react";
4
+ import { ChoiceContext } from "./ChoiceContext";
5
+ export function ChoiceTrigger({ choiceName, onClick, ...p }) {
6
+ const { multiple, activeChoice, setActiveChoice, requiredOne } = use(ChoiceContext);
7
+ const isActive = multiple
8
+ ? activeChoice.includes(choiceName)
9
+ : activeChoice === choiceName;
10
+ return (_jsx("button", { "data-state": isActive, onClick: (ev) => {
11
+ onClick?.(ev);
12
+ if (isActive) {
13
+ if (multiple) {
14
+ if (!requiredOne || activeChoice.length > 1) {
15
+ setActiveChoice((prev) => prev.filter((item) => item !== choiceName));
16
+ }
17
+ }
18
+ else {
19
+ if (!requiredOne) {
20
+ setActiveChoice(null);
21
+ }
22
+ }
23
+ }
24
+ else {
25
+ if (multiple) {
26
+ setActiveChoice((prev) => [...prev, choiceName]);
27
+ }
28
+ else {
29
+ setActiveChoice(choiceName);
30
+ }
31
+ }
32
+ }, ...p }));
33
+ }
@@ -1,21 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- const themeScript = `
3
- (function() {
4
- try {
5
- const themeHandler = (ev) => {
6
- const theme = ev.matches ? "dark" : "light";
7
- document.querySelector("html").setAttribute("data-theme", theme);
8
- };
9
-
10
- const darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)");
11
-
12
- darkModeQuery.addEventListener("change", themeHandler)
13
-
14
- themeHandler(darkModeQuery)
15
- } catch (err) {
16
- console.log(err)
17
- }
18
- })();
2
+ const themeScript = `
3
+ (function() {
4
+ try {
5
+ const themeHandler = (ev) => {
6
+ const theme = ev.matches ? "dark" : "light";
7
+ document.querySelector("html").setAttribute("data-theme", theme);
8
+ };
9
+
10
+ const darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)");
11
+
12
+ darkModeQuery.addEventListener("change", themeHandler)
13
+
14
+ themeHandler(darkModeQuery)
15
+ } catch (err) {
16
+ console.log(err)
17
+ }
18
+ })();
19
19
  `;
20
20
  export function ThemeAdapter() {
21
21
  return _jsx("script", { dangerouslySetInnerHTML: { __html: themeScript } });
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from "./components/ShowMore/ShowMore";
22
22
  export * from "./components/Spoiler/Spoiler";
23
23
  export * from "./components/Swap/Swap";
24
24
  export * from "./components/Tabs/Tabs";
25
+ export * from "./components/Choice/Choice";
25
26
  export * from "./components/Submit/Submit";
26
27
  export * from "./components/LinkLoader/LinkLoader";
27
28
  export * from "./components/ThemeAdapter/ThemeAdapter";
@@ -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,kCAAkC,CAAC;AACjD,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"}
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,kCAAkC,CAAC;AACjD,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,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ export * from "./components/ShowMore/ShowMore";
22
22
  export * from "./components/Spoiler/Spoiler";
23
23
  export * from "./components/Swap/Swap";
24
24
  export * from "./components/Tabs/Tabs";
25
+ export * from "./components/Choice/Choice";
25
26
  export * from "./components/Submit/Submit";
26
27
  export * from "./components/LinkLoader/LinkLoader";
27
28
  export * from "./components/ThemeAdapter/ThemeAdapter";
@@ -10,12 +10,12 @@ export const getBrowserScrollbarWith = () => {
10
10
  return scrollbarWidth;
11
11
  };
12
12
  export const selectAccessibleChildren = (parent) => {
13
- const children = Array.from(parent.querySelectorAll(`
14
- a:not([tabindex="-1"]),
15
- input:not([disabled],[tabindex="-1"]),
16
- select:not([disabled],[tabindex="-1"]),
17
- textarea:not([disabled],[tabindex="-1"]),
18
- button:not([disabled],[tabindex="-1"])
13
+ const children = Array.from(parent.querySelectorAll(`
14
+ a:not([tabindex="-1"]),
15
+ input:not([disabled],[tabindex="-1"]),
16
+ select:not([disabled],[tabindex="-1"]),
17
+ textarea:not([disabled],[tabindex="-1"]),
18
+ button:not([disabled],[tabindex="-1"])
19
19
  `));
20
20
  return children;
21
21
  };
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@kadoui/react",
3
- "version": "1.10.15",
4
- "description": "Kadoui primitive components for React",
5
- "author": "FarzadVav",
6
- "license": "MIT",
7
- "type": "module",
8
- "repository": "https://github.com/FarzadVav/kadoui-react",
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "scripts": {
13
- "build": "tsc"
14
- },
15
- "exports": {
16
- ".": "./dist/index.js",
17
- "./utils": "./dist/utils.js"
18
- },
19
- "keywords": [
20
- "@kadoui/react",
21
- "kado",
22
- "ui",
23
- "react",
24
- "next",
25
- "primitive",
26
- "component"
27
- ],
28
- "dependencies": {
29
- "react": "19.1.0",
30
- "react-dom": "19.1.0",
31
- "next": "15.4.5",
32
- "@mantine/hooks": "^8.1.3",
33
- "framer-motion": "^12.23.0",
34
- "qrcode": "^1.5.4",
35
- "zustand": "^5.0.6",
36
- "nanoid": "^5.1.5",
37
- "clsx": "^2.1.1",
38
- "tailwind-merge": "^3.3.1"
39
- },
40
- "devDependencies": {
41
- "tsconfig": "workspace:*",
42
- "typescript": "^5",
43
- "@types/node": "^20",
44
- "@types/react": "^19",
45
- "@types/react-dom": "^19",
46
- "@types/qrcode": "^1.5.5"
47
- }
48
- }
1
+ {
2
+ "name": "@kadoui/react",
3
+ "version": "1.11.16",
4
+ "description": "Kadoui primitive components for React",
5
+ "author": "FarzadVav",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "repository": "https://github.com/FarzadVav/kadoui-react",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "scripts": {
13
+ "build": "tsc"
14
+ },
15
+ "exports": {
16
+ ".": "./dist/index.js",
17
+ "./utils": "./dist/utils.js"
18
+ },
19
+ "keywords": [
20
+ "@kadoui/react",
21
+ "kado",
22
+ "ui",
23
+ "react",
24
+ "next",
25
+ "primitive",
26
+ "component"
27
+ ],
28
+ "dependencies": {
29
+ "react": "19.1.0",
30
+ "react-dom": "19.1.0",
31
+ "next": "15.4.5",
32
+ "@mantine/hooks": "^8.1.3",
33
+ "framer-motion": "^12.23.0",
34
+ "qrcode": "^1.5.4",
35
+ "zustand": "^5.0.6",
36
+ "nanoid": "^5.1.5",
37
+ "clsx": "^2.1.1",
38
+ "tailwind-merge": "^3.3.1"
39
+ },
40
+ "devDependencies": {
41
+ "tsconfig": "workspace:*",
42
+ "typescript": "^5",
43
+ "@types/node": "^20",
44
+ "@types/react": "^19",
45
+ "@types/react-dom": "^19",
46
+ "@types/qrcode": "^1.5.5"
47
+ }
48
+ }
@@ -1,4 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- export type ContextMenuContentPropsT = HTMLAttributes<HTMLDivElement>;
3
- export declare function ContextMenuContent({ onContextMenu, className, ...p }: ContextMenuContentPropsT): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=ContextMenuContent.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,30 +0,0 @@
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,6 +0,0 @@
1
- import { PropsWithChildren, ReactNode } from "react";
2
- export type LoaderLinkPropsT = PropsWithChildren & {
3
- loader: ReactNode;
4
- };
5
- export declare function LoaderLink({ loader, children }: LoaderLinkPropsT): ReactNode;
6
- //# sourceMappingURL=LoaderLink.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoaderLink.d.ts","sourceRoot":"","sources":["../../../src/components/LoaderLink/LoaderLink.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,6 +0,0 @@
1
- "use client";
2
- import { useLinkStatus } from "next/link";
3
- export function LoaderLink({ loader, children }) {
4
- const { pending } = useLinkStatus();
5
- return pending ? loader : children;
6
- }
@@ -1,4 +0,0 @@
1
- import { ButtonHTMLAttributes } from "react";
2
- export type ShowMoreTriggerPropsT = ButtonHTMLAttributes<HTMLButtonElement>;
3
- export declare function ShowMoreTrigger({ onClick, style, ...p }: ShowMoreTriggerPropsT): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=ShowMoreTrigger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShowMoreTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/ShowMore/ShowMoreTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAO,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5E,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAgB9E"}
@@ -1,14 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { use } from "react";
4
- import { ShowMoreContext } from "./ShowMoreContext";
5
- export function ShowMoreTrigger({ onClick, style, ...p }) {
6
- const { setIsShowMore } = use(ShowMoreContext);
7
- return (_jsx("button", { style: {
8
- position: "relative",
9
- ...style
10
- }, onClick: ev => {
11
- onClick?.(ev);
12
- setIsShowMore(prev => !prev);
13
- }, ...p }));
14
- }
@@ -1,19 +0,0 @@
1
- import { StepsRender } from "./StepsRender";
2
- import { StepsCounts } from "./StepsCounts";
3
- import { StepsPrevBtn } from "./StepsPrevBtn";
4
- import { StepsNextBtn } from "./StepsNextBtn";
5
- import { StepsStateRoot } from "./StepsStateRoot";
6
- import { StepsSearchParamsRoot } from "./StepsSearchParamsRoot";
7
- export declare const StepsWithState: typeof StepsStateRoot & {
8
- Render: typeof StepsRender;
9
- Counts: typeof StepsCounts;
10
- PrevBtn: typeof StepsPrevBtn;
11
- NextBtn: typeof StepsNextBtn;
12
- };
13
- export declare const StepsWithSearchParams: typeof StepsSearchParamsRoot & {
14
- Render: typeof StepsRender;
15
- Counts: typeof StepsCounts;
16
- PrevBtn: typeof StepsPrevBtn;
17
- NextBtn: typeof StepsNextBtn;
18
- };
19
- //# sourceMappingURL=Steps.d.ts.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import { StepsRender } from "./StepsRender";
2
- import { StepsCounts } from "./StepsCounts";
3
- import { StepsPrevBtn } from "./StepsPrevBtn";
4
- import { StepsNextBtn } from "./StepsNextBtn";
5
- import { StepsStateRoot } from "./StepsStateRoot";
6
- import { StepsSearchParamsRoot } from "./StepsSearchParamsRoot";
7
- const baseComponents = {
8
- Render: StepsRender,
9
- Counts: StepsCounts,
10
- PrevBtn: StepsPrevBtn,
11
- NextBtn: StepsNextBtn,
12
- };
13
- export const StepsWithState = Object.assign(StepsStateRoot, baseComponents);
14
- export const StepsWithSearchParams = Object.assign(StepsSearchParamsRoot, baseComponents);
@@ -1,14 +0,0 @@
1
- import { Dispatch, ReactNode, SetStateAction } from "react";
2
- export type StepsT = {
3
- name: string;
4
- component: ReactNode;
5
- };
6
- export type StepsContextT = {
7
- step: number;
8
- steps: StepsT[];
9
- setStep: Dispatch<SetStateAction<number>>;
10
- nextStep: () => void;
11
- prevStep: () => void;
12
- };
13
- export declare const StepsContext: import("react").Context<StepsContextT>;
14
- //# sourceMappingURL=StepsContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsContext.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3E,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACtB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,wCAAoD,CAAC"}
@@ -1,2 +0,0 @@
1
- import { createContext } from "react";
2
- export const StepsContext = createContext({});
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,11 +0,0 @@
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,6 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- export type StepsIndexBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
3
- index: number;
4
- };
5
- export declare function StepsIndexBtn({ index, onClick, ...p }: StepsIndexBtnPropsT): import("react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=StepsIndexBtn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsIndexBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsIndexBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACpE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,mBAAmB,2CAa1E"}
@@ -1,11 +0,0 @@
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 StepsIndexBtn({ index, onClick, ...p }) {
6
- const { step, setStep } = use(StepsContext);
7
- return (_jsx("button", { disabled: step < index, onClick: ev => {
8
- onClick?.(ev);
9
- setStep(index);
10
- }, ...p }));
11
- }
@@ -1,6 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- export type StepsNextBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
3
- disabled?: boolean;
4
- };
5
- export declare function StepsNextBtn({ onClick, disabled, ...p }: StepsNextBtnPropsT): import("react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=StepsNextBtn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsNextBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsNextBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAa3E"}
@@ -1,11 +0,0 @@
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 StepsNextBtn({ onClick, disabled, ...p }) {
6
- const { step, steps, nextStep } = use(StepsContext);
7
- return (_jsx("button", { disabled: disabled || step === steps.length, onClick: ev => {
8
- onClick?.(ev);
9
- nextStep();
10
- }, ...p }));
11
- }
@@ -1,6 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- export type StepsPrevBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
3
- disabled?: boolean;
4
- };
5
- export declare function StepsPrevBtn({ onClick, disabled, ...p }: StepsPrevBtnPropsT): import("react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=StepsPrevBtn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsPrevBtn.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsPrevBtn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAa3E"}
@@ -1,11 +0,0 @@
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 StepsPrevBtn({ onClick, disabled, ...p }) {
6
- const { step, prevStep } = use(StepsContext);
7
- return (_jsx("button", { disabled: disabled || step === 1, onClick: ev => {
8
- onClick?.(ev);
9
- prevStep();
10
- }, ...p }));
11
- }
@@ -1,2 +0,0 @@
1
- export declare function StepsRender(): import("react").ReactNode;
2
- //# sourceMappingURL=StepsRender.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsRender.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsRender.tsx"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,8BAI1B"}
@@ -1,7 +0,0 @@
1
- "use client";
2
- import { use } from "react";
3
- import { StepsContext } from "./StepsContext";
4
- export function StepsRender() {
5
- const { step, steps } = use(StepsContext);
6
- return steps.find((_, index) => index + 1 === step)?.component;
7
- }
@@ -1,8 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- import { StepsT } from "./StepsContext";
3
- export type StepsSearchParamsRootPropsT = PropsWithChildren & {
4
- stepKey?: string;
5
- steps: StepsT[];
6
- };
7
- export declare function StepsSearchParamsRoot({ children, steps, stepKey }: StepsSearchParamsRootPropsT): import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=StepsSearchParamsRoot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsSearchParamsRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsSearchParamsRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAgB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,GAAG;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,2BAA2B,2CAgC9F"}
@@ -1,29 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useRouter, useSearchParams } from "next/navigation";
4
- import { useEffect, useState } from "react";
5
- import { StepsContext } from "./StepsContext";
6
- export function StepsSearchParamsRoot({ children, steps, stepKey }) {
7
- const router = useRouter();
8
- const searchParams = useSearchParams();
9
- const [currentStep, setCurrentStep] = useState(1);
10
- useEffect(() => {
11
- setCurrentStep(+(searchParams.get(stepKey || "step") || "1"));
12
- }, [stepKey, searchParams]);
13
- const pushRouter = (page) => {
14
- const params = new URLSearchParams(searchParams.toString());
15
- params.set(stepKey || "step", page.toString());
16
- router.push("?" + params.toString());
17
- };
18
- const nextStep = () => {
19
- if (currentStep < steps.length) {
20
- pushRouter(currentStep + 1);
21
- }
22
- };
23
- const prevStep = () => {
24
- if (currentStep > 1) {
25
- pushRouter(currentStep - 1);
26
- }
27
- };
28
- return (_jsx(StepsContext.Provider, { value: { step: currentStep, setStep: setCurrentStep, steps, nextStep, prevStep }, children: children }));
29
- }
@@ -1,7 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- import { StepsT } from "./StepsContext";
3
- export type StepsStateRootPropsT = PropsWithChildren & {
4
- steps: StepsT[];
5
- };
6
- export declare function StepsStateRoot({ children, steps }: StepsStateRootPropsT): import("react/jsx-runtime").JSX.Element;
7
- //# sourceMappingURL=StepsStateRoot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepsStateRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/StepsStateRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAgB,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG;IACrD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAA;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CAYvE"}