react-kui 3.2.0 → 3.3.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 (354) hide show
  1. package/ai/kui-components.json +825 -168
  2. package/es/_virtual/_rolldown/runtime.js +2 -3
  3. package/es/affix/index.js +73 -185
  4. package/es/alert/index.js +3 -4
  5. package/es/anchor/anchor-context.js +2 -3
  6. package/es/anchor/anchor-link.js +3 -4
  7. package/es/anchor/anchor.js +195 -398
  8. package/es/auto-complete/index.js +160 -561
  9. package/es/avatar/avatar-group-context.js +2 -3
  10. package/es/avatar/avatar-group.js +32 -124
  11. package/es/avatar/avatar.js +58 -159
  12. package/es/back-top/index.js +66 -201
  13. package/es/badge/index.js +4 -5
  14. package/es/base/teleport.js +22 -54
  15. package/es/base/transition-props.js +2 -3
  16. package/es/base/transition.js +2 -3
  17. package/es/breadcrumb/breadcrumb-context.js +2 -3
  18. package/es/breadcrumb/breadcrumb-item.js +19 -102
  19. package/es/breadcrumb/breadcrumb.js +10 -59
  20. package/es/button/button-group-context.js +2 -3
  21. package/es/button/button-group.js +15 -75
  22. package/es/button/button.js +4 -5
  23. package/es/calendar/index.js +4 -5
  24. package/es/card/index.js +4 -5
  25. package/es/carousel/carousel-context.js +2 -3
  26. package/es/carousel/carousel-item.js +3 -4
  27. package/es/carousel/carousel.js +281 -628
  28. package/es/carousel/drag.js +2 -3
  29. package/es/cascader/index.js +7 -8
  30. package/es/check-card/check-card-group.js +53 -179
  31. package/es/check-card/check-card.js +100 -293
  32. package/es/check-card/context.js +2 -3
  33. package/es/checkbox/checkbox-group-context.js +2 -3
  34. package/es/checkbox/checkbox-group.js +34 -138
  35. package/es/checkbox/checkbox.js +4 -5
  36. package/es/checkbox/index.js +2 -3
  37. package/es/collapse/collapse-panel.js +84 -206
  38. package/es/collapse/collapse.js +38 -170
  39. package/es/color-picker/alpha.js +44 -125
  40. package/es/color-picker/hue.js +39 -108
  41. package/es/color-picker/index.js +7 -6
  42. package/es/color-picker/mode.js +76 -159
  43. package/es/color-picker/paint.js +66 -163
  44. package/es/color-picker/presets.js +12 -44
  45. package/es/components.js +37 -32
  46. package/es/config/config-context.js +2 -3
  47. package/es/config/context.js +2 -3
  48. package/es/config/index.js +3 -4
  49. package/es/config/popup-host.js +3 -4
  50. package/es/config/size-context.js +2 -3
  51. package/es/config/use-config-appearance.js +3 -4
  52. package/es/const/var.js +2 -3
  53. package/es/date-picker/index.js +8 -9
  54. package/es/descriptions/descriptions-item.js +3 -4
  55. package/es/descriptions/descriptions.js +53 -144
  56. package/es/divider/index.js +2 -3
  57. package/es/drawer/index.js +171 -465
  58. package/es/dropdown/dropdown-button.js +25 -128
  59. package/es/dropdown/dropdown-context.js +2 -3
  60. package/es/dropdown/dropdown.js +56 -207
  61. package/es/dropdown/trigger.js +37 -125
  62. package/es/empty/index.js +34 -111
  63. package/es/feature-card/index.js +2 -3
  64. package/es/feedback-panel/index.js +30 -155
  65. package/es/flame-wrap/index.js +3 -4
  66. package/es/flame-wrap/types.js +2 -3
  67. package/es/flex/index.js +2 -3
  68. package/es/form/field-context.js +3 -4
  69. package/es/form/form-context.js +2 -3
  70. package/es/form/form-item.js +4 -5
  71. package/es/form/form.js +108 -279
  72. package/es/form/utils.js +2 -3
  73. package/es/gradient-picker/corners.js +55 -0
  74. package/es/gradient-picker/index.js +191 -0
  75. package/es/gradient-picker/stops.js +219 -0
  76. package/es/gradient-picker/types.js +147 -0
  77. package/es/grid/grid-item.js +25 -116
  78. package/es/grid/grid.js +40 -151
  79. package/es/grid/useBreakpoint.js +3 -4
  80. package/es/icon/index.js +24 -126
  81. package/es/image/group.js +3 -4
  82. package/es/image/image-group-context.js +2 -3
  83. package/es/image/image.js +5 -6
  84. package/es/image/instance.js +2 -3
  85. package/es/image/preview.js +4 -5
  86. package/es/image/utils.js +2 -3
  87. package/es/index.js +5 -4
  88. package/es/input/index.js +2 -3
  89. package/es/input/input-base.js +4 -5
  90. package/es/input/input-box.js +2 -3
  91. package/es/input/input-group.js +4 -5
  92. package/es/input/input.js +3 -4
  93. package/es/input/textarea.js +3 -4
  94. package/es/input-number/drag.js +63 -0
  95. package/es/input-number/index.js +41 -11
  96. package/es/input-otp/index.js +3 -4
  97. package/es/input-tag/index.js +5 -6
  98. package/es/kanban/index.js +31 -168
  99. package/es/layout/index.js +43 -215
  100. package/es/layout/layout-context.js +2 -3
  101. package/es/list-panel/index.js +47 -185
  102. package/es/loading/index.js +2 -3
  103. package/es/loading/loading-bar.js +54 -114
  104. package/es/locale/de.js +2 -3
  105. package/es/locale/el.js +2 -3
  106. package/es/locale/en.js +2 -3
  107. package/es/locale/fr.js +2 -3
  108. package/es/locale/it.js +2 -3
  109. package/es/locale/ja.js +2 -3
  110. package/es/locale/ko.js +2 -3
  111. package/es/locale/ru.js +2 -3
  112. package/es/locale/th.js +2 -3
  113. package/es/locale/uk.js +2 -3
  114. package/es/locale/vi.js +2 -3
  115. package/es/locale/zh-CN.js +2 -3
  116. package/es/locale/zh-TW.js +2 -3
  117. package/es/mentions/index.js +214 -581
  118. package/es/menu/menu-context.js +2 -3
  119. package/es/menu/menu-divider.js +3 -4
  120. package/es/menu/menu-group.js +3 -4
  121. package/es/menu/menu-item.js +2 -3
  122. package/es/menu/menu-keyboard.js +2 -3
  123. package/es/menu/menu.js +184 -442
  124. package/es/menu/recursive-menu.js +3 -4
  125. package/es/menu/sub-menu.js +5 -6
  126. package/es/message/index.js +2 -3
  127. package/es/modal/api.js +2 -3
  128. package/es/modal/modal.js +263 -599
  129. package/es/modal/toast.js +63 -179
  130. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +2 -3
  131. package/es/notice/container.js +2 -3
  132. package/es/notice/content.js +4 -5
  133. package/es/notice/index.js +2 -3
  134. package/es/notice/instance.js +2 -3
  135. package/es/page/index.js +4 -5
  136. package/es/page/responsive.js +2 -3
  137. package/es/page-header/index.js +3 -4
  138. package/es/popconfirm/index.js +24 -70
  139. package/es/poptip/index.js +29 -88
  140. package/es/popup/index.js +8 -6
  141. package/es/popup/layers.js +2 -3
  142. package/es/progress/index.js +95 -229
  143. package/es/qrcode/index.js +3 -4
  144. package/es/radio/radio-button.js +37 -131
  145. package/es/radio/radio-group-context.js +2 -3
  146. package/es/radio/radio-group.js +69 -223
  147. package/es/radio/radio.js +3 -4
  148. package/es/rate/index.js +68 -226
  149. package/es/rate/star.js +38 -129
  150. package/es/result/index.js +35 -127
  151. package/es/ripple/index.js +3 -4
  152. package/es/ripple/types.js +2 -3
  153. package/es/row-col/col.js +59 -149
  154. package/es/row-col/row.js +2 -3
  155. package/es/segmented/index.js +72 -196
  156. package/es/select/option.js +23 -116
  157. package/es/select/select.js +9 -10
  158. package/es/skeleton/skeleton-avatar.js +2 -3
  159. package/es/skeleton/skeleton-button.js +2 -3
  160. package/es/skeleton/skeleton-image.js +28 -108
  161. package/es/skeleton/skeleton-text.js +17 -93
  162. package/es/skeleton/skeleton.js +46 -133
  163. package/es/skeleton/use-skeleton-loading.js +3 -4
  164. package/es/slider/index.js +92 -286
  165. package/es/slider/thumb.js +43 -133
  166. package/es/space/index.js +3 -4
  167. package/es/spin/index.js +2 -3
  168. package/es/splitter/splitter-panel.js +3 -4
  169. package/es/splitter/splitter.js +77 -219
  170. package/es/stat-card/countup.js +46 -141
  171. package/es/stat-card/rollup.js +27 -105
  172. package/es/stat-card/stat-card.js +3 -4
  173. package/es/stat-card/stat-number.js +26 -113
  174. package/es/stat-card/utils/countup.js +2 -3
  175. package/es/stat-card/utils/odometer.js +2 -3
  176. package/es/stat-card/utils/stat-item-key.js +2 -3
  177. package/es/steps/index.js +45 -123
  178. package/es/switch/index.js +4 -5
  179. package/es/table/column-setting.js +43 -139
  180. package/es/table/index.js +25 -15
  181. package/es/table/utils.js +3 -5
  182. package/es/tabs/tab-panel.js +19 -71
  183. package/es/tabs/tabs.js +6 -7
  184. package/es/tag/index.js +4 -5
  185. package/es/time-line/timeline-item.js +3 -4
  186. package/es/time-line/timeline.js +8 -44
  187. package/es/tooltip/index.js +41 -142
  188. package/es/tour/index.js +138 -356
  189. package/es/transfer/index.js +184 -487
  190. package/es/tree/index.js +8 -9
  191. package/es/tree/utils.js +2 -3
  192. package/es/tree-select/index.js +8 -9
  193. package/es/typography/index.js +75 -306
  194. package/es/upload/file-list.js +95 -119
  195. package/es/upload/index.js +8 -9
  196. package/es/upload/picture-sort.js +2 -3
  197. package/es/upload/selector.js +63 -193
  198. package/es/utils/checked.js +2 -3
  199. package/es/utils/color.js +2 -3
  200. package/es/utils/css.js +2 -3
  201. package/es/utils/focus.js +2 -3
  202. package/es/utils/number.js +2 -3
  203. package/es/utils/overlay-order.js +2 -3
  204. package/es/utils/overlay-stack.js +3 -4
  205. package/es/utils/placement.js +16 -4
  206. package/es/utils/popup-arrow.js +45 -0
  207. package/es/utils/popup.js +2 -3
  208. package/es/utils/promise.js +2 -3
  209. package/es/utils/react-node.js +2 -3
  210. package/es/utils/selection-tags.js +2 -3
  211. package/es/utils/share.js +2 -3
  212. package/es/utils/theme.js +2 -3
  213. package/es/utils/transition.js +2 -3
  214. package/es/utils/use-value.js +3 -4
  215. package/es/virtual-list/index.js +49 -187
  216. package/es/virtual-list/range.js +2 -3
  217. package/es/watermark/index.js +149 -289
  218. package/lib/index.cjs +2 -2
  219. package/lib/locale/de.cjs +1 -1
  220. package/lib/locale/el.cjs +1 -1
  221. package/lib/locale/en.cjs +1 -1
  222. package/lib/locale/fr.cjs +1 -1
  223. package/lib/locale/it.cjs +1 -1
  224. package/lib/locale/ja.cjs +1 -1
  225. package/lib/locale/ko.cjs +1 -1
  226. package/lib/locale/ru.cjs +1 -1
  227. package/lib/locale/th.cjs +1 -1
  228. package/lib/locale/uk.cjs +1 -1
  229. package/lib/locale/vi.cjs +1 -1
  230. package/lib/locale/zh-CN.cjs +1 -1
  231. package/lib/locale/zh-TW.cjs +1 -1
  232. package/package.json +24 -24
  233. package/style/base.css +1 -1
  234. package/style/components.css +2 -2
  235. package/style/index.css +2 -2
  236. package/style/theme.css +1 -1
  237. package/types/affix/index.d.cts +1 -1
  238. package/types/affix/index.d.ts +1 -1
  239. package/types/anchor/anchor-link.d.cts +1 -1
  240. package/types/anchor/anchor-link.d.ts +1 -1
  241. package/types/anchor/anchor.d.cts +1 -1
  242. package/types/anchor/anchor.d.ts +1 -1
  243. package/types/back-top/index.d.cts +1 -1
  244. package/types/back-top/index.d.ts +1 -1
  245. package/types/carousel/carousel-item.d.cts +1 -1
  246. package/types/carousel/carousel-item.d.ts +1 -1
  247. package/types/cascader/index.d.cts +1 -1
  248. package/types/cascader/index.d.ts +1 -1
  249. package/types/color-picker/alpha.d.cts +1 -1
  250. package/types/color-picker/alpha.d.ts +1 -1
  251. package/types/color-picker/hue.d.cts +1 -1
  252. package/types/color-picker/hue.d.ts +1 -1
  253. package/types/color-picker/index.d.cts +3 -2
  254. package/types/color-picker/index.d.ts +3 -2
  255. package/types/color-picker/mode.d.cts +1 -1
  256. package/types/color-picker/mode.d.ts +1 -1
  257. package/types/color-picker/paint.d.cts +1 -1
  258. package/types/color-picker/paint.d.ts +1 -1
  259. package/types/color-picker/presets.d.cts +1 -1
  260. package/types/color-picker/presets.d.ts +1 -1
  261. package/types/components.d.cts +3 -0
  262. package/types/components.d.ts +3 -0
  263. package/types/date-picker/index.d.cts +2 -2
  264. package/types/date-picker/index.d.ts +2 -2
  265. package/types/feature-card/index.d.cts +1 -1
  266. package/types/feature-card/index.d.ts +1 -1
  267. package/types/feedback-panel/index.d.cts +1 -1
  268. package/types/feedback-panel/index.d.ts +1 -1
  269. package/types/flame-wrap/index.d.cts +1 -1
  270. package/types/flame-wrap/index.d.ts +1 -1
  271. package/types/form/form-item.d.cts +1 -1
  272. package/types/form/form-item.d.ts +1 -1
  273. package/types/gradient-picker/corners.d.cts +8 -0
  274. package/types/gradient-picker/corners.d.ts +8 -0
  275. package/types/gradient-picker/index.d.cts +25 -0
  276. package/types/gradient-picker/index.d.ts +25 -0
  277. package/types/gradient-picker/stops.d.cts +12 -0
  278. package/types/gradient-picker/stops.d.ts +12 -0
  279. package/types/gradient-picker/types.d.cts +34 -0
  280. package/types/gradient-picker/types.d.ts +34 -0
  281. package/types/grid/grid-item.d.cts +1 -1
  282. package/types/grid/grid-item.d.ts +1 -1
  283. package/types/grid/grid.d.cts +1 -1
  284. package/types/grid/grid.d.ts +1 -1
  285. package/types/image/group.d.cts +1 -1
  286. package/types/image/group.d.ts +1 -1
  287. package/types/input-number/drag.d.cts +9 -0
  288. package/types/input-number/drag.d.ts +9 -0
  289. package/types/input-number/index.d.cts +1 -0
  290. package/types/input-number/index.d.ts +1 -0
  291. package/types/kanban/index.d.cts +1 -1
  292. package/types/kanban/index.d.ts +1 -1
  293. package/types/list-panel/index.d.cts +1 -1
  294. package/types/list-panel/index.d.ts +1 -1
  295. package/types/loading/loading-bar.d.cts +1 -1
  296. package/types/loading/loading-bar.d.ts +1 -1
  297. package/types/modal/toast.d.cts +1 -1
  298. package/types/modal/toast.d.ts +1 -1
  299. package/types/notice/content.d.cts +2 -2
  300. package/types/notice/content.d.ts +2 -2
  301. package/types/page-header/index.d.cts +1 -1
  302. package/types/page-header/index.d.ts +1 -1
  303. package/types/popconfirm/index.d.cts +1 -0
  304. package/types/popconfirm/index.d.ts +1 -0
  305. package/types/poptip/index.d.cts +1 -0
  306. package/types/poptip/index.d.ts +1 -0
  307. package/types/popup/index.d.cts +1 -0
  308. package/types/popup/index.d.ts +1 -0
  309. package/types/result/index.d.cts +1 -1
  310. package/types/result/index.d.ts +1 -1
  311. package/types/ripple/index.d.cts +1 -1
  312. package/types/ripple/index.d.ts +1 -1
  313. package/types/segmented/index.d.cts +2 -1
  314. package/types/segmented/index.d.ts +2 -1
  315. package/types/slider/index.d.cts +1 -1
  316. package/types/slider/index.d.ts +1 -1
  317. package/types/splitter/splitter-panel.d.cts +1 -1
  318. package/types/splitter/splitter-panel.d.ts +1 -1
  319. package/types/splitter/splitter.d.cts +1 -1
  320. package/types/splitter/splitter.d.ts +1 -1
  321. package/types/stat-card/countup.d.cts +1 -1
  322. package/types/stat-card/countup.d.ts +1 -1
  323. package/types/stat-card/rollup.d.cts +1 -1
  324. package/types/stat-card/rollup.d.ts +1 -1
  325. package/types/stat-card/stat-card.d.cts +1 -1
  326. package/types/stat-card/stat-card.d.ts +1 -1
  327. package/types/stat-card/stat-number.d.cts +1 -1
  328. package/types/stat-card/stat-number.d.ts +1 -1
  329. package/types/table/column-setting.d.cts +1 -1
  330. package/types/table/column-setting.d.ts +1 -1
  331. package/types/table/index.d.cts +1 -1
  332. package/types/table/index.d.ts +1 -1
  333. package/types/time-line/timeline-item.d.cts +1 -1
  334. package/types/time-line/timeline-item.d.ts +1 -1
  335. package/types/time-line/timeline.d.cts +1 -1
  336. package/types/time-line/timeline.d.ts +1 -1
  337. package/types/tooltip/index.d.cts +1 -0
  338. package/types/tooltip/index.d.ts +1 -0
  339. package/types/transfer/index.d.cts +1 -1
  340. package/types/transfer/index.d.ts +1 -1
  341. package/types/tree-select/index.d.cts +1 -1
  342. package/types/tree-select/index.d.ts +1 -1
  343. package/types/upload/file-list.d.cts +1 -1
  344. package/types/upload/file-list.d.ts +1 -1
  345. package/types/upload/selector.d.cts +1 -1
  346. package/types/upload/selector.d.ts +1 -1
  347. package/types/utils/placement.d.cts +2 -1
  348. package/types/utils/placement.d.ts +2 -1
  349. package/types/utils/popup-arrow.d.cts +5 -0
  350. package/types/utils/popup-arrow.d.ts +5 -0
  351. package/types/utils/selection-tags.d.cts +1 -1
  352. package/types/utils/selection-tags.d.ts +1 -1
  353. package/types/watermark/index.d.cts +1 -1
  354. package/types/watermark/index.d.ts +1 -1
