@trionesdev/antd-mobile-base-react 0.0.2-beta.2 → 0.0.2-beta.21

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 (226) hide show
  1. package/dist/Alert/alert.js +1 -1
  2. package/dist/Alert/style.scss +17 -17
  3. package/dist/Avatar/avatar.d.ts +4 -1
  4. package/dist/Avatar/avatar.js +19 -6
  5. package/dist/Avatar/style.scss +3 -2
  6. package/dist/Card/style.scss +12 -12
  7. package/dist/CascaderView/cascader-column-item.js +1 -1
  8. package/dist/CascaderView/style.scss +2 -2
  9. package/dist/Cell/CellGroup.js +53 -14
  10. package/dist/Cell/cell.js +52 -15
  11. package/dist/Cell/context.d.ts +19 -0
  12. package/dist/Cell/context.js +2 -0
  13. package/dist/Cell/styles.scss +42 -13
  14. package/dist/Cell/types.d.ts +30 -7
  15. package/dist/Checkbox/checkbox-button.d.ts +6 -2
  16. package/dist/Checkbox/checkbox-button.js +6 -18
  17. package/dist/Checkbox/checkbox-group.js +19 -4
  18. package/dist/Checkbox/checkbox-round.d.ts +8 -0
  19. package/dist/Checkbox/checkbox-round.js +35 -0
  20. package/dist/Checkbox/checkbox.js +49 -34
  21. package/dist/Checkbox/index.d.ts +0 -2
  22. package/dist/Checkbox/index.js +0 -2
  23. package/dist/Checkbox/index.scss +48 -34
  24. package/dist/Checkbox/types.d.ts +11 -1
  25. package/dist/ConfigProvider/config-provider.d.ts +1 -0
  26. package/dist/Descriptions/style.scss +4 -4
  27. package/dist/Divider/divider.d.ts +1 -1
  28. package/dist/Divider/divider.js +5 -3
  29. package/dist/Divider/style.scss +7 -7
  30. package/dist/Form/ErrorList.d.ts +4 -0
  31. package/dist/Form/ErrorList.js +9 -0
  32. package/dist/Form/context.d.ts +5 -2
  33. package/dist/Form/context.js +2 -1
  34. package/dist/Form/form.d.ts +25 -12
  35. package/dist/Form/form.js +25 -13
  36. package/dist/Form/hooks/useForm.js +1 -8
  37. package/dist/Form/hooks/useFormContext.js +1 -2
  38. package/dist/Form/index.d.ts +8 -3
  39. package/dist/Form/index.js +7 -2
  40. package/dist/Form/styles.scss +11 -0
  41. package/dist/Form/types.d.ts +8 -0
  42. package/dist/FormCell/FormCell.d.ts +22 -0
  43. package/dist/FormCell/FormCell.js +57 -0
  44. package/dist/FormCell/index.d.ts +4 -0
  45. package/dist/FormCell/index.js +3 -0
  46. package/dist/FormCell/styles.scss +103 -0
  47. package/dist/IndexedStack/IndexedStack.d.ts +9 -0
  48. package/dist/IndexedStack/IndexedStack.js +27 -0
  49. package/dist/IndexedStack/index.d.ts +3 -0
  50. package/dist/IndexedStack/index.js +2 -0
  51. package/dist/InputNumber/input-number.d.ts +3 -2
  52. package/dist/InputNumber/input-number.js +48 -26
  53. package/dist/InputNumber/style.scss +79 -22
  54. package/dist/Loading/DotLoading.d.ts +7 -0
  55. package/dist/{Mask/mask-modal.js → Loading/DotLoading.js} +25 -25
  56. package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -1
  57. package/dist/Loading/SpinLoading.js +69 -0
  58. package/dist/Loading/index.d.ts +6 -0
  59. package/dist/Loading/index.js +4 -0
  60. package/dist/Loading/style.scss +113 -0
  61. package/dist/NavBar/nav-bar.d.ts +1 -0
  62. package/dist/NavBar/nav-bar.js +3 -2
  63. package/dist/NavBar/style.scss +7 -3
  64. package/dist/Progress/Progress.d.ts +39 -0
  65. package/dist/Progress/Progress.js +56 -0
  66. package/dist/Progress/ProgressCircle.d.ts +15 -0
  67. package/dist/Progress/ProgressCircle.js +117 -0
  68. package/dist/Progress/ProgressLine.d.ts +15 -0
  69. package/dist/Progress/ProgressLine.js +87 -0
  70. package/dist/Progress/index.d.ts +3 -0
  71. package/dist/Progress/index.js +2 -0
  72. package/dist/Progress/style.scss +33 -0
  73. package/dist/Progress/types.d.ts +6 -0
  74. package/dist/Progress/types.js +2 -0
  75. package/dist/Radio/RadioGroup.js +3 -3
  76. package/dist/Radio/radio.js +1 -1
  77. package/dist/Radio/style.scss +40 -24
  78. package/dist/Radio/types.d.ts +6 -4
  79. package/dist/Rate/rate.js +1 -1
  80. package/dist/Result/use-result-icon.js +1 -1
  81. package/dist/SafeArea/style.scss +5 -3
  82. package/dist/Scaffold/style.scss +2 -1
  83. package/dist/Segmented/Segmented.d.ts +57 -0
  84. package/dist/Segmented/Segmented.js +82 -0
  85. package/dist/Segmented/index.d.ts +2 -0
  86. package/dist/Segmented/index.js +1 -0
  87. package/dist/Segmented/style.scss +75 -0
  88. package/dist/Skeleton/Skeleton.d.ts +86 -0
  89. package/dist/Skeleton/Skeleton.js +263 -0
  90. package/dist/Skeleton/index.d.ts +3 -0
  91. package/dist/Skeleton/index.js +2 -0
  92. package/dist/Skeleton/style.scss +215 -0
  93. package/dist/Space/space.d.ts +1 -0
  94. package/dist/Space/space.js +20 -6
  95. package/dist/Space/style.scss +27 -3
  96. package/dist/Stepper/index.d.ts +3 -0
  97. package/dist/Stepper/index.js +2 -0
  98. package/dist/Stepper/stepper.d.ts +14 -0
  99. package/dist/Stepper/stepper.js +92 -0
  100. package/dist/Stepper/style.scss +100 -0
  101. package/dist/Steps/HorizontalSteps.js +10 -3
  102. package/dist/Steps/VerticalSteps.js +5 -2
  103. package/dist/Steps/style.scss +7 -0
  104. package/dist/Steps/types.d.ts +2 -0
  105. package/dist/Switch/style.scss +6 -7
  106. package/dist/Switch/switch.d.ts +2 -0
  107. package/dist/Switch/switch.js +6 -5
  108. package/dist/TabBar/index.js +2 -1
  109. package/dist/TabBar/index.scss +3 -2
  110. package/dist/Tabs/style.scss +5 -5
  111. package/dist/Tag/style.scss +45 -21
  112. package/dist/Tag/tag.d.ts +4 -1
  113. package/dist/Tag/tag.js +8 -2
  114. package/dist/index.d.ts +17 -26
  115. package/dist/index.js +8 -13
  116. package/dist/style/css-variable.scss +6 -0
  117. package/dist/style/style.scss +2 -2
  118. package/dist/style/variable.scss +176 -164
  119. package/dist/types.d.ts +10 -1
  120. package/package.json +5 -8
  121. package/dist/ActionSheet/ActionSheet.d.ts +0 -25
  122. package/dist/ActionSheet/ActionSheet.js +0 -77
  123. package/dist/ActionSheet/index.d.ts +0 -3
  124. package/dist/ActionSheet/index.js +0 -2
  125. package/dist/ActionSheet/style.scss +0 -51
  126. package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
  127. package/dist/CascaderPicker/cascader-picker.js +0 -88
  128. package/dist/CascaderPicker/index.d.ts +0 -3
  129. package/dist/CascaderPicker/index.js +0 -2
  130. package/dist/CascaderPicker/style.scss +0 -42
  131. package/dist/Form/FormItem/form-item-input.d.ts +0 -15
  132. package/dist/Form/FormItem/form-item-input.js +0 -39
  133. package/dist/Form/FormItem/form-item-label.d.ts +0 -13
  134. package/dist/Form/FormItem/form-item-label.js +0 -25
  135. package/dist/Form/FormItem/form-item.d.ts +0 -21
  136. package/dist/Form/FormItem/form-item.js +0 -70
  137. package/dist/Form/FormItem/index.d.ts +0 -5
  138. package/dist/Form/FormItem/index.js +0 -3
  139. package/dist/Form/style.scss +0 -45
  140. package/dist/Input/base-input.d.ts +0 -14
  141. package/dist/Input/base-input.js +0 -63
  142. package/dist/Input/index.d.ts +0 -12
  143. package/dist/Input/index.js +0 -9
  144. package/dist/Input/index.scss +0 -173
  145. package/dist/Input/input-affix-wrapper.d.ts +0 -8
  146. package/dist/Input/input-affix-wrapper.js +0 -50
  147. package/dist/Input/input-opt.d.ts +0 -16
  148. package/dist/Input/input-opt.js +0 -93
  149. package/dist/Input/input-password.d.ts +0 -7
  150. package/dist/Input/input-password.js +0 -47
  151. package/dist/Input/input.d.ts +0 -15
  152. package/dist/Input/input.js +0 -47
  153. package/dist/Input/textarea.d.ts +0 -13
  154. package/dist/Input/textarea.js +0 -45
  155. package/dist/Input/types.d.ts +0 -1
  156. package/dist/Input/types.js +0 -1
  157. package/dist/Mask/index.d.ts +0 -3
  158. package/dist/Mask/index.js +0 -2
  159. package/dist/Mask/mask-modal.d.ts +0 -45
  160. package/dist/Mask/mask.d.ts +0 -5
  161. package/dist/Mask/mask.js +0 -19
  162. package/dist/Mask/style.scss +0 -20
  163. package/dist/Picker/index.d.ts +0 -3
  164. package/dist/Picker/index.js +0 -2
  165. package/dist/Picker/picker.d.ts +0 -19
  166. package/dist/Picker/picker.js +0 -97
  167. package/dist/Picker/style.scss +0 -41
  168. package/dist/PickerView/index.d.ts +0 -4
  169. package/dist/PickerView/index.js +0 -2
  170. package/dist/PickerView/picker-view-column-item.d.ts +0 -7
  171. package/dist/PickerView/picker-view-column-item.js +0 -11
  172. package/dist/PickerView/picker-view-column.d.ts +0 -10
  173. package/dist/PickerView/picker-view-column.js +0 -117
  174. package/dist/PickerView/picker-view.d.ts +0 -12
  175. package/dist/PickerView/picker-view.js +0 -60
  176. package/dist/PickerView/style.scss +0 -72
  177. package/dist/PickerView/types.d.ts +0 -4
  178. package/dist/Popup/index.d.ts +0 -3
  179. package/dist/Popup/index.js +0 -2
  180. package/dist/Popup/popup-modal.d.ts +0 -52
  181. package/dist/Popup/popup-modal.js +0 -74
  182. package/dist/Popup/popup.d.ts +0 -4
  183. package/dist/Popup/popup.js +0 -56
  184. package/dist/Popup/style.scss +0 -53
  185. package/dist/ScrollView/index.d.ts +0 -4
  186. package/dist/ScrollView/index.js +0 -2
  187. package/dist/ScrollView/scroll-view.d.ts +0 -4
  188. package/dist/ScrollView/scroll-view.js +0 -55
  189. package/dist/ScrollView/style.scss +0 -19
  190. package/dist/ScrollView/types.d.ts +0 -26
  191. package/dist/ScrollView/types.js +0 -1
  192. package/dist/SideBar/SideBarContext.d.ts +0 -18
  193. package/dist/SideBar/SideBarContext.js +0 -2
  194. package/dist/SideBar/index.d.ts +0 -3
  195. package/dist/SideBar/index.js +0 -2
  196. package/dist/SideBar/side-bar.d.ts +0 -25
  197. package/dist/SideBar/side-bar.js +0 -351
  198. package/dist/SideBar/style.scss +0 -85
  199. package/dist/SideBar/types.d.ts +0 -7
  200. package/dist/SideBar/types.js +0 -1
  201. package/dist/SpinLoading/demo/base.d.ts +0 -3
  202. package/dist/SpinLoading/demo/base.js +0 -21
  203. package/dist/SpinLoading/index.d.ts +0 -3
  204. package/dist/SpinLoading/index.js +0 -2
  205. package/dist/SpinLoading/spin-loading.js +0 -59
  206. package/dist/SpinLoading/spin-loading.scss +0 -40
  207. package/dist/Tabs/demo/base.d.ts +0 -3
  208. package/dist/Tabs/demo/base.js +0 -59
  209. package/dist/Tag/demo/base.d.ts +0 -7
  210. package/dist/Tag/demo/base.js +0 -67
  211. package/dist/Tag/demo/style.scss +0 -8
  212. package/dist/Toast/index.d.ts +0 -5
  213. package/dist/Toast/index.js +0 -3
  214. package/dist/Toast/style.scss +0 -63
  215. package/dist/Toast/toast-modal.d.ts +0 -18
  216. package/dist/Toast/toast-modal.js +0 -112
  217. package/dist/Toast/toast.d.ts +0 -7
  218. package/dist/Toast/toast.js +0 -78
  219. package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
  220. package/dist/VerificationCodeInput/demo/base.js +0 -11
  221. package/dist/VerificationCodeInput/index.d.ts +0 -3
  222. package/dist/VerificationCodeInput/index.js +0 -2
  223. package/dist/VerificationCodeInput/style.scss +0 -20
  224. package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
  225. package/dist/VerificationCodeInput/verification-code-input.js +0 -99
  226. /package/dist/{PickerView → Form}/types.js +0 -0
