@central-ui/react 0.0.0-stage → 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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/components/accordion/index.d.ts +73 -0
  4. package/dist/components/accordion/index.d.ts.map +1 -0
  5. package/dist/components/accordion/index.js +92 -0
  6. package/dist/components/accordion/index.js.map +1 -0
  7. package/dist/components/autocomplete/index.d.ts +365 -0
  8. package/dist/components/autocomplete/index.d.ts.map +1 -0
  9. package/dist/components/autocomplete/index.js +369 -0
  10. package/dist/components/autocomplete/index.js.map +1 -0
  11. package/dist/components/avatar/index.d.ts +48 -0
  12. package/dist/components/avatar/index.d.ts.map +1 -0
  13. package/dist/components/avatar/index.js +60 -0
  14. package/dist/components/avatar/index.js.map +1 -0
  15. package/dist/components/badge/index.d.ts +29 -0
  16. package/dist/components/badge/index.d.ts.map +1 -0
  17. package/dist/components/badge/index.js +36 -0
  18. package/dist/components/badge/index.js.map +1 -0
  19. package/dist/components/banner/index.d.ts +71 -0
  20. package/dist/components/banner/index.d.ts.map +1 -0
  21. package/dist/components/banner/index.js +119 -0
  22. package/dist/components/banner/index.js.map +1 -0
  23. package/dist/components/breadcrumb/index.d.ts +31 -0
  24. package/dist/components/breadcrumb/index.d.ts.map +1 -0
  25. package/dist/components/breadcrumb/index.js +42 -0
  26. package/dist/components/breadcrumb/index.js.map +1 -0
  27. package/dist/components/button/index.d.ts +48 -0
  28. package/dist/components/button/index.d.ts.map +1 -0
  29. package/dist/components/button/index.js +60 -0
  30. package/dist/components/button/index.js.map +1 -0
  31. package/dist/components/card/index.d.ts +34 -0
  32. package/dist/components/card/index.d.ts.map +1 -0
  33. package/dist/components/card/index.js +45 -0
  34. package/dist/components/card/index.js.map +1 -0
  35. package/dist/components/checkbox/index.d.ts +66 -0
  36. package/dist/components/checkbox/index.d.ts.map +1 -0
  37. package/dist/components/checkbox/index.js +146 -0
  38. package/dist/components/checkbox/index.js.map +1 -0
  39. package/dist/components/chip/index.d.ts +26 -0
  40. package/dist/components/chip/index.d.ts.map +1 -0
  41. package/dist/components/chip/index.js +40 -0
  42. package/dist/components/chip/index.js.map +1 -0
  43. package/dist/components/combobox/index.d.ts +427 -0
  44. package/dist/components/combobox/index.d.ts.map +1 -0
  45. package/dist/components/combobox/index.js +416 -0
  46. package/dist/components/combobox/index.js.map +1 -0
  47. package/dist/components/datepicker/index.d.ts +297 -0
  48. package/dist/components/datepicker/index.d.ts.map +1 -0
  49. package/dist/components/datepicker/index.js +507 -0
  50. package/dist/components/datepicker/index.js.map +1 -0
  51. package/dist/components/dialog/index.d.ts +88 -0
  52. package/dist/components/dialog/index.d.ts.map +1 -0
  53. package/dist/components/dialog/index.js +102 -0
  54. package/dist/components/dialog/index.js.map +1 -0
  55. package/dist/components/divider/index.d.ts +21 -0
  56. package/dist/components/divider/index.d.ts.map +1 -0
  57. package/dist/components/divider/index.js +24 -0
  58. package/dist/components/divider/index.js.map +1 -0
  59. package/dist/components/drawer/index.d.ts +99 -0
  60. package/dist/components/drawer/index.d.ts.map +1 -0
  61. package/dist/components/drawer/index.js +137 -0
  62. package/dist/components/drawer/index.js.map +1 -0
  63. package/dist/components/empty/index.d.ts +40 -0
  64. package/dist/components/empty/index.d.ts.map +1 -0
  65. package/dist/components/empty/index.js +61 -0
  66. package/dist/components/empty/index.js.map +1 -0
  67. package/dist/components/fileupload/index.d.ts +107 -0
  68. package/dist/components/fileupload/index.d.ts.map +1 -0
  69. package/dist/components/fileupload/index.js +185 -0
  70. package/dist/components/fileupload/index.js.map +1 -0
  71. package/dist/components/form/index.d.ts +34 -0
  72. package/dist/components/form/index.d.ts.map +1 -0
  73. package/dist/components/form/index.js +35 -0
  74. package/dist/components/form/index.js.map +1 -0
  75. package/dist/components/input/index.d.ts +85 -0
  76. package/dist/components/input/index.d.ts.map +1 -0
  77. package/dist/components/input/index.js +249 -0
  78. package/dist/components/input/index.js.map +1 -0
  79. package/dist/components/menu/index.d.ts +115 -0
  80. package/dist/components/menu/index.d.ts.map +1 -0
  81. package/dist/components/menu/index.js +188 -0
  82. package/dist/components/menu/index.js.map +1 -0
  83. package/dist/components/metric/index.d.ts +24 -0
  84. package/dist/components/metric/index.d.ts.map +1 -0
  85. package/dist/components/metric/index.js +26 -0
  86. package/dist/components/metric/index.js.map +1 -0
  87. package/dist/components/numberinput/index.d.ts +105 -0
  88. package/dist/components/numberinput/index.d.ts.map +1 -0
  89. package/dist/components/numberinput/index.js +240 -0
  90. package/dist/components/numberinput/index.js.map +1 -0
  91. package/dist/components/otpinput/index.d.ts +63 -0
  92. package/dist/components/otpinput/index.d.ts.map +1 -0
  93. package/dist/components/otpinput/index.js +133 -0
  94. package/dist/components/otpinput/index.js.map +1 -0
  95. package/dist/components/page/index.d.ts +54 -0
  96. package/dist/components/page/index.d.ts.map +1 -0
  97. package/dist/components/page/index.js +100 -0
  98. package/dist/components/page/index.js.map +1 -0
  99. package/dist/components/passwordinput/index.d.ts +88 -0
  100. package/dist/components/passwordinput/index.d.ts.map +1 -0
  101. package/dist/components/passwordinput/index.js +251 -0
  102. package/dist/components/passwordinput/index.js.map +1 -0
  103. package/dist/components/popover/index.d.ts +67 -0
  104. package/dist/components/popover/index.d.ts.map +1 -0
  105. package/dist/components/popover/index.js +76 -0
  106. package/dist/components/popover/index.js.map +1 -0
  107. package/dist/components/radio/index.d.ts +90 -0
  108. package/dist/components/radio/index.d.ts.map +1 -0
  109. package/dist/components/radio/index.js +232 -0
  110. package/dist/components/radio/index.js.map +1 -0
  111. package/dist/components/ratinginput/index.d.ts +59 -0
  112. package/dist/components/ratinginput/index.d.ts.map +1 -0
  113. package/dist/components/ratinginput/index.js +88 -0
  114. package/dist/components/ratinginput/index.js.map +1 -0
  115. package/dist/components/select/index.d.ts +205 -0
  116. package/dist/components/select/index.d.ts.map +1 -0
  117. package/dist/components/select/index.js +234 -0
  118. package/dist/components/select/index.js.map +1 -0
  119. package/dist/components/skeleton/index.d.ts +19 -0
  120. package/dist/components/skeleton/index.d.ts.map +1 -0
  121. package/dist/components/skeleton/index.js +20 -0
  122. package/dist/components/skeleton/index.js.map +1 -0
  123. package/dist/components/slider/index.d.ts +72 -0
  124. package/dist/components/slider/index.d.ts.map +1 -0
  125. package/dist/components/slider/index.js +159 -0
  126. package/dist/components/slider/index.js.map +1 -0
  127. package/dist/components/spinner/index.d.ts +14 -0
  128. package/dist/components/spinner/index.d.ts.map +1 -0
  129. package/dist/components/spinner/index.js +15 -0
  130. package/dist/components/spinner/index.js.map +1 -0
  131. package/dist/components/splitter/index.d.ts +49 -0
  132. package/dist/components/splitter/index.d.ts.map +1 -0
  133. package/dist/components/splitter/index.js +67 -0
  134. package/dist/components/splitter/index.js.map +1 -0
  135. package/dist/components/stepper/index.d.ts +82 -0
  136. package/dist/components/stepper/index.d.ts.map +1 -0
  137. package/dist/components/stepper/index.js +100 -0
  138. package/dist/components/stepper/index.js.map +1 -0
  139. package/dist/components/switch/index.d.ts +57 -0
  140. package/dist/components/switch/index.d.ts.map +1 -0
  141. package/dist/components/switch/index.js +101 -0
  142. package/dist/components/switch/index.js.map +1 -0
  143. package/dist/components/table/index.d.ts +110 -0
  144. package/dist/components/table/index.d.ts.map +1 -0
  145. package/dist/components/table/index.js +211 -0
  146. package/dist/components/table/index.js.map +1 -0
  147. package/dist/components/tabs/index.d.ts +67 -0
  148. package/dist/components/tabs/index.d.ts.map +1 -0
  149. package/dist/components/tabs/index.js +78 -0
  150. package/dist/components/tabs/index.js.map +1 -0
  151. package/dist/components/textarea/index.d.ts +72 -0
  152. package/dist/components/textarea/index.d.ts.map +1 -0
  153. package/dist/components/textarea/index.js +205 -0
  154. package/dist/components/textarea/index.js.map +1 -0
  155. package/dist/components/textlink/index.d.ts +39 -0
  156. package/dist/components/textlink/index.d.ts.map +1 -0
  157. package/dist/components/textlink/index.js +42 -0
  158. package/dist/components/textlink/index.js.map +1 -0
  159. package/dist/components/toast/index.d.ts +111 -0
  160. package/dist/components/toast/index.d.ts.map +1 -0
  161. package/dist/components/toast/index.js +205 -0
  162. package/dist/components/toast/index.js.map +1 -0
  163. package/dist/components/toggle/index.d.ts +41 -0
  164. package/dist/components/toggle/index.d.ts.map +1 -0
  165. package/dist/components/toggle/index.js +78 -0
  166. package/dist/components/toggle/index.js.map +1 -0
  167. package/dist/components/tooltip/index.d.ts +44 -0
  168. package/dist/components/tooltip/index.d.ts.map +1 -0
  169. package/dist/components/tooltip/index.js +51 -0
  170. package/dist/components/tooltip/index.js.map +1 -0
  171. package/dist/index.d.ts +50 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js +46 -0
  174. package/dist/index.js.map +1 -0
  175. package/dist/types/Style.d.ts +14 -0
  176. package/dist/types/Style.d.ts.map +1 -0
  177. package/dist/types/Style.js +2 -0
  178. package/dist/types/Style.js.map +1 -0
  179. package/dist/types/Tone.d.ts +4 -0
  180. package/dist/types/Tone.d.ts.map +1 -0
  181. package/dist/types/Tone.js +2 -0
  182. package/dist/types/Tone.js.map +1 -0
  183. package/dist/utils/ArkStateToDataAttributes.d.ts +4 -0
  184. package/dist/utils/ArkStateToDataAttributes.d.ts.map +1 -0
  185. package/dist/utils/ArkStateToDataAttributes.js +9 -0
  186. package/dist/utils/ArkStateToDataAttributes.js.map +1 -0
  187. package/dist/utils/Tone.d.ts +3 -0
  188. package/dist/utils/Tone.d.ts.map +1 -0
  189. package/dist/utils/Tone.js +7 -0
  190. package/dist/utils/Tone.js.map +1 -0
  191. package/dist/utils/useForwardClickToInput.d.ts +4 -0
  192. package/dist/utils/useForwardClickToInput.d.ts.map +1 -0
  193. package/dist/utils/useForwardClickToInput.js +27 -0
  194. package/dist/utils/useForwardClickToInput.js.map +1 -0
  195. package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts +198 -0
  196. package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts.map +1 -0
  197. package/dist/utils/virtualization/useVirtualizedAutocomplete.js +180 -0
  198. package/dist/utils/virtualization/useVirtualizedAutocomplete.js.map +1 -0
  199. package/dist/utils/virtualization/useVirtualizedCombobox.d.ts +200 -0
  200. package/dist/utils/virtualization/useVirtualizedCombobox.d.ts.map +1 -0
  201. package/dist/utils/virtualization/useVirtualizedCombobox.js +174 -0
  202. package/dist/utils/virtualization/useVirtualizedCombobox.js.map +1 -0
  203. package/dist/utils/virtualization/useVirtualizedTable.d.ts +169 -0
  204. package/dist/utils/virtualization/useVirtualizedTable.d.ts.map +1 -0
  205. package/dist/utils/virtualization/useVirtualizedTable.js +127 -0
  206. package/dist/utils/virtualization/useVirtualizedTable.js.map +1 -0
  207. package/package.json +64 -4
  208. package/src/presets/shopify-polaris/shopify-polaris-accordion.css +28 -0
  209. package/src/presets/shopify-polaris/shopify-polaris-autocomplete.css +155 -0
  210. package/src/presets/shopify-polaris/shopify-polaris-avatar.css +47 -0
  211. package/src/presets/shopify-polaris/shopify-polaris-badge.css +27 -0
  212. package/src/presets/shopify-polaris/shopify-polaris-banner.css +111 -0
  213. package/src/presets/shopify-polaris/shopify-polaris-breadcrumb.css +16 -0
  214. package/src/presets/shopify-polaris/shopify-polaris-button.css +79 -0
  215. package/src/presets/shopify-polaris/shopify-polaris-card.css +28 -0
  216. package/src/presets/shopify-polaris/shopify-polaris-checkbox.css +52 -0
  217. package/src/presets/shopify-polaris/shopify-polaris-chip.css +16 -0
  218. package/src/presets/shopify-polaris/shopify-polaris-combobox.css +179 -0
  219. package/src/presets/shopify-polaris/shopify-polaris-datepicker.css +183 -0
  220. package/src/presets/shopify-polaris/shopify-polaris-dialog.css +40 -0
  221. package/src/presets/shopify-polaris/shopify-polaris-divider.css +12 -0
  222. package/src/presets/shopify-polaris/shopify-polaris-drawer.css +40 -0
  223. package/src/presets/shopify-polaris/shopify-polaris-empty.css +32 -0
  224. package/src/presets/shopify-polaris/shopify-polaris-fileupload.css +78 -0
  225. package/src/presets/shopify-polaris/shopify-polaris-form.css +8 -0
  226. package/src/presets/shopify-polaris/shopify-polaris-input.css +72 -0
  227. package/src/presets/shopify-polaris/shopify-polaris-menu.css +112 -0
  228. package/src/presets/shopify-polaris/shopify-polaris-metric.css +16 -0
  229. package/src/presets/shopify-polaris/shopify-polaris-numberinput.css +88 -0
  230. package/src/presets/shopify-polaris/shopify-polaris-otpinput.css +42 -0
  231. package/src/presets/shopify-polaris/shopify-polaris-page.css +69 -0
  232. package/src/presets/shopify-polaris/shopify-polaris-passwordinput.css +76 -0
  233. package/src/presets/shopify-polaris/shopify-polaris-popover.css +47 -0
  234. package/src/presets/shopify-polaris/shopify-polaris-radio.css +54 -0
  235. package/src/presets/shopify-polaris/shopify-polaris-ratinginput.css +42 -0
  236. package/src/presets/shopify-polaris/shopify-polaris-select.css +119 -0
  237. package/src/presets/shopify-polaris/shopify-polaris-skeleton.css +8 -0
  238. package/src/presets/shopify-polaris/shopify-polaris-slider.css +86 -0
  239. package/src/presets/shopify-polaris/shopify-polaris-spinner.css +16 -0
  240. package/src/presets/shopify-polaris/shopify-polaris-splitter.css +34 -0
  241. package/src/presets/shopify-polaris/shopify-polaris-stepper.css +55 -0
  242. package/src/presets/shopify-polaris/shopify-polaris-switch.css +38 -0
  243. package/src/presets/shopify-polaris/shopify-polaris-table.css +72 -0
  244. package/src/presets/shopify-polaris/shopify-polaris-tabs.css +33 -0
  245. package/src/presets/shopify-polaris/shopify-polaris-textarea.css +61 -0
  246. package/src/presets/shopify-polaris/shopify-polaris-textlink.css +8 -0
  247. package/src/presets/shopify-polaris/shopify-polaris-toggle.css +52 -0
  248. package/src/presets/shopify-polaris/shopify-polaris-tooltip.css +31 -0
  249. package/src/presets/shopify-polaris/shopify-polaris.css +380 -0
  250. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-accordion.css +28 -0
  251. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-autocomplete.css +155 -0
  252. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-avatar.css +47 -0
  253. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-badge.css +27 -0
  254. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-banner.css +96 -0
  255. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-breadcrumb.css +16 -0
  256. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-button.css +68 -0
  257. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-card.css +28 -0
  258. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-checkbox.css +52 -0
  259. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-chip.css +16 -0
  260. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-combobox.css +184 -0
  261. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-datepicker.css +187 -0
  262. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-dialog.css +40 -0
  263. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-divider.css +12 -0
  264. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-drawer.css +40 -0
  265. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-empty.css +32 -0
  266. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-fileupload.css +72 -0
  267. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-form.css +8 -0
  268. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-input.css +72 -0
  269. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-menu.css +112 -0
  270. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-metric.css +16 -0
  271. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-numberinput.css +88 -0
  272. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-otpinput.css +42 -0
  273. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-page.css +69 -0
  274. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-passwordinput.css +76 -0
  275. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-popover.css +47 -0
  276. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-radio.css +54 -0
  277. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-ratinginput.css +42 -0
  278. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-select.css +118 -0
  279. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-skeleton.css +8 -0
  280. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-slider.css +86 -0
  281. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-spinner.css +16 -0
  282. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-splitter.css +34 -0
  283. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +55 -0
  284. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-switch.css +38 -0
  285. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-table.css +72 -0
  286. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tabs.css +33 -0
  287. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textarea.css +61 -0
  288. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textlink.css +8 -0
  289. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toast.css +43 -0
  290. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toggle.css +52 -0
  291. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tooltip.css +31 -0
  292. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +381 -0