@@ -29,6 +29,10 @@
29
29
  "CollapsePanel",
30
30
  "ColorPicker",
31
31
  "ColorPickerPanel",
32
+ "GradientPicker",
33
+ "createCornerGradient",
34
+ "createLinearGradient",
35
+ "formatGradient",
32
36
  "DatePicker",
33
37
  "DatePickerPanel",
34
38
  "Descriptions",
@@ -137,7 +141,7 @@
137
141
  "default"
138
142
  ],
139
143
  "library": "react-kui",
140
- "version": "3.2.0",
144
+ "version": "3.3.0",
141
145
  "framework": "react",
142
146
  "components": [
143
147
  {
@@ -671,6 +675,19 @@
671
675
  "descriptionZh": "显示箭头",
672
676
  "descriptionEn": "Show arrow"
673
677
  },
678
+ {
679
+ "name": "arrowPointAtCenter",
680
+ "type": "boolean | undefined",
681
+ "required": false,
682
+ "enumValues": [
683
+ false,
684
+ true
685
+ ],
686
+ "boolean": true,
687
+ "defaultExpression": "false",
688
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
689
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
690
+ },
674
691
  {
675
692
  "name": "offset",
676
693
  "type": "number | undefined",
@@ -1364,7 +1381,7 @@
1364
1381
  {
1365
1382
  "id": "components/popup/demo/placement.tsx",
1366
1383
  "title": "方位与箭头",
1367
- "source": "import { useState } from \"react\";\nimport { Button, Checkbox, Popup, Space } from \"react-kui\";\nexport default function App() {\n const [arrow, setArrow] = useState(true);\n const placements = [\n \"top-left\",\n \"top\",\n \"top-right\",\n \"bottom-left\",\n \"bottom\",\n \"bottom-right\",\n \"left-top\",\n \"left\",\n \"left-bottom\",\n \"right-top\",\n \"right\",\n \"right-bottom\",\n ] as const;\n return (\n <Space vertical>\n <Checkbox checked={arrow} onChange={(event) => setArrow(event.checked)}>\n Show arrow\n </Checkbox>\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, minmax(0, 1fr))\",\n gap: 8,\n maxWidth: 420,\n }}\n >\n {placements.map((placement) => (\n <Popup\n key={placement}\n placement={placement}\n arrow={arrow}\n offset={10}\n overlay={<span>{placement}</span>}\n >\n <Button>{placement}</Button>\n </Popup>\n ))}\n </div>\n </Space>\n );\n}"
1384
+ "source": "import { useState } from \"react\";\nimport { Button, Checkbox, Popup, Space } from \"react-kui\";\nexport default function App() {\n const [arrow, setArrow] = useState(true);\n const [arrowPointAtCenter, setArrowPointAtCenter] = useState(false);\n const placements = [\n \"top-left\",\n \"top\",\n \"top-right\",\n \"bottom-left\",\n \"bottom\",\n \"bottom-right\",\n \"left-top\",\n \"left\",\n \"left-bottom\",\n \"right-top\",\n \"right\",\n \"right-bottom\",\n ] as const;\n return (\n <Space vertical>\n <Checkbox checked={arrow} onChange={(event) => setArrow(event.checked)}>\n Show arrow\n </Checkbox>\n <Checkbox\n checked={arrowPointAtCenter}\n onChange={(event) => setArrowPointAtCenter(event.checked)}\n >\n Point arrow at trigger center\n </Checkbox>\n <div\n aria-label=\"Popup placements\"\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, minmax(0, 1fr))\",\n gap: 8,\n maxWidth: 420,\n }}\n >\n {placements.map((placement) => (\n <Popup\n key={placement}\n placement={placement}\n arrow={arrow}\n arrowPointAtCenter={arrowPointAtCenter}\n offset={10}\n overlay={<span>{placement}</span>}\n >\n <Button>{placement}</Button>\n </Popup>\n ))}\n </div>\n </Space>\n );\n}"
1368
1385
  },
1369
1386
  {
1370
1387
  "id": "components/popup/demo/controlled.tsx",
@@ -14006,6 +14023,19 @@
14006
14023
  "descriptionZh": "弹层位置",
14007
14024
  "descriptionEn": "Popup placement"
14008
14025
  },
14026
+ {
14027
+ "name": "arrowPointAtCenter",
14028
+ "type": "boolean | undefined",
14029
+ "required": false,
14030
+ "enumValues": [
14031
+ false,
14032
+ true
14033
+ ],
14034
+ "boolean": true,
14035
+ "defaultExpression": "false",
14036
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
14037
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
14038
+ },
14009
14039
  {
14010
14040
  "name": "destroyOnClose",
14011
14041
  "type": "boolean | undefined",
@@ -14511,14 +14541,629 @@
14511
14541
  "descriptionZh": "颜色值改变时触发",
14512
14542
  "descriptionEn": "Called when the color value changes"
14513
14543
  },
14514
- {
14515
- "name": "onUpdateMode",
14516
- "type": "((mode: ColorMode) => void) | undefined",
14517
- "required": false,
14518
- "boolean": false,
14519
- "descriptionZh": "颜色模式更新时触发",
14520
- "descriptionEn": "Called when the color mode changes"
14521
- },
14544
+ {
14545
+ "name": "onUpdateMode",
14546
+ "type": "((mode: ColorMode) => void) | undefined",
14547
+ "required": false,
14548
+ "boolean": false,
14549
+ "descriptionZh": "颜色模式更新时触发",
14550
+ "descriptionEn": "Called when the color mode changes"
14551
+ },
14552
+ {
14553
+ "name": "onOpenChange",
14554
+ "type": "((open: boolean) => void) | undefined",
14555
+ "required": false,
14556
+ "boolean": false,
14557
+ "descriptionZh": "颜色选择器展开或收起时触发",
14558
+ "descriptionEn": "Called when the popup opens or closes"
14559
+ }
14560
+ ],
14561
+ "renderProps": [
14562
+ "children"
14563
+ ],
14564
+ "behavior": {
14565
+ "rules": []
14566
+ },
14567
+ "children": [],
14568
+ "examples": [
14569
+ {
14570
+ "id": "components/color-picker/demo/basic.tsx",
14571
+ "title": "基本用法",
14572
+ "source": "import { useState } from \"react\";\nimport { Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\"),\n [hex, setHex] = useState(\"#3a95ff\"),\n [rgb, setRgb] = useState(\"rgba(0, 188, 212, 0.72)\"),\n [hsl, setHsl] = useState(\"hsl(207, 90%, 54%)\");\n return (\n <Space vertical>\n <code>value: {color}</code>\n <ColorPicker value={color} onChange={setColor} />\n <code>mode = hex, value: {hex}</code>\n <ColorPicker value={hex} onChange={setHex} />\n <code>mode = rgb, value: {rgb}</code>\n <ColorPicker mode=\"rgb\" value={rgb} onChange={setRgb} />\n <code>mode = hsl, value: {hsl}</code>\n <ColorPicker mode=\"hsl\" value={hsl} onChange={setHsl} />\n <code>showText = true</code>\n <ColorPicker showText value={color} onChange={setColor} />\n </Space>\n );\n}"
14573
+ },
14574
+ {
14575
+ "id": "components/color-picker/demo/size.tsx",
14576
+ "title": "尺寸大小 / 不可用",
14577
+ "source": "import { useState } from \"react\";\nimport { Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\");\n return (\n <Space vertical>\n <Space>\n <Space vertical>\n <ColorPicker value={color} size=\"small\" />\n <ColorPicker value={color} />\n <ColorPicker value={color} size=\"large\" />\n </Space>\n <Space vertical>\n <ColorPicker showText value={color} size=\"small\" />\n <ColorPicker showText value={color} />\n <ColorPicker showText value={color} size=\"large\" />\n </Space>\n </Space>\n <br />\n <Space vertical>\n <code>disabled</code>\n <Space>\n <ColorPicker value={color} disabled />\n <ColorPicker showText value={color} disabled />\n </Space>\n <br />\n <code>disabledAlpha</code>\n <ColorPicker showText disabledAlpha value={color} />\n <code>presets colors</code>\n <ColorPicker value={color} onChange={setColor} presets={[\"#9c27b0\", \"red\", \"blue\"]} />\n </Space>\n </Space>\n );\n}"
14578
+ },
14579
+ {
14580
+ "id": "components/color-picker/demo/appearance.tsx",
14581
+ "title": "主题与形状",
14582
+ "source": "import { useState } from \"react\";\nimport { ColorPicker, Space } from \"react-kui\";\n\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\");\n\n return (\n <Space vertical>\n <Space>\n <ColorPicker value={color} onChange={setColor} theme=\"outline\" showText />\n <ColorPicker value={color} onChange={setColor} theme=\"fill\" showText />\n <ColorPicker value={color} onChange={setColor} theme=\"plain\" showText />\n </Space>\n <Space>\n <ColorPicker value={color} onChange={setColor} shape=\"round\" showText />\n <ColorPicker value={color} onChange={setColor} shape=\"circle\" showText />\n <ColorPicker value={color} onChange={setColor} shape=\"square\" showText />\n </Space>\n </Space>\n );\n}"
14583
+ },
14584
+ {
14585
+ "id": "components/color-picker/demo/custom-trigger.tsx",
14586
+ "title": "自定义触发器",
14587
+ "source": "import { useState } from \"react\";\nimport { Button, Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color1, setColor1] = useState(\"#3a95ff\"),\n [color2, setColor2] = useState(\"red\");\n return (\n <Space className=\"demo-color-picker\" vertical>\n <Space>\n <ColorPicker value={color1} onChange={setColor1}>\n <Button type=\"primary\">Open</Button>\n </ColorPicker>\n {color1}\n </Space>\n <Space>\n <ColorPicker value={color2} onChange={setColor2} trigger=\"hover\">\n <Button type=\"primary\">Hover</Button>\n </ColorPicker>\n {color2}\n </Space>\n </Space>\n );\n}"
14588
+ },
14589
+ {
14590
+ "id": "components/color-picker/demo/placement.tsx",
14591
+ "title": "弹出位置",
14592
+ "source": "import { Button, Space, ColorPicker } from \"react-kui\";\nconst placements = [\n \"bottom-left\",\n \"bottom\",\n \"bottom-right\",\n \"top-left\",\n \"top\",\n \"top-right\",\n] as const;\nexport default function App() {\n return (\n <Space wrap>\n {placements.map((placement) => (\n <ColorPicker key={placement} value=\"red\" size=\"small\" placement={placement}>\n <Button>{placement}</Button>\n </ColorPicker>\n ))}\n </Space>\n );\n}"
14593
+ }
14594
+ ]
14595
+ },
14596
+ {
14597
+ "name": "ColorPickerPanel",
14598
+ "import": "import { ColorPickerPanel } from \"react-kui\"",
14599
+ "documentation": "https://react.k-ui.cn/components/color-picker",
14600
+ "props": [
14601
+ {
14602
+ "name": "onChange",
14603
+ "type": "((color: string) => void) | undefined",
14604
+ "required": false,
14605
+ "boolean": false,
14606
+ "descriptionZh": "颜色值改变时触发",
14607
+ "descriptionEn": "Called when the color value changes"
14608
+ },
14609
+ {
14610
+ "name": "disabled",
14611
+ "type": "boolean | undefined",
14612
+ "required": false,
14613
+ "enumValues": [
14614
+ false,
14615
+ true
14616
+ ],
14617
+ "boolean": true,
14618
+ "descriptionZh": "是否禁用",
14619
+ "descriptionEn": "Whether the picker is disabled"
14620
+ },
14621
+ {
14622
+ "name": "placement",
14623
+ "type": "DropPlacementsType | undefined",
14624
+ "required": false,
14625
+ "enumValues": [
14626
+ "top",
14627
+ "top-left",
14628
+ "top-right",
14629
+ "bottom",
14630
+ "bottom-left",
14631
+ "bottom-right"
14632
+ ],
14633
+ "boolean": false,
14634
+ "descriptionZh": "弹层位置",
14635
+ "descriptionEn": "Popup placement"
14636
+ },
14637
+ {
14638
+ "name": "trigger",
14639
+ "type": "\"hover\" | \"click\" | undefined",
14640
+ "required": false,
14641
+ "enumValues": [
14642
+ "hover",
14643
+ "click"
14644
+ ],
14645
+ "boolean": false,
14646
+ "descriptionZh": "弹层触发方式",
14647
+ "descriptionEn": "Popup trigger mode"
14648
+ },
14649
+ {
14650
+ "name": "arrowPointAtCenter",
14651
+ "type": "boolean | undefined",
14652
+ "required": false,
14653
+ "enumValues": [
14654
+ false,
14655
+ true
14656
+ ],
14657
+ "boolean": true,
14658
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
14659
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
14660
+ },
14661
+ {
14662
+ "name": "destroyOnClose",
14663
+ "type": "boolean | undefined",
14664
+ "required": false,
14665
+ "enumValues": [
14666
+ false,
14667
+ true
14668
+ ],
14669
+ "boolean": true,
14670
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
14671
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
14672
+ },
14673
+ {
14674
+ "name": "onOpenChange",
14675
+ "type": "((open: boolean) => void) | undefined",
14676
+ "required": false,
14677
+ "boolean": false,
14678
+ "descriptionZh": "颜色选择器展开或收起时触发",
14679
+ "descriptionEn": "Called when the popup opens or closes"
14680
+ },
14681
+ {
14682
+ "name": "size",
14683
+ "type": "SizeType | undefined",
14684
+ "required": false,
14685
+ "enumValues": [
14686
+ "small",
14687
+ "medium",
14688
+ "large"
14689
+ ],
14690
+ "boolean": false,
14691
+ "descriptionZh": "颜色选择器尺寸",
14692
+ "descriptionEn": "Picker size"
14693
+ },
14694
+ {
14695
+ "name": "value",
14696
+ "type": "string | undefined",
14697
+ "required": false,
14698
+ "boolean": false,
14699
+ "descriptionZh": "颜色值",
14700
+ "descriptionEn": "color value"
14701
+ },
14702
+ {
14703
+ "name": "readOnly",
14704
+ "type": "boolean | undefined",
14705
+ "required": false,
14706
+ "enumValues": [
14707
+ false,
14708
+ true
14709
+ ],
14710
+ "boolean": true,
14711
+ "descriptionZh": "是否只读",
14712
+ "descriptionEn": "Whether the picker is read-only"
14713
+ },
14714
+ {
14715
+ "name": "theme",
14716
+ "type": "ThemeType | undefined",
14717
+ "required": false,
14718
+ "enumValues": [
14719
+ "dashed",
14720
+ "solid",
14721
+ "fill",
14722
+ "outline",
14723
+ "plain",
14724
+ "underlined"
14725
+ ],
14726
+ "boolean": false,
14727
+ "descriptionZh": "主题,未设置时可继承 Form 或 ConfigProvider",
14728
+ "descriptionEn": "Theme; inherits from Form or ConfigProvider when unset"
14729
+ },
14730
+ {
14731
+ "name": "shape",
14732
+ "type": "ShapeType | undefined",
14733
+ "required": false,
14734
+ "enumValues": [
14735
+ "round",
14736
+ "default",
14737
+ "square",
14738
+ "circle"
14739
+ ],
14740
+ "boolean": false,
14741
+ "descriptionZh": "形状,支持 `round`、`circle`、`square`,未设置时可继承 Form 或 ConfigProvider",
14742
+ "descriptionEn": "Shape: `round`, `circle`, or `square`; inherits from Form or ConfigProvider"
14743
+ },
14744
+ {
14745
+ "name": "disabledAlpha",
14746
+ "type": "boolean | undefined",
14747
+ "required": false,
14748
+ "enumValues": [
14749
+ false,
14750
+ true
14751
+ ],
14752
+ "boolean": true,
14753
+ "descriptionZh": "是否禁用透明度",
14754
+ "descriptionEn": "Whether alpha editing is disabled"
14755
+ },
14756
+ {
14757
+ "name": "showText",
14758
+ "type": "boolean | undefined",
14759
+ "required": false,
14760
+ "enumValues": [
14761
+ false,
14762
+ true
14763
+ ],
14764
+ "boolean": true,
14765
+ "descriptionZh": "是否展示颜色文字",
14766
+ "descriptionEn": "Whether to display the color text"
14767
+ },
14768
+ {
14769
+ "name": "mode",
14770
+ "type": "ColorMode | undefined",
14771
+ "required": false,
14772
+ "enumValues": [
14773
+ "hex",
14774
+ "rgb",
14775
+ "hsl"
14776
+ ],
14777
+ "boolean": false,
14778
+ "descriptionZh": "颜色展示类型,支持 `hex`、`rgb`、`hsl`",
14779
+ "descriptionEn": "Color output mode: `hex`, `rgb`, or `hsl`"
14780
+ },
14781
+ {
14782
+ "name": "presets",
14783
+ "type": "string[] | undefined",
14784
+ "required": false,
14785
+ "boolean": false,
14786
+ "descriptionZh": "自定义颜色盘",
14787
+ "descriptionEn": "Custom color palette"
14788
+ },
14789
+ {
14790
+ "name": "onUpdateMode",
14791
+ "type": "((mode: ColorMode) => void) | undefined",
14792
+ "required": false,
14793
+ "boolean": false,
14794
+ "descriptionZh": "颜色模式更新时触发",
14795
+ "descriptionEn": "Called when the color mode changes"
14796
+ }
14797
+ ],
14798
+ "nativeProps": [
14799
+ "suppressContentEditableWarning",
14800
+ "suppressHydrationWarning",
14801
+ "accessKey",
14802
+ "autoCapitalize",
14803
+ "autoFocus",
14804
+ "className",
14805
+ "contentEditable",
14806
+ "contextMenu",
14807
+ "dir",
14808
+ "draggable",
14809
+ "enterKeyHint",
14810
+ "hidden",
14811
+ "id",
14812
+ "lang",
14813
+ "nonce",
14814
+ "slot",
14815
+ "spellCheck",
14816
+ "style",
14817
+ "tabIndex",
14818
+ "title",
14819
+ "translate",
14820
+ "radioGroup",
14821
+ "role",
14822
+ "about",
14823
+ "content",
14824
+ "datatype",
14825
+ "inlist",
14826
+ "prefix",
14827
+ "property",
14828
+ "rel",
14829
+ "resource",
14830
+ "rev",
14831
+ "typeof",
14832
+ "vocab",
14833
+ "autoCorrect",
14834
+ "autoSave",
14835
+ "color",
14836
+ "itemProp",
14837
+ "itemScope",
14838
+ "itemType",
14839
+ "itemID",
14840
+ "itemRef",
14841
+ "results",
14842
+ "security",
14843
+ "unselectable",
14844
+ "popover",
14845
+ "popoverTargetAction",
14846
+ "popoverTarget",
14847
+ "inert",
14848
+ "inputMode",
14849
+ "is",
14850
+ "exportparts",
14851
+ "part",
14852
+ "aria-activedescendant",
14853
+ "aria-atomic",
14854
+ "aria-autocomplete",
14855
+ "aria-braillelabel",
14856
+ "aria-brailleroledescription",
14857
+ "aria-busy",
14858
+ "aria-checked",
14859
+ "aria-colcount",
14860
+ "aria-colindex",
14861
+ "aria-colindextext",
14862
+ "aria-colspan",
14863
+ "aria-controls",
14864
+ "aria-current",
14865
+ "aria-describedby",
14866
+ "aria-description",
14867
+ "aria-details",
14868
+ "aria-disabled",
14869
+ "aria-dropeffect",
14870
+ "aria-errormessage",
14871
+ "aria-expanded",
14872
+ "aria-flowto",
14873
+ "aria-grabbed",
14874
+ "aria-haspopup",
14875
+ "aria-hidden",
14876
+ "aria-invalid",
14877
+ "aria-keyshortcuts",
14878
+ "aria-label",
14879
+ "aria-labelledby",
14880
+ "aria-level",
14881
+ "aria-live",
14882
+ "aria-modal",
14883
+ "aria-multiline",
14884
+ "aria-multiselectable",
14885
+ "aria-orientation",
14886
+ "aria-owns",
14887
+ "aria-placeholder",
14888
+ "aria-posinset",
14889
+ "aria-pressed",
14890
+ "aria-readonly",
14891
+ "aria-relevant",
14892
+ "aria-required",
14893
+ "aria-roledescription",
14894
+ "aria-rowcount",
14895
+ "aria-rowindex",
14896
+ "aria-rowindextext",
14897
+ "aria-rowspan",
14898
+ "aria-selected",
14899
+ "aria-setsize",
14900
+ "aria-sort",
14901
+ "aria-valuemax",
14902
+ "aria-valuemin",
14903
+ "aria-valuenow",
14904
+ "aria-valuetext",
14905
+ "dangerouslySetInnerHTML",
14906
+ "onCopy",
14907
+ "onCopyCapture",
14908
+ "onCut",
14909
+ "onCutCapture",
14910
+ "onPaste",
14911
+ "onPasteCapture",
14912
+ "onCompositionEnd",
14913
+ "onCompositionEndCapture",
14914
+ "onCompositionStart",
14915
+ "onCompositionStartCapture",
14916
+ "onCompositionUpdate",
14917
+ "onCompositionUpdateCapture",
14918
+ "onFocus",
14919
+ "onFocusCapture",
14920
+ "onBlur",
14921
+ "onBlurCapture",
14922
+ "onChangeCapture",
14923
+ "onBeforeInput",
14924
+ "onBeforeInputCapture",
14925
+ "onInput",
14926
+ "onInputCapture",
14927
+ "onReset",
14928
+ "onResetCapture",
14929
+ "onSubmit",
14930
+ "onSubmitCapture",
14931
+ "onInvalid",
14932
+ "onInvalidCapture",
14933
+ "onLoad",
14934
+ "onLoadCapture",
14935
+ "onError",
14936
+ "onErrorCapture",
14937
+ "onKeyDown",
14938
+ "onKeyDownCapture",
14939
+ "onKeyPress",
14940
+ "onKeyPressCapture",
14941
+ "onKeyUp",
14942
+ "onKeyUpCapture",
14943
+ "onAbort",
14944
+ "onAbortCapture",
14945
+ "onCanPlay",
14946
+ "onCanPlayCapture",
14947
+ "onCanPlayThrough",
14948
+ "onCanPlayThroughCapture",
14949
+ "onDurationChange",
14950
+ "onDurationChangeCapture",
14951
+ "onEmptied",
14952
+ "onEmptiedCapture",
14953
+ "onEncrypted",
14954
+ "onEncryptedCapture",
14955
+ "onEnded",
14956
+ "onEndedCapture",
14957
+ "onLoadedData",
14958
+ "onLoadedDataCapture",
14959
+ "onLoadedMetadata",
14960
+ "onLoadedMetadataCapture",
14961
+ "onLoadStart",
14962
+ "onLoadStartCapture",
14963
+ "onPause",
14964
+ "onPauseCapture",
14965
+ "onPlay",
14966
+ "onPlayCapture",
14967
+ "onPlaying",
14968
+ "onPlayingCapture",
14969
+ "onProgress",
14970
+ "onProgressCapture",
14971
+ "onRateChange",
14972
+ "onRateChangeCapture",
14973
+ "onSeeked",
14974
+ "onSeekedCapture",
14975
+ "onSeeking",
14976
+ "onSeekingCapture",
14977
+ "onStalled",
14978
+ "onStalledCapture",
14979
+ "onSuspend",
14980
+ "onSuspendCapture",
14981
+ "onTimeUpdate",
14982
+ "onTimeUpdateCapture",
14983
+ "onVolumeChange",
14984
+ "onVolumeChangeCapture",
14985
+ "onWaiting",
14986
+ "onWaitingCapture",
14987
+ "onAuxClick",
14988
+ "onAuxClickCapture",
14989
+ "onClick",
14990
+ "onClickCapture",
14991
+ "onContextMenu",
14992
+ "onContextMenuCapture",
14993
+ "onDoubleClick",
14994
+ "onDoubleClickCapture",
14995
+ "onDrag",
14996
+ "onDragCapture",
14997
+ "onDragEnd",
14998
+ "onDragEndCapture",
14999
+ "onDragEnter",
15000
+ "onDragEnterCapture",
15001
+ "onDragExit",
15002
+ "onDragExitCapture",
15003
+ "onDragLeave",
15004
+ "onDragLeaveCapture",
15005
+ "onDragOver",
15006
+ "onDragOverCapture",
15007
+ "onDragStart",
15008
+ "onDragStartCapture",
15009
+ "onDrop",
15010
+ "onDropCapture",
15011
+ "onMouseDown",
15012
+ "onMouseDownCapture",
15013
+ "onMouseEnter",
15014
+ "onMouseLeave",
15015
+ "onMouseMove",
15016
+ "onMouseMoveCapture",
15017
+ "onMouseOut",
15018
+ "onMouseOutCapture",
15019
+ "onMouseOver",
15020
+ "onMouseOverCapture",
15021
+ "onMouseUp",
15022
+ "onMouseUpCapture",
15023
+ "onSelect",
15024
+ "onSelectCapture",
15025
+ "onTouchCancel",
15026
+ "onTouchCancelCapture",
15027
+ "onTouchEnd",
15028
+ "onTouchEndCapture",
15029
+ "onTouchMove",
15030
+ "onTouchMoveCapture",
15031
+ "onTouchStart",
15032
+ "onTouchStartCapture",
15033
+ "onPointerDown",
15034
+ "onPointerDownCapture",
15035
+ "onPointerMove",
15036
+ "onPointerMoveCapture",
15037
+ "onPointerUp",
15038
+ "onPointerUpCapture",
15039
+ "onPointerCancel",
15040
+ "onPointerCancelCapture",
15041
+ "onPointerEnter",
15042
+ "onPointerLeave",
15043
+ "onPointerOver",
15044
+ "onPointerOverCapture",
15045
+ "onPointerOut",
15046
+ "onPointerOutCapture",
15047
+ "onGotPointerCapture",
15048
+ "onGotPointerCaptureCapture",
15049
+ "onLostPointerCapture",
15050
+ "onLostPointerCaptureCapture",
15051
+ "onScroll",
15052
+ "onScrollCapture",
15053
+ "onScrollEnd",
15054
+ "onScrollEndCapture",
15055
+ "onWheel",
15056
+ "onWheelCapture",
15057
+ "onAnimationStart",
15058
+ "onAnimationStartCapture",
15059
+ "onAnimationEnd",
15060
+ "onAnimationEndCapture",
15061
+ "onAnimationIteration",
15062
+ "onAnimationIterationCapture",
15063
+ "onToggle",
15064
+ "onBeforeToggle",
15065
+ "onTransitionCancel",
15066
+ "onTransitionCancelCapture",
15067
+ "onTransitionEnd",
15068
+ "onTransitionEndCapture",
15069
+ "onTransitionRun",
15070
+ "onTransitionRunCapture",
15071
+ "onTransitionStart",
15072
+ "onTransitionStartCapture"
15073
+ ],
15074
+ "nativeValueTypes": {
15075
+ "suppressContentEditableWarning": "boolean",
15076
+ "suppressHydrationWarning": "boolean",
15077
+ "accessKey": "string",
15078
+ "autoFocus": "boolean",
15079
+ "className": "string",
15080
+ "contextMenu": "string",
15081
+ "dir": "string",
15082
+ "enterKeyHint": "string",
15083
+ "hidden": "boolean",
15084
+ "id": "string",
15085
+ "lang": "string",
15086
+ "nonce": "string",
15087
+ "slot": "string",
15088
+ "tabIndex": "number",
15089
+ "title": "string",
15090
+ "translate": "string",
15091
+ "radioGroup": "string",
15092
+ "about": "string",
15093
+ "content": "string",
15094
+ "datatype": "string",
15095
+ "prefix": "string",
15096
+ "property": "string",
15097
+ "rel": "string",
15098
+ "resource": "string",
15099
+ "rev": "string",
15100
+ "typeof": "string",
15101
+ "vocab": "string",
15102
+ "autoCorrect": "string",
15103
+ "autoSave": "string",
15104
+ "color": "string",
15105
+ "itemProp": "string",
15106
+ "itemScope": "boolean",
15107
+ "itemType": "string",
15108
+ "itemID": "string",
15109
+ "itemRef": "string",
15110
+ "results": "number",
15111
+ "security": "string",
15112
+ "unselectable": "string",
15113
+ "popover": "string",
15114
+ "popoverTargetAction": "string",
15115
+ "popoverTarget": "string",
15116
+ "inert": "boolean",
15117
+ "inputMode": "string",
15118
+ "is": "string",
15119
+ "exportparts": "string",
15120
+ "part": "string",
15121
+ "aria-activedescendant": "string",
15122
+ "aria-autocomplete": "string",
15123
+ "aria-braillelabel": "string",
15124
+ "aria-brailleroledescription": "string",
15125
+ "aria-colcount": "number",
15126
+ "aria-colindex": "number",
15127
+ "aria-colindextext": "string",
15128
+ "aria-colspan": "number",
15129
+ "aria-controls": "string",
15130
+ "aria-describedby": "string",
15131
+ "aria-description": "string",
15132
+ "aria-details": "string",
15133
+ "aria-dropeffect": "string",
15134
+ "aria-errormessage": "string",
15135
+ "aria-flowto": "string",
15136
+ "aria-keyshortcuts": "string",
15137
+ "aria-label": "string",
15138
+ "aria-labelledby": "string",
15139
+ "aria-level": "number",
15140
+ "aria-live": "string",
15141
+ "aria-orientation": "string",
15142
+ "aria-owns": "string",
15143
+ "aria-placeholder": "string",
15144
+ "aria-posinset": "number",
15145
+ "aria-relevant": "string",
15146
+ "aria-roledescription": "string",
15147
+ "aria-rowcount": "number",
15148
+ "aria-rowindex": "number",
15149
+ "aria-rowindextext": "string",
15150
+ "aria-rowspan": "number",
15151
+ "aria-setsize": "number",
15152
+ "aria-sort": "string",
15153
+ "aria-valuemax": "number",
15154
+ "aria-valuemin": "number",
15155
+ "aria-valuenow": "number",
15156
+ "aria-valuetext": "string"
15157
+ },
15158
+ "events": [
15159
+ {
15160
+ "name": "onChange",
15161
+ "type": "((color: string) => void) | undefined",
15162
+ "required": false,
15163
+ "boolean": false,
15164
+ "descriptionZh": "颜色值改变时触发",
15165
+ "descriptionEn": "Called when the color value changes"
15166
+ },
14522
15167
  {
14523
15168
  "name": "onOpenChange",
14524
15169
  "type": "((open: boolean) => void) | undefined",
@@ -14526,11 +15171,17 @@
14526
15171
  "boolean": false,
14527
15172
  "descriptionZh": "颜色选择器展开或收起时触发",
14528
15173
  "descriptionEn": "Called when the popup opens or closes"
15174
+ },
15175
+ {
15176
+ "name": "onUpdateMode",
15177
+ "type": "((mode: ColorMode) => void) | undefined",
15178
+ "required": false,
15179
+ "boolean": false,
15180
+ "descriptionZh": "颜色模式更新时触发",
15181
+ "descriptionEn": "Called when the color mode changes"
14529
15182
  }
14530
15183
  ],
14531
- "renderProps": [
14532
- "children"
14533
- ],
15184
+ "renderProps": [],
14534
15185
  "behavior": {
14535
15186
  "rules": []
14536
15187
  },
@@ -14564,60 +15215,33 @@
14564
15215
  ]
