@datarobot/design-system 30.5.0 → 30.6.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.
@@ -60232,7 +60232,8 @@ var VALIDATION_RULE_TYPES = {
60232
60232
  SUCCESS_INFO: 'success-info',
60233
60233
  IN_PROGRESS: 'in-progress',
60234
60234
  EXPIRED: 'expired',
60235
- DISABLED: 'disabled'
60235
+ DISABLED: 'disabled',
60236
+ THINKING: 'thinking'
60236
60237
  };
60237
60238
  var MESSAGE_DISPLAY_LOCATION = {
60238
60239
  INLINE: 'inline',
@@ -69754,8 +69755,9 @@ var Markdown = function Markdown(_ref) {
69754
69755
  /* harmony import */ var _fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @fortawesome/free-solid-svg-icons/faCircleNotch */ "@fortawesome/free-solid-svg-icons/faCircleNotch");
69755
69756
  /* harmony import */ var _fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7__);
69756
69757
  /* harmony import */ var _font_awesome_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../font-awesome-icon */ "./src/components/font-awesome-icon/index.ts");
69757
- /* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./message.less */ "./src/components/message/message.less");
69758
- /* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_message_less__WEBPACK_IMPORTED_MODULE_9__);
69758
+ /* harmony import */ var _thinking_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./thinking-icon */ "./src/components/message/thinking-icon.tsx");
69759
+ /* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./message.less */ "./src/components/message/message.less");
69760
+ /* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_message_less__WEBPACK_IMPORTED_MODULE_10__);
69759
69761
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
69760
69762
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
69761
69763
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
@@ -69770,6 +69772,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
69770
69772
 
69771
69773
 
69772
69774
 
69775
+
69773
69776
  var MESSAGE_TYPES = {
69774
69777
  DISABLED: 'disabled',
69775
69778
  INFO: 'info',
@@ -69778,7 +69781,8 @@ var MESSAGE_TYPES = {
69778
69781
  SUCCESS: 'success',
69779
69782
  SUCCESS_INFO: 'success-info',
69780
69783
  IN_PROGRESS: 'in-progress',
69781
- EXPIRED: 'expired'
69784
+ EXPIRED: 'expired',
69785
+ THINKING: 'thinking'
69782
69786
  };
69783
69787
  var MESSAGE_ICON_PLACEMENT = {
69784
69788
  LEFT: 'left',
@@ -69833,6 +69837,10 @@ function getMessageConfig(icons, type) {
69833
69837
  icon: icon,
69834
69838
  className: 'expired'
69835
69839
  };
69840
+ case MESSAGE_TYPES.THINKING:
69841
+ return {
69842
+ className: 'thinking'
69843
+ };
69836
69844
  default:
69837
69845
  return {
69838
69846
  icon: icon,
@@ -69863,22 +69871,135 @@ function Message(_ref) {
69863
69871
  _ref$icons = _ref.icons,
69864
69872
  icons = _ref$icons === void 0 ? MESSAGE_ICONS : _ref$icons;
69865
69873
  var messageConfig = getMessageConfig(icons, type);
69866
- var icon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_font_awesome_icon__WEBPACK_IMPORTED_MODULE_8__.FontAwesomeIcon, {
69867
- icon: messageConfig.icon,
69868
- spin: type === MESSAGE_TYPES.IN_PROGRESS
69869
- });
69874
+ var renderIcon = function renderIcon() {
69875
+ if (type === MESSAGE_TYPES.THINKING) {
69876
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_thinking_icon__WEBPACK_IMPORTED_MODULE_9__.ThinkingIcon, {
69877
+ size: size
69878
+ });
69879
+ }
69880
+ if (messageConfig.icon) {
69881
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_font_awesome_icon__WEBPACK_IMPORTED_MODULE_8__.FontAwesomeIcon, {
69882
+ icon: messageConfig.icon,
69883
+ spin: type === MESSAGE_TYPES.IN_PROGRESS
69884
+ });
69885
+ }
69886
+ return null;
69887
+ };
69888
+ var icon = renderIcon();
69889
+ var resolvedChildren = type === MESSAGE_TYPES.THINKING ? children !== null && children !== void 0 ? children : 'Thinking' : children;
69870
69890
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
69871
69891
  className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('message-component', isStatus && 'status', messageConfig.className, {
69872
69892
  'center-status': isCentered,
69873
69893
  sm: size === MESSAGE_SIZES.SM
69874
- },
69875
- // global styles for now, should be moved into the components styles, once we message css usages to React
69876
- className, "with-".concat(iconPlacement, "-icon")),
69894
+ }, className, "with-".concat(iconPlacement, "-icon")),
69877
69895
  "test-id": testId,
69878
69896
  id: id,
69879
69897
  "aria-live": "polite",
69880
69898
  role: messageConfig === null || messageConfig === void 0 ? void 0 : messageConfig.role
69881
- }, iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, children), iconPlacement === MESSAGE_ICON_PLACEMENT.RIGHT && icon);
69899
+ }, iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, resolvedChildren), iconPlacement === MESSAGE_ICON_PLACEMENT.RIGHT && icon);
69900
+ }
69901
+
69902
+ /***/ }),
69903
+
69904
+ /***/ "./src/components/message/thinking-icon.less":
69905
+ /*!***************************************************!*\
69906
+ !*** ./src/components/message/thinking-icon.less ***!
69907
+ \***************************************************/
69908
+ /***/ (() => {
69909
+
69910
+ // extracted by mini-css-extract-plugin
69911
+
69912
+ /***/ }),
69913
+
69914
+ /***/ "./src/components/message/thinking-icon.tsx":
69915
+ /*!**************************************************!*\
69916
+ !*** ./src/components/message/thinking-icon.tsx ***!
69917
+ \**************************************************/
69918
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
69919
+
69920
+ "use strict";
69921
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
69922
+ /* harmony export */ ThinkingIcon: () => (/* binding */ ThinkingIcon)
69923
+ /* harmony export */ });
69924
+ /* unused harmony export THINKING_ICON_SIZES */
69925
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
69926
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
69927
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
69928
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
69929
+ /* harmony import */ var _thinking_icon_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./thinking-icon.less */ "./src/components/message/thinking-icon.less");
69930
+ /* harmony import */ var _thinking_icon_less__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_thinking_icon_less__WEBPACK_IMPORTED_MODULE_2__);
69931
+
69932
+
69933
+
69934
+ var THINKING_ICON_SIZES = {
69935
+ SM: 'sm',
69936
+ MD: 'md'
69937
+ };
69938
+ // Bar geometry in natural SVG coordinates (viewBox 0 0 18.667 18).
69939
+ var BARS = [{
69940
+ top: 0,
69941
+ left: 0,
69942
+ width: 9.334
69943
+ }, {
69944
+ top: 2,
69945
+ left: 9.334,
69946
+ width: 4.661
69947
+ }, {
69948
+ top: 4,
69949
+ left: 0,
69950
+ width: 9.334
69951
+ }, {
69952
+ top: 6,
69953
+ left: 14,
69954
+ width: 4.667
69955
+ }, {
69956
+ top: 8,
69957
+ left: 0,
69958
+ width: 14
69959
+ }, {
69960
+ top: 10,
69961
+ left: 14,
69962
+ width: 4.667
69963
+ }, {
69964
+ top: 12,
69965
+ left: 0,
69966
+ width: 9.334
69967
+ }, {
69968
+ top: 14,
69969
+ left: 9.334,
69970
+ width: 4.661
69971
+ }, {
69972
+ top: 16,
69973
+ left: 0,
69974
+ width: 9.334
69975
+ }];
69976
+ var BAR_HEIGHT = 2;
69977
+
69978
+ // Staggered cascade: left backbone bars enter first, right accent bars follow.
69979
+ // Entry order: r1 → r7 → r3 → r9 → r5 → r8 → r2 → r4 → r6
69980
+ var DELAYS = [0.0, 0.62, 0.22, 0.7, 0.44, 0.76, 0.12, 0.54, 0.32];
69981
+ function ThinkingIcon(_ref) {
69982
+ var _ref$size = _ref.size,
69983
+ size = _ref$size === void 0 ? THINKING_ICON_SIZES.MD : _ref$size;
69984
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
69985
+ className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('thinking-icon', size),
69986
+ viewBox: "0 0 18.667 18",
69987
+ "aria-hidden": "true"
69988
+ }, BARS.map(function (bar, i) {
69989
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", {
69990
+ key: i,
69991
+ className: "bar",
69992
+ x: bar.left,
69993
+ y: bar.top,
69994
+ width: bar.width,
69995
+ height: BAR_HEIGHT
69996
+ // eslint-disable-next-line react/forbid-dom-props
69997
+ ,
69998
+ style: {
69999
+ animationDelay: "".concat(DELAYS[i], "s")
70000
+ }
70001
+ });
70002
+ }));
69882
70003
  }
