antd-mobile 5.0.0-rc.22 → 5.0.0-rc.23

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 (97) hide show
  1. package/2x/README.md +1 -0
  2. package/2x/cjs/components/badge/badge.css +18 -10
  3. package/2x/cjs/components/badge/badge.d.ts +1 -0
  4. package/2x/cjs/components/badge/badge.js +4 -5
  5. package/2x/cjs/components/button/button.css +1 -1
  6. package/2x/cjs/components/checkbox/check-icon.js +4 -13
  7. package/2x/cjs/components/checkbox/checkbox.css +5 -14
  8. package/2x/cjs/components/checkbox/checkbox.js +3 -5
  9. package/2x/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
  10. package/2x/cjs/components/checkbox/indeterminate-icon.js +24 -0
  11. package/2x/cjs/components/image-viewer/image-viewer.d.ts +8 -2
  12. package/2x/cjs/components/image-viewer/image-viewer.js +8 -5
  13. package/2x/cjs/components/image-viewer/index.d.ts +6 -2
  14. package/2x/cjs/components/image-viewer/slides.d.ts +7 -3
  15. package/2x/cjs/components/image-viewer/slides.js +18 -11
  16. package/2x/cjs/components/modal/modal.css +25 -20
  17. package/2x/cjs/components/modal/modal.js +8 -12
  18. package/2x/cjs/components/passcode-input/passcode-input.d.ts +2 -2
  19. package/2x/cjs/components/picker-view/picker-view.css +2 -1
  20. package/2x/cjs/components/picker-view/wheel.js +1 -1
  21. package/2x/cjs/components/radio/radio.css +4 -7
  22. package/2x/cjs/components/radio/radio.js +1 -3
  23. package/2x/cjs/components/search-bar/search-bar.css +1 -1
  24. package/2x/cjs/components/switch/switch.css +8 -3
  25. package/2x/es/components/badge/badge.css +18 -10
  26. package/2x/es/components/badge/badge.d.ts +1 -0
  27. package/2x/es/components/badge/badge.js +4 -5
  28. package/2x/es/components/button/button.css +1 -1
  29. package/2x/es/components/checkbox/check-icon.js +4 -13
  30. package/2x/es/components/checkbox/checkbox.css +5 -14
  31. package/2x/es/components/checkbox/checkbox.js +2 -5
  32. package/2x/es/components/checkbox/indeterminate-icon.d.ts +3 -0
  33. package/2x/es/components/checkbox/indeterminate-icon.js +10 -0
  34. package/2x/es/components/image-viewer/image-viewer.d.ts +8 -2
  35. package/2x/es/components/image-viewer/image-viewer.js +4 -3
  36. package/2x/es/components/image-viewer/index.d.ts +6 -2
  37. package/2x/es/components/image-viewer/slides.d.ts +7 -3
  38. package/2x/es/components/image-viewer/slides.js +19 -10
  39. package/2x/es/components/modal/modal.css +25 -20
  40. package/2x/es/components/modal/modal.js +8 -12
  41. package/2x/es/components/passcode-input/passcode-input.d.ts +2 -2
  42. package/2x/es/components/picker-view/picker-view.css +2 -1
  43. package/2x/es/components/picker-view/wheel.js +1 -1
  44. package/2x/es/components/radio/radio.css +4 -7
  45. package/2x/es/components/radio/radio.js +1 -3
  46. package/2x/es/components/search-bar/search-bar.css +1 -1
  47. package/2x/es/components/switch/switch.css +8 -3
  48. package/2x/package.json +1 -1
  49. package/README.md +1 -0
  50. package/cjs/components/badge/badge.css +16 -10
  51. package/cjs/components/badge/badge.d.ts +1 -0
  52. package/cjs/components/badge/badge.js +4 -5
  53. package/cjs/components/button/button.css +1 -1
  54. package/cjs/components/checkbox/check-icon.js +4 -13
  55. package/cjs/components/checkbox/checkbox.css +5 -13
  56. package/cjs/components/checkbox/checkbox.js +3 -5
  57. package/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
  58. package/cjs/components/checkbox/indeterminate-icon.js +24 -0
  59. package/cjs/components/image-viewer/image-viewer.d.ts +8 -2
  60. package/cjs/components/image-viewer/image-viewer.js +8 -5
  61. package/cjs/components/image-viewer/index.d.ts +6 -2
  62. package/cjs/components/image-viewer/slides.d.ts +7 -3
  63. package/cjs/components/image-viewer/slides.js +18 -11
  64. package/cjs/components/modal/modal.css +23 -19
  65. package/cjs/components/modal/modal.js +8 -12
  66. package/cjs/components/passcode-input/passcode-input.d.ts +2 -2
  67. package/cjs/components/picker-view/picker-view.css +2 -1
  68. package/cjs/components/picker-view/wheel.js +1 -1
  69. package/cjs/components/radio/radio.css +4 -7
  70. package/cjs/components/radio/radio.js +1 -3
  71. package/cjs/components/search-bar/search-bar.css +1 -1
  72. package/cjs/components/switch/switch.css +8 -3
  73. package/es/components/badge/badge.css +16 -10
  74. package/es/components/badge/badge.d.ts +1 -0
  75. package/es/components/badge/badge.js +4 -5
  76. package/es/components/button/button.css +1 -1
  77. package/es/components/checkbox/check-icon.js +4 -13
  78. package/es/components/checkbox/checkbox.css +5 -13
  79. package/es/components/checkbox/checkbox.js +2 -5
  80. package/es/components/checkbox/indeterminate-icon.d.ts +3 -0
  81. package/es/components/checkbox/indeterminate-icon.js +10 -0
  82. package/es/components/image-viewer/image-viewer.d.ts +8 -2
  83. package/es/components/image-viewer/image-viewer.js +4 -3
  84. package/es/components/image-viewer/index.d.ts +6 -2
  85. package/es/components/image-viewer/slides.d.ts +7 -3
  86. package/es/components/image-viewer/slides.js +19 -10
  87. package/es/components/modal/modal.css +23 -19
  88. package/es/components/modal/modal.js +8 -12
  89. package/es/components/passcode-input/passcode-input.d.ts +2 -2
  90. package/es/components/picker-view/picker-view.css +2 -1
  91. package/es/components/picker-view/wheel.js +1 -1
  92. package/es/components/radio/radio.css +4 -7
  93. package/es/components/radio/radio.js +1 -3
  94. package/es/components/search-bar/search-bar.css +1 -1
  95. package/es/components/switch/switch.css +8 -3
  96. package/package.json +1 -1
  97. package/umd/antd-mobile.js +1 -1
