antd-mobile 5.28.2 → 5.29.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 (266) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +429 -217
  2. package/2x/bundle/antd-mobile.cjs.js +9 -9
  3. package/2x/bundle/antd-mobile.es.development.js +429 -217
  4. package/2x/bundle/antd-mobile.es.js +4918 -4678
  5. package/2x/bundle/antd-mobile.umd.development.js +429 -217
  6. package/2x/bundle/antd-mobile.umd.js +9 -9
  7. package/2x/bundle/style.css +36 -33
  8. package/2x/cjs/components/action-sheet/action-sheet.css +1 -1
  9. package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
  10. package/2x/cjs/components/avatar/avatar.d.ts +1 -1
  11. package/2x/cjs/components/avatar/avatar.js +2 -1
  12. package/2x/cjs/components/badge/badge.css +2 -2
  13. package/2x/cjs/components/button/button.css +2 -2
  14. package/2x/cjs/components/calendar/calendar.js +1 -1
  15. package/2x/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
  16. package/2x/cjs/components/check-list/check-list-item.js +3 -1
  17. package/2x/cjs/components/check-list/check-list.d.ts +1 -0
  18. package/2x/cjs/components/check-list/check-list.js +2 -0
  19. package/2x/cjs/components/check-list/context.d.ts +1 -0
  20. package/2x/cjs/components/checkbox/checkbox.css +2 -2
  21. package/2x/cjs/components/ellipsis/ellipsis.js +1 -1
  22. package/2x/cjs/components/image/image.css +1 -1
  23. package/2x/cjs/components/index-bar/index-bar.css +4 -4
  24. package/2x/cjs/components/input/input.d.ts +1 -1
  25. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
  26. package/2x/cjs/components/notice-bar/notice-bar.css +1 -1
  27. package/2x/cjs/components/number-keyboard/number-keyboard.js +14 -8
  28. package/2x/cjs/components/popover/index.d.ts +1 -1
  29. package/2x/cjs/components/popover/popover.css +1 -1
  30. package/2x/cjs/components/popover/popover.d.ts +2 -2
  31. package/2x/cjs/components/popover/popover.js +1 -1
  32. package/2x/cjs/components/popup/popup.js +13 -11
  33. package/2x/cjs/components/radio/radio.css +2 -2
  34. package/2x/cjs/components/search-bar/search-bar.css +1 -1
  35. package/2x/cjs/components/selector/selector.css +1 -1
  36. package/2x/cjs/components/selector/selector.js +10 -2
  37. package/2x/cjs/components/side-bar/side-bar.css +1 -1
  38. package/2x/cjs/components/slider/slider.css +3 -3
  39. package/2x/cjs/components/stepper/stepper.css +2 -2
  40. package/2x/cjs/components/swipe-action/swipe-action.css +1 -1
  41. package/2x/cjs/components/switch/switch.css +2 -2
  42. package/2x/cjs/components/tabs/tabs.js +5 -2
  43. package/2x/cjs/components/text-area/text-area.d.ts +1 -1
  44. package/2x/cjs/components/text-area/text-area.js +1 -0
  45. package/2x/cjs/components/virtual-input/virtual-input.js +11 -2
  46. package/2x/cjs/global/global.css +5 -2
  47. package/2x/cjs/global/theme-default.css +5 -2
  48. package/2x/cjs/locales/base.d.ts +3 -0
  49. package/2x/cjs/locales/base.js +3 -0
  50. package/2x/cjs/locales/da-DK.d.ts +134 -0
  51. package/2x/cjs/locales/da-DK.js +132 -0
  52. package/2x/cjs/locales/en-US.d.ts +3 -0
  53. package/2x/cjs/locales/es-ES.d.ts +3 -0
  54. package/2x/cjs/locales/fa-IR.d.ts +3 -0
  55. package/2x/cjs/locales/fr-FR.d.ts +3 -0
  56. package/2x/cjs/locales/id-ID.d.ts +3 -0
  57. package/2x/cjs/locales/it-IT.d.ts +134 -0
  58. package/2x/cjs/locales/it-IT.js +144 -0
  59. package/2x/cjs/locales/ja-JP.d.ts +3 -0
  60. package/2x/cjs/locales/kk-KZ.d.ts +3 -0
  61. package/2x/cjs/locales/ko-KR.d.ts +3 -0
  62. package/2x/cjs/locales/nb-NO.d.ts +134 -0
  63. package/2x/cjs/locales/nb-NO.js +144 -0
  64. package/2x/cjs/locales/nl-NL.d.ts +134 -0
  65. package/2x/cjs/locales/nl-NL.js +144 -0
  66. package/2x/cjs/locales/zh-CN.d.ts +3 -0
  67. package/2x/cjs/locales/zh-CN.js +3 -0
  68. package/2x/cjs/locales/zh-HK.d.ts +3 -0
  69. package/2x/cjs/locales/zh-TW.d.ts +3 -0
  70. package/2x/es/components/action-sheet/action-sheet.css +1 -1
  71. package/2x/es/components/action-sheet/action-sheet.js +6 -2
  72. package/2x/es/components/avatar/avatar.d.ts +1 -1
  73. package/2x/es/components/avatar/avatar.js +2 -1
  74. package/2x/es/components/badge/badge.css +2 -2
  75. package/2x/es/components/button/button.css +2 -2
  76. package/2x/es/components/calendar/calendar.js +1 -1
  77. package/2x/es/components/capsule-tabs/capsule-tabs.css +2 -2
  78. package/2x/es/components/check-list/check-list-item.js +3 -1
  79. package/2x/es/components/check-list/check-list.d.ts +1 -0
  80. package/2x/es/components/check-list/check-list.js +2 -0
  81. package/2x/es/components/check-list/context.d.ts +1 -0
  82. package/2x/es/components/checkbox/checkbox.css +2 -2
  83. package/2x/es/components/ellipsis/ellipsis.js +1 -1
  84. package/2x/es/components/image/image.css +1 -1
  85. package/2x/es/components/index-bar/index-bar.css +4 -4
  86. package/2x/es/components/input/input.d.ts +1 -1
  87. package/2x/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
  88. package/2x/es/components/notice-bar/notice-bar.css +1 -1
  89. package/2x/es/components/number-keyboard/number-keyboard.js +14 -8
  90. package/2x/es/components/popover/index.d.ts +1 -1
  91. package/2x/es/components/popover/popover.css +1 -1
  92. package/2x/es/components/popover/popover.d.ts +2 -2
  93. package/2x/es/components/popover/popover.js +1 -1
  94. package/2x/es/components/popup/popup.js +13 -11
  95. package/2x/es/components/radio/radio.css +2 -2
  96. package/2x/es/components/search-bar/search-bar.css +1 -1
  97. package/2x/es/components/selector/selector.css +1 -1
  98. package/2x/es/components/selector/selector.js +10 -2
  99. package/2x/es/components/side-bar/side-bar.css +1 -1
  100. package/2x/es/components/slider/slider.css +3 -3
  101. package/2x/es/components/stepper/stepper.css +2 -2
  102. package/2x/es/components/swipe-action/swipe-action.css +1 -1
  103. package/2x/es/components/switch/switch.css +2 -2
  104. package/2x/es/components/tabs/tabs.js +5 -2
  105. package/2x/es/components/text-area/text-area.d.ts +1 -1
  106. package/2x/es/components/text-area/text-area.js +1 -0
  107. package/2x/es/components/virtual-input/virtual-input.js +11 -2
  108. package/2x/es/global/global.css +5 -2
  109. package/2x/es/global/theme-default.css +5 -2
  110. package/2x/es/locales/base.d.ts +3 -0
  111. package/2x/es/locales/base.js +3 -0
  112. package/2x/es/locales/da-DK.d.ts +134 -0
  113. package/2x/es/locales/da-DK.js +125 -0
  114. package/2x/es/locales/en-US.d.ts +3 -0
  115. package/2x/es/locales/es-ES.d.ts +3 -0
  116. package/2x/es/locales/fa-IR.d.ts +3 -0
  117. package/2x/es/locales/fr-FR.d.ts +3 -0
  118. package/2x/es/locales/id-ID.d.ts +3 -0
  119. package/2x/es/locales/it-IT.d.ts +134 -0
  120. package/2x/es/locales/it-IT.js +137 -0
  121. package/2x/es/locales/ja-JP.d.ts +3 -0
  122. package/2x/es/locales/kk-KZ.d.ts +3 -0
  123. package/2x/es/locales/ko-KR.d.ts +3 -0
  124. package/2x/es/locales/nb-NO.d.ts +134 -0
  125. package/2x/es/locales/nb-NO.js +137 -0
  126. package/2x/es/locales/nl-NL.d.ts +134 -0
  127. package/2x/es/locales/nl-NL.js +137 -0
  128. package/2x/es/locales/zh-CN.d.ts +3 -0
  129. package/2x/es/locales/zh-CN.js +3 -0
  130. package/2x/es/locales/zh-HK.d.ts +3 -0
  131. package/2x/es/locales/zh-TW.d.ts +3 -0
  132. package/2x/package.json +1 -1
  133. package/bundle/antd-mobile.cjs.development.js +429 -217
  134. package/bundle/antd-mobile.cjs.js +9 -9
  135. package/bundle/antd-mobile.compatible.umd.js +1 -1
  136. package/bundle/antd-mobile.es.development.js +429 -217
  137. package/bundle/antd-mobile.es.js +4918 -4678
  138. package/bundle/antd-mobile.umd.development.js +429 -217
  139. package/bundle/antd-mobile.umd.js +9 -9
  140. package/bundle/style.css +1 -1
  141. package/cjs/components/action-sheet/action-sheet.css +1 -1
  142. package/cjs/components/action-sheet/action-sheet.js +6 -2
  143. package/cjs/components/avatar/avatar.d.ts +1 -1
  144. package/cjs/components/avatar/avatar.js +2 -1
  145. package/cjs/components/badge/badge.css +2 -2
  146. package/cjs/components/button/button.css +2 -2
  147. package/cjs/components/calendar/calendar.js +1 -1
  148. package/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
  149. package/cjs/components/check-list/check-list-item.js +3 -1
  150. package/cjs/components/check-list/check-list.d.ts +1 -0
  151. package/cjs/components/check-list/check-list.js +2 -0
  152. package/cjs/components/check-list/context.d.ts +1 -0
  153. package/cjs/components/checkbox/checkbox.css +2 -2
  154. package/cjs/components/ellipsis/ellipsis.js +1 -1
  155. package/cjs/components/image/image.css +1 -1
  156. package/cjs/components/index-bar/index-bar.css +4 -4
  157. package/cjs/components/input/input.d.ts +1 -1
  158. package/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
  159. package/cjs/components/notice-bar/notice-bar.css +1 -1
  160. package/cjs/components/number-keyboard/number-keyboard.js +14 -8
  161. package/cjs/components/popover/index.d.ts +1 -1
  162. package/cjs/components/popover/popover.css +1 -1
  163. package/cjs/components/popover/popover.d.ts +2 -2
  164. package/cjs/components/popover/popover.js +1 -1
  165. package/cjs/components/popup/popup.js +13 -11
  166. package/cjs/components/radio/radio.css +2 -2
  167. package/cjs/components/search-bar/search-bar.css +1 -1
  168. package/cjs/components/selector/selector.css +1 -1
  169. package/cjs/components/selector/selector.js +10 -2
  170. package/cjs/components/side-bar/side-bar.css +1 -1
  171. package/cjs/components/slider/slider.css +3 -3
  172. package/cjs/components/stepper/stepper.css +2 -2
  173. package/cjs/components/swipe-action/swipe-action.css +1 -1
  174. package/cjs/components/switch/switch.css +2 -2
  175. package/cjs/components/tabs/tabs.js +5 -2
  176. package/cjs/components/text-area/text-area.d.ts +1 -1
  177. package/cjs/components/text-area/text-area.js +1 -0
  178. package/cjs/components/virtual-input/virtual-input.js +11 -2
  179. package/cjs/global/global.css +5 -2
  180. package/cjs/global/theme-default.css +5 -2
  181. package/cjs/locales/base.d.ts +3 -0
  182. package/cjs/locales/base.js +3 -0
  183. package/cjs/locales/da-DK.d.ts +134 -0
  184. package/cjs/locales/da-DK.js +132 -0
  185. package/cjs/locales/en-US.d.ts +3 -0
  186. package/cjs/locales/es-ES.d.ts +3 -0
  187. package/cjs/locales/fa-IR.d.ts +3 -0
  188. package/cjs/locales/fr-FR.d.ts +3 -0
  189. package/cjs/locales/id-ID.d.ts +3 -0
  190. package/cjs/locales/it-IT.d.ts +134 -0
  191. package/cjs/locales/it-IT.js +144 -0
  192. package/cjs/locales/ja-JP.d.ts +3 -0
  193. package/cjs/locales/kk-KZ.d.ts +3 -0
  194. package/cjs/locales/ko-KR.d.ts +3 -0
  195. package/cjs/locales/nb-NO.d.ts +134 -0
  196. package/cjs/locales/nb-NO.js +144 -0
  197. package/cjs/locales/nl-NL.d.ts +134 -0
  198. package/cjs/locales/nl-NL.js +144 -0
  199. package/cjs/locales/zh-CN.d.ts +3 -0
  200. package/cjs/locales/zh-CN.js +3 -0
  201. package/cjs/locales/zh-HK.d.ts +3 -0
  202. package/cjs/locales/zh-TW.d.ts +3 -0
  203. package/es/components/action-sheet/action-sheet.css +1 -1
  204. package/es/components/action-sheet/action-sheet.js +6 -2
  205. package/es/components/avatar/avatar.d.ts +1 -1
  206. package/es/components/avatar/avatar.js +2 -1
  207. package/es/components/badge/badge.css +2 -2
  208. package/es/components/button/button.css +2 -2
  209. package/es/components/calendar/calendar.js +1 -1
  210. package/es/components/capsule-tabs/capsule-tabs.css +2 -2
  211. package/es/components/check-list/check-list-item.js +3 -1
  212. package/es/components/check-list/check-list.d.ts +1 -0
  213. package/es/components/check-list/check-list.js +2 -0
  214. package/es/components/check-list/context.d.ts +1 -0
  215. package/es/components/checkbox/checkbox.css +2 -2
  216. package/es/components/ellipsis/ellipsis.js +1 -1
  217. package/es/components/image/image.css +1 -1
  218. package/es/components/index-bar/index-bar.css +4 -4
  219. package/es/components/input/input.d.ts +1 -1
  220. package/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
  221. package/es/components/notice-bar/notice-bar.css +1 -1
  222. package/es/components/number-keyboard/number-keyboard.js +14 -8
  223. package/es/components/popover/index.d.ts +1 -1
  224. package/es/components/popover/popover.css +1 -1
  225. package/es/components/popover/popover.d.ts +2 -2
  226. package/es/components/popover/popover.js +1 -1
  227. package/es/components/popup/popup.js +13 -11
  228. package/es/components/radio/radio.css +2 -2
  229. package/es/components/search-bar/search-bar.css +1 -1
  230. package/es/components/selector/selector.css +1 -1
  231. package/es/components/selector/selector.js +10 -2
  232. package/es/components/side-bar/side-bar.css +1 -1
  233. package/es/components/slider/slider.css +3 -3
  234. package/es/components/stepper/stepper.css +2 -2
  235. package/es/components/swipe-action/swipe-action.css +1 -1
  236. package/es/components/switch/switch.css +2 -2
  237. package/es/components/tabs/tabs.js +5 -2
  238. package/es/components/text-area/text-area.d.ts +1 -1
  239. package/es/components/text-area/text-area.js +1 -0
  240. package/es/components/virtual-input/virtual-input.js +11 -2
  241. package/es/global/global.css +5 -2
  242. package/es/global/theme-default.css +5 -2
  243. package/es/locales/base.d.ts +3 -0
  244. package/es/locales/base.js +3 -0
  245. package/es/locales/da-DK.d.ts +134 -0
  246. package/es/locales/da-DK.js +125 -0
  247. package/es/locales/en-US.d.ts +3 -0
  248. package/es/locales/es-ES.d.ts +3 -0
  249. package/es/locales/fa-IR.d.ts +3 -0
  250. package/es/locales/fr-FR.d.ts +3 -0
  251. package/es/locales/id-ID.d.ts +3 -0
  252. package/es/locales/it-IT.d.ts +134 -0
  253. package/es/locales/it-IT.js +137 -0
  254. package/es/locales/ja-JP.d.ts +3 -0
  255. package/es/locales/kk-KZ.d.ts +3 -0
  256. package/es/locales/ko-KR.d.ts +3 -0
  257. package/es/locales/nb-NO.d.ts +134 -0
  258. package/es/locales/nb-NO.js +137 -0
  259. package/es/locales/nl-NL.d.ts +134 -0
  260. package/es/locales/nl-NL.js +137 -0
  261. package/es/locales/zh-CN.d.ts +3 -0
  262. package/es/locales/zh-CN.js +3 -0
  263. package/es/locales/zh-HK.d.ts +3 -0
  264. package/es/locales/zh-TW.d.ts +3 -0
  265. package/package.json +1 -1
  266. package/umd/antd-mobile.js +1 -1
