@luminati-io/uikit 1.9.13 → 1.9.14

Sign up to get free protection for your applications and to get access to all the features.
package/dist/uikit.umd.js CHANGED
@@ -24237,7 +24237,7 @@ var useCustomStyles = function useCustomStyles(size) {
24237
24237
  return _objectSpread(_objectSpread({}, baseStyles), {}, {
24238
24238
  padding: 0,
24239
24239
  boxSizing: 'border-box',
24240
- minWidth: '168px',
24240
+ minWidth: 'fit-content',
24241
24241
  maxWidth: '540px',
24242
24242
  width: '100%',
24243
24243
  backgroundColor: _theme__WEBPACK_IMPORTED_MODULE_8__["default"].color.white,
@@ -24775,14 +24775,6 @@ var FieldWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().for
24775
24775
  setActive(false);
24776
24776
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
24777
24777
  };
24778
- var onValueChange = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
24779
- onChange.apply(void 0, arguments);
24780
- // XXX vadimv: hack to autoresize textarea
24781
- if (autoresize) {
24782
- field.current.style.height = 0;
24783
- field.current.style.height = (0,_utils__WEBPACK_IMPORTED_MODULE_9__.toPixel)(field.current.scrollHeight);
24784
- }
24785
- }, [onChange]);
24786
24778
  var onWrapperClick = function onWrapperClick() {
24787
24779
  var _field$current;
24788
24780
  return field === null || field === void 0 ? void 0 : (_field$current = field.current) === null || _field$current === void 0 ? void 0 : _field$current.focus();
@@ -24791,6 +24783,10 @@ var FieldWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().for
24791
24783
  var _field$current2;
24792
24784
  if (autofocus) field === null || field === void 0 ? void 0 : (_field$current2 = field.current) === null || _field$current2 === void 0 ? void 0 : _field$current2.focus();
24793
24785
  }, []);
24786
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
24787
+ // XXX vadimv: hack to autoresize textarea
24788
+ if (autoresize) field.current.style.height = (0,_utils__WEBPACK_IMPORTED_MODULE_9__.toPixel)(field.current.scrollHeight);
24789
+ }, [autoresize, value]);
24794
24790
  var labelId = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.useLabelId)(props.id);
24795
24791
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_5__.Flex, _extends({
24796
24792
  ref: ref
@@ -24817,7 +24813,7 @@ var FieldWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().for
24817
24813
  }, leftInnerContent, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Field, _extends({}, props.inputProps, {
24818
24814
  ref: field,
24819
24815
  disabled: disabled,
24820
- onChange: onValueChange,
24816
+ onChange: onChange,
24821
24817
  onFocus: onFieldFocus,
24822
24818
  onBlur: onFieldBlur,
24823
24819
  value: value,
@@ -25468,6 +25464,11 @@ var Link = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(
25468
25464
  size = props.size,
25469
25465
  icon = props.icon,
25470
25466
  rest = _objectWithoutProperties(props, _excluded);
25467
+ if (variant == 'inline') {
25468
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(InlineLink, _extends({
25469
+ ref: ref
25470
+ }, rest, (0,_utils__WEBPACK_IMPORTED_MODULE_6__.getLinkProps)(props)), text);
25471
+ }
25471
25472
  var _getIconProps = (0,_utils__WEBPACK_IMPORTED_MODULE_6__.getIconProps)('Link', props),
25472
25473
  isLeft = _getIconProps.isLeft,
25473
25474
  isRight = _getIconProps.isRight,
@@ -25496,16 +25497,21 @@ Link.defaultProps = {
25496
25497
  };
25497
25498
  Link.propTypes = {
25498
25499
  text: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string.isRequired),
25499
- variant: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['primary', 'secondary']),
25500
+ variant: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['primary', 'secondary', 'inline']),
25500
25501
  size: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['sm', 'md', 'lg']),
25501
25502
  icon: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(_utils__WEBPACK_IMPORTED_MODULE_6__.iconNames),
25502
25503
  iconPlacement: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['left', 'right']),
25503
25504
  href: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
25504
25505
  newTab: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
25505
25506
  };
