@synerise/ds-menu 1.4.12 → 1.4.13

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/Elements/Breadcrumb/Breadcrumb.d.ts +3 -3
  3. package/dist/Elements/Breadcrumb/Breadcrumb.js +53 -74
  4. package/dist/Elements/Breadcrumb/Breadcrumb.styles.d.ts +10 -10
  5. package/dist/Elements/Breadcrumb/Breadcrumb.styles.js +45 -60
  6. package/dist/Elements/Breadcrumb/Breadcrumb.types.d.ts +1 -1
  7. package/dist/Elements/Breadcrumb/Breadcrumb.types.js +1 -1
  8. package/dist/Elements/Divider/Divider.d.ts +3 -3
  9. package/dist/Elements/Divider/Divider.js +8 -9
  10. package/dist/Elements/Divider/Divider.styles.d.ts +2 -2
  11. package/dist/Elements/Divider/Divider.styles.js +7 -8
  12. package/dist/Elements/Header/Header.d.ts +2 -2
  13. package/dist/Elements/Header/Header.js +15 -15
  14. package/dist/Elements/Header/Header.styles.d.ts +2 -2
  15. package/dist/Elements/Header/Header.styles.js +9 -9
  16. package/dist/Elements/Header/Header.types.js +1 -1
  17. package/dist/Elements/Item/Danger/Danger.d.ts +2 -3
  18. package/dist/Elements/Item/Danger/Danger.js +10 -10
  19. package/dist/Elements/Item/Danger/Danger.styles.d.ts +2 -2
  20. package/dist/Elements/Item/Danger/Danger.styles.js +28 -33
  21. package/dist/Elements/Item/MenuItem.d.ts +2 -3
  22. package/dist/Elements/Item/MenuItem.js +45 -89
  23. package/dist/Elements/Item/Select/Select.d.ts +2 -3
  24. package/dist/Elements/Item/Select/Select.js +12 -16
  25. package/dist/Elements/Item/Select/Select.styles.d.ts +2 -2
  26. package/dist/Elements/Item/Select/Select.styles.js +13 -18
  27. package/dist/Elements/Item/SubmenuText/SubmenuText.d.ts +2 -3
  28. package/dist/Elements/Item/SubmenuText/SubmenuText.js +15 -24
  29. package/dist/Elements/Item/SubmenuText/SubmenuText.styles.d.ts +3 -3
  30. package/dist/Elements/Item/SubmenuText/SubmenuText.styles.js +18 -23
  31. package/dist/Elements/Item/Text/DynamicLabel.d.ts +1 -1
  32. package/dist/Elements/Item/Text/DynamicLabel.js +15 -10
  33. package/dist/Elements/Item/Text/Text.const.d.ts +1 -1
  34. package/dist/Elements/Item/Text/Text.const.js +13 -6
  35. package/dist/Elements/Item/Text/Text.d.ts +2 -2
  36. package/dist/Elements/Item/Text/Text.js +131 -196
  37. package/dist/Elements/Item/Text/Text.styles.d.ts +15 -15
  38. package/dist/Elements/Item/Text/Text.styles.js +68 -112
  39. package/dist/Elements/Item/Text/Text.types.d.ts +3 -3
  40. package/dist/Elements/Item/Text/Text.types.js +1 -1
  41. package/dist/Elements/SubMenu/SubMenu.d.ts +2 -3
  42. package/dist/Elements/SubMenu/SubMenu.js +44 -89
  43. package/dist/Elements/index.js +4 -1
  44. package/dist/Menu.d.ts +6 -8
  45. package/dist/Menu.js +71 -136
  46. package/dist/Menu.styles.d.ts +4 -4
  47. package/dist/Menu.styles.js +26 -76
  48. package/dist/Menu.types.d.ts +4 -4
  49. package/dist/Menu.types.js +22 -22
  50. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  51. package/dist/hooks/useTemporaryLabel.d.ts +1 -1
  52. package/dist/hooks/useTemporaryLabel.js +12 -13
  53. package/dist/index.js +25 -18
  54. package/dist/modules.d.js +1 -1
  55. package/dist/modules.d.ts +0 -0
  56. package/dist/utils/getCopyConfig.d.ts +2 -2
  57. package/dist/utils/getCopyConfig.js +21 -17
  58. package/package.json +11 -10
package/dist/Menu.js CHANGED
@@ -1,146 +1,81 @@
1
- var _excluded = ["dataSource", "ordered", "selectable", "children", "showTextTooltip", "texts", "maxToShowItems", "popoverDelay"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
5
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
6
- import React, { Children, Component } from 'react';
7
- import { FormattedMessage } from 'react-intl';
8
- import Button from '@synerise/ds-button';
9
- import '@synerise/ds-core/dist/js/style';
10
- import Icon, { ArrowDownCircleM, ArrowUpCircleM } from '@synerise/ds-icon';
11
- import { FloatingDelayGroup } from '@synerise/ds-popover';
12
- import Tooltip from '@synerise/ds-tooltip';
13
- import Breadcrumb from './Elements/Breadcrumb/Breadcrumb';
14
- import { Divider } from './Elements/Divider/Divider';
15
- import Header from './Elements/Header/Header';
16
- import MenuItem from './Elements/Item/MenuItem';
17
- import SubMenuItem from './Elements/SubMenu/SubMenu';
18
- import * as S from './Menu.styles';
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Component, Children } from "react";
3
+ import { FormattedMessage } from "react-intl";
4
+ import Button from "@synerise/ds-button";
5
+ import Icon, { ArrowUpCircleM, ArrowDownCircleM } from "@synerise/ds-icon";
6
+ import { FloatingDelayGroup } from "@synerise/ds-popover";
7
+ import Tooltip from "@synerise/ds-tooltip";
8
+ import Breadcrumb from "./Elements/Breadcrumb/Breadcrumb.js";
9
+ import { Divider } from "./Elements/Divider/Divider.js";
10
+ import MenuHeader from "./Elements/Header/Header.js";
11
+ import MenuItem from "./Elements/Item/MenuItem.js";
12
+ import SubMenuItem from "./Elements/SubMenu/SubMenu.js";
13
+ import { AntdMenu } from "./Menu.styles.js";
19
14
  import "./style/index.css";
