@rainbow-oh/yee-c 0.2.0 → 0.3.0

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 (218) hide show
  1. package/dist/cjs/Button/button.js +2 -2
  2. package/dist/cjs/Button/style/index.less +23 -8
  3. package/dist/cjs/Card/demo/collapsible.js +2 -1
  4. package/dist/cjs/Carousel/demo/arrows.js +1 -1
  5. package/dist/cjs/Carousel/demo/autoplay.js +1 -1
  6. package/dist/cjs/Carousel/demo/effect.js +1 -1
  7. package/dist/cjs/Carousel/demo/position.js +1 -1
  8. package/dist/cjs/Config-Provider/interface.d.ts +4 -0
  9. package/dist/cjs/Form/Field.js +32 -10
  10. package/dist/cjs/Form/interface.d.ts +17 -1
  11. package/dist/cjs/Menu/style/index.less +2 -2
  12. package/dist/cjs/Radio/demo/button.js +1 -0
  13. package/dist/cjs/Radio/interface.d.ts +4 -0
  14. package/dist/cjs/Radio/radio-group.js +28 -14
  15. package/dist/cjs/Radio/radio.js +3 -1
  16. package/dist/cjs/Radio/style/index.less +19 -5
  17. package/dist/cjs/Segmented/demo/basic.d.ts +3 -0
  18. package/dist/cjs/Segmented/demo/basic.js +51 -0
  19. package/dist/cjs/Segmented/demo/block.d.ts +3 -0
  20. package/dist/cjs/Segmented/demo/block.js +49 -0
  21. package/dist/cjs/Segmented/demo/disabled.d.ts +3 -0
  22. package/dist/cjs/Segmented/demo/disabled.js +47 -0
  23. package/dist/cjs/Segmented/demo/size.d.ts +3 -0
  24. package/dist/cjs/Segmented/demo/size.js +37 -0
  25. package/dist/cjs/Segmented/index.d.ts +3 -0
  26. package/dist/cjs/Segmented/index.js +36 -0
  27. package/dist/cjs/Segmented/interface.d.ts +82 -0
  28. package/dist/cjs/Segmented/interface.js +17 -0
  29. package/dist/cjs/Segmented/segmented.d.ts +5 -0
  30. package/dist/cjs/Segmented/segmented.js +177 -0
  31. package/dist/cjs/Segmented/style/index.less +104 -0
  32. package/dist/cjs/Spin/spin.js +2 -1
  33. package/dist/cjs/Steps/step.js +1 -1
  34. package/dist/cjs/Steps/style/index.less +8 -2
  35. package/dist/cjs/Switch/demo/content.js +22 -1
  36. package/dist/cjs/Switch/style/index.less +16 -0
  37. package/dist/cjs/Switch/switch.js +9 -2
  38. package/dist/cjs/Table/interface.d.ts +5 -1
  39. package/dist/cjs/Table/theader/cell.js +4 -5
  40. package/dist/cjs/Tag/demo/size.js +1 -1
  41. package/dist/cjs/Tag/style/index.less +1 -0
  42. package/dist/cjs/Tour/demo/basic.d.ts +3 -0
  43. package/dist/cjs/Tour/demo/basic.js +69 -0
  44. package/dist/cjs/Tour/demo/indicators.d.ts +3 -0
  45. package/dist/cjs/Tour/demo/indicators.js +76 -0
  46. package/dist/cjs/Tour/demo/placement.d.ts +3 -0
  47. package/dist/cjs/Tour/demo/placement.js +80 -0
  48. package/dist/cjs/Tour/demo/scroll.d.ts +3 -0
  49. package/dist/cjs/Tour/demo/scroll.js +72 -0
  50. package/dist/cjs/Tour/index.d.ts +3 -0
  51. package/dist/cjs/Tour/index.js +36 -0
  52. package/dist/cjs/Tour/interface.d.ts +118 -0
  53. package/dist/cjs/Tour/interface.js +17 -0
  54. package/dist/cjs/Tour/style/index.less +103 -0
  55. package/dist/cjs/Tour/tour.d.ts +5 -0
  56. package/dist/cjs/Tour/tour.js +403 -0
  57. package/dist/cjs/Tree/demo/checkable.js +6 -6
  58. package/dist/cjs/index.d.ts +4 -0
  59. package/dist/cjs/index.js +6 -0
  60. package/dist/cjs/locale/interface.d.ts +7 -0
  61. package/dist/cjs/locale/lang/en_US.js +6 -0
  62. package/dist/cjs/locale/lang/ja_JP.js +6 -0
  63. package/dist/cjs/locale/lang/zh_CN.js +6 -0
  64. package/dist/cjs/locale/lang/zh_TW.js +6 -0
  65. package/dist/cjs/style/color.blue.css +1 -1
  66. package/dist/cjs/style/color.crimson.css +1 -1
  67. package/dist/cjs/style/color.css +18 -1
  68. package/dist/cjs/style/size.css +38 -0
  69. package/dist/cjs/style/themes.css +3 -3
  70. package/dist/cjs/style/variables.css +57 -2
  71. package/dist/cjs/version.d.ts +1 -1
  72. package/dist/cjs/version.js +1 -1
  73. package/dist/esm/Button/button.js +2 -2
  74. package/dist/esm/Button/style/index.less +23 -8
  75. package/dist/esm/Card/demo/collapsible.js +2 -1
  76. package/dist/esm/Carousel/demo/arrows.js +1 -1
  77. package/dist/esm/Carousel/demo/autoplay.js +1 -1
  78. package/dist/esm/Carousel/demo/effect.js +1 -1
  79. package/dist/esm/Carousel/demo/position.js +1 -1
  80. package/dist/esm/Config-Provider/interface.d.ts +4 -0
  81. package/dist/esm/Form/Field.js +11 -4
  82. package/dist/esm/Form/interface.d.ts +17 -1
  83. package/dist/esm/Menu/style/index.less +2 -2
  84. package/dist/esm/Radio/demo/button.js +1 -0
  85. package/dist/esm/Radio/interface.d.ts +4 -0
  86. package/dist/esm/Radio/radio-group.js +9 -2
  87. package/dist/esm/Radio/radio.js +3 -1
  88. package/dist/esm/Radio/style/index.less +19 -5
  89. package/dist/esm/Segmented/demo/basic.d.ts +3 -0
  90. package/dist/esm/Segmented/demo/basic.js +33 -0
  91. package/dist/esm/Segmented/demo/block.d.ts +3 -0
  92. package/dist/esm/Segmented/demo/block.js +29 -0
  93. package/dist/esm/Segmented/demo/disabled.d.ts +3 -0
  94. package/dist/esm/Segmented/demo/disabled.js +22 -0
  95. package/dist/esm/Segmented/demo/size.d.ts +3 -0
  96. package/dist/esm/Segmented/demo/size.js +15 -0
  97. package/dist/esm/Segmented/index.d.ts +3 -0
  98. package/dist/esm/Segmented/index.js +2 -0
  99. package/dist/esm/Segmented/interface.d.ts +82 -0
  100. package/dist/esm/Segmented/interface.js +1 -0
  101. package/dist/esm/Segmented/segmented.d.ts +5 -0
  102. package/dist/esm/Segmented/segmented.js +110 -0
  103. package/dist/esm/Segmented/style/index.less +104 -0
  104. package/dist/esm/Spin/spin.js +2 -1
  105. package/dist/esm/Steps/step.js +4 -1
  106. package/dist/esm/Steps/style/index.less +8 -2
  107. package/dist/esm/Switch/demo/content.js +12 -3
  108. package/dist/esm/Switch/style/index.less +16 -0
  109. package/dist/esm/Switch/switch.js +7 -5
  110. package/dist/esm/Table/interface.d.ts +5 -1
  111. package/dist/esm/Table/theader/cell.js +2 -3
  112. package/dist/esm/Tag/demo/size.js +6 -2
  113. package/dist/esm/Tag/style/index.less +1 -0
  114. package/dist/esm/Tour/demo/basic.d.ts +3 -0
  115. package/dist/esm/Tour/demo/basic.js +69 -0
  116. package/dist/esm/Tour/demo/indicators.d.ts +3 -0
  117. package/dist/esm/Tour/demo/indicators.js +73 -0
  118. package/dist/esm/Tour/demo/placement.d.ts +3 -0
  119. package/dist/esm/Tour/demo/placement.js +53 -0
  120. package/dist/esm/Tour/demo/scroll.d.ts +3 -0
  121. package/dist/esm/Tour/demo/scroll.js +58 -0
  122. package/dist/esm/Tour/index.d.ts +3 -0
  123. package/dist/esm/Tour/index.js +2 -0
  124. package/dist/esm/Tour/interface.d.ts +118 -0
  125. package/dist/esm/Tour/interface.js +1 -0
  126. package/dist/esm/Tour/style/index.less +103 -0
  127. package/dist/esm/Tour/tour.d.ts +5 -0
  128. package/dist/esm/Tour/tour.js +383 -0
  129. package/dist/esm/Tree/demo/checkable.js +6 -6
  130. package/dist/esm/index.d.ts +4 -0
  131. package/dist/esm/index.js +4 -0
  132. package/dist/esm/locale/interface.d.ts +7 -0
  133. package/dist/esm/locale/lang/en_US.js +6 -0
  134. package/dist/esm/locale/lang/ja_JP.js +6 -0
  135. package/dist/esm/locale/lang/zh_CN.js +6 -0
  136. package/dist/esm/locale/lang/zh_TW.js +6 -0
  137. package/dist/esm/style/color.blue.css +1 -1
  138. package/dist/esm/style/color.crimson.css +1 -1
  139. package/dist/esm/style/color.css +18 -1
  140. package/dist/esm/style/size.css +38 -0
  141. package/dist/esm/style/themes.css +3 -3
  142. package/dist/esm/style/variables.css +57 -2
  143. package/dist/esm/version.d.ts +1 -1
  144. package/dist/esm/version.js +1 -1
  145. package/dist/umd/yee-c.min.css +3 -3
  146. package/dist/umd/yee-c.min.js +1 -1
  147. package/package.json +1 -1
  148. package/src/Button/button.tsx +2 -2
  149. package/src/Button/style/index.less +23 -8
  150. package/src/Card/demo/collapsible.tsx +1 -0
  151. package/src/Carousel/demo/arrows.tsx +1 -1
  152. package/src/Carousel/demo/autoplay.tsx +1 -1
  153. package/src/Carousel/demo/effect.tsx +1 -1
  154. package/src/Carousel/demo/position.tsx +1 -1
  155. package/src/Config-Provider/index.en-US.md +2 -0
  156. package/src/Config-Provider/index.zh-CN.md +2 -0
  157. package/src/Config-Provider/interface.ts +4 -0
  158. package/src/Form/Field.tsx +30 -11
  159. package/src/Form/index.en-US.md +4 -0
  160. package/src/Form/index.zh-CN.md +4 -0
  161. package/src/Form/interface.ts +17 -1
  162. package/src/Menu/style/index.less +2 -2
  163. package/src/Radio/demo/button.tsx +1 -0
  164. package/src/Radio/index.en-US.md +2 -0
  165. package/src/Radio/index.zh-CN.md +2 -0
  166. package/src/Radio/interface.ts +4 -0
  167. package/src/Radio/radio-group.tsx +9 -1
  168. package/src/Radio/radio.tsx +2 -1
  169. package/src/Radio/style/index.less +19 -5
  170. package/src/Segmented/demo/basic.tsx +24 -0
  171. package/src/Segmented/demo/block.tsx +17 -0
  172. package/src/Segmented/demo/disabled.tsx +18 -0
  173. package/src/Segmented/demo/size.tsx +10 -0
  174. package/src/Segmented/index.en-US.md +47 -0
  175. package/src/Segmented/index.ts +12 -0
  176. package/src/Segmented/index.zh-CN.md +47 -0
  177. package/src/Segmented/interface.ts +87 -0
  178. package/src/Segmented/segmented.tsx +134 -0
  179. package/src/Segmented/style/index.less +104 -0
  180. package/src/Spin/spin.tsx +1 -0
  181. package/src/Steps/step.tsx +1 -1
  182. package/src/Steps/style/index.less +8 -2
  183. package/src/Switch/demo/content.tsx +15 -5
  184. package/src/Switch/style/index.less +16 -0
  185. package/src/Switch/switch.tsx +14 -6
  186. package/src/Table/index.en-US.md +1 -0
  187. package/src/Table/index.zh-CN.md +1 -0
  188. package/src/Table/interface.ts +5 -1
  189. package/src/Table/theader/cell.tsx +2 -9
  190. package/src/Tag/demo/size.tsx +2 -2
  191. package/src/Tag/style/index.less +1 -0
  192. package/src/Tour/demo/basic.tsx +52 -0
  193. package/src/Tour/demo/indicators.tsx +63 -0
  194. package/src/Tour/demo/placement.tsx +55 -0
  195. package/src/Tour/demo/scroll.tsx +49 -0
  196. package/src/Tour/index.en-US.md +61 -0
  197. package/src/Tour/index.ts +10 -0
  198. package/src/Tour/index.zh-CN.md +61 -0
  199. package/src/Tour/interface.ts +126 -0
  200. package/src/Tour/style/index.less +103 -0
  201. package/src/Tour/tour.tsx +399 -0
  202. package/src/Tree/demo/checkable.tsx +6 -6
  203. package/src/index.ts +6 -0
  204. package/src/locale/interface.ts +9 -0
  205. package/src/locale/lang/en_US.ts +7 -0
  206. package/src/locale/lang/ja_JP.ts +7 -0
  207. package/src/locale/lang/zh_CN.ts +7 -0
  208. package/src/locale/lang/zh_TW.ts +7 -0
  209. package/src/style/color.blue.css +1 -1
  210. package/src/style/color.crimson.css +1 -1
  211. package/src/style/color.css +18 -1
  212. package/src/style/size.css +38 -0
  213. package/src/version.ts +1 -1
  214. package/dist/cjs/utils/x.d.ts +0 -11
  215. package/dist/cjs/utils/x.js +0 -51
  216. package/dist/esm/utils/x.d.ts +0 -11
  217. package/dist/esm/utils/x.js +0 -49
  218. package/src/utils/x.ts +0 -33
