@kadoui/react 2.1.6 → 2.2.7

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 (166) hide show
  1. package/README.md +1 -1
  2. package/dist/react-components/AccessNavigation/AccessNavigation.d.ts +2 -2
  3. package/dist/react-components/AccessNavigation/AccessNavigation.d.ts.map +1 -1
  4. package/dist/react-components/AccessNavigation/AccessNavigation.js +8 -7
  5. package/dist/react-components/Accordion/Accordion.d.ts +4 -0
  6. package/dist/react-components/Accordion/Accordion.d.ts.map +1 -1
  7. package/dist/react-components/Accordion/Accordion.js +5 -1
  8. package/dist/react-components/Accordion/AccordionBody.d.ts +1 -1
  9. package/dist/react-components/Accordion/AccordionBody.d.ts.map +1 -1
  10. package/dist/react-components/Accordion/AccordionBody.js +6 -3
  11. package/dist/react-components/Accordion/AccordionContent.d.ts +3 -0
  12. package/dist/react-components/Accordion/AccordionContent.d.ts.map +1 -0
  13. package/dist/react-components/Accordion/AccordionContent.js +5 -0
  14. package/dist/react-components/Accordion/AccordionContext.d.ts +9 -2
  15. package/dist/react-components/Accordion/AccordionContext.d.ts.map +1 -1
  16. package/dist/react-components/Accordion/AccordionContext.js +1 -0
  17. package/dist/react-components/Accordion/AccordionItem.d.ts +3 -0
  18. package/dist/react-components/Accordion/AccordionItem.d.ts.map +1 -0
  19. package/dist/react-components/Accordion/AccordionItem.js +5 -0
  20. package/dist/react-components/Accordion/AccordionItemContext.d.ts +3 -0
  21. package/dist/react-components/Accordion/AccordionItemContext.d.ts.map +1 -0
  22. package/dist/react-components/Accordion/AccordionItemContext.js +3 -0
  23. package/dist/react-components/Accordion/AccordionRoot.d.ts +1 -1
  24. package/dist/react-components/Accordion/AccordionRoot.d.ts.map +1 -1
  25. package/dist/react-components/Accordion/AccordionRoot.js +3 -4
  26. package/dist/react-components/Accordion/AccordionToggle.d.ts +1 -1
  27. package/dist/react-components/Accordion/AccordionToggle.d.ts.map +1 -1
  28. package/dist/react-components/Accordion/AccordionToggle.js +23 -5
  29. package/dist/react-components/Accordion/accordionTypes.d.ts +21 -6
  30. package/dist/react-components/Accordion/accordionTypes.d.ts.map +1 -1
  31. package/dist/react-components/Affix/Affix.d.ts +1 -1
  32. package/dist/react-components/Affix/Affix.d.ts.map +1 -1
  33. package/dist/react-components/Affix/Affix.js +3 -2
  34. package/dist/react-components/Affix/affixTypes.d.ts +3 -1
  35. package/dist/react-components/Affix/affixTypes.d.ts.map +1 -1
  36. package/dist/react-components/Carousel/CarouselNextBtn.d.ts +1 -1
  37. package/dist/react-components/Carousel/CarouselNextBtn.d.ts.map +1 -1
  38. package/dist/react-components/Carousel/CarouselNextBtn.js +2 -2
  39. package/dist/react-components/Carousel/CarouselPrevBtn.d.ts +1 -1
  40. package/dist/react-components/Carousel/CarouselPrevBtn.d.ts.map +1 -1
  41. package/dist/react-components/Carousel/CarouselPrevBtn.js +2 -2
  42. package/dist/react-components/Choice/Choice.d.ts +0 -2
  43. package/dist/react-components/Choice/Choice.d.ts.map +1 -1
  44. package/dist/react-components/Choice/Choice.js +0 -2
  45. package/dist/react-components/Choice/ChoiceRoot.d.ts +1 -1
  46. package/dist/react-components/Choice/ChoiceRoot.d.ts.map +1 -1
  47. package/dist/react-components/Choice/ChoiceRoot.js +3 -2
  48. package/dist/react-components/Choice/ChoiceThumb.d.ts.map +1 -1
  49. package/dist/react-components/Choice/ChoiceThumb.js +1 -0
  50. package/dist/react-components/Choice/ChoiceToggle.d.ts.map +1 -1
  51. package/dist/react-components/Choice/ChoiceToggle.js +9 -9
  52. package/dist/react-components/Choice/choiceTypes.d.ts +9 -10
  53. package/dist/react-components/Choice/choiceTypes.d.ts.map +1 -1
  54. package/dist/react-components/Clipboard/Clipboard.d.ts +1 -1
  55. package/dist/react-components/Clipboard/Clipboard.d.ts.map +1 -1
  56. package/dist/react-components/Clipboard/Clipboard.js +2 -2
  57. package/dist/react-components/ContextMenu/ContextMenu.d.ts +0 -2
  58. package/dist/react-components/ContextMenu/ContextMenu.d.ts.map +1 -1
  59. package/dist/react-components/ContextMenu/ContextMenu.js +0 -2
  60. package/dist/react-components/ContextMenu/ContextMenuBody.d.ts.map +1 -1
  61. package/dist/react-components/ContextMenu/ContextMenuBody.js +5 -1
  62. package/dist/react-components/ContextMenu/ContextMenuContent.d.ts +3 -0
  63. package/dist/react-components/ContextMenu/ContextMenuContent.d.ts.map +1 -0
  64. package/dist/react-components/ContextMenu/ContextMenuContent.js +8 -0
  65. package/dist/react-components/ContextMenu/ContextMenuContext.d.ts.map +1 -1
  66. package/dist/react-components/ContextMenu/ContextMenuContext.js +1 -0
  67. package/dist/react-components/ContextMenu/ContextMenuRoot.d.ts.map +1 -1
  68. package/dist/react-components/ContextMenu/ContextMenuRoot.js +13 -2
  69. package/dist/react-components/ContextMenu/contextMenuTypes.d.ts +1 -2
  70. package/dist/react-components/ContextMenu/contextMenuTypes.d.ts.map +1 -1
  71. package/dist/react-components/Drawer/DrawerBody.js +1 -1
  72. package/dist/react-components/Drawer/DrawerContext.d.ts.map +1 -1
  73. package/dist/react-components/Drawer/DrawerContext.js +1 -0
  74. package/dist/react-components/Drawer/DrawerPortal.js +1 -1
  75. package/dist/react-components/Drawer/DrawerRoot.d.ts.map +1 -1
  76. package/dist/react-components/Drawer/DrawerRoot.js +1 -1
  77. package/dist/react-components/Drawer/DrawerToggle.d.ts +1 -1
  78. package/dist/react-components/Drawer/DrawerToggle.d.ts.map +1 -1
  79. package/dist/react-components/Drawer/DrawerToggle.js +5 -5
  80. package/dist/react-components/Drawer/drawerTypes.d.ts +3 -3
  81. package/dist/react-components/Drawer/drawerTypes.d.ts.map +1 -1
  82. package/dist/react-components/Modal/ModalPortal.d.ts.map +1 -1
  83. package/dist/react-components/Modal/ModalPortal.js +1 -1
  84. package/dist/react-components/Modal/ModalRoot.d.ts.map +1 -1
  85. package/dist/react-components/Modal/ModalRoot.js +2 -2
  86. package/dist/react-components/Modal/ModalToggle.d.ts +1 -1
  87. package/dist/react-components/Modal/ModalToggle.d.ts.map +1 -1
  88. package/dist/react-components/Modal/ModalToggle.js +5 -5
  89. package/dist/react-components/Modal/modalTypes.d.ts +3 -3
  90. package/dist/react-components/Modal/modalTypes.d.ts.map +1 -1
  91. package/dist/react-components/Otp/OtpInputs.d.ts +1 -1
  92. package/dist/react-components/Otp/OtpInputs.d.ts.map +1 -1
  93. package/dist/react-components/Otp/OtpInputs.js +2 -2
  94. package/dist/react-components/PasswordInput/PasswordInputContext.d.ts.map +1 -1
  95. package/dist/react-components/PasswordInput/PasswordInputContext.js +1 -0
  96. package/dist/react-components/PasswordInput/PasswordInputField.d.ts +1 -1
  97. package/dist/react-components/PasswordInput/PasswordInputField.d.ts.map +1 -1
  98. package/dist/react-components/PasswordInput/PasswordInputField.js +2 -2
  99. package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts +1 -1
  100. package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts.map +1 -1
  101. package/dist/react-components/PasswordInput/PasswordInputRoot.js +2 -2
  102. package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts +1 -1
  103. package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts.map +1 -1
  104. package/dist/react-components/PasswordInput/PasswordInputToggle.js +4 -4
  105. package/dist/react-components/PasswordInput/passwordInputTypes.d.ts +3 -3
  106. package/dist/react-components/PasswordInput/passwordInputTypes.d.ts.map +1 -1
  107. package/dist/react-components/Popover/Popover.d.ts +0 -2
  108. package/dist/react-components/Popover/Popover.d.ts.map +1 -1
  109. package/dist/react-components/Popover/Popover.js +0 -2
  110. package/dist/react-components/Popover/PopoverBody.d.ts +1 -1
  111. package/dist/react-components/Popover/PopoverBody.d.ts.map +1 -1
  112. package/dist/react-components/Popover/PopoverBody.js +2 -2
  113. package/dist/react-components/Popover/PopoverContext.d.ts.map +1 -1
  114. package/dist/react-components/Popover/PopoverContext.js +1 -0
  115. package/dist/react-components/Popover/PopoverRoot.d.ts.map +1 -1
  116. package/dist/react-components/Popover/PopoverRoot.js +3 -2
  117. package/dist/react-components/Popover/PopoverToggle.d.ts +1 -1
  118. package/dist/react-components/Popover/PopoverToggle.d.ts.map +1 -1
  119. package/dist/react-components/Popover/PopoverToggle.js +4 -4
  120. package/dist/react-components/Popover/popoverTypes.d.ts +4 -5
  121. package/dist/react-components/Popover/popoverTypes.d.ts.map +1 -1
  122. package/dist/react-components/SelectBox/SelectBoxInput.d.ts.map +1 -1
  123. package/dist/react-components/SelectBox/SelectBoxInput.js +1 -0
  124. package/dist/react-components/SelectBox/SelectBoxList.d.ts +1 -1
  125. package/dist/react-components/SelectBox/SelectBoxList.d.ts.map +1 -1
  126. package/dist/react-components/SelectBox/SelectBoxList.js +1 -2
  127. package/dist/react-components/SelectBox/SelectBoxRoot.d.ts.map +1 -1
  128. package/dist/react-components/SelectBox/SelectBoxRoot.js +12 -2
  129. package/dist/react-components/SelectBox/SelectBoxSearchInput.d.ts.map +1 -1
  130. package/dist/react-components/SelectBox/SelectBoxSearchInput.js +1 -0
  131. package/dist/react-components/SelectBox/selectBoxTypes.d.ts +7 -7
  132. package/dist/react-components/SelectBox/selectBoxTypes.d.ts.map +1 -1
  133. package/dist/react-components/Sheet/SheetBody.d.ts.map +1 -1
  134. package/dist/react-components/Sheet/SheetBody.js +1 -1
  135. package/dist/react-components/Sheet/SheetContext.d.ts.map +1 -1
  136. package/dist/react-components/Sheet/SheetContext.js +1 -0
  137. package/dist/react-components/Sheet/SheetPortal.js +1 -1
  138. package/dist/react-components/Sheet/SheetRoot.d.ts.map +1 -1
  139. package/dist/react-components/Sheet/SheetRoot.js +2 -2
  140. package/dist/react-components/Sheet/SheetToggle.d.ts +1 -1
  141. package/dist/react-components/Sheet/SheetToggle.d.ts.map +1 -1
  142. package/dist/react-components/Sheet/SheetToggle.js +5 -5
  143. package/dist/react-components/Sheet/sheetTypes.d.ts +3 -3
  144. package/dist/react-components/Sheet/sheetTypes.d.ts.map +1 -1
  145. package/dist/react-components/ShowMore/ShowMore.d.ts +1 -1
  146. package/dist/react-components/ShowMore/ShowMore.d.ts.map +1 -1
  147. package/dist/react-components/ShowMore/ShowMore.js +1 -1
  148. package/dist/react-components/ShowMore/ShowMoreContent.d.ts +1 -1
  149. package/dist/react-components/ShowMore/ShowMoreContent.d.ts.map +1 -1
  150. package/dist/react-components/ShowMore/ShowMoreContent.js +2 -2
  151. package/dist/react-components/ShowMore/ShowMoreContext.d.ts.map +1 -1
  152. package/dist/react-components/ShowMore/ShowMoreContext.js +1 -0
  153. package/dist/react-components/ShowMore/ShowMoreToggle.d.ts.map +1 -1
  154. package/dist/react-components/ShowMore/ShowMoreToggle.js +3 -3
  155. package/dist/react-components/ShowMore/showMoreTypes.d.ts +3 -3
  156. package/dist/react-components/ShowMore/showMoreTypes.d.ts.map +1 -1
  157. package/dist/react-components/Spoiler/SpoilerContext.d.ts.map +1 -1
  158. package/dist/react-components/Spoiler/SpoilerContext.js +1 -0
  159. package/dist/react-components/Spoiler/SpoilerRoot.js +1 -1
  160. package/dist/react-components/Spoiler/spoilerTypes.d.ts +2 -2
  161. package/dist/react-components/Spoiler/spoilerTypes.d.ts.map +1 -1
  162. package/dist/tsconfig.tsbuildinfo +1 -1
  163. package/dist/utils/browser.d.ts +1 -1
  164. package/dist/utils/browser.d.ts.map +1 -1
  165. package/dist/utils/browser.js +32 -9
  166. package/package.json +48 -49