14565
15216
  },
14566
15217
  {
14567
- "name": "ColorPickerPanel",
14568
- "import": "import { ColorPickerPanel } from \"react-kui\"",
14569
- "documentation": "https://react.k-ui.cn/components/color-picker",
15218
+ "name": "GradientPicker",
15219
+ "import": "import { GradientPicker } from \"react-kui\"",
15220
+ "documentation": "https://react.k-ui.cn/components/gradient-picker",
14570
15221
  "props": [
14571
15222
  {
14572
- "name": "onChange",
14573
- "type": "((color: string) => void) | undefined",
14574
- "required": false,
14575
- "boolean": false,
14576
- "descriptionZh": "颜色值改变时触发",
14577
- "descriptionEn": "Called when the color value changes"
14578
- },
14579
- {
14580
- "name": "disabled",
14581
- "type": "boolean | undefined",
14582
- "required": false,
14583
- "enumValues": [
14584
- false,
14585
- true
14586
- ],
14587
- "boolean": true,
14588
- "descriptionZh": "是否禁用",
14589
- "descriptionEn": "Whether the picker is disabled"
14590
- },
14591
- {
14592
- "name": "placement",
14593
- "type": "DropPlacementsType | undefined",
15223
+ "name": "value",
15224
+ "type": "GradientValue | undefined",
14594
15225
  "required": false,
14595
- "enumValues": [
14596
- "top",
14597
- "top-left",
14598
- "top-right",
14599
- "bottom",
14600
- "bottom-left",
14601
- "bottom-right"
14602
- ],
14603
15226
  "boolean": false,
14604
- "descriptionZh": "弹层位置",
14605
- "descriptionEn": "Popup placement"
15227
+ "descriptionZh": "渐变值,受控;色条、四角与颜色面板都跟随它",
15228
+ "descriptionEn": "Gradient value, controlled; the bar, corners and color panel all follow it"
14606
15229
  },
14607
15230
  {
14608
- "name": "trigger",
14609
- "type": "\"hover\" | \"click\" | undefined",
15231
+ "name": "type",
15232
+ "type": "GradientType | undefined",
14610
15233
  "required": false,
14611
15234
  "enumValues": [
14612
- "hover",
14613
- "click"
15235
+ "linear",
15236
+ "corner"
14614
15237
  ],
14615
15238
  "boolean": false,
14616
- "descriptionZh": "弹层触发方式",
14617
- "descriptionEn": "Popup trigger mode"
15239
+ "defaultExpression": "\"linear\"",
15240
+ "descriptionZh": "渐变类型,`linear` 为多色标渐变,`corner` 为四角渐变",
15241
+ "descriptionEn": "Gradient type: `linear` for multi-stop, `corner` for four corners"
14618
15242
  },
14619
15243
  {
14620
- "name": "destroyOnClose",
15244
+ "name": "alpha",
14621
15245
  "type": "boolean | undefined",
14622
15246
  "required": false,
14623
15247
  "enumValues": [
@@ -14625,40 +15249,12 @@
14625
15249
  true
14626
15250
  ],
14627
15251
  "boolean": true,
14628
- "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
14629
- "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
14630
- },
14631
- {
14632
- "name": "onOpenChange",
14633
- "type": "((open: boolean) => void) | undefined",
14634
- "required": false,
14635
- "boolean": false,
14636
- "descriptionZh": "颜色选择器展开或收起时触发",
14637
- "descriptionEn": "Called when the popup opens or closes"
14638
- },
14639
- {
14640
- "name": "size",
14641
- "type": "SizeType | undefined",
14642
- "required": false,
14643
- "enumValues": [
14644
- "small",
14645
- "medium",
14646
- "large"
14647
- ],
14648
- "boolean": false,
14649
- "descriptionZh": "颜色选择器尺寸",
14650
- "descriptionEn": "Picker size"
14651
- },
14652
- {
14653
- "name": "value",
14654
- "type": "string | undefined",
14655
- "required": false,
14656
- "boolean": false,
14657
- "descriptionZh": "颜色值",
14658
- "descriptionEn": "color value"
15252
+ "defaultExpression": "false",
15253
+ "descriptionZh": "颜色面板是否提供透明度调节",
15254
+ "descriptionEn": "Show the transparency control in the color panel"
14659
15255
  },
14660
15256
  {
14661
- "name": "readOnly",
15257
+ "name": "arrowPointAtCenter",
14662
15258
  "type": "boolean | undefined",
14663
15259
  "required": false,
14664
15260
  "enumValues": [
@@ -14666,41 +15262,38 @@
14666
15262
  true
14667
15263
  ],
14668
15264
  "boolean": true,
14669
- "descriptionZh": "是否只读",
14670
- "descriptionEn": "Whether the picker is read-only"
15265
+ "defaultExpression": "true",
15266
+ "descriptionZh": "让颜色面板箭头指向色标或角标中心;关闭后按面板边缘对齐",
15267
+ "descriptionEn": "Point the color-panel arrow at the stop or corner center; disable to align panel edges"
14671
15268
  },
14672
15269
  {
14673
- "name": "theme",
14674
- "type": "ThemeType | undefined",
15270
+ "name": "mode",
15271
+ "type": "ColorMode | undefined",
14675
15272
  "required": false,
14676
15273
  "enumValues": [
14677
- "dashed",
14678
- "solid",
14679
- "fill",
14680
- "outline",
14681
- "plain",
14682
- "underlined"
15274
+ "hex",
15275
+ "rgb",
15276
+ "hsl"
14683
15277
  ],
14684
15278
  "boolean": false,
14685
- "descriptionZh": "主题,未设置时可继承 Form 或 ConfigProvider",
14686
- "descriptionEn": "Theme; inherits from Form or ConfigProvider when unset"
15279
+ "descriptionZh": "颜色面板输入区的展示类型,提供 3 种模式(`hex`、`rgb`、`hsl`)",
15280
+ "descriptionEn": "Presentation of the color panel input: `hex`, `rgb` or `hsl`"
14687
15281
  },
14688
15282
  {
14689
- "name": "shape",
14690
- "type": "ShapeType | undefined",
15283
+ "name": "size",
15284
+ "type": "SizeType | undefined",
14691
15285
  "required": false,
14692
15286
  "enumValues": [
14693
- "round",
14694
- "default",
14695
- "square",
14696
- "circle"
15287
+ "small",
15288
+ "medium",
15289
+ "large"
14697
15290
  ],
14698
15291
  "boolean": false,
14699
- "descriptionZh": "形状,支持 `round`、`circle`、`square`,未设置时可继承 Form 或 ConfigProvider",
14700
- "descriptionEn": "Shape: `round`, `circle`, or `square`; inherits from Form or ConfigProvider"
15292
+ "descriptionZh": "控件尺寸,与其它控件一样分三档;色条加色标或四角预览块的总高度与对应尺寸的控件一致",
15293
+ "descriptionEn": "Control size, same three tiers as other controls; the bar plus its stops, or the corner block, add up to the height of the matching control"
14701
15294
  },
14702
15295
  {
14703
- "name": "disabledAlpha",
15296
+ "name": "disabled",
14704
15297
  "type": "boolean | undefined",
14705
15298
  "required": false,
14706
15299
  "enumValues": [
@@ -14708,11 +15301,12 @@
14708
15301
  true
14709
15302
  ],
14710
15303
  "boolean": true,
14711
- "descriptionZh": "是否禁用透明度",
14712
- "descriptionEn": "Whether alpha editing is disabled"
15304
+ "defaultExpression": "false",
15305
+ "descriptionZh": "是否失效状态",
15306
+ "descriptionEn": "Disabled state"
14713
15307
  },
14714
15308
  {
14715
- "name": "showText",
15309
+ "name": "readOnly",
14716
15310
  "type": "boolean | undefined",
14717
15311
  "required": false,
14718
15312
  "enumValues": [
@@ -14720,36 +15314,24 @@
14720
15314
  true
14721
15315
  ],
14722
15316
  "boolean": true,
14723
- "descriptionZh": "是否展示颜色文字",
14724
- "descriptionEn": "Whether to display the color text"
14725
- },
14726
- {
14727
- "name": "mode",
14728
- "type": "ColorMode | undefined",
14729
- "required": false,
14730
- "enumValues": [
14731
- "hex",
14732
- "rgb",
14733
- "hsl"
14734
- ],
14735
- "boolean": false,
14736
- "descriptionZh": "颜色展示类型,支持 `hex`、`rgb`、`hsl`",
14737
- "descriptionEn": "Color output mode: `hex`, `rgb`, or `hsl`"
15317
+ "defaultExpression": "false",
15318
+ "descriptionZh": "是否只读,不能拖动色标或打开颜色面板",
15319
+ "descriptionEn": "Read-only; stops cannot be dragged and the color panel cannot open"
14738
15320
  },
14739
15321
  {
14740
- "name": "presets",
14741
- "type": "string[] | undefined",
15322
+ "name": "onChange",
15323
+ "type": "((value: GradientValue) => void) | undefined",
14742
15324
  "required": false,
14743
15325
  "boolean": false,
14744
- "descriptionZh": "自定义颜色盘",
14745
- "descriptionEn": "Custom color palette"
15326
+ "descriptionZh": "渐变值改变时触发,参数是新的渐变值(线性档为色标数组,四角档为四色数组)",
15327
+ "descriptionEn": "Called when the gradient changes; the argument is the new value (a stop list for `linear`, four colors for `corner`)"
14746
15328
  },
14747
15329
  {
14748
15330
  "name": "onUpdateMode",
14749
15331
  "type": "((mode: ColorMode) => void) | undefined",
14750
15332
  "required": false,
14751
15333
  "boolean": false,
14752
- "descriptionZh": "颜色模式更新时触发",
15334
+ "descriptionZh": "颜色模式改变时触发",
14753
15335
  "descriptionEn": "Called when the color mode changes"
14754
15336
  }
14755
15337
  ],
@@ -14860,6 +15442,7 @@
14860
15442
  "aria-valuemin",
14861
15443
  "aria-valuenow",
14862
15444
  "aria-valuetext",
15445
+ "children",
14863
15446
  "dangerouslySetInnerHTML",
14864
15447
  "onCopy",
14865
15448
  "onCopyCapture",
@@ -15116,26 +15699,18 @@
15116
15699
  "events": [
15117
15700
  {
15118
15701
  "name": "onChange",
15119
- "type": "((color: string) => void) | undefined",
15120
- "required": false,
15121
- "boolean": false,
15122
- "descriptionZh": "颜色值改变时触发",
15123
- "descriptionEn": "Called when the color value changes"
15124
- },
15125
- {
15126
- "name": "onOpenChange",
15127
- "type": "((open: boolean) => void) | undefined",
15702
+ "type": "((value: GradientValue) => void) | undefined",
15128
15703
  "required": false,
15129
15704
  "boolean": false,
15130
- "descriptionZh": "颜色选择器展开或收起时触发",
15131
- "descriptionEn": "Called when the popup opens or closes"
15705
+ "descriptionZh": "渐变值改变时触发,参数是新的渐变值(线性档为色标数组,四角档为四色数组)",
15706
+ "descriptionEn": "Called when the gradient changes; the argument is the new value (a stop list for `linear`, four colors for `corner`)"
15132
15707
  },
15133
15708
  {
15134
15709
  "name": "onUpdateMode",
15135
15710
  "type": "((mode: ColorMode) => void) | undefined",
15136
15711
  "required": false,
15137
15712
  "boolean": false,
15138
- "descriptionZh": "颜色模式更新时触发",
15713
+ "descriptionZh": "颜色模式改变时触发",
15139
15714
  "descriptionEn": "Called when the color mode changes"
15140
15715
  }
15141
15716
  ],
@@ -15146,29 +15721,19 @@
15146
15721
  "children": [],
15147
15722
  "examples": [
15148
15723
  {
15149
- "id": "components/color-picker/demo/basic.tsx",
15724
+ "id": "components/gradient-picker/demo/basic.tsx",
15150
15725
  "title": "基本用法",
15151
- "source": "import { useState } from \"react\";\nimport { Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\"),\n [hex, setHex] = useState(\"#3a95ff\"),\n [rgb, setRgb] = useState(\"rgba(0, 188, 212, 0.72)\"),\n [hsl, setHsl] = useState(\"hsl(207, 90%, 54%)\");\n return (\n <Space vertical>\n <code>value: {color}</code>\n <ColorPicker value={color} onChange={setColor} />\n <code>mode = hex, value: {hex}</code>\n <ColorPicker value={hex} onChange={setHex} />\n <code>mode = rgb, value: {rgb}</code>\n <ColorPicker mode=\"rgb\" value={rgb} onChange={setRgb} />\n <code>mode = hsl, value: {hsl}</code>\n <ColorPicker mode=\"hsl\" value={hsl} onChange={setHsl} />\n <code>showText = true</code>\n <ColorPicker showText value={color} onChange={setColor} />\n </Space>\n );\n}"
15726
+ "source": "import { useState } from \"react\";\nimport {\n formatGradient,\n GradientPicker,\n Space,\n type GradientStop,\n type GradientValue,\n} from \"react-kui\";\n\nconst initial: GradientValue = [\n { color: \"#ffd166\", offset: 0 },\n { color: \"#ef476f\", offset: 55 },\n { color: \"#118ab2\", offset: 100 },\n];\n\nconst stopsText = (stops: GradientStop[]) =>\n stops.map((stop) => `${stop.color} ${stop.offset}%`).join(\", \");\n\nexport default function App() {\n const [value, setValue] = useState<GradientValue>(initial);\n const [linear, setLinear] = useState(() => formatGradient(initial));\n const [radial, setRadial] = useState(\n () => `radial-gradient(circle, ${stopsText(initial as GradientStop[])})`,\n );\n return (\n <Space vertical>\n <div style={{ width: 360 }}>\n <GradientPicker\n value={value}\n alpha\n onChange={(next) => {\n setValue(next);\n setLinear(formatGradient(next));\n setRadial(`radial-gradient(circle, ${stopsText(next as GradientStop[])})`);\n }}\n />\n </div>\n <code>linear: {linear}</code>\n <code>radial: {radial}</code>\n <div style={{ width: 360 }}>\n <GradientPicker value={value} disabled onChange={() => undefined} />\n </div>\n </Space>\n );\n}"
15152
15727
  },
15153
15728
  {
15154
- "id": "components/color-picker/demo/size.tsx",
15155
- "title": "尺寸大小 / 不可用",
15156
- "source": "import { useState } from \"react\";\nimport { Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\");\n return (\n <Space vertical>\n <Space>\n <Space vertical>\n <ColorPicker value={color} size=\"small\" />\n <ColorPicker value={color} />\n <ColorPicker value={color} size=\"large\" />\n </Space>\n <Space vertical>\n <ColorPicker showText value={color} size=\"small\" />\n <ColorPicker showText value={color} />\n <ColorPicker showText value={color} size=\"large\" />\n </Space>\n </Space>\n <br />\n <Space vertical>\n <code>disabled</code>\n <Space>\n <ColorPicker value={color} disabled />\n <ColorPicker showText value={color} disabled />\n </Space>\n <br />\n <code>disabledAlpha</code>\n <ColorPicker showText disabledAlpha value={color} />\n <code>presets colors</code>\n <ColorPicker value={color} onChange={setColor} presets={[\"#9c27b0\", \"red\", \"blue\"]} />\n </Space>\n </Space>\n );\n}"
15157
- },
15158
- {
15159
- "id": "components/color-picker/demo/appearance.tsx",
15160
- "title": "主题与形状",
15161
- "source": "import { useState } from \"react\";\nimport { ColorPicker, Space } from \"react-kui\";\n\nexport default function App() {\n const [color, setColor] = useState(\"#3a95ff\");\n\n return (\n <Space vertical>\n <Space>\n <ColorPicker value={color} onChange={setColor} theme=\"outline\" showText />\n <ColorPicker value={color} onChange={setColor} theme=\"fill\" showText />\n <ColorPicker value={color} onChange={setColor} theme=\"plain\" showText />\n </Space>\n <Space>\n <ColorPicker value={color} onChange={setColor} shape=\"round\" showText />\n <ColorPicker value={color} onChange={setColor} shape=\"circle\" showText />\n <ColorPicker value={color} onChange={setColor} shape=\"square\" showText />\n </Space>\n </Space>\n );\n}"
15729
+ "id": "components/gradient-picker/demo/corner.tsx",
15730
+ "title": "四角渐变",
15731
+ "source": "import { useState } from \"react\";\nimport { GradientPicker, Space, type CornerGradientValue, type GradientValue } from \"react-kui\";\n\nconst initial: GradientValue = [\"#ffffff\", \"#a9f0d1\", \"#5fe08a\", \"#3cbf6b\"];\n\nexport default function App() {\n const [value, setValue] = useState<GradientValue>(initial);\n return (\n <Space vertical>\n <div style={{ width: 360 }}>\n <GradientPicker type=\"corner\" value={value} onChange={(next) => setValue(next)} />\n </div>\n <code>colors: {(value as CornerGradientValue).join(\", \")}</code>\n <div style={{ width: 360 }}>\n <GradientPicker type=\"corner\" value={value} disabled onChange={() => undefined} />\n </div>\n </Space>\n );\n}"
15162
15732
  },
15163
15733
  {
15164
- "id": "components/color-picker/demo/custom-trigger.tsx",
15165
- "title": "自定义触发器",
15166
- "source": "import { useState } from \"react\";\nimport { Button, Space, ColorPicker } from \"react-kui\";\nexport default function App() {\n const [color1, setColor1] = useState(\"#3a95ff\"),\n [color2, setColor2] = useState(\"red\");\n return (\n <Space className=\"demo-color-picker\" vertical>\n <Space>\n <ColorPicker value={color1} onChange={setColor1}>\n <Button type=\"primary\">Open</Button>\n </ColorPicker>\n {color1}\n </Space>\n <Space>\n <ColorPicker value={color2} onChange={setColor2} trigger=\"hover\">\n <Button type=\"primary\">Hover</Button>\n </ColorPicker>\n {color2}\n </Space>\n </Space>\n );\n}"
15167
- },
15168
- {
15169
- "id": "components/color-picker/demo/placement.tsx",
15170
- "title": "弹出位置",
15171
- "source": "import { Button, Space, ColorPicker } from \"react-kui\";\nconst placements = [\n \"bottom-left\",\n \"bottom\",\n \"bottom-right\",\n \"top-left\",\n \"top\",\n \"top-right\",\n] as const;\nexport default function App() {\n return (\n <Space wrap>\n {placements.map((placement) => (\n <ColorPicker key={placement} value=\"red\" size=\"small\" placement={placement}>\n <Button>{placement}</Button>\n </ColorPicker>\n ))}\n </Space>\n );\n}"
15734
+ "id": "components/gradient-picker/demo/sizes.tsx",
15735
+ "title": "三种尺寸",
15736
+ "source": "import { useState } from \"react\";\nimport { GradientPicker, Space, type GradientValue } from \"react-kui\";\n\nconst create = (): GradientValue => [\n { color: \"#ffd166\", offset: 0 },\n { color: \"#ef476f\", offset: 55 },\n { color: \"#118ab2\", offset: 100 },\n];\n\nconst createCorner = (): GradientValue => [\"#ffd166\", \"#ef476f\", \"#118ab2\", \"#06d6a0\"];\n\nexport default function App() {\n const [small, setSmall] = useState<GradientValue>(create);\n const [medium, setMedium] = useState<GradientValue>(create);\n const [large, setLarge] = useState<GradientValue>(create);\n const [cornerSmall, setCornerSmall] = useState<GradientValue>(createCorner);\n const [cornerMedium, setCornerMedium] = useState<GradientValue>(createCorner);\n const [cornerLarge, setCornerLarge] = useState<GradientValue>(createCorner);\n return (\n <Space vertical>\n <div style={{ width: 360 }}>\n <GradientPicker value={small} size=\"small\" onChange={(next) => setSmall(next)} />\n </div>\n <div style={{ width: 360 }}>\n <GradientPicker value={medium} size=\"medium\" onChange={(next) => setMedium(next)} />\n </div>\n <div style={{ width: 360 }}>\n <GradientPicker value={large} size=\"large\" onChange={(next) => setLarge(next)} />\n </div>\n <div style={{ width: 360 }}>\n <GradientPicker\n value={cornerSmall}\n type=\"corner\"\n size=\"small\"\n onChange={(next) => setCornerSmall(next)}\n />\n </div>\n <div style={{ width: 360 }}>\n <GradientPicker\n value={cornerMedium}\n type=\"corner\"\n size=\"medium\"\n onChange={(next) => setCornerMedium(next)}\n />\n </div>\n <div style={{ width: 360 }}>\n <GradientPicker\n value={cornerLarge}\n type=\"corner\"\n size=\"large\"\n onChange={(next) => setCornerLarge(next)}\n />\n </div>\n </Space>\n );\n}"
15172
15737
  }
15173
15738
  ]
15174
15739
  },
