@koide-labs/ui 0.0.15 → 0.1.0

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 (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +1 -1
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -0,0 +1,701 @@
1
+ import { jsx as T, jsxs as ne } from "react/jsx-runtime";
2
+ import { c as Ce } from "../../clsx-OuTLNxxd.js";
3
+ import { textify as te } from "../../-utils.js";
4
+ import { Surface as Ne } from "../surface/surface.js";
5
+ import { View as oe } from "../view/view.js";
6
+ import { Icon as Oe } from "../icon/icon.js";
7
+ import * as r from "react";
8
+ import { u as ae } from "../../useControlled-Du4sJyMj.js";
9
+ import { u as L } from "../../useStableCallback-DKZHlUAT.js";
10
+ import { u as F } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
11
+ import { w as K } from "../../warn-CKtX8MLJ.js";
12
+ import { C as Ee, u as xe } from "../../useCompositeListItem-CZp9WTnF.js";
13
+ import { u as ve } from "../../DirectionContext-C2o_MF_i.js";
14
+ import { f as z } from "../../formatErrorMessage-BqPuTBN-.js";
15
+ import { u as B, d as ce } from "../../useRenderElement-DngNDu_P.js";
16
+ import { c as $, n as le, a as Ae } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
17
+ import { u as q } from "../../useBaseUiId-B7WyxtIE.js";
18
+ import { a as Se, T as re, t as Me, u as Pe } from "../../useOpenChangeComplete-BHd-N7Ig.js";
19
+ import { u as Ie } from "../../useTransitionStatus-CmMyUh74.js";
20
+ import { i as ie } from "../../isElementDisabled-Cbd8W9kH.js";
21
+ import { b as de, e as ue, c as fe, d as pe, H as we, E as De } from "../../composite-BwEK5cWH.js";
22
+ import { u as Ve } from "../../useButton-d3_JgBNr.js";
23
+ import { s as ke } from "../../event-B89-Ng5h.js";
24
+ import { u as Fe } from "../../useOnMount-VRW6CK2u.js";
25
+ import { u as Te, A as k } from "../../useAnimationFrame-DvK1s63A.js";
26
+ import '../../accordion.css';const G = /* @__PURE__ */ r.createContext(void 0);
27
+ process.env.NODE_ENV !== "production" && (G.displayName = "AccordionRootContext");
28
+ function Y() {
29
+ const n = r.useContext(G);
30
+ if (n === void 0)
31
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: AccordionRootContext is missing. Accordion parts must be placed within <Accordion.Root>." : z(10));
32
+ return n;
33
+ }
34
+ const He = {
35
+ value: () => null
36
+ }, me = /* @__PURE__ */ r.forwardRef(function(o, i) {
37
+ const {
38
+ render: I,
39
+ className: w,
40
+ disabled: c = !1,
41
+ hiddenUntilFound: m,
42
+ keepMounted: v,
43
+ loopFocus: C = !0,
44
+ onValueChange: R,
45
+ multiple: h = !1,
46
+ orientation: d = "vertical",
47
+ value: N,
48
+ defaultValue: f,
49
+ ...O
50
+ } = o, E = ve();
51
+ process.env.NODE_ENV !== "production" && F(() => {
52
+ m && v === !1 && K("The `keepMounted={false}` prop on a Accordion.Root will be ignored when using `hiddenUntilFound` since it requires Panels to remain mounted when closed.");
53
+ }, [m, v]);
54
+ const S = r.useMemo(() => {
55
+ if (N === void 0)
56
+ return f ?? [];
57
+ }, [N, f]), A = L(R), y = r.useRef([]), [b, _] = ae({
58
+ controlled: N,
59
+ default: S,
60
+ name: "Accordion",
61
+ state: "value"
62
+ }), l = L((p, V) => {
63
+ const g = $(le);
64
+ if (h)
65
+ if (V) {
66
+ const e = b.slice();
67
+ if (e.push(p), A(e, g), g.isCanceled)
68
+ return;
69
+ _(e);
70
+ } else {
71
+ const e = b.filter((a) => a !== p);
72
+ if (A(e, g), g.isCanceled)
73
+ return;
74
+ _(e);
75
+ }
76
+ else {
77
+ const e = b[0] === p ? [] : [p];
78
+ if (A(e, g), g.isCanceled)
79
+ return;
80
+ _(e);
81
+ }
82
+ }), x = r.useMemo(() => ({
83
+ value: b,
84
+ disabled: c,
85
+ orientation: d
86
+ }), [b, c, d]), M = r.useMemo(() => ({
87
+ accordionItemRefs: y,
88
+ direction: E,
89
+ disabled: c,
90
+ handleValueChange: l,
91
+ hiddenUntilFound: m ?? !1,
92
+ keepMounted: v ?? !1,
93
+ loopFocus: C,
94
+ orientation: d,
95
+ state: x,
96
+ value: b
97
+ }), [E, c, l, m, v, C, d, x, b]), P = B("div", o, {
98
+ state: x,
99
+ ref: i,
100
+ props: [{
101
+ dir: E,
102
+ role: "region"
103
+ }, O],
104
+ stateAttributesMapping: He
105
+ });
106
+ return /* @__PURE__ */ T(G.Provider, {
107
+ value: M,
108
+ children: /* @__PURE__ */ T(Ee, {
109
+ elementsRef: y,
110
+ children: P
111
+ })
112
+ });
113
+ });
114
+ process.env.NODE_ENV !== "production" && (me.displayName = "AccordionRoot");
115
+ function Ue(n) {
116
+ const {
117
+ open: o,
118
+ defaultOpen: i,
119
+ onOpenChange: I,
120
+ disabled: w
121
+ } = n, c = o !== void 0, [m, v] = ae({
122
+ controlled: o,
123
+ default: i,
124
+ name: "Collapsible",
125
+ state: "open"
126
+ }), {
127
+ mounted: C,
128
+ setMounted: R,
129
+ transitionStatus: h
130
+ } = Ie(m, !0, !0), [d, N] = r.useState(m), [{
131
+ height: f,
132
+ width: O
133
+ }, E] = r.useState({
134
+ height: void 0,
135
+ width: void 0
136
+ }), S = q(), [A, y] = r.useState(), b = A ?? S, [_, l] = r.useState(!1), [x, M] = r.useState(!1), P = r.useRef(null), p = r.useRef(null), V = r.useRef(null), g = r.useRef(null), e = Se(g, !1), a = L((s) => {
137
+ const t = !m, u = $(Ae, s.nativeEvent);
138
+ if (I(t, u), u.isCanceled)
139
+ return;
140
+ const D = g.current;
141
+ p.current === "css-animation" && D != null && D.style.removeProperty("animation-name"), !_ && !x && (p.current != null && p.current !== "css-animation" && !C && t && R(!0), p.current === "css-animation" && (!d && t && N(!0), !C && t && R(!0))), v(t), p.current === "none" && C && !t && R(!1);
142
+ });
143
+ return F(() => {
144
+ c && p.current === "none" && !x && !m && R(!1);
145
+ }, [c, x, m, o, R]), r.useMemo(() => ({
146
+ abortControllerRef: P,
147
+ animationTypeRef: p,
148
+ disabled: w,
149
+ handleTrigger: a,
150
+ height: f,
151
+ mounted: C,
152
+ open: m,
153
+ panelId: b,
154
+ panelRef: g,
155
+ runOnceAnimationsFinish: e,
156
+ setDimensions: E,
157
+ setHiddenUntilFound: l,
158
+ setKeepMounted: M,
159
+ setMounted: R,
160
+ setOpen: v,
161
+ setPanelIdState: y,
162
+ setVisible: N,
163
+ transitionDimensionRef: V,
164
+ transitionStatus: h,
165
+ visible: d,
166
+ width: O
167
+ }), [P, p, w, a, f, C, m, b, g, e, E, l, M, R, v, N, V, h, d, O]);
168
+ }
169
+ const J = /* @__PURE__ */ r.createContext(void 0);
170
+ process.env.NODE_ENV !== "production" && (J.displayName = "CollapsibleRootContext");
171
+ function he() {
172
+ const n = r.useContext(J);
173
+ if (n === void 0)
174
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>." : z(15));
175
+ return n;
176
+ }
177
+ const Q = /* @__PURE__ */ r.createContext(void 0);
178
+ process.env.NODE_ENV !== "production" && (Q.displayName = "AccordionItemContext");
179
+ function X() {
180
+ const n = r.useContext(Q);
181
+ if (n === void 0)
182
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: AccordionItemContext is missing. Accordion parts must be placed within <Accordion.Item>." : z(9));
183
+ return n;
184
+ }
185
+ let W = (function(n) {
186
+ return n.open = "data-open", n.closed = "data-closed", n[n.startingStyle = re.startingStyle] = "startingStyle", n[n.endingStyle = re.endingStyle] = "endingStyle", n;
187
+ })({}), We = /* @__PURE__ */ (function(n) {
188
+ return n.panelOpen = "data-panel-open", n;
189
+ })({});
190
+ const Le = {
191
+ [W.open]: ""
192
+ }, Be = {
193
+ [W.closed]: ""
194
+ }, je = {
195
+ open(n) {
196
+ return n ? {
197
+ [We.panelOpen]: ""
198
+ } : null;
199
+ }
200
+ }, qe = {
201
+ open(n) {
202
+ return n ? Le : Be;
203
+ }
204
+ };
205
+ let Ke = /* @__PURE__ */ (function(n) {
206
+ return n.index = "data-index", n.disabled = "data-disabled", n.open = "data-open", n;
207
+ })({});
208
+ const Z = {
209
+ ...qe,
210
+ index: (n) => Number.isInteger(n) ? {
211
+ [Ke.index]: String(n)
212
+ } : null,
213
+ ...Me,
214
+ value: () => null
215
+ }, ge = /* @__PURE__ */ r.forwardRef(function(o, i) {
216
+ const {
217
+ className: I,
218
+ disabled: w = !1,
219
+ onOpenChange: c,
220
+ render: m,
221
+ value: v,
222
+ ...C
223
+ } = o, {
224
+ ref: R,
225
+ index: h
226
+ } = xe(), d = ce(i, R), {
227
+ disabled: N,
228
+ handleValueChange: f,
229
+ state: O,
230
+ value: E
231
+ } = Y(), S = q(), A = v ?? S, y = w || N, b = r.useMemo(() => {
232
+ if (!E)
233
+ return !1;
234
+ for (let a = 0; a < E.length; a += 1)
235
+ if (E[a] === A)
236
+ return !0;
237
+ return !1;
238
+ }, [E, A]), _ = L((a, s) => {
239
+ c?.(a, s), !s.isCanceled && f(A, a);
240
+ }), l = Ue({
241
+ open: b,
242
+ onOpenChange: _,
243
+ disabled: y
244
+ }), x = r.useMemo(() => ({
245
+ open: l.open,
246
+ disabled: l.disabled,
247
+ hidden: !l.mounted,
248
+ transitionStatus: l.transitionStatus
249
+ }), [l.open, l.disabled, l.mounted, l.transitionStatus]), M = r.useMemo(() => ({
250
+ ...l,
251
+ onOpenChange: _,
252
+ state: x
253
+ }), [l, x, _]), P = r.useMemo(() => ({
254
+ ...O,
255
+ index: h,
256
+ disabled: y,
257
+ open: b
258
+ }), [y, h, b, O]), [p, V] = r.useState(q()), g = r.useMemo(() => ({
259
+ open: b,
260
+ state: P,
261
+ setTriggerId: V,
262
+ triggerId: p
263
+ }), [b, P, V, p]), e = B("div", o, {
264
+ state: P,
265
+ ref: d,
266
+ props: C,
267
+ stateAttributesMapping: Z
268
+ });
269
+ return /* @__PURE__ */ T(J.Provider, {
270
+ value: M,
271
+ children: /* @__PURE__ */ T(Q.Provider, {
272
+ value: g,
273
+ children: e
274
+ })
275
+ });
276
+ });
277
+ process.env.NODE_ENV !== "production" && (ge.displayName = "AccordionItem");
278
+ const be = /* @__PURE__ */ r.forwardRef(function(o, i) {
279
+ const {
280
+ render: I,
281
+ className: w,
282
+ ...c
283
+ } = o, {
284
+ state: m
285
+ } = X();
286
+ return B("h3", o, {
287
+ state: m,
288
+ ref: i,
289
+ props: c,
290
+ stateAttributesMapping: Z
291
+ });
292
+ });
293
+ process.env.NODE_ENV !== "production" && (be.displayName = "AccordionHeader");
294
+ const ze = /* @__PURE__ */ new Set([de, ue, fe, pe, we, De]);
295
+ function $e(n) {
296
+ const {
297
+ current: o
298
+ } = n, i = [];
299
+ for (let I = 0; I < o.length; I += 1) {
300
+ const w = o[I];
301
+ if (!ie(w)) {
302
+ const c = w?.querySelector('[type="button"]');
303
+ ie(c) || i.push(c);
304
+ }
305
+ }
306
+ return i;
307
+ }
308
+ const _e = /* @__PURE__ */ r.forwardRef(function(o, i) {
309
+ const {
310
+ disabled: I,
311
+ className: w,
312
+ id: c,
313
+ render: m,
314
+ nativeButton: v = !0,
315
+ ...C
316
+ } = o, {
317
+ panelId: R,
318
+ open: h,
319
+ handleTrigger: d,
320
+ disabled: N
321
+ } = he(), f = I ?? N, {
322
+ getButtonProps: O,
323
+ buttonRef: E
324
+ } = Ve({
325
+ disabled: f,
326
+ focusableWhenDisabled: !0,
327
+ native: v
328
+ }), {
329
+ accordionItemRefs: S,
330
+ direction: A,
331
+ loopFocus: y,
332
+ orientation: b
333
+ } = Y(), _ = A === "rtl", l = b === "horizontal", {
334
+ state: x,
335
+ setTriggerId: M,
336
+ triggerId: P
337
+ } = X();
338
+ F(() => (c && M(c), () => {
339
+ M(void 0);
340
+ }), [c, M]);
341
+ const p = r.useMemo(() => ({
342
+ "aria-controls": h ? R : void 0,
343
+ "aria-expanded": h,
344
+ disabled: f,
345
+ id: P,
346
+ onClick: d,
347
+ onKeyDown(g) {
348
+ if (!ze.has(g.key))
349
+ return;
350
+ ke(g);
351
+ const e = $e(S), s = e.length - 1;
352
+ let t = -1;
353
+ const u = e.indexOf(g.target);
354
+ function D() {
355
+ y ? t = u + 1 > s ? 0 : u + 1 : t = Math.min(u + 1, s);
356
+ }
357
+ function H() {
358
+ y ? t = u === 0 ? s : u - 1 : t = u - 1;
359
+ }
360
+ switch (g.key) {
361
+ case de:
362
+ l || D();
363
+ break;
364
+ case ue:
365
+ l || H();
366
+ break;
367
+ case fe:
368
+ l && (_ ? H() : D());
369
+ break;
370
+ case pe:
371
+ l && (_ ? D() : H());
372
+ break;
373
+ case "Home":
374
+ t = 0;
375
+ break;
376
+ case "End":
377
+ t = s;
378
+ break;
379
+ }
380
+ t > -1 && e[t].focus();
381
+ }
382
+ }), [S, f, d, P, l, _, y, h, R]);
383
+ return B("button", o, {
384
+ state: x,
385
+ ref: [i, E],
386
+ props: [p, C, O],
387
+ stateAttributesMapping: je
388
+ });
389
+ });
390
+ process.env.NODE_ENV !== "production" && (_e.displayName = "AccordionTrigger");
391
+ let Ge = /* @__PURE__ */ (function(n) {
392
+ return n.disabled = "data-disabled", n.orientation = "data-orientation", n;
393
+ })({});
394
+ function Ye(n) {
395
+ const {
396
+ abortControllerRef: o,
397
+ animationTypeRef: i,
398
+ externalRef: I,
399
+ height: w,
400
+ hiddenUntilFound: c,
401
+ keepMounted: m,
402
+ id: v,
403
+ mounted: C,
404
+ onOpenChange: R,
405
+ open: h,
406
+ panelRef: d,
407
+ runOnceAnimationsFinish: N,
408
+ setDimensions: f,
409
+ setMounted: O,
410
+ setOpen: E,
411
+ setVisible: S,
412
+ transitionDimensionRef: A,
413
+ visible: y,
414
+ width: b
415
+ } = n, _ = r.useRef(!1), l = r.useRef(null), x = r.useRef(h), M = r.useRef(h), P = Te(), p = r.useMemo(() => i.current === "css-animation" ? !y : !h && !C, [h, C, y, i]), V = L((e) => {
416
+ if (!e)
417
+ return;
418
+ if (i.current == null || A.current == null) {
419
+ const t = getComputedStyle(e), u = t.animationName !== "none" && t.animationName !== "", D = t.transitionDuration !== "0s" && t.transitionDuration !== "";
420
+ u && D ? process.env.NODE_ENV !== "production" && K("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.", "Only one of either animation type should be used.") : t.animationName === "none" && t.transitionDuration !== "0s" ? i.current = "css-transition" : t.animationName !== "none" && t.transitionDuration === "0s" ? i.current = "css-animation" : i.current = "none", e.getAttribute(Ge.orientation) === "horizontal" || t.transitionProperty.indexOf("width") > -1 ? A.current = "width" : A.current = "height";
421
+ }
422
+ if (i.current !== "css-transition")
423
+ return;
424
+ (w === void 0 || b === void 0) && (f({
425
+ height: e.scrollHeight,
426
+ width: e.scrollWidth
427
+ }), M.current && e.style.setProperty("transition-duration", "0s"));
428
+ let a = -1, s = -1;
429
+ return a = k.request(() => {
430
+ M.current = !1, s = k.request(() => {
431
+ setTimeout(() => {
432
+ e.style.removeProperty("transition-duration");
433
+ });
434
+ });
435
+ }), () => {
436
+ k.cancel(a), k.cancel(s);
437
+ };
438
+ }), g = ce(I, d, V);
439
+ return F(() => {
440
+ if (i.current !== "css-transition")
441
+ return;
442
+ const e = d.current;
443
+ if (!e)
444
+ return;
445
+ let a = -1;
446
+ if (o.current != null && (o.current.abort(), o.current = null), h) {
447
+ const s = {
448
+ "justify-content": e.style.justifyContent,
449
+ "align-items": e.style.alignItems,
450
+ "align-content": e.style.alignContent,
451
+ "justify-items": e.style.justifyItems
452
+ };
453
+ Object.keys(s).forEach((t) => {
454
+ e.style.setProperty(t, "initial", "important");
455
+ }), !M.current && !m && e.setAttribute(W.startingStyle, ""), f({
456
+ height: e.scrollHeight,
457
+ width: e.scrollWidth
458
+ }), a = k.request(() => {
459
+ Object.entries(s).forEach(([t, u]) => {
460
+ u === "" ? e.style.removeProperty(t) : e.style.setProperty(t, u);
461
+ });
462
+ });
463
+ } else {
464
+ if (e.scrollHeight === 0 && e.scrollWidth === 0)
465
+ return;
466
+ f({
467
+ height: e.scrollHeight,
468
+ width: e.scrollWidth
469
+ });
470
+ const s = new AbortController();
471
+ o.current = s;
472
+ const t = s.signal;
473
+ let u = null;
474
+ const D = W.endingStyle;
475
+ return u = new MutationObserver((H) => {
476
+ H.some((j) => j.type === "attributes" && j.attributeName === D) && (u?.disconnect(), u = null, N(() => {
477
+ f({
478
+ height: 0,
479
+ width: 0
480
+ }), e.style.removeProperty("content-visibility"), O(!1), o.current === s && (o.current = null);
481
+ }, t));
482
+ }), u.observe(e, {
483
+ attributes: !0,
484
+ attributeFilter: [D]
485
+ }), () => {
486
+ u?.disconnect(), P.cancel(), o.current === s && (s.abort(), o.current = null);
487
+ };
488
+ }
489
+ return () => {
490
+ k.cancel(a);
491
+ };
492
+ }, [o, i, P, c, m, C, h, d, N, f, O]), F(() => {
493
+ if (i.current !== "css-animation")
494
+ return;
495
+ const e = d.current;
496
+ e && (l.current = e.style.animationName || l.current, e.style.setProperty("animation-name", "none"), f({
497
+ height: e.scrollHeight,
498
+ width: e.scrollWidth
499
+ }), !x.current && !_.current && e.style.removeProperty("animation-name"), h ? (o.current != null && (o.current.abort(), o.current = null), O(!0), S(!0)) : (o.current = new AbortController(), N(() => {
500
+ O(!1), S(!1), o.current = null;
501
+ }, o.current.signal)));
502
+ }, [o, i, h, d, N, f, O, S, y]), Fe(() => {
503
+ const e = k.request(() => {
504
+ x.current = !1;
505
+ });
506
+ return () => k.cancel(e);
507
+ }), F(() => {
508
+ if (!c)
509
+ return;
510
+ const e = d.current;
511
+ if (!e)
512
+ return;
513
+ let a = -1, s = -1;
514
+ return h && _.current && (e.style.transitionDuration = "0s", f({
515
+ height: e.scrollHeight,
516
+ width: e.scrollWidth
517
+ }), a = k.request(() => {
518
+ _.current = !1, s = k.request(() => {
519
+ setTimeout(() => {
520
+ e.style.removeProperty("transition-duration");
521
+ });
522
+ });
523
+ })), () => {
524
+ k.cancel(a), k.cancel(s);
525
+ };
526
+ }, [c, h, d, f]), F(() => {
527
+ const e = d.current;
528
+ e && c && p && (e.setAttribute("hidden", "until-found"), i.current === "css-transition" && e.setAttribute(W.startingStyle, ""));
529
+ }, [c, p, i, d]), r.useEffect(function() {
530
+ const a = d.current;
531
+ if (!a)
532
+ return;
533
+ function s(t) {
534
+ _.current = !0, E(!0), R(!0, $(le, t));
535
+ }
536
+ return a.addEventListener("beforematch", s), () => {
537
+ a.removeEventListener("beforematch", s);
538
+ };
539
+ }, [R, d, E]), r.useMemo(() => ({
540
+ props: {
541
+ hidden: p,
542
+ id: v,
543
+ ref: g
544
+ }
545
+ }), [p, v, g]);
546
+ }
547
+ let se = /* @__PURE__ */ (function(n) {
548
+ return n.accordionPanelHeight = "--accordion-panel-height", n.accordionPanelWidth = "--accordion-panel-width", n;
549
+ })({});
550
+ const ye = /* @__PURE__ */ r.forwardRef(function(o, i) {
551
+ const {
552
+ className: I,
553
+ hiddenUntilFound: w,
554
+ keepMounted: c,
555
+ id: m,
556
+ render: v,
557
+ ...C
558
+ } = o, {
559
+ hiddenUntilFound: R,
560
+ keepMounted: h
561
+ } = Y(), {
562
+ abortControllerRef: d,
563
+ animationTypeRef: N,
564
+ height: f,
565
+ mounted: O,
566
+ onOpenChange: E,
567
+ open: S,
568
+ panelId: A,
569
+ panelRef: y,
570
+ runOnceAnimationsFinish: b,
571
+ setDimensions: _,
572
+ setHiddenUntilFound: l,
573
+ setKeepMounted: x,
574
+ setMounted: M,
575
+ setOpen: P,
576
+ setVisible: p,
577
+ transitionDimensionRef: V,
578
+ visible: g,
579
+ width: e,
580
+ setPanelIdState: a,
581
+ transitionStatus: s
582
+ } = he(), t = w ?? R, u = c ?? h;
583
+ process.env.NODE_ENV !== "production" && F(() => {
584
+ c === !1 && t && K("The `keepMounted={false}` prop on a Accordion.Panel will be ignored when using `contextHiddenUntilFound` on the Panel or the Root since it requires the panel to remain mounted when closed.");
585
+ }, [t, c]), F(() => {
586
+ if (m)
587
+ return a(m), () => {
588
+ a(void 0);
589
+ };
590
+ }, [m, a]), F(() => {
591
+ l(t);
592
+ }, [l, t]), F(() => {
593
+ x(u);
594
+ }, [x, u]), Pe({
595
+ open: S && s === "idle",
596
+ ref: y,
597
+ onComplete() {
598
+ S && _({
599
+ width: void 0,
600
+ height: void 0
601
+ });
602
+ }
603
+ });
604
+ const {
605
+ props: D
606
+ } = Ye({
607
+ abortControllerRef: d,
608
+ animationTypeRef: N,
609
+ externalRef: i,
610
+ height: f,
611
+ hiddenUntilFound: t,
612
+ id: m ?? A,
613
+ keepMounted: u,
614
+ mounted: O,
615
+ onOpenChange: E,
616
+ open: S,
617
+ panelRef: y,
618
+ runOnceAnimationsFinish: b,
619
+ setDimensions: _,
620
+ setMounted: M,
621
+ setOpen: P,
622
+ setVisible: p,
623
+ transitionDimensionRef: V,
624
+ visible: g,
625
+ width: e
626
+ }), {
627
+ state: H,
628
+ triggerId: ee
629
+ } = X(), j = r.useMemo(() => ({
630
+ ...H,
631
+ transitionStatus: s
632
+ }), [H, s]), Re = B("div", o, {
633
+ state: j,
634
+ ref: [i, y],
635
+ props: [D, {
636
+ "aria-labelledby": ee,
637
+ role: "region",
638
+ style: {
639
+ [se.accordionPanelHeight]: f === void 0 ? "auto" : `${f}px`,
640
+ [se.accordionPanelWidth]: e === void 0 ? "auto" : `${e}px`
641
+ }
642
+ }, C],
643
+ stateAttributesMapping: Z
644
+ });
645
+ return u || t || !u && O ? Re : null;
646
+ });
647
+ process.env.NODE_ENV !== "production" && (ye.displayName = "AccordionPanel");
648
+ const Je = "_accordion_olhk5_2", Qe = "_accordion__header_olhk5_6", Xe = "_accordion__trigger_olhk5_10", Ze = "_accordion__panel_olhk5_31", U = {
649
+ accordion: Je,
650
+ accordion__header: Qe,
651
+ "accordion__trigger-icon": "_accordion__trigger-icon_olhk5_10",
652
+ accordion__trigger: Xe,
653
+ accordion__panel: Ze,
654
+ "accordion__panel-content": "_accordion__panel-content_olhk5_43"
655
+ };
656
+ function en({
657
+ header: n,
658
+ children: o,
659
+ className: i,
660
+ ...I
661
+ }) {
662
+ return /* @__PURE__ */ ne(ge, { className: U.accordion, ...I, children: [
663
+ /* @__PURE__ */ T(be, { className: U.accordion__header, children: /* @__PURE__ */ T(
664
+ Ne,
665
+ {
666
+ elevated: !0,
667
+ render: /* @__PURE__ */ ne(
668
+ oe,
669
+ {
670
+ interactive: "list-item",
671
+ render: /* @__PURE__ */ T(
672
+ _e,
673
+ {
674
+ className: Ce(U.accordion__trigger, i)
675
+ }
676
+ ),
677
+ children: [
678
+ te(n),
679
+ /* @__PURE__ */ T(
680
+ Oe,
681
+ {
682
+ name: "close-line",
683
+ className: U["accordion__trigger-icon"]
684
+ }
685
+ )
686
+ ]
687
+ }
688
+ )
689
+ }
690
+ ) }),
691
+ /* @__PURE__ */ T(ye, { className: U.accordion__panel, children: /* @__PURE__ */ T(oe, { className: U["accordion__panel-content"], children: te(o, {
692
+ multiline: !0
693
+ }) }) })
694
+ ] });
695
+ }
696
+ const An = Object.assign(me, {
697
+ Item: en
698
+ });
699
+ export {
700
+ An as Accordion
701
+ };
@@ -1,12 +1 @@
1
- import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion';
2
- import { ComponentProps, ReactNode } from 'react';
3
- export declare const Accordion: import('react').ForwardRefExoticComponent<import('@base-ui/react').AccordionRootProps & import('react').RefAttributes<HTMLDivElement>>;
4
- export type AccordionItemProps = Omit<ComponentProps<typeof AccordionPrimitive.Item>, "render"> & {
5
- /** The content to display in the accordion header trigger. */
6
- header: ReactNode;
7
- /** The content to display within the expandable accordion panel. */
8
- content: ReactNode;
9
- /** Apply className to the accordion trigger */
10
- className?: string;
11
- };
12
- export declare function AccordionItem({ header, content, className, ...props }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
1
+ export { Accordion } from './accordion';