@@ -0,0 +1,117 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React, { memo, useMemo } from "react";
8
+ import { exceptionColor, successColor } from "./types";
9
+ import classNames from "classnames";
10
+ import { CheckOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
11
+ export var ProgressCircle = /*#__PURE__*/memo(function (_ref) {
12
+ var format = _ref.format,
13
+ _ref$percent = _ref.percent,
14
+ percent = _ref$percent === void 0 ? 0 : _ref$percent,
15
+ _ref$strokeWidth = _ref.strokeWidth,
16
+ strokeWidth = _ref$strokeWidth === void 0 ? 6 : _ref$strokeWidth,
17
+ _ref$size = _ref.size,
18
+ size = _ref$size === void 0 ? 'middle' : _ref$size,
19
+ _ref$showInfo = _ref.showInfo,
20
+ showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
21
+ _ref$railColor = _ref.railColor,
22
+ railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
23
+ _ref$strokeColor = _ref.strokeColor,
24
+ strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
25
+ _ref$strokeLineCap = _ref.strokeLineCap,
26
+ strokeLineCap = _ref$strokeLineCap === void 0 ? 'round' : _ref$strokeLineCap,
27
+ status = _ref.status;
28
+ var clsPrefix = 'triones-antm-progress-circle';
29
+ var computedDiameter = useMemo(function () {
30
+ switch (size) {
31
+ case 'small':
32
+ return 50;
33
+ case 'medium':
34
+ return 100;
35
+ case 'large':
36
+ return 150;
37
+ default:
38
+ if (typeof size === 'number') {
39
+ return size;
40
+ }
41
+ return 50;
42
+ }
43
+ }, [size]);
44
+ var style = {
45
+ width: computedDiameter,
46
+ height: computedDiameter
47
+ };
48
+ var computedIconSize = function computedIconSize() {
49
+ var iconSize = (computedDiameter - strokeWidth) / 2 / 3;
50
+ if (iconSize < 24) {
51
+ return 24;
52
+ }
53
+ return iconSize;
54
+ };
55
+ var computePercentSize = function computePercentSize() {
56
+ var percentSize = (computedDiameter - strokeWidth) / 2 / 3;
57
+ if (percentSize < 10) {
58
+ return 10;
59
+ }
60
+ return percentSize || 10;
61
+ };
62
+ var handleIndicator = function handleIndicator() {
63
+ var iconSize = computedIconSize();
64
+ var percentSize = computePercentSize();
65
+ var indicatorColor = '#333';
66
+ if (status === 'exception') {
67
+ indicatorColor = exceptionColor;
68
+ }
69
+ if (percent >= 100) {
70
+ indicatorColor = successColor;
71
+ }
72
+ if (format) {
73
+ return /*#__PURE__*/React.createElement("div", {
74
+ style: {
75
+ color: indicatorColor,
76
+ fontSize: percentSize
77
+ }
78
+ }, format(percent));
79
+ }
80
+ if (status === 'exception') {
81
+ return /*#__PURE__*/React.createElement(CloseOutline, {
82
+ style: {
83
+ color: indicatorColor,
84
+ fontSize: iconSize
85
+ }
86
+ });
87
+ }
88
+ if (percent >= 100) {
89
+ return /*#__PURE__*/React.createElement(CheckOutline, {
90
+ style: {
91
+ color: indicatorColor,
92
+ fontSize: iconSize
93
+ }
94
+ });
95
+ }
96
+ return /*#__PURE__*/React.createElement("div", {
97
+ style: {
98
+ color: indicatorColor,
99
+ fontSize: percentSize
100
+ }
101
+ }, percent, "%");
102
+ };
103
+ var radius = (computedDiameter - strokeWidth) / 2;
104
+ var circumference = 2 * Math.PI * radius; // 圆周长
105
+
106
+ // 计算偏移量:(1 - 比例) * 周长
107
+ var offset = circumference - percent / 100 * circumference;
108
+ var svg = "<svg xmlns='http://www.w3.org/2000/svg' width=\"".concat(computedDiameter, "\" height=\"").concat(computedDiameter, "\">\n <circle\n cx=\"").concat(computedDiameter / 2, "\"\n cy=\"").concat(computedDiameter / 2, "\"\n r=\"").concat(radius, "\"\n stroke=\"#e5e7eb\"\n stroke-width=\"").concat(strokeWidth, "\"\n fill=\"transparent\"\n />\n <circle\n cx=\"").concat(computedDiameter / 2, "\"\n cy=\"").concat(computedDiameter / 2, "\"\n r=\"").concat(radius, "\"\n stroke=\"").concat(strokeColor, "\"\n stroke-width=\"").concat(strokeWidth, "\"\n fill=\"transparent\"\n stroke-dasharray=\"").concat(circumference, "\"\n stroke-dashoffset=\"").concat(offset, "\"\n stroke-linecap=\"").concat(strokeLineCap, "\"\n transform=\"rotate(-90, ").concat(computedDiameter / 2, ", ").concat(computedDiameter / 2, ")\"\n />\n</svg>");
109
+ return /*#__PURE__*/React.createElement("div", {
110
+ className: classNames("".concat(clsPrefix)),
111
+ style: _objectSpread(_objectSpread({}, style), {}, {
112
+ backgroundImage: "url(\"data:image/svg+xml,".concat(encodeURIComponent(svg), "\")")
113
+ })
114
+ }, showInfo && computedDiameter > 20 && /*#__PURE__*/React.createElement("div", {
115
+ className: "".concat(clsPrefix, "-indicator")
116
+ }, handleIndicator()));
117
+ });
@@ -0,0 +1,15 @@
1
+ import { Size } from "./types";
2
+ import { FC } from "react";
3
+ import { PercentPositionAlign, ProgressStatus } from "./types";
4
+ type ProgressLineProps = {
5
+ format?: (percent: number) => string;
6
+ percent?: number;
7
+ size?: Size;
8
+ showInfo?: boolean;
9
+ railColor?: string;
10
+ strokeColor?: string;
11
+ status?: ProgressStatus;
12
+ percentPositionAlign?: PercentPositionAlign;
13
+ };
14
+ export declare const ProgressLine: FC<ProgressLineProps>;
15
+ export {};
@@ -0,0 +1,87 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import { exceptionColor, successColor } from "./types";
4
+ import { CloseCircleFill, CheckCircleFill } from "@trionesdev/antd-mobile-icons-react";
5
+ export var ProgressLine = function ProgressLine(_ref) {
6
+ var format = _ref.format,
7
+ _ref$percent = _ref.percent,
8
+ percent = _ref$percent === void 0 ? 0 : _ref$percent,
9
+ _ref$size = _ref.size,
10
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
11
+ _ref$showInfo = _ref.showInfo,
12
+ showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
13
+ _ref$railColor = _ref.railColor,
14
+ railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
15
+ _ref$strokeColor = _ref.strokeColor,
16
+ strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
17
+ status = _ref.status,
18
+ _ref$percentPositionA = _ref.percentPositionAlign,
19
+ percentPositionAlign = _ref$percentPositionA === void 0 ? 'end' : _ref$percentPositionA;
20
+ var clsPrefix = 'triones-antm-progress-line';
21
+ var handleComputeLineHeight = function handleComputeLineHeight() {
22
+ switch (size) {
23
+ case 'small':
24
+ return 6;
25
+ case 'medium':
26
+ return 8;
27
+ case 'large':
28
+ return 12;
29
+ default:
30
+ return size || 8;
31
+ }
32
+ };
33
+ var handleComputeInfoHeight = function handleComputeInfoHeight() {
34
+ var lineHeight = handleComputeLineHeight();
35
+ if (lineHeight <= 8) {
36
+ return 12;
37
+ } else if (lineHeight <= 12) {
38
+ return 14;
39
+ } else {
40
+ return 16;
41
+ }
42
+ };
43
+ var handleIndicator = function handleIndicator() {
44
+ if (format) {
45
+ return /*#__PURE__*/React.createElement("div", null, format(percent));
46
+ }
47
+ if (status === 'exception') {
48
+ return /*#__PURE__*/React.createElement(CloseCircleFill, {
49
+ style: {
50
+ color: exceptionColor,
51
+ fontSize: handleComputeInfoHeight()
52
+ }
53
+ });
54
+ }
55
+ if (percent >= 100) {
56
+ return /*#__PURE__*/React.createElement(CheckCircleFill, {
57
+ style: {
58
+ color: successColor,
59
+ fontSize: handleComputeInfoHeight()
60
+ }
61
+ });
62
+ }
63
+ return /*#__PURE__*/React.createElement("div", {
64
+ style: {
65
+ fontSize: handleComputeInfoHeight()
66
+ }
67
+ }, percent, "%");
68
+ };
69
+ var info = /*#__PURE__*/React.createElement("div", {
70
+ className: classNames("".concat(clsPrefix, "-indicator"))
71
+ }, handleIndicator());
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ className: classNames(clsPrefix)
74
+ }, showInfo && percentPositionAlign === 'start' && info, /*#__PURE__*/React.createElement("div", {
75
+ className: classNames("".concat(clsPrefix, "-rail")),
76
+ style: {
77
+ backgroundColor: railColor
78
+ }
79
+ }, /*#__PURE__*/React.createElement("div", {
80
+ className: classNames("".concat(clsPrefix, "-track")),
81
+ style: {
82
+ width: "".concat(percent, "%"),
83
+ backgroundColor: strokeColor,
84
+ height: handleComputeLineHeight()
85
+ }
86
+ })), showInfo && percentPositionAlign === 'end' && info);
87
+ };
@@ -0,0 +1,3 @@
1
+ import { Progress, ProgressProps } from "./Progress";
2
+ export type { ProgressProps };
3
+ export default Progress;
@@ -0,0 +1,2 @@
1
+ import { Progress } from "./Progress";
2
+ export default Progress;
@@ -0,0 +1,33 @@
1
+ $progressLineCls: 'triones-antm-progress-line';
2
+ $progressCircleCls: 'triones-antm-progress-circle';
3
+
4
+ .#{$progressLineCls}{
5
+ width: 100%;
6
+ display: flex;
7
+ align-items: center;
8
+ gap: 4Px;
9
+ &-rail{
10
+ flex: 1 auto;
11
+ border-radius: 90Px;
12
+ }
13
+ &-track{
14
+ border-radius: 90Px;
15
+ }
16
+ &-indicator{}
17
+ }
18
+
19
+ .#{$progressCircleCls} {
20
+ position: relative;
21
+ &-indicator {
22
+ position: absolute;
23
+ inset-block-start: 50%;
24
+ inset-inline-start: 0;
25
+ width: 100%;
26
+ margin: 0;
27
+ padding: 0;
28
+ line-height: 1;
29
+ white-space: normal;
30
+ text-align: center;
31
+ transform: translatey(-50%);
32
+ }
33
+ }
@@ -0,0 +1,6 @@
1
+ import { AntSize } from "..";
2
+ export type Size = AntSize | number;
3
+ export type ProgressStatus = 'normal' | 'active' | 'success' | 'exception';
4
+ export type PercentPositionAlign = 'start' | 'end';
5
+ export declare const successColor = "#53C31B";
6
+ export declare const exceptionColor = "#FF4D4F";
@@ -0,0 +1,2 @@
1
+ export var successColor = "#53C31B";
2
+ export var exceptionColor = "#FF4D4F";
@@ -20,7 +20,7 @@ export var RadioGroup = function RadioGroup(_ref) {
20
20
  labelPosition = _ref$labelPosition === void 0 ? 'right' : _ref$labelPosition,
21
21
  _ref$direction = _ref.direction,
22
22
  direction = _ref$direction === void 0 ? 'horizontal' : _ref$direction,
23
- items = _ref.items;
23
+ options = _ref.options;
24
24
  var _useState = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : value),