@@ -0,0 +1,249 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Input as BaseInput } from '@base-ui/react/input';
3
+ import { LoaderCircle, X } from 'lucide-react';
4
+ import { useRef } from 'react';
5
+ import { useForwardClickToInput } from "../../utils/useForwardClickToInput.js";
6
+ import { cloneElement, createContext, forwardRef, useContext, useEffect, useId, useState, } from 'react';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { ToneProvider, useToneContext } from "../../utils/Tone.js";
9
+ /**
10
+ * Keep configuration such as value, name, and validation tone on Root. Input is the editable control; InputGroup and Container organize it. Optional addon controls already have their own behavior where named, such as clearing.
11
+ *
12
+ * @example Complete composition
13
+ * import { Input } from '@central-ui/react'
14
+ *
15
+ * function Example() {
16
+ * return (
17
+ * <Input.Root defaultValue="Hello" name="message">
18
+ * <Input.Container>
19
+ * <Input.Label>Text</Input.Label>
20
+ * <Input.InputGroup>
21
+ * <Input.Input placeholder="Enter text" />
22
+ * <Input.Addon>
23
+ * <Input.AddonClearButton>
24
+ * <Input.AddonClearButtonIcon />
25
+ * </Input.AddonClearButton>
26
+ * </Input.Addon>
27
+ * </Input.InputGroup>
28
+ * <Input.Description>Enter your message.</Input.Description>
29
+ * </Input.Container>
30
+ * </Input.Root>
31
+ * )
32
+ * }
33
+ *
34
+ * @example Control the input from application state
35
+ * import { useState } from 'react'
36
+ * function ControlledExample() {
37
+ * const [value, setValue] = useState('')
38
+ * return (
39
+ * <Input.Root value={value} onValueChange={setValue}>
40
+ * {
41
+ * // Rest of components here
42
+ * }
43
+ * </Input.Root>
44
+ * )
45
+ * }
46
+ */
47
+ export function Root({ children, id, tone = 'neutral', value, defaultValue, onValueChange, disabled = false, readOnly = false, required = false, ...coreProps }) {
48
+ const generatedId = useId();
49
+ const inputRef = useRef(null);
50
+ const [valueInternalState, setValueInternalState] = useState(defaultValue ?? '');
51
+ const [connections, setConnections] = useState({
52
+ descriptionIds: [],
53
+ });
54
+ return (_jsx(InputContext.Provider, { value: {
55
+ inputId: id ?? generatedId,
56
+ disabled,
57
+ readOnly,
58
+ required,
59
+ inputRef,
60
+ value: value ?? valueInternalState,
61
+ setValueInternalState,
62
+ defaultValue,
63
+ controlled: value !== undefined,
64
+ onValueChange,
65
+ coreProps,
66
+ connections,
67
+ setConnections,
68
+ }, children: _jsx(ToneProvider, { value: tone, children: children }) }));
69
+ }
70
+ export const Input = forwardRef(function Input({ disableStyle, className, 'aria-describedby': describedBy, ...props }, ref) {
71
+ const context = useInputContext();
72
+ const tone = useToneContext();
73
+ const inputRef = useRef(null);
74
+ useEffect(() => {
75
+ const form = inputRef.current?.form;
76
+ if (!form || context.controlled)
77
+ return;
78
+ const reset = (event) => {
79
+ queueMicrotask(() => {
80
+ if (!event.defaultPrevented)
81
+ context.setValueInternalState(context.defaultValue ?? '');
82
+ });
83
+ };
84
+ form.addEventListener('reset', reset);
85
+ return () => form.removeEventListener('reset', reset);
86
+ }, [
87
+ context.controlled,
88
+ context.defaultValue,
89
+ context.setValueInternalState,
90
+ context.coreProps.form,
91
+ ]);
92
+ useEffect(() => {
93
+ context.inputRef.current = inputRef.current;
94
+ return () => {
95
+ context.inputRef.current = null;
96
+ };
97
+ }, [context.inputRef]);
98
+ return (_jsx(BaseInput, { ...context.coreProps, ...props, id: context.inputId, disabled: context.disabled, readOnly: context.readOnly, required: context.required, value: context.value, "data-tone": tone, "aria-invalid": tone === 'invalid' || props['aria-invalid'] || undefined, "aria-describedby": [describedBy, ...context.connections.descriptionIds]
99
+ .filter(Boolean)
100
+ .join(' ') || undefined, ref: (element) => {
101
+ inputRef.current = element;
102
+ if (typeof ref === 'function')
103
+ ref(inputRef.current);
104
+ else if (ref)
105
+ ref.current = inputRef.current;
106
+ }, onValueChange: (nextValue, details) => {
107
+ context.onValueChange?.(nextValue, details);
108
+ if (!details.isCanceled && !context.controlled)
109
+ context.setValueInternalState(nextValue);
110
+ }, "data-component": "input-input", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
111
+ });
112
+ export const InputGroup = forwardRef(function InputGroup({ disableStyle, className, onClick, ...props }, ref) {
113
+ const attributes = usePartAttributes();
114
+ const forwardClick = useForwardClickToInput('input:not([type="hidden"])', onClick);
115
+ return (_jsx("div", { ...attributes, ...props, ref: ref, onClick: forwardClick, "data-component": "input-inputgroup", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
116
+ });
117
+ export const Container = forwardRef(function Container({ disableStyle, className, ...props }, ref) {
118
+ const attributes = usePartAttributes();
119
+ return (_jsx("div", { ...attributes, ...props, ref: ref, "data-component": "input-container", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
120
+ });
121
+ /** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
122
+ export const Label = forwardRef(function Label({ disableStyle, className, id, ...props }, ref) {
123
+ const context = useInputContext();
124
+ const labelId = id ?? context.inputId + '-label';
125
+ const attributes = usePartAttributes();
126
+ useEffect(() => {
127
+ context.setConnections((current) => ({ ...current, labelId }));
128
+ return () => context.setConnections((current) => ({
129
+ ...current,
130
+ labelId: current.labelId === labelId ? undefined : current.labelId,
131
+ }));
132
+ }, [labelId, context.setConnections]);
133
+ return (_jsx("label", { ...attributes, ...props, id: labelId, ref: ref, htmlFor: context.inputId, "data-component": "input-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
134
+ });
135
+ export const Description = forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
136
+ const messageId = useMessageId(id);
137
+ const attributes = usePartAttributes();
138
+ return (_jsx("div", { ...attributes, ...props, id: messageId, ref: ref, "data-component": "input-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
139
+ });
140
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
141
+ export const Error = forwardRef(function Error({ disableStyle, className, id, ...props }, ref) {
142
+ const messageId = useMessageId(id);
143
+ const attributes = usePartAttributes();
144
+ return (_jsx("div", { role: "alert", "aria-atomic": "true", ...attributes, ...props, id: messageId, ref: ref, "data-component": "input-error", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
145
+ });
146
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
147
+ export const Success = forwardRef(function Success({ disableStyle, className, id, ...props }, ref) {
148
+ const messageId = useMessageId(id);
149
+ const attributes = usePartAttributes();
150
+ return (_jsx("div", { role: "status", "aria-atomic": "true", ...attributes, ...props, id: messageId, ref: ref, "data-component": "input-success", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
151
+ });
152
+ export const Addon = forwardRef(function Addon({ disableStyle, className, variant = 'normal', ...props }, ref) {
153
+ const attributes = usePartAttributes();
154
+ return (_jsx("div", { ...attributes, ...props, ref: ref, "data-variant": variant, "data-component": "input-addon", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
155
+ });
156
+ export const AddonText = forwardRef(function AddonText({ disableStyle, className, ...props }, ref) {
157
+ const attributes = usePartAttributes();
158
+ return (_jsx("span", { ...attributes, ...props, ref: ref, "data-component": "input-addontext", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
159
+ });
160
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
161
+ export function AddonIcon({ disableStyle, children, className, ...props }) {
162
+ const attributes = usePartAttributes();
163
+ return cloneElement(children, {
164
+ ...attributes,
165
+ ...props,
166
+ 'aria-hidden': true,
167
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
168
+ ...{
169
+ 'data-component': 'input-addonicon',
170
+ 'data-style-disabled': disableStyle ? '' : undefined,
171
+ },
172
+ className: twMerge(children.props.className, className),
173
+ });
174
+ }
175
+ export const AddonButton = forwardRef(function AddonButton({ disableStyle, className, disabled, type = 'button', ...props }, ref) {
176
+ const context = useInputContext();
177
+ const attributes = usePartAttributes();
178
+ return (_jsx("button", { ...attributes, ...props, ref: ref, type: type, disabled: disabled || context.disabled || context.readOnly, "data-component": "input-addonbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
179
+ });
180
+ /** Built-in icon; no children needed. Use it inside its matching control. */
181
+ export const AddonLoadingIcon = forwardRef(function AddonLoadingIcon({ disableStyle, className, strokeWidth = 1.5, ...props }, ref) {
182
+ const attributes = usePartAttributes();
183
+ return (_jsx(LoaderCircle, { ...attributes, "aria-hidden": true, ...props, ref: ref, strokeWidth: strokeWidth, "data-component": "input-addonloadingicon", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
184
+ });
185
+ /** Clears the control automatically; no clearing click handler needed. Supply the clear icon and an accessible name. */
186
+ export const AddonClearButton = forwardRef(function AddonClearButton({ disableStyle, className, disabled, onClick, ...props }, ref) {
187
+ const context = useInputContext();
188
+ const attributes = usePartAttributes();
189
+ return (_jsx("button", { ...attributes, "aria-label": "Clear text", ...props, ref: ref, type: "button", disabled: disabled || context.disabled || context.readOnly, onClick: (event) => {
190
+ onClick?.(event);
191
+ if (event.defaultPrevented)
192
+ return;
193
+ const input = context.inputRef.current;
194
+ if (!input)
195
+ return;
196
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(input, '');
197
+ input.dispatchEvent(new Event('input', { bubbles: true }));
198
+ input.focus();
199
+ }, "data-component": "input-addonclearbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
200
+ });
201
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
202
+ export function AddonClearButtonIcon({ disableStyle, children = _jsx(X, {}), className, ...props }) {
203
+ const attributes = usePartAttributes();
204
+ return cloneElement(children, {
205
+ ...attributes,
206
+ ...props,
207
+ 'aria-hidden': true,
208
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
209
+ ...{
210
+ 'data-component': 'input-addonclearbuttonicon',
211
+ 'data-style-disabled': disableStyle ? '' : undefined,
212
+ },
213
+ className: twMerge(children.props.className, className),
214
+ });
215
+ }
216
+ const InputContext = createContext(null);
217
+ function useInputContext() {
218
+ const context = useContext(InputContext);
219
+ if (!context)
220
+ throw new globalThis.Error('Parts must be inside Root');
221
+ return context;
222
+ }
223
+ function usePartAttributes() {
224
+ const context = useInputContext();
225
+ const tone = useToneContext();
226
+ return {
227
+ 'data-disabled': context.disabled ? '' : undefined,
228
+ 'data-readonly': context.readOnly ? '' : undefined,
229
+ 'data-required': context.required ? '' : undefined,
230
+ 'data-tone': tone,
231
+ };
232
+ }
233
+ function useMessageId(id) {
234
+ const generatedId = useId();
235
+ const messageId = id ?? generatedId;
236
+ const context = useInputContext();
237
+ useEffect(() => {
238
+ context.setConnections((current) => ({
239
+ ...current,
240
+ descriptionIds: [...current.descriptionIds, messageId],
241
+ }));
242
+ return () => context.setConnections((current) => ({
243
+ ...current,
244
+ descriptionIds: current.descriptionIds.filter((id) => id !== messageId),
245
+ }));
246
+ }, [messageId, context.setConnections]);
247
+ return messageId;
248
+ }
249
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/input/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAA;AASd,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAmBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,GAAG,SAAS,EACF;IACV,MAAM,WAAW,GAAG,KAAK,EAAE,CAAA;IAC3B,MAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAA;IACtD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAE1D,YAAY,IAAI,EAAE,CAAC,CAAA;IACrB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAc;QAC1D,cAAc,EAAE,EAAE;KACnB,CAAC,CAAA;IACF,OAAO,CACL,K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,CAAC,cAAc,EAAE,SAAS,CAAC;SACvD,CAAC,CAAC,CAAA;QACH,OAAO,GAAG,EAAE,CACV,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACnC,GAAG,OAAO;YACV,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC;SACxE,CAAC,CAAC,CAAA;IACP,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA;IACvC,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,115 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import { Menu as BaseMenu } from '@base-ui/react/menu';
3
+ import type { ComponentPropsWithRef, ReactElement } from 'react';
4
+ import type { LucideProps } from 'lucide-react';
5
+ /**
6
+ * OpenHandler gives a button menu-trigger behavior. Popup already includes its portal and positioner. Choose ButtonItem for actions and LinkItem for navigation. Use the matching checkbox/radio composition for persistent choices; submenu parts belong in SubMenuRoot.
7
+ *
8
+ * @example Complete composition
9
+ * import { Button, Menu } from '@central-ui/react'
10
+ *
11
+ * function Example() {
12
+ * return (
13
+ * <Menu.Root>
14
+ * <Menu.OpenHandler>
15
+ * <Button.default variant="primary">Options</Button.default>
16
+ * </Menu.OpenHandler>
17
+ * <Menu.Popup>
18
+ * <Menu.Group>
19
+ * <Menu.GroupLabel>Account</Menu.GroupLabel>
20
+ * <Menu.ItemsList>
21
+ * <Menu.ButtonItem onClick={() => console.log('Profile selected')}>
22
+ * Profile
23
+ * </Menu.ButtonItem>
24
+ * <Menu.LinkItem href="https://base-ui.com" target="_blank" rel="noreferrer">
25
+ * Base UI documentation
26
+ * </Menu.LinkItem>
27
+ * <Menu.ButtonItem disabled>Unavailable</Menu.ButtonItem>
28
+ * <Menu.ButtonItem tone="danger">Delete account</Menu.ButtonItem>
29
+ * </Menu.ItemsList>
30
+ * </Menu.Group>
31
+ * </Menu.Popup>
32
+ * </Menu.Root>
33
+ * )
34
+ * }
35
+ *
36
+ * @example Add a nested submenu
37
+ * // Place this inside the parent Menu.ItemsList.
38
+ * ;<Menu.SubMenuRoot>
39
+ * <Menu.SubMenuOpenButton>
40
+ * More options
41
+ * <Menu.SubMenuOpenButtonIcon />
42
+ * </Menu.SubMenuOpenButton>
43
+ * <Menu.Popup>
44
+ * <Menu.ItemsList>
45
+ * <Menu.ButtonItem onClick={() => console.log('Archived')}>Archive</Menu.ButtonItem>
46
+ * </Menu.ItemsList>
47
+ * </Menu.Popup>
48
+ * </Menu.SubMenuRoot>
49
+ */
50
+ export declare const Root: typeof BaseMenu.Root;
51
+ export declare const SubMenuRoot: typeof BaseMenu.SubmenuRoot;
52
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
53
+ export declare const OpenHandler: import("react").ForwardRefExoticComponent<Omit<Omit<BaseMenu.Trigger.Props<unknown>, "children" | "className" | "render"> & {
54
+ className?: string;
55
+ /** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
56
+ children: ReactElement;
57
+ }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
58
+ export type PopupProps = Omit<ComponentPropsWithRef<typeof BaseMenu.Popup>, 'className'> & {
59
+ className?: string;
60
+ } & Pick<BaseMenu.Portal.Props, 'container' | 'keepMounted'> & Pick<BaseMenu.Positioner.Props, 'anchor' | 'positionMethod' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'arrowPadding' | 'disableAnchorTracking' | 'collisionAvoidance'> & StyleProps;
61
+ /** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
62
+ export declare function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }: PopupProps & StyleProps): import("react").JSX.Element;
63
+ export declare const Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "children" | "dangerouslySetInnerHTML"> & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
64
+ export declare const Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuGroupProps, "className"> & {
65
+ className?: string;
66
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
67
+ /** Omit for an unlabeled/flat-looking group; keep the Group wrapper. Supply the heading only when grouping should be visible. */
68
+ export declare const GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuGroupLabelProps, "className"> & {
69
+ className?: string;
70
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
71
+ export declare const ItemsList: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
72
+ export declare const ButtonItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuItemProps, "className"> & {
73
+ className?: string;
74
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
75
+ tone?: "neutral" | "danger";
76
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
77
+ export declare const LinkItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuLinkItemProps, "className"> & {
78
+ className?: string;
79
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
80
+ export declare const RadioGroup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuRadioGroupProps, "className"> & {
81
+ className?: string;
82
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
83
+ export declare const SubMenuOpenButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuSubmenuTriggerProps, "className"> & {
84
+ className?: string;
85
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
86
+ export declare const Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SeparatorProps, "className"> & {
87
+ className?: string;
88
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
89
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
90
+ export declare const Icon: import("react").ForwardRefExoticComponent<Omit<LucideProps & {
91
+ /** Supply the decorative icon; the wrapper forwards the relevant state and preserves its classes. */
92
+ children: ReactElement<LucideProps>;
93
+ } & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
94
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
95
+ export declare const SubMenuOpenButtonIcon: import("react").ForwardRefExoticComponent<Omit<LucideProps & {
96
+ /** Omit for the supplied default icon; pass a child only to replace it. */
97
+ children?: ReactElement<LucideProps>;
98
+ } & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
99
+ export declare const CheckboxContainer: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
100
+ export declare const CheckboxButtonItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuCheckboxItemProps, "className" | "id" | "render" | "nativeButton"> & {
101
+ className?: string;
102
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
103
+ export declare const CheckboxLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "id" | "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
104
+ export declare const CheckboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuCheckboxItemIndicatorProps, "className"> & {
105
+ className?: string;
106
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
107
+ export declare const RadioContainer: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
108
+ export declare const RadioButtonItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuRadioItemProps, "className" | "id" | "render" | "nativeButton"> & {
109
+ className?: string;
110
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
111
+ export declare const RadioLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "id" | "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
112
+ export declare const RadioItemIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuRadioItemIndicatorProps, "className"> & {
113
+ className?: string;
114
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
115
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAUtD,OAAO,KAAK,EAEV,qBAAqB,EACrB,YAAY,EAEb,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,IAAI,sBAAgB,CAAA;AACjC,eAAO,MAAM,WAAW,6BAAuB,CAAA;AAC/C,8IAA8I;AAC9I,eAAO,MAAM,WA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AAiB;gBAEsC,MAAM;uEAYxE,CAAA;AAEF,eAAO,MAAM,SAAS;gBAEyC,MAAM;uEAYnE,CAAA;AAEF,wHAAwH;AACxH,eAAO,MAAM,IAAI;IAGb,qGAAqG;cAC3F,YAAY,CAAC,WAAW,CAAC;sEAcrC,CAAA;AAEF,8GAA8G;AAC9G,eAAO,MAAM,qBAAqB;IAG9B,2EAA2E;eAChE,YAAY,CAAC,WAAW,CAAC;sEAiBtC,CAAA;AAEF,eAAO,MAAM,iBAAiB,uNAyB5B,CAAA;AACF,eAAO,MAAM,kBAAkB;gBAKX,MAAM;uEA0BxB,CAAA;AACF,eAAO,MAAM,aAAa,2PAmBxB,CAAA;AACF,eAAO,MAAM,qBAAqB;gBAGlB,MAAM;wEAwBpB,CAAA;AAEF,eAAO,MAAM,cAAc,uNAyBzB,CAAA;AACF,eAAO,MAAM,eAAe;gBAKR,MAAM;uEAuBxB,CAAA;AACF,eAAO,MAAM,UAAU,2PAmBrB,CAAA;AACF,eAAO,MAAM,kBAAkB;gBAGf,MAAM;wEAkBpB,CAAA"}
@@ -0,0 +1,188 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Menu as BaseMenu } from '@base-ui/react/menu';
3
+ import { cloneElement, createContext, forwardRef, useContext, useEffect, useId, useState, } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { Check, ChevronRight } from 'lucide-react';
6
+ /**
7
+ * OpenHandler gives a button menu-trigger behavior. Popup already includes its portal and positioner. Choose ButtonItem for actions and LinkItem for navigation. Use the matching checkbox/radio composition for persistent choices; submenu parts belong in SubMenuRoot.
8
+ *
9
+ * @example Complete composition
10
+ * import { Button, Menu } from '@central-ui/react'
11
+ *
12
+ * function Example() {
13
+ * return (
14
+ * <Menu.Root>
15
+ * <Menu.OpenHandler>
16
+ * <Button.default variant="primary">Options</Button.default>
17
+ * </Menu.OpenHandler>
18
+ * <Menu.Popup>
19
+ * <Menu.Group>
20
+ * <Menu.GroupLabel>Account</Menu.GroupLabel>
21
+ * <Menu.ItemsList>
22
+ * <Menu.ButtonItem onClick={() => console.log('Profile selected')}>
23
+ * Profile
24
+ * </Menu.ButtonItem>
25
+ * <Menu.LinkItem href="https://base-ui.com" target="_blank" rel="noreferrer">
26
+ * Base UI documentation
27
+ * </Menu.LinkItem>
28
+ * <Menu.ButtonItem disabled>Unavailable</Menu.ButtonItem>
29
+ * <Menu.ButtonItem tone="danger">Delete account</Menu.ButtonItem>
30
+ * </Menu.ItemsList>
31
+ * </Menu.Group>
32
+ * </Menu.Popup>
33
+ * </Menu.Root>
34
+ * )
35
+ * }
36
+ *
37
+ * @example Add a nested submenu
38
+ * // Place this inside the parent Menu.ItemsList.
39
+ * ;<Menu.SubMenuRoot>
40
+ * <Menu.SubMenuOpenButton>
41
+ * More options
42
+ * <Menu.SubMenuOpenButtonIcon />
43
+ * </Menu.SubMenuOpenButton>
44
+ * <Menu.Popup>
45
+ * <Menu.ItemsList>
46
+ * <Menu.ButtonItem onClick={() => console.log('Archived')}>Archive</Menu.ButtonItem>
47
+ * </Menu.ItemsList>
48
+ * </Menu.Popup>
49
+ * </Menu.SubMenuRoot>
50
+ */
51
+ export const Root = BaseMenu.Root;
52
+ export const SubMenuRoot = BaseMenu.SubmenuRoot;
53
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
54
+ export const OpenHandler = forwardRef(function OpenHandler({ children, ...props }, ref) {
55
+ return _jsx(BaseMenu.Trigger, { ...props, ref: ref, render: children });
56
+ });
57
+ /** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
58
+ export function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side = 'bottom', sideOffset = 5, align = 'start', alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }) {
59
+ const baseStyle = {
60
+ maxHeight: 'var(--available-height)',
61
+ minWidth: 'var(--anchor-width)',
62
+ };
63
+ return (_jsx(BaseMenu.Portal, { container: container, keepMounted: keepMounted, children: _jsx(BaseMenu.Positioner, { anchor: anchor, positionMethod: positionMethod, side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, collisionBoundary: collisionBoundary, collisionPadding: collisionPadding, sticky: sticky, arrowPadding: arrowPadding, disableAnchorTracking: disableAnchorTracking, collisionAvoidance: collisionAvoidance, style: { zIndex: 80, maxWidth: 'var(--available-width)' }, children: _jsx(BaseMenu.Popup, { ...props, "data-component": "menu-popup", "data-style-disabled": disableStyle ? '' : undefined, className: className, style: typeof style === 'function'
64
+ ? (state) => ({ ...baseStyle, ...style(state) })
65
+ : { ...baseStyle, ...style } }) }) }));
66
+ }
67
+ export const Arrow = forwardRef(function Arrow({ disableStyle, className, style, ...props }, ref) {
68
+ return (_jsxs(BaseMenu.Arrow, { style: style, render: _jsx("svg", { ...props, ref: ref, "aria-hidden": true, width: "20", height: "10", viewBox: "0 0 20 10" }), "data-component": "menu-arrow", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: [_jsx("path", { d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z", "data-component": "menu-arrow-1" }), _jsx("path", { d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z", "data-component": "menu-arrow-2" }), _jsx("path", { d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z", "data-component": "menu-arrow-3" })] }));
69
+ });
70
+ export const Group = forwardRef(function Group({ disableStyle, className, ...props }, ref) {
71
+ return (_jsx(BaseMenu.Group, { ...props, ref: ref, "data-component": "menu-group", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
72
+ });
73
+ /** Omit for an unlabeled/flat-looking group; keep the Group wrapper. Supply the heading only when grouping should be visible. */
74
+ export const GroupLabel = forwardRef(function GroupLabel({ disableStyle, className, ...props }, ref) {
75
+ return (_jsx(BaseMenu.GroupLabel, { ...props, ref: ref, "data-component": "menu-grouplabel", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
76
+ });
77
+ export const ItemsList = forwardRef(function ItemsList({ disableStyle, className, ...props }, ref) {
78
+ return (_jsx("div", { ...props, ref: ref, "data-component": "menu-itemslist", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
79
+ });
80
+ export const ButtonItem = forwardRef(function ButtonItem({ disableStyle, className, tone = 'neutral', ...props }, ref) {
81
+ return (_jsx(BaseMenu.Item, { ...props, "data-tone": tone, ref: ref, "data-component": "menu-buttonitem", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
82
+ });
83
+ export const LinkItem = forwardRef(function LinkItem({ disableStyle, className, ...props }, ref) {
84
+ return (_jsx(BaseMenu.LinkItem, { ...props, ref: ref, "data-component": "menu-linkitem", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
85
+ });
86
+ export const RadioGroup = forwardRef(function RadioGroup({ disableStyle, className, ...props }, ref) {
87
+ return (_jsx(BaseMenu.RadioGroup, { ...props, ref: ref, "data-component": "menu-radiogroup", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
88
+ });
89
+ export const SubMenuOpenButton = forwardRef(function SubMenuOpenButton({ disableStyle, className, ...props }, ref) {
90
+ return (_jsx(BaseMenu.SubmenuTrigger, { ...props, ref: ref, "data-component": "menu-submenuopenbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
91
+ });
92
+ export const Separator = forwardRef(function Separator({ disableStyle, className, ...props }, ref) {
93
+ return (_jsx(BaseMenu.Separator, { ...props, ref: ref, "data-component": "menu-separator", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
94
+ });
95
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
96
+ export const Icon = forwardRef(function Icon({ disableStyle, children, className, ...props }, ref) {
97
+ return cloneElement(children, {
98
+ ...props,
99
+ ref,
100
+ 'aria-hidden': true,
101
+ ...{
102
+ 'data-component': 'menu-icon',
103
+ 'data-style-disabled': disableStyle ? '' : undefined,
104
+ },
105
+ className: twMerge(children?.props.className, className),
106
+ });
107
+ });
108
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
109
+ export const SubMenuOpenButtonIcon = forwardRef(function SubMenuOpenButtonIcon({ disableStyle, children, className, ...props }, ref) {
110
+ return cloneElement(children ?? _jsx(ChevronRight, {}), {
111
+ ...props,
112
+ ref,
113
+ 'aria-hidden': true,
114
+ ...{
115
+ 'data-component': 'menu-submenuopenbuttonicon',
116
+ 'data-style-disabled': disableStyle ? '' : undefined,
117
+ },
118
+ className: twMerge(children?.props.className, className),
119
+ });
120
+ });
121
+ export const CheckboxContainer = forwardRef(function CheckboxContainer({ disableStyle, className, ...props }, ref) {
122
+ const id = useId();
123
+ const [label, setLabel] = useState('');
124
+ const [state, setState] = useState({
125
+ checked: false,
126
+ disabled: false,
127
+ highlighted: false,
128
+ });
129
+ return (_jsx(CheckableContext.Provider, { value: { id, label, setLabel, state, setState }, children: _jsx("div", { ...props, ref: ref, "data-disabled": state.disabled ? '' : undefined, "data-highlighted": state.highlighted ? '' : undefined, "data-checked": state.checked ? '' : undefined, "data-component": "menu-checkboxcontainer", "data-style-disabled": disableStyle ? '' : undefined, className: className }) }));
130
+ });
131
+ export const CheckboxButtonItem = forwardRef(function CheckboxButtonItem({ disableStyle, className, label, ...props }, ref) {
132
+ const context = useCheckableContext();
133
+ return (_jsx(BaseMenu.CheckboxItem, { ...props, ref: ref, id: context.id, "aria-labelledby": context.id + '-label', label: label ?? context.label, nativeButton: true, "data-component": "menu-checkboxbuttonitem", "data-style-disabled": disableStyle ? '' : undefined, className: className, render: (buttonProps, state) => (_jsx(CheckableButtonSurface, { ...buttonProps, state: state })) }));
134
+ });
135
+ export const CheckboxLabel = forwardRef(function CheckboxLabel({ disableStyle, className, children, ...props }, ref) {
136
+ const context = useCheckableContext();
137
+ return (_jsx("label", { ...props, ref: ref, id: context.id + '-label', htmlFor: context.id, "data-disabled": context.state.disabled ? '' : undefined, "data-component": "menu-checkboxlabel", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: _jsx(CheckableLabelText, { children: children }) }));
138
+ });
139
+ export const CheckboxItemIndicator = forwardRef(function CheckboxItemIndicator({ disableStyle, children, className, ...props }, ref) {
140
+ return (_jsx(BaseMenu.CheckboxItemIndicator, { ...props, ref: ref, "data-component": "menu-checkboxitemindicator", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children ?? (_jsx(Check, { "aria-hidden": true, strokeWidth: 3.5, "data-component": "menu-checkboxitemindicator-1" })) }));
141
+ });
142
+ export const RadioContainer = forwardRef(function RadioContainer({ disableStyle, className, ...props }, ref) {
143
+ const id = useId();
144
+ const [label, setLabel] = useState('');
145
+ const [state, setState] = useState({
146
+ checked: false,
147
+ disabled: false,
148
+ highlighted: false,
149
+ });
150
+ return (_jsx(CheckableContext.Provider, { value: { id, label, setLabel, state, setState }, children: _jsx("div", { ...props, ref: ref, "data-disabled": state.disabled ? '' : undefined, "data-highlighted": state.highlighted ? '' : undefined, "data-checked": state.checked ? '' : undefined, "data-component": "menu-radiocontainer", "data-style-disabled": disableStyle ? '' : undefined, className: className }) }));
151
+ });
152
+ export const RadioButtonItem = forwardRef(function RadioButtonItem({ disableStyle, className, label, ...props }, ref) {
153
+ const context = useCheckableContext();
154
+ return (_jsx(BaseMenu.RadioItem, { ...props, ref: ref, id: context.id, "aria-labelledby": context.id + '-label', label: label ?? context.label, nativeButton: true, "data-component": "menu-radiobuttonitem", "data-style-disabled": disableStyle ? '' : undefined, className: className, render: (buttonProps, state) => (_jsx(CheckableButtonSurface, { ...buttonProps, state: state })) }));
155
+ });
156
+ export const RadioLabel = forwardRef(function RadioLabel({ disableStyle, className, children, ...props }, ref) {
157
+ const context = useCheckableContext();
158
+ return (_jsx("label", { ...props, ref: ref, id: context.id + '-label', htmlFor: context.id, "data-disabled": context.state.disabled ? '' : undefined, "data-component": "menu-radiolabel", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: _jsx(CheckableLabelText, { children: children }) }));
159
+ });
160
+ export const RadioItemIndicator = forwardRef(function RadioItemIndicator({ disableStyle, children, className, ...props }, ref) {
161
+ return (_jsx(BaseMenu.RadioItemIndicator, { ...props, ref: ref, "data-component": "menu-radioitemindicator", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children ?? _jsx("span", { "data-component": "menu-radioitemindicator-1" }) }));
162
+ });
163
+ const CheckableContext = createContext(null);
164
+ function useCheckableContext() {
165
+ const context = useContext(CheckableContext);
166
+ if (!context)
167
+ throw new Error('Menu checkable parts must be inside their Container');
168
+ return context;
169
+ }
170
+ const CheckableButtonSurface = forwardRef(function CheckableButtonSurface({ state, ...props }, ref) {
171
+ const { setState } = useCheckableContext();
172
+ useEffect(() => {
173
+ setState({
174
+ checked: state.checked,
175
+ disabled: state.disabled,
176
+ highlighted: state.highlighted,
177
+ });
178
+ }, [state.checked, state.disabled, state.highlighted, setState]);
179
+ return _jsx("button", { type: "button", ...props, ref: ref });
180
+ });
181
+ function CheckableLabelText({ children }) {
182
+ const { setLabel } = useCheckableContext();
183
+ return (_jsx("span", { ref: (element) => {
184
+ if (element)
185
+ setLabel(element.textContent ?? '');
186
+ }, children: children }));
187
+ }
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","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