25507
+ var InlineLink = styled_components__WEBPACK_IMPORTED_MODULE_2___default().a.withConfig({
25508
+ displayName: "InlineLink",
25509
+ componentId: "sc-1ilmd36-0"
25510
+ })(["justify-content:center;text-decoration:underline;background:0 none;border:0 none;padding:0;cursor:pointer;&:disabled{cursor:not-allowed;}&:hover,:visited,:focus{text-decoration:underline;}"]);
25511
+ InlineLink.displayName = 'InlineLink';
25506
25512
  var StyledLink = styled_components__WEBPACK_IMPORTED_MODULE_2___default().a.withConfig({
25507
25513
  displayName: "StyledLink",
25508
- componentId: "sc-1ilmd36-0"
25514
+ componentId: "sc-1ilmd36-1"
25509
25515
  })(["display:inline-flex;align-items:center;justify-content:center;text-decoration:none;background:0 none;border:0 none;padding:0;gap:", ";[data-label]{color:", ";text-decoration:", ";}[data-icon]{color:", ";}cursor:pointer;&:disabled{cursor:not-allowed;}&:hover:not(:disabled){[data-label]{color:", ";text-decoration:", ";}[data-icon]{color:", ";}}&:hover,:visited,:focus{text-decoration:none;}"], function (props) {
25510
25516
  return (0,_utils__WEBPACK_IMPORTED_MODULE_6__.toPixel)(props.size == 'lg' ? 8 : 4);
25511
25517
  }, function (props) {
@@ -25569,8 +25575,7 @@ __webpack_require__.r(__webpack_exports__);
25569
25575
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
25570
25576
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
25571
25577
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
25572
- /* harmony import */ var _menu_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./menu_item */ "./src/menu/menu_item.js");
25573
- /* harmony import */ var _shared__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared */ "./src/menu/shared.js");
25578
+ /* harmony import */ var _shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared */ "./src/menu/shared.js");
25574
25579
  // LICENSE_CODE ZON
25575
25580
 
25576
25581
 
@@ -25582,19 +25587,23 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
25582
25587
 
25583
25588
 
25584
25589
 
25585
-
25586
25590
  var Menu = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(function (props, ref) {
25587
25591
  var items = props.items,
25588
25592
  size = props.size,
25589
25593
  rest = _objectWithoutProperties(props, _excluded);
25590
25594
  if (!items || !items.length) return null;
25591
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_3__.MenuContainer, _extends({
25595
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_2__.MenuContainer, _extends({
25592
25596
  ref: ref
25593
25597
  }, rest, {
25594
25598
  role: "menu",
25595
25599
  "data-testid": "menu"
25596
- }), (0,_menu_item__WEBPACK_IMPORTED_MODULE_2__.buildMenuItems)(items, {
25597
- size: size
25600
+ }), items.map(function (item, ind) {
25601
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Menu.Item, _extends({
25602
+ key: item.key
25603
+ }, item, {
25604
+ size: size,
25605
+ isFirstItem: ind == 0
25606
+ }));
25598
25607
  }));
25599
25608
  });
25600
25609
  Menu.displayName = 'Menu';
@@ -25618,7 +25627,6 @@ Menu.propTypes = {
25618
25627
  "use strict";
25619
25628
  __webpack_require__.r(__webpack_exports__);
25620
25629
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25621
- /* harmony export */ "buildMenuItems": () => (/* binding */ buildMenuItems),
25622
25630
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25623
25631
  /* harmony export */ });
25624
25632
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
@@ -25633,9 +25641,10 @@ __webpack_require__.r(__webpack_exports__);
25633
25641
  /* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../tooltip */ "./src/tooltip.js");
25634
25642
  /* harmony import */ var _typography__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typography */ "./src/typography/index.js");
25635
25643
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils */ "./src/utils.js");
25636
- /* harmony import */ var _menu_item_divider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./menu_item_divider */ "./src/menu/menu_item_divider.js");
25637
- /* harmony import */ var _menu_item_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./menu_item_group */ "./src/menu/menu_item_group.js");
25638
- /* harmony import */ var _shared__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./shared */ "./src/menu/shared.js");
25644
+ /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./menu */ "./src/menu/menu.js");
25645
+ /* harmony import */ var _menu_item_divider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./menu_item_divider */ "./src/menu/menu_item_divider.js");
25646
+ /* harmony import */ var _menu_item_group__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./menu_item_group */ "./src/menu/menu_item_group.js");
25647
+ /* harmony import */ var _shared__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./shared */ "./src/menu/shared.js");
25639
25648
  // LICENSE_CODE ZON
25640
25649
 
25641
25650
 
@@ -25657,6 +25666,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
25657
25666
 
25658
25667
 
25659
25668
 