@@ -26789,6 +27354,19 @@
26789
27354
  "descriptionZh": "是否显示增减按钮",
26790
27355
  "descriptionEn": "Whether to show increase/decrease buttons"
26791
27356
  },
27357
+ {
27358
+ "name": "draggable",
27359
+ "type": "boolean | undefined",
27360
+ "required": false,
27361
+ "enumValues": [
27362
+ false,
27363
+ true
27364
+ ],
27365
+ "boolean": true,
27366
+ "defaultExpression": "true",
27367
+ "descriptionZh": "是否允许在输入框内拖动快速调节数值",
27368
+ "descriptionEn": "Allow dragging inside the input to adjust the value quickly"
27369
+ },
26792
27370
  {
26793
27371
  "name": "keyboard",
26794
27372
  "type": "boolean | undefined",
@@ -26912,7 +27490,6 @@
26912
27490
  "contentEditable",
26913
27491
  "contextMenu",
26914
27492
  "dir",
26915
- "draggable",
26916
27493
  "enterKeyHint",
26917
27494
  "hidden",
26918
27495
  "id",
@@ -27299,6 +27876,11 @@
27299
27876
  "title": "扩展, 前缀、后缀与附件",
27300
27877
  "source": "import { CircleQuestionMark, LogoYen, UserPlus } from \"kui-icons\";\nimport { Button, Divider, InputNumber, Space, Tooltip } from \"react-kui\";\nexport default function App() {\n return (\n <>\n <Space block vertical>\n <InputNumber placeholder=\"Please input amount\" suffix=\"元\" prefix=\"¥\" />\n <InputNumber placeholder=\"Please input amount\" step={50} suffix=\"元\" prefix=\"充值\" />\n <InputNumber placeholder=\"Please input amount\" suffix=\".00\" />\n </Space>\n <Divider text=\"Addons\" />\n <Space vertical block>\n <InputNumber placeholder=\"Please input amount\" addonBefore=\"¥\" addonAfter=\"RMB\" />\n <InputNumber placeholder=\"Please input weight\" addonAfter=\"kg\" />\n </Space>\n <Divider text=\"React nodes\" />\n <Space vertical block>\n <InputNumber\n placeholder=\"请填写您的薪资\"\n icon={LogoYen}\n addonAfter={\n <Tooltip title=\"此处如果不知道怎么填,请咨询管理员\">\n <Button icon={CircleQuestionMark} />\n </Tooltip>\n }\n />\n <InputNumber\n placeholder=\"Please input amount\"\n addonBefore={<Button icon={UserPlus} />}\n addonAfter={<Button>Top up</Button>}\n />\n </Space>\n </>\n );\n}"
27301
27878
  },