20
- export var Menu = /*#__PURE__*/function (_Component) {
21
- function Menu() {
22
- var _this;
23
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
- args[_key] = arguments[_key];
25
- }
26
- _this = _Component.call.apply(_Component, [this].concat(args)) || this;
27
- _this.state = {
15
+ const _Menu = class _Menu extends Component {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.state = {
28
19
  allItemsVisible: false
29
20
  };
30
- return _this;
31
21
  }
32
- _inheritsLoose(Menu, _Component);
33
- var _proto = Menu.prototype;
34
- _proto.toggleItems = function toggleItems() {
35
- var allItemsVisible = this.state.allItemsVisible;
22
+ toggleItems() {
23
+ const {
24
+ allItemsVisible
25
+ } = this.state;
36
26
  this.setState({
37
27
  allItemsVisible: !allItemsVisible
38
28
  });
39
- };
40
- _proto.render = function render() {
41
- var _this2 = this;
42
- var _this$props = this.props,
43
- dataSource = _this$props.dataSource,
44
- ordered = _this$props.ordered,
45
- selectable = _this$props.selectable,
46
- children = _this$props.children,
47
- showTextTooltip = _this$props.showTextTooltip,
48
- texts = _this$props.texts,
49
- maxToShowItems = _this$props.maxToShowItems,
50
- _this$props$popoverDe = _this$props.popoverDelay,
51
- popoverDelay = _this$props$popoverDe === void 0 ? {
29
+ }
30
+ render() {
31
+ const {
32
+ dataSource,
33
+ ordered,
34
+ selectable,
35
+ children,
36
+ showTextTooltip,
37
+ texts,
38
+ maxToShowItems,
39
+ popoverDelay = {
52
40
  open: 100,
53
41
  close: 400
54
- } : _this$props$popoverDe,
55
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
56
- var allItemsVisible = this.state.allItemsVisible;
57
- var allTexts = _extends({
58
- showLess: /*#__PURE__*/React.createElement(FormattedMessage, {
59
- id: "DS.MENU.SHOW-LESS",
60
- defaultMessage: "Show less"
61
- }),
62
- showMore: /*#__PURE__*/React.createElement(FormattedMessage, {
63
- id: "DS.MENU.SHOW-MORE",
64
- defaultMessage: "Show more"
65
- })
66
- }, texts);
67
- var isListTogglable = maxToShowItems !== undefined;
68
- var isDataSource = dataSource !== undefined;
69
- var childrenArray = Children.toArray(children);
70
- var itemsCount = (isDataSource ? dataSource.length : childrenArray.length) || 0;
71
- var itemsOverLimit = isListTogglable ? itemsCount - maxToShowItems : 0;
72
- var visibleItems = allItemsVisible || !isListTogglable ? dataSource : dataSource == null ? void 0 : dataSource.slice(0, maxToShowItems);
73
- var visibleChildren = allItemsVisible || !isListTogglable ? children : childrenArray.slice(0, maxToShowItems);
74
- var toggleButtonLabel = allItemsVisible ? allTexts.showLess : allTexts.showMore;
75
- var toggleButton = isListTogglable && itemsOverLimit > 0 && /*#__PURE__*/React.createElement(Button, {
76
- onClick: function onClick() {
77
- return _this2.toggleItems();
78
42
  },
79
- type: "ghost-primary",
80
- mode: "icon-label"
81
- }, /*#__PURE__*/React.createElement(Icon, {
82
- component: allItemsVisible ? /*#__PURE__*/React.createElement(ArrowUpCircleM, null) : /*#__PURE__*/React.createElement(ArrowDownCircleM, null)
83
- }), toggleButtonLabel);
84
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FloatingDelayGroup, {
85
- delay: popoverDelay
86
- }, /*#__PURE__*/React.createElement(S.AntdMenu, _extends({
87
- ordered: ordered,
88
- mode: "inline",
89
- inlineIndent: ordered ? 20 : 18
90
- }, rest, {
91
- selectable: selectable === undefined ? false : selectable
92
- }), isDataSource ? visibleItems == null ? void 0 : visibleItems.map(function (item, index) {
93
- return item.subMenu ? /*#__PURE__*/React.createElement(SubMenuItem, _extends({
94
- parent: item.parent,
95
- prefixel: item.prefixel,
96
- suffixel: item.suffixel,
97
- disabled: item.disabled,
98
- text: showTextTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
99
- title: item.text
100
- }, item.text) : item.text,
101
- description: item.description,
102
- subMenu: item.subMenu,
103
- ordered: item.ordered === undefined ? ordered : item.ordered,
104
- copyable: item.copyable,
105
- copyHint: item.copyHint,
106
- copyValue: item.copyValue,
107
- suffixVisibilityTrigger: item.suffixVisibilityTrigger,
108
- prefixVisibilityTrigger: item.prefixVisibilityTrigger,
109
- key: item.key || "" + item.text + index,
110
- menuItemKey: item.key || "" + item.text + index
111
- }, rest, item, {
112
- ItemComponent: MenuItem
113
- })) : /*#__PURE__*/React.createElement(MenuItem, _extends({
114
- className: "ds-menu-item",
115
- parent: item.parent,
116
- prefixel: item.prefixel,
117
- suffixel: item.suffixel,
118
- disabled: item.disabled,
119
- text: showTextTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
120
- title: item.text
121
- }, item.text) : item.text,
122
- description: item.description,
123
- subMenu: item.subMenu,
124
- ordered: item.ordered === undefined ? ordered : item.ordered,
125
- copyable: item.copyable,
126
- copyHint: item.copyHint,
127
- copyValue: item.copyValue,
128
- highlight: item.highlight,
129
- suffixVisibilityTrigger: item.suffixVisibilityTrigger,
130
- prefixVisibilityTrigger: item.prefixVisibilityTrigger,
131
- indentLevel: item.indentLevel || 0,
132
- type: item.type,
133
- key: item.key || "" + item.text + index,
134
- menuItemKey: item.key || "" + item.text + index
135
- }, rest, item));
136
- }) : visibleChildren)), toggleButton);
137
- };
138
- return Menu;
139
- }(Component);
140
- Menu.Item = MenuItem;
141
- Menu.Breadcrumb = Breadcrumb;
142
- Menu.Header = Header;
143
- Menu.ItemGroup = S.AntdMenu.ItemGroup;
144
- Menu.SubMenu = S.AntdMenu.SubMenu;
145
- Menu.Divider = Divider;
146
- export default Menu;
43
+ ...rest
44
+ } = this.props;
45
+ const {
46
+ allItemsVisible
47
+ } = this.state;
48
+ const allTexts = {
49
+ showLess: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.MENU.SHOW-LESS", defaultMessage: "Show less" }),
50
+ showMore: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.MENU.SHOW-MORE", defaultMessage: "Show more" }),
51
+ ...texts
52
+ };
53
+ const isListTogglable = maxToShowItems !== void 0;
54
+ const isDataSource = dataSource !== void 0;
55
+ const childrenArray = Children.toArray(children);
56
+ const itemsCount = (isDataSource ? dataSource.length : childrenArray.length) || 0;
57
+ const itemsOverLimit = isListTogglable ? itemsCount - maxToShowItems : 0;
58
+ const visibleItems = allItemsVisible || !isListTogglable ? dataSource : dataSource?.slice(0, maxToShowItems);
59
+ const visibleChildren = allItemsVisible || !isListTogglable ? children : childrenArray.slice(0, maxToShowItems);
60
+ const toggleButtonLabel = allItemsVisible ? allTexts.showLess : allTexts.showMore;
61
+ const toggleButton = isListTogglable && itemsOverLimit > 0 && /* @__PURE__ */ jsxs(Button, { onClick: () => this.toggleItems(), type: "ghost-primary", mode: "icon-label", children: [
62
+ /* @__PURE__ */ jsx(Icon, { component: allItemsVisible ? /* @__PURE__ */ jsx(ArrowUpCircleM, {}) : /* @__PURE__ */ jsx(ArrowDownCircleM, {}) }),
63
+ toggleButtonLabel
64
+ ] });
65
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
66
+ /* @__PURE__ */ jsx(FloatingDelayGroup, { delay: popoverDelay, children: /* @__PURE__ */ jsx(AntdMenu, { ordered, mode: "inline", inlineIndent: ordered ? 20 : 18, ...rest, selectable: selectable === void 0 ? false : selectable, children: isDataSource ? visibleItems?.map((item, index) => item.subMenu ? /* @__PURE__ */ jsx(SubMenuItem, { parent: item.parent, prefixel: item.prefixel, suffixel: item.suffixel, disabled: item.disabled, text: showTextTooltip ? /* @__PURE__ */ jsx(Tooltip, { title: item.text, children: item.text }) : item.text, description: item.description, subMenu: item.subMenu, ordered: item.ordered === void 0 ? ordered : item.ordered, copyable: item.copyable, copyHint: item.copyHint, copyValue: item.copyValue, suffixVisibilityTrigger: item.suffixVisibilityTrigger, prefixVisibilityTrigger: item.prefixVisibilityTrigger, menuItemKey: item.key || `${item.text}${index}`, ...rest, ...item, ItemComponent: MenuItem }, item.key || `${item.text}${index}`) : /* @__PURE__ */ jsx(MenuItem, { className: "ds-menu-item", parent: item.parent, prefixel: item.prefixel, suffixel: item.suffixel, disabled: item.disabled, text: showTextTooltip ? /* @__PURE__ */ jsx(Tooltip, { title: item.text, children: item.text }) : item.text, description: item.description, subMenu: item.subMenu, ordered: item.ordered === void 0 ? ordered : item.ordered, copyable: item.copyable, copyHint: item.copyHint, copyValue: item.copyValue, highlight: item.highlight, suffixVisibilityTrigger: item.suffixVisibilityTrigger, prefixVisibilityTrigger: item.prefixVisibilityTrigger, indentLevel: item.indentLevel || 0, type: item.type, menuItemKey: item.key || `${item.text}${index}`, ...rest, ...item }, item.key || `${item.text}${index}`)) : visibleChildren }) }),
67
+ toggleButton
68
+ ] });
69
+ }
70
+ };
71
+ _Menu.Item = MenuItem;
72
+ _Menu.Breadcrumb = Breadcrumb;
73
+ _Menu.Header = MenuHeader;
74
+ _Menu.ItemGroup = AntdMenu.ItemGroup;
75
+ _Menu.SubMenu = AntdMenu.SubMenu;
76
+ _Menu.Divider = Divider;
77
+ let Menu = _Menu;
78
+ export {
79
+ Menu,
80
+ Menu as default
81
+ };
@@ -1,6 +1,6 @@
1
1
  import { Menu } from 'antd';