@@ -4,24 +4,28 @@
4
4
  }
5
5
 
6
6
  .adm-badge {
7
- display: inline-block;
8
- color: #fff;
9
- font-weight: normal;
10
- text-align: center;
7
+ display: inline-flex;
11
8
  vertical-align: middle;
12
- box-sizing: border-box;
13
- min-width: 32px;
9
+ box-sizing: content-box;
14
10
  border-radius: 200px;
15
- padding: 0 8px;
16
- font-size: 18px;
17
- line-height: 28px;
18
- white-space: nowrap;
19
11
  background-color: var(--color);
20
12
  --right: 0;
21
13
  --top: 0;
22
14
  --color: var(--adm-badge-color, #ff411c);
23
15
  }
24
16
 
17
+ .adm-badge-content {
18
+ color: #fff;
19
+ box-sizing: border-box;
20
+ min-width: 16px;
21
+ padding: 2px 8px;
22
+ font-size: 18px;
23
+ line-height: 24px;
24
+ white-space: nowrap;
25
+ font-weight: normal;
26
+ text-align: center;
27
+ }
28
+
25
29
  .adm-badge-fixed {
26
30
  position: absolute;
27
31
  right: var(--right);
@@ -34,4 +38,8 @@
34
38
  width: 20px;
35
39
  height: 20px;
36
40
  border-radius: 10px;
41
+ }
42
+
43
+ .adm-badge-bordered {
44
+ border: solid 2px var(--adm-color-white);
37
45
  }
@@ -4,5 +4,6 @@ export declare const dot: unique symbol;
4
4
  export declare type BadgeProps = {
5
5
  content?: React.ReactNode | typeof dot;
6
6
  color?: string;
7
+ bordered?: boolean;
7
8
  } & NativeProps<'--right' | '--top' | '--color'>;
8
9
  export declare const Badge: FC<BadgeProps>;
@@ -10,16 +10,15 @@ export const Badge = props => {
10
10
  children
11
11
  } = props;
12
12
  const isDot = content === dot;
13
- const badgeCls = classNames(classPrefix, {
14
- [`${classPrefix}-fixed`]: !!children,
15
- [`${classPrefix}-dot`]: isDot
16
- });
13
+ const badgeCls = classNames(classPrefix, !!children && `${classPrefix}-fixed`, isDot && `${classPrefix}-dot`, props.bordered && `${classPrefix}-bordered`);
17
14
  const element = content ? withNativeProps(props, React.createElement("div", {
18
15
  className: badgeCls,
19
16
  style: {
20
17
  '--color': color
21
18
  }
22
- }, !isDot && content)) : null;
19
+ }, !isDot && React.createElement("div", {
20
+ className: `${classPrefix}-content`
21
+ }, content))) : null;
23
22
  return children ? React.createElement("div", {
24
23
  className: `${classPrefix}-wrap`
25
24
  }, children, element) : element;