@@ -0,0 +1,73 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { Button, Space, Tour } from "../..";
8
+ import React, { useRef, useState } from 'react';
9
+ export default (function () {
10
+ var _useState = useState(false),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ open = _useState2[0],
13
+ setOpen = _useState2[1];
14
+ var aRef = useRef(null);
15
+ var bRef = useRef(null);
16
+ return /*#__PURE__*/React.createElement(Space, {
17
+ direction: "vertical"
18
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement("div", {
19
+ ref: aRef,
20
+ style: {
21
+ display: 'inline-block'
22
+ }
23
+ }, /*#__PURE__*/React.createElement(Button, null, "\u5BFC\u5165")), /*#__PURE__*/React.createElement("div", {
24
+ ref: bRef,
25
+ style: {
26
+ display: 'inline-block'
27
+ }
28
+ }, /*#__PURE__*/React.createElement(Button, null, "\u7B5B\u9009")), /*#__PURE__*/React.createElement(Button, {
29
+ type: "primary",
30
+ onClick: function onClick() {
31
+ return setOpen(true);
32
+ }
33
+ }, "\u5F00\u59CB")), /*#__PURE__*/React.createElement(Tour, {
34
+ open: open,
35
+ onClose: function onClose() {
36
+ return setOpen(false);
37
+ },
38
+ onFinish: function onFinish() {
39
+ return setOpen(false);
40
+ },
41
+ indicatorsRender: function indicatorsRender(current, total) {
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, Array.from({
43
+ length: total
44
+ }).map(function (_, i) {
45
+ return /*#__PURE__*/React.createElement("span", {
46
+ key: i,
47
+ style: {
48
+ display: 'inline-block',
49
+ width: 8,
50
+ height: 8,
51
+ marginInlineEnd: 4,
52
+ borderRadius: '50%',
53
+ background: i === current ? 'var(--yee-primary-color)' : 'var(--yee-border-color)',
54
+ transition: 'background 0.2s'
55
+ }
56
+ });
57
+ }));
58
+ },
59
+ steps: [{
60
+ target: function target() {
61
+ return aRef.current;
62
+ },
63
+ title: '导入',
64
+ description: '点击此处导入数据文件。'
65
+ }, {
66
+ target: function target() {
67
+ return bRef.current;
68
+ },
69
+ title: '筛选',
70
+ description: '在这里筛选你需要的数据。'
71
+ }]
72
+ }));
73
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,53 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { Button, Space, Tour } from "../..";
8
+ import React, { useRef, useState } from 'react';
9
+ var placements = ['top', 'right', 'bottom', 'left'];
10
+ export default (function () {
11
+ var _useState = useState(false),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ open = _useState2[0],
14
+ setOpen = _useState2[1];
15
+ var _useState3 = useState('top'),
16
+ _useState4 = _slicedToArray(_useState3, 2),
17
+ p = _useState4[0],
18
+ setP = _useState4[1];
19
+ var targetRef = useRef(null);
20
+ return /*#__PURE__*/React.createElement(Space, {
21
+ direction: "vertical"
22
+ }, /*#__PURE__*/React.createElement(Space, null, placements.map(function (pl) {
23
+ return /*#__PURE__*/React.createElement(Button, {
24
+ key: pl,
25
+ type: p === pl ? 'primary' : 'default',
26
+ onClick: function onClick() {
27
+ setP(pl);
28
+ setOpen(true);
29
+ }
30
+ }, pl);
31
+ })), /*#__PURE__*/React.createElement("div", {
32
+ ref: targetRef,
33
+ style: {
34
+ display: 'inline-block',
35
+ padding: '16px 24px',
36
+ border: '1px dashed var(--yee-border-color)',
37
+ borderRadius: 6
38
+ }
39
+ }, "\u76EE\u6807\u5143\u7D20"), /*#__PURE__*/React.createElement(Tour, {
40
+ open: open,
41
+ placement: p,
42
+ onClose: function onClose() {
43
+ return setOpen(false);
44
+ },
45
+ steps: [{
46
+ target: function target() {
47
+ return targetRef.current;
48
+ },
49
+ title: "placement: ".concat(p),
50
+ description: '气泡卡片相对目标元素的位置;靠近视口边缘时会自动翻转。'
51
+ }]
52
+ }));
53
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,58 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { Button, Space, Tour } from "../..";
8
+ import React, { useRef, useState } from 'react';
9
+ export default (function () {
10
+ var _useState = useState(false),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ open = _useState2[0],
13
+ setOpen = _useState2[1];
14
+ var farRef = useRef(null);
15
+ return /*#__PURE__*/React.createElement(Space, {
16
+ direction: "vertical",
17
+ style: {
18
+ width: '100%'
19
+ }
20
+ }, /*#__PURE__*/React.createElement(Button, {
21
+ type: "primary",
22
+ onClick: function onClick() {
23
+ return setOpen(true);
24
+ }
25
+ }, "\u5F00\u59CB\u5F15\u5BFC\uFF08\u81EA\u52A8\u6EDA\u52A8\u5B9A\u4F4D\uFF09"), /*#__PURE__*/React.createElement("div", {
26
+ style: {
27
+ height: 600,
28
+ padding: 24,
29
+ background: 'var(--yee-color-bg-layout)',
30
+ borderRadius: 8,
31
+ color: '#999'
32
+ }
33
+ }, "\u2193 \u76EE\u6807\u5728\u4E0B\u65B9\uFF0C\u5207\u6362\u6B65\u9AA4\u65F6\u5F15\u5BFC\u4F1A\u81EA\u52A8\u6EDA\u52A8\u5B9A\u4F4D"), /*#__PURE__*/React.createElement("div", {
34
+ ref: farRef,
35
+ style: {
36
+ display: 'inline-block'
37
+ }
38
+ }, /*#__PURE__*/React.createElement(Button, null, "\u8FDC\u5904\u7684\u76EE\u6807")), /*#__PURE__*/React.createElement(Tour, {
39
+ open: open,
40
+ onClose: function onClose() {
41
+ return setOpen(false);
42
+ },
43
+ onFinish: function onFinish() {
44
+ return setOpen(false);
45
+ },
46
+ steps: [{
47
+ target: function target() {
48
+ return farRef.current;
49
+ },
50
+ title: '滚动定位',
51
+ description: '切换到这一步时,目标会自动滚动到视口内。'
52
+ }, {
53
+ target: '#tour-nonexistent-target',
54
+ title: '目标不存在',
55
+ description: '找不到目标元素时,卡片居中显示(无高亮)。'
56
+ }]
57
+ }));
58
+ });
@@ -0,0 +1,3 @@
1
+ import InternalTour from './tour';
2
+ export type { TourProps, TourStep, TourTarget, TourSemanticDOM, } from './interface';
3
+ export default InternalTour;
@@ -0,0 +1,2 @@
1
+ import InternalTour from "./tour";
2
+ export default InternalTour;
@@ -0,0 +1,118 @@
1
+ /// <reference types="react" />
2
+ import type { Placement } from '../Trigger/interface';
3
+ import type { DataAttributeProps } from '../utils/types';
4
+ export type TourTarget = (() => HTMLElement | null) | string | HTMLElement;
5
+ export type TourSemanticDOM = 'highlight' | 'content' | 'header' | 'body' | 'footer';
6
+ export interface TourStep {
7
+ /**
8
+ * The element to highlight, supports a finder function, a CSS selector string, or an HTMLElement
9
+ */
10
+ target: TourTarget;
11
+ /**
12
+ * Card title
13
+ */
14
+ title?: React.ReactNode;
15
+ /**
16
+ * Card description
17
+ */
18
+ description?: React.ReactNode;
19
+ /**
20
+ * Card placement relative to the highlighted target
21
+ * @default 'bottom'
22
+ */
23
+ placement?: Placement;
24
+ /**
25
+ * Whether to show the card arrow
26
+ */
27
+ arrow?: boolean;
28
+ /**
29
+ * Custom step class name
30
+ */
31
+ className?: string;
32
+ }
33
+ export interface TourProps extends DataAttributeProps {
34
+ /**
35
+ * Custom prefix class name
36
+ */
37
+ prefixCls?: string;
38
+ /**
39
+ * Custom root class name
40
+ */
41
+ className?: string;
42
+ /**
43
+ * Custom root style
44
+ */
45
+ style?: React.CSSProperties;
46
+ /**
47
+ * Semantic structure class names
48
+ */
49
+ classNames?: Partial<Record<TourSemanticDOM, string>>;
50
+ /**
51
+ * Semantic structure styles
52
+ */
53
+ styles?: Partial<Record<TourSemanticDOM, React.CSSProperties>>;
54
+ /**
55
+ * Whether the tour is visible (controlled)
56
+ */
57
+ open: boolean;
58
+ /**
59
+ * Tour steps
60
+ */
61
+ steps: TourStep[];
62
+ /**
63
+ * Controlled current step index
64
+ */
65
+ current?: number;
66
+ /**
67
+ * Default current step index
68
+ */
69
+ defaultCurrent?: number;
70
+ /**
71
+ * Callback when the tour is closed / skipped
72
+ */
73
+ onClose?: () => void;
74
+ /**
75
+ * Callback when all steps are finished
76
+ */
77
+ onFinish?: () => void;
78
+ /**
79
+ * Callback when current step changes
80
+ */
81
+ onChange?: (current: number) => void;
82
+ /**
83
+ * Default card placement relative to the highlighted target
84
+ * @default 'bottom'
85
+ */
86
+ placement?: Placement;
87
+ /**
88
+ * Whether to show the card arrow by default
89
+ */
90
+ arrow?: boolean;
91
+ /**
92
+ * Whether to show the mask layer (highlight cutout + click lock)
93
+ * @default true
94
+ */
95
+ mask?: boolean;
96
+ /**
97
+ * Whether the close button is shown at the top-right of the card
98
+ * @default true
99
+ */
100
+ closable?: boolean;
101
+ /**
102
+ * Custom close icon
103
+ */
104
+ closeIcon?: React.ReactNode;
105
+ /**
106
+ * Whether clicking the mask closes the tour
107
+ * @default false
108
+ */
109
+ maskClosable?: boolean;
110
+ /**
111
+ * Custom step indicators renderer, receives (current, total)
112
+ */
113
+ indicatorsRender?: (current: number, total: number) => React.ReactNode;
114
+ /**
115
+ * Options passed to target.scrollIntoView on each step
116
+ */
117
+ scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
118
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,103 @@
1
+ @pls: .yee-tour;
2
+
3
+ @{pls} {
4
+ position: fixed;
5
+ inset: 0;
6
+ z-index: var(--yee-tour-mask-z-index);
7
+ pointer-events: none;
8
+
9
+ // ① click-intercept layer (box-shadow receives no pointer events, so a
10
+ // transparent full-screen layer is needed to lock interaction + carry maskClosable)
11
+ &-mask {
12
+ position: absolute;
13
+ inset: 0;
14
+ pointer-events: auto;
15
+ background-color: transparent;
16
+
17
+ // No target to cut out → the mask itself becomes the full-screen dim layer.
18
+ &-full {
19
+ background-color: var(--yee-tour-mask-color);
20
+ }
21
+ }
22
+
23
+ // ② highlight cutout via a huge box-shadow; top/left/width/height come from
24
+ // motion inline styles, position/shape/visuals from here
25
+ &-highlight {
26
+ position: fixed;
27
+ box-sizing: border-box;
28
+ border-radius: var(--yee-tour-highlight-border-radius);
29
+ box-shadow: 0 0 0 9999px var(--yee-tour-mask-color);
30
+ z-index: 1;
31
+ pointer-events: none;
32
+ }
33
+ }
34
+
35
+ // card
36
+ .yee-tour-content {
37
+ position: fixed;
38
+ z-index: 2;
39
+ pointer-events: auto;
40
+ box-sizing: border-box;
41
+ width: var(--yee-tour-content-width);
42
+ max-width: calc(100vw - 48px);
43
+ padding: var(--yee-tour-content-padding);
44
+ background-color: var(--yee-tour-content-bg-color);
45
+ border-radius: var(--yee-tour-content-border-radius);
46
+ box-shadow: var(--yee-tour-content-box-shadow);
47
+
48
+ .yee-tour-close {
49
+ position: absolute;
50
+ top: var(--yee-tour-close-top);
51
+ inset-inline-end: var(--yee-tour-close-right);
52
+ display: inline-flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ padding: 0;
56
+ border: none;
57
+ background: transparent;
58
+ color: var(--yee-tour-close-color);
59
+ cursor: pointer;
60
+ opacity: 0.55;
61
+ transition: opacity var(--yee-tour-transition-duration) linear;
62
+
63
+ &:hover {
64
+ opacity: 1;
65
+ }
66
+ }
67
+
68
+ .yee-tour-header {
69
+ margin-bottom: var(--yee-tour-header-margin-bottom);
70
+ padding-inline-end: var(--yee-tour-close-size);
71
+ color: var(--yee-tour-title-color);
72
+ font-size: var(--yee-tour-title-font-size);
73
+ font-weight: var(--yee-tour-title-font-weight);
74
+ line-height: var(--yee-tour-title-line-height);
75
+ }
76
+
77
+ .yee-tour-body {
78
+ color: var(--yee-tour-description-color);
79
+ font-size: var(--yee-tour-description-font-size);
80
+ line-height: var(--yee-tour-description-line-height);
81
+ }
82
+
83
+ .yee-tour-footer {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: space-between;
87
+ gap: var(--yee-tour-button-gap);
88
+ margin-top: var(--yee-tour-footer-margin-top);
89
+ }
90
+
91
+ .yee-tour-indicators {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ gap: var(--yee-tour-indicator-gap);
95
+ }
96
+
97
+ .yee-tour-buttons {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ gap: var(--yee-tour-button-gap);
101
+ margin-left: auto;
102
+ }
103
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { TourProps } from './interface';
3
+ import './style/index.less';
4
+ declare const Tour: React.FC<TourProps>;
5
+ export default Tour;