27879
+ {
27880
+ "id": "components/input-number/demo/drag.tsx",
27881
+ "title": "拖动调节",
27882
+ "source": "import { useState } from \"react\";\nimport { InputNumber, Space } from \"react-kui\";\n\nexport default function App() {\n const [amount, setAmount] = useState<number | undefined>(100);\n const [decimal, setDecimal] = useState<number | undefined>(1.25);\n return (\n <Space vertical block style={{ maxWidth: 280 }}>\n <span>Drag inside the input left or right; click to type, double-click to select.</span>\n <InputNumber value={amount} onChange={setAmount} min={0} max={10000} addonAfter=\"USD\" />\n <InputNumber value={decimal} onChange={setDecimal} step={0.01} precision={2} min={0} max={100} />\n <InputNumber value={10} draggable={false} placeholder=\"Drag disabled\" />\n </Space>\n );\n}"
27883
+ },
27302
27884
  {
27303
27885
  "id": "components/input-number/demo/size.tsx",
27304
27886
  "title": "尺寸",
@@ -33765,6 +34347,19 @@
33765
34347
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
33766
34348
  "descriptionEn": "Position where the tooltip appears"
33767
34349
  },
34350
+ {
34351
+ "name": "arrowPointAtCenter",
34352
+ "type": "boolean | undefined",
34353
+ "required": false,
34354
+ "enumValues": [
34355
+ false,
34356
+ true
34357
+ ],
34358
+ "boolean": true,
34359
+ "defaultExpression": "false",
34360
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
34361
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
34362
+ },
33768
34363
  {
33769
34364
  "name": "destroyOnClose",
33770
34365
  "type": "boolean | undefined",
@@ -33940,6 +34535,18 @@
33940
34535
  "descriptionZh": "触发方式,可选值为 `hover`(悬停)`click`(点击)",
33941
34536
  "descriptionEn": "Trigger method, optional values: `hover` (hover) `click` (click)"
33942
34537
  },
