react-kui 3.1.2 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/README.zh-CN.md +3 -1
  2. package/ai/kui-components.json +918 -324
  3. package/es/_virtual/_rolldown/runtime.js +1 -1
  4. package/es/affix/index.js +1 -1
  5. package/es/alert/index.js +11 -4
  6. package/es/anchor/anchor-context.js +1 -1
  7. package/es/anchor/anchor-link.js +1 -1
  8. package/es/anchor/anchor.js +1 -1
  9. package/es/auto-complete/index.js +371 -347
  10. package/es/avatar/avatar-group-context.js +1 -1
  11. package/es/avatar/avatar-group.js +1 -1
  12. package/es/avatar/avatar.js +1 -1
  13. package/es/back-top/index.js +1 -1
  14. package/es/badge/index.js +10 -8
  15. package/es/base/teleport.js +1 -1
  16. package/es/base/transition-props.js +1 -1
  17. package/es/base/transition.js +1 -1
  18. package/es/breadcrumb/breadcrumb-context.js +1 -1
  19. package/es/breadcrumb/breadcrumb-item.js +1 -1
  20. package/es/breadcrumb/breadcrumb.js +1 -1
  21. package/es/button/button-group-context.js +1 -1
  22. package/es/button/button-group.js +1 -1
  23. package/es/button/button.js +13 -6
  24. package/es/calendar/index.js +20 -6
  25. package/es/card/index.js +11 -4
  26. package/es/carousel/carousel-context.js +1 -1
  27. package/es/carousel/carousel-item.js +1 -1
  28. package/es/carousel/carousel.js +1 -1
  29. package/es/carousel/drag.js +1 -1
  30. package/es/cascader/index.js +13 -10
  31. package/es/check-card/check-card-group.js +3 -3
  32. package/es/check-card/check-card.js +155 -141
  33. package/es/check-card/context.js +1 -1
  34. package/es/checkbox/checkbox-group-context.js +1 -1
  35. package/es/checkbox/checkbox-group.js +3 -3
  36. package/es/checkbox/checkbox.js +64 -244
  37. package/es/checkbox/index.js +1 -1
  38. package/es/collapse/collapse-panel.js +1 -1
  39. package/es/collapse/collapse.js +96 -82
  40. package/es/color-picker/alpha.js +1 -1
  41. package/es/color-picker/hue.js +1 -1
  42. package/es/color-picker/index.js +7 -7
  43. package/es/color-picker/mode.js +2 -2
  44. package/es/color-picker/paint.js +1 -1
  45. package/es/color-picker/presets.js +1 -1
  46. package/es/components.js +4 -4
  47. package/es/config/config-context.js +16 -3
  48. package/es/config/context.js +29 -2
  49. package/es/config/index.js +31 -12
  50. package/es/config/popup-host.js +106 -0
  51. package/es/config/size-context.js +1 -1
  52. package/es/config/use-config-appearance.js +62 -2
  53. package/es/const/var.js +6 -2
  54. package/es/date-picker/index.js +404 -885
  55. package/es/descriptions/descriptions-item.js +1 -1
  56. package/es/descriptions/descriptions.js +1 -1
  57. package/es/divider/index.js +1 -1
  58. package/es/drawer/index.js +328 -240
  59. package/es/dropdown/dropdown-button.js +69 -51
  60. package/es/dropdown/dropdown-context.js +1 -1
  61. package/es/dropdown/dropdown.js +137 -93
  62. package/es/dropdown/trigger.js +85 -33
  63. package/es/empty/index.js +3 -4
  64. package/es/feature-card/index.js +15 -4
  65. package/es/feedback-panel/index.js +95 -81
  66. package/es/flame-wrap/index.js +116 -109
  67. package/es/flame-wrap/types.js +54 -6
  68. package/es/flex/index.js +1 -1
  69. package/es/form/field-context.js +16 -2
  70. package/es/form/form-context.js +1 -1
  71. package/es/form/form-item.js +7 -6
  72. package/es/form/form.js +1 -1
  73. package/es/form/utils.js +1 -1
  74. package/es/grid/grid-item.js +1 -1
  75. package/es/grid/grid.js +1 -1
  76. package/es/grid/useBreakpoint.js +1 -1
  77. package/es/icon/index.js +1 -1
  78. package/es/image/group.js +1 -1
  79. package/es/image/image-group-context.js +1 -1
  80. package/es/image/image.js +137 -123
  81. package/es/image/instance.js +1 -1
  82. package/es/image/preview.js +1 -1
  83. package/es/image/utils.js +1 -1
  84. package/es/index.js +3 -3
  85. package/es/input/index.js +3 -3
  86. package/es/input/input-base.js +7 -7
  87. package/es/input/input-box.js +2 -2
  88. package/es/input/input-group.js +43 -127
  89. package/es/input/input.js +1 -1
  90. package/es/input/textarea.js +28 -114
  91. package/es/input-number/index.js +7 -5
  92. package/es/input-otp/index.js +5 -5
  93. package/es/input-tag/index.js +5 -5
  94. package/es/kanban/index.js +79 -63
  95. package/es/layout/index.js +1 -1
  96. package/es/layout/layout-context.js +1 -1
  97. package/es/list-panel/index.js +96 -83
  98. package/es/loading/index.js +1 -1
  99. package/es/loading/loading-bar.js +1 -1
  100. package/es/locale/de.js +10 -2
  101. package/es/locale/el.js +10 -2
  102. package/es/locale/en.js +10 -2
  103. package/es/locale/fr.js +10 -2
  104. package/es/locale/it.js +10 -2
  105. package/es/locale/ja.js +10 -2
  106. package/es/locale/ko.js +10 -2
  107. package/es/locale/ru.js +10 -2
  108. package/es/locale/th.js +10 -2
  109. package/es/locale/uk.js +10 -2
  110. package/es/locale/vi.js +10 -2
  111. package/es/locale/zh-CN.js +10 -2
  112. package/es/locale/zh-TW.js +10 -2
  113. package/es/mentions/index.js +291 -286
  114. package/es/menu/menu-context.js +1 -1
  115. package/es/menu/menu-divider.js +1 -1
  116. package/es/menu/menu-group.js +1 -1
  117. package/es/menu/menu-item.js +1 -1
  118. package/es/menu/menu-keyboard.js +41 -2
  119. package/es/menu/menu.js +268 -222
  120. package/es/menu/recursive-menu.js +1 -1
  121. package/es/menu/sub-menu.js +81 -23
  122. package/es/message/index.js +1 -1
  123. package/es/modal/api.js +46 -12
  124. package/es/modal/modal.js +441 -345
  125. package/es/modal/toast.js +177 -64
  126. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  127. package/es/notice/container.js +1 -1
  128. package/es/notice/content.js +1 -1
  129. package/es/notice/index.js +1 -1
  130. package/es/notice/instance.js +1 -1
  131. package/es/page/index.js +13 -8
  132. package/es/page/responsive.js +1 -1
  133. package/es/page-header/index.js +1 -1
  134. package/es/popconfirm/index.js +36 -35
  135. package/es/poptip/index.js +47 -45
  136. package/es/popup/index.js +5 -2
  137. package/es/popup/layers.js +11 -2
  138. package/es/progress/index.js +1 -1
  139. package/es/qrcode/index.js +13 -7
  140. package/es/radio/radio-button.js +51 -44
  141. package/es/radio/radio-group-context.js +1 -1
  142. package/es/radio/radio-group.js +49 -52
  143. package/es/radio/radio.js +46 -197
  144. package/es/rate/index.js +1 -1
  145. package/es/rate/star.js +1 -1
  146. package/es/result/index.js +1 -1
  147. package/es/ripple/index.js +104 -97
  148. package/es/ripple/types.js +71 -18
  149. package/es/row-col/col.js +1 -1
  150. package/es/row-col/row.js +1 -1
  151. package/es/segmented/index.js +112 -92
  152. package/es/select/option.js +1 -1
  153. package/es/select/select.js +29 -29
  154. package/es/skeleton/skeleton-avatar.js +1 -1
  155. package/es/skeleton/skeleton-button.js +1 -1
  156. package/es/skeleton/skeleton-image.js +1 -1
  157. package/es/skeleton/skeleton-text.js +1 -1
  158. package/es/skeleton/skeleton.js +1 -1
  159. package/es/skeleton/use-skeleton-loading.js +1 -1
  160. package/es/slider/index.js +1 -1
  161. package/es/slider/thumb.js +1 -1
  162. package/es/space/index.js +1 -1
  163. package/es/spin/index.js +1 -1
  164. package/es/splitter/splitter-panel.js +1 -1
  165. package/es/splitter/splitter.js +1 -1
  166. package/es/stat-card/countup.js +2 -2
  167. package/es/stat-card/rollup.js +1 -1
  168. package/es/stat-card/stat-card.js +16 -7
  169. package/es/stat-card/stat-number.js +4 -3
  170. package/es/stat-card/utils/countup.js +1 -1
  171. package/es/stat-card/utils/odometer.js +1 -1
  172. package/es/stat-card/utils/stat-item-key.js +22 -0
  173. package/es/steps/index.js +1 -1
  174. package/es/switch/index.js +3 -3
  175. package/es/table/column-setting.js +104 -115
  176. package/es/table/index.js +556 -207
  177. package/es/table/utils.js +140 -3
  178. package/es/tabs/tab-panel.js +1 -1
  179. package/es/tabs/tabs.js +1 -1
  180. package/es/tag/index.js +12 -5
  181. package/es/time-line/timeline-item.js +1 -1
  182. package/es/time-line/timeline.js +1 -1
  183. package/es/tooltip/index.js +114 -94
  184. package/es/tour/index.js +1 -1
  185. package/es/transfer/index.js +190 -172
  186. package/es/tree/index.js +55 -44
  187. package/es/tree/utils.js +1 -1
  188. package/es/tree-select/index.js +259 -781
  189. package/es/typography/index.js +1 -1
  190. package/es/upload/file-list.js +1 -1
  191. package/es/upload/index.js +5 -6
  192. package/es/upload/picture-sort.js +1 -1
  193. package/es/upload/selector.js +1 -1
  194. package/es/utils/checked.js +1 -1
  195. package/es/utils/color.js +25 -2
  196. package/es/utils/css.js +19 -0
  197. package/es/utils/focus.js +63 -0
  198. package/es/utils/number.js +1 -1
  199. package/es/utils/overlay-order.js +18 -0
  200. package/es/utils/overlay-stack.js +33 -0
  201. package/es/utils/placement.js +1 -1
  202. package/es/utils/popup.js +1 -1
  203. package/es/utils/promise.js +18 -0
  204. package/es/utils/react-node.js +55 -30
  205. package/es/utils/selection-tags.js +6 -4
  206. package/es/utils/share.js +5 -2
  207. package/es/utils/theme.js +1 -1
  208. package/es/utils/transition.js +1 -1
  209. package/es/utils/use-value.js +1 -1
  210. package/es/virtual-list/index.js +1 -1
  211. package/es/virtual-list/range.js +3 -2
  212. package/es/watermark/index.js +1 -1
  213. package/lib/index.cjs +2 -2
  214. package/lib/locale/de.cjs +2 -2
  215. package/lib/locale/el.cjs +2 -2
  216. package/lib/locale/en.cjs +2 -2
  217. package/lib/locale/fr.cjs +2 -2
  218. package/lib/locale/it.cjs +2 -2
  219. package/lib/locale/ja.cjs +2 -2
  220. package/lib/locale/ko.cjs +2 -2
  221. package/lib/locale/ru.cjs +2 -2
  222. package/lib/locale/th.cjs +2 -2
  223. package/lib/locale/uk.cjs +2 -2
  224. package/lib/locale/vi.cjs +2 -2
  225. package/lib/locale/zh-CN.cjs +2 -2
  226. package/lib/locale/zh-TW.cjs +2 -2
  227. package/package.json +4 -3
  228. package/readme.md +3 -1
  229. package/style/base.css +2 -2
  230. package/style/components.css +2 -2
  231. package/style/index.css +2 -2
  232. package/style/theme.css +2 -2
  233. package/types/alert/index.d.cts +2 -2
  234. package/types/alert/index.d.ts +2 -2
  235. package/types/auto-complete/index.d.cts +7 -1
  236. package/types/auto-complete/index.d.ts +7 -1
  237. package/types/badge/index.d.cts +2 -1
  238. package/types/badge/index.d.ts +2 -1
  239. package/types/button/button.d.cts +2 -2
  240. package/types/button/button.d.ts +2 -2
  241. package/types/card/index.d.cts +3 -3
  242. package/types/card/index.d.ts +3 -3
  243. package/types/cascader/index.d.cts +1 -1
  244. package/types/cascader/index.d.ts +1 -1
  245. package/types/cascader/types.d.cts +2 -0
  246. package/types/cascader/types.d.ts +2 -0
  247. package/types/check-card/context.d.cts +4 -3
  248. package/types/check-card/context.d.ts +4 -3
  249. package/types/check-card/index.d.cts +1 -1
  250. package/types/check-card/index.d.ts +1 -1
  251. package/types/check-card/types.d.cts +3 -4
  252. package/types/check-card/types.d.ts +3 -4
  253. package/types/checkbox/checkbox-group.d.cts +2 -2
  254. package/types/checkbox/checkbox-group.d.ts +2 -2
  255. package/types/checkbox/checkbox.d.cts +2 -2
  256. package/types/checkbox/checkbox.d.ts +2 -2
  257. package/types/collapse/collapse.d.cts +3 -3
  258. package/types/collapse/collapse.d.ts +3 -3
  259. package/types/color-picker/index.d.cts +3 -1
  260. package/types/color-picker/index.d.ts +3 -1
  261. package/types/components.d.cts +2 -2
  262. package/types/components.d.ts +2 -2
  263. package/types/config/config-context.d.cts +15 -2
  264. package/types/config/config-context.d.ts +15 -2
  265. package/types/config/context.d.cts +6 -0
  266. package/types/config/context.d.ts +6 -0
  267. package/types/config/popup-host.d.cts +16 -0
  268. package/types/config/popup-host.d.ts +16 -0
  269. package/types/config/use-config-appearance.d.cts +41 -2
  270. package/types/config/use-config-appearance.d.ts +41 -2
  271. package/types/const/types.d.cts +30 -1
  272. package/types/const/types.d.ts +30 -1
  273. package/types/const/var.d.cts +6 -1
  274. package/types/const/var.d.ts +6 -1
  275. package/types/date-picker/index.d.cts +3 -1
  276. package/types/date-picker/index.d.ts +3 -1
  277. package/types/descriptions/descriptions.d.cts +2 -2
  278. package/types/descriptions/descriptions.d.ts +2 -2
  279. package/types/drawer/index.d.cts +1 -0
  280. package/types/drawer/index.d.ts +1 -0
  281. package/types/dropdown/dropdown-button.d.cts +5 -2
  282. package/types/dropdown/dropdown-button.d.ts +5 -2
  283. package/types/dropdown/dropdown-context.d.cts +6 -0
  284. package/types/dropdown/dropdown-context.d.ts +6 -0
  285. package/types/dropdown/dropdown.d.cts +2 -0
  286. package/types/dropdown/dropdown.d.ts +2 -0
  287. package/types/feature-card/index.d.cts +3 -3
  288. package/types/feature-card/index.d.ts +3 -3
  289. package/types/feedback-panel/index.d.cts +3 -3
  290. package/types/feedback-panel/index.d.ts +3 -3
  291. package/types/flame-wrap/types.d.cts +18 -0
  292. package/types/flame-wrap/types.d.ts +18 -0
  293. package/types/form/field-context.d.cts +2 -0
  294. package/types/form/field-context.d.ts +2 -0
  295. package/types/image/image.d.cts +2 -2
  296. package/types/image/image.d.ts +2 -2
  297. package/types/input/input-group.d.cts +2 -2
  298. package/types/input/input-group.d.ts +2 -2
  299. package/types/input-number/index.d.cts +2 -0
  300. package/types/input-number/index.d.ts +2 -0
  301. package/types/kanban/index.d.cts +3 -2
  302. package/types/kanban/index.d.ts +3 -2
  303. package/types/list-panel/index.d.cts +3 -3
  304. package/types/list-panel/index.d.ts +3 -3
  305. package/types/locale/de.d.cts +6 -0
  306. package/types/locale/de.d.ts +6 -0
  307. package/types/locale/el.d.cts +6 -0
  308. package/types/locale/el.d.ts +6 -0
  309. package/types/locale/en.d.cts +6 -0
  310. package/types/locale/en.d.ts +6 -0
  311. package/types/locale/fr.d.cts +6 -0
  312. package/types/locale/fr.d.ts +6 -0
  313. package/types/locale/it.d.cts +6 -0
  314. package/types/locale/it.d.ts +6 -0
  315. package/types/locale/ja.d.cts +6 -0
  316. package/types/locale/ja.d.ts +6 -0
  317. package/types/locale/ko.d.cts +6 -0
  318. package/types/locale/ko.d.ts +6 -0
  319. package/types/locale/ru.d.cts +6 -0
  320. package/types/locale/ru.d.ts +6 -0
  321. package/types/locale/th.d.cts +6 -0
  322. package/types/locale/th.d.ts +6 -0
  323. package/types/locale/uk.d.cts +6 -0
  324. package/types/locale/uk.d.ts +6 -0
  325. package/types/locale/vi.d.cts +6 -0
  326. package/types/locale/vi.d.ts +6 -0
  327. package/types/locale/zh-CN.d.cts +6 -0
  328. package/types/locale/zh-CN.d.ts +6 -0
  329. package/types/locale/zh-TW.d.cts +6 -0
  330. package/types/locale/zh-TW.d.ts +6 -0
  331. package/types/mentions/index.d.cts +2 -0
  332. package/types/mentions/index.d.ts +2 -0
  333. package/types/menu/menu-keyboard.d.cts +23 -0
  334. package/types/menu/menu-keyboard.d.ts +23 -0
  335. package/types/modal/api.d.cts +6 -1
  336. package/types/modal/api.d.ts +6 -1
  337. package/types/modal/modal.d.cts +1 -0
  338. package/types/modal/modal.d.ts +1 -0
  339. package/types/modal/toast.d.cts +8 -2
  340. package/types/modal/toast.d.ts +8 -2
  341. package/types/page/index.d.cts +2 -2
  342. package/types/page/index.d.ts +2 -2
  343. package/types/popconfirm/index.d.cts +2 -0
  344. package/types/popconfirm/index.d.ts +2 -0
  345. package/types/poptip/index.d.cts +2 -0
  346. package/types/poptip/index.d.ts +2 -0
  347. package/types/popup/layers.d.cts +2 -0
  348. package/types/popup/layers.d.ts +2 -0
  349. package/types/qrcode/index.d.cts +2 -2
  350. package/types/qrcode/index.d.ts +2 -2
  351. package/types/radio/radio-button.d.cts +2 -2
  352. package/types/radio/radio-button.d.ts +2 -2
  353. package/types/radio/radio-group.d.cts +2 -2
  354. package/types/radio/radio-group.d.ts +2 -2
  355. package/types/radio/radio.d.cts +2 -2
  356. package/types/radio/radio.d.ts +2 -2
  357. package/types/ripple/types.d.cts +18 -0
  358. package/types/ripple/types.d.ts +18 -0
  359. package/types/segmented/index.d.cts +2 -1
  360. package/types/segmented/index.d.ts +2 -1
  361. package/types/select/select.d.cts +2 -0
  362. package/types/select/select.d.ts +2 -0
  363. package/types/stat-card/stat-card.d.cts +3 -3
  364. package/types/stat-card/stat-card.d.ts +3 -3
  365. package/types/stat-card/utils/stat-item-key.d.cts +11 -0
  366. package/types/stat-card/utils/stat-item-key.d.ts +11 -0
  367. package/types/table/column-setting.d.cts +4 -4
  368. package/types/table/column-setting.d.ts +4 -4
  369. package/types/table/index.d.cts +2 -2
  370. package/types/table/index.d.ts +2 -2
  371. package/types/table/types.d.cts +21 -2
  372. package/types/table/types.d.ts +21 -2
  373. package/types/table/utils.d.cts +75 -0
  374. package/types/table/utils.d.ts +75 -0
  375. package/types/tag/index.d.cts +2 -2
  376. package/types/tag/index.d.ts +2 -2
  377. package/types/tooltip/index.d.cts +2 -0
  378. package/types/tooltip/index.d.ts +2 -0
  379. package/types/transfer/index.d.cts +3 -2
  380. package/types/transfer/index.d.ts +3 -2
  381. package/types/tree-select/index.d.cts +3 -1
  382. package/types/tree-select/index.d.ts +3 -1
  383. package/types/utils/checked.d.cts +1 -1
  384. package/types/utils/checked.d.ts +1 -1
  385. package/types/utils/color.d.cts +13 -0
  386. package/types/utils/color.d.ts +13 -0
  387. package/types/utils/css.d.cts +2 -0
  388. package/types/utils/css.d.ts +2 -0
  389. package/types/utils/focus.d.cts +5 -0
  390. package/types/utils/focus.d.ts +5 -0
  391. package/types/utils/overlay-order.d.cts +6 -0
  392. package/types/utils/overlay-order.d.ts +6 -0
  393. package/types/utils/overlay-stack.d.cts +13 -0
  394. package/types/utils/overlay-stack.d.ts +13 -0
  395. package/types/utils/promise.d.cts +5 -0
  396. package/types/utils/promise.d.ts +5 -0
  397. package/types/utils/react-node.d.cts +10 -0
  398. package/types/utils/react-node.d.ts +10 -0
