@rescui/select 0.13.1-RUI-270-Update-select-options-label-types-b99bd91c.3 → 0.14.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.
@@ -1,15 +1,15 @@
1
1
  var styles = {
2
- "sizeS": "_sizeS_3ddtgz_3",
3
- "sizeM": "_sizeM_3ddtgz_6",
4
- "sizeL": "_sizeL_3ddtgz_9",
5
- "menu": "_menu_3ddtgz_13",
6
- "menuSizeS": "_menuSizeS_3ddtgz_26",
7
- "menuSizeM": "_menuSizeM_3ddtgz_30",
8
- "menuSizeL": "_menuSizeL_3ddtgz_34",
9
- "withGroupsLabel": "_withGroupsLabel_3ddtgz_40",
10
- "lastOption": "_lastOption_3ddtgz_39",
11
- "divider": "_divider_3ddtgz_45",
12
- "checkIcon": "_checkIcon_3ddtgz_51",
13
- "observable": "_observable_3ddtgz_56"
2
+ "sizeS": "_sizeS_1r2w8hs_3",
3
+ "sizeM": "_sizeM_1r2w8hs_6",
4
+ "sizeL": "_sizeL_1r2w8hs_9",
5
+ "menu": "_menu_1r2w8hs_13",
6
+ "menuSizeS": "_menuSizeS_1r2w8hs_26",
7
+ "menuSizeM": "_menuSizeM_1r2w8hs_30",
8
+ "menuSizeL": "_menuSizeL_1r2w8hs_34",
9
+ "withGroupsLabel": "_withGroupsLabel_1r2w8hs_40",
10
+ "lastOption": "_lastOption_1r2w8hs_39",
11
+ "divider": "_divider_1r2w8hs_45",
12
+ "checkIcon": "_checkIcon_1r2w8hs_51",
13
+ "observable": "_observable_1r2w8hs_56"
14
14
  };
15
15
  export { styles as default };
@@ -1,13 +1,13 @@
1
1
  var styles = {
2
- "themeLight": "_themeLight_1ea9p06_7",
3
- "themeDark": "_themeDark_1ea9p06_10",
4
- "sizeS": "_sizeS_1ea9p06_14",
5
- "sizeM": "_sizeM_1ea9p06_17",
6
- "sizeL": "_sizeL_1ea9p06_20",
7
- "main": "_main_1ea9p06_24",
8
- "label": "_label_1ea9p06_28",
9
- "errorMessage": "_errorMessage_1ea9p06_34",
10
- "errorIcon": "_errorIcon_1ea9p06_45",
11
- "note": "_note_1ea9p06_50"
2
+ "themeLight": "_themeLight_yw1fz9_7",
3
+ "themeDark": "_themeDark_yw1fz9_10",
4
+ "sizeS": "_sizeS_yw1fz9_14",
5
+ "sizeM": "_sizeM_yw1fz9_17",
6
+ "sizeL": "_sizeL_yw1fz9_20",
7
+ "main": "_main_yw1fz9_24",
8
+ "label": "_label_yw1fz9_28",
9
+ "errorMessage": "_errorMessage_yw1fz9_34",
10
+ "errorIcon": "_errorIcon_yw1fz9_45",
11
+ "note": "_note_yw1fz9_50"
12
12
  };
13
13
  export { styles as default };
@@ -7,7 +7,7 @@ import scrollIntoView from 'scroll-into-view-if-needed';
7
7
  import { Dropdown } from '@rescui/dropdown';
8
8
  import { Menu, MenuItem, Divider, GroupHeader } from '@rescui/menu';
9
9
  import { useThemeWithUndefined } from '@rescui/ui-contexts';
10
- import CheckIcon from '../_virtual/check.js';
10
+ import CheckOutlineIcon from '../_virtual/check-outline.js';
11
11
  import { useStrongMemo, getDefaultCursorIndex, isGroupsEmpty, getOptionValue, getMovedCursorIndex, shouldOpenSelect, isIndexMatchCursor, withoutGroupsLabel, getPlainOptionsFromGroups, getEmptyMessage, OptionGroupTypes, convertToOptionGroupsIfNeeded, calculateMaxHeight } from '../utils.js';
12
12
  import { optionType, optionsGroupType, noOptionsMessageType } from '../common-prop-types.js';
13
13
  import { ARROW_DOWN, ARROW_UP, ENTER, SPACE, TAB, ESCAPE, BACKSPACE } from '../key-codes.js';
