@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,126 @@
1
+ import { jsx as u, jsxs as S } from "react/jsx-runtime";
2
+ import { c as U } from "../../clsx-OuTLNxxd.js";
3
+ import * as c from "react";
4
+ import { useId as A } from "react";
5
+ import { s as I } from "../../input.module-CtE19OH8.js";
6
+ import { View as K } from "../view/view.js";
7
+ import { u as $ } from "../../useStableCallback-DKZHlUAT.js";
8
+ import { u as q } from "../../useControlled-Du4sJyMj.js";
9
+ import { u as z } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
10
+ import { a as R, u as G, b as H, f as J } from "../../LabelableContext-Be1u-eFg.js";
11
+ import { u as Q } from "../../useLabelableId-CX4tcfzK.js";
12
+ import { u as W } from "../../useRenderElement-DngNDu_P.js";
13
+ import { c as X, n as Y } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
14
+ import { Text as Z } from "../text/text.js";
15
+ const y = /* @__PURE__ */ c.forwardRef(function(a, o) {
16
+ const {
17
+ render: m,
18
+ className: f,
19
+ id: l,
20
+ name: F,
21
+ value: n,
22
+ disabled: h = !1,
23
+ onValueChange: x,
24
+ defaultValue: p,
25
+ ...T
26
+ } = a, {
27
+ state: b,
28
+ name: D,
29
+ disabled: P
30
+ } = R(), d = P || h, v = D ?? F, w = c.useMemo(() => ({
31
+ ...b,
32
+ disabled: d
33
+ }), [b, d]), {
34
+ setTouched: C,
35
+ setDirty: M,
36
+ validityData: _,
37
+ setFocused: g,
38
+ setFilled: s,
39
+ validationMode: L,
40
+ validation: t
41
+ } = R(), {
42
+ labelId: j
43
+ } = G(), N = Q({
44
+ id: l
45
+ });
46
+ z(() => {
47
+ const e = n != null;
48
+ t.inputRef.current?.value || e && n !== "" ? s(!0) : e && n === "" && s(!1);
49
+ }, [t.inputRef, s, n]);
50
+ const [V, k] = q({
51
+ controlled: n,
52
+ default: p,
53
+ name: "FieldControl",
54
+ state: "value"
55
+ }), B = n !== void 0, O = $((e, r) => {
56
+ x?.(e, r), !r.isCanceled && k(e);
57
+ });
58
+ return H({
59
+ id: N,
60
+ name: v,
61
+ commit: t.commit,
62
+ value: V,
63
+ getValue: () => t.inputRef.current?.value,
64
+ controlRef: t.inputRef
65
+ }), W("input", a, {
66
+ ref: o,
67
+ state: w,
68
+ props: [{
69
+ id: N,
70
+ disabled: d,
71
+ name: v,
72
+ ref: t.inputRef,
73
+ "aria-labelledby": j,
74
+ ...B ? {
75
+ value: V
76
+ } : {
77
+ defaultValue: p
78
+ },
79
+ onChange(e) {
80
+ const r = e.currentTarget.value;
81
+ O(r, X(Y, e.nativeEvent)), M(r !== _.initialValue), s(r !== "");
82
+ },
83
+ onFocus() {
84
+ g(!0);
85
+ },
86
+ onBlur(e) {
87
+ C(!0), g(!1), L === "onBlur" && t.commit(e.currentTarget.value);
88
+ },
89
+ onKeyDown(e) {
90
+ e.currentTarget.tagName === "INPUT" && e.key === "Enter" && (C(!0), t.commit(e.currentTarget.value));
91
+ }
92
+ }, t.getInputValidationProps(), T],
93
+ stateAttributesMapping: J
94
+ });
95
+ });
96
+ process.env.NODE_ENV !== "production" && (y.displayName = "FieldControl");
97
+ const E = /* @__PURE__ */ c.forwardRef(function(a, o) {
98
+ return /* @__PURE__ */ u(y, {
99
+ ref: o,
100
+ ...a
101
+ });
102
+ });
103
+ process.env.NODE_ENV !== "production" && (E.displayName = "Input");
104
+ function pe({ label: i, className: a, ...o }) {
105
+ const m = A(), f = o.id || m, l = /* @__PURE__ */ u(
106
+ K,
107
+ {
108
+ interactive: "fill-outline",
109
+ render: /* @__PURE__ */ u(
110
+ E,
111
+ {
112
+ ...o,
113
+ className: U(I.input, a),
114
+ id: f
115
+ }
116
+ )
117
+ }
118
+ );
119
+ return i ? /* @__PURE__ */ S("label", { className: I.input__label, children: [
120
+ /* @__PURE__ */ u(Z, { color: "dimmer", children: i }),
121
+ l
122
+ ] }) : l;
123
+ }
124
+ export {
125
+ pe as Input
126
+ };
@@ -1,18 +1 @@
1
- import { Meter as MeterPrimitive } from '@base-ui/react/meter';
2
- import { Color } from '../view';
3
- export type MeterProps = MeterPrimitive.Root.Props & {
4
- /**
5
- * What is this meter even for bro?
6
- * If one is not provided, we render a standard meter (no label, no value).
7
- * You can still provide one yourself through children.
8
- * @example
9
- * <Meter value={24}>
10
- * <MeterPrimitive.Label render={<Text />} />
11
- * <MeterPrimitive.Value render={<Text />} />
12
- * </Meter>
13
- */
14
- label?: string;
15
- /** Communicate purpose with color. Defaults to "primary". */
16
- color?: Color;
17
- };
18
- export declare function Meter({ label, color, className, children, ...props }: MeterProps): import("react/jsx-runtime").JSX.Element;
1
+ export { Meter } from './meter';
@@ -1,166 +1,5 @@
1
1
  "use client";
