@jetbrains/ring-ui 5.0.69 → 5.0.71

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.
@@ -40,21 +40,14 @@
40
40
 
41
41
  .icons {
42
42
  position: absolute;
43
- top: -3px;
43
+ top: 0;
44
44
  right: 5px;
45
+ bottom: 0;
45
46
 
46
47
  transition: color var(--ring-ease);
47
48
 
48
49
  color: var(--ring-icon-secondary-color);
49
50
 
50
- line-height: calc(unit * 4);
51
-
52
- & :global(.ring-loader_inline) {
53
- top: 2px;
54
-
55
- margin-right: 2px;
56
- }
57
-
58
51
  @nest .inputMode & {
59
52
  font-size: var(--ring-font-size);
60
53
  }
@@ -235,7 +228,3 @@
235
228
 
236
229
  color: inherit;
237
230
  }
238
-
239
- .heightS .icons {
240
- top: -5px;
241
- }
@@ -740,14 +740,15 @@ export default class Select extends Component {
740
740
  const { selected } = this.state;
741
741
  const { disabled, clear, hideArrow } = this.props;
742
742
  const icons = [];
743
+ const height = this.props.height || this.context;
743
744
  if (!Array.isArray(selected) && selected?.icon) {
744
745
  icons.push(<button title="Toggle options popup" type="button" className={styles.selectedIcon} key="selected" disabled={this.props.disabled} onClick={this._clickHandler} style={{ backgroundImage: `url(${selected.icon})` }}/>);
745
746
  }
746
747
  if (clear && !disabled && !this._selectionIsEmpty()) {
747
- icons.push(<Button title="Clear selection" data-test="ring-clear-select" className={styles.clearIcon} key="close" disabled={this.props.disabled} onClick={this.clear} icon={closeIcon}/>);
748
+ icons.push(<Button title="Clear selection" data-test="ring-clear-select" className={styles.clearIcon} key="close" disabled={this.props.disabled} onClick={this.clear} height={height} icon={closeIcon}/>);
748
749
  }
749
750
  if (!hideArrow) {
750
- icons.push(<Button title="Toggle options popup" className={styles.chevron} iconClassName={styles.chevronIcon} icon={chevronDownIcon} key="hide" disabled={this.props.disabled} onClick={this._clickHandler}/>);
751
+ icons.push(<Button title="Toggle options popup" className={styles.chevron} iconClassName={styles.chevronIcon} icon={chevronDownIcon} key="hide" disabled={this.props.disabled} height={height} onClick={this._clickHandler}/>);
751
752
  }
752
753
  return icons;
753
754
  }
@@ -782,7 +783,7 @@ export default class Select extends Component {
782
783
  });
783
784
  const icons = this._getIcons();
784
785
  const style = getStyle(icons.length);
785
- const iconsNode = <span className={styles.icons}>{icons}</span>;
786
+ const iconsNode = <div className={styles.icons}>{icons}</div>;
786
787
  const ariaProps = this.state.showPopup
787
788
  ? {
788
789
  'aria-owns': this.listId,
@@ -829,7 +830,7 @@ export default class Select extends Component {
829
830
  case Type.INLINE:
830
831
  return (<div className={classes} ref={this.nodeRef} data-test={dataTests('ring-select', dataTest)}>
831
832
  {shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
832
- <Anchor {...ariaProps} id={this.props.id} onClick={this._clickHandler} data-test="ring-select__focus" disabled={this.props.disabled} active={this.state.showPopup}>
833
+ <Anchor {...ariaProps} className={this.props.buttonClassName ?? undefined} id={this.props.id} onClick={this._clickHandler} data-test="ring-select__focus" disabled={this.props.disabled} active={this.state.showPopup}>
833
834
  {this._getPlaceholder()}
834
835
  </Anchor>
835
836
  {this._renderPopup()}
@@ -857,6 +857,7 @@ class Select extends Component {
857
857
  hideArrow
858
858
  } = this.props;
859
859
  const icons = [];
860
+ const height = this.props.height || this.context;
860
861
  if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {
861
862
  icons.push( /*#__PURE__*/React.createElement("button", {
862
863
  title: "Toggle options popup",
@@ -878,6 +879,7 @@ class Select extends Component {
878
879
  key: "close",
879
880
  disabled: this.props.disabled,
880
881
  onClick: this.clear,
882
+ height: height,
881
883
  icon: closeIcon
882
884
  }));
883
885
  }
@@ -889,6 +891,7 @@ class Select extends Component {
889
891
  icon: chevronDownIcon,
890
892
  key: "hide",
891
893
  disabled: this.props.disabled,
894
+ height: height,
892
895
  onClick: this._clickHandler
893
896
  }));
894
897
  }
@@ -917,7 +920,7 @@ class Select extends Component {
917
920
  };
918
921
  }
919
922
  renderSelect(activeItemId) {
920
- var _this$props$label3, _this$props$label4, _this$_popup5, _this$_popup5$list;
923
+ var _this$props$label3, _this$props$label4, _this$_popup5, _this$_popup5$list, _this$props$buttonCla;
921
924
  const dataTest = this.props['data-test'];
922
925
  const {
923
926
  selectedLabel
@@ -931,7 +934,7 @@ class Select extends Component {
931
934
  });
932
935
  const icons = this._getIcons();
933
936
  const style = getStyle(icons.length);
934
- const iconsNode = /*#__PURE__*/React.createElement("span", {
937
+ const iconsNode = /*#__PURE__*/React.createElement("div", {
935
938
  className: modules_9d0de074.icons
936
939
  }, icons);
937
940
  const ariaProps = this.state.showPopup ? {
@@ -1014,6 +1017,7 @@ class Select extends Component {
1014
1017
  map: this.getShortcutsMap(),
1015
1018
  scope: this.shortcutsScope
1016
1019
  }), /*#__PURE__*/React.createElement(Anchor, _extends({}, ariaProps, {
1020
+ className: (_this$props$buttonCla = this.props.buttonClassName) !== null && _this$props$buttonCla !== void 0 ? _this$props$buttonCla : undefined,
1017
1021
  id: this.props.id,
1018
1022
  onClick: this._clickHandler,
1019
1023
  "data-test": "ring-select__focus",