@@ -71,7 +71,7 @@
71
71
  .adm-button:not(.adm-button-default).adm-button-fill-none {
72
72
  --text-color: var(--color);
73
73
  --background-color: transparent;
74
- --border-color: transparent;
74
+ --border-width: 0;
75
75
  }
76
76
 
77
77
  .adm-button-primary {
@@ -2,18 +2,9 @@ import React, { memo } from 'react';
2
2
  import { withNativeProps } from '../../utils/native-props';
3
3
  export const CheckIcon = memo(props => {
4
4
  return withNativeProps(props, React.createElement("svg", {
5
- viewBox: '0 0 24 16'
6
- }, React.createElement("g", {
7
- stroke: 'none',
8
- strokeWidth: '1',
9
- fill: 'none',
10
- fillRule: 'evenodd'
11
- }, React.createElement("g", {
12
- transform: 'translate(-35.000000, -40.000000)',
13
- fill: 'currentColor'
14
- }, React.createElement("g", {
15
- transform: 'translate(24.000000, 26.000000)'
5
+ viewBox: '0 0 40 40'
16
6
  }, React.createElement("path", {
17
- d: 'M18.8574375,25.9363304 L14.4138058,21.4926987 C13.8001225,20.8790154 12.8051453,20.8790154 12.1914621,21.4926987 C11.5777807,22.10638 11.5777807,23.1013541 12.1914621,23.7150354 C12.1914632,23.7150366 12.1914644,23.7150377 12.1914656,23.7150389 L17.4442507,28.9677909 C18.225314,29.7488091 19.4916285,29.7488141 20.2726979,28.9678021 L21.0808125,28.1597054 L21.0808125,28.1597054 L32.5627182,16.6759191 C33.176366,16.0621709 33.1763252,15.0671824 32.5626272,14.4534844 C31.948944,13.8398011 30.9539668,13.8398011 30.3402835,14.4534844 L18.8574375,25.9363304 L18.8574375,25.9363304 Z'
18
- }))))));
7
+ d: 'M31.5541766,15 L28.0892433,15 L28.0892434,15 C27.971052,15 27.8576674,15.044522 27.7740471,15.1239792 L18.2724722,24.1625319 L13.2248725,19.3630279 L13.2248725,19.3630279 C13.1417074,19.2834412 13.0287551,19.2384807 12.9107898,19.2380079 L9.44474455,19.2380079 L9.44474454,19.2380079 C9.19869815,19.2384085 8.99957935,19.4284738 9,19.66253 C9,19.7747587 9.04719253,19.8823283 9.13066188,19.9616418 L17.0907466,27.5338228 C17.4170809,27.8442545 17.8447695,28 18.2713393,28 L18.2980697,28 C18.7168464,27.993643 19.133396,27.8378975 19.4530492,27.5338228 L31.8693384,15.7236361 L31.8693384,15.7236361 C32.0434167,15.5582251 32.0435739,15.2898919 31.8696892,15.1242941 C31.7860402,15.0446329 31.6725052,15 31.5541421,15 L31.5541766,15 Z',
8
+ fill: 'currentColor'
9
+ })));
19
10
  });
@@ -18,17 +18,15 @@
18
18
  border: 2px solid var(--adm-color-light);
19
19
  border-radius: var(--icon-size);
20
20
  box-sizing: border-box;
21
- display: flex;
22
- justify-content: center;
23
- align-items: center;
24
21
  width: var(--icon-size);
25
22
  height: var(--icon-size);
26
- color: #ffffff;
23
+ color: var(--adm-color-white);
27
24
  }