2
- import { jsx as m, jsxs as M, Fragment as g } from "react/jsx-runtime";
3
- import { c as j } from "../../clsx-OuTLNxxd.js";
4
- import { Text as h } from "../text/index.js";
5
- import { View as C } from "../view/index.js";
6
- import * as i from "react";
7
- import { f as L } from "../../formatErrorMessage-BqPuTBN-.js";
8
- import { f as x } from "../../formatNumber-1UNwjeqf.js";
9
- import { u } from "../../useRenderElement-DwToLA61.js";
10
- import { u as T } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
11
- import { u as P } from "../../useBaseUiId-B7WyxtIE.js";
12
- import { v as z } from "../../valueToPercent-DaP9qN4u.js";
13
- import '../../index26.css';const _ = /* @__PURE__ */ i.createContext(void 0);
14
- process.env.NODE_ENV !== "production" && (_.displayName = "MeterRootContext");
15
- function N() {
16
- const t = i.useContext(_);
17
- if (t === void 0)
18
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MeterRootContext is missing. Meter parts must be placed within <Meter.Root>." : L(38));
19
- return t;
20
- }
21
- function B(t, e, r) {
22
- return r ? x(t, e, r) : x(t / 100, e, {
23
- style: "percent"
24
- });
25
- }
26
- const E = /* @__PURE__ */ i.forwardRef(function(e, r) {
27
- const {
28
- format: c,
29
- getAriaValueText: l,
30
- locale: s,
31
- max: n = 100,
32
- min: a = 0,
33
- value: o,
34
- render: F,
35
- className: W,
36
- ...I
37
- } = e, [b, v] = i.useState(), d = B(o, s, c);
38
- let p = `${o}%`;
39
- l ? p = l(d, o) : c && (p = d);
40
- const k = {
41
- "aria-labelledby": b,
42
- "aria-valuemax": n,
43
- "aria-valuemin": a,
44
- "aria-valuenow": o,
45
- "aria-valuetext": p,
46
- role: "meter"
47
- }, D = i.useMemo(() => ({
48
- formattedValue: d,
49
- max: n,
50
- min: a,
51
- setLabelId: v,
52
- value: o
53
- }), [d, n, a, v, o]), O = u("div", e, {
54
- ref: r,
55
- props: [k, I]
56
- });
57
- return /* @__PURE__ */ m(_.Provider, {
58
- value: D,
59
- children: O
60
- });
61
- });
62
- process.env.NODE_ENV !== "production" && (E.displayName = "MeterRoot");
63
- const V = /* @__PURE__ */ i.forwardRef(function(e, r) {
64
- const {
65
- render: c,
66
- className: l,
67
- ...s
68
- } = e;
69
- return u("div", e, {
70
- ref: r,
71
- props: s
72
- });
73
- });
74
- process.env.NODE_ENV !== "production" && (V.displayName = "MeterTrack");
75
- const R = /* @__PURE__ */ i.forwardRef(function(e, r) {
76
- const {
77
- render: c,
78
- className: l,
79
- ...s
80
- } = e, n = N(), a = z(n.value, n.min, n.max);
81
- return u("div", e, {
82
- ref: r,
83
- props: [{
84
- style: {
85
- insetInlineStart: 0,
86
- height: "inherit",
87
- width: `${a}%`
88
- }
89
- }, s]
90
- });
91
- });
92
- process.env.NODE_ENV !== "production" && (R.displayName = "MeterIndicator");
93
- const y = /* @__PURE__ */ i.forwardRef(function(e, r) {
94
- const {
95
- className: c,
96
- render: l,
97
- children: s,
98
- ...n
99
- } = e, {
100
- value: a,
101
- formattedValue: o
102
- } = N();
103
- return u("span", e, {
104
- ref: r,
105
- props: [{
106
- "aria-hidden": !0,
107
- children: typeof s == "function" ? s(o, a) : (o || a) ?? ""
108
- }, n]
109
- });
110
- });
111
- process.env.NODE_ENV !== "production" && (y.displayName = "MeterValue");
112
- const w = /* @__PURE__ */ i.forwardRef(function(e, r) {
113
- const {
114
- render: c,
115
- className: l,
116
- id: s,
117
- ...n
118
- } = e, a = P(s), {
119
- setLabelId: o
120
- } = N();
121
- return T(() => (o(a), () => o(void 0)), [a, o]), u("span", e, {
122
- ref: r,
123
- props: [{
124
- id: a
125
- }, n]
126
- });
127
- });
128
- process.env.NODE_ENV !== "production" && (w.displayName = "MeterLabel");
129
- const S = "_meter_ejhiz_1", U = "_meter__value_ejhiz_7", $ = "_meter__track_ejhiz_13", A = "_meter__indicator_ejhiz_20", f = {
130
- meter: S,
131
- meter__value: U,
132
- meter__track: $,
133
- meter__indicator: A
134
- };
135
- function re({
136
- label: t,
137
- color: e = "primary",
138
- className: r,
139
- children: c,
140
- ...l
141
- }) {
142
- return /* @__PURE__ */ m(C, { color: e, children: /* @__PURE__ */ M(
143
- E,
144
- {
145
- className: j(f.meter, r),
146
- ...l,
147
- children: [
148
- t ? /* @__PURE__ */ M(g, { children: [
149
- /* @__PURE__ */ m(h, { render: /* @__PURE__ */ m(w, {}), children: t }),
150
- /* @__PURE__ */ m(
151
- h,
152
- {
153
- className: f.meter__value,
154
- render: /* @__PURE__ */ m(y, {})
155
- }
156
- )
157
- ] }) : null,
158
- c,
159
- /* @__PURE__ */ m(V, { className: f.meter__track, children: /* @__PURE__ */ m(R, { className: f.meter__indicator }) })
160
- ]
161
- }
162
- ) });
163
- }
2
+ import { Meter as t } from "./meter.js";
164
3
  export {
165
- re as Meter
4
+ t as Meter
166
5
  };