@@ -26,7 +26,7 @@ export declare type InputRef = {
26
26
  blur: () => void;
27
27
  nativeElement: HTMLInputElement | null;
28
28
  };
29
- export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength" | "step"> & {
29
+ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoFocus" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength" | "step"> & {
30
30
  value?: string | undefined;
31
31
  defaultValue?: string | undefined;
32
32
  onChange?: ((val: string) => void) | undefined;
@@ -49,13 +49,13 @@
49
49
  border-radius: 10px;
50
50
  color: var(--adm-color-weak);
51
51
  font-size: var(--adm-font-size-main);
52
- background-color: var(--adm-color-box);
52
+ background-color: var(--adm-color-fill-content);
53
53
  }
54
54
  .adm-jumbo-tabs-tab-active {
55
55
  color: var(--adm-color-primary);
56
56
  }
57
57
  .adm-jumbo-tabs-tab-active .adm-jumbo-tabs-tab-description {
58
- color: var(--adm-color-white);
58
+ color: var(--adm-color-text-light-solid);
59
59
  background-color: var(--adm-color-primary);
60
60
  }
61
61
  .adm-jumbo-tabs-tab-disabled {
@@ -1,7 +1,7 @@
1
1
  .adm-notice-bar {
2
2
  --background-color: #ababab;
3
3
  --border-color: #999999;
4
- --text-color: var(--adm-color-white);
4
+ --text-color: var(--adm-color-text-light-solid);
5
5
  --font-size: var(--adm-font-size-7);
6
6
  --icon-font-size: var(--adm-font-size-10);
7
7
  --height: 40px;
@@ -88,16 +88,18 @@ export const NumberKeyboard = p => {
88
88
  className: classNames(`${classPrefix}-header`, {
89
89
  [`${classPrefix}-header-with-title`]: !!title
90
90
  })
91
- }, title && React.createElement("div", {
92
- className: `${classPrefix}-title`
91
+ }, 'title' && React.createElement("div", {
92
+ className: `${classPrefix}-title`,
93
+ "aria-label": title
93
94
  }, title), showCloseButton && React.createElement("span", {
94
95
  className: `${classPrefix}-header-close-button`,
95
96
  onClick: () => {
96
97
  var _a;
97
98
  (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
98
99
  },
99
- role: 'button',
100
- title: 'CLOSE'
100
+ role: 'grid',
101
+ title: 'CLOSE',
102
+ tabIndex: -1
101
103
  }, React.createElement(DownOutline, null)));
102
104
  };
103
105
  const renderKey = (key, index) => {
@@ -108,8 +110,9 @@ export const NumberKeyboard = p => {
108
110
  [`${classPrefix}-key-mid`]: index === 9 && !!confirmText && keys.length < 12
109
111
  });
110
112
  const ariaProps = key ? {
111
- role: 'button',
112
- title: key
113
+ role: 'grid',
114
+ title: key,
115
+ tabIndex: -1
113
116
  } : undefined;
114
117
  return React.createElement("div", Object.assign({
115
118
  key: key,
@@ -161,11 +164,14 @@ export const NumberKeyboard = p => {
161
164
  onBackspacePressEnd();
162
165
  },
163
166
  title: 'BACKSPACE',
164
- role: 'button'
167
+ role: 'grid',
168
+ tabIndex: -1
165
169
  }, React.createElement(TextDeletionOutline, null)), React.createElement("div", {
166
170
  className: `${classPrefix}-key ${classPrefix}-key-extra ${classPrefix}-key-ok`,
167
171
  onTouchEnd: e => onKeyPress(e, 'OK'),
168
- role: 'button'
172
+ role: 'grid',
173
+ tabIndex: -1,
174
+ "aria-label": confirmText
169
175
  }, confirmText))), props.safeArea && React.createElement("div", {
170
176
  className: `${classPrefix}-footer`
171
177
  }, React.createElement(SafeArea, {
@@ -18,7 +18,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
18
18
  content: import("react").ReactNode;
19
19
  } & {
20
20
  className?: string | undefined;
21
- style?: (import("react").CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
21
+ style?: (import("react").CSSProperties & Partial<Record<"--z-index" | "--arrow-size", string>>) | undefined;
22
22
  tabIndex?: number | undefined;
23
23
  } & import("react").AriaAttributes & import("react").RefAttributes<import("./popover").PopoverRef>> & {
24
24
  Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
@@ -57,7 +57,7 @@
57
57
  .adm-popover-arrow-icon {
58
58
  display: block;
59
59
  height: var(--arrow-size);
60
- width: 15px;
60
+ width: calc(var(--arrow-size) / 8 * 15);
61
61
  position: absolute;
62
62
  top: 50%;
63
63
  left: 50%;
@@ -15,7 +15,7 @@ export declare type PopoverProps = {
15
15
  placement?: Placement | DeprecatedPlacement;
16
16
  stopPropagation?: PropagationEvent[];
17
17
  content: React.ReactNode;
18
- } & NativeProps<'--z-index'>;
18
+ } & NativeProps<'--z-index' | '--arrow-size'>;
19
19
  export declare type PopoverRef = {
20
20
  show: () => void;
21
21
  hide: () => void;
@@ -35,6 +35,6 @@ export declare const Popover: React.ForwardRefExoticComponent<{
35
35
  content: React.ReactNode;
36
36
  } & {
37
37
  className?: string | undefined;
38
- style?: (React.CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
38
+ style?: (React.CSSProperties & Partial<Record<"--z-index" | "--arrow-size", string>>) | undefined;
39
39
  tabIndex?: number | undefined;
40
40
  } & React.AriaAttributes & React.RefAttributes<PopoverRef>>;
@@ -99,7 +99,7 @@ export const Popover = forwardRef((p, ref) => {
99
99
  top: arrowY != null ? `${arrowY}px` : '',
100
100
  right: '',
101
101
  bottom: '',
102
- [arrowSide]: `-${convertPx(8)}px`
102
+ [arrowSide]: 'calc(var(--arrow-size) * -1)'
103
103
  });
104
104
  const arrowRotate = {
105
105
  top: '0deg',
@@ -79,17 +79,19 @@ export const Popup = p => {
79
79
  className: bodyCls,
80
80
  style: Object.assign(Object.assign({}, props.bodyStyle), {
81
81
  transform: percent.to(v => {
82
- if (props.position === 'bottom') {
83
- return `translate(0, ${v}%)`;
84
- }
85
- if (props.position === 'top') {
86
- return `translate(0, -${v}%)`;
87
- }
88
- if (props.position === 'left') {
89
- return `translate(-${v}%, 0)`;
90
- }
91
- if (props.position === 'right') {
92
- return `translate(${v}%, 0)`;
82
+ if (v) {
83
+ if (props.position === 'bottom') {
84
+ return `translate(0, ${v}%)`;
85
+ }
86
+ if (props.position === 'top') {
87
+ return `translate(0, -${v}%)`;
88
+ }
89
+ if (props.position === 'left') {
90
+ return `translate(-${v}%, 0)`;
91
+ }
92
+ if (props.position === 'right') {
93
+ return `translate(${v}%, 0)`;
94
+ }
93
95
  }
94
96
  return 'none';
95
97
  })
@@ -18,7 +18,7 @@
18
18
  box-sizing: border-box;
19
19
  width: var(--icon-size);
20
20
  height: var(--icon-size);
21
- color: var(--adm-color-white);
21
+ color: var(--adm-color-text-light-solid);
22
22
  }
23
23
  .adm-radio .adm-radio-icon > svg {
24
24
  display: block;
@@ -41,7 +41,7 @@
41
41
  .adm-radio.adm-radio-disabled .adm-radio-icon {
42
42
  color: #b7b7b7;
43
43
  border-color: var(--adm-color-light);
44
- background-color: var(--adm-color-box);
44
+ background-color: var(--adm-color-fill-content);
45
45
  }
46
46
  .adm-radio .adm-radio-custom-icon {
47
47
  font-size: var(--icon-size);
@@ -1,7 +1,7 @@
1
1
  .adm-search-bar {
2
2
  --height: 32px;
3
3
  --padding-left: 8px;
4
- --background: var(--adm-color-box);
4
+ --background: var(--adm-color-fill-content);
5
5
  --border-radius: 6px;
6
6
  --placeholder-color: var(--adm-color-weak);
7
7
  ---placeholder-color: var(--placeholder-color);
@@ -1,5 +1,5 @@
1
1
  .adm-selector {
2
- --color: var(--adm-color-box);
2
+ --color: var(--adm-color-fill-content);
3
3
  --checked-color: #e7f1ff;
4
4
  --text-color: var(--adm-color-text);
5
5
  --checked-text-color: var(--adm-color-primary);
@@ -6,6 +6,7 @@ import Space from '../space';
6
6
  import Grid from '../grid';
7
7
  import { usePropsValue } from '../../utils/use-props-value';
8
8
  import { CheckMark } from './check-mark';
9
+ import { useConfig } from '../config-provider';
9
10
  const classPrefix = `adm-selector`;
10
11
  const defaultProps = {
11
12
  multiple: false,
@@ -27,6 +28,9 @@ export const Selector = p => {
27
28
  (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
28
29
  }
29
30
  });
31
+ const {
32
+ locale
33
+ } = useConfig();
30
34
  const items = props.options.map(option => {
31
35
  const active = (value || []).includes(option.value);
32
36
  const disabled = option.disabled || props.disabled;
@@ -49,7 +53,9 @@ export const Selector = p => {
49
53
  const val = active ? [] : [option.value];
50
54
  setValue(val);
51
55
  }
52
- }
56
+ },
57
+ role: 'option',
58
+ "aria-selected": active && !props.multiple || active && props.multiple
53
59
  }, option.label, option.description && React.createElement("div", {
54
60
  className: `${classPrefix}-item-description`
55
61
  }, option.description), active && props.showCheckMark && React.createElement("div", {
@@ -57,7 +63,9 @@ export const Selector = p => {
57
63
  }, React.createElement(CheckMark, null)));
58
64
  });
59
65
  return withNativeProps(props, React.createElement("div", {
60
- className: classPrefix
66
+ className: classPrefix,
67
+ role: 'listbox',
68
+ "aria-label": locale.Selector.name
61
69
  }, !props.columns && React.createElement(Space, {
62
70
  wrap: true
63
71
  }, items), props.columns && React.createElement(Grid, {
@@ -2,7 +2,7 @@
2
2
  --height: 100%;
3
3
  --width: 105px;
4
4
  --item-border-radius: 8px;
5
- --background-color: var(--adm-color-box);
5
+ --background-color: var(--adm-color-fill-content);
6
6
  width: var(--width);
7
7
  height: var(--height);
8
8
  box-sizing: border-box;
@@ -12,7 +12,7 @@
12
12
  position: relative;
13
13
  width: 100%;
14
14
  height: 3px;
15
- background-color: var(--adm-color-box);
15
+ background-color: var(--adm-color-fill-content);
16
16
  border-radius: 3px;
17
17
  }
18
18
  .adm-slider-fill {
@@ -34,7 +34,7 @@
34
34
  width: 7px;
35
35
  height: 7px;
36
36
  margin-left: -3px;
37
- background-color: var(--adm-color-box);
37
+ background-color: var(--adm-color-fill-content);
38
38
  border-radius: 50%;
39
39
  }
40
40
  .adm-slider-tick-active {
@@ -47,7 +47,7 @@
47
47
  border-radius: 50%;
48
48
  text-align: center;
49
49
  line-height: 28px;
50
- background: var(--adm-color-white);
50
+ background: var(--adm-color-text-light-solid);
51
51
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.12);
52
52
  color: var(--fill-color);
53
53
  }
@@ -3,14 +3,14 @@
3
3
  --input-width: 44px;
4
4
  --input-font-size: var(--adm-font-size-main);
5
5
  --input-font-color: var(--adm-color-text);
6
- --input-background-color: var(--adm-color-box);
6
+ --input-background-color: var(--adm-color-fill-content);
7
7
  --border-radius: 2px;
8
8
  --border: none;
9
9
  --border-inner: solid 2px transparent;
10
10
  --active-border: var(--border);
11
11
  --button-font-size: var(--adm-font-size-7);
12
12
  --button-text-color: var(--adm-color-primary);
13
- --button-background-color: var(--adm-color-box);
13
+ --button-background-color: var(--adm-color-fill-content);
14
14
  --button-width: var(--height);
15
15
  display: flex;
16
16
  align-items: center;
@@ -31,7 +31,7 @@
31
31
  .adm-swipe-action-action-button.adm-button {
32
32
  --border-radius: 0;
33
33
  --border-width: 0;
34
- --text-color: var(--adm-color-white);
34
+ --text-color: var(--adm-color-text-light-solid);
35
35
  padding-left: 20px;
36
36
  padding-right: 20px;
37
37
  }
@@ -52,7 +52,7 @@
52
52
  width: calc(var(--height) - 2 * var(--border-width));
53
53
  height: calc(var(--height) - 2 * var(--border-width));
54
54
  border-radius: calc(var(--height) - 2 * var(--border-width));
55
- background: var(--adm-color-white);
55
+ background: var(--adm-color-text-light-solid);
56
56
  position: absolute;
57
57
  z-index: 2;
58
58
  top: var(--border-width);
@@ -83,7 +83,7 @@
83
83
  }
84
84
  .adm-switch.adm-switch-checked .adm-switch-inner {
85
85
  margin: 0 calc(var(--height) - var(--border-width) + 5px) 0 10px;
86
- color: var(--adm-color-white);
86
+ color: var(--adm-color-text-light-solid);
87
87
  }
88
88
  .adm-switch.adm-switch-disabled {
89
89
  cursor: not-allowed;
@@ -182,7 +182,8 @@ export const Tabs = p => {
182
182
  className: `${classPrefix}-tab-list`,
183
183
  ref: tabListContainerRef,
184
184
  scrollLeft: scrollLeft,
185
- onScroll: updateMask
185
+ onScroll: updateMask,
186
+ role: 'tablist'
186
187
  }, React.createElement(animated.div, {
187
188
  ref: activeLineRef,
188
189
  className: `${classPrefix}-tab-line`,
@@ -209,7 +210,9 @@ export const Tabs = p => {
209
210
  className: classNames(`${classPrefix}-tab`, {
210
211
  [`${classPrefix}-tab-active`]: pane.key === activeKey,
211
212
  [`${classPrefix}-tab-disabled`]: pane.props.disabled
212
- })
213
+ }),
214
+ role: 'tab',
215
+ "aria-selected": pane.key === activeKey
213
216
  }, pane.props.title)))))), panes.map(pane => {
214
217
  if (pane.props.children === undefined) {
215
218
  return null;
@@ -21,7 +21,7 @@ export declare type TextAreaRef = {
21
21
  blur: () => void;
22
22
  nativeElement: HTMLTextAreaElement | null;
23
23
  };
24
- export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
24
+ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoFocus" | "autoComplete" | "readOnly"> & {
25
25
  onChange?: ((val: string) => void) | undefined;
26
26
  value?: string | undefined;
27
27
  defaultValue?: string | undefined;
@@ -118,6 +118,7 @@ export const TextArea = forwardRef((p, ref) => {
118
118
  ref: hiddenTextAreaRef,
119
119
  className: `${classPrefix}-element ${classPrefix}-element-hidden`,
120
120
  value: value,
121
+ rows: props.rows,
121
122
  "aria-hidden": true,
122
123
  readOnly: true
123
124
  })));
@@ -5,6 +5,7 @@ import { usePropsValue } from '../../utils/use-props-value';
5
5
  import classNames from 'classnames';
6
6
  import { CloseCircleFill } from 'antd-mobile-icons';
7
7
  import { useIsomorphicLayoutEffect } from 'ahooks';
8
+ import { useConfig } from '../config-provider';
8
9
  const classPrefix = 'adm-virtual-input';
9
10
  const defaultProps = {
10
11
  defaultValue: ''
@@ -15,6 +16,9 @@ export const VirtualInput = forwardRef((p, ref) => {
15
16
  const rootRef = useRef(null);
16
17
  const contentRef = useRef(null);
17
18
  const [hasFocus, setHasFocus] = useState(false);
19
+ const {
20
+ locale
21
+ } = useConfig();
18
22
  function scrollToEnd() {
19
23
  const root = rootRef.current;
20
24
  if (!root) return;
@@ -79,12 +83,15 @@ export const VirtualInput = forwardRef((p, ref) => {
79
83
  [`${classPrefix}-disabled`]: props.disabled
80
84
  }),
81
85
  tabIndex: props.disabled ? undefined : 0,
86
+ role: 'option',
82
87
  onFocus: onFocus,
83
88
  onBlur: onBlur,
84
89
  onClick: props.onClick
85
90
  }, React.createElement("div", {
86
91
  className: `${classPrefix}-content`,
87
- ref: contentRef
92
+ ref: contentRef,
93
+ "aria-disabled": props.disabled,
94
+ "aria-label": props.placeholder
88
95
  }, value, React.createElement("div", {
89
96
  className: `${classPrefix}-caret-container`
90
97
  }, hasFocus && React.createElement("div", {
@@ -96,7 +103,9 @@ export const VirtualInput = forwardRef((p, ref) => {
96
103
  e.stopPropagation();
97
104
  setValue('');
98
105
  (_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
99
- }
106
+ },
107
+ role: 'button',
108
+ "aria-label": locale.Input.clear
100
109
  }, React.createElement(CloseCircleFill, null)), !value && React.createElement("div", {
101
110
  className: `${classPrefix}-placeholder`
102
111
  }, props.placeholder), keyboardElement));
@@ -16,14 +16,17 @@
16
16
  --adm-color-success: #00b578;
17
17
  --adm-color-warning: #ff8f1f;
18
18
  --adm-color-danger: #ff3141;
19
- --adm-color-white: #ffffff;
20
19
  --adm-color-text: #333333;
21
20
  --adm-color-text-secondary: #666666;
22
21
  --adm-color-weak: #999999;
23
22
  --adm-color-light: #cccccc;
24
23
  --adm-color-border: #eeeeee;
25
- --adm-color-box: #f5f5f5;
26
24
  --adm-color-background: #ffffff;
25
+ --adm-color-white: #ffffff;
26
+ --adm-color-box: #f5f5f5;
27
+ --adm-color-text-light-solid: var(--adm-color-white);
28
+ --adm-color-text-dark-solid: #000000;
29
+ --adm-color-fill-content: var(--adm-color-box);
27
30
  --adm-font-size-main: var(--adm-font-size-5);
28
31
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
29
32
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
@@ -16,14 +16,17 @@
16
16
  --adm-color-success: #00b578;
17
17
  --adm-color-warning: #ff8f1f;
18
18
  --adm-color-danger: #ff3141;
19
- --adm-color-white: #ffffff;
20
19
  --adm-color-text: #333333;
21
20
  --adm-color-text-secondary: #666666;
22
21
  --adm-color-weak: #999999;
23
22
  --adm-color-light: #cccccc;
24
23
  --adm-color-border: #eeeeee;
25
- --adm-color-box: #f5f5f5;
26
24
  --adm-color-background: #ffffff;
25
+ --adm-color-white: #ffffff;
26
+ --adm-color-box: #f5f5f5;
27
+ --adm-color-text-light-solid: var(--adm-color-white);
28
+ --adm-color-text-dark-solid: #000000;
29
+ --adm-color-fill-content: var(--adm-color-box);
27
30
  --adm-font-size-main: var(--adm-font-size-5);
28
31
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
29
32
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
@@ -127,5 +127,8 @@ export declare const base: {
127
127
  Switch: {
128
128
  name: string;
129
129
  };
130
+ Selector: {
131
+ name: string;
132
+ };
130
133
  };
131
134
  export declare type Locale = typeof base;
@@ -127,5 +127,8 @@ export const base = {
127
127
  },
128
128
  Switch: {
129
129
  name: 'Switch'
130
+ },
131
+ Selector: {
132
+ name: 'Selector'
130
133
  }
131
134
  };
@@ -0,0 +1,134 @@
1
+ declare const daDK: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ close: string;
8
+ };
9
+ Calendar: {
10
+ markItems: string[];
11
+ renderYearAndMonth: (year: number, month: number) => string;
12
+ };
13
+ Cascader: {
14
+ placeholder: string;
15
+ };
16
+ Dialog: {
17
+ ok: string;
18
+ };
19
+ DatePicker: {
20
+ tillNow: string;
21
+ };
22
+ ErrorBlock: {
23
+ default: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ busy: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ disconnected: {
32
+ title: string;
33
+ description: string;
34
+ };
35
+ empty: {
36
+ title: string;
37
+ description: string;
38
+ };
39
+ };
40
+ Form: {
41
+ required: string;
42
+ optional: string;
43
+ defaultValidateMessages: {
44
+ default: string;
45
+ required: string;
46
+ enum: string;
47
+ whitespace: string;
48
+ date: {
49
+ format: string;
50
+ parse: string;
51
+ invalid: string;
52
+ };
53
+ types: {
54
+ string: string;
55
+ method: string;
56
+ array: string;
57
+ object: string;
58
+ number: string;
59
+ date: string;
60
+ boolean: string;
61
+ integer: string;
62
+ float: string;
63
+ regexp: string;
64
+ email: string;
65
+ url: string;
66
+ hex: string;
67
+ };
68
+ string: {
69
+ len: string;
70
+ min: string;
71
+ max: string;
72
+ range: string;
73
+ };
74
+ number: {
75
+ len: string;
76
+ min: string;
77
+ max: string;
78
+ range: string;
79
+ };
80
+ array: {
81
+ len: string;
82
+ min: string;
83
+ max: string;
84
+ range: string;
85
+ };
86
+ pattern: {
87
+ mismatch: string;
88
+ };
89
+ };
90
+ };
91
+ ImageUploader: {
92
+ uploading: string;
93
+ upload: string;
94
+ };
95
+ InfiniteScroll: {
96
+ noMore: string;
97
+ failedToLoad: string;
98
+ retry: string;
99
+ };
100
+ Input: {
101
+ clear: string;
102
+ };
103
+ Mask: {
104
+ name: string;
105
+ };
106
+ Modal: {
107
+ ok: string;
108
+ };
109
+ PasscodeInput: {
110
+ name: string;
111
+ };
112
+ PullToRefresh: {
113
+ pulling: string;
114
+ canRelease: string;
115
+ complete: string;
116
+ };
117
+ SearchBar: {
118
+ name: string;
119
+ };
120
+ Slider: {
121
+ name: string;
122
+ };
123
+ Stepper: {
124
+ decrease: string;
125
+ increase: string;
126
+ };
127
+ Switch: {
128
+ name: string;
129
+ };
130
+ Selector: {
131
+ name: string;
132
+ };
133
+ };
134
+ export default daDK;