25
25
  _useState2 = _slicedToArray(_useState, 2),
26
26
  internalValue = _useState2[0],
@@ -44,14 +44,14 @@ export var RadioGroup = function RadioGroup(_ref) {
44
44
  }
45
45
  }, shape === 'button' ? /*#__PURE__*/React.createElement("div", {
46
46
  className: classNames("".concat(classPrefix, "-button-group"))
47
- }, children || (items === null || items === void 0 ? void 0 : items.map(function (item) {
47
+ }, children || (options === null || options === void 0 ? void 0 : options.map(function (item) {
48
48
  return /*#__PURE__*/React.createElement(RadioButton, {
49
49
  key: item.value,
50
50
  value: item.value
51
51
  }, item.label);
52
52
  }))) : /*#__PURE__*/React.createElement("div", {
53
53
  className: classNames("".concat(classPrefix, "-group"), "".concat(classPrefix, "-group-").concat(direction))
54
- }, children || (items === null || items === void 0 ? void 0 : items.map(function (item) {
54
+ }, children || (options === null || options === void 0 ? void 0 : options.map(function (item) {
55
55
  return /*#__PURE__*/React.createElement(Radio, {
56
56
  key: item.value,
57
57
  value: item.value
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { CheckOutline } from "../../../antd-mobile-icons-react";
11
+ import { CheckOutline } from '@trionesdev/antd-mobile-icons-react';
12
12
  import classNames from 'classnames';
13
13
  import React, { useContext, useEffect, useMemo, useState } from 'react';
14
14
  import { RadioGroupContext } from "./GroupContext";
@@ -1,4 +1,4 @@
1
- @use "../style/variable" as *;
1
+ @use "../style/variable" as variable;
2
2
 
3
3
  $checkboxDisabledColor: rgba(0, 0, 0, 0.25) !default;
4
4
 
@@ -11,12 +11,17 @@ $class-prefix-radio: 'triones-antm-radio';
11
11
  gap: 8Px;
12
12
 
13
13
  .#{$class-prefix-radio} {
14
+ flex-shrink: 0;
14
15
  &-fake {
15
- width: 22PX;
16
- height: 22PX;
16
+ width: 20PX;
17
+ height: 20PX;
18
+ line-height: 0;
19
+ box-sizing: border-box;
20
+ overflow: hidden;
17
21
 
18
22
  .triones-antm-icon {
19
23
  //position: absolute;
24
+ font-size: variable.$trionesFontSize;
20
25
  }
21
26
 
22
27
  &-checked {
@@ -25,12 +30,17 @@ $class-prefix-radio: 'triones-antm-radio';
25
30
  display: inline-flex;
26
31
  justify-content: center;
27
32
  align-items: center;
28
- background-color: $trionesColorPrimary;
33
+ background-color: variable.$trionesColorPrimary;
29
34
  color: white;
30
35
  border-radius: 50vh;
31
36
  box-sizing: border-box;
32
37
  overflow: hidden;
33
38
 
39
+ .triones-antm-icon {
40
+ font-size: 14Px;
41
+ line-height: 1;
42
+ display: block;
43
+ }
34
44
  }
35
45
 
36
46
  &-unchecked {
@@ -40,14 +50,13 @@ $class-prefix-radio: 'triones-antm-radio';
40
50
  justify-content: center;
41
51
  align-items: center;
42
52
  border-radius: 50vh;
43
- border: 1PX solid $trionesBorderColor;
53
+ border: 1PX solid variable.$trionesBorderColor;
44
54
  box-sizing: border-box;
45
55
  }
46
56
 
47
57
  }
48
58
 
49
59
 
50
-
51
60
  &-label {
52
61
  flex: 1 auto;
53
62
  }
@@ -62,6 +71,7 @@ $class-prefix-radio: 'triones-antm-radio';
62
71
  background-color: $checkboxDisabledColor;
63
72
  }
64
73
  }
74
+
65
75
  &-block {
66
76
  width: 100%;
67
77
  }
@@ -71,12 +81,18 @@ $class-prefix-radio: 'triones-antm-radio';
71
81
 
72
82
 
73
83
  .#{$class-prefix-radio}-group {
74
- display: flex;
84
+
75
85
  gap: 8Px;
76
- &-horizontal{
86
+
87
+ &-horizontal {
88
+ display: inline-flex;
77
89
  flex-direction: row;
90
+ align-items: center;
91
+ vertical-align: middle;
78
92
  }
79
- &-vertical{
93
+
94
+ &-vertical {
95
+ display: flex;
80
96
  flex-direction: column;
81
97
  }
82
98
  }
@@ -88,36 +104,36 @@ $class-prefix-radio: 'triones-antm-radio';
88
104
  .#{$class-prefix-radio}-button-wrapper {
89
105
  display: inline-flex;
90
106
  position: relative;
91
- border-top: 1PX solid $trionesBorderColor;
92
- border-bottom: 1PX solid $trionesBorderColor;
93
- border-right: 1PX solid $trionesBorderColor;
107
+ border-top: 1PX solid variable.$trionesBorderColor;
108
+ border-bottom: 1PX solid variable.$trionesBorderColor;
109
+ border-right: 1PX solid variable.$trionesBorderColor;
94
110
 
95
111
  &:first-child {
96
- border-left: 1PX solid $trionesBorderColor;
97
- border-top-left-radius: $trionesBorderRadius;
98
- border-bottom-left-radius: $trionesBorderRadius;
112
+ border-left: 1PX solid variable.$trionesBorderColor;
113
+ border-top-left-radius: variable.$trionesBorderRadius;
114
+ border-bottom-left-radius: variable.$trionesBorderRadius;
99
115
  }
100
116
 
101
117
  &:last-child {
102
- border-right: 1PX solid $trionesBorderColor;
103
- border-top-right-radius: $trionesBorderRadius;
104
- border-bottom-right-radius: $trionesBorderRadius;
118
+ border-right: 1PX solid variable.$trionesBorderColor;
119
+ border-top-right-radius: variable.$trionesBorderRadius;
120
+ border-bottom-right-radius: variable.$trionesBorderRadius;
105
121
  }
106
122
 
107
123
  &-checked {
108
- border-top: 1PX solid $trionesColorPrimary;
109
- border-bottom: 1PX solid $trionesColorPrimary;
110
- color: $trionesColorPrimary;
124
+ border-top: 1PX solid variable.$trionesColorPrimary;
125
+ border-bottom: 1PX solid variable.$trionesColorPrimary;
126
+ color: variable.$trionesColorPrimary;
111
127
 
112
128
  &:first-child {
113
- border: 1PX solid $trionesColorPrimary;
129
+ border: 1PX solid variable.$trionesColorPrimary;
114
130
  }
115
131
 
116
132
  &:not(:first-child) {
117
133
  &::before {
118
134
  content: " ";
119
135
  width: 1PX;
120
- background-color: $trionesColorPrimary;
136
+ background-color: variable.$trionesColorPrimary;
121
137
  position: absolute;
122
138
  inset-block-start: -1Px;
123
139
  inset-inline-start: -1Px;
@@ -125,7 +141,7 @@ $class-prefix-radio: 'triones-antm-radio';
125
141
  padding-block: 1Px;
126
142
  }
127
143
 
128
- border-right: 1PX solid $trionesColorPrimary;
144
+ border-right: 1PX solid variable.$trionesColorPrimary;
129
145
  }
130
146
  }
131
147
 
@@ -41,6 +41,11 @@ export type RadioProps = {
41
41
  */
42
42
  onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
43
43
  };
44
+ export type RadioOptionProps = {
45
+ label?: React.ReactNode;
46
+ value?: any;
47
+ [key: string]: any;
48
+ };
44
49
  export interface RadioGroupProps {
45
50
  children?: ReactNode;
46
51
  className?: string;
@@ -51,8 +56,5 @@ export interface RadioGroupProps {
51
56
  shape?: 'button' | 'round';
52
57
  labelPosition?: 'left' | 'right';
53
58
  direction?: 'vertical' | 'horizontal';
54
- items?: {
55
- label: React.ReactNode;
56
- value: any;
57
- }[];
59
+ options?: RadioOptionProps[];
58
60
  }
package/dist/Rate/rate.js CHANGED
@@ -12,7 +12,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
12
12
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
13
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
- import { StarFill } from "../../../antd-mobile-icons-react";
15
+ import { StarFill } from '@trionesdev/antd-mobile-icons-react';
16
16
  import classNames from 'classnames';
17
17
  import React, { useState } from 'react';
18
18
  import { withNativeProps } from "../utils/native-props";
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import ConfigProvider from "../ConfigProvider";
3
- import { CheckCircleOutline, CloseCircleOutline, InformationCircleOutline, ClockCircleOutline, ExclamationTriangleOutline } from "../../../antd-mobile-icons-react";
3
+ import { CheckCircleOutline, CloseCircleOutline, InformationCircleOutline, ClockCircleOutline, ExclamationTriangleOutline } from '@trionesdev/antd-mobile-icons-react';
4
4
  export var useResultIcon = function useResultIcon(status) {
5
5
  var _ConfigProvider$useCo = ConfigProvider.useConfig(),
6
6
  _ConfigProvider$useCo2 = _ConfigProvider$useCo.result,
@@ -1,7 +1,9 @@
1
- @use "../style/variable" as *;
1
+ @use "../style/variable" as variable;
2
2
 
3
3
  $class-prefix-safe-area: 'triones-antm-safe-area';
4
4
 
5
+ $safeAreaMultiple : variable.$trionesSafeAreaMultiple;
6
+
5
7
  .#{$class-prefix-safe-area} {
6
8
  height: 100%;
7
9
  display: block;
@@ -9,10 +11,10 @@ $class-prefix-safe-area: 'triones-antm-safe-area';
9
11
  box-sizing: border-box;
10
12
 
11
13
  &-position-top {
12
- padding-top: calc(env(safe-area-inset-top) * $trionesSafeAreaMultiple);
14
+ padding-top: calc(env(safe-area-inset-top) * $safeAreaMultiple);
13
15
  }
14
16
 
15
17
  &-position-bottom {
16
- padding-bottom: calc(env(safe-area-inset-bottom) * $trionesSafeAreaMultiple);
18
+ padding-bottom: calc(env(safe-area-inset-bottom) * $safeAreaMultiple);
17
19
  }
18
20
  }
@@ -1,4 +1,4 @@
1
- @use "../style/variable" as *;
1
+ @use "../style/variable" as variable;
2
2
 
3
3
 
4
4
  $trionesScaffoldCls: 'triones-antm-scaffold';
@@ -8,6 +8,7 @@ $trionesScaffoldCls: 'triones-antm-scaffold';
8
8
  width: 100%;
9
9
  display: flex;
10
10
  flex-direction: column;
11
+ background-color: variable.$trionesColorBgScaffold;
11
12
 
12
13
  &-body {
13
14
  flex: 1 auto;
@@ -0,0 +1,57 @@
1
+ import React, { FC } from 'react';
2
+ import './style.scss';
3
+ type SegmentedItemType = {
4
+ /**
5
+ * @description 分段项的显示文本
6
+ */
7
+ label?: React.ReactNode;
8
+ /**
9
+ * @description 分段项的值
10
+ * @required
11
+ */
12
+ value?: string | number;
13
+ /**
14
+ * @description 分段项的图标
15
+ */
16
+ icon?: React.ReactNode;
17
+ /**
18
+ * @description 是否禁用
19
+ * @default false
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * @description 自定义样式类名
24
+ */
25
+ className?: string;
26
+ };
27
+ export type SegmentedProps = {
28
+ className?: string;
29
+ style?: React.CSSProperties;
30
+ /**
31
+ * @description 将宽度调整为父元素宽度的选项
32
+ * @default false
33
+ */
34
+ block?: boolean;
35
+ /**
36
+ * @description 是否禁用
37
+ * @default false
38
+ */
39
+ disabled?: boolean;
40
+ /**
41
+ * @description 默认选中的值
42
+ * @default undefined
43
+ */
44
+ defaultValue?: string | number;
45
+ /**
46
+ * @description 选项列表
47
+ * @required
48
+ */
49
+ options: SegmentedItemType[];
50
+ /**
51
+ * @description 当前选中的值
52
+ */
53
+ value?: string | number;
54
+ onChange?: (value: string | number) => void;
55
+ };
56
+ export declare const Segmented: FC<SegmentedProps>;
57
+ export {};