@@ -0,0 +1,22 @@
1
+ import { Meter as MeterPrimitive } from '@base-ui/react/meter';
2
+ import { Color } from '../view';
3
+ interface MeterProps extends MeterPrimitive.Root.Props {
4
+ /**
5
+ * What is this meter even for bro?
6
+ * If one is not provided, we render a standard meter (no label, no value).
7
+ * You can still provide one yourself through children.
8
+ * @example
9
+ * <Meter value={24}>
10
+ * <MeterPrimitive.Label render={<Text />} />
11
+ * <MeterPrimitive.Value render={<Text />} />
12
+ * </Meter>
13
+ */
14
+ label?: string;
15
+ /** Communicate purpose with color. Defaults to "primary". */
16
+ color?: Color;
17
+ }
18
+ declare function Meter({ label, color, className, children, ...props }: MeterProps): import("react/jsx-runtime").JSX.Element;
19
+ export { Meter };
20
+ export declare namespace Meter {
21
+ type Props = MeterProps;
22
+ }
@@ -0,0 +1,165 @@
1
+ import { jsx as m, jsxs as x, Fragment as g } from "react/jsx-runtime";
2
+ import { c as C } from "../../clsx-OuTLNxxd.js";
3
+ import { View as L } from "../view/view.js";
4
+ import { Text as M } from "../text/text.js";
5
+ import * as i from "react";
6
+ import { f as T } from "../../formatErrorMessage-BqPuTBN-.js";
7
+ import { f as h } from "../../formatNumber-1UNwjeqf.js";
8
+ import { u } from "../../useRenderElement-DngNDu_P.js";
9
+ import { u as P } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
10
+ import { u as j } from "../../useBaseUiId-B7WyxtIE.js";
11
+ import { v as B } from "../../valueToPercent-DaP9qN4u.js";
12
+ import '../../meter.css';const _ = /* @__PURE__ */ i.createContext(void 0);
13
+ process.env.NODE_ENV !== "production" && (_.displayName = "MeterRootContext");
14
+ function N() {
15
+ const t = i.useContext(_);
16
+ if (t === void 0)
17
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MeterRootContext is missing. Meter parts must be placed within <Meter.Root>." : T(38));
18
+ return t;
19
+ }
20
+ function S(t, e, r) {
21
+ return r ? h(t, e, r) : h(t / 100, e, {
22
+ style: "percent"
23
+ });
24
+ }
25
+ const E = /* @__PURE__ */ i.forwardRef(function(e, r) {
26
+ const {
27
+ format: c,
28
+ getAriaValueText: l,
29
+ locale: s,
30
+ max: n = 100,
31
+ min: a = 0,
32
+ value: o,
33
+ render: W,
34
+ className: q,
35
+ ...I
36
+ } = e, [b, v] = i.useState(), d = S(o, s, c);
37
+ let p = `${o}%`;
38
+ l ? p = l(d, o) : c && (p = d);
39
+ const k = {
40
+ "aria-labelledby": b,
41
+ "aria-valuemax": n,
42
+ "aria-valuemin": a,
43
+ "aria-valuenow": o,
44
+ "aria-valuetext": p,
45
+ role: "meter"
46
+ }, D = i.useMemo(() => ({
47
+ formattedValue: d,
48
+ max: n,
49
+ min: a,
50
+ setLabelId: v,
51
+ value: o
52
+ }), [d, n, a, v, o]), O = u("div", e, {
53
+ ref: r,
54
+ props: [k, I]
55
+ });
56
+ return /* @__PURE__ */ m(_.Provider, {
57
+ value: D,
58
+ children: O
59
+ });
60
+ });
61
+ process.env.NODE_ENV !== "production" && (E.displayName = "MeterRoot");
62
+ const V = /* @__PURE__ */ i.forwardRef(function(e, r) {
63
+ const {
64
+ render: c,
65
+ className: l,
66
+ ...s
67
+ } = e;
68
+ return u("div", e, {
69
+ ref: r,
70
+ props: s
71
+ });
72
+ });
73
+ process.env.NODE_ENV !== "production" && (V.displayName = "MeterTrack");
74
+ const R = /* @__PURE__ */ i.forwardRef(function(e, r) {
75
+ const {
76
+ render: c,
77
+ className: l,
78
+ ...s
79
+ } = e, n = N(), a = B(n.value, n.min, n.max);
80
+ return u("div", e, {
81
+ ref: r,
82
+ props: [{
83
+ style: {
84
+ insetInlineStart: 0,
85
+ height: "inherit",
86
+ width: `${a}%`
87
+ }
88
+ }, s]
89
+ });
90
+ });
91
+ process.env.NODE_ENV !== "production" && (R.displayName = "MeterIndicator");
92
+ const y = /* @__PURE__ */ i.forwardRef(function(e, r) {
93
+ const {
94
+ className: c,
95
+ render: l,
96
+ children: s,
97
+ ...n
98
+ } = e, {
99
+ value: a,
100
+ formattedValue: o
101
+ } = N();
102
+ return u("span", e, {
103
+ ref: r,
104
+ props: [{
105
+ "aria-hidden": !0,
106
+ children: typeof s == "function" ? s(o, a) : (o || a) ?? ""
107
+ }, n]
108
+ });
109
+ });
110
+ process.env.NODE_ENV !== "production" && (y.displayName = "MeterValue");
111
+ const w = /* @__PURE__ */ i.forwardRef(function(e, r) {
112
+ const {
113
+ render: c,
114
+ className: l,
115
+ id: s,
116
+ ...n
117
+ } = e, a = j(s), {
118
+ setLabelId: o
119
+ } = N();
120
+ return P(() => (o(a), () => o(void 0)), [a, o]), u("span", e, {
121
+ ref: r,
122
+ props: [{
123
+ id: a
124
+ }, n]
125
+ });
126
+ });
127
+ process.env.NODE_ENV !== "production" && (w.displayName = "MeterLabel");
128
+ const U = "_meter_1hxrp_2", $ = "_meter__value_1hxrp_8", A = "_meter__track_1hxrp_14", F = "_meter__indicator_1hxrp_21", f = {
129
+ meter: U,
130
+ meter__value: $,
131
+ meter__track: A,
132
+ meter__indicator: F
133
+ };
134
+ function re({
135
+ label: t,
136
+ color: e = "primary",
137
+ className: r,
138
+ children: c,
139
+ ...l
140
+ }) {
141
+ return /* @__PURE__ */ m(L, { color: e, children: /* @__PURE__ */ x(
142
+ E,
143
+ {
144
+ className: C(f.meter, r),
145
+ ...l,
146
+ children: [
147
+ t ? /* @__PURE__ */ x(g, { children: [
148
+ /* @__PURE__ */ m(M, { render: /* @__PURE__ */ m(w, {}), children: t }),
149
+ /* @__PURE__ */ m(
150
+ M,
151
+ {
152
+ className: f.meter__value,
153
+ render: /* @__PURE__ */ m(y, {})
154
+ }
155
+ )
156
+ ] }) : null,
157
+ c,
158
+ /* @__PURE__ */ m(V, { className: f.meter__track, children: /* @__PURE__ */ m(R, { className: f.meter__indicator }) })
159
+ ]
160
+ }
161
+ ) });
162
+ }
163
+ export {
164
+ re as Meter
165
+ };
@@ -1,6 +1 @@
1
- import { useRender } from '@base-ui/react';
2
- export interface MultilineInputProps extends useRender.ComponentProps<"textarea"> {
3
- /** Automatically resize textarea. Defaults to false. */
4
- autosize?: boolean;
5
- }
6
- export declare function MultilineInput({ autosize, className, ref, ...props }: MultilineInputProps): import("react/jsx-runtime").JSX.Element;
1
+ export { MultilineInput } from './multiline-input';
@@ -1,101 +1,5 @@
1
1
  "use client";
