@kadoui/react 1.0.0 → 1.0.1

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 (179) hide show
  1. package/README.md +1 -0
  2. package/dist/components/AccessNavigation/AccessNavigation.d.ts.map +1 -1
  3. package/dist/components/AccessNavigation/AccessNavigation.jsx +1 -1
  4. package/dist/components/Accordion/AccordionBody.jsx +1 -1
  5. package/dist/components/Affix/Affix.jsx +1 -1
  6. package/dist/components/Breadcrumbs/BreadcrumbsItem.jsx +1 -1
  7. package/dist/components/Breadcrumbs/BreadcrumbsRoot.jsx +1 -1
  8. package/dist/components/Carousel/CarouselContainer.jsx +1 -1
  9. package/dist/components/Carousel/CarouselRoot.jsx +1 -1
  10. package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/ContextMenuContent.jsx +2 -1
  12. package/dist/components/ContextMenu/ContextMenuRoot.d.ts.map +1 -1
  13. package/dist/components/ContextMenu/ContextMenuRoot.jsx +1 -1
  14. package/dist/components/Drawer/DrawerBody.jsx +1 -1
  15. package/dist/components/Drawer/DrawerPortal.jsx +1 -1
  16. package/dist/components/Drawer/DrawerRoot.jsx +1 -1
  17. package/dist/components/Dropdown/DropdownMenu.d.ts.map +1 -1
  18. package/dist/components/Dropdown/DropdownMenu.jsx +1 -1
  19. package/dist/components/Dropdown/DropdownRoot.d.ts.map +1 -1
  20. package/dist/components/Dropdown/DropdownRoot.jsx +2 -1
  21. package/dist/components/LinkLoader/LinkLoader.jsx +1 -1
  22. package/dist/components/Modal/ModalBody.jsx +1 -1
  23. package/dist/components/Modal/ModalContent.jsx +1 -1
  24. package/dist/components/Modal/ModalHeader.jsx +1 -1
  25. package/dist/components/Modal/ModalPortal.jsx +1 -1
  26. package/dist/components/Modal/ModalRoot.d.ts.map +1 -1
  27. package/dist/components/Modal/ModalRoot.jsx +1 -1
  28. package/dist/components/Otp/OtpInputs.jsx +1 -1
  29. package/dist/components/Otp/OtpRoot.jsx +1 -1
  30. package/dist/components/Progress/ProgressBar.jsx +1 -1
  31. package/dist/components/Progress/ProgressRoot.jsx +1 -1
  32. package/dist/components/Rating/RatingItems.jsx +1 -1
  33. package/dist/components/Rating/RatingRoot.jsx +1 -1
  34. package/dist/components/Sheet/SheetBody.jsx +1 -1
  35. package/dist/components/Sheet/SheetContent.jsx +1 -1
  36. package/dist/components/Sheet/SheetHeader.jsx +1 -1
  37. package/dist/components/Sheet/SheetPortal.jsx +1 -1
  38. package/dist/components/ShowMore/ShowMoreContent.jsx +1 -1
  39. package/dist/components/ShowMore/ShowMoreFade.jsx +1 -1
  40. package/dist/components/ShowMore/ShowMoreRoot.jsx +1 -1
  41. package/dist/components/ShowMore/ShowMoreTrigger.jsx +1 -1
  42. package/dist/components/Slide/SlideContent.jsx +1 -1
  43. package/dist/components/Slide/SlideHeader.jsx +1 -1
  44. package/dist/components/Slide/SlidePortal.jsx +1 -1
  45. package/dist/components/Spoiler/Spoiler.jsx +1 -1
  46. package/dist/components/Steps/StepsControls.jsx +1 -1
  47. package/dist/components/Tabs/TabsList.jsx +1 -1
  48. package/dist/components/Tabs/TabsPanel.jsx +1 -1
  49. package/dist/components/Toast/ToastBox.jsx +1 -1
  50. package/dist/index.d.ts +3 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +5 -0
  53. package/dist/utils/browser.d.ts +3 -0
  54. package/dist/utils/browser.d.ts.map +1 -0
  55. package/dist/utils/browser.js +21 -0
  56. package/dist/utils/cn.d.ts +3 -0
  57. package/dist/utils/cn.d.ts.map +1 -0
  58. package/dist/utils/cn.js +3 -0
  59. package/dist/utils/form.d.ts +2 -0
  60. package/dist/utils/form.d.ts.map +1 -0
  61. package/dist/utils/form.js +8 -0
  62. package/package.json +4 -3
  63. package/src/components/AccessNavigation/AccessNavigation.tsx +0 -46
  64. package/src/components/Accordion/Accordion.ts +0 -8
  65. package/src/components/Accordion/AccordionBody.tsx +0 -31
  66. package/src/components/Accordion/AccordionContext.ts +0 -8
  67. package/src/components/Accordion/AccordionRoot.tsx +0 -17
  68. package/src/components/Accordion/AccordionToggle.tsx +0 -29
  69. package/src/components/Affix/Affix.tsx +0 -59
  70. package/src/components/Breadcrumbs/Breadcrumbs.ts +0 -6
  71. package/src/components/Breadcrumbs/BreadcrumbsContext.ts +0 -7
  72. package/src/components/Breadcrumbs/BreadcrumbsItem.tsx +0 -24
  73. package/src/components/Breadcrumbs/BreadcrumbsRoot.tsx +0 -21
  74. package/src/components/Carousel/Carousel.ts +0 -6
  75. package/src/components/Carousel/CarouselContainer.tsx +0 -18
  76. package/src/components/Carousel/CarouselContext.ts +0 -7
  77. package/src/components/Carousel/CarouselRoot.tsx +0 -75
  78. package/src/components/ClientOnly/ClientOnly.tsx +0 -12
  79. package/src/components/Clipboard/Clipboard.tsx +0 -36
  80. package/src/components/ContextMenu/ContextMenu.ts +0 -6
  81. package/src/components/ContextMenu/ContextMenuContent.tsx +0 -51
  82. package/src/components/ContextMenu/ContextMenuContext.ts +0 -9
  83. package/src/components/ContextMenu/ContextMenuRoot.tsx +0 -79
  84. package/src/components/Drawer/Drawer.ts +0 -10
  85. package/src/components/Drawer/DrawerBody.tsx +0 -67
  86. package/src/components/Drawer/DrawerContext.ts +0 -8
  87. package/src/components/Drawer/DrawerPortal.tsx +0 -40
  88. package/src/components/Drawer/DrawerRoot.tsx +0 -45
  89. package/src/components/Drawer/DrawerToggle.tsx +0 -21
  90. package/src/components/Dropdown/Dropdown.ts +0 -8
  91. package/src/components/Dropdown/DropdownContext.ts +0 -10
  92. package/src/components/Dropdown/DropdownMenu.tsx +0 -34
  93. package/src/components/Dropdown/DropdownRoot.tsx +0 -90
  94. package/src/components/Dropdown/DropdownToggle.tsx +0 -23
  95. package/src/components/LinkLoader/LinkLoader.tsx +0 -16
  96. package/src/components/Modal/Modal.ts +0 -14
  97. package/src/components/Modal/ModalBody.tsx +0 -12
  98. package/src/components/Modal/ModalContent.tsx +0 -44
  99. package/src/components/Modal/ModalContext.ts +0 -8
  100. package/src/components/Modal/ModalHeader.tsx +0 -10
  101. package/src/components/Modal/ModalPortal.tsx +0 -40
  102. package/src/components/Modal/ModalRoot.tsx +0 -47
  103. package/src/components/Modal/ModalTrigger.tsx +0 -21
  104. package/src/components/Otp/Otp.ts +0 -8
  105. package/src/components/Otp/OtpContext.ts +0 -10
  106. package/src/components/Otp/OtpHiddenInput.tsx +0 -15
  107. package/src/components/Otp/OtpInputs.tsx +0 -86
  108. package/src/components/Otp/OtpRoot.tsx +0 -26
  109. package/src/components/Pagination/Pagination.ts +0 -15
  110. package/src/components/Pagination/PaginationContext.tsx +0 -10
  111. package/src/components/Pagination/PaginationCounts.tsx +0 -17
  112. package/src/components/Pagination/PaginationNextBtn.tsx +0 -27
  113. package/src/components/Pagination/PaginationPrevBtn.tsx +0 -27
  114. package/src/components/Pagination/PaginationSearchParamsRoot.tsx +0 -45
  115. package/src/components/Pagination/PaginationStateRoot.tsx +0 -23
  116. package/src/components/PasswordInput/PasswordInput.ts +0 -8
  117. package/src/components/PasswordInput/PasswordInputContext.tsx +0 -8
  118. package/src/components/PasswordInput/PasswordInputField.tsx +0 -15
  119. package/src/components/PasswordInput/PasswordInputRoot.tsx +0 -17
  120. package/src/components/PasswordInput/PasswordInputToggle.tsx +0 -52
  121. package/src/components/Portal/Portal.tsx +0 -17
  122. package/src/components/Progress/Progress.ts +0 -6
  123. package/src/components/Progress/ProgressBar.tsx +0 -29
  124. package/src/components/Progress/ProgressContext.ts +0 -8
  125. package/src/components/Progress/ProgressRoot.tsx +0 -22
  126. package/src/components/QrCode/QrCode.tsx +0 -22
  127. package/src/components/Rating/Rating.ts +0 -6
  128. package/src/components/Rating/RatingContext.ts +0 -8
  129. package/src/components/Rating/RatingItems.tsx +0 -50
  130. package/src/components/Rating/RatingRoot.tsx +0 -22
  131. package/src/components/Sheet/Sheet.tsx +0 -14
  132. package/src/components/Sheet/SheetBody.tsx +0 -49
  133. package/src/components/Sheet/SheetContent.tsx +0 -8
  134. package/src/components/Sheet/SheetContext.ts +0 -14
  135. package/src/components/Sheet/SheetHeader.tsx +0 -24
  136. package/src/components/Sheet/SheetPortal.tsx +0 -35
  137. package/src/components/Sheet/SheetRoot.tsx +0 -56
  138. package/src/components/Sheet/SheetToggle.tsx +0 -21
  139. package/src/components/ShowMore/ShowMore.ts +0 -10
  140. package/src/components/ShowMore/ShowMoreContent.tsx +0 -31
  141. package/src/components/ShowMore/ShowMoreContext.ts +0 -11
  142. package/src/components/ShowMore/ShowMoreFade.tsx +0 -18
  143. package/src/components/ShowMore/ShowMoreRoot.tsx +0 -37
  144. package/src/components/ShowMore/ShowMoreTrigger.tsx +0 -23
  145. package/src/components/Slide/Slide.ts +0 -12
  146. package/src/components/Slide/SlideContent.tsx +0 -8
  147. package/src/components/Slide/SlideContext.ts +0 -11
  148. package/src/components/Slide/SlideHeader.tsx +0 -10
  149. package/src/components/Slide/SlidePortal.tsx +0 -26
  150. package/src/components/Slide/SlideRoot.tsx +0 -39
  151. package/src/components/Slide/SlideToggle.tsx +0 -21
  152. package/src/components/Spoiler/Spoiler.tsx +0 -28
  153. package/src/components/Steps/Steps.ts +0 -15
  154. package/src/components/Steps/StepsContext.tsx +0 -16
  155. package/src/components/Steps/StepsControls.tsx +0 -56
  156. package/src/components/Steps/StepsNextBtn.tsx +0 -27
  157. package/src/components/Steps/StepsPrevBtn.tsx +0 -27
  158. package/src/components/Steps/StepsSearchParamsRoot.tsx +0 -45
  159. package/src/components/Steps/StepsStateRoot.tsx +0 -23
  160. package/src/components/Swap/Swap.ts +0 -8
  161. package/src/components/Swap/SwapContext.ts +0 -9
  162. package/src/components/Swap/SwapItem.tsx +0 -16
  163. package/src/components/Swap/SwapRoot.tsx +0 -29
  164. package/src/components/Swap/SwapTrigger.tsx +0 -31
  165. package/src/components/Tabs/Tabs.ts +0 -10
  166. package/src/components/Tabs/TabsContext.ts +0 -11
  167. package/src/components/Tabs/TabsList.tsx +0 -12
  168. package/src/components/Tabs/TabsPanel.tsx +0 -23
  169. package/src/components/Tabs/TabsRoot.tsx +0 -18
  170. package/src/components/Tabs/TabsTab.tsx +0 -23
  171. package/src/components/Toast/Toast.ts +0 -3
  172. package/src/components/Toast/ToastBox.tsx +0 -50
  173. package/src/components/Toast/ToastRoot.tsx +0 -71
  174. package/src/components/Toast/toastStore.ts +0 -22
  175. package/src/components/Toggle/Toggle.ts +0 -6
  176. package/src/components/Toggle/ToggleContext.ts +0 -9
  177. package/src/components/Toggle/ToggleRoot.tsx +0 -26
  178. package/src/components/Toggle/ToggleSwitch.tsx +0 -41
  179. package/src/index.ts +0 -28
