@rescui/tag 0.13.14-RUI-308-Fix-select-issues-405b9fa40.12 → 0.14.1

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,4 +1,6 @@
1
1
  "use client";
2
+ import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
3
+ import { c } from 'react-compiler-runtime';
2
4
  import React, { cloneElement } from 'react';
3
5
  import cn from 'classnames';
4
6
  import PropTypes from 'prop-types';
@@ -15,48 +17,169 @@ const THEME_STYLES = {
15
17
  light: styles.themeLight,
16
18
  dark: styles.themeDark
17
19
  };
18
- const RemovableTag = /*#__PURE__*/React.forwardRef(function Tag(_ref, ref) {
19
- let {
20
- className,
21
- disabled,
22
- size = 'xs',
23
- theme: themeFromProps,
24
- children,
25
- icon,
26
- // eslint-disable-next-line @typescript-eslint/no-empty-function
27
- onRemoveClick = () => {},
28
- wrap = false,
29
- ...restProps
30
- } = _ref;
20
+ const RemovableTag = /*#__PURE__*/React.forwardRef(function Tag(t0, ref) {
21
+ const $ = c(33);
22
+ let children;
23
+ let className;
24
+ let disabled;
25
+ let icon;
26
+ let restProps;
27
+ let t1;
28
+ let t2;
29
+ let t3;
30
+ let themeFromProps;
31
+
32
+ if ($[0] !== t0) {
33
+ ({
34
+ className,
35
+ disabled,
36
+ size: t1,
37
+ theme: themeFromProps,
38
+ children,
39
+ icon,
40
+ onRemoveClick: t2,
41
+ wrap: t3,
42
+ ...restProps
43
+ } = t0);
44
+ $[0] = t0;
45
+ $[1] = children;
46
+ $[2] = className;
47
+ $[3] = disabled;
48
+ $[4] = icon;
49
+ $[5] = restProps;
50
+ $[6] = t1;
51
+ $[7] = t2;
52
+ $[8] = t3;
53
+ $[9] = themeFromProps;
54
+ } else {
55
+ children = $[1];
56
+ className = $[2];
57
+ disabled = $[3];
58
+ icon = $[4];
59
+ restProps = $[5];
60
+ t1 = $[6];
61
+ t2 = $[7];
62
+ t3 = $[8];
63
+ themeFromProps = $[9];
64
+ }
65
+
66
+ const size = t1 === undefined ? "xs" : t1;
67
+ const onRemoveClick = t2 === undefined ? _temp : t2;
68
+ const wrap = t3 === undefined ? false : t3;
31
69
  const theme = useThemeWithUndefined(themeFromProps);
32
- return /*#__PURE__*/React.createElement("span", {
33
- className: cn(styles.wrapper, SIZE_STYLES[size], THEME_STYLES[theme], disabled && styles.disabled, wrap && styles.wrap, className),
34
- "data-test": 'removable-tag-wrapper',
35
- ...restProps,
36
- ref: ref
37
- }, /*#__PURE__*/React.isValidElement(icon) && /*#__PURE__*/cloneElement(icon, {
38
- className: cn(icon.props.className, styles.icon),
39
- 'data-render-all-sizes': true
40
- }), /*#__PURE__*/React.createElement("span", {
41
- className: styles.main,
42
- "data-test": "removable-tag"
43
- }, children), /*#__PURE__*/React.createElement("button", {
44
- type: "button",
45
- "data-test": "removable-tag-remove-icon",
46
- className: styles.close,
47
- "aria-label": `Remove`,
48
- tabIndex: disabled ? -1 : 0,
49
- onClick: e => {
70
+ const t4 = SIZE_STYLES[size];
71
+ const t5 = THEME_STYLES[theme];
72
+ const t6 = disabled && styles.disabled;
73
+ const t7 = wrap && styles.wrap;
74
+ let t8;
75
+
76
+ if ($[10] !== className || $[11] !== t4 || $[12] !== t5 || $[13] !== t6 || $[14] !== t7) {
77
+ t8 = cn(styles.wrapper, t4, t5, t6, t7, className);
78
+ $[10] = className;
79
+ $[11] = t4;
80
+ $[12] = t5;
81
+ $[13] = t6;
82
+ $[14] = t7;
83
+ $[15] = t8;
84
+ } else {
85
+ t8 = $[15];
86
+ }
87
+
88
+ let t9;
89
+
90
+ if ($[16] !== icon) {
91
+ t9 = /*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) && /*#__PURE__*/cloneElement(icon, {
92
+ className: cn(icon.props.className, styles.icon),
93
+ "data-render-all-sizes": true
94
+ });
95
+ $[16] = icon;
96
+ $[17] = t9;
97
+ } else {
98
+ t9 = $[17];
99
+ }
100
+
101
+ let t10;
102
+
103
+ if ($[18] !== children) {
104
+ t10 = /*#__PURE__*/React.createElement("span", {
105
+ className: styles.main,
106
+ "data-test": "removable-tag"
107
+ }, children);
108
+ $[18] = children;
109
+ $[19] = t10;
110
+ } else {
111
+ t10 = $[19];
112
+ }
113
+
114
+ const t11 = disabled ? -1 : 0;
115
+ let t12;
116
+
117
+ if ($[20] !== onRemoveClick) {
118
+ t12 = e => {
50
119
  e.stopPropagation();
51
120
  onRemoveClick();
52
- },
53
- onPointerDown: e => e.stopPropagation(),
54
- onMouseDown: e => e.stopPropagation(),
55
- onKeyDown: e => e.stopPropagation()
56
- }, /*#__PURE__*/React.createElement(CloseOutlineIcon, {
57
- "data-rs-internal": "removable-tag__close-icon",
58
- "data-render-all-sizes": true
59
- })));
121
+ };
122
+
123
+ $[20] = onRemoveClick;
124
+ $[21] = t12;
125
+ } else {
126
+ t12 = $[21];
127
+ }
128
+
129
+ let t13;
130
+
131
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
132
+ t13 = /*#__PURE__*/React.createElement(CloseOutlineIcon, {
133
+ "data-rs-internal": "removable-tag__close-icon",
134
+ "data-render-all-sizes": true
135
+ });
136
+ $[22] = t13;
137
+ } else {
138
+ t13 = $[22];
139
+ }
140
+
141
+ let t14;
142
+
143
+ if ($[23] !== t11 || $[24] !== t12) {
144
+ t14 = /*#__PURE__*/React.createElement("button", {
145
+ type: "button",
146
+ "data-test": "removable-tag-remove-icon",
147
+ className: styles.close,
148
+ "aria-label": "Remove",
149
+ tabIndex: t11,
150
+ onClick: t12,
151
+ onPointerDown: _temp2,
152
+ onMouseDown: _temp3,
153
+ onKeyDown: _temp4
154
+ }, t13);
155
+ $[23] = t11;
156
+ $[24] = t12;
157
+ $[25] = t14;
158
+ } else {
159
+ t14 = $[25];
160
+ }
161
+
162
+ let t15;
163
+
164
+ if ($[26] !== ref || $[27] !== restProps || $[28] !== t10 || $[29] !== t14 || $[30] !== t8 || $[31] !== t9) {
165
+ t15 = /*#__PURE__*/React.createElement("span", _extends({
166
+ className: t8,
167
+ "data-test": "removable-tag-wrapper"
168
+ }, restProps, {
169
+ ref: ref
170
+ }), t9, t10, t14);
171
+ $[26] = ref;
172
+ $[27] = restProps;
173
+ $[28] = t10;
174
+ $[29] = t14;
175
+ $[30] = t8;
176
+ $[31] = t9;
177
+ $[32] = t15;
178
+ } else {
179
+ t15 = $[32];
180
+ }
181
+
182
+ return t15;
60
183
  });
61
184
  RemovableTag.propTypes = {
62
185
  disabled: PropTypes.bool,
@@ -65,4 +188,19 @@ RemovableTag.propTypes = {
65
188
  icon: PropTypes.node,
66
189
  onRemoveClick: PropTypes.func.isRequired
67
190
  };
191
+
192
+ function _temp() {}
193
+
194
+ function _temp2(e_0) {
195
+ return e_0.stopPropagation();
196
+ }
197
+
198
+ function _temp3(e_1) {
199
+ return e_1.stopPropagation();
200
+ }
201
+
202
+ function _temp4(e_2) {
203
+ return e_2.stopPropagation();
204
+ }
205
+
68
206
  export { RemovableTag };
@@ -1,15 +1,15 @@
1
1
  var styles = {
2
- "themeLight": "_themeLight_xeu6t3_7",
3
- "themeDark": "_themeDark_xeu6t3_10",
4
- "sizeXs": "_sizeXs_xeu6t3_14",
5
- "sizeS": "_sizeS_xeu6t3_17",
6
- "sizeM": "_sizeM_xeu6t3_20",
7
- "sizeL": "_sizeL_xeu6t3_23",
8
- "wrapper": "_wrapper_xeu6t3_27",
9
- "icon": "_icon_xeu6t3_49",
10
- "disabled": "_disabled_xeu6t3_62",
11
- "main": "_main_xeu6t3_67",
12
- "wrap": "_wrap_xeu6t3_27",
13
- "close": "_close_xeu6t3_86"
2
+ "themeLight": "_themeLight_s3cbrf_7",
3
+ "themeDark": "_themeDark_s3cbrf_10",
4
+ "sizeXs": "_sizeXs_s3cbrf_14",
5
+ "sizeS": "_sizeS_s3cbrf_17",
6
+ "sizeM": "_sizeM_s3cbrf_20",
7
+ "sizeL": "_sizeL_s3cbrf_23",
8
+ "wrapper": "_wrapper_s3cbrf_27",
9
+ "icon": "_icon_s3cbrf_49",
10
+ "disabled": "_disabled_s3cbrf_62",
11
+ "main": "_main_s3cbrf_67",
12
+ "wrap": "_wrap_s3cbrf_27",
13
+ "close": "_close_s3cbrf_86"
14
14
  };
15
15
  export { styles as default };
@@ -1,3 +1,5 @@
1
+ import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
+ import { c } from 'react-compiler-runtime';
1
3
  import React from 'react';
2
4
  import cn from 'classnames';
3
5
  import PropTypes from 'prop-types';
@@ -19,29 +21,118 @@ const OFFSET_STYLES = {
19
21
  24: styles.offset24,
20
22
  32: styles.offset32
21
23
  };
22
- const StickyTag = /*#__PURE__*/React.forwardRef(function StickyTag(_ref, ref) {
23
- let {
24
- className,
25
- wrapperClassName,
26
- content,
27
- children,
28
- size = 'xs',
29
- placement = 'top-end',
30
- align = 'top',
31
- offset = DEFAULT_OFFSET,
32
- ...restProps
33
- } = _ref;
24
+ const StickyTag = /*#__PURE__*/React.forwardRef(function StickyTag(t0, ref) {
25
+ const $ = c(27);
26
+ let children;
27
+ let className;
28
+ let content;
29
+ let restProps;
30
+ let t1;
31
+ let t2;
32
+ let t3;
33
+ let t4;
34
+ let wrapperClassName;
35
+
36
+ if ($[0] !== t0) {
37
+ ({
38
+ className,
39
+ wrapperClassName,
40
+ content,
41
+ children,
42
+ size: t1,
43
+ placement: t2,
44
+ align: t3,
45
+ offset: t4,
46
+ ...restProps
47
+ } = t0);
48
+ $[0] = t0;
49
+ $[1] = children;
50
+ $[2] = className;
51
+ $[3] = content;
52
+ $[4] = restProps;
53
+ $[5] = t1;
54
+ $[6] = t2;
55
+ $[7] = t3;
56
+ $[8] = t4;
57
+ $[9] = wrapperClassName;
58
+ } else {
59
+ children = $[1];
60
+ className = $[2];
61
+ content = $[3];
62
+ restProps = $[4];
63
+ t1 = $[5];
64
+ t2 = $[6];
65
+ t3 = $[7];
66
+ t4 = $[8];
67
+ wrapperClassName = $[9];
68
+ }
69
+
70
+ const size = t1 === undefined ? "xs" : t1;
71
+ const placement = t2 === undefined ? "top-end" : t2;
72
+ const align = t3 === undefined ? "top" : t3;
73
+ const offset = t4 === undefined ? DEFAULT_OFFSET : t4;
34
74
  const offsetCn = offset in OFFSET_STYLES ? OFFSET_STYLES[offset] : OFFSET_STYLES[DEFAULT_OFFSET];
35
- return /*#__PURE__*/React.createElement("div", {
36
- className: cn(styles.wrapper, wrapperClassName),
37
- "data-test": 'sticky-tag-wrapper'
38
- }, children, /*#__PURE__*/React.createElement(BaseTag, {
39
- size: size,
40
- className: cn(styles.tag, className, PLACEMENT_STYLES[placement], ALIGN_STYLES[align], offsetCn),
41
- "data-test": 'sticky-tag',
42
- ...restProps,
43
- ref: ref
44
- }, content));
75
+ let t5;
76
+
77
+ if ($[10] !== wrapperClassName) {
78
+ t5 = cn(styles.wrapper, wrapperClassName);
79
+ $[10] = wrapperClassName;
80
+ $[11] = t5;
81
+ } else {
82
+ t5 = $[11];
83
+ }
84
+
85
+ const t6 = PLACEMENT_STYLES[placement];
86
+ const t7 = ALIGN_STYLES[align];
87
+ let t8;
88
+
89
+ if ($[12] !== className || $[13] !== offsetCn || $[14] !== t6 || $[15] !== t7) {
90
+ t8 = cn(styles.tag, className, t6, t7, offsetCn);
91
+ $[12] = className;
92
+ $[13] = offsetCn;
93
+ $[14] = t6;
94
+ $[15] = t7;
95
+ $[16] = t8;
96
+ } else {
97
+ t8 = $[16];
98
+ }
99
+
100
+ let t9;
101
+
102
+ if ($[17] !== content || $[18] !== ref || $[19] !== restProps || $[20] !== size || $[21] !== t8) {
103
+ t9 = /*#__PURE__*/React.createElement(BaseTag, _extends({
104
+ size: size,
105
+ className: t8,
106
+ "data-test": "sticky-tag"
107
+ }, restProps, {
108
+ ref: ref
109
+ }), content);
110
+ $[17] = content;
111
+ $[18] = ref;
112
+ $[19] = restProps;
113
+ $[20] = size;
114
+ $[21] = t8;
115
+ $[22] = t9;
116
+ } else {
117
+ t9 = $[22];
118
+ }
119
+
120
+ let t10;
121
+
122
+ if ($[23] !== children || $[24] !== t5 || $[25] !== t9) {
123
+ t10 = /*#__PURE__*/React.createElement("div", {
124
+ className: t5,
125
+ "data-test": "sticky-tag-wrapper"
126
+ }, children, t9);
127
+ $[23] = children;
128
+ $[24] = t5;
129
+ $[25] = t9;
130
+ $[26] = t10;
131
+ } else {
132
+ t10 = $[26];
133
+ }
134
+
135
+ return t10;
45
136
  });
46
137
  StickyTag.propTypes = {
47
138
  className: PropTypes.string,
@@ -1,14 +1,14 @@
1
1
  var styles = {
2
- "wrapper": "_wrapper_5bwiyy_3",
3
- "offset16": "_offset16_5bwiyy_7",
4
- "offset24": "_offset24_5bwiyy_10",
5
- "offset32": "_offset32_5bwiyy_13",
6
- "alignTop": "_alignTop_5bwiyy_17",
7
- "alignMiddle": "_alignMiddle_5bwiyy_20",
8
- "topStart": "_topStart_5bwiyy_24",
9
- "topEnd": "_topEnd_5bwiyy_27",
10
- "leftStart": "_leftStart_5bwiyy_30",
11
- "leftEnd": "_leftEnd_5bwiyy_33",
12
- "tag": "_tag_5bwiyy_37"
2
+ "wrapper": "_wrapper_dnchrq_3",
3
+ "offset16": "_offset16_dnchrq_7",
4
+ "offset24": "_offset24_dnchrq_10",
5
+ "offset32": "_offset32_dnchrq_13",
6
+ "alignTop": "_alignTop_dnchrq_17",
7
+ "alignMiddle": "_alignMiddle_dnchrq_20",
8
+ "topStart": "_topStart_dnchrq_24",
9
+ "topEnd": "_topEnd_dnchrq_27",
10
+ "leftStart": "_leftStart_dnchrq_30",
11
+ "leftEnd": "_leftEnd_dnchrq_33",
12
+ "tag": "_tag_dnchrq_37"
13
13
  };
14
14
  export { styles as default };
@@ -1,4 +1,4 @@
1
1
  var styles = {
2
- "main": "_main_1s6s1c8_1"
2
+ "main": "_main_65y1pw_1"
3
3
  };
4
4
  export { styles as default };
package/lib/tag.js CHANGED
@@ -1,23 +1,69 @@
1
+ import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
+ import { c } from 'react-compiler-runtime';
1
3
  import React from 'react';
2
4
  import cn from 'classnames';
3
5
  import PropTypes from 'prop-types';
4
6
  import { BaseTag } from './parts/base-tag.js';
5
7
  import styles from './parts/tag.p.module.css.js';
6
8
  const Tag = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line complexity
7
- (_ref, ref) => {
8
- let {
9
- className,
10
- children,
11
- size = 'xs',
12
- ...restProps
13
- } = _ref;
14
- return /*#__PURE__*/React.createElement(BaseTag, {
15
- "data-test": 'tag',
16
- ...restProps,
17
- size: size,
18
- ref: ref,
19
- className: cn(styles.main, className)
20
- }, children);
9
+ (t0, ref) => {
10
+ const $ = c(13);
11
+ let children;
12
+ let className;
13
+ let restProps;
14
+ let t1;
15
+
16
+ if ($[0] !== t0) {
17
+ ({
18
+ className,
19
+ children,
20
+ size: t1,
21
+ ...restProps
22
+ } = t0);
23
+ $[0] = t0;
24
+ $[1] = children;
25
+ $[2] = className;
26
+ $[3] = restProps;
27
+ $[4] = t1;
28
+ } else {
29
+ children = $[1];
30
+ className = $[2];
31
+ restProps = $[3];
32
+ t1 = $[4];
33
+ }
34
+
35
+ const size = t1 === undefined ? "xs" : t1;
36
+ let t2;
37
+
38
+ if ($[5] !== className) {
39
+ t2 = cn(styles.main, className);
40
+ $[5] = className;
41
+ $[6] = t2;
42
+ } else {
43
+ t2 = $[6];
44
+ }
45
+
46
+ let t3;
47
+
48
+ if ($[7] !== children || $[8] !== ref || $[9] !== restProps || $[10] !== size || $[11] !== t2) {
49
+ t3 = /*#__PURE__*/React.createElement(BaseTag, _extends({
50
+ "data-test": "tag"
51
+ }, restProps, {
52
+ size: size,
53
+ ref: ref,
54
+ className: t2
55
+ }), children);
56
+ $[7] = children;
57
+ $[8] = ref;
58
+ $[9] = restProps;
59
+ $[10] = size;
60
+ $[11] = t2;
61
+ $[12] = t3;
62
+ } else {
63
+ t3 = $[12];
64
+ }
65
+
66
+ return t3;
21
67
  });
22
68
  Tag.displayName = 'Tag';
23
69
  Tag.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/tag",
3
- "version": "0.13.14-RUI-308-Fix-select-issues-405b9fa40.12+405b9fa40",
3
+ "version": "0.14.1",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -17,23 +17,24 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@babel/runtime-corejs3": "^7.26.0",
20
- "@rescui/colors": "0.3.4-RUI-308-Fix-select-issues-405b9fa40.12+405b9fa40",
21
- "classnames": "^2.3.1"
20
+ "@rescui/colors": "^0.3.4",
21
+ "classnames": "^2.3.1",
22
+ "react-compiler-runtime": "^1.0.0"
22
23
  },
23
24
  "peerDependencies": {
24
- "@rescui/ui-contexts": "^0.6.0",
25
+ "@rescui/ui-contexts": "^0.7.0",
25
26
  "prop-types": "^15",
26
- "react": ">=16.8.0 <20"
27
+ "react": ">=17.0.0 <20"
27
28
  },
28
29
  "devDependencies": {
29
- "@rescui/icons": "1.8.5-RUI-308-Fix-select-issues-405b9fa40.12+405b9fa40",
30
- "@rescui/scripts": "0.5.2",
31
- "@rescui/typography": "0.27.5-RUI-308-Fix-select-issues-405b9fa40.12+405b9fa40"
30
+ "@rescui/icons": "^1.9.1",
31
+ "@rescui/scripts": "^0.5.3",
32
+ "@rescui/typography": "^0.28.1"
32
33
  },
33
34
  "scripts": {
34
35
  "build": "rescui-scripts build && yarn run build-pcss-api",
35
36
  "build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
36
37
  },
37
38
  "nx": {},
38
- "gitHead": "405b9fa40886b0ab6709c9185e8214599d2d792e"
39
+ "gitHead": "ce4c6c5e3fd5aede0006f6ef8e655fc0ab394c0f"
39
40
  }