25669
+
25660
25670
  var MenuItem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(function (props, ref) {
25661
25671
  var type = props.type,
25662
25672
  text = props.text,
@@ -25672,15 +25682,15 @@ var MenuItem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forward
25672
25682
  subMenu = props.subMenu,
25673
25683
  tooltip = props.tooltip,
25674
25684
  rest = _objectWithoutProperties(props, _excluded);
25675
- if (type == 'divider') return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_menu_item_divider__WEBPACK_IMPORTED_MODULE_9__["default"], {
25685
+ if (type == 'divider') return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_menu_item_divider__WEBPACK_IMPORTED_MODULE_10__["default"], {
25676
25686
  ref: ref
25677
25687
  });
25678
- var subItems = Array.isArray(children) && children.length ? buildMenuItems(children, {
25688
+ var subItems = buildSubItems(children, {
25679
25689
  size: size
25680
- }) : undefined;
25690
+ });
25681
25691
  var isSubMenu = subMenu || subItems;
25682
25692
  if (type == 'group') {
25683
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_menu_item_group__WEBPACK_IMPORTED_MODULE_10__["default"], _extends({
25693
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_menu_item_group__WEBPACK_IMPORTED_MODULE_11__["default"], _extends({
25684
25694
  ref: ref,
25685
25695
  text: text
25686
25696
  }, rest), subItems);
@@ -25691,7 +25701,7 @@ var MenuItem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forward
25691
25701
  var iconColor = disabled ? 'gray_6' : variant == 'negative' ? 'red_10' : 'gray_9';
25692
25702
  var labelColor = disabled ? 'gray_9' : variant == 'negative' ? 'red_11' : 'gray_11_50';
25693
25703
  var Comp = subItems ? MenuItemPopover : MenuItemButton;
25694
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_11__.MenuItemContainer, {
25704
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_12__.MenuItemContainer, {
25695
25705
  ref: ref,
25696
25706
  as: tag,
25697
25707
  role: "menuitem"
@@ -25707,8 +25717,7 @@ var MenuItem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forward
25707
25717
  }
25708
25718
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(MenuItemText, null, isLeft && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], _extends({}, iconProps, {
25709
25719
  color: iconColor
25710
- })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_7__.Label, {
25711
- variant: "sm",
25720
+ })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(PrimaryText, {
25712
25721
  no_wrap: true,
25713
25722
  color: labelColor
25714
25723
  }, text), isSubMenu && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(SecondaryIcon, {
@@ -25755,7 +25764,7 @@ var MenuItemPopover = (0,_hoc__WEBPACK_IMPORTED_MODULE_3__.withPopover)(function
25755
25764
  onClick: props.popover.toggle
25756
25765
  }));
25757
25766
  }, function (props) {
25758
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_11__.MenuContainer, {
25767
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_12__.MenuContainer, {
25759
25768
  onClick: props.popover.hide
25760
25769
  }, props.subItems);
25761
25770
  }, {
@@ -25787,13 +25796,20 @@ var RightIcon = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_icon__
25787
25796
  displayName: "RightIcon",
25788
25797
  componentId: "sc-vtiffr-2"
25789
25798
  })(["margin-left:auto;"]);
25799
+ var PrimaryText = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typography__WEBPACK_IMPORTED_MODULE_7__.Label).attrs({
25800
+ variant: 'sm',
25801
+ no_wrap: true
25802
+ }).withConfig({
25803
+ displayName: "PrimaryText",
25804
+ componentId: "sc-vtiffr-3"
25805
+ })(["overflow-x:hidden;text-overflow:ellipsis;"]);
25790
25806
  var SecondaryText = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typography__WEBPACK_IMPORTED_MODULE_7__.Label).attrs({
25791
25807
  variant: 'sm',
25792
25808
  color: 'gray_9',
25793
25809
  no_wrap: true
25794
25810
  }).withConfig({
25795
25811
  displayName: "SecondaryText",
25796
- componentId: "sc-vtiffr-3"
25812
+ componentId: "sc-vtiffr-4"
25797
25813
  })(["margin-left:auto;"]);
25798
25814
  var Description = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typography__WEBPACK_IMPORTED_MODULE_7__.Label).attrs({
25799
25815
  variant: 'xs',
@@ -25801,16 +25817,16 @@ var Description = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_typo
25801
25817
  no_wrap: true
25802
25818
  }).withConfig({
25803
25819
  displayName: "Description",
25804
- componentId: "sc-vtiffr-4"
25820
+ componentId: "sc-vtiffr-5"
25805
25821
  })(["max-width:516px;text-overflow:ellipsis;overflow-x:clip;"]);
25806
- var buildMenuItems = function buildMenuItems(items, itemProps) {
25807
- return items.map(function (item, ind) {
25808
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(MenuItem, _extends({
25822
+ var buildSubItems = function buildSubItems(children, itemProps) {
25823
+ return Array.isArray(children) && children.length > 0 ? children.map(function (item, ind) {
25824
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_9__["default"].Item, _extends({
25809
25825
  key: item.key
25810
25826
  }, item, itemProps, {
25811
25827
  isFirstItem: ind == 0
25812
25828
  }));
25813
- });
25829
+ }) : undefined;
25814
25830
  };
25815
25831
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuItem);
25816
25832