package/es/popup/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -8,6 +8,7 @@
8
8
 
9
9
  import Teleport from "../base/teleport.js";
10
10
  import { Transition } from "../base/transition.js";
11
+ import { usePopupHost } from "../config/popup-host.js";
11
12
  import { setPlacement } from "../utils/placement.js";
12
13
  import { createFrameScheduler, isEventOutside } from "../utils/popup.js";
13
14
  import { getChildren, setRef } from "../utils/react-node.js";
@@ -153,6 +154,7 @@ var Popup = forwardRef(function Popup({ open, disabled = false, placement = "bot
153
154
  getAnchorPosition
154
155
  ]);
155
156
  const requestFromEvent = useEffectEvent(request);
157
+ usePopupHost(() => requestFromEvent(false, { reason: "host" }));
156
158
  const closeLater = () => {
157
159
  clearTimer();
158
160
  timer.current = setTimeout(() => request(false, { reason: trigger === "focus" ? "focus" : "hover" }), Math.max(0, closeDelay));
@@ -271,13 +273,14 @@ var Popup = forwardRef(function Popup({ open, disabled = false, placement = "bot
271
273
  const nodes = getChildren(children);
272
274
  const candidate = nodes.length === 1 && React.isValidElement(nodes[0]) && nodes[0].type !== React.Fragment ? nodes[0] : /* @__PURE__ */ jsx("span", { children: nodes });
273
275
  const original = candidate.props;
276
+ const hidesExpansionAria = original.role === "menuitem" && !original["aria-haspopup"];
274
277
  const triggerNode = target ? candidate : React.cloneElement(candidate, {
275
278
  ...triggerProps,
276
279
  ref: (node_0) => {
277
280
  selectionRef.current = node_0;
278
281
  setRef(original.ref, node_0);
279
282
  },
280
- "aria-expanded": visible,
283
+ ...hidesExpansionAria ? {} : { "aria-expanded": visible },
281
284
  onTouchStart: (event_2) => {
282
285
  original.onTouchStart?.(event_2);
283
286
  if (trigger === "hover") request(true, {
@@ -1,20 +1,29 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
6
6
  * Author: Qiu / https://chuchur.com
7
7
  */
8
8
 
9
+ import { nextOverlayOrder } from "../utils/overlay-order.js";
9
10
  //#region components/popup/layers.ts
10
11
  var layers = [];
12
+ var openedAt = /* @__PURE__ */ new WeakMap();
11
13
  function registerPopupLayer(layer) {
14
+ openedAt.set(layer, nextOverlayOrder());
12
15
  layers.push(layer);
13
16
  return () => {
14
17
  const index = layers.indexOf(layer);
15
18
  if (index >= 0) layers.splice(index, 1);
16
19
  };
17
20
  }
21
+ /** 还开着的弹层里最晚打开那位的顺序号;一个都没有则 0。遮罩层用它判断自己有没有被弹层压住。 */
22
+ function latestPopupLayerOrder() {
23
+ let latest = 0;
24
+ for (const layer of layers) latest = Math.max(latest, openedAt.get(layer) ?? 0);
25
+ return latest;
26
+ }
18
27
  function descendants(layer, seen = /* @__PURE__ */ new Set()) {
19
28
  seen.add(layer);
20
29
  return layers.filter((child) => child !== layer && !seen.has(child) && layer.popup.contains(child.trigger())).flatMap((child) => [child, ...descendants(child, seen)]);
@@ -30,4 +39,4 @@ function closePopupChildren(popup) {
30
39
  if (layer) descendants(layer).reverse().forEach((child) => child.close());
31
40
  }
32
41
  //#endregion
33
- export { closePopupChildren, isTopPopupLayer, popupLayerElements, registerPopupLayer };
42
+ export { closePopupChildren, isTopPopupLayer, latestPopupLayerOrder, popupLayerElements, registerPopupLayer };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,14 +1,13 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
6
6
  * Author: Qiu / https://chuchur.com
7
7
  */
8
8
 
9
- import zh_CN_default from "../locale/zh-CN.js";
10
- import { ConfigContext } from "../config/config-context.js";
11
- import { useConfigAppearance } from "../config/use-config-appearance.js";
9
+ import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
10
+ import { resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
12
11
  import Button from "../button/button.js";
13
12
  import Spin from "../spin/index.js";
14
13
  import clsx from "clsx";
@@ -17,6 +16,13 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
16
  import Color from "color";
18
17
  import { toCanvas } from "qrcode";
19
18
  //#region components/qrcode/index.tsx
19
+ var PAINTED_THEMES = [
20
+ "fill",
21
+ "outline",
22
+ "plain",
23
+ "solid",
24
+ "dashed"
25
+ ];
20
26
  var positive = (value, fallback) => Number.isFinite(value) && value > 0 ? value : fallback;
21
27
  var resolveColor = (input, parent, fallback) => {
22
28
  if (!input.trim().startsWith("var(")) return input;
@@ -42,7 +48,7 @@ var loadImage = (src) => new Promise((resolve) => {
42
48
  var QRCode = forwardRef(function QRCode({ value, size = 160, colorDark = "var(--kui-color-reverse)", colorLight = "var(--kui-color-bg)", bordered = true, shape: shapeProp, theme: themeProp, status = "active", logo = "", logoSize, margin = 0, logoRadius = 4, logoBorder = true, errorLevel = "M", loadingContent, expiredContent, scannedContent, onRefresh, className, style, ...rest }, ref) {
43
49
  const inheritedAppearance = useConfigAppearance();
44
50
  const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
45
- const theme = themeProp ?? inheritedAppearance.theme ?? "outline";
51
+ const theme = resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? "outline";
46
52
  const canvasRef = useRef(null);
47
53
  const drawIdRef = useRef(0);
48
54
  const drawnRef = useRef(false);
@@ -50,7 +56,7 @@ var QRCode = forwardRef(function QRCode({ value, size = 160, colorDark = "var(--
50
56
  const safeSize = positive(size, 160);
51
57
  const safeMargin = Number.isFinite(margin) ? Math.max(0, Math.floor(margin)) : 0;
52
58
  const { locale } = useContext(ConfigContext);
53
- const messages = (locale ?? zh_CN_default)?.k?.qrcode;
59
+ const messages = (locale ?? DEFAULT_LOCALE)?.k?.qrcode;
54
60
  const draw = useCallback(async () => {
55
61
  const canvas = canvasRef.current;
56
62
  if (!canvas) return;
@@ -152,7 +158,7 @@ var QRCode = forwardRef(function QRCode({ value, size = 160, colorDark = "var(--
152
158
  };
153
159
  return /* @__PURE__ */ jsxs("div", {
154
160
  ...rest,
155
- className: clsx("k-qrcode", `k-qrcode-${shape}`, `k-qrcode-${theme}`, { "k-qrcode-plain": !bordered }, className),
161
+ className: clsx("k-qrcode", `k-qrcode-${shape}`, `k-qrcode-${theme}`, { "k-qrcode-borderless": !bordered }, className),
156
162
  style: {
157
163
  ...style,
158
164
  width: safeSize,
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
6
6
  * Author: Qiu / https://chuchur.com
7
7
  */
8
8
 
9
- import { useConfigAppearance } from "../config/use-config-appearance.js";
9
+ import { SURFACE_THEMES, resolvePaintedTheme, useFormAppearance } from "../config/use-config-appearance.js";
10
10
  import { useValue } from "../utils/use-value.js";
11
11
  import Button from "../button/button.js";
12
12
  import { createFormFieldComponent } from "../form/field-context.js";
@@ -16,7 +16,7 @@ import React, { useContext } from "react";
16
16
  import { jsx } from "react/jsx-runtime";
17
17
  //#region components/radio/radio-button.tsx
18
18
  var RadioButton = React.forwardRef((t0, ref) => {
19
- const $ = c(39);
19
+ const $ = c(41);
20
20
  let checked;
21
21
  let children;
22
22
  let icon;
@@ -63,7 +63,7 @@ var RadioButton = React.forwardRef((t0, ref) => {
63
63
  }
64
64
  const disabled = t1 === void 0 ? false : t1;
65
65
  const readOnly = t2 === void 0 ? false : t2;
66
- const inheritedAppearance = useConfigAppearance();
66
+ const inheritedAppearance = useFormAppearance();
67
67
  const theme = themeProp ?? inheritedAppearance.theme;
68
68
  const size = sizeProp ?? inheritedAppearance.size;
69
69
  const shape = shapeProp ?? inheritedAppearance.shape;
@@ -74,13 +74,20 @@ var RadioButton = React.forwardRef((t0, ref) => {
74
74
  const isChecked = isGroup ? groupChecked : localChecked;
75
75
  const currentDisabled = disabled || isGroup && group.disabled;
76
76
  const currentReadOnly = readOnly || Boolean(isGroup && group.readOnly);
77
- const currentTheme = themeProp ?? group?.theme ?? theme;
77
+ const t3 = themeProp ?? group?.theme ?? theme;
78
+ let t4;
79
+ if ($[14] !== t3) {
80
+ t4 = resolvePaintedTheme(t3, SURFACE_THEMES);
81
+ $[14] = t3;
82
+ $[15] = t4;
83
+ } else t4 = $[15];
84
+ const currentTheme = t4;
78
85
  const currentSize = sizeProp ?? group?.size ?? size;
79
86
  const currentShape = shapeProp ?? group?.shape ?? shape;
80
87
  const labelText = label ?? children ?? String(value ?? "");
81
- let t3;
82
- if ($[14] !== currentDisabled || $[15] !== currentReadOnly || $[16] !== group || $[17] !== isChecked || $[18] !== isGroup || $[19] !== label || $[20] !== onChange || $[21] !== onClick || $[22] !== setLocalChecked || $[23] !== value) {
83
- t3 = (e) => {
88
+ let t5;
89
+ if ($[16] !== currentDisabled || $[17] !== currentReadOnly || $[18] !== group || $[19] !== isChecked || $[20] !== isGroup || $[21] !== label || $[22] !== onChange || $[23] !== onClick || $[24] !== setLocalChecked || $[25] !== value) {
90
+ t5 = (e) => {
84
91
  onClick?.(e);
85
92
  if (e.defaultPrevented) return;
86
93
  if (currentDisabled || currentReadOnly || isChecked) return;
@@ -94,25 +101,25 @@ var RadioButton = React.forwardRef((t0, ref) => {
94
101
  group?.onChange?.(eventObj);
95
102
  e.preventDefault();
96
103
  };
97
- $[14] = currentDisabled;
98
- $[15] = currentReadOnly;
99
- $[16] = group;
100
- $[17] = isChecked;
101
- $[18] = isGroup;
102
- $[19] = label;
103
- $[20] = onChange;
104
- $[21] = onClick;
105
- $[22] = setLocalChecked;
106
- $[23] = value;
107
- $[24] = t3;
108
- } else t3 = $[24];
109
- const handleClick = t3;
110
- const t4 = isChecked ? "primary" : "default";
111
- const t5 = currentReadOnly || void 0;
112
- const t6 = isChecked ? 0 : -1;
113
- let t7;
114
- if ($[25] !== currentDisabled || $[26] !== currentShape || $[27] !== currentSize || $[28] !== currentTheme || $[29] !== handleClick || $[30] !== icon || $[31] !== isChecked || $[32] !== labelText || $[33] !== ref || $[34] !== rest || $[35] !== t4 || $[36] !== t5 || $[37] !== t6) {
115
- t7 = /* @__PURE__ */ jsx(Button, {
104
+ $[16] = currentDisabled;
105
+ $[17] = currentReadOnly;
106
+ $[18] = group;
107
+ $[19] = isChecked;
108
+ $[20] = isGroup;
109
+ $[21] = label;
110
+ $[22] = onChange;
111
+ $[23] = onClick;
112
+ $[24] = setLocalChecked;
113
+ $[25] = value;
114
+ $[26] = t5;
115
+ } else t5 = $[26];
116
+ const handleClick = t5;
117
+ const t6 = isChecked ? "primary" : "default";
118
+ const t7 = currentReadOnly || void 0;
119
+ const t8 = isChecked ? 0 : -1;
120
+ let t9;
121
+ if ($[27] !== currentDisabled || $[28] !== currentShape || $[29] !== currentSize || $[30] !== currentTheme || $[31] !== handleClick || $[32] !== icon || $[33] !== isChecked || $[34] !== labelText || $[35] !== ref || $[36] !== rest || $[37] !== t6 || $[38] !== t7 || $[39] !== t8) {
122
+ t9 = /* @__PURE__ */ jsx(Button, {
116
123
  ...rest,
117
124
  ref,
118
125
  disabled: currentDisabled,
@@ -120,30 +127,30 @@ var RadioButton = React.forwardRef((t0, ref) => {
120
127
  icon,
121
128
  theme: currentTheme,
122
129
  shape: currentShape,
123
- type: t4,
130
+ type: t6,
124
131
  onClick: handleClick,
125
132
  role: "radio",
126
133
  "aria-checked": isChecked,
127
- "aria-readonly": t5,
128
- tabIndex: t6,
134
+ "aria-readonly": t7,
135
+ tabIndex: t8,
129
136
  children: labelText
130
137
  });
131
- $[25] = currentDisabled;
132
- $[26] = currentShape;
133
- $[27] = currentSize;
134
- $[28] = currentTheme;
135
- $[29] = handleClick;
136
- $[30] = icon;
137
- $[31] = isChecked;
138
- $[32] = labelText;
139
- $[33] = ref;
140
- $[34] = rest;
141
- $[35] = t4;
142
- $[36] = t5;
138
+ $[27] = currentDisabled;
139
+ $[28] = currentShape;
140
+ $[29] = currentSize;
141
+ $[30] = currentTheme;
142
+ $[31] = handleClick;
143
+ $[32] = icon;
144
+ $[33] = isChecked;
145
+ $[34] = labelText;
146
+ $[35] = ref;
147
+ $[36] = rest;
143
148
  $[37] = t6;
144
149
  $[38] = t7;
145
- } else t7 = $[38];
146
- return t7;
150
+ $[39] = t8;
151
+ $[40] = t9;
152
+ } else t9 = $[40];
153
+ return t9;
147
154
  });
148
155
  RadioButton.displayName = "RadioButton";
149
156
  var radio_button_default = createFormFieldComponent(RadioButton, {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * react-kui v3.1.2
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
6
6
  * Author: Qiu / https://chuchur.com
7
7
  */
8
8
 
9
- import { useConfigAppearance } from "../config/use-config-appearance.js";
9
+ import { useFormAppearance } from "../config/use-config-appearance.js";
10
10
  import { useValue } from "../utils/use-value.js";
11
11
  import { createFormFieldComponent } from "../form/field-context.js";
12
12
  import { RadioGroupContext } from "./radio-group-context.js";
@@ -18,7 +18,7 @@ import React, { useId, useRef } from "react";
18
18
  import { jsx } from "react/jsx-runtime";
19
19
  //#region components/radio/radio-group.tsx
20
20
  var RadioGroup = (t0) => {
21
- const $ = c(67);
21
+ const $ = c(65);
22
22
  let children;
23
23
  let onChange;
24
24
  let onKeyDown;
@@ -70,7 +70,7 @@ var RadioGroup = (t0) => {
70
70
  const readOnly = t2 === void 0 ? false : t2;
71
71
  const direction = t3 === void 0 ? "horizontal" : t3;
72
72
  const className = t4 === void 0 ? "" : t4;
73
- const inheritedAppearance = useConfigAppearance();
73
+ const inheritedAppearance = useFormAppearance();
74
74
  const size = sizeProp ?? inheritedAppearance.size;
75
75
  const theme = themeProp ?? inheritedAppearance.theme;
76
76
  const shape = shapeProp ?? inheritedAppearance.shape;
@@ -129,9 +129,9 @@ var RadioGroup = (t0) => {
129
129
  bb0: {
130
130
  if (options && options.length > 0) {
131
131
  let t12;
132
- if ($[28] !== Component || $[29] !== disabled || $[30] !== options || $[31] !== readOnly || $[32] !== shape || $[33] !== size || $[34] !== theme) {
132
+ if ($[28] !== Component || $[29] !== disabled || $[30] !== options || $[31] !== readOnly || $[32] !== shape || $[33] !== size) {
133
133
  let t13;
134
- if ($[36] !== Component || $[37] !== disabled || $[38] !== readOnly || $[39] !== shape || $[40] !== size || $[41] !== theme) {
134
+ if ($[35] !== Component || $[36] !== disabled || $[37] !== readOnly || $[38] !== shape || $[39] !== size) {
135
135
  t13 = (option) => /* @__PURE__ */ jsx(Component, {
136
136
  label: option.label,
137
137
  value: option.value,
@@ -139,17 +139,15 @@ var RadioGroup = (t0) => {
139
139
  readOnly,
140
140
  icon: option.icon,
141
141
  size,
142
- theme,
143
142
  shape
144
143
  }, option.label ?? option.value);
145
- $[36] = Component;
146
- $[37] = disabled;
147
- $[38] = readOnly;
148
- $[39] = shape;
149
- $[40] = size;
150
- $[41] = theme;
151
- $[42] = t13;
152
- } else t13 = $[42];
144
+ $[35] = Component;
145
+ $[36] = disabled;
146
+ $[37] = readOnly;
147
+ $[38] = shape;
148
+ $[39] = size;
149
+ $[40] = t13;
150
+ } else t13 = $[40];
153
151
  t12 = options.map(t13);
154
152
  $[28] = Component;
155
153
  $[29] = disabled;
@@ -157,23 +155,22 @@ var RadioGroup = (t0) => {
157
155
  $[31] = readOnly;
158
156
  $[32] = shape;
159
157
  $[33] = size;
160
- $[34] = theme;
161
- $[35] = t12;
162
- } else t12 = $[35];
158
+ $[34] = t12;
159
+ } else t12 = $[34];
163
160
  t11 = t12;
164
161
  break bb0;
165
162
  }
166
163
  let t12;
167
- if ($[43] !== children) {
164
+ if ($[41] !== children) {
168
165
  t12 = React.Children.map(children, _temp2);
169
- $[43] = children;
170
- $[44] = t12;
171
- } else t12 = $[44];
166
+ $[41] = children;
167
+ $[42] = t12;
168
+ } else t12 = $[42];
172
169
  t11 = t12;
173
170
  }
174
171
  const content = t11;
175
172
  let t12;
176
- if ($[45] !== currentValue || $[46] !== disabled || $[47] !== handleRadioChange || $[48] !== name || $[49] !== readOnly || $[50] !== shape || $[51] !== size || $[52] !== theme) {
173
+ if ($[43] !== currentValue || $[44] !== disabled || $[45] !== handleRadioChange || $[46] !== name || $[47] !== readOnly || $[48] !== shape || $[49] !== size || $[50] !== theme) {
177
174
  t12 = {
178
175
  name,
179
176
  value: currentValue,
@@ -184,20 +181,20 @@ var RadioGroup = (t0) => {
184
181
  shape,
185
182
  onChange: handleRadioChange
186
183
  };
187
- $[45] = currentValue;
188
- $[46] = disabled;
189
- $[47] = handleRadioChange;
190
- $[48] = name;
191
- $[49] = readOnly;
192
- $[50] = shape;
193
- $[51] = size;
194
- $[52] = theme;
195
- $[53] = t12;
196
- } else t12 = $[53];
184
+ $[43] = currentValue;
185
+ $[44] = disabled;
186
+ $[45] = handleRadioChange;
187
+ $[46] = name;
188
+ $[47] = readOnly;
189
+ $[48] = shape;
190
+ $[49] = size;
191
+ $[50] = theme;
192
+ $[51] = t12;
193
+ } else t12 = $[51];
197
194
  const t13 = disabled || void 0;
198
195
  const t14 = readOnly || void 0;
199
196
  let t15;
200
- if ($[54] !== isButton || $[55] !== onKeyDown) {
197
+ if ($[52] !== isButton || $[53] !== onKeyDown) {
201
198
  t15 = (event_0) => {
202
199
  onKeyDown?.(event_0);
203
200
  if (event_0.defaultPrevented) return;
@@ -216,12 +213,12 @@ var RadioGroup = (t0) => {
216
213
  next_0?.focus();
217
214
  next_0?.click();
218
215
  };
219
- $[54] = isButton;
220
- $[55] = onKeyDown;
221
- $[56] = t15;
222
- } else t15 = $[56];
216
+ $[52] = isButton;
217
+ $[53] = onKeyDown;
218
+ $[54] = t15;
219
+ } else t15 = $[54];
223
220
  let t16;
224
- if ($[57] !== classes || $[58] !== content || $[59] !== rest || $[60] !== t13 || $[61] !== t14 || $[62] !== t15) {
221
+ if ($[55] !== classes || $[56] !== content || $[57] !== rest || $[58] !== t13 || $[59] !== t14 || $[60] !== t15) {
225
222
  t16 = /* @__PURE__ */ jsx("div", {
226
223
  ...rest,
227
224
  className: classes,
@@ -232,24 +229,24 @@ var RadioGroup = (t0) => {
232
229
  onKeyDown: t15,
233
230
  children: content
234
231
  });
235
- $[57] = classes;
236
- $[58] = content;
237
- $[59] = rest;
238
- $[60] = t13;
239
- $[61] = t14;
240
- $[62] = t15;
241
- $[63] = t16;
242
- } else t16 = $[63];
232
+ $[55] = classes;
233
+ $[56] = content;
234
+ $[57] = rest;
235
+ $[58] = t13;
236
+ $[59] = t14;
237
+ $[60] = t15;
238
+ $[61] = t16;
239
+ } else t16 = $[61];
243
240
  let t17;
244
- if ($[64] !== t12 || $[65] !== t16) {
241
+ if ($[62] !== t12 || $[63] !== t16) {
245
242
  t17 = /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
246
243
  value: t12,
247
244
  children: t16
248
245
  });
249
- $[64] = t12;
250
- $[65] = t16;
251
- $[66] = t17;
252
- } else t17 = $[66];
246
+ $[62] = t12;
247
+ $[63] = t16;
248
+ $[64] = t17;
249
+ } else t17 = $[64];
253
250
  return t17;
254
251
  };
255
252
  var radio_group_default = createFormFieldComponent(RadioGroup);