@@ -36,7 +36,7 @@ const Option = _ref => {
36
36
  const value = getOptionValue(item);
37
37
  const isItemSelected = Boolean(selected && selected.length && selected.some(s => value === getOptionValue(s)));
38
38
  const isHighlighted = isIndexMatchCursor(cursorIndex, index);
39
- const icon = isSingleLine && isItemSelected ? /*#__PURE__*/React.createElement(CheckIcon, {
39
+ const icon = isSingleLine && isItemSelected ? /*#__PURE__*/React.createElement(CheckOutlineIcon, {
40
40
  className: styles.checkIcon,
41
41
  "data-render-all-sizes": true
42
42
  }) : null;
@@ -1,9 +1,9 @@
1
1
  var styles = {
2
- "sizeS": "_sizeS_4q9tzo_6",
3
- "sizeM": "_sizeM_4q9tzo_9",
4
- "sizeL": "_sizeL_4q9tzo_12",
5
- "main": "_main_4q9tzo_16",
6
- "wrapper": "_wrapper_4q9tzo_20",
7
- "select": "_select_4q9tzo_24"
2
+ "sizeS": "_sizeS_1hz5w4n_6",
3
+ "sizeM": "_sizeM_1hz5w4n_9",
4
+ "sizeL": "_sizeL_1hz5w4n_12",
5
+ "main": "_main_1hz5w4n_16",
6
+ "wrapper": "_wrapper_1hz5w4n_20",
7
+ "select": "_select_1hz5w4n_24"
8
8
  };
9
9
  export { styles as default };
@@ -4,9 +4,9 @@ import cn from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import { RemovableTag, Tag } from '@rescui/tag';
6
6
  import { useThemeWithUndefined } from '@rescui/ui-contexts';
7
- import DownIcon from '../_virtual/down.js';
8
- import CloseIcon from '../_virtual/close.js';
9
- import LoadingIcon from '../_virtual/loading.js';
7
+ import DownOutlineIcon from '../_virtual/down-outline.js';
8
+ import CloseOutlineIcon from '../_virtual/close-outline.js';
9
+ import LoadingOutlineIcon from '../_virtual/loading-outline.js';
10
10
  import { optionType } from '../common-prop-types.js';
11
11
  import { getOptionValue } from '../utils.js';
12
12
  import Foldable from './foldable.js';
@@ -113,7 +113,7 @@ const ClearOrLoading = _ref3 => {
113
113
  } = _ref3;
114
114
 
115
115
  if (isLoading) {
116
- return /*#__PURE__*/React.createElement(LoadingIcon, {
116
+ return /*#__PURE__*/React.createElement(LoadingOutlineIcon, {
117
117
  style: {
118
118
  pointerEvents: 'none'
119
119
  },
@@ -130,7 +130,7 @@ const ClearOrLoading = _ref3 => {
130
130
  e.stopPropagation();
131
131
  onClearClick();
132
132
  }
133
- }, /*#__PURE__*/React.createElement(CloseIcon, {
133
+ }, /*#__PURE__*/React.createElement(CloseOutlineIcon, {
134
134
  "data-render-all-sizes": true
135
135
  }));
136
136
  } else {
@@ -223,7 +223,7 @@ const SelectTrigger = /*#__PURE__*/React.memo(props => {
223
223
  isClearable: isClearable,
224
224
  onClearClick: onClearClick,
225
225
  selected: selected
226
- }), /*#__PURE__*/React.createElement(DownIcon, {
226
+ }), /*#__PURE__*/React.createElement(DownOutlineIcon, {
227
227
  className: styles.toggle,
228
228
  "data-test": "down-icon",
229
229
  "data-render-all-sizes": true
@@ -1,31 +1,31 @@
1
1
  var styles = {
2
- "themeLight": "_themeLight_pvn8q3_27",
3
- "themeDark": "_themeDark_pvn8q3_30",
4
- "sizeS": "_sizeS_pvn8q3_34",
5
- "sizeM": "_sizeM_pvn8q3_37",
6
- "sizeL": "_sizeL_pvn8q3_40",
7
- "classic": "_classic_pvn8q3_44",
8
- "rock": "_rock_pvn8q3_47",
9
- "main": "_main_pvn8q3_51",
10
- "open": "_open_pvn8q3_80",
11
- "searchKeyFocused": "_searchKeyFocused_pvn8q3_85",
12
- "error": "_error_pvn8q3_89",
13
- "disabled": "_disabled_pvn8q3_95",
14
- "enabled": "_enabled_pvn8q3_103",
15
- "searchFocused": "_searchFocused_pvn8q3_104",
16
- "focused": "_focused_pvn8q3_105",
17
- "isMulti": "_isMulti_pvn8q3_138",
18
- "iconsWrapper": "_iconsWrapper_pvn8q3_142",
19
- "labelWrapper": "_labelWrapper_pvn8q3_157",
20
- "label": "_label_pvn8q3_157",
21
- "labelNotSelected": "_labelNotSelected_pvn8q3_197",
22
- "searchInput": "_searchInput_pvn8q3_210",
23
- "multi": "_multi_pvn8q3_240",
24
- "tagsContainer": "_tagsContainer_pvn8q3_256",
25
- "tag": "_tag_pvn8q3_256",
26
- "filledTag": "_filledTag_pvn8q3_279",
27
- "toggle": "_toggle_pvn8q3_286",
28
- "icon": "_icon_pvn8q3_142",
29
- "clearIcon": "_clearIcon_pvn8q3_353"
2
+ "themeLight": "_themeLight_c93kzc_27",
3
+ "themeDark": "_themeDark_c93kzc_30",
4
+ "sizeS": "_sizeS_c93kzc_34",
5
+ "sizeM": "_sizeM_c93kzc_37",
6
+ "sizeL": "_sizeL_c93kzc_40",
7
+ "classic": "_classic_c93kzc_44",
8
+ "rock": "_rock_c93kzc_47",
9
+ "main": "_main_c93kzc_51",
10
+ "open": "_open_c93kzc_80",
11
+ "searchKeyFocused": "_searchKeyFocused_c93kzc_85",
12
+ "error": "_error_c93kzc_89",
13
+ "disabled": "_disabled_c93kzc_95",
14
+ "enabled": "_enabled_c93kzc_103",
15
+ "searchFocused": "_searchFocused_c93kzc_104",
16
+ "focused": "_focused_c93kzc_105",
17
+ "isMulti": "_isMulti_c93kzc_138",
18
+ "iconsWrapper": "_iconsWrapper_c93kzc_142",
19
+ "labelWrapper": "_labelWrapper_c93kzc_157",
20
+ "label": "_label_c93kzc_157",
21
+ "labelNotSelected": "_labelNotSelected_c93kzc_197",
22
+ "searchInput": "_searchInput_c93kzc_210",
23
+ "multi": "_multi_c93kzc_240",
24
+ "tagsContainer": "_tagsContainer_c93kzc_256",
25
+ "tag": "_tag_c93kzc_256",
26
+ "filledTag": "_filledTag_c93kzc_279",
27
+ "toggle": "_toggle_c93kzc_286",
28
+ "icon": "_icon_c93kzc_142",
29
+ "clearIcon": "_clearIcon_c93kzc_353"
30
30
  };
31
31
  export { styles as default };
package/lib/utils.js CHANGED
@@ -30,7 +30,7 @@ const getTextFromNodes = function (node) {
30
30
  return node.map(n => getTextFromNodes(n, depth + 1)).join('');
31
31
  }
32
32
 
33
- if ( /*#__PURE__*/React.isValidElement(node) && (node === null || node === void 0 || (_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.toLowerCase()) !== 'svg') {
33
+ if ( /*#__PURE__*/React.isValidElement(node) && (node === null || node === void 0 || (_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.toString()) === null || _node$type === void 0 ? void 0 : _node$type.toLowerCase()) !== 'svg') {
34
34
  return getTextFromNodes(node.props.children, depth + 1);
35
35
  }
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/select",
3
- "version": "0.13.1-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
3
+ "version": "0.14.0",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -16,10 +16,10 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@babel/runtime-corejs3": "^7.26.0",
19
- "@rescui/dropdown": "0.9.1-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
20
- "@rescui/menu": "0.12.3-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
21
- "@rescui/tag": "0.12.2-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
22
- "@rescui/use-resize-observer": "0.3.1-RUI-270-Update-select-options-label-types-b99bd91c.49+b99bd91c",
19
+ "@rescui/dropdown": "^0.9.0",
20
+ "@rescui/menu": "^0.13.0",
21
+ "@rescui/tag": "^0.13.0",
22
+ "@rescui/use-resize-observer": "^0.3.0",
23
23
  "classnames": "^2.2.6",
24
24
  "scroll-into-view-if-needed": "2.2.20"
25
25
  },
@@ -29,10 +29,10 @@
29
29
  "react": ">=16.8.0 <20"
30
30
  },
31
31
  "devDependencies": {
32
- "@rescui/colors": "0.2.13-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
33
- "@rescui/scripts": "0.5.1",
34
- "@rescui/typography": "0.24.3-RUI-270-Update-select-options-label-types-b99bd91c.3+b99bd91c",
35
- "@rescui/visual-regression": "0.1.4",
32
+ "@rescui/colors": "^0.2.12",
33
+ "@rescui/scripts": "^0.5.1",
34
+ "@rescui/typography": "^0.24.2",
35
+ "@rescui/visual-regression": "^0.1.4",
36
36
  "sniffr": "^1.2.0"
37
37
  },
38
38
  "scripts": {
@@ -40,5 +40,5 @@
40
40
  "build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
41
41
  },
42
42
  "nx": {},
43
- "gitHead": "b99bd91c4c5319fed687fdfa123e195ccc8275ba"
43
+ "gitHead": "66c499bb620ffa7b651301dfb24dbb4e5782435d"
44
44
  }
@@ -1,106 +0,0 @@
1
- import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import cn from 'classnames';
5
- import styles from './index.css.js';
6
- const sizeStyles = {
7
- "xs": styles.sizeXS,
8
- "s": styles.sizeS,
9
- "m": styles.sizeM,
10
- "l": styles.sizeL
11
- };
12
- const Size = {
13
- "xs": "xs",
14
- "s": "s",
15
- "m": "m",
16
- "l": "l"
17
- };
18
- const CheckIcon16 = /*#__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: "M14.03 3.97a.75.75 0 0 1 0 1.06l-7 7a.75.75 0 0 1-1.06 0l-3.5-3.5a.75.75 0 0 1 1.06-1.06l2.97 2.97 6.47-6.47a.75.75 0 0 1 1.06 0"
24
- })));
25
- CheckIcon16.displayName = 'CheckIcon16';
26
- const CheckIcon20 = /*#__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: "M16.707 5.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L8 12.586l7.293-7.293a1 1 0 0 1 1.414 0"
32
- })));
33
- CheckIcon20.displayName = 'CheckIcon20';
34
- const CheckIcon24 = /*#__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: "M20.06 5.94a1.5 1.5 0 0 1 0 2.12l-10 10a1.5 1.5 0 0 1-2.12 0l-5-5a1.5 1.5 0 0 1 2.12-2.12L9 14.878l8.94-8.94a1.5 1.5 0 0 1 2.12 0"
40
- })));
41
- CheckIcon24.displayName = 'CheckIcon24';
42
- const CheckIcon28 = /*#__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: "M23.014 6.894a1.5 1.5 0 0 0-2.12.092l-9.941 10.846-4.892-4.893a1.5 1.5 0 0 0-2.122 2.122l6 6a1.5 1.5 0 0 0 2.167-.047l11-12a1.5 1.5 0 0 0-.092-2.12"
48
- })));
49
- CheckIcon28.displayName = 'CheckIcon28';
50
- const CheckIcon = /*#__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(CheckIcon16, {
74
- className: styles.variant16
75
- }), /*#__PURE__*/React.createElement(CheckIcon20, {
76
- className: styles.variant20
77
- }), /*#__PURE__*/React.createElement(CheckIcon24, {
78
- className: styles.variant24
79
- }), /*#__PURE__*/React.createElement(CheckIcon28, {
80
- className: styles.variant28
81
- }));
82
- }
83
-
84
- if (size === Size['xs']) {
85
- return /*#__PURE__*/React.createElement(CheckIcon16, mainProps);
86
- }
87
-
88
- if (size === Size['s']) {
89
- return /*#__PURE__*/React.createElement(CheckIcon20, mainProps);
90
- }
91
-
92
- if (size === Size['m']) {
93
- return /*#__PURE__*/React.createElement(CheckIcon24, mainProps);
94
- }
95
-
96
- return /*#__PURE__*/React.createElement(CheckIcon28, mainProps);
97
- });
98
- CheckIcon.displayName = 'CheckIcon';
99
- CheckIcon.propTypes = {
100
- className: PropTypes.string,
101
- theme: PropTypes.oneOf(["light", "dark"]),
102
- size: PropTypes.oneOf(["xs", "s", "m", "l"]),
103
- 'data-render-all-sizes': PropTypes.bool,
104
- style: PropTypes.object
105
- };
106
- export { Size, CheckIcon as default };
@@ -1,106 +0,0 @@
1
- import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import cn from 'classnames';
5
- import styles from './index.css.js';
6
- const sizeStyles = {
7
- "xs": styles.sizeXS,
8
- "s": styles.sizeS,
9
- "m": styles.sizeM,
10
- "l": styles.sizeL
11
- };
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
- }
87
-
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);
97
- });
98
- CloseIcon.displayName = 'CloseIcon';
99
- CloseIcon.propTypes = {
100
- className: PropTypes.string,
101
- theme: PropTypes.oneOf(["light", "dark"]),
102
- size: PropTypes.oneOf(["xs", "s", "m", "l"]),
103
- 'data-render-all-sizes': PropTypes.bool,
104
- style: PropTypes.object
105
- };
106
- export { Size, CloseIcon as default };
@@ -1,106 +0,0 @@
1
- import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import cn from 'classnames';
5
- import styles from './index.css.js';
6
- const sizeStyles = {
7
- "xs": styles.sizeXS,
8
- "s": styles.sizeS,
9
- "m": styles.sizeM,
10
- "l": styles.sizeL
11
- };
12
- const Size = {
13
- "xs": "xs",
14
- "s": "s",
15
- "m": "m",
16
- "l": "l"
17
- };
18
- const DownIcon16 = /*#__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: "M11.53 5.97a.75.75 0 0 0-1.06 0L8 8.44 5.53 5.97a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 0 0 0-1.06"
24
- })));
25
- DownIcon16.displayName = 'DownIcon16';
26
- const DownIcon20 = /*#__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: "M14.707 7.293a1 1 0 0 0-1.414 0L10 10.586 6.707 7.293a1 1 0 0 0-1.414 1.414l4 4a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0 0-1.414"
32
- })));
33
- DownIcon20.displayName = 'DownIcon20';
34
- const DownIcon24 = /*#__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: "M19.06 7.94a1.5 1.5 0 0 0-2.12 0L12 12.878l-4.94-4.94a1.5 1.5 0 1 0-2.12 2.122l6 6a1.5 1.5 0 0 0 2.12 0l6-6a1.5 1.5 0 0 0 0-2.122"
40
- })));
41
- DownIcon24.displayName = 'DownIcon24';
42
- const DownIcon28 = /*#__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: "M22.06 9.44a1.5 1.5 0 0 0-2.12 0L14 15.378l-5.94-5.94a1.5 1.5 0 1 0-2.12 2.122l7 7a1.5 1.5 0 0 0 2.12 0l7-7a1.5 1.5 0 0 0 0-2.122"
48
- })));
49
- DownIcon28.displayName = 'DownIcon28';
50
- const DownIcon = /*#__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(DownIcon16, {
74
- className: styles.variant16
75
- }), /*#__PURE__*/React.createElement(DownIcon20, {
76
- className: styles.variant20
77
- }), /*#__PURE__*/React.createElement(DownIcon24, {
78
- className: styles.variant24
79
- }), /*#__PURE__*/React.createElement(DownIcon28, {
80
- className: styles.variant28
81
- }));
82
- }
83
-
84
- if (size === Size['xs']) {
85
- return /*#__PURE__*/React.createElement(DownIcon16, mainProps);
86
- }
87
-
88
- if (size === Size['s']) {
89
- return /*#__PURE__*/React.createElement(DownIcon20, mainProps);
90
- }
91
-
92
- if (size === Size['m']) {
93
- return /*#__PURE__*/React.createElement(DownIcon24, mainProps);
94
- }
95
-
96
- return /*#__PURE__*/React.createElement(DownIcon28, mainProps);
97
- });
98
- DownIcon.displayName = 'DownIcon';
99
- DownIcon.propTypes = {
100
- className: PropTypes.string,
101
- theme: PropTypes.oneOf(["light", "dark"]),
102
- size: PropTypes.oneOf(["xs", "s", "m", "l"]),
103
- 'data-render-all-sizes': PropTypes.bool,
104
- style: PropTypes.object
105
- };
106
- export { Size, DownIcon as default };