@rescui/tag 0.10.11 → 0.10.13-RUI-226-Update-card-cn-6e43cc89.60

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.
@@ -1,37 +1,106 @@
1
1
  import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
- import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cn from 'classnames';
6
5
  import styles from './index.css.js';
7
- var _excluded = ["theme", "size", "className"];
8
- var sizeStyles = {
6
+ const sizeStyles = {
9
7
  "xs": styles.sizeXS,
10
8
  "s": styles.sizeS,
11
9
  "m": styles.sizeM,
12
10
  "l": styles.sizeL
13
11
  };
14
- var CloseIcon = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
15
- var theme = _ref.theme,
16
- size = _ref.size,
17
- className = _ref.className,
18
- props = _objectWithoutProperties(_ref, _excluded);
12
+ const Size = {
13
+ "xs": "xs",
14
+ "s": "s",
15
+ "m": "m",
16
+ "l": "l"
17
+ };
18
+ const CloseIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
19
+ viewBox: "0 0 16 16"
20
+ }, props, {
21
+ ref: ref
22
+ }), /*#__PURE__*/React.createElement("path", {
23
+ d: "M2.47 2.47a.75.75 0 0 1 1.06 0L8 6.94l4.47-4.47a.75.75 0 1 1 1.06 1.06L9.06 8l4.47 4.47a.75.75 0 1 1-1.06 1.06L8 9.06l-4.47 4.47a.75.75 0 0 1-1.06-1.06L6.94 8 2.47 3.53a.75.75 0 0 1 0-1.06"
24
+ })));
25
+ CloseIcon16.displayName = 'CloseIcon16';
26
+ const CloseIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
27
+ viewBox: "0 0 20 20"
28
+ }, props, {
29
+ ref: ref
30
+ }), /*#__PURE__*/React.createElement("path", {
31
+ d: "M3.293 3.293a1 1 0 0 1 1.414 0L10 8.586l5.293-5.293a1 1 0 1 1 1.414 1.414L11.414 10l5.293 5.293a1 1 0 0 1-1.414 1.414L10 11.414l-5.293 5.293a1 1 0 0 1-1.414-1.414L8.586 10 3.293 4.707a1 1 0 0 1 0-1.414"
32
+ })));
33
+ CloseIcon20.displayName = 'CloseIcon20';
34
+ const CloseIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
35
+ viewBox: "0 0 24 24"
36
+ }, props, {
37
+ ref: ref
38
+ }), /*#__PURE__*/React.createElement("path", {
39
+ d: "M3.44 3.44a1.5 1.5 0 0 1 2.12 0L12 9.878l6.44-6.44a1.5 1.5 0 0 1 2.12 2.122L14.122 12l6.44 6.44a1.5 1.5 0 0 1-2.122 2.12L12 14.122l-6.44 6.44a1.5 1.5 0 0 1-2.12-2.122L9.878 12l-6.44-6.44a1.5 1.5 0 0 1 0-2.12"
40
+ })));
41
+ CloseIcon24.displayName = 'CloseIcon24';
42
+ const CloseIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
43
+ viewBox: "0 0 28 28"
44
+ }, props, {
45
+ ref: ref
46
+ }), /*#__PURE__*/React.createElement("path", {
47
+ d: "M4.44 4.44a1.5 1.5 0 0 1 2.12 0L14 11.878l7.44-7.44a1.5 1.5 0 0 1 2.12 2.122L16.122 14l7.44 7.44a1.5 1.5 0 0 1-2.122 2.12L14 16.122l-7.44 7.44a1.5 1.5 0 0 1-2.12-2.122L11.878 14l-7.44-7.44a1.5 1.5 0 0 1 0-2.12"
48
+ })));
49
+ CloseIcon28.displayName = 'CloseIcon28';
50
+ const CloseIcon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
51
+ let {
52
+ theme,
53
+ size: sizeFromProps = "m",
54
+ className,
55
+ style,
56
+ ['data-render-all-sizes']: renderAllSizes = false,
57
+ ...props
58
+ } = _ref;
59
+ const size = sizeFromProps in Size ? sizeFromProps : "m";
60
+ const mainProps = { ...props,
61
+ className: cn(styles.icon, styles[theme], sizeStyles[size], renderAllSizes && styles.allVariants, className),
62
+ style: renderAllSizes ? {
63
+ '--rs-icon-ar-width': 28,
64
+ '--rs-icon-ar-height': 28,
65
+ ...style
66
+ } : style,
67
+ ref
68
+ };
69
+
70
+ if (renderAllSizes) {
71
+ return /*#__PURE__*/React.createElement("svg", _extends({
72
+ viewBox: "0 0 28 28"
73
+ }, mainProps), /*#__PURE__*/React.createElement(CloseIcon16, {
74
+ className: styles.variant16
75
+ }), /*#__PURE__*/React.createElement(CloseIcon20, {
76
+ className: styles.variant20
77
+ }), /*#__PURE__*/React.createElement(CloseIcon24, {
78
+ className: styles.variant24
79
+ }), /*#__PURE__*/React.createElement(CloseIcon28, {
80
+ className: styles.variant28
81
+ }));
82
+ }
83
+
84
+ if (size === Size['xs']) {
85
+ return /*#__PURE__*/React.createElement(CloseIcon16, mainProps);
86
+ }
19
87
 
