@central-ui/react 0.0.0-stage → 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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -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,61 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cloneElement } from 'react';
3
+ import { twMerge } from 'tailwind-merge';
4
+ /**
5
+ * Compose Surface and Body for an empty-state panel. You decide when the panel appears; it does not inspect your data. Image/Icon and ActionsList are optional ways to explain the state and offer a next action.
6
+ *
7
+ * @example Complete composition
8
+ * import { Button, Empty } from '@central-ui/react'
9
+ * import { FolderOpen } from 'lucide-react'
10
+ *
11
+ * function Example() {
12
+ * return (
13
+ * <Empty.Surface>
14
+ * <Empty.Body>
15
+ * <Empty.Icon>
16
+ * <FolderOpen aria-hidden="true" />
17
+ * </Empty.Icon>
18
+ * <Empty.Title>No projects yet</Empty.Title>
19
+ * <Empty.Description>Create a project to get started.</Empty.Description>
20
+ * <Empty.ActionsList>
21
+ * <Button.default variant="secondary" size="small">
22
+ * Create project
23
+ * </Button.default>
24
+ * </Empty.ActionsList>
25
+ * </Empty.Body>
26
+ * </Empty.Surface>
27
+ * )
28
+ * }
29
+ */
30
+ export function Surface({ disableStyle, className, children, ...props }) {
31
+ return (_jsx("div", { "data-component": "empty-surface", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props, children: children }));
32
+ }
33
+ export function Body({ disableStyle, className, ...props }) {
34
+ return (_jsx("div", { ...props, "data-component": "empty-body", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
35
+ }
36
+ export function Title({ disableStyle, className, ...props }) {
37
+ return (_jsx("p", { "data-component": "empty-title", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
38
+ }
39
+ export function Description({ disableStyle, className, ...props }) {
40
+ return (_jsx("p", { "data-component": "empty-description", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
41
+ }
42
+ export function Image({ disableStyle, className, ...props }) {
43
+ return (_jsx("img", { alt: "Empty", "data-component": "empty-image", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
44
+ }
45
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
46
+ export function Icon({ disableStyle, children, className, ...props }) {
47
+ return cloneElement(children, {
48
+ ...children.props,
49
+ ...props,
50
+ ...{
51
+ 'data-component': 'empty-icon',
52
+ 'data-style-disabled': disableStyle ? '' : undefined,
53
+ },
54
+ className: twMerge(children.props.className, className),
55
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
56
+ });
57
+ }
58
+ export function ActionsList({ disableStyle, className, ...props }) {
59
+ return (_jsx("div", { "data-component": "empty-actionslist", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
60
+ }
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/empty/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,eAAe,yBACT,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,YAER,QAAQ,GACL,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,OAAO,CACL,iBACM,KAAK,oBACM,YAAY,yBACN,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,OAAO,CACL,8BACiB,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,OAAO,CACL,8BACiB,mBAAmB,yBACb,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACyC;IACjD,OAAO,CACL,cACE,GAAG,EAAC,OAAO,oBACI,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,wHAAwH;AACxH,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EAKE;IACV,OAAO,YAAY,CAAC,QAAQ,EAAE;QAC5B,GAAG,QAAQ,CAAC,KAAK;QACjB,GAAG,KAAK;QACR,GAAG;YACD,gBAAgB,EAAE,YAAY;YAC9B,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;QACvD,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,GAAG;KACpE,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,mBAAmB,yBACb,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,107 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import { FileUpload as ArkFileUpload, type FileUploadFileRejection } from '@ark-ui/react/file-upload';
3
+ import type { ComponentProps, ReactElement, ReactNode } from 'react';
4
+ /**
5
+ * Root manages accepted/rejected files, validation, and picker behavior. Dropzone/FilePickerOpenButton open the picker; do not add a second file input. FileList supplies entries; pass each entry file and status to File. FileThumbnail chooses image preview versus fallback automatically.
6
+ *
7
+ * @example Complete composition
8
+ * import { FileUpload } from '@central-ui/react'
9
+ *
10
+ * function Example() {
11
+ * return (
12
+ * <FileUpload.Root accept="image/png,image/jpeg" maxFileSize={10 * 1024 * 1024}>
13
+ * <FileUpload.Container>
14
+ * <FileUpload.Label>Profile image</FileUpload.Label>
15
+ * <FileUpload.Dropzone>
16
+ * <FileUpload.UploadIcon />
17
+ * <FileUpload.Title>Drop an image here</FileUpload.Title>
18
+ * <FileUpload.Description>PNG or JPG up to 10 MB.</FileUpload.Description>
19
+ * <FileUpload.FilePickerOpenButton>Browse image</FileUpload.FilePickerOpenButton>
20
+ * <FileUpload.FileList>
21
+ * {({ file, status }) => (
22
+ * <FileUpload.File file={file} status={status}>
23
+ * <FileUpload.FileThumbnail>
24
+ * <FileUpload.FileThumbnailIcon />
25
+ * </FileUpload.FileThumbnail>
26
+ * <FileUpload.FileName />
27
+ * <FileUpload.FileSize />
28
+ * {status === 'rejected' && <FileUpload.FileErrorText />}
29
+ * <FileUpload.FileRemoveButton>
30
+ * <FileUpload.FileRemoveButtonIcon />
31
+ * </FileUpload.FileRemoveButton>
32
+ * </FileUpload.File>
33
+ * )}
34
+ * </FileUpload.FileList>
35
+ * </FileUpload.Dropzone>
36
+ * </FileUpload.Container>
37
+ * </FileUpload.Root>
38
+ * )
39
+ * }
40
+ *
41
+ * @example Accept just one PDF document
42
+ * // Keep the same Dropzone and FileList composition.
43
+ * ;<FileUpload.Root accept="application/pdf" maxFiles={1}>
44
+ * {
45
+ * // Rest of components here
46
+ * }
47
+ * </FileUpload.Root>
48
+ */
49
+ export declare function Root({ children, ...props }: Omit<ArkFileUpload.RootProps, 'asChild'>): import("react").JSX.Element;
50
+ export declare function Container({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
51
+ export declare function Label({ disableStyle, className, ...props }: ArkFileUpload.LabelProps & StyleProps): import("react").JSX.Element;
52
+ export declare function Dropzone({ disableStyle, children, className, ...props }: ArkFileUpload.DropzoneProps & StyleProps): import("react").JSX.Element;
53
+ export declare function FilePickerOpenButton({ disableStyle, className, ...props }: ArkFileUpload.TriggerProps & StyleProps): import("react").JSX.Element;
54
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
55
+ export declare function UploadIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
56
+ /** Omit for the supplied default icon; pass a child only to replace it. */
57
+ children?: ReactElement<ComponentProps<'svg'>>;
58
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
59
+ export declare function Title({ disableStyle, className, ...props }: ComponentProps<'p'> & StyleProps): import("react").JSX.Element;
60
+ export declare function Description({ disableStyle, className, ...props }: ComponentProps<'p'> & StyleProps): import("react").JSX.Element;
61
+ export declare function FileList({ disableStyle, children, className, style, onClick, ...props }: (Omit<ComponentProps<'ul'>, 'children'> & {
62
+ /** Render File for each entry, passing its file and status. Both accepted and rejected entries are supplied; no second list-merging step needed. */
63
+ children: (entry: {
64
+ /** Pass the file supplied by FileList so preview, name, size, and removal all refer to the same file. */
65
+ file: FileUploadFileRejection['file'];
66
+ /** Pass the status from the FileList entry so rejected files get the matching error/removal behavior. */
67
+ status: 'accepted' | 'rejected';
68
+ /** Reasons the file was rejected. FileErrorText already presents them; read this only for custom error presentation. */
69
+ errors: FileUploadFileRejection['errors'];
70
+ }) => ReactNode;
71
+ }) & StyleProps): import("react").JSX.Element;
72
+ export declare function File({ disableStyle, status, className, children, ...props }: (ArkFileUpload.ItemProps & {
73
+ /** Pass the status from the FileList entry so rejected files get the matching error/removal behavior. */
74
+ status: 'accepted' | 'rejected';
75
+ }) & StyleProps): import("react").JSX.Element;
76
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
77
+ export declare function FileErrorText({ disableStyle, children, className, ...props }: ComponentProps<'p'> & StyleProps): import("react").JSX.Element;
78
+ export declare function FilePreview({ disableStyle, className, ...props }: ArkFileUpload.ItemPreviewProps & StyleProps): import("react").JSX.Element;
79
+ export declare function FilePreviewImage({ disableStyle, className, ...props }: ArkFileUpload.ItemPreviewImageProps & StyleProps): import("react").JSX.Element;
80
+ /** Chooses image preview versus fallback from the file type automatically. Supply fallback content for non-image files; do not add a second file-type condition. */
81
+ export declare function FileThumbnail({ disableStyle, children, className, ...props }: Omit<ArkFileUpload.ItemPreviewProps, 'type' | 'children'> & {
82
+ children?: ReactNode;
83
+ } & StyleProps): import("react").JSX.Element;
84
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
85
+ export declare function FileThumbnailIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
86
+ /** Omit for the supplied default icon; pass a child only to replace it. */
87
+ children?: ReactElement<ComponentProps<'svg'>>;
88
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
89
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
90
+ export declare function FileName({ disableStyle, className, ...props }: ArkFileUpload.ItemNameProps & StyleProps): import("react").JSX.Element;
91
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
92
+ export declare function FileSize({ disableStyle, className, ...props }: ArkFileUpload.ItemSizeTextProps & StyleProps): import("react").JSX.Element;
93
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
94
+ export declare function FileRemoveHandler({ children, ...props }: Omit<ArkFileUpload.ItemDeleteTriggerProps, 'asChild' | 'children'> & {
95
+ /** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
96
+ children: ReactElement;
97
+ }): import("react").JSX.Element;
98
+ /** Removes the surrounding file automatically, including rejected entries. No extra removal click handler needed. */
99
+ export declare function FileRemoveButton({ disableStyle, children, className, ...props }: (Omit<ArkFileUpload.ItemDeleteTriggerProps, 'asChild' | 'children'> & {
100
+ children?: ReactNode;
101
+ }) & StyleProps): import("react").JSX.Element;
102
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
103
+ export declare function FileRemoveButtonIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
104
+ /** Omit for the supplied default icon; pass a child only to replace it. */
105
+ children?: ReactElement<ComponentProps<'svg'>>;
106
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
107
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/fileupload/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACL,UAAU,IAAI,aAAa,EAG3B,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,+BAO1C;AAED,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,+BASpC;AACD,wBAAgB,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,UAAU,GAAG,UAAU,+BASvC;AAED,wBAAgB,QAAQ,CAAC,EACvB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,aAAa,GAAG,UAAU,+BAY1C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,SAAS,EACT,GAAG,KA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,+BAU9C;AAED,8IAA8I;AAC9I,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IACtE,2GAA2G;IAC3G,QAAQ,EAAE,YAAY,CAAA;CACvB,+BAOA;AAED,qHAAqH;AACrH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IACvE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAC,GACA,UAAU,+BAaX;AAED,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,QAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5C,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;CAC/C,CAAC,GACA,UAAU,8GAcX"}
@@ -0,0 +1,185 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FileUpload as ArkFileUpload, useFileUpload, useFileUploadContext, } from '@ark-ui/react/file-upload';
3
+ import { File as FileIcon, Upload, X } from 'lucide-react';
4
+ import { cloneElement, createContext, useContext, Fragment } from 'react';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { arkStateToDataAttributes } from "../../utils/ArkStateToDataAttributes.js";
7
+ /**
8
+ * Root manages accepted/rejected files, validation, and picker behavior. Dropzone/FilePickerOpenButton open the picker; do not add a second file input. FileList supplies entries; pass each entry file and status to File. FileThumbnail chooses image preview versus fallback automatically.
9
+ *
10
+ * @example Complete composition
11
+ * import { FileUpload } from '@central-ui/react'
12
+ *
13
+ * function Example() {
14
+ * return (
15
+ * <FileUpload.Root accept="image/png,image/jpeg" maxFileSize={10 * 1024 * 1024}>
16
+ * <FileUpload.Container>
17
+ * <FileUpload.Label>Profile image</FileUpload.Label>
18
+ * <FileUpload.Dropzone>
19
+ * <FileUpload.UploadIcon />
20
+ * <FileUpload.Title>Drop an image here</FileUpload.Title>
21
+ * <FileUpload.Description>PNG or JPG up to 10 MB.</FileUpload.Description>
22
+ * <FileUpload.FilePickerOpenButton>Browse image</FileUpload.FilePickerOpenButton>
23
+ * <FileUpload.FileList>
24
+ * {({ file, status }) => (
25
+ * <FileUpload.File file={file} status={status}>
26
+ * <FileUpload.FileThumbnail>
27
+ * <FileUpload.FileThumbnailIcon />
28
+ * </FileUpload.FileThumbnail>
29
+ * <FileUpload.FileName />
30
+ * <FileUpload.FileSize />
31
+ * {status === 'rejected' && <FileUpload.FileErrorText />}
32
+ * <FileUpload.FileRemoveButton>
33
+ * <FileUpload.FileRemoveButtonIcon />
34
+ * </FileUpload.FileRemoveButton>
35
+ * </FileUpload.File>
36
+ * )}
37
+ * </FileUpload.FileList>
38
+ * </FileUpload.Dropzone>
39
+ * </FileUpload.Container>
40
+ * </FileUpload.Root>
41
+ * )
42
+ * }
43
+ *
44
+ * @example Accept just one PDF document
45
+ * // Keep the same Dropzone and FileList composition.
46
+ * ;<FileUpload.Root accept="application/pdf" maxFiles={1}>
47
+ * {
48
+ * // Rest of components here
49
+ * }
50
+ * </FileUpload.Root>
51
+ */
52
+ export function Root({ children, ...props }) {
53
+ const file_upload = useFileUpload(props);
54
+ return (_jsx(ArkFileUpload.RootProvider, { value: file_upload, asChild: true, children: _jsx(_Fragment, { children: children }) }));
55
+ }
56
+ export function Container({ disableStyle, className, ...props }) {
57
+ return (_jsx("div", { "data-component": "fileupload-container", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
58
+ }
59
+ export function Label({ disableStyle, className, ...props }) {
60
+ return (_jsx(ArkFileUpload.Label, { ...props, "data-component": "fileupload-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
61
+ }
62
+ export function Dropzone({ disableStyle, children, className, ...props }) {
63
+ return (_jsxs(ArkFileUpload.Dropzone, { ...props, "data-component": "fileupload-dropzone", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: [children, _jsx(ArkFileUpload.HiddenInput, {})] }));
64
+ }
65
+ export function FilePickerOpenButton({ disableStyle, className, ...props }) {
66
+ return (_jsx(ArkFileUpload.Trigger, { ...props, "data-component": "fileupload-filepickeropenbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
67
+ }
68
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
69
+ export function UploadIcon({ disableStyle, children = _jsx(Upload, {}), className, ...props }) {
70
+ const file_upload = useFileUploadContext();
71
+ return cloneElement(children, {
72
+ ...children.props,
73
+ ...props,
74
+ ...arkStateToDataAttributes(file_upload),
75
+ ...useFileStatusAttributes(),
76
+ ...{
77
+ 'data-component': 'fileupload-uploadicon',
78
+ 'data-style-disabled': disableStyle ? '' : undefined,
79
+ },
80
+ className: twMerge(children.props.className, className),
81
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.8,
82
+ });
83
+ }
84
+ export function Title({ disableStyle, className, ...props }) {
85
+ const file_upload = useFileUploadContext();
86
+ return (_jsx("p", { ...props, ...arkStateToDataAttributes(file_upload), ...useFileStatusAttributes(), "data-component": "fileupload-title", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
87
+ }
88
+ export function Description({ disableStyle, className, ...props }) {
89
+ const file_upload = useFileUploadContext();
90
+ return (_jsx("p", { ...props, ...arkStateToDataAttributes(file_upload), ...useFileStatusAttributes(), "data-component": "fileupload-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
91
+ }
92
+ // Keep Ark's accepted and rejected arrays native; only merge their presentation.
93
+ export function FileList({ disableStyle, children, className, style, onClick, ...props }) {
94
+ const upload = useFileUploadContext();
95
+ const entries = [
96
+ ...upload.acceptedFiles.map((file) => ({
97
+ file,
98
+ status: 'accepted',
99
+ errors: [],
100
+ })),
101
+ ...upload.rejectedFiles.map((rejection) => ({
102
+ ...rejection,
103
+ status: 'rejected',
104
+ })),
105
+ ];
106
+ return (_jsx("ul", { ...props, style: { ...style, cursor: 'default' }, onClick: (event) => {
107
+ // Clicks anywhere in the file list must not open the surrounding Dropzone.
108
+ event.stopPropagation();
109
+ onClick?.(event);
110
+ }, "data-component": "fileupload-filelist", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: entries.map((entry, index) => (_jsx(FileStatusContext.Provider, { value: entry, children: children(entry) }, entry.status + ':' + index))) }));
111
+ }
112
+ export function File({ disableStyle, status, className, children, ...props }) {
113
+ const entry = useContext(FileStatusContext);
114
+ return (_jsx(ArkFileUpload.ItemGroup, { type: status, asChild: true, children: _jsx(Fragment, { children: _jsx(FileStatusContext.Provider, { value: { status, errors: entry.errors }, children: _jsx(ArkFileUpload.Item, { ...props, "data-status": status, "data-component": "fileupload-file", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children }) }) }) }));
115
+ }
116
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
117
+ export function FileErrorText({ disableStyle, children, className, ...props }) {
118
+ const entry = useContext(FileStatusContext);
119
+ return (_jsx("p", { ...props, role: "alert", "data-status": entry.status, "data-component": "fileupload-fileerrortext", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children ?? entry.errors.join(', ') }));
120
+ }
121
+ export function FilePreview({ disableStyle, className, ...props }) {
122
+ return (_jsx(ArkFileUpload.ItemPreview, { ...props, ...useFileStatusAttributes(), "data-component": "fileupload-filepreview", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
123
+ }
124
+ export function FilePreviewImage({ disableStyle, className, ...props }) {
125
+ return (_jsx(ArkFileUpload.ItemPreviewImage, { ...props, ...useFileStatusAttributes(), "data-component": "fileupload-filepreviewimage", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
126
+ }
127
+ /** Chooses image preview versus fallback from the file type automatically. Supply fallback content for non-image files; do not add a second file-type condition. */
128
+ export function FileThumbnail({ disableStyle, children, className, ...props }) {
129
+ return (_jsxs(_Fragment, { children: [_jsx(FilePreview, { type: "image/*", className: className, ...props, disableStyle: disableStyle, children: _jsx(FilePreviewImage, { disableStyle: disableStyle }) }), _jsx(FilePreview, { type: "^(?!image/).*", className: className, disableStyle: disableStyle, children: children })] }));
130
+ }
131
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
132
+ export function FileThumbnailIcon({ disableStyle, children = _jsx(FileIcon, {}), className, ...props }) {
133
+ const file_upload = useFileUploadContext();
134
+ return cloneElement(children, {
135
+ ...children.props,
136
+ ...props,
137
+ ...arkStateToDataAttributes(file_upload),
138
+ ...useFileStatusAttributes(),
139
+ ...{
140
+ 'data-component': 'fileupload-filethumbnailicon',
141
+ 'data-style-disabled': disableStyle ? '' : undefined,
142
+ },
143
+ className: twMerge(children.props.className, className),
144
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1,
145
+ });
146
+ }
147
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
148
+ export function FileName({ disableStyle, className, ...props }) {
149
+ return (_jsx(ArkFileUpload.ItemName, { ...props, ...useFileStatusAttributes(), "data-component": "fileupload-filename", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
150
+ }
151
+ /** Reads the surrounding File automatically. Omit children to keep the supplied text; override only for custom presentation. */
152
+ export function FileSize({ disableStyle, className, ...props }) {
153
+ return (_jsx(ArkFileUpload.ItemSizeText, { ...props, ...useFileStatusAttributes(), "data-component": "fileupload-filesize", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
154
+ }
155
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
156
+ export function FileRemoveHandler({ children, ...props }) {
157
+ const attributes = useFileStatusAttributes();
158
+ return (_jsx(ArkFileUpload.ItemDeleteTrigger, { ...props, ...attributes, asChild: true, children: children }));
159
+ }
160
+ /** Removes the surrounding file automatically, including rejected entries. No extra removal click handler needed. */
161
+ export function FileRemoveButton({ disableStyle, children, className, ...props }) {
162
+ return (_jsx(ArkFileUpload.ItemDeleteTrigger, { ...props, ...useFileStatusAttributes(), asChild: false, "data-component": "fileupload-fileremovebutton", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children }));
163
+ }
164
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
165
+ export function FileRemoveButtonIcon({ disableStyle, children = _jsx(X, {}), className, ...props }) {
166
+ const file_upload = useFileUploadContext();
167
+ return cloneElement(children, {
168
+ ...children.props,
169
+ ...props,
170
+ ...arkStateToDataAttributes(file_upload),
171
+ ...useFileStatusAttributes(),
172
+ ...{
173
+ 'data-component': 'fileupload-fileremovebuttonicon',
174
+ 'data-style-disabled': disableStyle ? '' : undefined,
175
+ },
176
+ className: twMerge(children.props.className, className),
177
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 2,
178
+ });
179
+ }
180
+ // Each rendered row shares rejection details with its parts, without mirroring upload state.
181
+ const FileStatusContext = createContext({ errors: [] });
182
+ function useFileStatusAttributes() {
183
+ return { 'data-status': useContext(FileStatusContext).status };
184
+ }
185
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/fileupload/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,aAAa,EACb,oBAAoB,GAErB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,wBAAw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AO,CACL,KAAC,aAAa,CAAC,iBAAiB,OAC1B,KAAK,KACL,uBAAuB,EAAE,EAC7B,OAAO,EAAE,KAAK,oBACC,6BAA6B,yBACvB,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACuB,CACnC,CAAA;AACH,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,oBAAoB,CAAC,EACnC,YAAY,EACZ,QAAQ,GAAG,KAAC,CAAC,KAAG,EAChB,SAAS,EACT,GAAG,KAAK,EAKE;IACV,MAAM,WAAW,GAAG,oBAAoB,EAAE,CAAA;IAC1C,OAAO,YAAY,CAAC,QAAQ,EAAE;QAC5B,GAAG,QAAQ,CAAC,KAAK;QACjB,GAAG,KAAK;QACR,GAAG,wBAAwB,CAAC,WAAW,CAAC;QACxC,GAAG,uBAAuB,EAAE;QAC5B,GAAG;YACD,gBAAgB,EAAE,iCAAiC;YACnD,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;QACvD,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC;KAClE,CAAC,CAAA;AACJ,CAAC;AAED,6FAA6F;AAC7F,MAAM,iBAAiB,GAAG,aAAa,CAIpC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAA;AAClB,SAAS,uBAAuB;IAC9B,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAA;AAChE,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { FormHTMLAttributes } from 'react';
3
+ /**
4
+ * Use Form for native form submission and your own validation strategy. It supplies layout only; field state, validation, and submission handlers belong to your application.
5
+ *
6
+ * @example Complete composition
7
+ * import { Button, Form } from '@central-ui/react'
8
+ *
9
+ * function Example() {
10
+ * return (
11
+ * <Form.Form>
12
+ * <label className="flex flex-col gap-1 text-sm text-neutral-900">
13
+ * Name
14
+ * <input
15
+ * className="h-8 rounded-lg border border-neutral-400 px-2"
16
+ * defaultValue="Alex"
17
+ * />
18
+ * </label>
19
+ * <label className="flex flex-col gap-1 text-sm text-neutral-900">
20
+ * Email
21
+ * <input
22
+ * className="h-8 rounded-lg border border-neutral-400 px-2"
23
+ * defaultValue="alex@example.com"
24
+ * />
25
+ * </label>
26
+ * <Button.default variant="primary" size="small">
27
+ * Save changes
28
+ * </Button.default>
29
+ * </Form.Form>
30
+ * )
31
+ * }
32
+ */
33
+ export declare function Form({ disableStyle, className, ...props }: FormHTMLAttributes<HTMLFormElement> & StyleProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,UAAU,+BASlD"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Use Form for native form submission and your own validation strategy. It supplies layout only; field state, validation, and submission handlers belong to your application.
4
+ *
5
+ * @example Complete composition
6
+ * import { Button, Form } from '@central-ui/react'
7
+ *
8
+ * function Example() {
9
+ * return (
10
+ * <Form.Form>
11
+ * <label className="flex flex-col gap-1 text-sm text-neutral-900">
12
+ * Name
13
+ * <input
14
+ * className="h-8 rounded-lg border border-neutral-400 px-2"
15
+ * defaultValue="Alex"
16
+ * />
17
+ * </label>
18
+ * <label className="flex flex-col gap-1 text-sm text-neutral-900">
19
+ * Email
20
+ * <input
21
+ * className="h-8 rounded-lg border border-neutral-400 px-2"
22
+ * defaultValue="alex@example.com"
23
+ * />
24
+ * </label>
25
+ * <Button.default variant="primary" size="small">
26
+ * Save changes
27
+ * </Button.default>
28
+ * </Form.Form>
29
+ * )
30
+ * }
31
+ */
32
+ export function Form({ disableStyle, className, ...props }) {
33
+ return (_jsx("form", { "data-component": "form-form", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
34
+ }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACyC;IACjD,OAAO,CACL,iCACiB,WAAW,yBACL,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,85 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import { Input as BaseInput } from '@base-ui/react/input';
3
+ import type { LucideProps } from 'lucide-react';
4
+ import type { ComponentProps, ReactElement, ReactNode } from 'react';
5
+ export type RootProps = Pick<BaseInput.Props, 'id' | 'name' | 'form' | 'value' | 'defaultValue' | 'onValueChange' | 'disabled' | 'readOnly' | 'required' | 'type'> & {
6
+ children?: ReactNode;
7
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
8
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
9
+ tone?: 'neutral' | 'valid' | 'invalid';
10
+ };
11
+ /**
12
+ * 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.
13
+ *
14
+ * @example Complete composition
15
+ * import { Input } from '@central-ui/react'
16
+ *
17
+ * function Example() {
18
+ * return (
19
+ * <Input.Root defaultValue="Hello" name="message">
20
+ * <Input.Container>
21
+ * <Input.Label>Text</Input.Label>
22
+ * <Input.InputGroup>
23
+ * <Input.Input placeholder="Enter text" />
24
+ * <Input.Addon>
25
+ * <Input.AddonClearButton>
26
+ * <Input.AddonClearButtonIcon />
27
+ * </Input.AddonClearButton>
28
+ * </Input.Addon>
29
+ * </Input.InputGroup>
30
+ * <Input.Description>Enter your message.</Input.Description>
31
+ * </Input.Container>
32
+ * </Input.Root>
33
+ * )
34
+ * }
35
+ *
36
+ * @example Control the input from application state
37
+ * import { useState } from 'react'
38
+ * function ControlledExample() {
39
+ * const [value, setValue] = useState('')
40
+ * return (
41
+ * <Input.Root value={value} onValueChange={setValue}>
42
+ * {
43
+ * // Rest of components here
44
+ * }
45
+ * </Input.Root>
46
+ * )
47
+ * }
48
+ */
49
+ export declare function Root({ children, id, tone, value, defaultValue, onValueChange, disabled, readOnly, required, ...coreProps }: RootProps): import("react").JSX.Element;
50
+ export type InputProps = Omit<BaseInput.Props, keyof Pick<RootProps, 'id' | 'name' | 'form' | 'value' | 'defaultValue' | 'onValueChange' | 'disabled' | 'readOnly' | 'required' | 'type'> | 'className' | 'render'> & {
51
+ className?: string;
52
+ } & StyleProps;
53
+ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").InputProps, "form" | "className" | "defaultValue" | "id" | "name" | "type" | "disabled" | "value" | "render" | "onValueChange" | "required" | "readOnly"> & {
54
+ className?: string;
55
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
56
+ export declare const InputGroup: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
57
+ export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
58
+ /** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
59
+ export declare const Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
60
+ export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
61
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
62
+ export declare const Error: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
63
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
64
+ export declare const Success: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
65
+ export declare const Addon: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
66
+ /** Choose the preset appearance; this does not add action behavior. */
67
+ variant?: "normal" | "emphasized";
68
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
69
+ export declare const AddonText: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
70
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
71
+ export declare function AddonIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
72
+ /** Supply the decorative icon; the wrapper forwards the relevant state and preserves its classes. */
73
+ children: ReactElement<ComponentProps<'svg'>>;
74
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
75
+ export declare const AddonButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
76
+ /** Built-in icon; no children needed. Use it inside its matching control. */
77
+ export declare const AddonLoadingIcon: import("react").ForwardRefExoticComponent<Omit<Omit<LucideProps, "children"> & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
78
+ /** Clears the control automatically; no clearing click handler needed. Supply the clear icon and an accessible name. */
79
+ export declare const AddonClearButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
80
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
81
+ export declare function AddonClearButtonIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
82
+ /** Omit for the supplied default icon; pass a child only to replace it. */
83
+ children?: ReactElement<ComponentProps<'svg'>>;
84
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
85
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,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