69883
70004
 
69884
70005
  /***/ }),
@@ -83642,9 +83763,7 @@ function TextEditorContent(_ref4) {
83642
83763
  var Editable = slateReact.Editable,
83643
83764
  useSlate = slateReact.useSlate;
83644
83765
  var editor = useSlate();
83645
- /* eslint-disable-next-line testing-library/render-result-naming-convention */
83646
83766
  var ElementNode = elementRender;
83647
- /* eslint-disable-next-line testing-library/render-result-naming-convention */
83648
83767
  var LeafNode = leafRender;
83649
83768
 
83650
83769
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -87973,11 +88092,10 @@ function CheckboxOptionList(_ref2) {
87973
88092
  "test-id": "typeahead-dropdown-list",
87974
88093
  id: listId,
87975
88094
  ref: function ref(el) {
87976
- var _ref3;
87977
- // we have to search for parent container which is rendered by PopperDropdownWrapper
87978
- // in typeahead component, because it is an actual scrollable container,
87979
- // and we need it to correctly scroll to active option when navigating via arrow keys
87980
- scrollableContainerRef.current = (_ref3 = el === null || el === void 0 ? void 0 : el.parentElement) !== null && _ref3 !== void 0 ? _ref3 : null;
88095
+ // The element itself is the scrollable container (overflow-y: auto on
88096
+ // .checkbox-multiselect-container); keyboard navigation needs the ref
88097
+ // here so active options can be scrolled into view.
88098
+ scrollableContainerRef.current = el;
87981
88099
  }
87982
88100
  }, visibleOptions.map(function (option) {
87983
88101
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CheckboxListItem, {
@@ -87994,24 +88112,24 @@ function CheckboxOptionList(_ref2) {
87994
88112
  });
87995
88113
  }));