34538
+ {
34539
+ "name": "arrowPointAtCenter",
34540
+ "type": "boolean | undefined",
34541
+ "required": false,
34542
+ "enumValues": [
34543
+ false,
34544
+ true
34545
+ ],
34546
+ "boolean": true,
34547
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
34548
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
34549
+ },
33943
34550
  {
33944
34551
  "name": "destroyOnClose",
33945
34552
  "type": "boolean | undefined",
@@ -34165,6 +34772,19 @@
34165
34772
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
34166
34773
  "descriptionEn": "Position where the tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
34167
34774
  },
34775
+ {
34776
+ "name": "arrowPointAtCenter",
34777
+ "type": "boolean | undefined",
34778
+ "required": false,
34779
+ "enumValues": [
34780
+ false,
34781
+ true
34782
+ ],
34783
+ "boolean": true,
34784
+ "defaultExpression": "false",
34785
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
34786
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
34787
+ },
34168
34788
  {
34169
34789
  "name": "destroyOnClose",
34170
34790
  "type": "boolean | undefined",
@@ -34329,6 +34949,18 @@
34329
34949
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
34330
34950
  "descriptionEn": "Position where the tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
34331
34951
  },
34952
+ {
34953
+ "name": "arrowPointAtCenter",
34954
+ "type": "boolean | undefined",
34955
+ "required": false,
34956
+ "enumValues": [
34957
+ false,
34958
+ true
34959
+ ],
34960
+ "boolean": true,
34961
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
34962
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
34963
+ },
34332
34964
  {
34333
34965
  "name": "destroyOnClose",
34334
34966
  "type": "boolean | undefined",
@@ -37380,12 +38012,12 @@
37380
38012
  },
