@rockshin/tao-ui 0.0.59 → 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 (420) hide show
  1. package/README.md +5 -1
  2. package/component-manifest.json +1 -1
  3. package/dist/components/affix/affix.css +1 -1
  4. package/dist/components/affix/affix.d.ts +1 -0
  5. package/dist/components/affix/affix.js +18 -17
  6. package/dist/components/alert/alert.css +123 -119
  7. package/dist/components/alert/alert.js +78 -188
  8. package/dist/components/app/app-modals.js +49 -98
  9. package/dist/components/app/app-notices.d.ts +2 -2
  10. package/dist/components/app/app-notices.js +294 -243
  11. package/dist/components/app/app-types.d.ts +6 -3
  12. package/dist/components/app/app.css +185 -183
  13. package/dist/components/app/app.js +1 -1
  14. package/dist/components/auto-complete/auto-complete.css +30 -28
  15. package/dist/components/auto-complete/auto-complete.d.ts +3 -1
  16. package/dist/components/auto-complete/auto-complete.js +2 -1
  17. package/dist/components/badge/badge.js +42 -127
  18. package/dist/components/border-beam/border-beam.css +1 -1
  19. package/dist/components/border-beam/border-beam.d.ts +1 -0
  20. package/dist/components/border-beam/border-beam.js +1 -0
  21. package/dist/components/breadcrumb/breadcrumb.css +123 -120
  22. package/dist/components/breadcrumb/breadcrumb.js +160 -265
  23. package/dist/components/button/button.d.ts +1 -1
  24. package/dist/components/button/button.js +52 -151
  25. package/dist/components/calendar/calendar.js +28 -27
  26. package/dist/components/card/card-tabs.d.ts +56 -5
  27. package/dist/components/card/card-tabs.js +214 -468
  28. package/dist/components/card/card.d.ts +1 -2
  29. package/dist/components/card/card.js +64 -226
  30. package/dist/components/carousel/carousel.css +1 -1
  31. package/dist/components/carousel/carousel.d.ts +59 -4
  32. package/dist/components/carousel/carousel.js +299 -243
  33. package/dist/components/cascader/cascader.css +186 -184
  34. package/dist/components/cascader/cascader.d.ts +3 -1
  35. package/dist/components/cascader/cascader.js +29 -34
  36. package/dist/components/checkbox/checkbox.css +93 -90
  37. package/dist/components/checkbox/checkbox.d.ts +1 -1
  38. package/dist/components/checkbox/checkbox.js +171 -499
  39. package/dist/components/collapse/collapse-panels.js +145 -400
  40. package/dist/components/collapse/collapse.css +172 -170
  41. package/dist/components/collapse/collapse.d.ts +1 -1
  42. package/dist/components/collapse/collapse.js +62 -181
  43. package/dist/components/color-picker/color-picker.css +1 -1
  44. package/dist/components/color-picker/color-picker.js +418 -981
  45. package/dist/components/context-menu/context-menu.css +4 -4
  46. package/dist/components/context-menu/context-menu.d.ts +3 -1
  47. package/dist/components/context-menu/context-menu.js +54 -135
  48. package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
  49. package/dist/components/date-picker/calendar/calendar-header.js +171 -337
  50. package/dist/components/date-picker/calendar/month-grid.js +33 -103
  51. package/dist/components/date-picker/calendar/time-panel.js +84 -209
  52. package/dist/components/date-picker/calendar/year-grid.js +36 -105
  53. package/dist/components/date-picker/date-localization.js +1 -1
  54. package/dist/components/date-picker/date-picker.css +599 -642
  55. package/dist/components/date-picker/date-picker.d.ts +2 -1
  56. package/dist/components/date-picker/date-picker.js +96 -105
  57. package/dist/components/date-picker/presets.js +12 -37
  58. package/dist/components/date-picker/range-picker.d.ts +2 -1
  59. package/dist/components/date-picker/range-picker.js +222 -255
  60. package/dist/components/date-picker/types.d.ts +2 -1
  61. package/dist/components/descriptions/descriptions.css +1 -1
  62. package/dist/components/descriptions/descriptions.js +30 -39
  63. package/dist/components/drawer/drawer.css +202 -200
  64. package/dist/components/drawer/drawer.js +28 -34
  65. package/dist/components/dropdown/dropdown-core.d.ts +32 -0
  66. package/dist/components/dropdown/dropdown-core.js +156 -0
  67. package/dist/components/dropdown/dropdown.css +38 -36
  68. package/dist/components/dropdown/dropdown.d.ts +4 -30
  69. package/dist/components/dropdown/dropdown.js +91 -271
  70. package/dist/components/empty/empty.css +30 -28
  71. package/dist/components/empty/empty.js +81 -236
  72. package/dist/components/float-button/float-button.css +1 -1
  73. package/dist/components/float-button/float-button.js +38 -48
  74. package/dist/components/form/field-control.js +2 -3
  75. package/dist/components/form/form-item.js +67 -129
  76. package/dist/components/form/form.css +36 -34
  77. package/dist/components/form/form.d.ts +1 -1
  78. package/dist/components/form/form.js +29 -100
  79. package/dist/components/form/index.d.ts +1 -1
  80. package/dist/components/form/use-form.js +48 -66
  81. package/dist/components/form-actions/form-actions.d.ts +1 -0
  82. package/dist/components/form-actions/form-actions.js +10 -36
  83. package/dist/components/form-field/form-field-view.d.ts +1 -0
  84. package/dist/components/form-field/form-field-view.js +81 -288
  85. package/dist/components/form-field/form-field.js +13 -31
  86. package/dist/components/form-field/form.css +74 -72
  87. package/dist/components/form-section/form-section.d.ts +1 -0
  88. package/dist/components/form-section/form-section.js +38 -91
  89. package/dist/components/image/image-icons.js +16 -31
  90. package/dist/components/image/image.css +1 -1
  91. package/dist/components/image/image.js +298 -911
  92. package/dist/components/input/base-input.d.ts +3 -1
  93. package/dist/components/input/base-input.js +8 -7
  94. package/dist/components/input/input-shared.css +62 -60
  95. package/dist/components/input/input-shared.d.ts +1 -1
  96. package/dist/components/input/input-shared.js +56 -100
  97. package/dist/components/input/input.css +222 -220
  98. package/dist/components/input/otp.d.ts +2 -1
  99. package/dist/components/input/otp.js +143 -324
  100. package/dist/components/input/password.js +12 -67
  101. package/dist/components/input/search.js +13 -13
  102. package/dist/components/input-number/input-number.d.ts +4 -2
  103. package/dist/components/input-number/input-number.js +30 -137
  104. package/dist/components/list/list-pagination.css +107 -105
  105. package/dist/components/list/list-pagination.d.ts +56 -5
  106. package/dist/components/list/list-pagination.js +249 -316
  107. package/dist/components/list/list.css +179 -177
  108. package/dist/components/list/list.js +170 -604
  109. package/dist/components/listy/listy.css +55 -53
  110. package/dist/components/listy/listy.d.ts +43 -4
  111. package/dist/components/listy/listy.js +198 -216
  112. package/dist/components/masonry/masonry.css +1 -1
  113. package/dist/components/masonry/masonry.d.ts +1 -0
  114. package/dist/components/masonry/masonry.js +90 -244
  115. package/dist/components/mentions/mentions.css +153 -151
  116. package/dist/components/mentions/mentions.d.ts +53 -11
  117. package/dist/components/mentions/mentions.js +291 -75
  118. package/dist/components/menu/menu-render.d.ts +7 -0
  119. package/dist/components/menu/menu-render.js +156 -302
  120. package/dist/components/menu/menu.css +142 -140
  121. package/dist/components/modal/confirm-dialog.js +19 -24
  122. package/dist/components/modal/modal.css +165 -162
  123. package/dist/components/modal/modal.js +285 -731
  124. package/dist/components/modal/use-modal.js +25 -25
  125. package/dist/components/pagination/pagination.css +134 -131
  126. package/dist/components/pagination/pagination.d.ts +4 -3
  127. package/dist/components/pagination/pagination.js +138 -281
  128. package/dist/components/popconfirm/popconfirm.css +38 -36
  129. package/dist/components/popconfirm/popconfirm.js +105 -288
  130. package/dist/components/popover/popover.css +89 -87
  131. package/dist/components/popover/popover.js +189 -469
  132. package/dist/components/progress/progress.css +153 -151
  133. package/dist/components/progress/progress.js +34 -43
  134. package/dist/components/qr-code/qr-code.css +36 -34
  135. package/dist/components/qr-code/qr-code.js +83 -277
  136. package/dist/components/radio/radio.css +95 -92
  137. package/dist/components/radio/radio.d.ts +1 -1
  138. package/dist/components/radio/radio.js +114 -376
  139. package/dist/components/rate/rate.css +80 -78
  140. package/dist/components/rate/rate.d.ts +34 -6
  141. package/dist/components/rate/rate.js +160 -244
  142. package/dist/components/result/result.css +59 -57
  143. package/dist/components/result/result.d.ts +1 -0
  144. package/dist/components/result/result.js +118 -291
  145. package/dist/components/scroll-area/scroll-area.css +160 -148
  146. package/dist/components/scroll-area/scroll-area.js +284 -488
  147. package/dist/components/segmented/segmented.css +1 -1
  148. package/dist/components/segmented/segmented.js +59 -58
  149. package/dist/components/select/mobile-select.css +166 -164
  150. package/dist/components/select/mobile-select.js +48 -131
  151. package/dist/components/select/select-icons.js +59 -128
  152. package/dist/components/select/select-model.js +1 -1
  153. package/dist/components/select/select-searchable-list.js +19 -19
  154. package/dist/components/select/select-tags.js +70 -156
  155. package/dist/components/select/select-types.d.ts +2 -1
  156. package/dist/components/select/select.css +509 -506
  157. package/dist/components/select/select.d.ts +1 -0
  158. package/dist/components/select/select.js +67 -65
  159. package/dist/components/select/use-select-selection.js +181 -261
  160. package/dist/components/skeleton/skeleton.css +105 -103
  161. package/dist/components/skeleton/skeleton.js +140 -399
  162. package/dist/components/slider/slider.css +160 -158
  163. package/dist/components/slider/slider.d.ts +45 -6
  164. package/dist/components/slider/slider.js +359 -74
  165. package/dist/components/sonner/index.d.ts +1 -1
  166. package/dist/components/sonner/sonner.css +190 -182
  167. package/dist/components/sonner/sonner.js +12 -11
  168. package/dist/components/spinner/spinner.css +80 -76
  169. package/dist/components/spinner/spinner.d.ts +1 -1
  170. package/dist/components/spinner/spinner.js +75 -219
  171. package/dist/components/splitter/splitter.css +157 -154
  172. package/dist/components/splitter/splitter.js +271 -448
  173. package/dist/components/statistic/statistic.css +1 -1
  174. package/dist/components/statistic/statistic.js +121 -406
  175. package/dist/components/status-icon/status-icon.js +14 -26
  176. package/dist/components/steps/steps-icons.js +63 -100
  177. package/dist/components/steps/steps.css +817 -807
  178. package/dist/components/steps/steps.d.ts +1 -1
  179. package/dist/components/steps/steps.js +38 -94
  180. package/dist/components/steps/use-display-steps.js +21 -54
  181. package/dist/components/switch/switch-touch.css +17 -15
  182. package/dist/components/switch/switch.css +192 -190
  183. package/dist/components/switch/switch.js +63 -196
  184. package/dist/components/table/table-filter.d.ts +3 -1
  185. package/dist/components/table/table-filter.js +72 -133
  186. package/dist/components/table/table-icons.js +77 -152
  187. package/dist/components/table/table-summary.js +30 -77
  188. package/dist/components/table/table-types.d.ts +2 -1
  189. package/dist/components/table/table.css +468 -465
  190. package/dist/components/table/table.js +86 -84
  191. package/dist/components/table/use-table-data.js +137 -248
  192. package/dist/components/tabs/tabs.css +123 -120
  193. package/dist/components/tabs/tabs.d.ts +4 -3
  194. package/dist/components/tabs/tabs.js +157 -322
  195. package/dist/components/tag/tag.css +231 -221
  196. package/dist/components/tag/tag.js +110 -248
  197. package/dist/components/textarea/textarea.css +2 -1
  198. package/dist/components/textarea/textarea.d.ts +3 -1
  199. package/dist/components/textarea/textarea.js +16 -15
  200. package/dist/components/time-picker/time-picker.d.ts +1 -0
  201. package/dist/components/time-picker/time-picker.js +91 -221
  202. package/dist/components/timeline/timeline.css +1 -1
  203. package/dist/components/timeline/timeline.js +17 -17
  204. package/dist/components/tooltip/tooltip.css +79 -77
  205. package/dist/components/tooltip/tooltip.d.ts +1 -1
  206. package/dist/components/tooltip/tooltip.js +111 -263
  207. package/dist/components/tour/tour.css +1 -1
  208. package/dist/components/tour/tour.d.ts +59 -6
  209. package/dist/components/tour/tour.js +343 -622
  210. package/dist/components/transfer/transfer-list.js +19 -19
  211. package/dist/components/transfer/transfer-parts.js +63 -139
  212. package/dist/components/transfer/transfer.css +192 -190
  213. package/dist/components/transfer/transfer.js +57 -56
  214. package/dist/components/tree/tree-check.js +25 -32
  215. package/dist/components/tree/tree-keyboard.js +1 -1
  216. package/dist/components/tree/tree.css +204 -200
  217. package/dist/components/tree/tree.js +139 -277
  218. package/dist/components/tree-select/select-engine.css +200 -197
  219. package/dist/components/tree-select/select-engine.js +11 -38
  220. package/dist/components/tree-select/tree-select.css +21 -19
  221. package/dist/components/tree-select/tree-select.d.ts +3 -1
  222. package/dist/components/tree-select/tree-select.js +12 -10
  223. package/dist/components/upload/upload.js +193 -308
  224. package/dist/components/watermark/watermark-context.js +8 -14
  225. package/dist/components/watermark/watermark.css +1 -1
  226. package/dist/components/watermark/watermark.js +209 -400
  227. package/dist/docs/components/stack.doc.js +1 -1
  228. package/dist/docs/components/table.doc.js +1 -1
  229. package/dist/entries/affix.d.ts +0 -2
  230. package/dist/entries/affix.js +0 -2
  231. package/dist/entries/alert.d.ts +0 -2
  232. package/dist/entries/alert.js +0 -2
  233. package/dist/entries/app.d.ts +0 -2
  234. package/dist/entries/app.js +0 -2
  235. package/dist/entries/auto-complete.d.ts +0 -2
  236. package/dist/entries/auto-complete.js +0 -2
  237. package/dist/entries/avatar.d.ts +0 -2
  238. package/dist/entries/avatar.js +0 -2
  239. package/dist/entries/badge.d.ts +0 -2
  240. package/dist/entries/badge.js +0 -2
  241. package/dist/entries/border-beam.d.ts +0 -2
  242. package/dist/entries/border-beam.js +0 -2
  243. package/dist/entries/breadcrumb.d.ts +0 -2
  244. package/dist/entries/breadcrumb.js +0 -2
  245. package/dist/entries/button.d.ts +0 -2
  246. package/dist/entries/button.js +0 -2
  247. package/dist/entries/calendar.d.ts +0 -2
  248. package/dist/entries/calendar.js +0 -2
  249. package/dist/entries/card.d.ts +0 -2
  250. package/dist/entries/card.js +0 -2
  251. package/dist/entries/carousel.d.ts +0 -2
  252. package/dist/entries/carousel.js +0 -2
  253. package/dist/entries/cascader.d.ts +0 -2
  254. package/dist/entries/cascader.js +0 -2
  255. package/dist/entries/checkbox.d.ts +0 -2
  256. package/dist/entries/checkbox.js +0 -2
  257. package/dist/entries/collapse.d.ts +0 -2
  258. package/dist/entries/collapse.js +0 -2
  259. package/dist/entries/color-picker.d.ts +0 -2
  260. package/dist/entries/color-picker.js +0 -2
  261. package/dist/entries/context-menu.d.ts +0 -2
  262. package/dist/entries/context-menu.js +0 -2
  263. package/dist/entries/date-picker.d.ts +0 -2
  264. package/dist/entries/date-picker.js +0 -2
  265. package/dist/entries/descriptions.d.ts +0 -2
  266. package/dist/entries/descriptions.js +0 -2
  267. package/dist/entries/divider.d.ts +0 -2
  268. package/dist/entries/divider.js +0 -2
  269. package/dist/entries/drawer.d.ts +0 -2
  270. package/dist/entries/drawer.js +0 -2
  271. package/dist/entries/dropdown.d.ts +0 -2
  272. package/dist/entries/dropdown.js +0 -2
  273. package/dist/entries/empty.d.ts +0 -2
  274. package/dist/entries/empty.js +0 -2
  275. package/dist/entries/float-button.d.ts +0 -2
  276. package/dist/entries/float-button.js +0 -2
  277. package/dist/entries/form-actions.d.ts +0 -2
  278. package/dist/entries/form-actions.js +0 -2
  279. package/dist/entries/form-field.d.ts +0 -2
  280. package/dist/entries/form-field.js +0 -2
  281. package/dist/entries/form-layout.d.ts +0 -2
  282. package/dist/entries/form-layout.js +0 -2
  283. package/dist/entries/form-section.d.ts +0 -2
  284. package/dist/entries/form-section.js +0 -2
  285. package/dist/entries/form.d.ts +1 -3
  286. package/dist/entries/form.js +0 -2
  287. package/dist/entries/image.d.ts +0 -2
  288. package/dist/entries/image.js +0 -2
  289. package/dist/entries/input-number.d.ts +0 -2
  290. package/dist/entries/input-number.js +0 -2
  291. package/dist/entries/input.d.ts +1 -3
  292. package/dist/entries/input.js +0 -2
  293. package/dist/entries/list.d.ts +0 -2
  294. package/dist/entries/list.js +0 -2
  295. package/dist/entries/listy.d.ts +0 -2
  296. package/dist/entries/listy.js +0 -2
  297. package/dist/entries/masonry.d.ts +0 -2
  298. package/dist/entries/masonry.js +0 -2
  299. package/dist/entries/mentions.d.ts +0 -2
  300. package/dist/entries/mentions.js +0 -2
  301. package/dist/entries/modal.d.ts +0 -2
  302. package/dist/entries/modal.js +0 -2
  303. package/dist/entries/number-input.d.ts +0 -2
  304. package/dist/entries/number-input.js +0 -2
  305. package/dist/entries/pagination.d.ts +0 -2
  306. package/dist/entries/pagination.js +0 -2
  307. package/dist/entries/popconfirm.d.ts +0 -2
  308. package/dist/entries/popconfirm.js +0 -2
  309. package/dist/entries/popover.d.ts +0 -2
  310. package/dist/entries/popover.js +0 -2
  311. package/dist/entries/progress.d.ts +0 -2
  312. package/dist/entries/progress.js +0 -2
  313. package/dist/entries/provider.d.ts +1 -3
  314. package/dist/entries/provider.js +1 -3
  315. package/dist/entries/qr-code.d.ts +0 -2
  316. package/dist/entries/qr-code.js +0 -2
  317. package/dist/entries/radio.d.ts +0 -2
  318. package/dist/entries/radio.js +0 -2
  319. package/dist/entries/range-picker.d.ts +0 -2
  320. package/dist/entries/range-picker.js +0 -2
  321. package/dist/entries/rate.d.ts +0 -2
  322. package/dist/entries/rate.js +0 -2
  323. package/dist/entries/result.d.ts +0 -2
  324. package/dist/entries/result.js +0 -2
  325. package/dist/entries/scroll-area.d.ts +0 -2
  326. package/dist/entries/scroll-area.js +0 -2
  327. package/dist/entries/segmented.d.ts +0 -2
  328. package/dist/entries/segmented.js +0 -2
  329. package/dist/entries/select.d.ts +0 -2
  330. package/dist/entries/select.js +0 -2
  331. package/dist/entries/skeleton.d.ts +0 -2
  332. package/dist/entries/skeleton.js +0 -2
  333. package/dist/entries/slider.d.ts +0 -2
  334. package/dist/entries/slider.js +0 -2
  335. package/dist/entries/sonner.d.ts +0 -2
  336. package/dist/entries/sonner.js +0 -2
  337. package/dist/entries/spinner.d.ts +0 -2
  338. package/dist/entries/spinner.js +0 -2
  339. package/dist/entries/splitter.d.ts +0 -2
  340. package/dist/entries/splitter.js +0 -2
  341. package/dist/entries/stack.d.ts +0 -2
  342. package/dist/entries/stack.js +0 -2
  343. package/dist/entries/statistic.d.ts +0 -2
  344. package/dist/entries/statistic.js +0 -2
  345. package/dist/entries/steps.d.ts +0 -2
  346. package/dist/entries/steps.js +0 -2
  347. package/dist/entries/switch.d.ts +0 -2
  348. package/dist/entries/switch.js +0 -2
  349. package/dist/entries/table.d.ts +0 -2
  350. package/dist/entries/table.js +0 -2
  351. package/dist/entries/tabs.d.ts +0 -2
  352. package/dist/entries/tabs.js +0 -2
  353. package/dist/entries/tag.d.ts +0 -2
  354. package/dist/entries/tag.js +0 -2
  355. package/dist/entries/textarea.d.ts +0 -2
  356. package/dist/entries/textarea.js +0 -2
  357. package/dist/entries/time-picker.d.ts +0 -2
  358. package/dist/entries/time-picker.js +0 -2
  359. package/dist/entries/timeline.d.ts +0 -2
  360. package/dist/entries/timeline.js +0 -2
  361. package/dist/entries/tooltip.d.ts +0 -2
  362. package/dist/entries/tooltip.js +0 -2
  363. package/dist/entries/tour.d.ts +0 -2
  364. package/dist/entries/tour.js +0 -2
  365. package/dist/entries/transfer.d.ts +0 -2
  366. package/dist/entries/transfer.js +0 -2
  367. package/dist/entries/tree-select.d.ts +0 -2
  368. package/dist/entries/tree-select.js +0 -2
  369. package/dist/entries/tree.d.ts +0 -2
  370. package/dist/entries/tree.js +0 -2
  371. package/dist/entries/upload.d.ts +0 -2
  372. package/dist/entries/upload.js +0 -2
  373. package/dist/entries/watermark.d.ts +0 -2
  374. package/dist/entries/watermark.js +0 -2
  375. package/dist/index.d.ts +5 -7
  376. package/dist/index.js +2 -4
  377. package/dist/layouts/form-layout/form-layout.d.ts +1 -0
  378. package/dist/layouts/form-layout/form-layout.js +10 -36
  379. package/dist/layouts/stack/layout.css +46 -44
  380. package/dist/layouts/stack/stack.d.ts +1 -0
  381. package/dist/layouts/stack/stack.js +16 -69
  382. package/dist/locales/ar-EG.js +25 -2
  383. package/dist/locales/create-locale.d.ts +1 -2
  384. package/dist/locales/create-locale.js +0 -28
  385. package/dist/locales/de-DE.js +25 -2
  386. package/dist/locales/en-US.js +24 -1
  387. package/dist/locales/es-ES.js +25 -2
  388. package/dist/locales/fr-FR.js +25 -2
  389. package/dist/locales/hi-IN.js +25 -2
  390. package/dist/locales/id-ID.js +25 -2
  391. package/dist/locales/index.d.ts +10 -10
  392. package/dist/locales/index.js +9 -9
  393. package/dist/locales/it-IT.js +25 -2
  394. package/dist/locales/ja-JP.js +25 -2
  395. package/dist/locales/ko-KR.js +25 -2
  396. package/dist/locales/pt-BR.js +25 -2
  397. package/dist/locales/ru-RU.js +25 -2
  398. package/dist/locales/th-TH.js +25 -2
  399. package/dist/locales/tr-TR.js +25 -2
  400. package/dist/locales/vi-VN.js +25 -2
  401. package/dist/locales/zh-CN.js +25 -2
  402. package/dist/locales/zh-TW.js +25 -2
  403. package/dist/number-input/number-input.js +24 -81
  404. package/dist/number-input/use-number-input.d.ts +1 -0
  405. package/dist/number-input/use-number-input.js +47 -43
  406. package/dist/provider/locale.d.ts +1 -1
  407. package/dist/provider/tao-context.d.ts +38 -0
  408. package/dist/provider/tao-context.js +92 -0
  409. package/dist/provider/tao-portal-scope.d.ts +14 -0
  410. package/dist/provider/tao-portal-scope.js +54 -0
  411. package/dist/provider/tao-provider.d.ts +5 -55
  412. package/dist/provider/tao-provider.js +94 -364
  413. package/dist/theme/control.css +106 -122
  414. package/dist/theme/theme.css +4 -2
  415. package/dist/utils/dialog-content.js +55 -210
  416. package/dist/utils/overlay.js +15 -30
  417. package/dist/utils/rc-compat.d.ts +13 -0
  418. package/dist/utils/rc-compat.js +48 -0
  419. package/dist/utils/refs.js +5 -19
  420. package/package.json +10 -16