28
25
 
29
- .adm-checkbox .adm-checkbox-icon-checked {
30
- width: 65%;
31
- height: 65%;
26
+ .adm-checkbox .adm-checkbox-icon > svg {
27
+ display: block;
28
+ width: 100%;
29
+ height: 100%;
32
30
  }
33
31
 
34
32
  .adm-checkbox.adm-checkbox-block {
@@ -63,13 +61,6 @@
63
61
  color: var(--adm-color-primary);
64
62
  }
65
63
 
66
- .adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-indeterminate-checked {
67
- width: 60%;
68
- height: 60%;
69
- border-radius: 100%;
70
- background-color: currentColor;
71
- }
72
-
73
64
  .adm-checkbox-content {
74
65
  flex: 0 1 auto;
75
66
  font-size: var(--font-size);
@@ -6,6 +6,7 @@ import { usePropsValue } from '../../utils/use-props-value';
6
6
  import { mergeProps } from '../../utils/with-default-props';
7
7
  import { devWarning } from '../../utils/dev-log';
8
8
  import { CheckIcon } from './check-icon';
9
+ import { IndeterminateIcon } from './indeterminate-icon';
9
10
  const classPrefix = `adm-checkbox`;
10
11
  const defaultProps = {
11
12
  defaultChecked: false,
@@ -63,11 +64,7 @@ export const Checkbox = p => {
63
64
 
64
65
  return React.createElement("div", {
65
66
  className: `${classPrefix}-icon`
66
- }, props.indeterminate ? React.createElement("div", {
67
- className: `${classPrefix}-indeterminate-checked`
68
- }) : checked && React.createElement(CheckIcon, {
69
- className: `${classPrefix}-icon-checked`
70
- }));
67
+ }, props.indeterminate ? React.createElement(IndeterminateIcon, null) : checked && React.createElement(CheckIcon, null));
71
68
  };
72
69
 
73
70
  return withNativeProps(props, React.createElement("label", {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { NativeProps } from '../../utils/native-props';
3
+ export declare const IndeterminateIcon: React.NamedExoticComponent<NativeProps<never>>;
@@ -0,0 +1,10 @@
1
+ import React, { memo } from 'react';
2
+ import { withNativeProps } from '../../utils/native-props';
3
+ export const IndeterminateIcon = memo(props => {
4
+ return withNativeProps(props, React.createElement("svg", {
5
+ viewBox: '0 0 40 40'
6
+ }, React.createElement("path", {
7
+ d: 'M20,9 C26.0752953,9 31,13.9247047 31,20 C31,26.0752953 26.0752953,31 20,31 C13.9247047,31 9,26.0752953 9,20 C9,13.9247047 13.9247047,9 20,9 Z',
8
+ fill: 'currentColor'
9
+ })));
10
+ });
@@ -1,5 +1,6 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import { GetContainer } from '../../utils/render-to-container';
3
+ import { SlidesRef } from './slides';
3
4
  export declare type ImageViewerProps = {
4
5
  image?: string;
5
6
  maxZoom?: number;
@@ -9,9 +10,14 @@ export declare type ImageViewerProps = {
9
10
  afterClose?: () => void;
10
11
  };
11
12
  export declare const ImageViewer: FC<ImageViewerProps>;
13
+ export declare type MultiImageViewerRef = SlidesRef;
12
14
  export declare type MultiImageViewerProps = Omit<ImageViewerProps, 'image'> & {
13
15
  images?: string[];
14
16
  defaultIndex?: number;
15
17
  onIndexChange?: (index: number) => void;
16
18
  };
17
- export declare const MultiImageViewer: FC<MultiImageViewerProps>;
19
+ export declare const MultiImageViewer: React.ForwardRefExoticComponent<Pick<ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
20
+ images?: string[] | undefined;
21
+ defaultIndex?: number | undefined;
22
+ onIndexChange?: ((index: number) => void) | undefined;
23
+ } & React.RefAttributes<SlidesRef>>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { mergeProps } from '../../utils/with-default-props';
3
3
  import { renderToContainer } from '../../utils/render-to-container';
4
4
  import Mask from '../mask';
@@ -33,7 +33,7 @@ export const ImageViewer = p => {
33
33
  const multiDefaultProps = Object.assign(Object.assign({}, defaultProps), {
34
34
  defaultIndex: 0
35
35
  });
36
- export const MultiImageViewer = p => {
36
+ export const MultiImageViewer = forwardRef((p, ref) => {
37
37
  const props = mergeProps(multiDefaultProps, p);
38
38
  const node = React.createElement(Mask, {
39
39
  visible: props.visible,
@@ -43,6 +43,7 @@ export const MultiImageViewer = p => {
43
43
  }, React.createElement("div", {
44
44
  className: `${classPrefix}-content`
45
45
  }, props.images && React.createElement(Slides, {
46
+ ref: ref,
46
47
  defaultIndex: props.defaultIndex,
47
48
  onIndexChange: props.onIndexChange,
48
49
  images: props.images,
@@ -54,4 +55,4 @@ export const MultiImageViewer = p => {
54
55
  maxZoom: props.maxZoom
55
56
  })));
56
57
  return renderToContainer(props.getContainer, node);
57
- };
58
+ });
@@ -1,10 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import './image-viewer.less';
3
3
  import { showMultiImageViewer, showImageViewer, clearImageViewer } from './methods';
4
- export type { ImageViewerProps, MultiImageViewerProps } from './image-viewer';
4
+ export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
5
5
  export type { ImageViewerHandler } from './methods';
6
6
  declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
7
- Multi: import("react").FC<import("./image-viewer").MultiImageViewerProps> & {
7
+ Multi: import("react").ForwardRefExoticComponent<Pick<import("./image-viewer").ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
8
+ images?: string[] | undefined;
9
+ defaultIndex?: number | undefined;
10
+ onIndexChange?: ((index: number) => void) | undefined;
11
+ } & import("react").RefAttributes<import("./slides").SlidesRef>> & {
8
12
  show: typeof showMultiImageViewer;
9
13
  };
10
14
  show: typeof showImageViewer;
@@ -1,8 +1,12 @@
1
- import { FC } from 'react';
2
- export declare const Slides: FC<{
1
+ import React from 'react';
2
+ export declare type SlidesType = {
3
3
  images: string[];
4
4
  onTap: () => void;
5
5
  maxZoom: number;
6
6
  defaultIndex: number;
7
7
  onIndexChange?: (index: number) => void;
8
- }>;
8
+ };
9
+ export declare type SlidesRef = {
10
+ swipeTo: (index: number, immediate: boolean) => void;
11
+ };
12
+ export declare const Slides: React.ForwardRefExoticComponent<SlidesType & React.RefAttributes<SlidesRef>>;
@@ -1,11 +1,11 @@
1
- import React, { useRef } from 'react';
1
+ import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
2
  import { useDrag } from '@use-gesture/react';
3
3
  import { useSpring, animated } from '@react-spring/web';
4
4
  import { Slide } from './slide';
5
5
  import { convertPx } from '../../utils/convert-px';
6
6
  import { bound } from '../../utils/bound';
7
7
  const classPrefix = `adm-image-viewer`;
8
- export const Slides = props => {
8
+ export const Slides = forwardRef((props, ref) => {
9
9
  const slideWidth = window.innerWidth + convertPx(16);
10
10
  const [{
11
11
  x
@@ -17,10 +17,23 @@ export const Slides = props => {
17
17
  }
18
18
  }));
19
19
  const count = props.images.length;
20
- const dragLockRef = useRef(false);
21
- const bind = useDrag(state => {
20
+
21
+ function swipeTo(index, immediate = false) {
22
22
  var _a;
23
23
 
24
+ const i = bound(index, 0, count - 1);
25
+ (_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, i);
26
+ api.start({
27
+ x: i * slideWidth,
28
+ immediate
29
+ });
30
+ }
31
+
32
+ useImperativeHandle(ref, () => ({
33
+ swipeTo
34
+ }));
35
+ const dragLockRef = useRef(false);
36
+ const bind = useDrag(state => {
24
37
  if (dragLockRef.current) return;
25
38
  const [offsetX] = state.offset;
26
39
 
@@ -28,11 +41,7 @@ export const Slides = props => {
28
41
  const minIndex = Math.floor(offsetX / slideWidth);
29
42
  const maxIndex = minIndex + 1;
30
43
  const velocityOffset = Math.min(state.velocity[0] * 2000, slideWidth) * state.direction[0];
31
- const index = bound(bound(Math.round((offsetX + velocityOffset) / slideWidth), minIndex, maxIndex), 0, count - 1);
32
- (_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, index);
33
- api.start({
34
- x: index * slideWidth
35
- });
44
+ swipeTo(bound(Math.round((offsetX + velocityOffset) / slideWidth), minIndex, maxIndex));
36
45
  } else {
37
46
  api.start({
38
47
  x: offsetX,
@@ -81,4 +90,4 @@ export const Slides = props => {
81
90
  },
82
91
  dragLockRef: dragLockRef
83
92
  }))));
84
- };
93
+ });
@@ -22,10 +22,12 @@
22
22
  .adm-modal-main {
23
23
  width: 100%;
24
24
  max-height: 70vh;
25
+ box-sizing: border-box;
25
26
  font-size: 28px;
26
27
  background-color: white;
27
28
  border-radius: 16px;
28
- overflow: hidden;
29
+ overflow-x: hidden;
30
+ overflow-y: auto;
29
31
  display: flex;
30
32
  flex-direction: column;
31
33
  }
@@ -40,14 +42,12 @@
40
42
 
41
43
  .adm-modal-main .adm-modal-body {
42
44
  padding: 40px 24px 24px;
45
+ display: flex;
46
+ flex-direction: column;
43
47
  }
44
48
 
45
- .adm-modal-main .adm-modal-body .adm-modal-close {
46
- position: absolute;
47
- right: 24px;
48
- top: 24px;
49
- color: var(--adm-color-weak);
50
- padding: 4px;
49
+ .adm-modal-main .adm-modal-body > * + * {
50
+ margin-top: 16px;
51
51
  }
52
52
 
53
53
  .adm-modal-main .adm-modal-body-header-wrapper {
@@ -63,39 +63,44 @@
63
63
  }
64
64
 
65
65
  .adm-modal-main .adm-modal-body-content {
66
- max-height: 70vh;
67
- overflow-x: hidden;
68
- overflow-y: auto;
69
66
  font-size: 30px;
70
67
  line-height: 1.4;
71
68
  color: #333;
72
69
  }
73
70
 
74
- .adm-modal-main .adm-modal-footer {
71
+ .adm-modal-main .adm-modal-close {
72
+ position: absolute;
73
+ right: 16px;
74
+ top: 16px;
75
+ color: var(--adm-color-weak);
76
+ padding: 8px;
77
+ font-size: 36px;
78
+ }
79
+
80
+ .adm-modal-footer {
75
81
  user-select: none;
76
82
  padding: 16px 24px 24px;
77
83
  }
78
84
 
79
- .adm-modal-main .adm-modal-footer .adm-modal-button {
80
- font-size: 36px;
81
- line-height: 50px;
82
- border-right: solid 1px var(--adm-border-color);
85
+ .adm-modal-footer.adm-space {
86
+ --gap-vertical: 40px;
83
87
  }
84
88
 
85
- .adm-modal-main .adm-modal-footer .adm-modal-button:last-child {
86
- border-right: none;
89
+ .adm-modal-footer .adm-modal-button {
90
+ font-size: 36px;
91
+ line-height: 50px;
87
92
  }
88
93
 
89
- .adm-modal-main .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary) {
94
+ .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary) {
90
95
  padding-top: 0;
91
96
  padding-bottom: 0;
92
97
  }
93
98
 
94
- .adm-modal-main .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary)::before {
99
+ .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary)::before {
95
100
  display: none;
96
101
  }
97
102
 
98
- .adm-modal-main .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
103
+ .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
99
104
  opacity: 0.7;
100
105
  }
101
106
 
@@ -71,7 +71,10 @@ export const Modal = p => {
71
71
  style: Object.assign({}, style),
72
72
  onClick: e => e.stopPropagation(),
73
73
  className: `${classPrefix}-main`
74
- }, !!props.image && React.createElement("div", {
74
+ }, props.showCloseButton && React.createElement("a", {
75
+ className: classNames(`${classPrefix}-close`, 'adm-plain-anchor'),
76
+ onClick: props.onClose
77
+ }, React.createElement(CloseOutline, null)), !!props.image && React.createElement("div", {
75
78
  className: `${classPrefix}-image-container`
76
79
  }, React.createElement(Image, {
77
80
  src: props.image,
@@ -80,12 +83,6 @@ export const Modal = p => {
80
83
  })), React.createElement("div", {
81
84
  style: props.bodyStyle,
82
85
  className: classNames(`${classPrefix}-body`, props.bodyClassName)
83
- }, props.showCloseButton && React.createElement("a", {
84
- className: classNames(`${classPrefix}-close`, 'adm-plain-anchor'),
85
- onClick: props.onClose
86
- }, React.createElement(CloseOutline, null)), React.createElement(Space, {
87
- direction: 'vertical',
88
- block: true
89
86
  }, !!props.header && React.createElement("div", {
90
87
  className: `${classPrefix}-body-header-wrapper`
91
88
  }, React.createElement("div", {
@@ -94,11 +91,10 @@ export const Modal = p => {
94
91
  className: `${classPrefix}-body-title`
95
92
  }, props.title), !!props.content && React.createElement("div", {
96
93
  className: `${classPrefix}-body-content`
97
- }, typeof props.content === 'string' ? React.createElement(AutoCenter, null, props.content) : props.content))), React.createElement("div", {
98
- className: `${classPrefix}-footer`
99
- }, React.createElement(Space, {
94
+ }, typeof props.content === 'string' ? React.createElement(AutoCenter, null, props.content) : props.content)), React.createElement(Space, {
100
95
  direction: 'vertical',
101
- block: true
96
+ block: true,
97
+ className: `${classPrefix}-footer`
102
98
  }, props.actions.map((action, index) => {
103
99
  return React.createElement(ModalActionButton, {
104
100
  key: action.key,
@@ -113,6 +109,6 @@ export const Modal = p => {
113
109
  }
114
110
  })
115
111
  });
116
- }))))))));
112
+ })))))));
117
113
  return renderToContainer(props.getContainer, node);