20
- return /*#__PURE__*/React.createElement("svg", _extends({
21
- viewBox: "0 0 24 24"
22
- }, props, {
23
- className: cn(styles.icon, styles[theme], sizeStyles[size], className),
24
- ref: ref
25
- }), /*#__PURE__*/React.createElement("path", {
26
- d: "M5.67 19.751l6.342-6.34 6.34 6.34 1.41-1.409-6.341-6.34 6.34-6.341-1.408-1.409-6.341 6.341L5.67 4.251 4.26 5.66l6.342 6.342-6.34 6.34 1.408 1.409z"
27
- }));
88
+ if (size === Size['s']) {
89
+ return /*#__PURE__*/React.createElement(CloseIcon20, mainProps);
90
+ }
91
+
92
+ if (size === Size['m']) {
93
+ return /*#__PURE__*/React.createElement(CloseIcon24, mainProps);
94
+ }
95
+
96
+ return /*#__PURE__*/React.createElement(CloseIcon28, mainProps);
28
97
  });
98
+ CloseIcon.displayName = 'CloseIcon';
29
99
  CloseIcon.propTypes = {
30
100
  className: PropTypes.string,
31
101
  theme: PropTypes.oneOf(["light", "dark"]),
32
- size: PropTypes.oneOf(["xs", "s", "m", "l"])
33
- };
34
- CloseIcon.defaultProps = {
35
- size: "m"
102
+ size: PropTypes.oneOf(["xs", "s", "m", "l"]),
103
+ 'data-render-all-sizes': PropTypes.bool,
104
+ style: PropTypes.object
36
105
  };
37
- export { CloseIcon as default };
106
+ export { Size, CloseIcon as default };
@@ -1,10 +1,15 @@
1
1
  var styles = {
2
- "icon": "_icon_1hf44po_4",
3
- "sizeXS": "_sizeXS_1hf44po_14",
4
- "sizeS": "_sizeS_1hf44po_18",
5
- "sizeM": "_sizeM_1hf44po_22",
6
- "sizeL": "_sizeL_1hf44po_26",
7
- "light": "_light_1hf44po_30",
8
- "dark": "_dark_1hf44po_34"
2
+ "icon": "_icon_15yklic_4",
3
+ "sizeXS": "_sizeXS_15yklic_14",
4
+ "sizeS": "_sizeS_15yklic_18",
5
+ "sizeM": "_sizeM_15yklic_22",
6
+ "sizeL": "_sizeL_15yklic_26",
7
+ "light": "_light_15yklic_30",
8
+ "dark": "_dark_15yklic_34",
9
+ "allVariants": "_allVariants_15yklic_48",
10
+ "variant16": "_variant16_15yklic_53",
11
+ "variant20": "_variant20_15yklic_54",
12
+ "variant24": "_variant24_15yklic_55",
13
+ "variant28": "_variant28_15yklic_58"
9
14
  };
10
15
  export { styles as default };