@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 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/spinner/index.tsx"],"names":[],"mappings":";AAGA;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,oBACP,iBAAiB,yBACX,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,CAAC,KACV,KAAK,aAET,iBAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,oBAAiB,eAAe,GAAG,EAChE,iBACE,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,EAAE,EACL,UAAU,EAAE,CAAC,oBACE,mBAAmB,GAClC,EACD,KAAK,CAAC,QAAQ,IACX,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { GroupProps, PanelProps, SeparatorProps } from 'react-resizable-panels';
3
+ import type { ComponentProps, ReactNode } from 'react';
4
+ export { useGroupRef, useGroupCallbackRef, usePanelRef, usePanelCallbackRef, } from 'react-resizable-panels';
5
+ type CoreKeys = 'id' | 'orientation' | 'defaultLayout' | 'disableCursor' | 'disabled' | 'groupRef' | 'onLayoutChange' | 'onLayoutChanged' | 'resizePreviewMode' | 'resizeTargetMinimumSize';
6
+ export type RootProps = Pick<GroupProps, CoreKeys> & {
7
+ children?: ReactNode;
8
+ };
9
+ /**
10
+ * Keep ContentList inside Root and alternate Content panels with Separator/Handle between them. Root owns layout and resize behavior; ContentList is the visible group. Give the surrounding layout a usable size.
11
+ *
12
+ * @example Complete composition
13
+ * import { Splitter } from '@central-ui/react'
14
+ *
15
+ * function Example() {
16
+ * return (
17
+ * <div className="h-40 w-full">
18
+ * <Splitter.Root orientation="horizontal">
19
+ * <Splitter.ContentList>
20
+ * <Splitter.Content id="editor" defaultSize="50%" minSize="20%">
21
+ * <div className="p-3 text-sm">Editor</div>
22
+ * </Splitter.Content>
23
+ * <Splitter.Separator aria-label="Resize Editor and Preview">
24
+ * <Splitter.Handle />
25
+ * </Splitter.Separator>
26
+ * <Splitter.Content id="preview" defaultSize="50%" minSize="20%">
27
+ * <div className="p-3 text-sm">Preview</div>
28
+ * </Splitter.Content>
29
+ * </Splitter.ContentList>
30
+ * </Splitter.Root>
31
+ * </div>
32
+ * )
33
+ * }
34
+ *
35
+ * @example Stack panels vertically
36
+ * // Keep the Content/Separator composition and give the surrounding layout a height.
37
+ * ;<Splitter.Root orientation="vertical">
38
+ * {
39
+ * // Rest of components here
40
+ * }
41
+ * </Splitter.Root>
42
+ */
43
+ export declare function Root({ children, orientation, ...props }: RootProps): import("react").JSX.Element;
44
+ export type ContentListProps = Omit<GroupProps, CoreKeys> & StyleProps;
45
+ export declare function ContentList({ disableStyle, className, ...props }: ContentListProps & StyleProps): import("react").JSX.Element;
46
+ export declare function Content({ disableStyle, className, ...props }: PanelProps & StyleProps): import("react").JSX.Element;
47
+ export declare function Separator({ disableStyle, className, ...props }: SeparatorProps & StyleProps): import("react").JSX.Element;
48
+ export declare function Handle({ disableStyle, className, children, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/splitter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAMtD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACf,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAE/B,KAAK,QAAQ,GACT,IAAI,GACJ,aAAa,GACb,eAAe,GACf,eAAe,GACf,UAAU,GACV,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,yBAAyB,CAAA;AAC7B,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,SAAS,+BAMX;AACD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAA;AACtE,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,UAAU,+BAY/B;AACD,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,GAAG,UAAU,+BASzB;AACD,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,GAAG,UAAU,+BAW7B;AAED,wBAAgB,MAAM,CAAC,EACrB,YAAY,EACZ,SAAS,EACT,QAMC,EACD,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,+BAapC"}
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Group as ResizableGroup, Panel as ResizablePanel, Separator as ResizableSeparator, } from 'react-resizable-panels';
3
+ import { createContext, useContext } from 'react';
4
+ import { GripVertical } from 'lucide-react';
5
+ export { useGroupRef, useGroupCallbackRef, usePanelRef, usePanelCallbackRef, } from 'react-resizable-panels';
6
+ // Only configuration lives here. ContentList renders the measured native Group.
7
+ /**
8
+ * Keep ContentList inside Root and alternate Content panels with Separator/Handle between them. Root owns layout and resize behavior; ContentList is the visible group. Give the surrounding layout a usable size.
9
+ *
10
+ * @example Complete composition
11
+ * import { Splitter } from '@central-ui/react'
12
+ *
13
+ * function Example() {
14
+ * return (
15
+ * <div className="h-40 w-full">
16
+ * <Splitter.Root orientation="horizontal">
17
+ * <Splitter.ContentList>
18
+ * <Splitter.Content id="editor" defaultSize="50%" minSize="20%">
19
+ * <div className="p-3 text-sm">Editor</div>
20
+ * </Splitter.Content>
21
+ * <Splitter.Separator aria-label="Resize Editor and Preview">
22
+ * <Splitter.Handle />
23
+ * </Splitter.Separator>
24
+ * <Splitter.Content id="preview" defaultSize="50%" minSize="20%">
25
+ * <div className="p-3 text-sm">Preview</div>
26
+ * </Splitter.Content>
27
+ * </Splitter.ContentList>
28
+ * </Splitter.Root>
29
+ * </div>
30
+ * )
31
+ * }
32
+ *
33
+ * @example Stack panels vertically
34
+ * // Keep the Content/Separator composition and give the surrounding layout a height.
35
+ * ;<Splitter.Root orientation="vertical">
36
+ * {
37
+ * // Rest of components here
38
+ * }
39
+ * </Splitter.Root>
40
+ */
41
+ export function Root({ children, orientation = 'horizontal', ...props }) {
42
+ return (_jsx(SplitterContext.Provider, { value: { ...props, orientation }, children: children }));
43
+ }
44
+ export function ContentList({ disableStyle, className, ...props }) {
45
+ const context = useSplitterContext();
46
+ return (_jsx(ResizableGroup, { ...props, ...context, "data-orientation": context.orientation, "data-component": "splitter-contentlist", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
47
+ }
48
+ export function Content({ disableStyle, className, ...props }) {
49
+ return (_jsx(ResizablePanel, { ...props, "data-component": "splitter-content", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
50
+ }
51
+ export function Separator({ disableStyle, className, ...props }) {
52
+ const { orientation } = useSplitterContext();
53
+ return (_jsx(ResizableSeparator, { ...props, "data-orientation": orientation, "data-component": "splitter-separator", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
54
+ }
55
+ // Native Separator explicitly supports children for a custom grip; all resize behavior stays native.
56
+ export function Handle({ disableStyle, className, children = (_jsx(GripVertical, { "data-component": "splitter-handle-1", strokeWidth: 2, "aria-hidden": true })), ...props }) {
57
+ const { orientation } = useSplitterContext();
58
+ return (_jsx("div", { ...props, "data-orientation": orientation, "data-component": "splitter-handle", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children }));
59
+ }
60
+ const SplitterContext = createContext(null);
61
+ function useSplitterContext() {
62
+ const context = useContext(SplitterContext);
63
+ if (!context)
64
+ throw new Error('Splitter parts must be inside Splitter.Root');
65
+ return context;
66
+ }
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/splitter/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,IAAI,cAAc,EACvB,KAAK,IAAI,cAAc,EACvB,SAAS,IAAI,kBAAkB,GAChC,MAAM,wBAAwB,CAAA;AAM/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAc/B,gFAAgF;AAChF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,YACvD,QAAQ,GACgB,CAC5B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAA;IACpC,OAAO,CACL,KAAC,cAAc,OACT,KAAK,KACL,OAAO,sBACO,OAAO,CAAC,WAAW,oBACtB,sBAAsB,yBAChB,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EA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5E,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,82 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { UseStepsProps } from '@ark-ui/react/steps';
3
+ import { Steps } from '@ark-ui/react/steps';
4
+ import type { ReactElement } from 'react';
5
+ export declare function useSteps(props: UseStepsProps): import("@ark-ui/react/steps").UseStepsReturn;
6
+ export { useStepsContext } from '@ark-ui/react/steps';
7
+ export { useStepsItemContext } from '@ark-ui/react/steps';
8
+ /**
9
+ * Root owns the active step. Keep each Item in List with its index, and match Content indices to those items. NextHandler/PreviousHandler supply navigation to your buttons. Indicator reflects progress automatically; CompletedContent is shown after the last step.
10
+ *
11
+ * @example Complete composition
12
+ * import { Button, Stepper } from '@central-ui/react'
13
+ *
14
+ * function Example() {
15
+ * return (
16
+ * <Stepper.Root count={2} defaultStep={0}>
17
+ * <div className="flex items-start gap-4">
18
+ * <Stepper.List className="w-32 shrink-0">
19
+ * <Stepper.Item index={0}>
20
+ * <Stepper.OpenButton>
21
+ * <Stepper.Indicator />
22
+ * Details
23
+ * </Stepper.OpenButton>
24
+ * <Stepper.Separator />
25
+ * </Stepper.Item>
26
+ * <Stepper.Item index={1}>
27
+ * <Stepper.OpenButton>
28
+ * <Stepper.Indicator />
29
+ * Review
30
+ * </Stepper.OpenButton>
31
+ * </Stepper.Item>
32
+ * </Stepper.List>
33
+ * <div className="w-full flex flex-col gap-3">
34
+ * <Stepper.Content index={0}>Set your basics.</Stepper.Content>
35
+ * <Stepper.Content index={1}>Check everything.</Stepper.Content>
36
+ * <Stepper.CompletedContent>Done.</Stepper.CompletedContent>
37
+ * <div className="flex gap-2">
38
+ * <Stepper.PreviousHandler>
39
+ * <Button.default variant="secondary" size="small">
40
+ * Previous
41
+ * </Button.default>
42
+ * </Stepper.PreviousHandler>
43
+ * <Stepper.NextHandler>
44
+ * <Button.default variant="primary" size="small">
45
+ * Next
46
+ * </Button.default>
47
+ * </Stepper.NextHandler>
48
+ * </div>
49
+ * </div>
50
+ * </div>
51
+ * </Stepper.Root>
52
+ * )
53
+ * }
54
+ *
55
+ * @example Show the steps horizontally
56
+ * // Keep the same indexed Item and Content pairs.
57
+ * ;<Stepper.Root count={2} orientation="horizontal">
58
+ * {
59
+ * // Rest of components here
60
+ * }
61
+ * </Stepper.Root>
62
+ */
63
+ export declare function Root({ children, className, orientation, ...props }: Omit<Steps.RootProps, 'asChild'>): import("react").JSX.Element;
64
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
65
+ export declare function NextHandler({ children, ...props }: Omit<Steps.NextTriggerProps, 'asChild' | 'children'> & {
66
+ /** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
67
+ children: ReactElement;
68
+ }): import("react").JSX.Element;
69
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
70
+ export declare function PreviousHandler({ children, ...props }: Omit<Steps.PrevTriggerProps, 'asChild' | 'children'> & {
71
+ /** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
72
+ children: ReactElement;
73
+ }): import("react").JSX.Element;
74
+ export declare function List({ disableStyle, className, ...props }: Steps.ListProps & StyleProps): import("react").JSX.Element;
75
+ export declare function Item({ disableStyle, className, ...props }: Steps.ItemProps & StyleProps): import("react").JSX.Element;
76
+ /** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
77
+ export declare function Indicator({ disableStyle, className, ...props }: Omit<Steps.IndicatorProps, 'children'> & StyleProps): import("react").JSX.Element;
78
+ export declare function Separator({ disableStyle, className, ...props }: Steps.SeparatorProps & StyleProps): import("react").JSX.Element;
79
+ export declare function Content({ disableStyle, className, ...props }: Steps.ContentProps & StyleProps): import("react").JSX.Element;
80
+ export declare function CompletedContent({ disableStyle, className, ...props }: Steps.CompletedContentProps & StyleProps): import("react").JSX.Element;
81
+ export declare function OpenButton({ disableStyle, className, ...props }: Steps.TriggerProps & StyleProps): import("react").JSX.Element;
82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CAAC,SAAS,GAAG,UAAU,+BAS9B;AAED,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,SAAS,GAAG,UAAU,+BAS9B;AAED,kLAAkL;AAClL,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG,UAAU,+BAoBrD;AAED,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,GAAG,UAAU,+BASnC;AAED,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,YAAY,GAAG,UAAU,+BASjC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,qBAAqB,GAAG,UAAU,+BAS1C;AAED,wBAAgB,UAAU,CAAC,EACzB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,YAAY,GAAG,UAAU,+BASjC"}
@@ -0,0 +1,100 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Steps, useSteps as useArkSteps } from '@ark-ui/react/steps';
3
+ import { Check } from 'lucide-react';
4
+ // Creates a controlled steps state machine for RootProvider.
5
+ export function useSteps(props) {
6
+ return useArkSteps({ orientation: 'vertical', ...props });
7
+ }
8
+ // Reads the state of the nearest Steps root.
9
+ export { useStepsContext } from '@ark-ui/react/steps';
10
+ // Reads the state of the nearest Steps item.
11
+ export { useStepsItemContext } from '@ark-ui/react/steps';
12
+ /**
13
+ * Root owns the active step. Keep each Item in List with its index, and match Content indices to those items. NextHandler/PreviousHandler supply navigation to your buttons. Indicator reflects progress automatically; CompletedContent is shown after the last step.
14
+ *
15
+ * @example Complete composition
16
+ * import { Button, Stepper } from '@central-ui/react'
17
+ *
18
+ * function Example() {
19
+ * return (
20
+ * <Stepper.Root count={2} defaultStep={0}>
21
+ * <div className="flex items-start gap-4">
22
+ * <Stepper.List className="w-32 shrink-0">
23
+ * <Stepper.Item index={0}>
24
+ * <Stepper.OpenButton>
25
+ * <Stepper.Indicator />
26
+ * Details
27
+ * </Stepper.OpenButton>
28
+ * <Stepper.Separator />
29
+ * </Stepper.Item>
30
+ * <Stepper.Item index={1}>
31
+ * <Stepper.OpenButton>
32
+ * <Stepper.Indicator />
33
+ * Review
34
+ * </Stepper.OpenButton>
35
+ * </Stepper.Item>
36
+ * </Stepper.List>
37
+ * <div className="w-full flex flex-col gap-3">
38
+ * <Stepper.Content index={0}>Set your basics.</Stepper.Content>
39
+ * <Stepper.Content index={1}>Check everything.</Stepper.Content>
40
+ * <Stepper.CompletedContent>Done.</Stepper.CompletedContent>
41
+ * <div className="flex gap-2">
42
+ * <Stepper.PreviousHandler>
43
+ * <Button.default variant="secondary" size="small">
44
+ * Previous
45
+ * </Button.default>
46
+ * </Stepper.PreviousHandler>
47
+ * <Stepper.NextHandler>
48
+ * <Button.default variant="primary" size="small">
49
+ * Next
50
+ * </Button.default>
51
+ * </Stepper.NextHandler>
52
+ * </div>
53
+ * </div>
54
+ * </div>
55
+ * </Stepper.Root>
56
+ * )
57
+ * }
58
+ *
59
+ * @example Show the steps horizontally
60
+ * // Keep the same indexed Item and Content pairs.
61
+ * ;<Stepper.Root count={2} orientation="horizontal">
62
+ * {
63
+ * // Rest of components here
64
+ * }
65
+ * </Stepper.Root>
66
+ */
67
+ export function Root({ children, className, orientation = 'vertical', ...props }) {
68
+ return (_jsx(Steps.Root, { ...props, orientation: orientation, asChild: true, children: _jsx(_Fragment, { children: children }) }));
69
+ }
70
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
71
+ export function NextHandler({ children, ...props }) {
72
+ return (_jsx(Steps.NextTrigger, { ...props, asChild: true, children: children }));
73
+ }
74
+ /** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
75
+ export function PreviousHandler({ children, ...props }) {
76
+ return (_jsx(Steps.PrevTrigger, { ...props, asChild: true, children: children }));
77
+ }
78
+ export function List({ disableStyle, className, ...props }) {
79
+ return (_jsx(Steps.List, { "data-component": "stepper-list", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
80
+ }
81
+ export function Item({ disableStyle, className, ...props }) {
82
+ return (_jsx(Steps.Item, { "data-component": "stepper-item", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
83
+ }
84
+ /** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
85
+ export function Indicator({ disableStyle, className, ...props }) {
86
+ return (_jsx(Steps.ItemContext, { children: (step) => (_jsx(Steps.Indicator, { "data-component": "stepper-indicator", "data-style-disabled": disableStyle ? '' : undefined, "data-completed": step.completed ? '' : undefined, className: className, ...props, children: step.completed ? (_jsx(Check, { "data-component": "stepper-indicator-1", strokeWidth: 2.5 })) : (_jsx("span", { "data-component": "stepper-indicator-2" })) })) }));
87
+ }
88
+ export function Separator({ disableStyle, className, ...props }) {
89
+ return (_jsx(Steps.Separator, { "data-component": "stepper-separator", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
90
+ }
91
+ export function Content({ disableStyle, className, ...props }) {
92
+ return (_jsx(Steps.Content, { "data-component": "stepper-content", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
93
+ }
94
+ export function CompletedContent({ disableStyle, className, ...props }) {
95
+ return (_jsx(Steps.CompletedContent, { "data-component": "stepper-completedcontent", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
96
+ }
97
+ export function OpenButton({ disableStyle, className, ...props }) {
98
+ return (_jsx(Steps.Trigger, { "data-component": "stepper-openbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
99
+ }
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/stepper/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAIpC,6DAA6D;AAC7D,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,WAAW,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;AAC3D,CAAC;AAED,6CAA6C;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,6CAA6C;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,WAAW,GAAG,UAAU,EACxB,GAAG,KAAK,EACyB;IACjC,OAAO,CACL,KAAC,KAAK,CAAC,IAAI,OAAK,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,kBACtD,4BAAG,QAAQ,GAAI,GACJ,CACd,CAAA;AACH,CAAC;AAED,8IAA8I;AAC9I,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAG,KAAK,EAIT;IACC,OAAO,CACL,KAAC,KAAK,CAAC,WAAW,OAAK,KAAK,EAAE,OAAO,kBAClC,QAAQ,GACS,CACrB,CAAA;AACH,CAAC;AAED,8IAA8I;AAC9I,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,GAAG,KAAK,EAIT;IACC,OAAO,CACL,KAAC,KAAK,CAAC,WAAW,OAAK,KAAK,EAAE,OAAO,kBAClC,QAAQ,GACS,CACrB,CAAA;AACH,CAAC;AAED,MAA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,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACwB;IAChC,OAAO,CACL,KAAC,KAAK,CAAC,OAAO,sBACG,iBAAiB,yBACX,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACiC;IACzC,OAAO,CACL,KAAC,KAAK,CAAC,gBAAgB,sBACN,0BAA0B,yBACpB,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACwB;IAChC,OAAO,CACL,KAAC,KAAK,CAAC,OAAO,sBACG,oBAAoB,yBACd,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import { Switch as BaseSwitch } from '@base-ui/react/switch';
3
+ import type { ReactNode } from 'react';
4
+ type CoreKeys = 'checked' | 'defaultChecked' | 'onCheckedChange' | 'disabled' | 'readOnly' | 'required' | 'name' | 'value' | 'uncheckedValue' | 'form' | 'id' | 'inputRef';
5
+ export type RootProps = Pick<BaseSwitch.Root.Props, CoreKeys> & {
6
+ children: ReactNode;
7
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
8
+ tone?: 'neutral' | 'valid' | 'invalid';
9
+ };
10
+ /**
11
+ * Keep Button, Indicator, and Label in the same Root. Indicator follows the checked state automatically; do not add a second boolean just for its position.
12
+ *
13
+ * @example Complete composition
14
+ * import { Switch } from '@central-ui/react'
15
+ *
16
+ * function Example() {
17
+ * return (
18
+ * <Switch.Root name="notifications">
19
+ * <Switch.Container>
20
+ * <Switch.Button>
21
+ * <Switch.Indicator />
22
+ * </Switch.Button>
23
+ * <Switch.Label>Email notifications</Switch.Label>
24
+ * <Switch.Description>Receive updates about your account.</Switch.Description>
25
+ * </Switch.Container>
26
+ * </Switch.Root>
27
+ * )
28
+ * }
29
+ *
30
+ * @example Enable the setting initially
31
+ * // The same Indicator follows the initial checked state automatically.
32
+ * ;<Switch.Root defaultChecked name="notifications">
33
+ * <Switch.Container>
34
+ * {
35
+ * // Rest of components here
36
+ * }
37
+ * </Switch.Container>
38
+ * </Switch.Root>
39
+ */
40
+ export declare function Root({ children, tone, checked, defaultChecked, onCheckedChange, id, ...props }: RootProps): import("react").JSX.Element;
41
+ export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
42
+ export declare const Button: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SwitchRootProps, "className" | "render" | "nativeButton" | CoreKeys> & {
43
+ className?: string;
44
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
45
+ /** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
46
+ export declare const Indicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SwitchThumbProps, "className"> & {
47
+ className?: string;
48
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
49
+ /** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
50
+ export declare const Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
51
+ export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
52
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
53
+ export declare const Error: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
54
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
55
+ export declare const Success: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
56
+ export {};
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAS5D,OAAO,KAAK,EAAkB,SAAS,EAA4B,MAAM,OAAO,CAAA;AAIhF,KAAK,QAAQ,GACT,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,MAAM,GACN,IAAI,GACJ,UAAU,CAAA;AACd,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG;IAC9D,QAAQ,EAAE,SAAS,CAAA;IACnB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;CACvC,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,IAAgB,EAChB,OAAO,EACP,cAAsB,EACtB,eAAe,EACf,EAAE,EACF,GAAG,KAAK,EACT,EAAE,SAAS,+BAsBX;AACD,eAAO,MAAM,SAAS,uNAapB,CAAA;AAEF,eAAO,MAAM,MAAM;gBAKC,MAAM;oEAqBxB,CAAA;AACF,kLAAkL;AAClL,eAAO,MAAM,SAAS;gBAEuC,MAAM;wEAYjE,CAAA;AAEF,oHAAoH;AACpH,eAAO,MAAM,KAAK,oPAgBhB,CAAA;AACF,eAAO,MAAM,WAAW,uNAetB,CAAA;AAEF,iHAAiH;AACjH,eAAO,MAAM,KAAK,uNAiBhB,CAAA;AAEF,iHAAiH;AACjH,eAAO,MAAM,OAAO,uNAiBlB,CAAA"}
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Switch as BaseSwitch } from '@base-ui/react/switch';
3
+ import { createContext, forwardRef, useContext, useEffect, useId, useState, } from 'react';
4
+ import { ToneProvider, useToneContext } from "../../utils/Tone.js";
5
+ /**
6
+ * Keep Button, Indicator, and Label in the same Root. Indicator follows the checked state automatically; do not add a second boolean just for its position.
7
+ *
8
+ * @example Complete composition
9
+ * import { Switch } from '@central-ui/react'
10
+ *
11
+ * function Example() {
12
+ * return (
13
+ * <Switch.Root name="notifications">
14
+ * <Switch.Container>
15
+ * <Switch.Button>
16
+ * <Switch.Indicator />
17
+ * </Switch.Button>
18
+ * <Switch.Label>Email notifications</Switch.Label>
19
+ * <Switch.Description>Receive updates about your account.</Switch.Description>
20
+ * </Switch.Container>
21
+ * </Switch.Root>
22
+ * )
23
+ * }
24
+ *
25
+ * @example Enable the setting initially
26
+ * // The same Indicator follows the initial checked state automatically.
27
+ * ;<Switch.Root defaultChecked name="notifications">
28
+ * <Switch.Container>
29
+ * {
30
+ * // Rest of components here
31
+ * }
32
+ * </Switch.Container>
33
+ * </Switch.Root>
34
+ */
35
+ export function Root({ children, tone = 'neutral', checked, defaultChecked = false, onCheckedChange, id, ...props }) {
36
+ const generatedId = useId();
37
+ const [messageIds, setMessageIds] = useState([]);
38
+ const [checkedInternalState, setCheckedInternalState] = useState(defaultChecked);
39
+ return (_jsx(SwitchContext.Provider, { value: {
40
+ messageIds,
41
+ setMessageIds,
42
+ ...props,
43
+ id: id ?? generatedId,
44
+ checked: checked ?? checkedInternalState,
45
+ onCheckedChange: (next, details) => {
46
+ onCheckedChange?.(next, details);
47
+ if (!details.isCanceled)
48
+ setCheckedInternalState(next);
49
+ },
50
+ }, children: _jsx(ToneProvider, { value: tone, children: children }) }));
51
+ }
52
+ export const Container = forwardRef(function Container({ disableStyle, className, ...props }, ref) {
53
+ return (_jsx("div", { ...props, ref: ref, "data-component": "switch-container", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
54
+ });
55
+ export const Button = forwardRef(function Button({ disableStyle, className, ...props }, ref) {
56
+ const { messageIds, setMessageIds, ...context } = useSwitchContext();
57
+ const tone = useToneContext();
58
+ return (_jsx(BaseSwitch.Root, { ...props, ...context, "aria-invalid": tone === 'invalid' || props['aria-invalid'] || undefined, "aria-describedby": [props['aria-describedby'], ...messageIds].filter(Boolean).join(' ') ||
59
+ undefined, ref: ref, "data-tone": tone, "data-component": "switch-button", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
60
+ });
61
+ /** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
62
+ export const Indicator = forwardRef(function Indicator({ disableStyle, className, ...props }, ref) {
63
+ return (_jsx(BaseSwitch.Thumb, { ...props, ref: ref, "data-component": "switch-indicator", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
64
+ });
65
+ /** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
66
+ export const Label = forwardRef(function Label({ disableStyle, className, ...props }, ref) {
67
+ const context = useSwitchContext();
68
+ return (_jsx("label", { ...props, ref: ref, htmlFor: context.id, "data-disabled": context.disabled ? '' : undefined, "data-component": "switch-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
69
+ });
70
+ export const Description = forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
71
+ const messageId = useMessageId(id);
72
+ return (_jsx("div", { id: messageId, ...props, ref: ref, "data-component": "switch-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
73
+ });
74
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
75
+ export const Error = forwardRef(function Error({ disableStyle, className, id, ...props }, ref) {
76
+ const messageId = useMessageId(id);
77
+ return (_jsx("div", { id: messageId, ...props, ref: ref, role: "alert", "aria-atomic": "true", "data-component": "switch-error", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
78
+ });
79
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
80
+ export const Success = forwardRef(function Success({ disableStyle, className, id, ...props }, ref) {
81
+ const messageId = useMessageId(id);
82
+ return (_jsx("div", { id: messageId, ...props, ref: ref, role: "status", "aria-atomic": "true", "data-component": "switch-success", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
83
+ });
84
+ const SwitchContext = createContext(null);
85
+ function useSwitchContext() {
86
+ const context = useContext(SwitchContext);
87
+ if (!context)
88
+ throw new globalThis.Error('Switch parts must be inside Switch.Root');
89
+ return context;
90
+ }
91
+ function useMessageId(id) {
92
+ const generatedId = useId();
93
+ const messageId = id ?? generatedId;
94
+ const { setMessageIds } = useSwitchContext();
95
+ useEffect(() => {
96
+ setMessageIds((current) => [...current, messageId]);
97
+ return () => setMessageIds((current) => current.filter((value) => value !== messageId));
98
+ }, [messageId, setMessageIds]);
99
+ return messageId;
100
+ }
101
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":";AACA,O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AAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAA;IAC9E,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAA;IAC9B,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,110 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { ComponentProps, HTMLAttributes, ImgHTMLAttributes, ReactElement, ReactNode } from 'react';
3
+ type Pinning = 'first' | 'last';
4
+ /**
5
+ * Use Root → Surface → ScrollArea → Table for the scrolling table composition. Render your own data rows. Empty is manually controlled; the table does not inspect data to show it. Set pinning on Root when an edge column should remain visible while scrolling.
6
+ *
7
+ * To virtualize, import useVirtualizedTable from '@central-ui/react'.
8
+ * See the hook's types and documentation for configuration and integration examples.
9
+ *
10
+ * @example Complete composition
11
+ * import { Table } from '@central-ui/react'
12
+ *
13
+ * const orders = [
14
+ * {
15
+ * customer: 'Alex Morgan',
16
+ * number: '#1048',
17
+ * status: 'Paid',
18
+ * channel: 'Online',
19
+ * region: 'North',
20
+ * date: 'Sep 28',
21
+ * total: '$248.00',
22
+ * },
23
+ * {
24
+ * customer: 'Sam Lee',
25
+ * number: '#1049',
26
+ * status: 'Pending',
27
+ * channel: 'Retail',
28
+ * region: 'West',
29
+ * date: 'Sep 29',
30
+ * total: '$86.00',
31
+ * },
32
+ * {
33
+ * customer: 'Taylor Reed',
34
+ * number: '#1050',
35
+ * status: 'Paid',
36
+ * channel: 'Online',
37
+ * region: 'East',
38
+ * date: 'Sep 30',
39
+ * total: '$139.00',
40
+ * },
41
+ * ]
42
+ * function Example() {
43
+ * return (
44
+ * <Table.Root>
45
+ * <Table.Surface>
46
+ * <Table.ScrollArea>
47
+ * <Table.Table>
48
+ * <Table.Head>
49
+ * <Table.Row>
50
+ * <Table.HeadCell>Customer</Table.HeadCell>
51
+ * <Table.HeadCell>Status</Table.HeadCell>
52
+ * <Table.HeadCell>Total</Table.HeadCell>
53
+ * </Table.Row>
54
+ * </Table.Head>
55
+ * <Table.Body>
56
+ * {orders.map((order) => (
57
+ * <Table.Row key={order.number}>
58
+ * <Table.Cell>{order.customer}</Table.Cell>
59
+ * <Table.Cell>{order.status}</Table.Cell>
60
+ * <Table.Cell>{order.total}</Table.Cell>
61
+ * </Table.Row>
62
+ * ))}
63
+ * </Table.Body>
64
+ * </Table.Table>
65
+ * </Table.ScrollArea>
66
+ * </Table.Surface>
67
+ * </Table.Root>
68
+ * )
69
+ * }
70
+ *
71
+ * @example Keep the first column visible during scrolling
72
+ * // Keep the same Surface/ScrollArea/Table composition; no sticky classes needed on cells.
73
+ * ;<Table.Root pinning="first">
74
+ * <Table.Surface>
75
+ * {
76
+ * // Rest of components here
77
+ * }
78
+ * </Table.Surface>
79
+ * </Table.Root>
80
+ */
81
+ export declare function Root({ pinning, children, }: {
82
+ /** Keep the requested edge column visible while scrolling. Cells receive the current pinning state automatically. */
83
+ pinning?: Pinning;
84
+ children: ReactNode;
85
+ }): import("react").JSX.Element;
86
+ export declare function Surface({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
87
+ export declare function SurfaceHeader({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
88
+ export declare function SurfaceFooter({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
89
+ export declare function ScrollArea({ disableStyle, className, onScroll, style, ...props }: Omit<ComponentProps<'div'>, 'ref'> & StyleProps): import("react").JSX.Element;
90
+ export declare function Table({ disableStyle, className, ...props }: ComponentProps<'table'> & StyleProps): import("react").JSX.Element;
91
+ export declare function ColGroup({ disableStyle, className, ...props }: ComponentProps<'colgroup'> & StyleProps): import("react").JSX.Element;
92
+ export declare function Col({ disableStyle, className, ...props }: ComponentProps<'col'> & StyleProps): import("react").JSX.Element;
93
+ export declare function Head({ disableStyle, className, ...props }: ComponentProps<'thead'> & StyleProps): import("react").JSX.Element;
94
+ export declare const Body: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLTableSectionElement> & HTMLAttributes<HTMLTableSectionElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
95
+ export declare const Row: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLTableRowElement> & HTMLAttributes<HTMLTableRowElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLTableRowElement>>;
96
+ export declare function HeadCell({ disableStyle, className, ...props }: ComponentProps<'th'> & StyleProps): import("react").JSX.Element;
97
+ export declare function Cell({ disableStyle, className, ...props }: ComponentProps<'td'> & StyleProps): import("react").JSX.Element;
98
+ export declare function Empty({ disableStyle, className, children, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
99
+ export declare function EmptyBody({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
100
+ export declare function EmptyTitle({ disableStyle, className, ...props }: HTMLAttributes<HTMLParagraphElement> & StyleProps): import("react").JSX.Element;
101
+ export declare function EmptyDescription({ disableStyle, className, ...props }: ComponentProps<'p'> & StyleProps): import("react").JSX.Element;
102
+ export declare function EmptyImage({ disableStyle, className, ...props }: ImgHTMLAttributes<HTMLImageElement> & StyleProps): import("react").JSX.Element;
103
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
104
+ export declare function EmptyIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
105
+ /** Supply the decorative icon; the wrapper forwards the relevant state and preserves its classes. */
106
+ children: ReactElement<ComponentProps<'svg'>>;
107
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
108
+ export declare function EmptyActionsList({ disableStyle, className, children, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
109
+ export {};
110
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAA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