@trionesdev/antd-mobile-base-react 0.0.2-beta.16 → 0.0.2-beta.17

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 (110) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -23
  3. package/dist/Alert/style.scss +69 -69
  4. package/dist/Avatar/avatar.d.ts +2 -2
  5. package/dist/Avatar/avatar.js +1 -1
  6. package/dist/Avatar/style.scss +17 -17
  7. package/dist/Badge/style.scss +100 -100
  8. package/dist/Card/style.scss +35 -35
  9. package/dist/CascaderView/style.scss +22 -22
  10. package/dist/Cell/CellGroup.js +25 -8
  11. package/dist/Cell/cell.js +20 -37
  12. package/dist/Cell/context.d.ts +4 -2
  13. package/dist/Cell/styles.scss +81 -52
  14. package/dist/Cell/types.d.ts +6 -4
  15. package/dist/Checkbox/checkbox-group.js +1 -2
  16. package/dist/Checkbox/index.scss +165 -165
  17. package/dist/ConfigProvider/config-provider.d.ts +1 -0
  18. package/dist/DemoBlock/index.scss +20 -20
  19. package/dist/DemoDescription/index.scss +3 -3
  20. package/dist/Descriptions/style.scss +65 -65
  21. package/dist/Divider/divider.d.ts +1 -1
  22. package/dist/Divider/divider.js +5 -3
  23. package/dist/Divider/style.scss +62 -62
  24. package/dist/Ellipsis/style.scss +13 -13
  25. package/dist/Empty/style.scss +29 -29
  26. package/dist/ErrorBlock/demo/base.js +2 -2
  27. package/dist/ErrorBlock/style.scss +62 -62
  28. package/dist/Footer/style.scss +55 -55
  29. package/dist/Form/ErrorList.d.ts +4 -0
  30. package/dist/Form/ErrorList.js +9 -0
  31. package/dist/Form/context.d.ts +4 -2
  32. package/dist/Form/context.js +2 -1
  33. package/dist/Form/form.d.ts +24 -6
  34. package/dist/Form/form.js +22 -11
  35. package/dist/Form/hooks/useForm.js +1 -8
  36. package/dist/Form/hooks/useFormContext.js +1 -2
  37. package/dist/Form/index.d.ts +6 -3
  38. package/dist/Form/index.js +4 -1
  39. package/dist/Form/styles.scss +11 -0
  40. package/dist/Form/types.d.ts +2 -1
  41. package/dist/FormCell/FormCell.d.ts +21 -0
  42. package/dist/FormCell/FormCell.js +56 -0
  43. package/dist/FormCell/index.d.ts +4 -0
  44. package/dist/FormCell/index.js +3 -0
  45. package/dist/FormCell/styles.scss +103 -0
  46. package/dist/Grid/style.scss +17 -17
  47. package/dist/Icon/demo/base.js +2 -2
  48. package/dist/InputNumber/style.scss +100 -100
  49. package/dist/Loading/DotLoading.d.ts +8 -0
  50. package/dist/Loading/DotLoading.js +33 -0
  51. package/dist/Loading/SpinLoading.js +70 -0
  52. package/dist/Loading/dot-loading.scss +72 -0
  53. package/dist/Loading/index.d.ts +5 -0
  54. package/dist/Loading/index.js +3 -0
  55. package/dist/{SpinLoading → Loading}/spin-loading.scss +39 -40
  56. package/dist/NavBar/style.scss +64 -64
  57. package/dist/NoticeBar/style.scss +130 -130
  58. package/dist/PageIndicator/style.scss +59 -59
  59. package/dist/Progress/Progress.js +1 -1
  60. package/dist/Progress/ProgressCircle.js +5 -2
  61. package/dist/Progress/ProgressLine.js +2 -2
  62. package/dist/Progress/style.scss +33 -33
  63. package/dist/Progress/types.d.ts +2 -2
  64. package/dist/Radio/style.scss +154 -141
  65. package/dist/Rate/style.scss +37 -37
  66. package/dist/Result/demo/base.js +2 -2
  67. package/dist/Result/style.scss +73 -73
  68. package/dist/SafeArea/style.scss +20 -20
  69. package/dist/Scaffold/style.scss +17 -17
  70. package/dist/Segmented/style.scss +75 -75
  71. package/dist/Skeleton/Skeleton.d.ts +80 -21
  72. package/dist/Skeleton/Skeleton.js +248 -57
  73. package/dist/Skeleton/index.d.ts +3 -1
  74. package/dist/Skeleton/index.js +2 -1
  75. package/dist/Skeleton/style.scss +215 -48
  76. package/dist/Space/space.js +12 -9
  77. package/dist/Space/style.scss +101 -80
  78. package/dist/Stepper/stepper.js +2 -1
  79. package/dist/Stepper/style.scss +100 -100
  80. package/dist/Steps/HorizontalSteps.js +5 -2
  81. package/dist/Steps/VerticalSteps.js +5 -2
  82. package/dist/Steps/style.scss +153 -153
  83. package/dist/Steps/types.d.ts +2 -0
  84. package/dist/Switch/style.scss +127 -128
  85. package/dist/Switch/switch.d.ts +2 -0
  86. package/dist/Switch/switch.js +6 -5
  87. package/dist/TabBar/demo/base.js +2 -2
  88. package/dist/TabBar/index.scss +37 -37
  89. package/dist/Tabs/style.scss +108 -108
  90. package/dist/Tag/style.scss +110 -109
  91. package/dist/Tag/tag.d.ts +1 -1
  92. package/dist/Tag/tag.js +1 -1
  93. package/dist/WaterMark/style.scss +17 -17
  94. package/dist/index.d.ts +9 -4
  95. package/dist/index.js +4 -2
  96. package/dist/style/css-variable.scss +6 -6
  97. package/dist/style/style.scss +52 -52
  98. package/dist/style/theme-dark.scss +24 -24
  99. package/dist/style/theme-default.scss +54 -54
  100. package/dist/style/variable.scss +180 -173
  101. package/dist/types.d.ts +6 -1
  102. package/dist/utils/type.js +36 -36
  103. package/dist/utils/with-default-props.js +4 -4
  104. package/package.json +4 -7
  105. package/dist/SpinLoading/index.d.ts +0 -3
  106. package/dist/SpinLoading/index.js +0 -2
  107. package/dist/SpinLoading/spin-loading.js +0 -59
  108. package/dist/Tabs/demo/base.d.ts +0 -3
  109. package/dist/Tabs/demo/base.js +0 -59
  110. /package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -0