87996
88114
  }
87997
- function CheckboxMultiselectTypeahead(_ref4) {
88115
+ function CheckboxMultiselectTypeahead(_ref3) {
87998
88116
  var _items$map, _options$map;
87999
- var options = _ref4.options,
88000
- optionId = _ref4.optionId,
88001
- _ref4$optionLabel = _ref4.optionLabel,
88002
- optionLabel = _ref4$optionLabel === void 0 ? 'label' : _ref4$optionLabel,
88003
- _ref4$items = _ref4.items,
88004
- items = _ref4$items === void 0 ? [] : _ref4$items,
88005
- isDisabled = _ref4.isDisabled,
88006
- validity = _ref4.validity,
88007
- _ref4$onSelect = _ref4.onSelect,
88008
- onChange = _ref4$onSelect === void 0 ? function () {} : _ref4$onSelect,
88009
- selectAllRow = _ref4.selectAllRow,
88010
- _ref4$optionComponent = _ref4.optionComponent,
88011
- optionComponent = _ref4$optionComponent === void 0 ? null : _ref4$optionComponent,
88012
- _ref4$shouldShowValid = _ref4.shouldShowValidityOnTouched,
88013
- shouldShowValidityOnTouched = _ref4$shouldShowValid === void 0 ? false : _ref4$shouldShowValid,
88014
- otherMultiSelectTypeaheadProps = _objectWithoutProperties(_ref4, _excluded);
88117
+ var options = _ref3.options,
88118
+ optionId = _ref3.optionId,
88119
+ _ref3$optionLabel = _ref3.optionLabel,
88120
+ optionLabel = _ref3$optionLabel === void 0 ? 'label' : _ref3$optionLabel,
88121
+ _ref3$items = _ref3.items,
88122
+ items = _ref3$items === void 0 ? [] : _ref3$items,
88123
+ isDisabled = _ref3.isDisabled,
88124
+ validity = _ref3.validity,
88125
+ _ref3$onSelect = _ref3.onSelect,
88126
+ onChange = _ref3$onSelect === void 0 ? function () {} : _ref3$onSelect,
88127
+ selectAllRow = _ref3.selectAllRow,
88128
+ _ref3$optionComponent = _ref3.optionComponent,
88129
+ optionComponent = _ref3$optionComponent === void 0 ? null : _ref3$optionComponent,
88130
+ _ref3$shouldShowValid = _ref3.shouldShowValidityOnTouched,
88131
+ shouldShowValidityOnTouched = _ref3$shouldShowValid === void 0 ? false : _ref3$shouldShowValid,
88132
+ otherMultiSelectTypeaheadProps = _objectWithoutProperties(_ref3, _excluded);
88015
88133
  // multiselect typeahead does not use typeahead logic for rendering validity message,
88016
88134
  // but in its logic it does not do checks on whether input was touched or not
88017
88135
  // didn't want to introduce this to multiselect typeahead component cause not sure if it's needed there,