index.d.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. import type { CSSProperties } from 'react';
  2. import type { FullToken, GetDefaultToken } from '../../theme/internal';
  3. /** Component only token. Which will handle additional calculation of alias token */
  4. export interface ComponentToken {
  5. /**
  6. * @desc 弹出菜单的宽度
  7. * @descEN Width of popup menu
  8. */
  9. dropdownWidth: number | string;
  10. /**
  11. * @desc 弹出菜单的 z-index
  12. * @descEN z-index of popup menu
  13. */
  14. zIndexPopup: number;
  15. /** @deprecated Use `groupTitleColor` instead */
  16. colorGroupTitle: string;
  17. /**
  18. * @desc 分组标题文字颜色
  19. * @descEN Color of group title text
  20. */
  21. groupTitleColor: string;
  22. /**
  23. * @desc 分组标题文字高度
  24. * @descEN line-height of group title
  25. */
  26. groupTitleLineHeight: string | number;
  27. /**
  28. * @desc 分组标题文字大小
  29. * @descEN font-size of group title
  30. */
  31. groupTitleFontSize: number;
  32. /** @deprecated Use `itemBorderRadius` instead */
  33. radiusItem: number;
  34. /**
  35. * @desc 菜单项的圆角
  36. * @descEN Radius of menu item
  37. */
  38. itemBorderRadius: number;
  39. /** @deprecated Use `subMenuItemBorderRadius` instead */
  40. radiusSubMenuItem: number;
  41. /**
  42. * @desc 子菜单项的圆角
  43. * @descEN Radius of sub-menu item
  44. */
  45. subMenuItemBorderRadius: number;
  46. /** @deprecated Use `itemColor` instead */
  47. colorItemText: string;
  48. /**
  49. * @desc 菜单项文字颜色
  50. * @descEN Color of menu item text
  51. */
  52. itemColor: string;
  53. /** @deprecated Use `itemHoverColor` instead */
  54. colorItemTextHover: string;
  55. /**
  56. * @desc 菜单项文字悬浮颜色
  57. * @descEN Hover color of menu item text
  58. */
  59. itemHoverColor: string;
  60. /** @deprecated Use `horizontalItemHoverColor` instead */
  61. colorItemTextHoverHorizontal: string;
  62. /**
  63. * @desc 水平菜单项文字悬浮颜色
  64. * @descEN Hover color of horizontal menu item text
  65. */
  66. horizontalItemHoverColor: string;
  67. /** @deprecated Use `itemSelectedColor` instead */
  68. colorItemTextSelected: string;
  69. /**
  70. * @desc 菜单项文字选中颜色
  71. * @descEN Color of selected menu item text
  72. */
  73. itemSelectedColor: string;
  74. /**
  75. * @desc 子菜单内有选中项时,子菜单标题色
  76. * @descEN Color of submenu title when submenu has selected item
  77. */
  78. subMenuItemSelectedColor: string;
  79. /** @deprecated Use `horizontalItemSelectedColor` instead */
  80. colorItemTextSelectedHorizontal: string;
  81. /**
  82. * @desc 水平菜单项文字选中颜色
  83. * @descEN Color of selected horizontal menu item text
  84. */
  85. horizontalItemSelectedColor: string;
  86. /** @deprecated Use `itemDisabledColor` instead */
  87. colorItemTextDisabled: string;
  88. /**
  89. * @desc 菜单项文字禁用颜色
  90. * @descEN Color of disabled menu item text
  91. */
  92. itemDisabledColor: string;
  93. /** @deprecated Use `dangerItemColor` instead */
  94. colorDangerItemText: string;
  95. /**
  96. * @desc 危险菜单项文字颜色
  97. * @descEN Color of danger menu item text
  98. */
  99. dangerItemColor: string;
  100. /** @deprecated Use `dangerItemHoverColor` instead */
  101. colorDangerItemTextHover: string;
  102. /**
  103. * @desc 危险菜单项文字悬浮颜色
  104. * @descEN Hover color of danger menu item text
  105. */
  106. dangerItemHoverColor: string;
  107. /** @deprecated Use `dangerItemSelectedColor` instead */
  108. colorDangerItemTextSelected: string;
  109. /**
  110. * @desc 危险菜单项文字选中颜色
  111. * @descEN Color of selected danger menu item text
  112. */
  113. dangerItemSelectedColor: string;
  114. /** @deprecated Use `dangerItemActiveBg` instead */
  115. colorDangerItemBgActive: string;
  116. /**
  117. * @desc 危险菜单项激活态背景色
  118. * @descEN Background color of danger menu item when active
  119. */
  120. dangerItemActiveBg: string;
  121. /** @deprecated Use `dangerItemSelectedBg` instead */
  122. colorDangerItemBgSelected: string;
  123. /**
  124. * @desc 危险菜单项选中背景色
  125. * @descEN Background color of selected danger menu item
  126. */
  127. dangerItemSelectedBg: string;
  128. /** @deprecated Use `itemBg` instead */
  129. colorItemBg: string;
  130. /**
  131. * @desc 菜单项背景色
  132. */
  133. itemBg: string;
  134. /** @deprecated Use `itemHoverBg` instead */
  135. colorItemBgHover: string;
  136. /**
  137. * @desc 菜单项悬浮态背景色
  138. * @descEN Background color of menu item when hover
  139. */
  140. itemHoverBg: string;
  141. /** @deprecated Use `subMenuItemBg` instead */
  142. colorSubItemBg: string;
  143. /**
  144. * @desc 子菜单项背景色
  145. * @descEN Background color of sub-menu item
  146. */
  147. subMenuItemBg: string;
  148. /** @deprecated Use `itemActiveBg` instead */
  149. colorItemBgActive: string;
  150. /**
  151. * @desc 菜单项激活态背景色
  152. * @descEN Background color of menu item when active
  153. */
  154. itemActiveBg: string;
  155. /** @deprecated Use `itemSelectedBg` instead */
  156. colorItemBgSelected: string;
  157. /**
  158. * @desc 菜单项选中态背景色
  159. * @descEN Background color of menu item when selected
  160. */
  161. itemSelectedBg: string;
  162. /** @deprecated Use `horizontalItemSelectedBg` instead */
  163. colorItemBgSelectedHorizontal: string;
  164. /**
  165. * @desc 水平菜单项选中态背景色
  166. * @descEN Background color of horizontal menu item when selected
  167. */
  168. horizontalItemSelectedBg: string;
  169. /** @deprecated Use `activeBarWidth` instead */
  170. colorActiveBarWidth: number | string;
  171. /**
  172. * @desc 菜单项指示条宽度
  173. * @descEN Width of menu item active bar
  174. */
  175. activeBarWidth: number | string;
  176. /** @deprecated Use `activeBarHeight` instead */
  177. colorActiveBarHeight: number;
  178. /**
  179. * @desc 菜单项指示条高度
  180. * @descEN Height of menu item active bar
  181. */
  182. activeBarHeight: number;
  183. /** @deprecated Use `activeBarBorderWidth` instead */
  184. colorActiveBarBorderSize: number;
  185. /**
  186. * @desc 菜单项指示条边框宽度
  187. * @descEN Border width of menu item active bar
  188. */
  189. activeBarBorderWidth: number | string;
  190. /**
  191. * @desc 菜单项横向外间距
  192. * @descEN Horizontal margin of menu item
  193. */
  194. itemMarginInline: number;
  195. /**
  196. * @desc 横向菜单项横悬浮态背景色
  197. * @descEN Background color of horizontal menu item when hover
  198. */
  199. horizontalItemHoverBg: string;
  200. /**
  201. * @desc 横向菜单项圆角
  202. * @descEN Border radius of horizontal menu item
  203. */
  204. horizontalItemBorderRadius: number;
  205. /**
  206. * @desc 菜单项高度
  207. * @descEN Height of menu item
  208. */
  209. itemHeight: number | string;
  210. /**
  211. * @desc 收起后的宽度
  212. * @descEN Width when collapsed
  213. */
  214. collapsedWidth: number | string;
  215. /**
  216. * @desc 弹出框背景色
  217. * @descEN Background color of popup
  218. */
  219. popupBg: string;
  220. /**
  221. * @desc 菜单项纵向外间距
  222. * @descEN margin-block of menu item
  223. */
  224. itemMarginBlock: CSSProperties['marginBlock'];
  225. /**
  226. * @desc 菜单项横向内间距
  227. * @descEN padding-inline of menu item
  228. */
  229. itemPaddingInline: CSSProperties['paddingInline'];
  230. /**
  231. * @desc 横向菜单行高
  232. * @descEN LineHeight of horizontal menu item
  233. */
  234. horizontalLineHeight: CSSProperties['lineHeight'];
  235. /**
  236. * @desc 图标与文字间距
  237. * @descEN Spacing between icon and text
  238. */
  239. iconMarginInlineEnd: CSSProperties['marginInlineEnd'];
  240. /**
  241. * @desc 图标尺寸
  242. * @descEN Size of icon
  243. */
  244. iconSize: number;
  245. /**
  246. * @desc 收起时图标尺寸
  247. * @descEN Size of icon when collapsed
  248. */
  249. collapsedIconSize: number;
  250. /**
  251. * @desc 暗色模式下的浮层菜单的背景颜色
  252. * @descEN The background color of the overlay menu in dark mode.
  253. */
  254. darkPopupBg: string;
  255. /**
  256. * @desc 暗色模式下的菜单项文字颜色
  257. * @descEN Color of menu item text in dark mode
  258. */
  259. darkItemColor: string;
  260. /**
  261. * @desc 暗色模式下的危险菜单项文字颜色
  262. * @descEN Color of danger menu item text in dark mode
  263. */
  264. darkDangerItemColor: string;
  265. /**
  266. * @desc 暗色模式下的菜单项背景
  267. * @descEN Background of menu item in dark mode
  268. */
  269. darkItemBg: string;
  270. /**
  271. * @desc 暗色模式下的子菜单项背景
  272. * @descEN Background of submenu item in dark mode
  273. */
  274. darkSubMenuItemBg: string;
  275. /**
  276. * @desc 暗色模式下的菜单项选中颜色
  277. * @descEN Color of selected menu item in dark mode
  278. */
  279. darkItemSelectedColor: string;
  280. /**
  281. * @desc 暗色模式下的菜单项选中背景
  282. * @descEN Background of active menu item in dark mode
  283. */
  284. darkItemSelectedBg: string;
  285. /**
  286. * @desc 暗色模式下的菜单项悬浮背景
  287. * @descEN Background of hovered menu item in dark mode
  288. */
  289. darkItemHoverBg: string;
  290. /**
  291. * @desc 暗色模式下的分组标题文字颜色
  292. * @descEN Color of group title text in dark mode
  293. */
  294. darkGroupTitleColor: string;
  295. /**
  296. * @desc 暗色模式下的菜单项悬浮颜色
  297. * @descEN Color of hovered menu item in dark mode
  298. */
  299. darkItemHoverColor: string;
  300. /**
  301. * @desc 暗色模式下的菜单项禁用颜色
  302. * @descEN Color of disabled menu item in dark mode
  303. */
  304. darkItemDisabledColor: string;
  305. /**
  306. * @desc 暗色模式下的危险菜单项选中背景
  307. * @descEN Background of active danger menu item in dark mode
  308. */
  309. darkDangerItemSelectedBg: string;
  310. /**
  311. * @desc 暗色模式下的危险菜单项悬浮文字背景
  312. * @descEN Background of hovered danger menu item in dark mode
  313. */
  314. darkDangerItemHoverColor: string;
  315. /**
  316. * @desc 暗色模式下的危险菜单项选中文字颜色
  317. * @descEN Color of selected danger menu item in dark mode
  318. */
  319. darkDangerItemSelectedColor: string;
  320. /**
  321. * @desc 暗色模式下的危险菜单项激活态背景
  322. * @descEN Background of active danger menu item in dark mode
  323. */
  324. darkDangerItemActiveBg: string;
  325. }
  326. /**
  327. * @desc Menu 组件的 Token
  328. * @descEN Token for Menu component
  329. */
  330. export interface MenuToken extends FullToken<'Menu'> {
  331. /**
  332. * @desc 水平菜单高度
  333. * @descEN Height of horizontal menu
  334. */
  335. menuHorizontalHeight: number | string;
  336. /**
  337. * @desc 菜单箭头尺寸
  338. * @descEN Size of menu arrow
  339. */
  340. menuArrowSize: number | string;
  341. /**
  342. * @desc 菜单箭头偏移量
  343. * @descEN Offset of menu arrow
  344. */
  345. menuArrowOffset: number | string;
  346. /**
  347. * @desc 子菜单背景色
  348. * @descEN Background color of sub-menu
  349. */
  350. menuSubMenuBg: string;
  351. /**
  352. * @desc 暗色模式下的浮层菜单背景色
  353. * @descEN Background color of popup menu in dark mode
  354. */
  355. darkPopupBg: string;
  356. }
  357. export declare const prepareComponentToken: GetDefaultToken<'Menu'>;
  358. declare const _default: (prefixCls: string, rootCls?: string, injectStyle?: boolean) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
  359. export default _default;