2
- import { jsx as T } from "react/jsx-runtime";
3
- import { c as R } from "../../clsx-OuTLNxxd.js";
4
- import { useRef as W, useEffect as Y } from "react";
5
- import { mergeRefs as B } from "../../-utils.js";
6
- import { View as X } from "../view/index.js";
7
- import { s as b } from "../../input.module-DDQY_Ij6.js";
8
- var c = /* @__PURE__ */ new Map();
9
- function j(t) {
10
- var o = c.get(t);
11
- o && o.destroy();
12
- }
13
- function k(t) {
14
- var o = c.get(t);
15
- o && o.update();
16
- }
17
- var f = null;
18
- typeof window > "u" ? ((f = function(t) {
19
- return t;
20
- }).destroy = function(t) {
21
- return t;
22
- }, f.update = function(t) {
23
- return t;
24
- }) : ((f = function(t, o) {
25
- return t && Array.prototype.forEach.call(t.length ? t : [t], function(i) {
26
- return (function(e) {
27
- if (e && e.nodeName && e.nodeName === "TEXTAREA" && !c.has(e)) {
28
- var l, g = null, r = window.getComputedStyle(e), m = (l = e.value, function() {
29
- v({ testForHeightReduction: l === "" || !e.value.startsWith(l), restoreTextAlign: null }), l = e.value;
30
- }), p = (function(d) {
31
- e.removeEventListener("autosize:destroy", p), e.removeEventListener("autosize:update", s), e.removeEventListener("input", m), window.removeEventListener("resize", s), Object.keys(d).forEach(function(a) {
32
- return e.style[a] = d[a];
33
- }), c.delete(e);
34
- }).bind(e, { height: e.style.height, resize: e.style.resize, textAlign: e.style.textAlign, overflowY: e.style.overflowY, overflowX: e.style.overflowX, wordWrap: e.style.wordWrap });
35
- e.addEventListener("autosize:destroy", p), e.addEventListener("autosize:update", s), e.addEventListener("input", m), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word", c.set(e, { destroy: p, update: s }), s();
36
- }
37
- function v(d) {
38
- var a, u, w = d.restoreTextAlign, h = w === void 0 ? null : w, x = d.testForHeightReduction, H = x === void 0 || x, N = r.overflowY;
39
- if (e.scrollHeight !== 0 && (r.resize === "vertical" ? e.style.resize = "none" : r.resize === "both" && (e.style.resize = "horizontal"), H && (a = (function(n) {
40
- for (var E = []; n && n.parentNode && n.parentNode instanceof Element; ) n.parentNode.scrollTop && E.push([n.parentNode, n.parentNode.scrollTop]), n = n.parentNode;
41
- return function() {
42
- return E.forEach(function(A) {
43
- var y = A[0], L = A[1];
44
- y.style.scrollBehavior = "auto", y.scrollTop = L, y.style.scrollBehavior = null;
45
- });
46
- };
47
- })(e), e.style.height = ""), u = r.boxSizing === "content-box" ? e.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : e.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && u > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (e.style.overflow = "scroll"), u = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (e.style.overflow = "hidden"), e.style.height = u + "px", h && (e.style.textAlign = h), a && a(), g !== u && (e.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), g = u), N !== r.overflow && !h)) {
48
- var z = r.textAlign;
49
- r.overflow === "hidden" && (e.style.textAlign = z === "start" ? "end" : "start"), v({ restoreTextAlign: z, testForHeightReduction: !0 });
50
- }
51
- }
52
- function s() {
53
- v({ testForHeightReduction: !0, restoreTextAlign: null });
54
- }
55
- })(i);
56
- }), t;
57
- }).destroy = function(t) {
58
- return t && Array.prototype.forEach.call(t.length ? t : [t], j), t;
59
- }, f.update = function(t) {
60
- return t && Array.prototype.forEach.call(t.length ? t : [t], k), t;
61
- });
62
- var F = f;
63
- function q({
64
- autosize: t = !1,
65
- className: o,
66
- ref: i,
67
- ...e
68
- }) {
69
- const l = M(t);
70
- return /* @__PURE__ */ T(
71
- X,
72
- {
73
- interactive: "fill-outline",
74
- render: /* @__PURE__ */ T(
75
- "textarea",
76
- {
77
- className: R(
78
- b.input,
79
- t && b.input_autosize,
80
- o
81
- ),
82
- ref: B(i, l),
83
- ...e
84
- }
85
- )
86
- }
87
- );
88
- }
89
- function M(t) {
90
- const o = W(null);
91
- return Y(() => {
92
- const i = o.current;
93
- if (!(!i || !t))
94
- return F(i), () => {
95
- F.destroy(i);
96
- };
97
- }, [t]), o;
98
- }
2
+ import { MultilineInput as i } from "./multiline-input.js";
99
3
  export {
100
- q as MultilineInput
4
+ i as MultilineInput
101
5
  };
@@ -0,0 +1,10 @@
1
+ import { useRender } from '@base-ui/react';
2
+ interface MultilineInputProps extends useRender.ComponentProps<"textarea"> {
3
+ /** Automatically resize textarea. Defaults to false. */
4
+ autosize?: boolean;
5
+ }
6
+ declare function MultilineInput({ autosize, className, ref, ...props }: MultilineInputProps): import("react/jsx-runtime").JSX.Element;
7
+ export { MultilineInput };
8
+ export declare namespace MultilineInput {
9
+ type Props = MultilineInputProps;
10
+ }