package/README.md ADDED
@@ -0,0 +1 @@
1
+ ### Kadoui primitive components for React
@@ -1 +1 @@
1
- {"version":3,"file":"AccessNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/AccessNavigation/AccessNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAGtD,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,SAAe,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB,+BAoCjG"}
1
+ {"version":3,"file":"AccessNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/AccessNavigation/AccessNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAItD,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,SAAe,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,sBAAsB,+BAoCjG"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { selectAccessibleChildren } from "kadoui-utils";
2
+ import { selectAccessibleChildren } from "../../utils/browser";
3
3
  export function AccessNavigation({ direction = "y", dir, onKeyDown, ...p }) {
4
4
  const handleKeyDown = (ev) => {
5
5
  const focusableChildren = selectAccessibleChildren(ev.currentTarget);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { AnimatePresence, motion } from "framer-motion";
5
5
  import { AccordionContext } from "./AccordionContext";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { ChevronUpIcon } from "lucide-react";
4
4
  import { useState, useEffect } from "react";
5
5
  export const Affix = ({ className, onClick, "aria-label": ariaLabel, children, ...props }) => {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { BreadcrumbsContext } from "./BreadcrumbsContext";
5
5
  export function BreadcrumbsItem({ isLast = false, className, children, ...p }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { BreadcrumbsContext } from "./BreadcrumbsContext";
4
4
  export function BreadcrumbsRoot({ separator = "/", className, ...p }) {
5
5
  return (<BreadcrumbsContext value={{ separator }}>
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { CarouselContext } from "./CarouselContext";
5
5
  export function CarouselContainer({ children, className, ...p }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { CarouselContext } from "./CarouselContext";
5
5
  export function CarouselRoot({ children, className, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,wBAAwB,+BAyC9F"}
1
+ {"version":3,"file":"ContextMenuContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAOvD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,wBAAwB,+BAyC9F"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { use, useEffect } from "react";
3
- import { cn, selectAccessibleChildren } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
+ import { selectAccessibleChildren } from "../../utils/browser";
4
5
  import { ContextMenuContext } from "./ContextMenuContext";
5
6
  export function ContextMenuContent({ onContextMenu, className, ...p }) {
6
7
  const { contentRef, position, isOpen } = use(ContextMenuContext);
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAwD,MAAM,OAAO,CAAC;AAI7F,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,+BAqE7E"}
1
+ {"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwD,MAAM,OAAO,CAAC;AAK7F,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,+BAqE7E"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { getBrowserScrollbarWith } from "kadoui-utils";
3
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
+ import { getBrowserScrollbarWith } from "../../utils/browser";
4
4
  import { ContextMenuContext } from "./ContextMenuContext";
5
5
  export function ContextMenuRoot({ onContextMenu, ...p }) {
6
6
  const [position, setPosition] = useState(undefined);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { motion } from "framer-motion";
4
4
  import { use, useEffect, useRef } from "react";
5
5
  import { DrawerContext } from "./DrawerContext";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { use } from "react";
3
- import { cn } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
4
  import { motion, AnimatePresence } from "framer-motion";
5
5
  import { Portal } from "../Portal/Portal";
6
6
  import { DrawerContext } from "./DrawerContext";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { getBrowserScrollbarWith } from "kadoui-utils";
2
+ import { getBrowserScrollbarWith } from "../../utils/browser";
3
3
  import { useState, useEffect } from "react";
4
4
  import { DrawerContext } from "./DrawerContext";
5
5
  export function DrawerRoot({ children }) {
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,sCAsB1F"}
1
+ {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAO,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,sCAsB1F"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
3
2
  import { use } from "react";
3
+ import { cn } from "../../utils/cn";
4
4
  import { DropdownContext } from "./DropdownContext";
5
5
  export function DropdownMenu({ preventClose, onClick, className, ...p }) {
6
6
  const { menuRef, isOpen } = use(DropdownContext);
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAA8C,MAAM,OAAO,CAAC;AAKnF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,sBAAsB,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrD,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,+BA6EtG"}
1
+ {"version":3,"file":"DropdownRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA8C,MAAM,OAAO,CAAC;AAQnF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,sBAAsB,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrD,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,+BA6EtG"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- import { cn, selectAccessibleChildren } from "kadoui-utils";
3
2
  import { useEffect, useRef, useState } from "react";
3
+ import { cn } from "../../utils/cn";
4
+ import { selectAccessibleChildren } from "../../utils/browser";
4
5
  import { DropdownContext } from "./DropdownContext";
5
6
  export function DropdownRoot({ accessHorizontalArrows, onKeyDown, className, ...p }) {
6
7
  const [isOpen, setOpen] = useState(false);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { LoaderIcon } from "lucide-react";
4
4
  import { useLinkStatus } from "next/link";
5
5
  export function LinkLoader({ children, className }) {
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  export function ModalBody({ children, className, ...props }) {
3
3
  return (<div className={cn("py-3 px-1.5 mx-1.5 max-h-[calc(100%-4rem)] overflow-y-auto", className)} {...props}>
4
4
  {children}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use, useEffect, useRef } from "react";
4
4
  import { AnimatePresence, motion } from "framer-motion";
5
5
  import { ModalContext } from "./ModalContext";
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  export function ModalHeader({ className, ...props }) {
3
3
  return (<div className={cn("h-16 f-align px-3 bg-background rounded-t-2xl border-b border-separator sticky top-0", className)} {...props}/>);
4
4
  }
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { use } from "react";
3
- import { cn } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
4
  import { motion, AnimatePresence } from "framer-motion";
5
5
  import { Portal } from "../Portal/Portal";
6
6
  import { ModalContext } from "./ModalContext";
@@ -1 +1 @@
1
- {"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/D,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,WAAmB,EAAE,EAAE,eAAe,+BAmC3E"}
1
+ {"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM/D,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,WAAmB,EAAE,EAAE,eAAe,+BAmC3E"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { getBrowserScrollbarWith } from "kadoui-utils";
3
2
  import { useState, useEffect } from "react";
3
+ import { getBrowserScrollbarWith } from "../../utils/browser";
4
4
  import { ModalContext } from "./ModalContext";
5
5
  export function ModalRoot({ children, defaultOpen = false }) {
6
6
  const [isOpen, setOpen] = useState(defaultOpen);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { OtpContext } from "./OtpContext";
5
5
  export function OtpInputs({ className, name, length, onLastChange, ...props }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { useEffect, useRef } from "react";
4
4
  import { OtpContext } from "./OtpContext";
5
5
  export function OtpRoot({ className, ...props }) {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { use } from "react";
3
- import { cn } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
4
  import { motion } from "framer-motion";
5
5
  import { ProgressContext } from "./ProgressContext";
6
6
  export function ProgressBar({ className, duration, children, ...p }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { ProgressContext } from "./ProgressContext";
4
4
  export function ProgressRoot({ value, maxValue = 100, className, ...p }) {
5
5
  return (<ProgressContext value={{ value, maxValue }}>
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { StarIcon } from "lucide-react";
4
4
  import { use } from "react";
5
5
  import { RatingContext } from "./RatingContext";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { useState } from "react";
4
4
  import { RatingContext } from "./RatingContext";
5
5
  export const RatingRoot = ({ className, ...p }) => {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { use } from "react";
3
- import { cn } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
4
  import { motion } from "framer-motion";
5
5
  import { SheetContext } from "./SheetContext";
6
6
  export function SheetBody({ className, ...props }) {
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  export function SheetContent({ className, ...props }) {
3
3
  return <div className={cn("overflow-y-auto h-[calc(100%-1.75rem)] px-3 pb-3", className)} {...props}/>;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { SheetContext } from "./SheetContext";
5
5
  export function SheetHeader({ className, children, ...props }) {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { use } from "react";
3
- import { cn } from "kadoui-utils";
3
+ import { cn } from "../../utils/cn";
4
4
  import { AnimatePresence, motion } from "framer-motion";
5
5
  import { Portal } from "../Portal/Portal";
6
6
  import { SheetContext } from "./SheetContext";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
5
  export function ShowMoreContent({ children, className, ...props }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
5
  export function ShowMoreFade({ className, ...p }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
5
  export function ShowMoreRoot({ maxLines, defaultExpanded = false, className, ...p }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { ShowMoreContext } from "./ShowMoreContext";
5
5
  export function ShowMoreTrigger({ onClick, className, ...p }) {
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  export function SlideContent({ className, ...props }) {
3
3
  return <div className={cn("h-[calc(100dvh-5rem)] py-3 overflow-y-auto", className)} {...props}/>;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  export function SlideHeader({ className, ...props }) {
3
3
  return (<header className={cn("h-20 f-align border-b border-foreground/10", className)} {...props}/>);
4
4
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { Portal } from "../Portal/Portal";
5
5
  import { SlideContext } from "./SlideContext";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { useState } from "react";
4
4
  export function Spoiler({ children, className }) {
5
5
  const [revealed, setRevealed] = useState(false);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { StepsContext } from "./StepsContext";
5
5
  export function StepsControls({ className, ...props }) {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  export function TabsList({ className, ...props }) {
4
4
  return (<div className={cn("join-border", className)} {...props}/>);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "kadoui-utils";
2
+ import { cn } from "../../utils/cn";
3
3
  import { use } from "react";
4
4
  import { TabsContext } from "./TabsContext";
5
5
  export function TabsPanel({ value, className, ...props }) {
@@ -1,4 +1,4 @@
1
- import { cn } from "kadoui-utils";
1
+ import { cn } from "../../utils/cn";
2
2
  import { CheckIcon, CircleAlertIcon, TriangleAlertIcon, XIcon } from "lucide-react";
3
3
  export function ToastBox({ toast }) {
4
4
  let toastIcon = null;
package/dist/index.d.ts CHANGED
@@ -26,4 +26,7 @@ export * from "./components/Swap/Swap";
26
26
  export * from "./components/Tabs/Tabs";
27
27
  export * from "./components/Toast/Toast";
28
28
  export * from "./components/Toggle/Toggle";
29
+ export * from "./utils/browser";
30
+ export * from "./utils/cn";
31
+ export * from "./utils/form";
29
32
  //# sourceMappingURL=index.d.ts.map
@@ -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,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,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,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,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,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,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,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // Components
1
2
  export * from "./components/AccessNavigation/AccessNavigation";
2
3
  export * from "./components/Accordion/Accordion";
3
4
  export * from "./components/Affix/Affix";
@@ -26,3 +27,7 @@ export * from "./components/Swap/Swap";
26
27
  export * from "./components/Tabs/Tabs";
27
28
  export * from "./components/Toast/Toast";
28
29
  export * from "./components/Toggle/Toggle";
30
+ // Utils
31
+ export * from "./utils/browser";
32
+ export * from "./utils/cn";
33
+ export * from "./utils/form";
@@ -0,0 +1,3 @@
1
+ export declare const getBrowserScrollbarWith: () => number;
2
+ export declare const selectAccessibleChildren: (parent: HTMLElement) => HTMLElement[];
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/utils/browser.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,cAenC,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,QAAQ,WAAW,kBAY3D,CAAA"}
@@ -0,0 +1,21 @@
1
+ export const getBrowserScrollbarWith = () => {
2
+ const outer = document.createElement("div");
3
+ outer.style.visibility = "hidden";
4
+ outer.style.overflow = "scroll";
5
+ document.body.appendChild(outer);
6
+ const inner = document.createElement("div");
7
+ outer.appendChild(inner);
8
+ const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);
9
+ outer.parentNode?.removeChild(outer);
10
+ return scrollbarWidth;
11
+ };
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"])
19
+ `));
20
+ return children;
21
+ };
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare const cn: (...inputs: ClassValue[]) => string;
3
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAE7C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,WAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { twMerge } from "tailwind-merge";
2
+ import { clsx } from "clsx";
3
+ export const cn = (...inputs) => twMerge(clsx(inputs));
@@ -0,0 +1,2 @@
1
+ export declare const formatInput: (value: string, regex: RegExp) => string;
2
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/utils/form.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,WAUvD,CAAA"}
@@ -0,0 +1,8 @@
1
+ export const formatInput = (value, regex) => {
2
+ let correctValue = value;
3
+ const filteredValue = Array.from(value).filter(char => regex.test(char)).join("");
4
+ if (filteredValue !== value) {
5
+ correctValue = filteredValue;
6
+ }
7
+ return correctValue;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadoui/react",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Kadoui primitive components for React",
5
5
  "author": "Jstation",
6
6
  "license": "MIT",
@@ -21,7 +21,6 @@
21
21
  "component"
22
22
  ],
23
23
  "dependencies": {
24
- "@kadoui/utils": "workspace:*",
25
24
  "react": "19.1.0",
26
25
  "react-dom": "19.1.0",
27
26
  "next": "15.4.5",
@@ -30,7 +29,9 @@
30
29
  "lucide-react": "^0.525.0",
31
30
  "qrcode": "^1.5.4",
32
31
  "zustand": "^5.0.6",
33
- "nanoid": "^5.1.5"
32
+ "nanoid": "^5.1.5",
33
+ "clsx": "^2.1.1",
34
+ "tailwind-merge": "^3.3.1"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@repo/tsconfig": "workspace:*",
@@ -1,46 +0,0 @@
1
- "use client";
2
-
3
- import { HTMLAttributes, KeyboardEvent } from "react";
4
- import { selectAccessibleChildren } from "@kadoui/utils";
5
-
6
- export type AccessNavigationPropsT = HTMLAttributes<HTMLDivElement> & {
7
- direction?: "y" | "x";
8
- };
9
-
10
- export function AccessNavigation({ direction = "y", dir, onKeyDown, ...p }: AccessNavigationPropsT) {
11
- const handleKeyDown = (ev: KeyboardEvent<HTMLDivElement>) => {
12
- const focusableChildren = selectAccessibleChildren(ev.currentTarget);
13
-
14
- if (!focusableChildren.length) {
15
- return;
16
- }
17
-
18
- const currentDir: "ltr" | "rtl" = (dir || document.documentElement.getAttribute("dir") || "ltr") as ("ltr" | "rtl");
19
-
20
- const currentIndex = focusableChildren.findIndex((item) => item === document.activeElement);
21
-
22
- if (ev.key === (direction === "y" ? "ArrowDown" : (currentDir === "ltr" ? "ArrowRight" : "ArrowLeft"))) {
23
- ev.preventDefault();
24
- const nextIndex =
25
- currentIndex === -1 || currentIndex === focusableChildren.length - 1 ? 0 : currentIndex + 1;
26
- focusableChildren[nextIndex]?.focus();
27
- }
28
-
29
- if (ev.key === (direction === "y" ? "ArrowUp" : (currentDir === "ltr" ? "ArrowLeft" : "ArrowRight"))) {
30
- ev.preventDefault();
31
- const prevIndex = currentIndex <= 0 ? focusableChildren.length - 1 : currentIndex - 1;
32
- focusableChildren[prevIndex]?.focus();
33
- }
34
- }
35
-
36
- return (
37
- <div
38
- dir={dir}
39
- onKeyDown={ev => {
40
- onKeyDown?.(ev);
41
- handleKeyDown(ev);
42
- }}
43
- {...p}
44
- />
45
- )
46
- }
@@ -1,8 +0,0 @@
1
- import { AccordionBody } from "./AccordionBody";
2
- import { AccordionRoot } from "./AccordionRoot";
3
- import { AccordionToggle } from "./AccordionToggle";
4
-
5
- export const Accordion = Object.assign(AccordionRoot, {
6
- Toggle: AccordionToggle,
7
- Body: AccordionBody
8
- });
@@ -1,31 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "@kadoui/utils";
4
- import { ReactNode, use } from "react";
5
- import { AnimatePresence, HTMLMotionProps, motion } from "framer-motion";
6
-
7
- import { AccordionContext } from "./AccordionContext";
8
-
9
- export type AccordionBodyPropsT = HTMLMotionProps<"div">;
10
-
11
- export function AccordionBody({ children, className, ...props }: AccordionBodyPropsT) {
12
- const { isOpen } = use(AccordionContext);
13
-
14
- return (
15
- <AnimatePresence>
16
- {isOpen ?
17
- <motion.div
18
- className={cn("overflow-hidden", className)}
19
- initial={{ height: 0, opacity: 0 }}
20
- animate={{ height: "auto", opacity: 1 }}
21
- exit={{ height: 0, opacity: 0 }}
22
- {...props}
23
- >
24
- <div className="m-3">
25
- {children as ReactNode}
26
- </div>
27
- </motion.div>
28
- : null}
29
- </AnimatePresence>
30
- )
31
- }
@@ -1,8 +0,0 @@
1
- import { createContext, Dispatch, SetStateAction } from "react";
2
-
3
- export type AccordionContextT = {
4
- isOpen: boolean;
5
- setOpen: Dispatch<SetStateAction<boolean>>;
6
- }
7
-
8
- export const AccordionContext = createContext<AccordionContextT>({} as AccordionContextT)