37381
38013
  {
37382
38014
  "name": "options",
37383
- "type": "SegmentedOption[] | undefined",
38015
+ "type": "SegmentedOptionInput[] | undefined",
37384
38016
  "required": false,
37385
38017
  "boolean": false,
37386
38018
  "defaultExpression": "[]",
37387
- "descriptionZh": "选项数据",
37388
- "descriptionEn": "Option data"
38019
+ "descriptionZh": "选项数据;直接传字符串或数字时,该值同时作为显示内容",
38020
+ "descriptionEn": "Option data; a bare string or number is used as both the value and the label"
37389
38021
  },
37390
38022
  {
37391
38023
  "name": "disabled",
@@ -37872,7 +38504,7 @@
37872
38504
  {
37873
38505
  "id": "components/segmented/demo/options.tsx",
37874
38506
  "title": "尺寸与布局",
37875
- "source": "import { useState } from \"react\";\nimport { Segmented, Space } from \"react-kui\";\n\nexport default function SegmentedOptionsDemo() {\n const [value, setValue] = useState(\"react\");\n const options = [\n { label: \"Vue\", value: \"vue\" },\n { label: \"React\", value: \"react\" },\n { label: \"Disabled\", value: \"disabled\", disabled: true },\n ];\n return (\n <Space direction=\"vertical\">\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n size=\"small\"\n />\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n block\n />\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n direction=\"vertical\"\n />\n </Space>\n );\n}"
38507
+ "source": "import { useState } from \"react\";\nimport { Segmented } from \"react-kui\";\n\nexport default function SegmentedOptionsDemo() {\n const [value, setValue] = useState(\"react\");\n const options = [\n { label: \"Vue\", value: \"vue\" },\n { label: \"React\", value: \"react\" },\n { label: \"Disabled\", value: \"disabled\", disabled: true },\n ];\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", alignItems: \"flex-start\", gap: 8 }}>\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n size=\"small\"\n />\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n block\n />\n <Segmented\n value={value}\n onChange={(next) => setValue(String(next))}\n options={options}\n direction=\"vertical\"\n />\n </div>\n );\n}"
37876
38508
  },
37877
38509
  {
37878
38510
  "id": "components/segmented/demo/icon.tsx",
@@ -47603,8 +48235,8 @@
47603
48235
  ],
47604
48236
  "boolean": true,
47605
48237
  "defaultExpression": "false",
47606
- "descriptionZh": "是否启用虚拟滚动",
47607
- "descriptionEn": "Whether to enable virtual scrolling"
48238
+ "descriptionZh": "是否启用虚拟滚动,需设置 `scroll.y`",
48239
+ "descriptionEn": "Whether to enable virtual scrolling; requires `scroll.y`"
47608
48240
  },