@@ -1,73 +1,73 @@
1
- $class-prefix-result: 'triones-antm-result';
2
- /* prettier-ignore */
3
- .#{$class-prefix-result} {
4
- padding: 32PX 12PX;
5
- background-color: var(--triones-antm-color-background);
6
-
7
- &-icon {
8
- box-sizing: border-box;
9
- width: 64PX;
10
- height: 64PX;
11
- margin: 0 auto 20PX auto;
12
- padding: 6PX;
13
-
14
- .antd-mobile-icon {
15
- font-size: 52PX;
16
- }
17
- }
18
-
19
- &-title {
20
- color: var(--triones-antm-color-text);
21
- font-size: var(--triones-antm-font-size-10);
22
- line-height: 1.4;
23
- text-align: center;
24
- }
25
-
26
- &-description {
27
- margin-top: 8PX;
28
- color: var(--triones-antm-color-weak);
29
- font-size: var(--triones-antm-font-size-main);
30
- line-height: 1.4;
31
- text-align: center;
32
- }
33
- }
34
-
35
- .#{$class-prefix-result}-success {
36
- .#{$class-prefix-result}-icon {
37
- .antd-mobile-icon {
38
- color: var(--triones-antm-color-primary);
39
- }
40
- }
41
- }
42
-
43
- .#{$class-prefix-result}-error {
44
- .#{$class-prefix-result}-icon {
45
- .antd-mobile-icon {
46
- color: var(--triones-antm-color-danger);
47
- }
48
- }
49
- }
50
-
51
- .#{$class-prefix-result}-info {
52
- .#{$class-prefix-result}-icon {
53
- .antd-mobile-icon {
54
- color: var(--triones-antm-color-primary);
55
- }
56
- }
57
- }
58
-
59
- .#{$class-prefix-result}-waiting {
60
- .#{$class-prefix-result}-icon {
61
- .antd-mobile-icon {
62
- color: var(--triones-antm-color-success);
63
- }
64
- }
65
- }
66
-
67
- .#{$class-prefix-result}-warning {
68
- .#{$class-prefix-result}-icon {
69
- .antd-mobile-icon {
70
- color: var(--triones-antm-color-warning);
71
- }
72
- }
73
- }
1
+ $class-prefix-result: 'triones-antm-result';
2
+ /* prettier-ignore */
3
+ .#{$class-prefix-result} {
4
+ padding: 32PX 12PX;
5
+ background-color: var(--triones-antm-color-background);
6
+
7
+ &-icon {
8
+ box-sizing: border-box;
9
+ width: 64PX;
10
+ height: 64PX;
11
+ margin: 0 auto 20PX auto;
12
+ padding: 6PX;
13
+
14
+ .antd-mobile-icon {
15
+ font-size: 52PX;
16
+ }
17
+ }
18
+
19
+ &-title {
20
+ color: var(--triones-antm-color-text);
21
+ font-size: var(--triones-antm-font-size-10);
22
+ line-height: 1.4;
23
+ text-align: center;
24
+ }
25
+
26
+ &-description {
27
+ margin-top: 8PX;
28
+ color: var(--triones-antm-color-weak);
29
+ font-size: var(--triones-antm-font-size-main);
30
+ line-height: 1.4;
31
+ text-align: center;
32
+ }
33
+ }
34
+
35
+ .#{$class-prefix-result}-success {
36
+ .#{$class-prefix-result}-icon {
37
+ .antd-mobile-icon {
38
+ color: var(--triones-antm-color-primary);
39
+ }
40
+ }
41
+ }
42
+
43
+ .#{$class-prefix-result}-error {
44
+ .#{$class-prefix-result}-icon {
45
+ .antd-mobile-icon {
46
+ color: var(--triones-antm-color-danger);
47
+ }
48
+ }
49
+ }
50
+
51
+ .#{$class-prefix-result}-info {
52
+ .#{$class-prefix-result}-icon {
53
+ .antd-mobile-icon {
54
+ color: var(--triones-antm-color-primary);
55
+ }
56
+ }
57
+ }
58
+
59
+ .#{$class-prefix-result}-waiting {
60
+ .#{$class-prefix-result}-icon {
61
+ .antd-mobile-icon {
62
+ color: var(--triones-antm-color-success);
63
+ }
64
+ }
65
+ }
66
+
67
+ .#{$class-prefix-result}-warning {
68
+ .#{$class-prefix-result}-icon {
69
+ .antd-mobile-icon {
70
+ color: var(--triones-antm-color-warning);
71
+ }
72
+ }
73
+ }
@@ -1,20 +1,20 @@
1
- @use "../style/variable" as variable;
2
-
3
- $class-prefix-safe-area: 'triones-antm-safe-area';
4
-
5
- $safeAreaMultiple : variable.$trionesSafeAreaMultiple;
6
-
7
- .#{$class-prefix-safe-area} {
8
- height: 100%;
9
- display: block;
10
- width: 100%;
11
- box-sizing: border-box;
12
-
13
- &-position-top {
14
- padding-top: calc(env(safe-area-inset-top) * $safeAreaMultiple);
15
- }
16
-
17
- &-position-bottom {
18
- padding-bottom: calc(env(safe-area-inset-bottom) * $safeAreaMultiple);
19
- }
20
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $class-prefix-safe-area: 'triones-antm-safe-area';
4
+
5
+ $safeAreaMultiple : variable.$trionesSafeAreaMultiple;
6
+
7
+ .#{$class-prefix-safe-area} {
8
+ height: 100%;
9
+ display: block;
10
+ width: 100%;
11
+ box-sizing: border-box;
12
+
13
+ &-position-top {
14
+ padding-top: calc(env(safe-area-inset-top) * $safeAreaMultiple);
15
+ }
16
+
17
+ &-position-bottom {
18
+ padding-bottom: calc(env(safe-area-inset-bottom) * $safeAreaMultiple);
19
+ }
20
+ }
@@ -1,17 +1,17 @@
1
- @use "../style/variable" as variable;
2
-
3
-
4
- $trionesScaffoldCls: 'triones-antm-scaffold';
5
-
6
- .#{$trionesScaffoldCls} {
7
- height: 100%;
8
- width: 100%;
9
- display: flex;
10
- flex-direction: column;
11
- background-color: variable.$trionesColorBgScaffold;
12
-
13
- &-body {
14
- flex: 1 auto;
15
- overflow: hidden;
16
- }
17
- }
1
+ @use "../style/variable" as variable;
2
+
3
+
4
+ $trionesScaffoldCls: 'triones-antm-scaffold';
5
+
6
+ .#{$trionesScaffoldCls} {
7
+ height: 100%;
8
+ width: 100%;
9
+ display: flex;
10
+ flex-direction: column;
11
+ background-color: variable.$trionesColorBgScaffold;
12
+
13
+ &-body {
14
+ flex: 1 auto;
15
+ overflow: hidden;
16
+ }
17
+ }
@@ -1,75 +1,75 @@
1
- @use "../style/variable" as variable;
2
-
3
- $class-prefix-segmented: 'triones-antm-segmented';
4
-
5
- .#{$class-prefix-segmented} {
6
- display: inline-flex;
7
- flex-direction: row;
8
- align-items: stretch;
9
- box-sizing: border-box;
10
- padding: 2Px;
11
- border-radius: variable.$trionesBorderRadius;
12
- background: variable.$trionesColorFillTertiary;
13
- gap: 0;
14
-
15
- &-block {
16
- display: flex;
17
- width: 100%;
18
- }
19
-
20
- &-disabled {
21
- opacity: 0.45;
22
- pointer-events: none;
23
- }
24
-
25
- &-item {
26
- position: relative;
27
- z-index: 0;
28
- display: inline-flex;
29
- flex: 0 1 auto;
30
- align-items: center;
31
- justify-content: center;
32
- min-height: 10Px;
33
- padding: 0Px 11Px;
34
- font-size: variable.$trionesFontSize;
35
- line-height: variable.$trionesLineHeightSm;
36
- color: variable.$trionesColorTextSecondary;
37
- border-radius: variable.$trionesBorderRadiusXs;
38
- cursor: pointer;
39
- user-select: none;
40
- transition:
41
- color 0.2s,
42
- background-color 0.2s,
43
- box-shadow 0.2s;
44
-
45
- &-icon {
46
- display: inline-flex;
47
- margin-inline-end: 4Px;
48
- font-size: variable.$trionesFontSizeIcon;
49
- line-height: 1;
50
- }
51
-
52
- &-label {
53
- display: inline-flex;
54
- align-items: center;
55
- line-height: 28Px;
56
- }
57
-
58
- &-active {
59
- z-index: 1;
60
- color: variable.$trionesColorTextHeading;
61
- background: variable.$trionesColorBgBase;
62
- box-shadow: 0 1Px 2Px rgba(0, 0, 0, 0.06);
63
- }
64
-
65
- &-disabled {
66
- cursor: not-allowed;
67
- color: variable.$trionesColorTextDisabled;
68
- }
69
- }
70
-
71
- &-block &-item {
72
- flex: 1 1 0;
73
- min-width: 0;
74
- }
75
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $class-prefix-segmented: 'triones-antm-segmented';
4
+
5
+ .#{$class-prefix-segmented} {
6
+ display: inline-flex;
7
+ flex-direction: row;
8
+ align-items: stretch;
9
+ box-sizing: border-box;
10
+ padding: 2Px;
11
+ border-radius: variable.$trionesBorderRadius;
12
+ background: variable.$trionesColorFillTertiary;
13
+ gap: 0;
14
+
15
+ &-block {
16
+ display: flex;
17
+ width: 100%;
18
+ }
19
+
20
+ &-disabled {
21
+ opacity: 0.45;
22
+ pointer-events: none;
23
+ }
24
+
25
+ &-item {
26
+ position: relative;
27
+ z-index: 0;
28
+ display: inline-flex;
29
+ flex: 0 1 auto;
30
+ align-items: center;
31
+ justify-content: center;
32
+ min-height: 10Px;
33
+ padding: 0Px 11Px;
34
+ font-size: variable.$trionesFontSize;
35
+ line-height: variable.$trionesLineHeightSm;
36
+ color: variable.$trionesColorTextSecondary;
37
+ border-radius: variable.$trionesBorderRadiusXs;
38
+ cursor: pointer;
39
+ user-select: none;
40
+ transition:
41
+ color 0.2s,
42
+ background-color 0.2s,
43
+ box-shadow 0.2s;
44
+
45
+ &-icon {
46
+ display: inline-flex;
47
+ margin-inline-end: 4Px;
48
+ font-size: variable.$trionesFontSizeIcon;
49
+ line-height: 1;
50
+ }
51
+
52
+ &-label {
53
+ display: inline-flex;
54
+ align-items: center;
55
+ line-height: 28Px;
56
+ }
57
+
58
+ &-active {
59
+ z-index: 1;
60
+ color: variable.$trionesColorTextHeading;
61
+ background: variable.$trionesColorBgBase;
62
+ box-shadow: 0 1Px 2Px rgba(0, 0, 0, 0.06);
63
+ }
64
+
65
+ &-disabled {
66
+ cursor: not-allowed;
67
+ color: variable.$trionesColorTextDisabled;
68
+ }
69
+ }
70
+
71
+ &-block &-item {
72
+ flex: 1 1 0;
73
+ min-width: 0;
74
+ }
75
+ }
@@ -1,27 +1,86 @@
1
- import React from 'react';
1
+ import type { CSSProperties, FC, ReactNode } from 'react';
2
2
  import './style.scss';