@@ -2,13 +2,13 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { PopoverContext } from "./PopoverContext";
5
- export function PopoverToggle({ onClick, ...props }) {
5
+ export function PopoverToggle({ onClick, ...p }) {
6
6
  const { mode, toggleRef, isOpen, setOpen } = use(PopoverContext);
7
- return (_jsx("button", { ref: toggleRef, "data-state": isOpen, onClick: (ev) => {
7
+ return (_jsx("button", { type: "button", ref: toggleRef, "data-state": isOpen, onClick: (ev) => {
8
8
  onClick?.(ev);
9
9
  ev.stopPropagation();
10
10
  if (["click", "both"].includes(mode)) {
11
- setOpen((prev) => !prev);
11
+ setOpen(!isOpen);
12
12
  }
13
- }, ...props }));
13
+ }, ...p }));
14
14
  }
@@ -1,18 +1,17 @@
1
- import type { ComponentProps, Dispatch, RefObject, SetStateAction } from "react";
1
+ import type { ComponentProps, RefObject } from "react";
2
2
  import type { AccessNavigationPropsT } from "../AccessNavigation/AccessNavigation";
3
3
  export type PopoverContextT = {
4
4
  isOpen: boolean;
5
- setOpen: Dispatch<SetStateAction<boolean>>;
5
+ setOpen: (newState: boolean) => void;
6
6
  toggleRef: RefObject<HTMLButtonElement | null>;
7
7
  bodyRef: RefObject<HTMLDivElement | null>;
8
8
  mode: "click" | "hover" | "both";
9
9
  };
10
- export type PopoverRootPropsT = ComponentProps<"div"> & {
10
+ export type PopoverRootPropsT = AccessNavigationPropsT & {
11
11
  mode?: PopoverContextT["mode"];
12
12
  };
13
13
  export type PopoverBodyPropsT = ComponentProps<"div"> & {
14
14
  preventClose?: boolean;
15
15
  };
16
- export type PopoverTogglePropsT = ComponentProps<"button">;
17
- export type PopoverNavigationPropsT = AccessNavigationPropsT;
16
+ export type PopoverTogglePropsT = Omit<ComponentProps<"button">, "type">;
18
17
  //# sourceMappingURL=popoverTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popoverTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Popover/popoverTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC/C,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;I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AAQ,CAAC,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBoxInput.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,oBAAoB,2CAE7D"}
1
+ {"version":3,"file":"SelectBoxInput.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,oBAAoB,2CAE7D"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  export default function SelectBoxInput(p) {
3
4
  return _jsx("label", { ...p });
@@ -1,3 +1,3 @@
1
1
  import type { SelectBoxListPropsT } from "./selectBoxTypes";
2
- export default function SelectBoxList(p: SelectBoxListPropsT): import("react/jsx-runtime").JSX.Element | null;
2
+ export default function SelectBoxList(p: SelectBoxListPropsT): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=SelectBoxList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBoxList.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxList.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,EAAE,mBAAmB,kDAI3D"}
1
+ {"version":3,"file":"SelectBoxList.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxList.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,EAAE,mBAAmB,2CAU3D"}
@@ -2,8 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { SelectBoxContext } from "./SelectBoxContext";
5
- import { AccessNavigation } from "../AccessNavigation/AccessNavigation";
6
5
  export default function SelectBoxList(p) {
7
6
  const { inputFocused } = use(SelectBoxContext);
8
- return inputFocused ? _jsx(AccessNavigation, { focusOnMount: true, direction: "y", ...p }) : null;
7
+ return (_jsx("div", { "data-state": inputFocused, "data-access-navigation": inputFocused, ...p }));
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBoxRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxRoot.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,wBAAgB,aAAa,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,mBAAmB,2CAgClH"}
1
+ {"version":3,"file":"SelectBoxRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxRoot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,wBAAgB,aAAa,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,mBAAmB,2CA2ClH"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useRef, useState, useEffect } from "react";
4
4
  import { SelectBoxContext } from "./SelectBoxContext";
5
+ import { AccessNavigation } from "../AccessNavigation/AccessNavigation";
5
6
  export function SelectBoxRoot({ multiSelect, optionValue, setOptionValue, options, ref, ...p }) {
6
7
  const [inputFocused, setInputFocused] = useState(false);
7
8
  const [inputSearch, setInputSearch] = useState("");
@@ -12,8 +13,17 @@ export function SelectBoxRoot({ multiSelect, optionValue, setOptionValue, option
12
13
  setInputFocused(false);
13
14
  }
14
15
  };
16
+ const handleEscape = (e) => {
17
+ if (e.key === "Escape") {
18
+ setInputFocused(false);
19
+ }
20
+ };
21
+ document.addEventListener("keydown", handleEscape);
15
22
  document.addEventListener("click", handleClickOutside);
16
- return () => document.removeEventListener("click", handleClickOutside);
23
+ return () => {
24
+ document.removeEventListener("keydown", handleEscape);
25
+ document.removeEventListener("click", handleClickOutside);
26
+ };
17
27
  }, []);
18
28
  const contextValue = {
19
29
  multiSelect,
@@ -25,5 +35,5 @@ export function SelectBoxRoot({ multiSelect, optionValue, setOptionValue, option
25
35
  inputSearch,
26
36
  setInputSearch,
27
37
  };
28
- return (_jsx(SelectBoxContext, { value: contextValue, children: _jsx("div", { ref: selectBoxRootRef, ...p }) }));
38
+ return (_jsx(SelectBoxContext, { value: contextValue, children: _jsx(AccessNavigation, { ref: selectBoxRootRef, ...p }) }));
29
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBoxSearchInput.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxSearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,CAAC,EAAE,0BAA0B,2CAIzE"}
1
+ {"version":3,"file":"SelectBoxSearchInput.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/SelectBoxSearchInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,CAAC,EAAE,0BAA0B,2CAIzE"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  export default function SelectBoxSearchInput(p) {
3
4
  return (_jsx("label", { ...p }));
@@ -1,4 +1,4 @@
1
- import type { ComponentProps, ComponentPropsWithoutRef, Dispatch, RefObject, SetStateAction } from "react";
1
+ import type { ComponentProps, RefObject } from "react";
2
2
  import type { AccessNavigationPropsT } from "../AccessNavigation/AccessNavigation";
3
3
  export type SelectBoxOptionT = {
4
4
  name: string;
@@ -7,22 +7,22 @@ export type SelectBoxOptionT = {
7
7
  export type WithMultiSelect = {
8
8
  multiSelect: true;
9
9
  optionValue: SelectBoxOptionT[];
10
- setOptionValue: Dispatch<SetStateAction<SelectBoxOptionT[]>>;
10
+ setOptionValue: (newOptionValue: SelectBoxOptionT[]) => void;
11
11
  };
12
12
  export type WithSingleSelect = {
13
13
  multiSelect?: false;
14
14
  optionValue: SelectBoxOptionT | null;
15
- setOptionValue: Dispatch<SetStateAction<SelectBoxOptionT | null>>;
15
+ setOptionValue: (newOptionValue: SelectBoxOptionT | null) => void;
16
16
  };
17
17
  export type MergedSelectMode = WithMultiSelect | WithSingleSelect;
18
18
  export type SelectBoxContextT = MergedSelectMode & {
19
19
  inputFocused: boolean;
20
- setInputFocused: Dispatch<SetStateAction<boolean>>;
20
+ setInputFocused: (newState: boolean) => void;
21
21
  inputSearch: string;
22
- setInputSearch: Dispatch<SetStateAction<string>>;
22
+ setInputSearch: (newInputSearch: string) => void;
23
23
  options: SelectBoxOptionT[];
24
24
  };
25
- export type SelectBoxRootPropsT = ComponentPropsWithoutRef<"div"> & MergedSelectMode & {
25
+ export type SelectBoxRootPropsT = AccessNavigationPropsT & MergedSelectMode & {
26
26
  ref?: RefObject<HTMLDivElement | null>;
27
27
  options: SelectBoxOptionT[];
28
28
  };
@@ -30,6 +30,6 @@ export type SelectBoxFieldPropsT = ComponentProps<"input">;
30
30
  export type SelectBoxSearchFieldPropsT = ComponentProps<"input">;
31
31
  export type SelectBoxSearchInputPropsT = ComponentProps<"label">;
32
32
  export type SelectBoxInputPropsT = ComponentProps<"label">;
33
- export type SelectBoxListPropsT = Omit<AccessNavigationPropsT, "direction" | "focusOnMount">;
33
+ export type SelectBoxListPropsT = ComponentProps<"div">;
34
34
  export type SelectBoxOptionsPropsT = ComponentProps<"button">;
35
35
  //# sourceMappingURL=selectBoxTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectBoxTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/SelectBox/selectBoxTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,QAAQ,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M,cAAc,CAAC;AAEpD,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,eAAe,2CAqDjE"}
1
+ {"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetBody.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,eAAe,2CAqDjE"}
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use, useEffect, useRef } from "react";
4
4
  import { motion, useDragControls } from "framer-motion";
5
- import { FRAMER_MOTION_DURATION } from "../../configs";
6
5
  import { SheetContext } from "./SheetContext";
6
+ import { FRAMER_MOTION_DURATION } from "../../configs";
7
7
  export function SheetBody({ onPointerDown, ...p }) {
8
8
  const controls = useDragControls();
9
9
  const { isOpen, y, closeHandler: handleClose } = use(SheetContext);
@@ -1 +1 @@
1
- {"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,MAAM,YAAY,wCAAoD,CAAC"}
1
+ {"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,MAAM,YAAY,wCAAoD,CAAC"}
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import { createContext } from "react";
2
3
  export const SheetContext = createContext({});
@@ -2,9 +2,9 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { AnimatePresence, motion } from "framer-motion";
5
- import { ClientOnly } from "../ClientOnly/ClientOnly";
6
5
  import { Portal } from "../Portal/Portal";
7
6
  import { SheetContext } from "./SheetContext";
7
+ import { ClientOnly } from "../ClientOnly/ClientOnly";
8
8
  export function SheetPortal(p) {
9
9
  const { isOpen, closeHandler: handleClose, scope } = use(SheetContext);
10
10
  return (_jsx(ClientOnly, { children: _jsx(Portal, { children: _jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { ref: scope, onClick: handleClose, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, ...p })) : null }) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"SheetRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetRoot.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAkEtD"}
1
+ {"version":3,"file":"SheetRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetRoot.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAkEtD"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
3
4
  import { usePathname } from "next/navigation";
4
5
  import { useMotionValue, useAnimate } from "framer-motion";
5
- import { useEffect, useState } from "react";
6
- import { getBrowserScrollbarWith } from "../../utils-exports";
7
6
  import { SheetContext } from "./SheetContext";
7
+ import { getBrowserScrollbarWith } from "../../utils-exports";
8
8
  export function SheetRoot({ children }) {
9
9
  const pathname = usePathname();
10
10
  const y = useMotionValue(0);
@@ -1,3 +1,3 @@
1
1
  import type { SheetTogglePropsT } from "./sheetTypes";
2
- export declare function SheetToggle({ onClick, ...props }: SheetTogglePropsT): import("react/jsx-runtime").JSX.Element;
2
+ export declare function SheetToggle({ onClick, ...p }: SheetTogglePropsT): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=SheetToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SheetToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetToggle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAYnE"}
1
+ {"version":3,"file":"SheetToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/SheetToggle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,2CAa/D"}
@@ -2,10 +2,10 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { SheetContext } from "./SheetContext";
5
- export function SheetToggle({ onClick, ...props }) {
6
- const { setOpen } = use(SheetContext);
7
- return (_jsx("button", { onClick: ev => {
5
+ export function SheetToggle({ onClick, ...p }) {
6
+ const { isOpen, setOpen } = use(SheetContext);
7
+ return (_jsx("button", { type: "button", onClick: ev => {
8
8
  onClick?.(ev);
9
- setOpen(prev => !prev);
10
- }, ...props }));
9
+ setOpen(!isOpen);
10
+ }, ...p }));
11
11
  }
@@ -1,8 +1,8 @@
1
+ import type { ComponentProps, PropsWithChildren } from "react";
1
2
  import type { AnimationScope, MotionValue, HTMLMotionProps } from "framer-motion";
2
- import type { ComponentProps, Dispatch, PropsWithChildren, SetStateAction } from "react";
3
3
  export type SheetContextT = {
4
4
  isOpen: boolean;
5
- setOpen: Dispatch<SetStateAction<boolean>>;
5
+ setOpen: (newState: boolean) => void;
6
6
  closeHandler: () => void;
7
7
  scope?: AnimationScope<any>;
8
8
  y?: MotionValue<number>;
@@ -12,6 +12,6 @@ export type SheetBodyPropsT = HTMLMotionProps<"div">;
12
12
  export type SheetContentPropsT = ComponentProps<"div">;
13
13
  export type SheetHeaderPropsT = ComponentProps<"div">;
14
14
  export type SheetHandlebarPropsT = ComponentProps<"div">;
15
- export type SheetTogglePropsT = ComponentProps<"button">;
15
+ export type SheetTogglePropsT = Omit<ComponentProps<"button">, "type">;
16
16
  export type SheetPortalPropsT = HTMLMotionProps<"div">;
17
17
  //# sourceMappingURL=sheetTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheetTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/sheetTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEzF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"sheetTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Sheet/sheetTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ShowMoreRoot } from "./ShowMoreRoot";
2
2
  import { ShowMoreFade } from "./ShowMoreFade";
3
- import { ShowMoreContent } from "./ShowMoreContent";
4
3
  import { ShowMoreToggle } from "./ShowMoreToggle";
4
+ import { ShowMoreContent } from "./ShowMoreContent";
5
5
  export declare const ShowMore: typeof ShowMoreRoot & {
6
6
  Content: typeof ShowMoreContent;
7
7
  Toggle: typeof ShowMoreToggle;
@@ -1 +1 @@
1
- {"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../../../src/react-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;AAEH,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../../../src/react-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,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,QAAQ;;;;CAInB,CAAC;AAEH,cAAc,iBAAiB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ShowMoreRoot } from "./ShowMoreRoot";
2
2
  import { ShowMoreFade } from "./ShowMoreFade";
3
- import { ShowMoreContent } from "./ShowMoreContent";
4
3
  import { ShowMoreToggle } from "./ShowMoreToggle";
4
+ import { ShowMoreContent } from "./ShowMoreContent";
5
5
  export const ShowMore = Object.assign(ShowMoreRoot, {
6
6
  Content: ShowMoreContent,
7
7
  Toggle: ShowMoreToggle,
@@ -1,3 +1,3 @@
1
1
  import type { ShowMoreContentPropsT } from "./showMoreTypes";
2
- export declare function ShowMoreContent({ children, style, ...props }: ShowMoreContentPropsT): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ShowMoreContent({ children, style, ...p }: ShowMoreContentPropsT): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=ShowMoreContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShowMoreContent.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreContent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,2CAuBnF"}
1
+ {"version":3,"file":"ShowMoreContent.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreContent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAuB/E"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
- export function ShowMoreContent({ children, style, ...props }) {
5
+ export function ShowMoreContent({ children, style, ...p }) {
6
6
  const { contentRef, shouldShowMore, isShowMore, maxHeight } = use(ShowMoreContext);
7
7
  return (_jsx("div", { ref: contentRef, style: {
8
8
  overflow: "hidden",
@@ -15,5 +15,5 @@ export function ShowMoreContent({ children, style, ...props }) {
15
15
  : maxHeight
16
16
  : "auto",
17
17
  ...style
18
- }, ...props, children: children }));
18
+ }, ...p, children: children }));
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ShowMoreContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,2CAA0D,CAAC"}
1
+ {"version":3,"file":"ShowMoreContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,2CAA0D,CAAC"}
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import { createContext } from "react";
2
3
  export const ShowMoreContext = createContext({});
@@ -1 +1 @@
1
- {"version":3,"file":"ShowMoreToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreToggle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,oBAAoB,2CAgB5E"}
1
+ {"version":3,"file":"ShowMoreToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/ShowMoreToggle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,oBAAoB,2CAkB5E"}
@@ -3,12 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { use } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
5
  export function ShowMoreToggle({ onClick, style, ...p }) {
6
- const { setIsShowMore } = use(ShowMoreContext);
7
- return (_jsx("button", { style: {
6
+ const { isShowMore, setIsShowMore } = use(ShowMoreContext);
7
+ return (_jsx("button", { type: "button", "data-state": isShowMore, style: {
8
8
  position: "relative",
9
9
  ...style
10
10
  }, onClick: ev => {
11
11
  onClick?.(ev);
12
- setIsShowMore(prev => !prev);
12
+ setIsShowMore(!isShowMore);
13
13
  }, ...p }));
14
14
  }
@@ -1,9 +1,9 @@
1
- import type { ComponentProps, Dispatch, RefObject, SetStateAction } from "react";
1
+ import type { ComponentProps, RefObject } from "react";
2
2
  export type ShowMoreContextT = {
3
3
  contentRef: RefObject<HTMLDivElement | null>;
4
4
  shouldShowMore: boolean;
5
5
  isShowMore: boolean;
6
- setIsShowMore: Dispatch<SetStateAction<boolean>>;
6
+ setIsShowMore: (newState: boolean) => void;
7
7
  maxHeight: number;
8
8
  };
9
9
  export type ShowMoreRootPropsT = ComponentProps<"div"> & {
@@ -12,5 +12,5 @@ export type ShowMoreRootPropsT = ComponentProps<"div"> & {
12
12
  };
13
13
  export type ShowMoreContentPropsT = ComponentProps<"div">;
14
14
  export type ShowMoreFadePropsT = ComponentProps<"div">;
15
- export type ShowMoreTogglePropsT = ComponentProps<"button">;
15
+ export type ShowMoreTogglePropsT = Omit<ComponentProps<"button">, "type">;
16
16
  //# sourceMappingURL=showMoreTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"showMoreTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/showMoreTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7C,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"showMoreTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/ShowMore/showMoreTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7C,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpoilerContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Spoiler/SpoilerContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,eAAO,MAAM,cAAc,0CAAuC,CAAC"}
1
+ {"version":3,"file":"SpoilerContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Spoiler/SpoilerContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,eAAO,MAAM,cAAc,0CAAuC,CAAC"}
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import { createContext } from "react";
2
3
  export const SpoilerContext = createContext({});
@@ -4,5 +4,5 @@ import { useState } from "react";
4
4
  import { SpoilerContext } from "./SpoilerContext";
5
5
  export function SpoilerRoot(p) {
6
6
  const [isOpen, setOpen] = useState(false);
7
- return (_jsx(SpoilerContext, { value: { isOpen, setOpen }, children: _jsx("span", { onClick: () => setOpen(true), "data-state": isOpen, ...p }) }));
7
+ return (_jsx(SpoilerContext, { value: { isOpen, setOpen }, children: _jsx("span", { "data-state": isOpen, onClick: () => setOpen(true), ...p }) }));
8
8
  }
@@ -1,7 +1,7 @@
1
- import type { ComponentProps, Dispatch, SetStateAction } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  export type SpoilerContextT = {
3
3
  isOpen: boolean;
4
- setOpen: Dispatch<SetStateAction<boolean>>;
4
+ setOpen: (newState: boolean) => void;
5
5
  };
6
6
  export type SpoilerRootProps = ComponentProps<"span">;
7
7
  export type SpoilerBlurPropsT = ComponentProps<"span">;
@@ -1 +1 @@
1
- {"version":3,"file":"spoilerTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Spoiler/spoilerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"spoilerTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Spoiler/spoilerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC"}