@koide-labs/ui 0.0.15 → 0.1.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 (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,511 @@
1
+ import { jsx as g, jsxs as j } from "react/jsx-runtime";
2
+ import { c as z } from "../../clsx-OuTLNxxd.js";
3
+ import * as n from "react";
4
+ import { Fragment as rt } from "react";
5
+ import { tokens as it } from "../../styles/tokens.js";
6
+ import { View as U } from "../view/view.js";
7
+ import { Button as ut } from "../button/button.js";
8
+ import { Icon as ct } from "../icon/icon.js";
9
+ import { S as lt } from "../../separator-fh_wDZNf.js";
10
+ import { u as dt } from "../../useControlled-Du4sJyMj.js";
11
+ import { u as F } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
12
+ import { u as k } from "../../useStableCallback-DKZHlUAT.js";
13
+ import { u as $, b as ft } from "../../useRenderElement-DngNDu_P.js";
14
+ import { C as bt, u as pt } from "../../useCompositeListItem-CZp9WTnF.js";
15
+ import { u as mt } from "../../DirectionContext-C2o_MF_i.js";
16
+ import { f as tt } from "../../formatErrorMessage-BqPuTBN-.js";
17
+ import { u as et } from "../../useBaseUiId-B7WyxtIE.js";
18
+ import { u as _t, A as gt, C as vt } from "../../CompositeRoot-CCgh2M64.js";
19
+ import { o as J } from "../../owner-rKN292Q9.js";
20
+ import { c as Q, n as X } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
21
+ import { u as ht } from "../../useButton-d3_JgBNr.js";
22
+ import { d as Tt, f as Ct } from "../../element-u5WgOZX1.js";
23
+ import '../../tabs.css';const K = /* @__PURE__ */ n.createContext(void 0);
24
+ process.env.NODE_ENV !== "production" && (K.displayName = "TabsRootContext");
25
+ function Y() {
26
+ const t = n.useContext(K);
27
+ if (t === void 0)
28
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : tt(64));
29
+ return t;
30
+ }
31
+ let Et = /* @__PURE__ */ (function(t) {
32
+ return t.activationDirection = "data-activation-direction", t.orientation = "data-orientation", t;
33
+ })({});
34
+ const W = {
35
+ tabActivationDirection: (t) => ({
36
+ [Et.activationDirection]: t
37
+ })
38
+ }, nt = /* @__PURE__ */ n.forwardRef(function(o, u) {
39
+ const {
40
+ className: f,
41
+ defaultValue: e = 0,
42
+ onValueChange: c,
43
+ orientation: a = "horizontal",
44
+ render: _,
45
+ value: b,
46
+ ...v
47
+ } = o, h = mt(), E = Object.hasOwn(o, "defaultValue"), R = n.useRef([]), [x, l] = n.useState(() => /* @__PURE__ */ new Map()), [d, T] = dt({
48
+ controlled: b,
49
+ default: e,
50
+ name: "Tabs",
51
+ state: "value"
52
+ }), N = b !== void 0, [i, P] = n.useState(() => /* @__PURE__ */ new Map()), [D, I] = n.useState("none"), M = k((s, m) => {
53
+ c?.(s, m), !m.isCanceled && (T(s), I(m.activationDirection));
54
+ }), p = k((s, m) => {
55
+ l((r) => {
56
+ if (r.get(s) === m)
57
+ return r;
58
+ const C = new Map(r);
59
+ return C.set(s, m), C;
60
+ });
61
+ }), A = k((s, m) => {
62
+ l((r) => {
63
+ if (!r.has(s) || r.get(s) !== m)
64
+ return r;
65
+ const C = new Map(r);
66
+ return C.delete(s), C;
67
+ });
68
+ }), V = n.useCallback((s) => x.get(s), [x]), O = n.useCallback((s) => {
69
+ for (const m of i.values())
70
+ if (s === m?.value)
71
+ return m?.id;
72
+ }, [i]), w = n.useCallback((s) => {
73
+ if (s === void 0)
74
+ return null;
75
+ for (const [m, r] of i.entries())
76
+ if (r != null && s === (r.value ?? r.index))
77
+ return m;
78
+ return null;
79
+ }, [i]), y = n.useMemo(() => ({
80
+ direction: h,
81
+ getTabElementBySelectedValue: w,
82
+ getTabIdByPanelValue: O,
83
+ getTabPanelIdByValue: V,
84
+ onValueChange: M,
85
+ orientation: a,
86
+ registerMountedTabPanel: p,
87
+ setTabMap: P,
88
+ unregisterMountedTabPanel: A,
89
+ tabActivationDirection: D,
90
+ value: d
91
+ }), [h, w, O, V, M, a, p, P, A, D, d]), S = n.useMemo(() => {
92
+ for (const s of i.values())
93
+ if (s != null && s.value === d)
94
+ return s;
95
+ }, [i, d]), L = n.useMemo(() => {
96
+ for (const s of i.values())
97
+ if (s != null && !s.disabled)
98
+ return s.value;
99
+ }, [i]);
100
+ F(() => {
101
+ if (N || i.size === 0)
102
+ return;
103
+ const s = S?.disabled, m = S == null && d !== null;
104
+ if (E && s && d === e || !s && !m)
105
+ return;
106
+ const C = L ?? null;
107
+ d !== C && (T(C), I("none"));
108
+ }, [e, L, E, N, S, I, T, i, d]);
109
+ const H = $("div", o, {
110
+ state: {
111
+ orientation: a,
112
+ tabActivationDirection: D
113
+ },
114
+ ref: u,
115
+ props: v,
116
+ stateAttributesMapping: W
117
+ });
118
+ return /* @__PURE__ */ g(K.Provider, {
119
+ value: y,
120
+ children: /* @__PURE__ */ g(bt, {
121
+ elementsRef: R,
122
+ children: H
123
+ })
124
+ });
125
+ });
126
+ process.env.NODE_ENV !== "production" && (nt.displayName = "TabsRoot");
127
+ const q = /* @__PURE__ */ n.createContext(void 0);
128
+ process.env.NODE_ENV !== "production" && (q.displayName = "TabsListContext");
129
+ function Mt() {
130
+ const t = n.useContext(q);
131
+ if (t === void 0)
132
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : tt(65));
133
+ return t;
134
+ }
135
+ const ot = /* @__PURE__ */ n.forwardRef(function(o, u) {
136
+ const {
137
+ className: f,
138
+ disabled: e = !1,
139
+ render: c,
140
+ value: a,
141
+ id: _,
142
+ nativeButton: b = !0,
143
+ ...v
144
+ } = o, {
145
+ value: h,
146
+ getTabPanelIdByValue: E,
147
+ orientation: R
148
+ } = Y(), {
149
+ activateOnFocus: x,
150
+ highlightedTabIndex: l,
151
+ onTabActivation: d,
152
+ setHighlightedTabIndex: T,
153
+ tabsListElement: N
154
+ } = Mt(), i = et(_), P = n.useMemo(() => ({
155
+ disabled: e,
156
+ id: i,
157
+ value: a
158
+ }), [e, i, a]), {
159
+ compositeProps: D,
160
+ compositeRef: I,
161
+ index: M
162
+ // hook is used instead of the CompositeItem component
163
+ // because the index is needed for Tab internals
164
+ } = _t({
165
+ metadata: P
166
+ }), p = a === h, A = n.useRef(!1);
167
+ F(() => {
168
+ if (A.current) {
169
+ A.current = !1;
170
+ return;
171
+ }
172
+ if (!(p && M > -1 && l !== M))
173
+ return;
174
+ const r = N;
175
+ if (r != null) {
176
+ const C = Tt(J(r));
177
+ if (C && Ct(r, C))
178
+ return;
179
+ }
180
+ e || T(M);
181
+ }, [p, M, l, T, e, N]);
182
+ const {
183
+ getButtonProps: V,
184
+ buttonRef: O
185
+ } = ht({
186
+ disabled: e,
187
+ native: b,
188
+ focusableWhenDisabled: !0
189
+ }), w = E(a), y = n.useRef(!1), S = n.useRef(!1);
190
+ function L(r) {
191
+ p || e || d(a, Q(X, r.nativeEvent, void 0, {
192
+ activationDirection: "none"
193
+ }));
194
+ }
195
+ function G(r) {
196
+ p || (M > -1 && !e && T(M), !e && x && (!y.current || // keyboard or touch focus
197
+ y.current && S.current) && d(a, Q(X, r.nativeEvent, void 0, {
198
+ activationDirection: "none"
199
+ })));
200
+ }
201
+ function H(r) {
202
+ if (p || e)
203
+ return;
204
+ y.current = !0;
205
+ function C() {
206
+ y.current = !1, S.current = !1;
207
+ }
208
+ (!r.button || r.button === 0) && (S.current = !0, J(r.currentTarget).addEventListener("pointerup", C, {
209
+ once: !0
210
+ }));
211
+ }
212
+ const s = n.useMemo(() => ({
213
+ disabled: e,
214
+ active: p,
215
+ orientation: R
216
+ }), [e, p, R]);
217
+ return $("button", o, {
218
+ state: s,
219
+ ref: [u, O, I],
220
+ props: [D, {
221
+ role: "tab",
222
+ "aria-controls": w,
223
+ "aria-selected": p,
224
+ id: i,
225
+ onClick: L,
226
+ onFocus: G,
227
+ onPointerDown: H,
228
+ [gt]: p ? "" : void 0,
229
+ onKeyDownCapture() {
230
+ A.current = !0;
231
+ }
232
+ }, v, V]
233
+ });
234
+ });
235
+ process.env.NODE_ENV !== "production" && (ot.displayName = "TabsTab");
236
+ let xt = /* @__PURE__ */ (function(t) {
237
+ return t.index = "data-index", t.activationDirection = "data-activation-direction", t.orientation = "data-orientation", t.hidden = "data-hidden", t;
238
+ })({});
239
+ const at = /* @__PURE__ */ n.forwardRef(function(o, u) {
240
+ const {
241
+ className: f,
242
+ value: e,
243
+ render: c,
244
+ keepMounted: a = !1,
245
+ ..._
246
+ } = o, {
247
+ value: b,
248
+ getTabIdByPanelValue: v,
249
+ orientation: h,
250
+ tabActivationDirection: E,
251
+ registerMountedTabPanel: R,
252
+ unregisterMountedTabPanel: x
253
+ } = Y(), l = et(), d = n.useMemo(() => ({
254
+ id: l,
255
+ value: e
256
+ }), [l, e]), {
257
+ ref: T,
258
+ index: N
259
+ } = pt({
260
+ metadata: d
261
+ }), i = e !== b, P = v(e), D = n.useMemo(() => ({
262
+ hidden: i,
263
+ orientation: h,
264
+ tabActivationDirection: E
265
+ }), [i, h, E]), I = $("div", o, {
266
+ state: D,
267
+ ref: [u, T],
268
+ props: [{
269
+ "aria-labelledby": P,
270
+ hidden: i,
271
+ id: l ?? void 0,
272
+ role: "tabpanel",
273
+ tabIndex: i ? -1 : 0,
274
+ [xt.index]: N
275
+ }, _],
276
+ stateAttributesMapping: W
277
+ });
278
+ return F(() => {
279
+ if (!(i && !a) && l != null)
280
+ return R(e, l), () => {
281
+ x(e, l);
282
+ };
283
+ }, [i, a, e, l, R, x]), !i || a ? I : null;
284
+ });
285
+ process.env.NODE_ENV !== "production" && (at.displayName = "TabsPanel");
286
+ const st = /* @__PURE__ */ n.forwardRef(function(o, u) {
287
+ const {
288
+ activateOnFocus: f = !1,
289
+ className: e,
290
+ loopFocus: c = !0,
291
+ render: a,
292
+ ..._
293
+ } = o, {
294
+ getTabElementBySelectedValue: b,
295
+ onValueChange: v,
296
+ orientation: h,
297
+ value: E,
298
+ setTabMap: R,
299
+ tabActivationDirection: x
300
+ } = Y(), [l, d] = n.useState(0), [T, N] = n.useState(null), i = Rt(
301
+ E,
302
+ // the old value
303
+ h,
304
+ T,
305
+ b
306
+ ), P = k((p, A) => {
307
+ if (p !== E) {
308
+ const V = i(p);
309
+ A.activationDirection = V, v(p, A);
310
+ }
311
+ }), D = n.useMemo(() => ({
312
+ orientation: h,
313
+ tabActivationDirection: x
314
+ }), [h, x]), I = {
315
+ "aria-orientation": h === "vertical" ? "vertical" : void 0,
316
+ role: "tablist"
317
+ }, M = n.useMemo(() => ({
318
+ activateOnFocus: f,
319
+ highlightedTabIndex: l,
320
+ onTabActivation: P,
321
+ setHighlightedTabIndex: d,
322
+ tabsListElement: T,
323
+ value: E
324
+ }), [f, l, P, d, T, E]);
325
+ return /* @__PURE__ */ g(q.Provider, {
326
+ value: M,
327
+ children: /* @__PURE__ */ g(vt, {
328
+ render: a,
329
+ className: e,
330
+ state: D,
331
+ refs: [u, N],
332
+ props: [I, _],
333
+ stateAttributesMapping: W,
334
+ highlightedIndex: l,
335
+ enableHomeAndEndKeys: !0,
336
+ loopFocus: c,
337
+ orientation: h,
338
+ onHighlightedIndexChange: d,
339
+ onMapChange: R,
340
+ disabledIndices: ft
341
+ })
342
+ });
343
+ });
344
+ process.env.NODE_ENV !== "production" && (st.displayName = "TabsList");
345
+ function Z(t, o) {
346
+ const {
347
+ left: u,
348
+ top: f
349
+ } = t.getBoundingClientRect(), {
350
+ left: e,
351
+ top: c
352
+ } = o.getBoundingClientRect(), a = u - e, _ = f - c;
353
+ return {
354
+ left: a,
355
+ top: _
356
+ };
357
+ }
358
+ function Rt(t, o, u, f) {
359
+ const [e, c] = n.useState(null);
360
+ return F(() => {
361
+ if (t == null || u == null) {
362
+ c(null);
363
+ return;
364
+ }
365
+ const a = f(t);
366
+ if (a == null) {
367
+ c(null);
368
+ return;
369
+ }
370
+ const {
371
+ left: _,
372
+ top: b
373
+ } = Z(a, u);
374
+ c(o === "horizontal" ? _ : b);
375
+ }, [o, f, u, t]), n.useCallback((a) => {
376
+ if (a === t)
377
+ return "none";
378
+ if (a == null)
379
+ return c(null), "none";
380
+ if (a != null && u != null) {
381
+ const _ = f(a);
382
+ if (_ != null) {
383
+ const {
384
+ left: b,
385
+ top: v
386
+ } = Z(_, u);
387
+ if (e == null)
388
+ return c(o === "horizontal" ? b : v), "none";
389
+ if (o === "horizontal") {
390
+ if (b < e)
391
+ return c(b), "left";
392
+ if (b > e)
393
+ return c(b), "right";
394
+ } else {
395
+ if (v < e)
396
+ return c(v), "up";
397
+ if (v > e)
398
+ return c(v), "down";
399
+ }
400
+ }
401
+ }
402
+ return "none";
403
+ }, [f, o, e, u, t]);
404
+ }
405
+ const Nt = "_tabs_ndch5_6", Pt = "_tabs__list_ndch5_10", Dt = "_tabs_variant_default_ndch5_17", It = "_tabs__separator_ndch5_22", At = "_tabs__trigger_ndch5_26", St = "_tabs_variant_progress_ndch5_48", B = {
406
+ tabs: Nt,
407
+ tabs__list: Pt,
408
+ tabs_variant_default: Dt,
409
+ tabs__separator: It,
410
+ tabs__trigger: At,
411
+ tabs_variant_progress: St,
412
+ "tabs__trigger-complete": "_tabs__trigger-complete_ndch5_72",
413
+ "tabs_variant_button-group": "_tabs_variant_button-group_ndch5_84"
414
+ }, Vt = /* @__PURE__ */ new Set(["default", "progress"]);
415
+ function yt({
416
+ variant: t = "default",
417
+ disabled: o = !1,
418
+ tabs: u,
419
+ className: f,
420
+ children: e,
421
+ ...c
422
+ }) {
423
+ return /* @__PURE__ */ j(
424
+ U,
425
+ {
426
+ render: /* @__PURE__ */ g(
427
+ nt,
428
+ {
429
+ className: z(
430
+ B.tabs,
431
+ B[`tabs_variant_${t}`],
432
+ f
433
+ ),
434
+ ...c
435
+ }
436
+ ),
437
+ children: [
438
+ /* @__PURE__ */ g(Ot, { children: u.map((a, _) => /* @__PURE__ */ j(rt, { children: [
439
+ /* @__PURE__ */ g(Bt, { disabled: o, ...a }),
440
+ _ + 1 < u.length && Vt.has(t) ? /* @__PURE__ */ g(
441
+ wt,
442
+ {
443
+ orientation: t === "progress" ? "horizontal" : "vertical"
444
+ }
445
+ ) : null
446
+ ] }, a.value)) }),
447
+ e
448
+ ]
449
+ }
450
+ );
451
+ }
452
+ function Bt({
453
+ value: t,
454
+ className: o,
455
+ complete: u,
456
+ children: f,
457
+ ...e
458
+ }) {
459
+ return /* @__PURE__ */ j(
460
+ ut,
461
+ {
462
+ interactive: "list-item",
463
+ className: z(B.tabs__trigger, o),
464
+ render: /* @__PURE__ */ g(ot, { value: t }),
465
+ ...e,
466
+ children: [
467
+ u ? /* @__PURE__ */ g(
468
+ ct,
469
+ {
470
+ color: it.positiveDefault,
471
+ name: "check-line",
472
+ className: B["tabs__trigger-complete"]
473
+ }
474
+ ) : null,
475
+ f
476
+ ]
477
+ }
478
+ );
479
+ }
480
+ function Ot({ className: t, ...o }) {
481
+ return /* @__PURE__ */ g(
482
+ U,
483
+ {
484
+ render: /* @__PURE__ */ g(
485
+ st,
486
+ {
487
+ className: z(B.tabs__list, t),
488
+ ...o
489
+ }
490
+ )
491
+ }
492
+ );
493
+ }
494
+ function wt({ className: t, ...o }) {
495
+ return /* @__PURE__ */ g(
496
+ lt,
497
+ {
498
+ className: z(B.tabs__separator, t),
499
+ ...o
500
+ }
501
+ );
502
+ }
503
+ function Lt({ children: t, ...o }) {
504
+ return /* @__PURE__ */ g(at, { ...o, children: /* @__PURE__ */ g(U, { children: t }) });
505
+ }
506
+ const re = Object.assign(yt, {
507
+ Panel: Lt
508
+ });
509
+ export {
510
+ re as Tabs
511
+ };
@@ -1,26 +1 @@
1
- import { useRender } from '@base-ui/react';
2
- import { Size } from '../../styles/tokens';
3
- type ColorVariants = "inherit" | "default" | "dimmer" | "dimmest";
4
- export interface TextProps extends Omit<useRender.ComponentProps<"span">, "color"> {
5
- /**
6
- * The color variant of the text.
7
- * Defaults to "default".
8
- */
9
- color?: ColorVariants;
10
- /**
11
- * The size variant of the text.
12
- * Defaults to "md".
13
- */
14
- size?: Size;
15
- /**
16
- * Maximum number of lines that should be displayed.
17
- * Defaults to 1 (the minimum).
18
- */
19
- maxLines?: number;
20
- /**
21
- * A convenient shorthand that has the same effect as setting maxLines to Infinity
22
- */
23
- multiline?: boolean;
24
- }
25
- export declare function Text({ color, size, maxLines, multiline, render, ...props }: TextProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
26
- export {};
1
+ export { Text } from './text';
@@ -1,49 +1,5 @@
1
1
  "use client";
2
- import { c as i } from "../../clsx-OuTLNxxd.js";
3
- import { s as c } from "../../view.module-DfDLgJE0.js";
4
- import { u as m } from "../../useRender-CLx7dR_1.js";
5
- import { m as r } from "../../useRenderElement-DwToLA61.js";
6
- import '../../index18.css';const n = "_text_ghwl6_1", a = "_text_color_inherit_ghwl6_25", z = "_text_color_default_ghwl6_29", g = "_text_color_dimmer_ghwl6_33", h = "_text_color_dimmest_ghwl6_37", d = "_text_size_sm_ghwl6_42", p = "_text_size_md_ghwl6_48", w = "_text_size_lg_ghwl6_54", f = "_text_size_xl_ghwl6_60", u = "_text_size_2xl_ghwl6_66", y = "_text_size_3xl_ghwl6_72", t = {
7
- text: n,
8
- "text_clip-line": "_text_clip-line_ghwl6_8",
9
- "text_clamp-lines": "_text_clamp-lines_ghwl6_15",
10
- text_color_inherit: a,
11
- text_color_default: z,
12
- text_color_dimmer: g,
13
- text_color_dimmest: h,
14
- text_size_sm: d,
15
- text_size_md: p,
16
- text_size_lg: w,
17
- text_size_xl: f,
18
- text_size_2xl: u,
19
- text_size_3xl: y
20
- };
21
- function P({
22
- color: l = "default",
23
- size: s = "md",
24
- maxLines: _ = 1,
25
- multiline: e,
26
- render: x,
27
- ...o
28
- }) {
29
- return m({
30
- defaultTagName: "span",
31
- render: x,
32
- props: r(o, {
33
- className: i(
34
- c.view,
35
- t.text,
36
- t[`text_color_${l}`],
37
- t[`text_size_${s}`],
38
- !e && t["text_clip-line"],
39
- !e && _ > 1 && t["text_clamp-lines"]
40
- ),
41
- style: {
42
- "--text-max-lines": Math.max(_, 1)
43
- }
44
- })
45
- });
46
- }
2
+ import { Text as o } from "./text.js";
47
3
  export {
48
- P as Text
4
+ o as Text
49
5
  };
@@ -0,0 +1,29 @@
1
+ import { useRender } from '@base-ui/react';
2
+ import { Size } from '../../styles/tokens';
3
+ type ColorVariants = "inherit" | "default" | "dimmer" | "dimmest";
4
+ interface TextProps extends Omit<useRender.ComponentProps<"span">, "color"> {
5
+ /**
6
+ * The color variant of the text.
7
+ * Defaults to "default".
8
+ */
9
+ color?: ColorVariants;
10
+ /**
11
+ * The size variant of the text.
12
+ * Defaults to "md".
13
+ */
14
+ size?: Size;
15
+ /**
16
+ * Maximum number of lines that should be displayed.
17
+ * Defaults to 1 (the minimum).
18
+ */
19
+ maxLines?: number;
20
+ /**
21
+ * A convenient shorthand that has the same effect as setting maxLines to Infinity
22
+ */
23
+ multiline?: boolean;
24
+ }
25
+ declare function Text({ color, size, maxLines, multiline, render, ...props }: TextProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
26
+ export { Text };
27
+ export declare namespace Text {
28
+ type Props = TextProps;
29
+ }
@@ -0,0 +1,48 @@
1
+ import { c as l } from "../../clsx-OuTLNxxd.js";
2
+ import { s as r } from "../../view.module-Dj7wj0kk.js";
3
+ import { u as i } from "../../useRender-C3vlzS3t.js";
4
+ import { m as c } from "../../useRenderElement-DngNDu_P.js";
5
+ import '../../text.css';const n = "_text_9ru3m_2", u = "_text_color_inherit_9ru3m_26", a = "_text_color_default_9ru3m_30", z = "_text_color_dimmer_9ru3m_34", d = "_text_color_dimmest_9ru3m_38", p = "_text_size_sm_9ru3m_43", f = "_text_size_md_9ru3m_49", g = "_text_size_lg_9ru3m_55", h = "_text_size_xl_9ru3m_61", y = "_text_size_2xl_9ru3m_67", $ = "_text_size_3xl_9ru3m_73", t = {
6
+ text: n,
7
+ "text_clip-line": "_text_clip-line_9ru3m_9",
8
+ "text_clamp-lines": "_text_clamp-lines_9ru3m_16",
9
+ text_color_inherit: u,
10
+ text_color_default: a,
11
+ text_color_dimmer: z,
12
+ text_color_dimmest: d,
13
+ text_size_sm: p,
14
+ text_size_md: f,
15
+ text_size_lg: g,
16
+ text_size_xl: h,
17
+ text_size_2xl: y,
18
+ text_size_3xl: $
19
+ };
20
+ function P({
21
+ color: s = "default",
22
+ size: x = "md",
23
+ maxLines: _ = 1,
24
+ multiline: e,
25
+ render: o,
26
+ ...m
27
+ }) {
28
+ return i({
29
+ defaultTagName: "span",
30
+ render: o,
31
+ props: c(m, {
32
+ className: l(
33
+ r.view,
34
+ t.text,
35
+ t[`text_color_${s}`],
36
+ t[`text_size_${x}`],
37
+ !e && t["text_clip-line"],
38
+ !e && _ > 1 && t["text_clamp-lines"]
39
+ ),
40
+ style: {
41
+ "--text-max-lines": Math.max(_, 1)
42
+ }
43
+ })
44
+ });
45
+ }
46
+ export {
47
+ P as Text
48
+ };
@@ -1,2 +1,2 @@
1
- export { ThemeProvider, type ThemeProviderProps } from './theme-provider';
1
+ export { ThemeProvider } from './theme-provider';
2
2
  export { useThemeContext } from './theme-context';
@@ -1,5 +1,5 @@
1
- import { ViewProps } from '../view';
2
- export type ThemeProviderProps = ViewProps & {
1
+ import { View } from '../view';
2
+ interface ThemeProviderProps extends View.Props {
3
3
  /** Override theme. */
4
4
  value?: string;
5
5
  /**
@@ -13,5 +13,9 @@ export type ThemeProviderProps = ViewProps & {
13
13
  * Defaults to true.
14
14
  */
15
15
  overrideBody?: boolean;
16
- };
17
- export declare function ThemeProvider({ value, defaultValue, overrideBody, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ }
17
+ declare function ThemeProvider({ value, defaultValue, overrideBody, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
18
+ export { ThemeProvider };
19
+ export declare namespace ThemeProvider {
20
+ type Props = ThemeProviderProps;
21
+ }