@datarobot/design-system 28.6.1 → 28.7.0
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.
- package/cjs/icon-sidebar/icon-sidebar.d.ts +4 -2
- package/cjs/icon-sidebar/icon-sidebar.js +7 -5
- package/cjs/icon-sidebar/types.d.ts +25 -0
- package/cjs/icon-sidebar/types.js +5 -0
- package/cjs/icon-sidebar/with-icon-sidebar-item.d.ts +3 -0
- package/cjs/icon-sidebar/with-icon-sidebar-item.js +106 -0
- package/cjs/key-value-pairs/key-value-pairs.js +1 -1
- package/cjs/smooth-transition-loader/smooth-transition-loader.js +6 -2
- package/esm/icon-sidebar/icon-sidebar.d.ts +4 -2
- package/esm/icon-sidebar/icon-sidebar.js +7 -5
- package/esm/icon-sidebar/types.d.ts +25 -0
- package/esm/icon-sidebar/types.js +1 -0
- package/esm/icon-sidebar/with-icon-sidebar-item.d.ts +3 -0
- package/esm/icon-sidebar/with-icon-sidebar-item.js +98 -0
- package/esm/key-value-pairs/key-value-pairs.js +1 -1
- package/esm/smooth-transition-loader/smooth-transition-loader.js +6 -2
- package/js/139/139.min.js +1 -1
- package/js/244/244.min.js +1 -1
- package/js/633/633.min.js +1 -1
- package/js/784/784.min.js +1 -1
- package/js/86/86.min.js +1 -1
- package/js/bundle/bundle.js +128 -88
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +27 -2
- package/js/src_locales_es_419_translation_json/src_locales_es_419_translation_json.js +1 -1
- package/js/src_locales_fr_translation_json/src_locales_fr_translation_json.js +1 -1
- package/js/src_locales_ja_translation_json/src_locales_ja_translation_json.js +1 -1
- package/js/src_locales_ko_translation_json/src_locales_ko_translation_json.js +1 -1
- package/js/src_locales_pt_BR_translation_json/src_locales_pt_BR_translation_json.js +1 -1
- package/locales/es_419/translation.json +2 -1
- package/locales/fr/translation.json +2 -1
- package/locales/ja/translation.json +2 -1
- package/locales/ko/translation.json +2 -1
- package/locales/pt_BR/translation.json +2 -1
- package/package.json +1 -1
- package/styles/index.css +1 -0
- package/styles/index.min.css +1 -1
- package/cjs/icon-sidebar/icon-sidebar-button.d.ts +0 -14
- package/cjs/icon-sidebar/icon-sidebar-button.js +0 -66
- package/esm/icon-sidebar/icon-sidebar-button.d.ts +0 -14
- package/esm/icon-sidebar/icon-sidebar-button.js +0 -59
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import { DropdownMenuOption } from '../dropdown-menu';
|
|
3
|
-
import './icon-sidebar.less';
|
|
4
|
-
export type IconSidebarButtonProps = {
|
|
5
|
-
option: DropdownMenuOption & {
|
|
6
|
-
selectedIcon?: IconProp;
|
|
7
|
-
divider?: boolean;
|
|
8
|
-
ariaLabel?: string;
|
|
9
|
-
};
|
|
10
|
-
onSelect?: (option: DropdownMenuOption) => void;
|
|
11
|
-
selected?: number | string | (number | string)[];
|
|
12
|
-
isLimited?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare function IconSidebarButton({ option, selected, isLimited, onSelect, }: IconSidebarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.IconSidebarButton = IconSidebarButton;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
var _tooltip = require("../tooltip");
|
|
10
|
-
var _fontAwesomeIcon = require("../font-awesome-icon");
|
|
11
|
-
var _truncateWithTooltip = require("../truncate-with-tooltip");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function IconSidebarButton({
|
|
15
|
-
option,
|
|
16
|
-
selected,
|
|
17
|
-
isLimited,
|
|
18
|
-
onSelect
|
|
19
|
-
}) {
|
|
20
|
-
const isSelected = option.key === selected;
|
|
21
|
-
const icon = isSelected && option.selectedIcon ? option.selectedIcon : option.icon;
|
|
22
|
-
const getTitle = () => {
|
|
23
|
-
if (option.title) {
|
|
24
|
-
if (option.tooltipText) {
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
26
|
-
className: "icon-sidebar-text",
|
|
27
|
-
children: option.title
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_truncateWithTooltip.TruncateWithTooltip, {
|
|
31
|
-
className: "icon-sidebar-text",
|
|
32
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
33
|
-
children: option.title
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
39
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
40
|
-
className: "icon-sidebar-button-icon-container",
|
|
41
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
|
|
42
|
-
icon: icon
|
|
43
|
-
})
|
|
44
|
-
}), getTitle(), option.divider && !isLimited && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
|
-
className: "icon-sidebar-divider"
|
|
46
|
-
})]
|
|
47
|
-
});
|
|
48
|
-
const props = {
|
|
49
|
-
className: (0, _classnames.default)('icon-sidebar-button-container', option.className, option.disabled && 'disabled', isSelected && 'selected'),
|
|
50
|
-
disabled: option.disabled,
|
|
51
|
-
'test-id': option.testId,
|
|
52
|
-
'aria-label': option.title && typeof option.title === 'string' ? option.title : option.ariaLabel
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
|
|
55
|
-
content: option.tooltipText,
|
|
56
|
-
placement: option.tooltipPlacement,
|
|
57
|
-
children: onSelect ? /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
58
|
-
...props,
|
|
59
|
-
onClick: () => onSelect(option),
|
|
60
|
-
children: content
|
|
61
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
-
...props,
|
|
63
|
-
children: content
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import { DropdownMenuOption } from '../dropdown-menu';
|
|
3
|
-
import './icon-sidebar.less';
|
|
4
|
-
export type IconSidebarButtonProps = {
|
|
5
|
-
option: DropdownMenuOption & {
|
|
6
|
-
selectedIcon?: IconProp;
|
|
7
|
-
divider?: boolean;
|
|
8
|
-
ariaLabel?: string;
|
|
9
|
-
};
|
|
10
|
-
onSelect?: (option: DropdownMenuOption) => void;
|
|
11
|
-
selected?: number | string | (number | string)[];
|
|
12
|
-
isLimited?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare function IconSidebarButton({ option, selected, isLimited, onSelect, }: IconSidebarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { Tooltip } from '../tooltip';
|
|
4
|
-
import { FontAwesomeIcon } from '../font-awesome-icon';
|
|
5
|
-
import { TruncateWithTooltip } from '../truncate-with-tooltip';
|
|
6
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
export function IconSidebarButton({
|
|
8
|
-
option,
|
|
9
|
-
selected,
|
|
10
|
-
isLimited,
|
|
11
|
-
onSelect
|
|
12
|
-
}) {
|
|
13
|
-
const isSelected = option.key === selected;
|
|
14
|
-
const icon = isSelected && option.selectedIcon ? option.selectedIcon : option.icon;
|
|
15
|
-
const getTitle = () => {
|
|
16
|
-
if (option.title) {
|
|
17
|
-
if (option.tooltipText) {
|
|
18
|
-
return /*#__PURE__*/_jsx("span", {
|
|
19
|
-
className: "icon-sidebar-text",
|
|
20
|
-
children: option.title
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return /*#__PURE__*/_jsx(TruncateWithTooltip, {
|
|
24
|
-
className: "icon-sidebar-text",
|
|
25
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
26
|
-
children: option.title
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
33
|
-
className: "icon-sidebar-button-icon-container",
|
|
34
|
-
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
35
|
-
icon: icon
|
|
36
|
-
})
|
|
37
|
-
}), getTitle(), option.divider && !isLimited && /*#__PURE__*/_jsx("div", {
|
|
38
|
-
className: "icon-sidebar-divider"
|
|
39
|
-
})]
|
|
40
|
-
});
|
|
41
|
-
const props = {
|
|
42
|
-
className: classNames('icon-sidebar-button-container', option.className, option.disabled && 'disabled', isSelected && 'selected'),
|
|
43
|
-
disabled: option.disabled,
|
|
44
|
-
'test-id': option.testId,
|
|
45
|
-
'aria-label': option.title && typeof option.title === 'string' ? option.title : option.ariaLabel
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
48
|
-
content: option.tooltipText,
|
|
49
|
-
placement: option.tooltipPlacement,
|
|
50
|
-
children: onSelect ? /*#__PURE__*/_jsx("button", {
|
|
51
|
-
...props,
|
|
52
|
-
onClick: () => onSelect(option),
|
|
53
|
-
children: content
|
|
54
|
-
}) : /*#__PURE__*/_jsx("div", {
|
|
55
|
-
...props,
|
|
56
|
-
children: content
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
}
|