@plesk/ui-library 3.43.0 → 3.43.2

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.
@@ -58886,7 +58886,7 @@ function useFocusVisible() {
58886
58886
  /***/ ((module) => {
58887
58887
 
58888
58888
  "use strict";
58889
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.43.0","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.(less|css)\\"","format:check":"prettier --check src styleguidist","format":"prettier --write src styleguidist","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.6","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.65.18","marked":"15.0.7","memoize-one":"^6.0.0","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"2.0.0","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^3.1.0","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.25.2","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.25.4","@babel/preset-env":"^7.25.4","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.6","@csstools/postcss-logical-float-and-clear":"^3.0.0","@plesk/eslint-config":"^4.0.0","@plesk/stylelint-config":"^3.0.1","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^16.1.0","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.4","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.9","@types/jest":"^29.5.13","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^6.0.0","@types/node":"^22.5.5","@types/react":"^18.3.8","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.12","@types/react-transition-group":"^4.4.11","@types/svg4everybody":"2.1.5","@types/webpack-env":"^1.18.5","autoprefixer":"^10.4.20","babel-loader":"^10.0.0","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^9.21.0","eslint-config-prettier":"^10.0.2","eslint-plugin-markdown":"^5.1.0","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^11.0.0","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.1","postcss":"^8.4.47","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^8.0.0","prettier":"^3.4.1","puppeteer-core":"22.15.0","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.3.0","style-loader":"^4.0.0","stylelint":"^16.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^8.0.2","stylelint-prettier":"^5.0.2","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.8.2","typescript-eslint":"^8.26.0","webpack":"^5.94.0","webpack-cli":"^6.0.1"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
58889
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.43.2","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.(less|css)\\"","format:check":"prettier --check src styleguidist","format":"prettier --write src styleguidist","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.6","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.65.18","marked":"15.0.7","memoize-one":"^6.0.0","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"2.0.0","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^3.1.0","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.25.2","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.25.4","@babel/preset-env":"^7.25.4","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.6","@csstools/postcss-logical-float-and-clear":"^3.0.0","@plesk/eslint-config":"^4.0.0","@plesk/stylelint-config":"^3.0.1","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^16.1.0","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.4","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.9","@types/jest":"^29.5.13","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^6.0.0","@types/node":"^22.5.5","@types/react":"^18.3.8","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.12","@types/react-transition-group":"^4.4.11","@types/svg4everybody":"2.1.5","@types/webpack-env":"^1.18.5","autoprefixer":"^10.4.20","babel-loader":"^10.0.0","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^9.21.0","eslint-config-prettier":"^10.0.2","eslint-plugin-markdown":"^5.1.0","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^11.0.0","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.1","postcss":"^8.4.47","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^8.0.0","prettier":"^3.4.1","puppeteer-core":"22.15.0","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.3.0","style-loader":"^4.0.0","stylelint":"^16.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^8.0.2","stylelint-prettier":"^5.0.2","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.8.2","typescript-eslint":"^8.26.0","webpack":"^5.94.0","webpack-cli":"^6.0.1"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
58890
58890
 
58891
58891
  /***/ }),
58892
58892
 
@@ -79821,25 +79821,26 @@ const TabList = _ref => {
79821
79821
  monospacedWidth,
79822
79822
  baseClassName
79823
79823
  } = _ref;
79824
- if (!_react.Children.toArray(children).length) {
79825
- return null;
79826
- }
79824
+ const handleTabClick = (tab, position) => {
79825
+ onTabClick(position);
79826
+ tab?.props?.onActivate?.();
79827
+ };
79827
79828
  let tabs = _react.Children.toArray(children);
79828
79829
  tabs = tabs.filter(child => child?.type === _Tab.default);
79829
79830
  const listChildren = tabs.slice(0, visibleLength);
79830
79831
  const menuChildren = tabs.slice(visibleLength);
79831
- const listItems = _react.Children.map(listChildren, (tab, index) => {
79832
+ const listItems = listChildren.map((tab, index) => {
79832
79833
  const position = index + 1;
79833
79834
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabListItem.default, {
79834
79835
  // eslint-disable-line react/no-array-index-key
79835
79836
  tab: tab,
79836
79837
  baseClassName: baseClassName,
79837
79838
  selected: position === active,
79838
- onClick: () => onTabClick(position),
79839
+ onClick: () => handleTabClick(tab, position),
79839
79840
  monospacedWidth: monospacedWidth
79840
79841
  }, index);
79841
79842
  });
79842
- const menuItems = _react.Children.map(menuChildren, (tab, index) => {
79843
+ const menuItems = menuChildren.map((tab, index) => {
79843
79844
  const position = listChildren.length + index + 1;
79844
79845
  const {
79845
79846
  title,
@@ -79868,7 +79869,7 @@ const TabList = _ref => {
79868
79869
  })]
79869
79870
  }),
79870
79871
  active: active === position,
79871
- onClick: () => onTabClick(position),
79872
+ onClick: () => handleTabClick(tab, position),
79872
79873
  className: `${baseClassName}__menu-item`,
79873
79874
  component: Tag,
79874
79875
  ...tabProps,
@@ -79949,32 +79950,36 @@ const TabListItem = _ref => {
79949
79950
  icon,
79950
79951
  onActivate,
79951
79952
  onClose,
79952
- component: Tag = 'a',
79953
+ component = 'a',
79953
79954
  style = {},
79954
79955
  ...tabProps
79955
79956
  } = tab.props;
79956
79957
  const closable = typeof onClose === 'function';
79957
- tabProps.tabIndex = isFake ? -1 : tabProps.tabIndex || 0;
79958
- if (!isFake) {
79959
- tabProps.onKeyDown = (0, _utils.wrapFunction)(tabProps.onKeyDown, e => {
79958
+ const linkProps = isFake ? {
79959
+ tabIndex: -1
79960
+ } : {
79961
+ tabIndex: tabProps.tabIndex || 0,
79962
+ onClick,
79963
+ onKeyDown: (0, _utils.wrapFunction)(tabProps.onKeyDown, e => {
79960
79964
  if (e.key === 'Enter') {
79961
79965
  e.currentTarget.click();
79962
79966
  }
79963
- });
79964
- }
79967
+ }),
79968
+ role: 'tab',
79969
+ 'aria-selected': selected || undefined,
79970
+ ...tabProps
79971
+ };
79972
+ const Tag = isFake ? 'a' : component;
79965
79973
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
79966
79974
  className: (0, _classnames.default)(`${baseClassName}__tab`, selected && `${baseClassName}__tab--selected`, closable && `${baseClassName}__tab--closable`),
79967
79975
  role: isFake ? undefined : 'presentation',
79968
79976
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
79969
79977
  className: `${baseClassName}__link`,
79970
- role: isFake ? undefined : 'tab',
79971
- "aria-selected": selected || undefined,
79972
- onClick: onClick,
79973
79978
  style: {
79974
79979
  width: monospacedWidth || undefined,
79975
79980
  ...style
79976
79981
  },
79977
- ...tabProps,
79982
+ ...linkProps,
79978
79983
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabIcon.default, {
79979
79984
  icon: icon,
79980
79985
  baseClassName: baseClassName
@@ -80061,7 +80066,7 @@ const Tabs = _ref => {
80061
80066
  const tabNavRef = (0, _react.useRef)(null);
80062
80067
  const tabListRef = (0, _react.useRef)(null);
80063
80068
  const fakeAddonRef = (0, _react.useRef)(null);
80064
- const childrenCount = _react.Children.count(children);
80069
+ const childrenCount = _react.Children.toArray(children).length;
80065
80070
  const [active, setActive] = (0, _useActive.useActive)(externalActive);
80066
80071
  const {
80067
80072
  monospacedWidth,
@@ -80076,11 +80081,6 @@ const Tabs = _ref => {
80076
80081
  baseClassName,
80077
80082
  childrenCount
80078
80083
  });
80079
- const handleTabClick = active => {
80080
- setActive(active);
80081
- const tab = Array.isArray(children) ? children[active - 1] : children;
80082
- tab?.props?.onActivate?.();
80083
- };
80084
80084
  const [searching, setSearching] = (0, _react.useState)(false);
80085
80085
  if (!childrenCount) {
80086
80086
  return null;
@@ -80131,7 +80131,7 @@ const Tabs = _ref => {
80131
80131
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabList.default, {
80132
80132
  tabListRef: tabListRef,
80133
80133
  active: active,
80134
- onTabClick: handleTabClick,
80134
+ onTabClick: setActive,
80135
80135
  visibleLength: visibleLength,
80136
80136
  monospacedWidth: monospacedWidth,
80137
80137
  baseClassName: baseClassName,
@@ -80153,7 +80153,7 @@ const Tabs = _ref => {
80153
80153
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
80154
80154
  className: `${baseClassName}__tab-panel`,
80155
80155
  role: "tabpanel",
80156
- children: _react.Children.map(children, (tab, index) => index + 1 === active ? tab : null)
80156
+ children: _react.Children.toArray(children).map((tab, index) => index + 1 === active ? tab : null)
80157
80157
  })]
80158
80158
  });
80159
80159
  };