3
- export interface SkeletonProps {
4
- /** 是否显示骨架屏 */
3
+ export type SkeletonAvatarShape = 'circle' | 'square';
4
+ export type SkeletonAvatarSize = 'small' | 'medium' | 'large';
5
+ export interface SkeletonAvatarProps {
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ shape?: SkeletonAvatarShape;
9
+ size?: SkeletonAvatarSize | number;
10
+ active?: boolean;
11
+ }
12
+ export interface SkeletonTitleProps {
13
+ className?: string;
14
+ style?: CSSProperties;
15
+ width?: number | string;
16
+ active?: boolean;
17
+ }
18
+ export interface SkeletonParagraphProps {
19
+ className?: string;
20
+ style?: CSSProperties;
21
+ rows?: number;
22
+ /** 单行宽度;数组时为每行宽度,与 antd 一致 */
23
+ width?: number | string | Array<number | string>;
24
+ active?: boolean;
25
+ }
26
+ export interface SkeletonInputProps {
27
+ className?: string;
28
+ style?: CSSProperties;
29
+ size?: 'small' | 'medium' | 'large';
30
+ active?: boolean;
31
+ }
32
+ export type SkeletonButtonShape = 'default' | 'square' | 'round' | 'circle';
33
+ export interface SkeletonButtonProps {
34
+ className?: string;
35
+ style?: CSSProperties;
36
+ size?: 'small' | 'medium' | 'large';
37
+ shape?: SkeletonButtonShape;
38
+ block?: boolean;
39
+ active?: boolean;
40
+ }
41
+ /** 简单块模式:与历史 API 兼容 */
42
+ export type SkeletonBlockType = 'text' | 'circle' | 'rect';
43
+ export type SkeletonProps = {
44
+ /** 为 true 时显示骨架,为 false 时渲染子节点 */
5
45
  loading?: boolean;
6
- /** 骨架屏类型:text, circle, rect */
7
- type?: 'text' | 'circle' | 'rect';
8
- /** 宽度 */
46
+ /** 是否展示扫光动画,对应 antd `active` */
47
+ active?: boolean;
48
+ /** `active`,兼容旧属性 */
49
+ animated?: boolean;
50
+ /** 标题占位 */
51
+ title?: boolean | SkeletonTitleProps;
52
+ /** 段落占位 */
53
+ paragraph?: boolean | SkeletonParagraphProps;
54
+ /** 左侧头像占位 */
55
+ avatar?: boolean | SkeletonAvatarProps;
56
+ /** 标题与段落是否使用大圆角 */
57
+ round?: boolean;
58
+ className?: string;
59
+ style?: CSSProperties;
60
+ children?: ReactNode;
61
+ /**
62
+ * `composed`:标题+段落组合(默认,对齐 [antd Skeleton](https://ant.design/components/skeleton-cn));可配合 `avatar`
63
+ * `block`:单行/单块占位(兼容历史 `type` + `rows`)
64
+ */
65
+ mode?: 'composed' | 'block';
66
+ /** 仅在 mode=block 时生效 */
67
+ type?: SkeletonBlockType;
9
68
  width?: string | number;
10
- /** 高度 */
11
69
  height?: string | number;
12
- /** 圆角大小,仅在type为circle时生效 */
13
70
  radius?: string | number;
14
- /** 显示多行文本骨架,仅在type为text时生效 */
15
71
  rows?: number;
16
- /** 是否显示动画效果 */
17
- animated?: boolean;
18
- /** 自定义样式类名 */
19
- className?: string;
20
- /** 自定义内联样式 */
21
- style?: React.CSSProperties;
22
- /** 子元素 */
23
- children?: React.ReactNode;
24
- /** 是否是圆角矩形 */
25
- round?: boolean;
26
- }
27
- export declare const Skeleton: React.FC<SkeletonProps>;
72
+ };
73
+ export declare const SkeletonAvatar: FC<SkeletonAvatarProps>;
74
+ export declare const SkeletonTitle: FC<SkeletonTitleProps>;
75
+ export declare const SkeletonParagraph: FC<SkeletonParagraphProps>;
76
+ export declare const SkeletonInput: FC<SkeletonInputProps>;
77
+ export declare const SkeletonButton: FC<SkeletonButtonProps>;
78
+ type CompoundedSkeleton = FC<SkeletonProps> & {
79
+ Avatar: typeof SkeletonAvatar;
80
+ Title: typeof SkeletonTitle;
81
+ Paragraph: typeof SkeletonParagraph;
82
+ Input: typeof SkeletonInput;
83
+ Button: typeof SkeletonButton;
84
+ };
85
+ export declare const Skeleton: CompoundedSkeleton;
86
+ export {};