118
114
  };
@@ -14,7 +14,7 @@ export declare type PasscodeInputProps = {
14
14
  onFocus?: () => void;
15
15
  keyboard?: ReactElement<NumberKeyboardProps>;
16
16
  onFill?: (val: string) => void;
17
- } & NativeProps<'--cell-gap' | '--cell-size'>;
17
+ } & NativeProps<'--cell-gap' | '--cell-size' | '--dot-size' | '--border-color' | '--border-radius'>;
18
18
  export declare type PasscodeInputRef = {
19
19
  focus: () => void;
20
20
  blur: () => void;
@@ -32,4 +32,4 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
32
32
  onFocus?: (() => void) | undefined;
33
33
  keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
34
34
  onFill?: ((val: string) => void) | undefined;
35
- } & NativeProps<"--cell-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
35
+ } & NativeProps<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
@@ -66,6 +66,7 @@
66
66
  display: flex;
67
67
  flex-direction: column;
68
68
  position: relative;
69
+ z-index: 0;
69
70
  }
70
71
 
71
72
  .adm-picker-view-column-accessible > * {
@@ -86,7 +87,7 @@
86
87
 
87
88
  .adm-picker-view-mask {
88
89
  position: absolute;
89
- z-index: 100;
90
+ z-index: 10000;
90
91
  left: 0;
91
92
  top: 0;
92
93
  width: 100%;
@@ -126,7 +126,7 @@ export const Wheel = memo(props => {
126
126
  className: `${classPrefix}-column`
127
127
  }, bind()), React.createElement(animated.div, {
128
128
  style: {
129
- y
129
+ translateY: y
130
130
  },
131
131
  className: `${classPrefix}-column-wheel`,
132
132
  "aria-hidden": true
@@ -18,18 +18,15 @@
18
18
  border: 2px solid var(--adm-color-light);
19
19
  border-radius: var(--icon-size);
20
20
  box-sizing: border-box;
21
- display: flex;
22
- justify-content: center;
23
- align-items: center;
24
21
  width: var(--icon-size);
25
22
  height: var(--icon-size);
26
- color: #ffffff;
23
+ color: var(--adm-color-white);
27
24
  }
28
25
 
29
- .adm-radio .adm-radio-icon-checked {
26
+ .adm-radio .adm-radio-icon > svg {
30
27
  display: block;
31
- width: 65%;
32
- height: 65%;
28
+ width: 100%;
29
+ height: 100%;
33
30
  }
34
31
 
35
32
  .adm-radio.adm-radio-block {
@@ -49,9 +49,7 @@ export const Radio = p => {
49
49
 
50
50
  return React.createElement("div", {
51
51
  className: `${classPrefix}-icon`
52
- }, checked && React.createElement(CheckIcon, {
53
- className: `${classPrefix}-icon-checked`
54
- }));
52
+ }, checked && React.createElement(CheckIcon, null));
55
53
  };
56
54
 
57
55
  return withNativeProps(props, React.createElement("label", {
@@ -57,7 +57,7 @@
57
57
  padding: 6px 24px;
58
58
  }
59
59
 
60
- .adm-search-bar-active .adm-input.adm-input {
60
+ .adm-search-bar-active .adm-input.adm-input.adm-input {
61
61
  --placeholder-color: var(--adm-color-light);
62
62
  }
63
63
 
@@ -6,8 +6,8 @@
6
6
 
7
7
  .adm-switch {
8
8
  --checked-color: var(--adm-color-primary);
9
- --height: 60px;
10
- --width: 100px;
9
+ --height: 62px;
10
+ --width: 102px;
11
11
  --border-width: 4px;
12
12
  display: inline-block;
13
13
  vertical-align: middle;
@@ -69,9 +69,14 @@
69
69
  .adm-switch-inner {
70
70
  position: relative;
71
71
  z-index: 1;
72
- margin: 0 20px 0 calc(var(--height) - var(--border-width) + 10px);
72
+ display: flex;
73
+ justify-content: center;
74
+ align-items: center;
75
+ margin: 0 16px 0 calc(var(--height) - var(--border-width) + 8px);
76
+ height: 100%;
73
77
  color: var(--adm-color-weak);
74
78
  transition: margin 200ms;
79
+ font-size: 30px;
75
80
  }
76
81
 
77
82
  .adm-switch.adm-switch-checked .adm-switch-checkbox {
package/2x/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.0.0-rc.22",
3
+ "version": "5.0.0-rc.23",
4
4
  "dependencies": {
5
5
  "@react-spring/web": "^9.4.2",
6
6
  "@types/resize-observer-browser": "^0.1.6",
package/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/ant-design/ant-design-mobile.svg)](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Average time to resolve an issue')
8
8
  [![Percentage of issues still open](http://isitmaintained.com/badge/open/ant-design/ant-design-mobile.svg)](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Percentage of issues still open')
9
9
  ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ant-design/ant-design-mobile/Check/v5)
10
+ [![codecov](https://codecov.io/gh/ant-design/ant-design-mobile/branch/master/graph/badge.svg?token=2kJyJBg1nK)](https://codecov.io/gh/ant-design/ant-design-mobile)
10
11
  ![GitHub](https://img.shields.io/github/license/ant-design/ant-design-mobile)
11
12
 
12
13
  ```bash
@@ -3,23 +3,26 @@
3
3
  position: relative;
4
4
  }
5
5
  .adm-badge {
6
- display: inline-block;
7
- color: #fff;
8
- font-weight: normal;
9
- text-align: center;
6
+ display: inline-flex;
10
7
  vertical-align: middle;
11
- box-sizing: border-box;
12
- min-width: 16px;
8
+ box-sizing: content-box;
13
9
  border-radius: 100px;
14
- padding: 0 4px;
15
- font-size: 9px;
16
- line-height: 14px;
17
- white-space: nowrap;
18
10
  background-color: var(--color);
19
11
  --right: 0;
20
12
  --top: 0;
21
13
  --color: var(--adm-badge-color, #ff411c);
22
14
  }
15
+ .adm-badge-content {
16
+ color: #fff;
17
+ box-sizing: border-box;
18
+ min-width: 8px;
19
+ padding: 1px 4px;
20
+ font-size: 9px;
21
+ line-height: 12px;
22
+ white-space: nowrap;
23
+ font-weight: normal;
24
+ text-align: center;
25
+ }
23
26
  .adm-badge-fixed {
24
27
  position: absolute;
25
28
  right: var(--right);
@@ -32,3 +35,6 @@
32
35
  height: 10px;
33
36
  border-radius: 5px;
34
37
  }
38
+ .adm-badge-bordered {
39
+ border: solid 1px var(--adm-color-white);
40
+ }
@@ -4,5 +4,6 @@ export declare const dot: unique symbol;
4
4
  export declare type BadgeProps = {
5
5
  content?: React.ReactNode | typeof dot;
6
6
  color?: string;
7
+ bordered?: boolean;
7
8
  } & NativeProps<'--right' | '--top' | '--color'>;
8
9
  export declare const Badge: FC<BadgeProps>;