47609
48241
  {
47610
48242
  "name": "itemHeight",
@@ -48501,6 +49133,19 @@
48501
49133
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
48502
49134
  "descriptionEn": "Position where tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
48503
49135
  },
49136
+ {
49137
+ "name": "arrowPointAtCenter",
49138
+ "type": "boolean | undefined",
49139
+ "required": false,
49140
+ "enumValues": [
49141
+ false,
49142
+ true
49143
+ ],
49144
+ "boolean": true,
49145
+ "defaultExpression": "false",
49146
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
49147
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
49148
+ },
48504
49149
  {
48505
49150
  "name": "destroyOnClose",
48506
49151
  "type": "boolean | undefined",
@@ -48665,6 +49310,18 @@
48665
49310
  "descriptionZh": "自动悬停触发或手动控制显隐",
48666
49311
  "descriptionEn": "Automatic hover or manual visibility"
48667
49312
  },
49313
+ {
49314
+ "name": "arrowPointAtCenter",
49315
+ "type": "boolean | undefined",
49316
+ "required": false,
49317
+ "enumValues": [
49318
+ false,
49319
+ true
49320
+ ],
49321
+ "boolean": true,
49322
+ "descriptionZh": "让箭头中心指向触发器中心;默认按面板边缘或中心对齐,需有箭头时才生效",
49323
+ "descriptionEn": "Point the arrow at the trigger center instead of aligning panel edges; requires a visible arrow"
49324
+ },
48668
49325
  {
48669
49326
  "name": "destroyOnClose",
48670
49327
  "type": "boolean | undefined",