2
- import { type PropsWithChildren, type ReactNode } from 'react';
3
- import { type AntdMenuProps } from './Menu.types';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ import { AntdMenuProps } from './Menu.types';
4
4
  type SubMenuProps = PropsWithChildren<{
5
5
  ordered?: boolean | undefined;
6
6
  disabled?: boolean | undefined;
@@ -9,6 +9,6 @@ type SubMenuProps = PropsWithChildren<{
9
9
  title: string | ReactNode;
10
10
  tabIndex?: number;
11
11
  }>;
12
- export declare const AntdMenu: import("styled-components").StyledComponent<typeof Menu, any, AntdMenuProps, never>;
13
- export declare const SubMenuItem: import("styled-components").StyledComponent<typeof import("antd/lib/menu/SubMenu").default, any, SubMenuProps, never>;
12
+ export declare const AntdMenu: import('styled-components').StyledComponent<typeof Menu, any, AntdMenuProps, never>;
13
+ export declare const SubMenuItem: import('styled-components').StyledComponent<typeof import('antd/lib/menu/SubMenu').default, any, SubMenuProps, never>;
14
14
  export {};
@@ -1,82 +1,32 @@
1
- import { Menu } from 'antd';
2
- import styled, { css } from 'styled-components';
3
- var overflowStyles = css(["text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"]);
4
- var arrowDownSvgWithCustomColor = function arrowDownSvgWithCustomColor(color) {
5
- var colorValueForSvg = color.replace(/#/, '%23');
6
- var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: " + colorValueForSvg + ";' d='M14.71973,9.84473,12,12.56445,9.28027,9.84473a.74992.74992,0,0,0-1.06054,1.06054l3.25,3.25a.74971.74971,0,0,0,1.06054,0l3.25-3.25a.74992.74992,0,0,0-1.06054-1.06054Z'/></svg>";
1
+ import { Menu } from "antd";
2
+ import styled, { css } from "styled-components";
3
+ const overflowStyles = /* @__PURE__ */ css(["text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"]);
4
+ const arrowDownSvgWithCustomColor = (color) => {
5
+ const colorValueForSvg = color.replace(/#/, "%23");
6
+ const iconWithColor = `data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: ${colorValueForSvg};' d='M14.71973,9.84473,12,12.56445,9.28027,9.84473a.74992.74992,0,0,0-1.06054,1.06054l3.25,3.25a.74971.74971,0,0,0,1.06054,0l3.25-3.25a.74992.74992,0,0,0-1.06054-1.06054Z'/></svg>`;
7
7
  return iconWithColor;
8
8
  };
9
- export var AntdMenu = styled(Menu).withConfig({
9
+ const AntdMenu = /* @__PURE__ */ styled(Menu).withConfig({
10
10
  displayName: "Menustyles__AntdMenu",
11
11
  componentId: "sc-10eu0qe-0"
12
- })(["", " ", " > li{> .ant-menu-submenu-title,> .-submenu-title{padding-left:12px !important;}&:not(.ant-menu-submenu){padding-left:12px !important;}}.ant-menu-submenu-title,.-submenu-title{display:flex;", " .ds-submenu-title-wrapper{", " .ds-submenu-title{padding-top:5px;padding-bottom:5px;", "}}}&&& .ant-menu-item-selected,&&& .-item-selected{&:focus:not(:active){color:", ";background:", ";box-shadow:inset 0 0 0 2px ", ";&::before{color:", ";}}}&&{.ant-menu-submenu-open,.-submenu-open{.ant-menu-inline,.-inline,.ant-menu-vertical,.-vertical,.ant-menu-vertical-left,.-vertical-left{border-right-width:0px;margin:8px 0 8px 0;padding-left:24px;}}}", ""], function (props) {
13
- return Boolean(props.asDropdownMenu) && !props.asInfoCardContainer && css(["&&{padding:8px;width:100%;"]);
14
- }, function (props) {
15
- return !!props.ordered && css(["&,ul{counter-reset:custom-counter;li:not(.ds-submenu-title){counter-increment:custom-counter;&::before{content:'0' counter(custom-counter) '. \\a0';line-height:1.39;font-weight:normal;color:", ";}}li.ant-menu-submenu,li.-submenu{&::before{content:'';}}}"], props.theme.palette['grey-500']);
16
- }, overflowStyles, overflowStyles, overflowStyles, function (props) {
17
- return props.theme.palette['blue-600'];
18
- }, function (props) {
19
- return props.theme.palette['blue-050'];
20
- }, function (props) {
21
- return props.theme.palette['blue-600'];
22
- }, function (props) {
23
- return props.theme.palette['blue-600'];
24
- }, function (props) {
25
- return Boolean(props.asInfoCardContainer) && css(["&&& li.ds-menu-item{padding:0 !important;}"]);
26
- });
27
- export var SubMenuItem = styled(Menu.SubMenu).withConfig({
12
+ })(["", " ", " > li{> .ant-menu-submenu-title,> .-submenu-title{padding-left:12px !important;}&:not(.ant-menu-submenu){padding-left:12px !important;}}.ant-menu-submenu-title,.-submenu-title{display:flex;", " .ds-submenu-title-wrapper{", " .ds-submenu-title{padding-top:5px;padding-bottom:5px;", "}}}&&& .ant-menu-item-selected,&&& .-item-selected{&:focus:not(:active){color:", ";background:", ";box-shadow:inset 0 0 0 2px ", ";&::before{color:", ";}}}&&{.ant-menu-submenu-open,.-submenu-open{.ant-menu-inline,.-inline,.ant-menu-vertical,.-vertical,.ant-menu-vertical-left,.-vertical-left{border-right-width:0px;margin:8px 0 8px 0;padding-left:24px;}}}", ""], (props) => Boolean(props.asDropdownMenu) && !props.asInfoCardContainer && css(["&&{padding:8px;width:100%;"]), (props) => !!props.ordered && css(["&,ul{counter-reset:custom-counter;li:not(.ds-submenu-title){counter-increment:custom-counter;&::before{content:'0' counter(custom-counter) '. \\a0';line-height:1.39;font-weight:normal;color:", ";}}li.ant-menu-submenu,li.-submenu{&::before{content:'';}}}"], props.theme.palette["grey-500"]), overflowStyles, overflowStyles, overflowStyles, (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"], (props) => Boolean(props.asInfoCardContainer) && css(["&&& li.ds-menu-item{padding:0 !important;}"]));
13
+ const SubMenuItem$1 = /* @__PURE__ */ styled(Menu.SubMenu).withConfig({
28
14
  displayName: "Menustyles__SubMenuItem",
29
15
  componentId: "sc-10eu0qe-1"
30
- })(["&&&{color:", ";opacity:", ";cursor:", ";font-weight:500;border-radius:3px;transition:background-color 0.2s ease-out;&& .ant-menu-submenu-title:hover,&& .-submenu-title:hover{&& > i.ant-menu-submenu-arrow,&& > i.-submenu-arrow{background-image:url(\"", "\");}.ds-submenu-title-wrapper > .ds-submenu-title{color:", ";.ds-menu-prefix{svg{fill:", ";}}}}> .ant-menu-submenu-title,> .-submenu-title{line-height:1.39;height:auto;margin:0;padding-bottom:2px;padding-top:2px;max-width:100%;align-items:center;.ds-submenu-title-wrapper > .ds-submenu-title:focus:not(:active){box-shadow:inset 0 0 0 2px transparent;background:transparent;}", "}.ant-menu-item,.-item{padding-right:5px;padding-left:10px !important;}.ant-menu-title-content{.ant-menu-item,.-item{margin-left:0;}}.ds-menu-prefix{margin-left:0px;}&.ant-menu-item-selected,&.-item-selected{background:inherit;.ant-menu-submenu-title,.-submenu-title{&:focus,&:active{background:", ";&::before{color:", ";}}& > .ds-menu-prefix{svg{fill:", ";}}&::after{content:none;}}}}", " i{right:12px;}> .ant-menu-submenu-title:hover,> .-submenu-title:hover{color:", ";}&&.ant-menu-submenu-open > .ant-menu-submenu-title,&&.-submenu-open > .-submenu-title{&:not(:hover){color:", ";}background:", ";.ds-menu-content-wrapper{color:", ";background:", ";.ds-menu-prefix{svg{fill:", ";}}.ds-check-icon{svg{fill:", ";}}}& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{transform:rotate(180deg);background-image:url(\"", "\");}}> .ant-menu-submenu-title,> .-submenu-title{border-radius:3px;& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{transform:rotate(0deg);top:calc(50% - 12px);right:5px;height:24px;width:24px;}& > i.ant-menu-submenu-arrow::after,& > i.-submenu-arrow::after,& > i.ant-menu-submenu-arrow::before,& > i.-submenu-arrow::before{background-image:none;display:none;}&:hover > i.ant-menu-submenu-arrow::after,&:hover > i.-submenu-arrow::after,&:hover > i.ant-menu-submenu-arrow::before,&:hover > i.-submenu-arrow::before{background-image:none;}&:hover{color:", ";background:", ";}& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{background-image:url(\"", "\");}&:hover > i.ant-menu-submenu-arrow,&:hover > i.-submenu-arrow{background-image:url(\"", "\");}}&&.ant-menu-submenu-open > .ant-menu-submenu-title:hover,&&.-submenu-open > .-submenu-title:hover{& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{background-image:url(\"", "\");}}> li.ant-menu-submenu,> li.-submenu{&:hover{background:none !important;}}", " > ul{li{i{right:12px;}> .ant-menu-submenu,> .-submenu{&:hover{", "}}}}}"], function (props) {
31
- return props.theme.palette['grey-700'];
32
- }, function (props) {
33
- return props.disabled ? '0.4' : '1';
34
- }, function (props) {
35
- return props.disabled ? 'not-allowed' : 'pointer';
36
- }, function (props) {
37
- return props.disabled ? arrowDownSvgWithCustomColor(props.theme.palette['grey-400']) : arrowDownSvgWithCustomColor(props.theme.palette['blue-600']);
38
- }, function (props) {
39
- return props.theme.palette['blue-600'];
40
- }, function (props) {
41
- return props.theme.palette['blue-600'];
42
- }, function (props) {
43
- return !!props.ordered && css(["&::before{content:'0' counter(custom-counter) '. \\a0';line-height:1.39;font-weight:normal;color:", ";}"], props.theme.palette['grey-500']);
44
- }, function (props) {
45
- return props.theme.palette['blue-050'];
46
- }, function (props) {
47
- return props.theme.palette['blue-600'];
48
- }, function (props) {
49
- return props.theme.palette['blue-600'];
50
- }, function (props) {
51
- return !props.disabled && "\n &:focus {\n > .ant-menu-submenu-title, > .-submenu-title {\n box-shadow: inset 0 0 0 2px " + props.theme.palette['blue-600'] + ";\n }\n }\n ";
52
- }, function (props) {
53
- return props.theme.palette['blue-600'];
54
- }, function (props) {
55
- return props.theme.palette['grey-700'];
56
- }, function (props) {
57
- return props.theme.palette['blue-050'];
58
- }, function (props) {
59
- return props.theme.palette['blue-600'];
60
- }, function (props) {
61
- return props.theme.palette['blue-050'];
62
- }, function (props) {
63
- return props.theme.palette['blue-600'];
64
- }, function (props) {
65
- return props.theme.palette['green-600'];
66
- }, function (props) {
67
- return props.disabled ? arrowDownSvgWithCustomColor(props.theme.palette['grey-400']) : arrowDownSvgWithCustomColor(props.theme.palette['blue-600']);
68
- }, function (props) {
69
- return props.theme.palette['blue-600'];
70
- }, function (props) {
71
- return props.theme.palette['grey-050'];
72
- }, function (props) {
73
- return arrowDownSvgWithCustomColor(props.theme.palette['grey-400']);
74
- }, function (props) {
75
- return arrowDownSvgWithCustomColor(props.theme.palette['blue-600']);
76
- }, function (props) {
77
- return arrowDownSvgWithCustomColor(props.theme.palette['blue-600']);
78
- }, function (props) {
79
- return props.disabled ? "\n > * {\n pointer-events:none;\n }" : "";
80
- }, function (props) {
81
- return !props.disabled && "\n color: " + (props.danger ? props.theme.palette['red-600'] : props.theme.palette['blue-600']) + ";\n background: " + (props.danger ? props.theme.palette['red-050'] : props.theme.palette['grey-050']) + ";\n ";
82
- });
16
+ })(["&&&{color:", ";opacity:", ";cursor:", ';font-weight:500;border-radius:3px;transition:background-color 0.2s ease-out;&& .ant-menu-submenu-title:hover,&& .-submenu-title:hover{&& > i.ant-menu-submenu-arrow,&& > i.-submenu-arrow{background-image:url("', '");}.ds-submenu-title-wrapper > .ds-submenu-title{color:', ";.ds-menu-prefix{svg{fill:", ";}}}}> .ant-menu-submenu-title,> .-submenu-title{line-height:1.39;height:auto;margin:0;padding-bottom:2px;padding-top:2px;max-width:100%;align-items:center;.ds-submenu-title-wrapper > .ds-submenu-title:focus:not(:active){box-shadow:inset 0 0 0 2px transparent;background:transparent;}", "}.ant-menu-item,.-item{padding-right:5px;padding-left:10px !important;}.ant-menu-title-content{.ant-menu-item,.-item{margin-left:0;}}.ds-menu-prefix{margin-left:0px;}&.ant-menu-item-selected,&.-item-selected{background:inherit;.ant-menu-submenu-title,.-submenu-title{&:focus,&:active{background:", ";&::before{color:", ";}}& > .ds-menu-prefix{svg{fill:", ";}}&::after{content:none;}}}}", " i{right:12px;}> .ant-menu-submenu-title:hover,> .-submenu-title:hover{color:", ";}&&.ant-menu-submenu-open > .ant-menu-submenu-title,&&.-submenu-open > .-submenu-title{&:not(:hover){color:", ";}background:", ";.ds-menu-content-wrapper{color:", ";background:", ";.ds-menu-prefix{svg{fill:", ";}}.ds-check-icon{svg{fill:", ';}}}& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{transform:rotate(180deg);background-image:url("', '");}}> .ant-menu-submenu-title,> .-submenu-title{border-radius:3px;& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{transform:rotate(0deg);top:calc(50% - 12px);right:5px;height:24px;width:24px;}& > i.ant-menu-submenu-arrow::after,& > i.-submenu-arrow::after,& > i.ant-menu-submenu-arrow::before,& > i.-submenu-arrow::before{background-image:none;display:none;}&:hover > i.ant-menu-submenu-arrow::after,&:hover > i.-submenu-arrow::after,&:hover > i.ant-menu-submenu-arrow::before,&:hover > i.-submenu-arrow::before{background-image:none;}&:hover{color:', ";background:", ';}& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{background-image:url("', '");}&:hover > i.ant-menu-submenu-arrow,&:hover > i.-submenu-arrow{background-image:url("', '");}}&&.ant-menu-submenu-open > .ant-menu-submenu-title:hover,&&.-submenu-open > .-submenu-title:hover{& > i.ant-menu-submenu-arrow,& > i.-submenu-arrow{background-image:url("', '");}}> li.ant-menu-submenu,> li.-submenu{&:hover{background:none !important;}}', " > ul{li{i{right:12px;}> .ant-menu-submenu,> .-submenu{&:hover{", "}}}}}"], (props) => props.theme.palette["grey-700"], (props) => props.disabled ? "0.4" : "1", (props) => props.disabled ? "not-allowed" : "pointer", (props) => props.disabled ? arrowDownSvgWithCustomColor(props.theme.palette["grey-400"]) : arrowDownSvgWithCustomColor(props.theme.palette["blue-600"]), (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"], (props) => !!props.ordered && css(["&::before{content:'0' counter(custom-counter) '. \\a0';line-height:1.39;font-weight:normal;color:", ";}"], props.theme.palette["grey-500"]), (props) => props.theme.palette["blue-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"], (props) => !props.disabled && `
17
+ &:focus {
18
+ > .ant-menu-submenu-title, > .-submenu-title {
19
+ box-shadow: inset 0 0 0 2px ${props.theme.palette["blue-600"]};
20
+ }
21
+ }
22
+ `, (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["grey-700"], (props) => props.theme.palette["blue-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["green-600"], (props) => props.disabled ? arrowDownSvgWithCustomColor(props.theme.palette["grey-400"]) : arrowDownSvgWithCustomColor(props.theme.palette["blue-600"]), (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["grey-050"], (props) => arrowDownSvgWithCustomColor(props.theme.palette["grey-400"]), (props) => arrowDownSvgWithCustomColor(props.theme.palette["blue-600"]), (props) => arrowDownSvgWithCustomColor(props.theme.palette["blue-600"]), (props) => props.disabled ? `
23
+ > * {
24
+ pointer-events:none;
25
+ }` : ``, (props) => !props.disabled && `
26
+ color: ${props.danger ? props.theme.palette["red-600"] : props.theme.palette["blue-600"]};
27
+ background: ${props.danger ? props.theme.palette["red-050"] : props.theme.palette["grey-050"]};
28
+ `);
29
+ export {
30
+ AntdMenu,
31
+ SubMenuItem$1 as SubMenuItem
32
+ };
@@ -1,7 +1,7 @@
1
- import { type MenuProps } from 'antd/lib/menu';
2
- import type { ReactElement, ReactNode } from 'react';
3
- import { type DelayConfig, type LegacyPlacement, type PopoverOptions } from '@synerise/ds-popover';
4
- import { type TooltipProps } from '@synerise/ds-tooltip';
1
+ import { MenuProps } from 'antd/lib/menu';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ import { DelayConfig, LegacyPlacement, PopoverOptions } from '@synerise/ds-popover';
4
+ import { TooltipProps } from '@synerise/ds-tooltip';
5
5
  export type MenuTexts = {
6
6
  showLess: ReactNode;
7
7
  showMore: ReactNode;
@@ -1,22 +1,22 @@
1
- export var VisibilityTrigger = /*#__PURE__*/function (VisibilityTrigger) {
2
- VisibilityTrigger["DEFAULT"] = "default";
3
- VisibilityTrigger["HOVER"] = "hover";
4
- return VisibilityTrigger;
5
- }({});
6
- /**
7
- * @deprecated
8
- * provide Copyable type instead
9
- */
10
-
11
- export var ItemType = /*#__PURE__*/function (ItemType) {
12
- ItemType["DEFAULT"] = "default";
13
- ItemType["SELECT"] = "select";
14
- ItemType["DANGER"] = "danger";
15
- ItemType["DIVIDER"] = "divider";
16
- return ItemType;
17
- }({});
18
- export var ItemSize = /*#__PURE__*/function (ItemSize) {
19
- ItemSize["DEFAULT"] = "default";
20
- ItemSize["LARGE"] = "large";
21
- return ItemSize;
22
- }({});
1
+ var VisibilityTrigger = /* @__PURE__ */ ((VisibilityTrigger2) => {
2
+ VisibilityTrigger2["DEFAULT"] = "default";
3
+ VisibilityTrigger2["HOVER"] = "hover";
4
+ return VisibilityTrigger2;
5
+ })(VisibilityTrigger || {});
6
+ var ItemType = /* @__PURE__ */ ((ItemType2) => {
7
+ ItemType2["DEFAULT"] = "default";
8
+ ItemType2["SELECT"] = "select";
9
+ ItemType2["DANGER"] = "danger";
10
+ ItemType2["DIVIDER"] = "divider";
11
+ return ItemType2;
12
+ })(ItemType || {});
13
+ var ItemSize = /* @__PURE__ */ ((ItemSize2) => {
14
+ ItemSize2["DEFAULT"] = "default";
15
+ ItemSize2["LARGE"] = "large";
16
+ return ItemSize2;
17
+ })(ItemSize || {});
18
+ export {
19
+ ItemSize,
20
+ ItemType,
21
+ VisibilityTrigger
22
+ };
File without changes
@@ -1,4 +1,4 @@
1
1
  export declare const useTemporaryLabel: (duration: number) => {
2
2
  temporaryLabel: boolean;
3
- setTemporaryLabel: import("react").Dispatch<import("react").SetStateAction<boolean>>;
3
+ setTemporaryLabel: import('react').Dispatch<import('react').SetStateAction<boolean>>;
4
4
  };
@@ -1,18 +1,17 @@
1
- import { useEffect, useState } from 'react';
2
- export var useTemporaryLabel = function useTemporaryLabel(duration) {
3
- var _useState = useState(false),
4
- temporaryLabel = _useState[0],
5
- setTemporaryLabel = _useState[1];
6
- useEffect(function () {
7
- var timer = setTimeout(function () {
8
- return setTemporaryLabel(false);
9
- }, duration);
10
- return function () {
1
+ import { useState, useEffect } from "react";
2
+ const useTemporaryLabel = (duration) => {
3
+ const [temporaryLabel, setTemporaryLabel] = useState(false);
4
+ useEffect(() => {
5
+ const timer = setTimeout(() => setTemporaryLabel(false), duration);
6
+ return () => {
11
7
  clearTimeout(timer);
12
8
  };
13
9
  });
14
10
  return {
15
- temporaryLabel: temporaryLabel,
16
- setTemporaryLabel: setTemporaryLabel
11
+ temporaryLabel,
12
+ setTemporaryLabel
17
13
  };
18
- };
14
+ };
15
+ export {
16
+ useTemporaryLabel
17
+ };
package/dist/index.js CHANGED
@@ -1,18 +1,25 @@
1
- import * as BreadcrumbStyles from './Elements/Breadcrumb/Breadcrumb.styles';
2
- import * as HeaderStyles from './Elements/Header/Header.styles';
3
- import * as ItemDangerStyles from './Elements/Item/Danger/Danger.styles';
4
- import * as ItemSelectStyles from './Elements/Item/Select/Select.styles';
5
- import * as ItemSubmenuTextStyles from './Elements/Item/SubmenuText/SubmenuText.styles';
6
- import * as ItemTextStyles from './Elements/Item/Text/Text.styles';
7
- import * as MainMenuStyles from './Menu.styles';
8
- export { default } from './Menu';
9
- export * from './Menu.types';
10
- export var MenuStyles = {
11
- MenuStyles: MainMenuStyles,
12
- Breadcrumb: BreadcrumbStyles,
13
- Header: HeaderStyles,
14
- ItemDanger: ItemDangerStyles,
15
- ItemSelect: ItemSelectStyles,
16
- ItemSubmenuText: ItemSubmenuTextStyles,
17
- ItemText: ItemTextStyles
18
- };
1
+ import * as Elements_Breadcrumb_Breadcrumb_styles from "./Elements/Breadcrumb/Breadcrumb.styles.js";
2
+ import * as Elements_Header_Header_styles from "./Elements/Header/Header.styles.js";
3
+ import * as Elements_Item_Danger_Danger_styles from "./Elements/Item/Danger/Danger.styles.js";
4
+ import * as Elements_Item_Select_Select_styles from "./Elements/Item/Select/Select.styles.js";
5
+ import * as Elements_Item_SubmenuText_SubmenuText_styles from "./Elements/Item/SubmenuText/SubmenuText.styles.js";
6
+ import * as Elements_Item_Text_Text_styles from "./Elements/Item/Text/Text.styles.js";
7
+ import * as Menu_styles from "./Menu.styles.js";
8
+ import { Menu } from "./Menu.js";
9
+ import { ItemSize, ItemType, VisibilityTrigger } from "./Menu.types.js";
10
+ const MenuStyles = {
11
+ MenuStyles: Menu_styles,
12
+ Breadcrumb: Elements_Breadcrumb_Breadcrumb_styles,
13
+ Header: Elements_Header_Header_styles,
14
+ ItemDanger: Elements_Item_Danger_Danger_styles,
15
+ ItemSelect: Elements_Item_Select_Select_styles,
16
+ ItemSubmenuText: Elements_Item_SubmenuText_SubmenuText_styles,
17
+ ItemText: Elements_Item_Text_Text_styles
18
+ };
19
+ export {
20
+ ItemSize,
21
+ ItemType,
22
+ MenuStyles,
23
+ VisibilityTrigger,
24
+ Menu as default
25
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
@@ -1,8 +1,8 @@
1
- import { type MenuItemProps } from '../Menu.types';
1
+ import { MenuItemProps } from '../Menu.types';
2
2
  export declare const getCopyConfig: ({ copyable, copyValue, disabled, }: Pick<MenuItemProps, "copyValue" | "copyable" | "disabled">) => {
3
3
  delayClickEvent: number | false;
4
4
  enabled: boolean | "" | undefined;
5
5
  valueToCopy: string | undefined;
6
- copiedLabel: import("react").ReactNode;
6
+ copiedLabel: import('react').ReactNode;
7
7
  labelTimerReset: number;
8
8
  };
@@ -1,19 +1,23 @@
1
- export var getCopyConfig = function getCopyConfig(_ref) {
2
- var copyable = _ref.copyable,
3
- copyValue = _ref.copyValue,
4
- disabled = _ref.disabled;
5
- var DEFAULT_RESET_TIMER = 1000;
6
- var DELAY_CLICK_AFTER_COPY_DURATION = 700;
7
- var enabled = copyable && (copyValue || typeof copyable === 'object' && copyable.copyValue) && !disabled;
8
- var valueToCopy = typeof copyable === 'object' ? copyable.copyValue : copyValue;
9
- var copiedLabel = typeof copyable === 'object' ? copyable.copiedLabel : null;
10
- var labelTimerReset = typeof copyable === 'object' && copyable.timeToReset || DEFAULT_RESET_TIMER;
11
- var delayClickEvent = typeof copyable === 'object' && copyable.delayClickEvent !== undefined ? copyable.delayClickEvent : copyable ? DELAY_CLICK_AFTER_COPY_DURATION : false;
1
+ const getCopyConfig = ({
2
+ copyable,
3
+ copyValue,
4
+ disabled
5
+ }) => {
6
+ const DEFAULT_RESET_TIMER = 1e3;
7
+ const DELAY_CLICK_AFTER_COPY_DURATION = 700;
8
+ const enabled = copyable && (copyValue || typeof copyable === "object" && copyable.copyValue) && !disabled;
9
+ const valueToCopy = typeof copyable === "object" ? copyable.copyValue : copyValue;
10
+ const copiedLabel = typeof copyable === "object" ? copyable.copiedLabel : null;
11
+ const labelTimerReset = typeof copyable === "object" && copyable.timeToReset || DEFAULT_RESET_TIMER;
12
+ const delayClickEvent = typeof copyable === "object" && copyable.delayClickEvent !== void 0 ? copyable.delayClickEvent : copyable ? DELAY_CLICK_AFTER_COPY_DURATION : false;
12
13
  return {
13
- delayClickEvent: delayClickEvent,
14
- enabled: enabled,
15
- valueToCopy: valueToCopy,
16
- copiedLabel: copiedLabel,
17
- labelTimerReset: labelTimerReset
14
+ delayClickEvent,
15
+ enabled,
16
+ valueToCopy,
17
+ copiedLabel,
18
+ labelTimerReset
18
19
  };
19
- };
20
+ };
21
+ export {
22
+ getCopyConfig
23
+ };