@@ -1,11 +1,34 @@
1
- import zh_CN from "@rc-component/picker/locale/zh_CN";
2
1
  import "dayjs/locale/zh-cn";
2
+ import zh_CN from "@rc-component/picker/locale/zh_CN";
3
3
  import { createFormMessages, createItemCount, createLocale } from "./create-locale.js";
4
- const zhCN = createLocale({
4
+ const zhCN = /*#__PURE__*/ createLocale({
5
5
  locale: 'zh_CN',
6
6
  numberLocale: 'zh-CN',
7
7
  dayjsLocale: 'zh-cn',
8
8
  weekStartsOn: 1,
9
+ weekdays: [
10
+ '一',
11
+ '二',
12
+ '三',
13
+ '四',
14
+ '五',
15
+ '六',
16
+ '日'
17
+ ],
18
+ months: [
19
+ '1月',
20
+ '2月',
21
+ '3月',
22
+ '4月',
23
+ '5月',
24
+ '6月',
25
+ '7月',
26
+ '8月',
27
+ '9月',
28
+ '10月',
29
+ '11月',
30
+ '12月'
31
+ ],
9
32
  pickerLocale: zh_CN,
10
33
  select: '选择',
11
34
  searchPlaceholder: '搜索…',
@@ -1,11 +1,34 @@
1
- import zh_TW from "@rc-component/picker/locale/zh_TW";
2
1
  import "dayjs/locale/zh-tw";
2
+ import zh_TW from "@rc-component/picker/locale/zh_TW";
3
3
  import { createFormMessages, createItemCount, createLocale } from "./create-locale.js";
4
- const zhTW = createLocale({
4
+ const zhTW = /*#__PURE__*/ createLocale({
5
5
  locale: 'zh_TW',
6
6
  numberLocale: 'zh-TW',
7
7
  dayjsLocale: 'zh-tw',
8
8
  weekStartsOn: 0,
9
+ weekdays: [
10
+ '一',
11
+ '二',
12
+ '三',
13
+ '四',
14
+ '五',
15
+ '六',
16
+ '日'
17
+ ],
18
+ months: [
19
+ '1月',
20
+ '2月',
21
+ '3月',
22
+ '4月',
23
+ '5月',
24
+ '6月',
25
+ '7月',
26
+ '8月',
27
+ '9月',
28
+ '10月',
29
+ '11月',
30
+ '12月'
31
+ ],
9
32
  pickerLocale: zh_TW,
10
33
  select: '選擇',
11
34
  searchPlaceholder: '搜尋…',
@@ -1,5 +1,4 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
2
  import { useNumberInput } from "./use-number-input.js";
4
3
  const HOOK_KEYS = [
5
4
  'locale',
@@ -17,87 +16,31 @@ const HOOK_KEYS = [
17
16
  'max'
18
17
  ];
19
18
  function HeadlessInputNumber(props) {
20
- const $ = c(20);
21
- let className;
22
- let containerClassName;
23
- let hookOpts;
24
- let nativeAttrs;
25
- let prefix;
26
- let suffix;
27
- if ($[0] !== props) {
28
- const { prefix: t0, suffix: t1, containerClassName: t2, className: t3, ...rest } = props;
29
- prefix = t0;
30
- suffix = t1;
31
- containerClassName = t2;
32
- className = t3;
33
- hookOpts = {};
34
- nativeAttrs = {};
35
- for (const [key, val] of Object.entries(rest))if (HOOK_KEYS.includes(key)) hookOpts[key] = val;
36
- else nativeAttrs[key] = val;
37
- $[0] = props;
38
- $[1] = className;
39
- $[2] = containerClassName;
40
- $[3] = hookOpts;
41
- $[4] = nativeAttrs;
42
- $[5] = prefix;
43
- $[6] = suffix;
44
- } else {
45
- className = $[1];
46
- containerClassName = $[2];
47
- hookOpts = $[3];
48
- nativeAttrs = $[4];
49
- prefix = $[5];
50
- suffix = $[6];
51
- }
19
+ const { prefix, suffix, containerClassName, className, ...rest } = props;
20
+ const hookOpts = {};
21
+ const nativeAttrs = {};
22
+ for (const [key, val] of Object.entries(rest))if (HOOK_KEYS.includes(key)) hookOpts[key] = val;
23
+ else nativeAttrs[key] = val;
52
24
  const { inputProps } = useNumberInput(hookOpts);
53
- let t0;
54
- if ($[7] !== prefix) {
55
- t0 = void 0 !== prefix && /*#__PURE__*/ jsx("span", {
56
- "data-tao-prefix": "",
57
- children: prefix
58
- });
59
- $[7] = prefix;
60
- $[8] = t0;
61
- } else t0 = $[8];
62
- let t1;
63
- if ($[9] !== className || $[10] !== inputProps || $[11] !== nativeAttrs) {
64
- t1 = /*#__PURE__*/ jsx("input", {
65
- ...nativeAttrs,
66
- ...inputProps,
67
- className: className
68
- });
69
- $[9] = className;
70
- $[10] = inputProps;
71
- $[11] = nativeAttrs;
72
- $[12] = t1;
73
- } else t1 = $[12];
74
- let t2;
75
- if ($[13] !== suffix) {
76
- t2 = void 0 !== suffix && /*#__PURE__*/ jsx("span", {
77
- "data-tao-suffix": "",
78
- children: suffix
79
- });
80
- $[13] = suffix;
81
- $[14] = t2;
82
- } else t2 = $[14];
83
- let t3;
84
- if ($[15] !== containerClassName || $[16] !== t0 || $[17] !== t1 || $[18] !== t2) {
85
- t3 = /*#__PURE__*/ jsxs("span", {
86
- className: containerClassName,
87
- "data-tao-number-input": "",
88
- children: [
89
- t0,
90
- t1,
91
- t2
92
- ]
93
- });
94
- $[15] = containerClassName;
95
- $[16] = t0;
96
- $[17] = t1;
97
- $[18] = t2;
98
- $[19] = t3;
99
- } else t3 = $[19];
100
- return t3;
25
+ return /*#__PURE__*/ jsxs("span", {
26
+ className: containerClassName,
27
+ "data-tao-number-input": "",
28
+ children: [
29
+ void 0 !== prefix && /*#__PURE__*/ jsx("span", {
30
+ "data-tao-prefix": "",
31
+ children: prefix
32
+ }),
33
+ /*#__PURE__*/ jsx("input", {
34
+ ...nativeAttrs,
35
+ ...inputProps,
36
+ className: className
37
+ }),
38
+ void 0 !== suffix && /*#__PURE__*/ jsx("span", {
39
+ "data-tao-suffix": "",
40
+ children: suffix
41
+ })
42
+ ]
43
+ });
101
44
  }
102
45
  const NumberInput = HeadlessInputNumber;
103
46
  export { HeadlessInputNumber, NumberInput };
@@ -15,6 +15,7 @@ export interface UseNumberInputOptions {
15
15
  allowNegative?: boolean;
16
16
  min?: number;
17
17
  max?: number;
18
+ disabled?: boolean;
18
19
  }
19
20
  export interface UseNumberInputReturn {
20
21
  inputProps: {
@@ -6,9 +6,10 @@ import { resolveNumberFormat } from "./locale.js";
6
6
  import { fromPercent, toPercent } from "./percentage.js";
7
7
  import { clampToRange, isValidCanonical, stripDisallowedSign, toCanonical } from "./validate.js";
8
8
  function useNumberInput(opts) {
9
- const { value: externalValue, defaultValue, onChange, onBlur, locale: localeProp, decimalSeparator, thousandsSeparator: thousandsSeparatorProp, decimalPlaces = 2, padDecimalsOnBlur: padMode = 'never', isPercentage = false, allowNegative = false, min, max } = opts;
9
+ const { value: externalValue, defaultValue, onChange, onBlur, locale: localeProp, decimalSeparator, thousandsSeparator: thousandsSeparatorProp, decimalPlaces = 2, padDecimalsOnBlur: padMode = 'never', isPercentage = false, allowNegative = false, min, max, disabled: disabledProp } = opts;
10
10
  const value = 'number' == typeof externalValue ? toCanonical(externalValue) : externalValue;
11
11
  const config = useTaoConfig();
12
+ const disabled = disabledProp ?? config.disabled;
12
13
  const locale = localeProp ?? config.locale.numberLocale;
13
14
  const fmtOpts = useMemo(()=>resolveNumberFormat(locale, {
14
15
  decimalSeparator,
@@ -42,23 +43,23 @@ function useNumberInput(opts) {
42
43
  if (buffer.format === fmtOpts && buffer.isPercentage === isPercentage) return;
43
44
  const previousCanonical = parse(buffer.display, buffer.format);
44
45
  const useExternalValue = isValueControlled && !isFocusedRef.current;
45
- const actual_0 = useExternalValue ? value ?? '' : buffer.isPercentage ? fromPercent(previousCanonical) : previousCanonical;
46
- let canonical_0 = isPercentage ? toPercent(actual_0) : actual_0;
47
- if (!useExternalValue && previousCanonical.endsWith('.') && !canonical_0.includes('.')) canonical_0 += '.';
48
- const display_0 = format(canonical_0, fmtOpts);
46
+ const actual = useExternalValue ? value ?? '' : buffer.isPercentage ? fromPercent(previousCanonical) : previousCanonical;
47
+ let canonical = isPercentage ? toPercent(actual) : actual;
48
+ if (!useExternalValue && previousCanonical.endsWith('.') && !canonical.includes('.')) canonical += '.';
49
+ const display = format(canonical, fmtOpts);
49
50
  const input = inputRef.current;
50
- if (isFocusedRef.current && input && display_0 !== buffer.display) {
51
+ if (isFocusedRef.current && input && display !== buffer.display) {
51
52
  const beforeCount = countAnchored(buffer.display, buffer.display.length, buffer.format.thousandsSeparator);
52
- const afterCount = countAnchored(display_0, display_0.length, thousandsSeparator);
53
- const mapCursor = (position)=>findCursorAt(display_0, afterCount - beforeCount + countAnchored(buffer.display, position, buffer.format.thousandsSeparator), thousandsSeparator);
53
+ const afterCount = countAnchored(display, display.length, thousandsSeparator);
54
+ const mapCursor = (position)=>findCursorAt(display, afterCount - beforeCount + countAnchored(buffer.display, position, buffer.format.thousandsSeparator), thousandsSeparator);
54
55
  pendingCursorRef.current = {
55
- display: display_0,
56
+ display,
56
57
  start: mapCursor(input.selectionStart ?? buffer.display.length),
57
58
  end: mapCursor(input.selectionEnd ?? buffer.display.length)
58
59
  };
59
60
  }
60
61
  setBuffer({
61
- display: display_0,
62
+ display,
62
63
  format: fmtOpts,
63
64
  isPercentage
64
65
  });
@@ -73,8 +74,8 @@ function useNumberInput(opts) {
73
74
  useEffect(()=>{
74
75
  if (!isValueControlled) return;
75
76
  if (isFocusedRef.current) return;
76
- const display_1 = canonicalToDisplay(value ?? '');
77
- if (displayBuffer !== display_1) setDisplayBuffer(display_1);
77
+ const display = canonicalToDisplay(value ?? '');
78
+ if (displayBuffer !== display) setDisplayBuffer(display);
78
79
  }, [
79
80
  value,
80
81
  isValueControlled
@@ -111,13 +112,14 @@ function useNumberInput(opts) {
111
112
  displayBuffer
112
113
  ]);
113
114
  const handleChange = (e)=>{
115
+ if (disabled) return;
114
116
  const raw = e.target.value;
115
117
  const cursor = e.target.selectionStart ?? raw.length;
116
- let canonical_1 = parse(raw, fmtOpts);
117
- canonical_1 = stripDisallowedSign(canonical_1, allowNegative);
118
- canonical_1 = truncateDecimals(canonical_1, decimalPlaces);
119
- if (!isValidCanonical(canonical_1)) return;
120
- const newDisplay = format(canonical_1, fmtOpts);
118
+ let canonical = parse(raw, fmtOpts);
119
+ canonical = stripDisallowedSign(canonical, allowNegative);
120
+ canonical = truncateDecimals(canonical, decimalPlaces);
121
+ if (!isValidCanonical(canonical)) return;
122
+ const newDisplay = format(canonical, fmtOpts);
121
123
  const cursorPosition = reposition({
122
124
  before: raw,
123
125
  beforeCursor: cursor,
@@ -130,51 +132,53 @@ function useNumberInput(opts) {
130
132
  end: cursorPosition
131
133
  };
132
134
  setDisplayBuffer(newDisplay);
133
- const actual_1 = isPercentage ? fromPercent(canonical_1) : canonical_1;
134
- onChange?.(actual_1);
135
+ const actual = isPercentage ? fromPercent(canonical) : canonical;
136
+ onChange?.(actual);
135
137
  };
136
138
  const commit = ()=>{
137
- const raw_0 = isValueControlled ? canonicalToDisplay(value ?? '') : inputRef.current?.value ?? displayBuffer;
138
- let canonical_2 = truncateDecimals(parse(raw_0, fmtOpts), decimalPlaces);
139
- canonical_2 = padOnBlur(canonical_2, decimalPlaces, padMode);
140
- const beforeClamp = isPercentage ? fromPercent(canonical_2) : canonical_2;
139
+ const raw = isValueControlled ? canonicalToDisplay(value ?? '') : inputRef.current?.value ?? displayBuffer;
140
+ let canonical = truncateDecimals(parse(raw, fmtOpts), decimalPlaces);
141
+ canonical = padOnBlur(canonical, decimalPlaces, padMode);
142
+ const beforeClamp = isPercentage ? fromPercent(canonical) : canonical;
141
143
  const bounded = clampToRange(beforeClamp, min, max);
142
- const actual_2 = !isPercentage && decimalPlaces > 0 && bounded !== beforeClamp ? padOnBlur(bounded, decimalPlaces, padMode) : bounded;
143
- const canonicalAfter = isPercentage ? toPercent(actual_2) : actual_2;
144
- const newDisplay_0 = format(canonicalAfter, fmtOpts);
145
- setDisplayBuffer(newDisplay_0);
146
- return actual_2;
144
+ const actual = !isPercentage && decimalPlaces > 0 && bounded !== beforeClamp ? padOnBlur(bounded, decimalPlaces, padMode) : bounded;
145
+ const canonicalAfter = isPercentage ? toPercent(actual) : actual;
146
+ const newDisplay = format(canonicalAfter, fmtOpts);
147
+ setDisplayBuffer(newDisplay);
148
+ return actual;
147
149
  };
148
150
  const handleBlur = ()=>{
149
151
  isFocusedRef.current = false;
152
+ if (disabled) return;
150
153
  const previous = isValueControlled ? value ?? '' : derivedActual;
151
- const actual_3 = commit();
152
- if (actual_3 !== previous) onChange?.(actual_3);
153
- onBlur?.(actual_3);
154
+ const actual = commit();
155
+ if (actual !== previous) onChange?.(actual);
156
+ onBlur?.(actual);
154
157
  };
155
158
  const handleFocus = ()=>{
159
+ if (disabled) return;
156
160
  isFocusedRef.current = true;
157
161
  };
158
- const handleKeyDown = (e_0)=>{
159
- if (e_0.nativeEvent.isComposing || 229 === e_0.keyCode) return;
160
- if ('Enter' === e_0.key) {
161
- const previous_0 = isValueControlled ? value ?? '' : derivedActual;
162
- const actual_4 = commit();
163
- if (actual_4 !== previous_0) onChange?.(actual_4);
162
+ const handleKeyDown = (e)=>{
163
+ if (disabled || e.nativeEvent.isComposing || 229 === e.keyCode) return;
164
+ if ('Enter' === e.key) {
165
+ const previous = isValueControlled ? value ?? '' : derivedActual;
166
+ const actual = commit();
167
+ if (actual !== previous) onChange?.(actual);
164
168
  return;
165
169
  }
166
- if ('Backspace' !== e_0.key) return;
170
+ if ('Backspace' !== e.key) return;
167
171
  const el = inputRef.current;
168
172
  if (!el) return;
169
- const cursor_0 = el.selectionStart ?? 0;
170
- if (cursor_0 > 0 && el.selectionEnd === cursor_0 && isThousandSepBeforeCursor(displayBuffer, cursor_0, thousandsSeparator)) {
171
- const beforeSeparator = cursor_0 - thousandsSeparator.length;
173
+ const cursor = el.selectionStart ?? 0;
174
+ if (cursor > 0 && el.selectionEnd === cursor && isThousandSepBeforeCursor(displayBuffer, cursor, thousandsSeparator)) {
175
+ const beforeSeparator = cursor - thousandsSeparator.length;
172
176
  el.setSelectionRange(beforeSeparator, beforeSeparator);
173
177
  }
174
178
  };
175
179
  const derivedActual = useMemo(()=>{
176
- const canonical_3 = parse(buffer.display, buffer.format);
177
- return buffer.isPercentage ? fromPercent(canonical_3) : canonical_3;
180
+ const canonical = parse(buffer.display, buffer.format);
181
+ return buffer.isPercentage ? fromPercent(canonical) : canonical;
178
182
  }, [
179
183
  buffer
180
184
  ]);
@@ -1,3 +1,3 @@
1
- export type { BuiltinTaoLocale, TaoLocale, TaoMessages, } from '../locales/types.js';
2
1
  export { enUS } from '../locales/en-US.js';
2
+ export type { BuiltinTaoLocale, TaoLocale, TaoMessages, } from '../locales/types.js';
3
3
  export { zhCN } from '../locales/zh-CN.js';
@@ -0,0 +1,38 @@
1
+ import type { TaoLocale } from '../locales/types.js';
2
+ import '../theme/theme.css';
3
+ import type { ResolvedTaoLocale } from './merge-locale.js';
4
+ export type TaoThemeMode = 'light' | 'dark';
5
+ export type TaoSize = 'small' | 'medium' | 'large';
6
+ export type TaoVariant = 'outlined' | 'filled' | 'borderless';
7
+ export type TaoStatus = 'error' | 'warning';
8
+ export type TaoDirection = 'ltr' | 'rtl';
9
+ export interface TaoConfig {
10
+ direction?: TaoDirection;
11
+ locale: TaoLocale;
12
+ size: TaoSize;
13
+ disabled: boolean;
14
+ variant: TaoVariant;
15
+ /** Resolved 明暗模式,portal 浮层用它重建 data-tao-theme。 */
16
+ mode: TaoThemeMode;
17
+ /** Resolved 紧凑密度,portal 浮层用它重建 data-tao-density。 */
18
+ compact: boolean;
19
+ }
20
+ export interface TaoConfigContextValue extends TaoConfig {
21
+ locale: ResolvedTaoLocale;
22
+ /**
23
+ * Merged CSS custom-property overrides from this provider and all ancestors.
24
+ * Carried through context so portaled layers (Modal/Drawer/Select dropdown…)
25
+ * — which render outside the provider's DOM subtree — can re-apply the theme.
26
+ */
27
+ tokenStyle: Record<string, string>;
28
+ /** Caller-provided tokens, excluding generated defaults used to isolate a scope. */
29
+ tokenOverrides: Record<string, string>;
30
+ }
31
+ export declare const TaoConfigContext: import("react").Context<TaoConfigContextValue>;
32
+ export declare function useTaoConfig(): TaoConfig & {
33
+ locale: ResolvedTaoLocale;
34
+ };
35
+ /** Internal component access for token propagation through third-party portals. */
36
+ export declare function useTaoInternalConfig(): TaoConfigContextValue;
37
+ /** Resolve DOM inheritance at a component's source, before it creates portals. */
38
+ export declare function useTaoDirection(explicit?: TaoDirection | 'auto', source?: 'parent' | 'self'): readonly [TaoDirection, import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>];
@@ -0,0 +1,92 @@
1
+ import { createContext, useContext, useLayoutEffect, useMemo, useState } from "react";
2
+ import { enUS } from "../locales/en-US.js";
3
+ import "../theme/theme.css";
4
+ import { getComposedParent } from "../utils/composed-parent.js";
5
+ const TaoConfigContext = createContext({
6
+ size: 'medium',
7
+ disabled: false,
8
+ variant: 'outlined',
9
+ mode: 'light',
10
+ compact: false,
11
+ tokenStyle: {},
12
+ tokenOverrides: {},
13
+ locale: enUS
14
+ });
15
+ function useTaoConfig() {
16
+ const { size, disabled, variant, mode, compact, locale, direction } = useContext(TaoConfigContext);
17
+ return useMemo(()=>({
18
+ size,
19
+ disabled,
20
+ variant,
21
+ mode,
22
+ compact,
23
+ locale,
24
+ direction
25
+ }), [
26
+ size,
27
+ disabled,
28
+ variant,
29
+ mode,
30
+ compact,
31
+ locale,
32
+ direction
33
+ ]);
34
+ }
35
+ function useTaoInternalConfig() {
36
+ return useContext(TaoConfigContext);
37
+ }
38
+ function useTaoDirection(explicit, source = 'parent') {
39
+ const { direction: contextDirection } = useContext(TaoConfigContext);
40
+ const [element, setElement] = useState(null);
41
+ const [inherited, setInherited] = useState();
42
+ useLayoutEffect(()=>{
43
+ if (explicit && 'auto' !== explicit || !element) return;
44
+ const target = 'self' === source || 'auto' === explicit ? element : getComposedParent(element);
45
+ if (!target) return;
46
+ const update = ()=>{
47
+ let resolved;
48
+ for(let ancestor = target; ancestor; ancestor = getComposedParent(ancestor)){
49
+ const inlineDir = ancestor.style?.direction;
50
+ if ('rtl' === inlineDir || 'ltr' === inlineDir) {
51
+ resolved = inlineDir;
52
+ break;
53
+ }
54
+ const attrDir = ancestor.getAttribute('dir');
55
+ if ('rtl' === attrDir || 'ltr' === attrDir) {
56
+ resolved = attrDir;
57
+ break;
58
+ }
59
+ }
60
+ const computed = getComputedStyle(target).direction;
61
+ const value = resolved ?? ('rtl' === computed ? 'rtl' : contextDirection ?? 'ltr');
62
+ setInherited('rtl' === value ? 'rtl' : 'ltr');
63
+ for(let ancestor = target; ancestor; ancestor = getComposedParent(ancestor)){
64
+ const auto = 'auto' === ancestor.getAttribute('dir');
65
+ observer.observe(ancestor, {
66
+ attributes: true,
67
+ attributeFilter: [
68
+ 'dir',
69
+ 'style',
70
+ 'class'
71
+ ],
72
+ childList: auto,
73
+ characterData: auto,
74
+ subtree: auto
75
+ });
76
+ }
77
+ };
78
+ const observer = new MutationObserver(update);
79
+ update();
80
+ return ()=>observer.disconnect();
81
+ }, [
82
+ element,
83
+ explicit,
84
+ contextDirection,
85
+ source
86
+ ]);
87
+ return [
88
+ ('auto' === explicit ? void 0 : explicit) ?? inherited ?? contextDirection ?? 'ltr',
89
+ setElement
90
+ ];
91
+ }
92
+ export { TaoConfigContext, useTaoConfig, useTaoDirection, useTaoInternalConfig };
@@ -0,0 +1,14 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type TaoDirection } from './tao-context.js';
3
+ /**
4
+ * Re-establishes the theme token scope inside a portal. Floating components
5
+ * portal their popup to document.body, escaping the `[data-tao-provider]`
6
+ * element that carries custom token overrides; wrapping the portal content in
7
+ * this component re-applies those overrides so colors/sizes stay consistent.
8
+ */
9
+ export declare const TaoPortalScope: import("react").ForwardRefExoticComponent<{
10
+ children: ReactNode;
11
+ style?: CSSProperties;
12
+ asChild?: boolean;
13
+ direction?: TaoDirection;
14
+ } & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,54 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { forwardRef, useMemo } from "react";
4
+ import { TaoConfigContext, useTaoInternalConfig } from "./tao-context.js";
5
+ const tao_portal_scope_TaoPortalScope = /*#__PURE__*/ forwardRef(function({ children, style, asChild, direction: directionProp }, ref) {
6
+ const config = useTaoInternalConfig();
7
+ const { tokenStyle, mode, compact } = config;
8
+ const direction = directionProp ?? config.direction;
9
+ const portalConfig = useMemo(()=>({
10
+ ...config,
11
+ direction
12
+ }), [
13
+ config,
14
+ direction
15
+ ]);
16
+ const themeAttr = 'light' === mode ? void 0 : {
17
+ 'data-tao-theme': mode
18
+ };
19
+ const densityAttr = compact ? {
20
+ 'data-tao-density': 'compact'
21
+ } : void 0;
22
+ if (asChild) return /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
23
+ value: portalConfig,
24
+ children: /*#__PURE__*/ jsx(Slot, {
25
+ ref: ref,
26
+ dir: direction,
27
+ "data-tao-provider": "",
28
+ ...themeAttr,
29
+ ...densityAttr,
30
+ style: {
31
+ ...tokenStyle,
32
+ ...style
33
+ },
34
+ children: children
35
+ })
36
+ });
37
+ return /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
38
+ value: portalConfig,
39
+ children: /*#__PURE__*/ jsx("div", {
40
+ ref: ref,
41
+ dir: direction,
42
+ "data-tao-provider": "",
43
+ ...themeAttr,
44
+ ...densityAttr,
45
+ style: {
46
+ display: 'contents',
47
+ ...tokenStyle,
48
+ ...style
49
+ },
50
+ children: children
51
+ })
52
+ });
53
+ });
54
+ export { tao_portal_scope_TaoPortalScope as TaoPortalScope };
@@ -1,8 +1,11 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
+ import '../theme/theme.css';
2
3
  import { type TaoTokenName } from '../theme/tokens.js';
3
- import { type TaoLocale } from './locale.js';
4
- import { type ResolvedTaoLocale } from './merge-locale.js';
4
+ import type { TaoLocale } from './locale.js';
5
+ import { type TaoDirection, type TaoSize, type TaoThemeMode, type TaoVariant } from './tao-context.js';
5
6
  export { enUS, type TaoLocale, zhCN } from './locale.js';
7
+ export { type TaoConfig, type TaoDirection, type TaoSize, type TaoStatus, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoDirection, useTaoInternalConfig, } from './tao-context.js';
8
+ export { TaoPortalScope } from './tao-portal-scope.js';
6
9
  export interface TaoSeedToken {
7
10
  colorPrimary?: string;
8
11
  colorSuccess?: string;
@@ -23,7 +26,6 @@ export interface TaoSeedToken {
23
26
  zIndexBase?: number;
24
27
  zIndexPopupBase?: number;
25
28
  }
26
- export type TaoThemeMode = 'light' | 'dark';
27
29
  export interface ButtonComponentToken {
28
30
  fontWeight?: CSSProperties['fontWeight'];
29
31
  borderRadius?: number;
@@ -92,39 +94,6 @@ export interface TaoThemeConfig {
92
94
  components?: TaoComponentTokenMap;
93
95
  inherit?: boolean;
94
96
  }
95
- export type TaoSize = 'small' | 'medium' | 'large';
96
- export type TaoVariant = 'outlined' | 'filled' | 'borderless';
97
- export type TaoStatus = 'error' | 'warning';
98
- export type TaoDirection = 'ltr' | 'rtl';
99
- export interface TaoConfig {
100
- direction?: TaoDirection;
101
- locale: TaoLocale;
102
- size: TaoSize;
103
- disabled: boolean;
104
- variant: TaoVariant;
105
- /** Resolved 明暗模式,portal 浮层用它重建 data-tao-theme。 */
106
- mode: TaoThemeMode;
107
- /** Resolved 紧凑密度,portal 浮层用它重建 data-tao-density。 */
108
- compact: boolean;
109
- }
110
- interface TaoConfigContextValue extends TaoConfig {
111
- locale: ResolvedTaoLocale;
112
- /**
113
- * Merged CSS custom-property overrides from this provider and all ancestors.
114
- * Carried through context so portaled layers (Modal/Drawer/Select dropdown…)
115
- * — which render outside the provider's DOM subtree — can re-apply the theme.
116
- */
117
- tokenStyle: Record<string, string>;
118
- /** Caller-provided tokens, excluding generated defaults used to isolate a scope. */
119
- tokenOverrides: Record<string, string>;
120
- }
121
- export declare function useTaoConfig(): TaoConfig & {
122
- locale: ResolvedTaoLocale;
123
- };
124
- /** Internal component access for token propagation through third-party portals. */
125
- export declare function useTaoInternalConfig(): TaoConfigContextValue;
126
- /** Resolve DOM inheritance at a component's source, before it creates portals. */
127
- export declare function useTaoDirection(explicit?: TaoDirection | 'auto', source?: 'parent' | 'self'): readonly [TaoDirection, import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>];
128
97
  /**
129
98
  * antd `theme.useToken` counterpart, zero-runtime edition: returns every
130
99
  * design token as a `var(--tao-*)` reference string, so custom components can
@@ -139,25 +108,6 @@ export declare function useTaoDirection(explicit?: TaoDirection | 'auto', source
139
108
  export declare function useTaoToken(): {
140
109
  token: Record<TaoTokenName, string>;
141
110
  };
142
- /**
143
- * Re-establishes the theme token scope inside a portal. Floating components
144
- * portal their popup to document.body, escaping the `[data-tao-provider]`
145
- * element that carries custom token overrides; wrapping the portal content in
146
- * this component re-applies those overrides so colors/sizes stay consistent.
147
- *
148
- * With `asChild`, merges the tokens onto the immediate child (via Radix Slot)
149
- * instead of adding a wrapper div. Prefer `asChild` inside portals whose Radix
150
- * primitive does NOT Presence-gate its Portal (notably `@radix-ui/react-select`
151
- * — see `SelectPortal` in `node_modules/@radix-ui/react-select`): the wrapper
152
- * div would otherwise render even while the popup is closed, leaving a ghost
153
- * `<div data-tao-provider>` in the body for every mounted-but-closed Select.
154
- */
155
- export declare const TaoPortalScope: import("react").ForwardRefExoticComponent<{
156
- children: ReactNode;
157
- style?: CSSProperties;
158
- asChild?: boolean;
159
- direction?: TaoDirection;
160
- } & import("react").RefAttributes<HTMLElement>>;
161
111
  export interface TaoProviderProps {
162
112
  /** Text and interaction direction. Defaults to the surrounding DOM direction. */
163
113
  direction?: TaoDirection;