@elliemae/ds-mini-toolbar 2.3.1 → 3.0.0-alpha.3
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/dist/cjs/Components/MiniToolbar.js +81 -0
- package/dist/cjs/Components/MiniToolbar.js.map +7 -0
- package/dist/cjs/Components/ToolbarShortcut.js +79 -0
- package/dist/cjs/Components/ToolbarShortcut.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/Button.js +57 -0
- package/dist/cjs/Components/outOfTheBox/Button.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/ComboBox.js +51 -0
- package/dist/cjs/Components/outOfTheBox/ComboBox.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/IconItem.js +50 -0
- package/dist/cjs/Components/outOfTheBox/IconItem.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/SearchBox.js +71 -0
- package/dist/cjs/Components/outOfTheBox/SearchBox.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/Separator.js +39 -0
- package/dist/cjs/Components/outOfTheBox/Separator.js.map +7 -0
- package/dist/cjs/Components/outOfTheBox/index.js +53 -0
- package/dist/cjs/Components/outOfTheBox/index.js.map +7 -0
- package/dist/cjs/hooks/useGenerateItems.js +131 -0
- package/dist/cjs/hooks/useGenerateItems.js.map +7 -0
- package/dist/cjs/index.d.js +27 -0
- package/dist/cjs/index.d.js.map +7 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/propTypes.js +69 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/styles.js +62 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/esm/Components/MiniToolbar.js +52 -0
- package/dist/esm/Components/MiniToolbar.js.map +7 -0
- package/dist/esm/Components/ToolbarShortcut.js +52 -0
- package/dist/esm/Components/ToolbarShortcut.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/Button.js +30 -0
- package/dist/esm/Components/outOfTheBox/Button.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/ComboBox.js +24 -0
- package/dist/esm/Components/outOfTheBox/ComboBox.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/IconItem.js +21 -0
- package/dist/esm/Components/outOfTheBox/IconItem.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/SearchBox.js +44 -0
- package/dist/esm/Components/outOfTheBox/SearchBox.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/Separator.js +10 -0
- package/dist/esm/Components/outOfTheBox/Separator.js.map +7 -0
- package/dist/esm/Components/outOfTheBox/index.js +24 -0
- package/dist/esm/Components/outOfTheBox/index.js.map +7 -0
- package/dist/esm/hooks/useGenerateItems.js +115 -0
- package/dist/esm/hooks/useGenerateItems.js.map +7 -0
- package/dist/esm/index.d.js +2 -0
- package/dist/esm/index.d.js.map +7 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/propTypes.js +40 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/styles.js +33 -0
- package/dist/esm/styles.js.map +7 -0
- package/package.json +51 -42
- package/cjs/Components/MiniToolbar.js +0 -70
- package/cjs/Components/ToolbarShortcut.js +0 -72
- package/cjs/Components/outOfTheBox/Button.js +0 -29
- package/cjs/Components/outOfTheBox/ComboBox.js +0 -25
- package/cjs/Components/outOfTheBox/IconItem.js +0 -36
- package/cjs/Components/outOfTheBox/SearchBox.js +0 -55
- package/cjs/Components/outOfTheBox/Separator.js +0 -19
- package/cjs/Components/outOfTheBox/index.js +0 -26
- package/cjs/hooks/useGenerateItems.js +0 -134
- package/cjs/index.d.js +0 -2
- package/cjs/index.js +0 -12
- package/cjs/propTypes.js +0 -35
- package/cjs/styles.js +0 -29
- package/esm/Components/MiniToolbar.js +0 -60
- package/esm/Components/ToolbarShortcut.js +0 -63
- package/esm/Components/outOfTheBox/Button.js +0 -20
- package/esm/Components/outOfTheBox/ComboBox.js +0 -17
- package/esm/Components/outOfTheBox/IconItem.js +0 -28
- package/esm/Components/outOfTheBox/SearchBox.js +0 -45
- package/esm/Components/outOfTheBox/Separator.js +0 -11
- package/esm/Components/outOfTheBox/index.js +0 -13
- package/esm/hooks/useGenerateItems.js +0 -125
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -2
- package/esm/propTypes.js +0 -30
- package/esm/styles.js +0 -17
- package/types/Components/MiniToolbar.d.ts +0 -21
- package/types/Components/ToolbarShortcut.d.ts +0 -4
- package/types/Components/outOfTheBox/Button.d.ts +0 -3
- package/types/Components/outOfTheBox/ComboBox.d.ts +0 -3
- package/types/Components/outOfTheBox/IconItem.d.ts +0 -4
- package/types/Components/outOfTheBox/SearchBox.d.ts +0 -5
- package/types/Components/outOfTheBox/Separator.d.ts +0 -3
- package/types/Components/outOfTheBox/index.d.ts +0 -10
- package/types/hooks/useGenerateItems.d.ts +0 -4
- package/types/index.d.d.ts +0 -75
- package/types/index.d.ts +0 -2
- package/types/propTypes.d.ts +0 -17
- package/types/styles.d.ts +0 -5
- package/types/tests/DSMiniToolbar.events.test.d.ts +0 -1
- package/types/tests/DSMiniToolbar.keyboard.test.d.ts +0 -1
- package/types/tests/DSMiniToolbar.test.d.ts +0 -1
- package/types/tests/utils.test.d.ts +0 -161
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { StyledButton } from '../../styles.js';
|
|
4
|
-
|
|
5
|
-
const MiniToolbarIcon = props => {
|
|
6
|
-
const {
|
|
7
|
-
Icon,
|
|
8
|
-
size,
|
|
9
|
-
color,
|
|
10
|
-
onClick,
|
|
11
|
-
ariaLabel,
|
|
12
|
-
style,
|
|
13
|
-
buttonType = 'secondary'
|
|
14
|
-
} = props;
|
|
15
|
-
return /*#__PURE__*/_jsx(StyledButton, {
|
|
16
|
-
"aria-label": ariaLabel,
|
|
17
|
-
buttonType: buttonType,
|
|
18
|
-
onClick: onClick,
|
|
19
|
-
style: style,
|
|
20
|
-
leftIcon: /*#__PURE__*/_jsx(Icon, {
|
|
21
|
-
size: size,
|
|
22
|
-
color: color
|
|
23
|
-
}),
|
|
24
|
-
"data-testid": "ds-mini-toolbar__shortcut"
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { MiniToolbarIcon };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { Search } from '@elliemae/ds-icons';
|
|
10
|
-
import { DSSearchBox } from '@elliemae/ds-form';
|
|
11
|
-
import { StyledButton } from '../../styles.js';
|
|
12
|
-
import { jsx } from 'react/jsx-runtime';
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
|
|
18
|
-
const MiniToolbarSearchButton = props => {
|
|
19
|
-
const {
|
|
20
|
-
size,
|
|
21
|
-
color,
|
|
22
|
-
onClick,
|
|
23
|
-
ariaLabel,
|
|
24
|
-
style,
|
|
25
|
-
buttonType = 'secondary'
|
|
26
|
-
} = props;
|
|
27
|
-
return /*#__PURE__*/_jsx(StyledButton, {
|
|
28
|
-
"aria-label": ariaLabel,
|
|
29
|
-
buttonType: buttonType,
|
|
30
|
-
onClick: onClick,
|
|
31
|
-
style: style,
|
|
32
|
-
leftIcon: /*#__PURE__*/_jsx(Search, {
|
|
33
|
-
size: size,
|
|
34
|
-
color: color
|
|
35
|
-
}),
|
|
36
|
-
"data-testid": "ds-mini-toolbar__shortcut"
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const MiniToolbarSearchBox = props => /*#__PURE__*/jsx(DSSearchBox, _objectSpread({
|
|
41
|
-
clearable: true,
|
|
42
|
-
showIcon: false
|
|
43
|
-
}, props));
|
|
44
|
-
|
|
45
|
-
export { MiniToolbarSearchBox, MiniToolbarSearchButton };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { Separator } from '../../styles.js';
|
|
4
|
-
|
|
5
|
-
var _Separator;
|
|
6
|
-
|
|
7
|
-
const MiniToolbarSeparator = () => _Separator || (_Separator = /*#__PURE__*/_jsx(Separator, {
|
|
8
|
-
"data-testid": "ds-mini-toolbar__separator"
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
export { MiniToolbarSeparator };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { MiniToolbarButton } from './Button.js';
|
|
2
|
-
export { MiniToolbarIcon } from './IconItem.js';
|
|
3
|
-
export { MiniToolbarSearchBox } from './SearchBox.js';
|
|
4
|
-
export { MiniToolbarSeparator } from './Separator.js';
|
|
5
|
-
export { MiniToolbarComboBox } from './ComboBox.js';
|
|
6
|
-
|
|
7
|
-
const ICON_ITEM = 'ds-icon-item';
|
|
8
|
-
const SEPARATOR = 'ds-separator';
|
|
9
|
-
const BUTTON = 'ds-button';
|
|
10
|
-
const SEARCH_BOX = 'ds-search-box';
|
|
11
|
-
const COMBO_BOX = 'ds-combo-box';
|
|
12
|
-
|
|
13
|
-
export { BUTTON, COMBO_BOX, ICON_ITEM, SEARCH_BOX, SEPARATOR };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import { useMemo } from 'react';
|
|
11
|
-
import { uid } from 'uid';
|
|
12
|
-
import { Search } from '@elliemae/ds-icons';
|
|
13
|
-
import { SEARCH_BOX, SEPARATOR, BUTTON, ICON_ITEM, COMBO_BOX } from '../Components/outOfTheBox/index.js';
|
|
14
|
-
import { ToolbarShortcut } from '../Components/ToolbarShortcut.js';
|
|
15
|
-
import { MiniToolbarSearchButton, MiniToolbarSearchBox } from '../Components/outOfTheBox/SearchBox.js';
|
|
16
|
-
import { MiniToolbarSeparator } from '../Components/outOfTheBox/Separator.js';
|
|
17
|
-
import { MiniToolbarButton } from '../Components/outOfTheBox/Button.js';
|
|
18
|
-
import { MiniToolbarIcon } from '../Components/outOfTheBox/IconItem.js';
|
|
19
|
-
import { MiniToolbarComboBox } from '../Components/outOfTheBox/ComboBox.js';
|
|
20
|
-
|
|
21
|
-
var _MiniToolbarSeparator;
|
|
22
|
-
|
|
23
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
-
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
-
|
|
27
|
-
const useGenerateItems = items => {
|
|
28
|
-
const instanceUID = useMemo(() => uid(6), []);
|
|
29
|
-
const shortcutItems = useMemo(() => items.filter(item => item.hasShortcut || item.component === SEARCH_BOX || item.contextualRegion).map((item, index) => {
|
|
30
|
-
const {
|
|
31
|
-
component,
|
|
32
|
-
shortcutComponent,
|
|
33
|
-
shortcutProps,
|
|
34
|
-
sharedProps,
|
|
35
|
-
contextualRegion,
|
|
36
|
-
contextualRegionProps
|
|
37
|
-
} = item;
|
|
38
|
-
let Component;
|
|
39
|
-
let ContextualRegion;
|
|
40
|
-
if (component === SEPARATOR) return _MiniToolbarSeparator || (_MiniToolbarSeparator = /*#__PURE__*/_jsx(MiniToolbarSeparator, {}));
|
|
41
|
-
if (component === BUTTON) Component = MiniToolbarButton;else if (component === ICON_ITEM) Component = MiniToolbarIcon;else if (component === COMBO_BOX) Component = MiniToolbarComboBox;else if (component === SEARCH_BOX) {
|
|
42
|
-
if (item.hasShortcut) {
|
|
43
|
-
Component = MiniToolbarSearchButton;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
ContextualRegion = MiniToolbarSearchBox;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!ContextualRegion) {
|
|
50
|
-
ContextualRegion = contextualRegion;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (!Component) {
|
|
54
|
-
Component = shortcutComponent;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return /*#__PURE__*/_jsx(ToolbarShortcut, {
|
|
58
|
-
Component: Component,
|
|
59
|
-
shortcutProps: shortcutProps,
|
|
60
|
-
sharedProps: sharedProps,
|
|
61
|
-
ContextualRegion: ContextualRegion,
|
|
62
|
-
contextualRegionProps: contextualRegionProps
|
|
63
|
-
}, "".concat(instanceUID, "-shortcut-").concat(index));
|
|
64
|
-
}), [instanceUID, items]);
|
|
65
|
-
const dropdownMenuItems = useMemo(() => items.map((item, index) => {
|
|
66
|
-
const {
|
|
67
|
-
component,
|
|
68
|
-
sharedProps,
|
|
69
|
-
dropdownComponentProps
|
|
70
|
-
} = item;
|
|
71
|
-
const dropdownItem = {};
|
|
72
|
-
|
|
73
|
-
const {
|
|
74
|
-
Icon,
|
|
75
|
-
color,
|
|
76
|
-
label,
|
|
77
|
-
onClick
|
|
78
|
-
} = _objectSpread(_objectSpread({}, sharedProps), dropdownComponentProps);
|
|
79
|
-
|
|
80
|
-
if (component === SEPARATOR) dropdownItem.type = 'separator';else {
|
|
81
|
-
dropdownItem.id = "".concat(instanceUID, "-dropdown-").concat(index);
|
|
82
|
-
|
|
83
|
-
dropdownItem.onClick = () => onClick(item);
|
|
84
|
-
|
|
85
|
-
dropdownItem.label = label;
|
|
86
|
-
|
|
87
|
-
dropdownItem.onKeyDown = e => {
|
|
88
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
89
|
-
onClick(item);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (component === ICON_ITEM) {
|
|
95
|
-
dropdownItem.leftAddon = /*#__PURE__*/_jsx(Icon, {
|
|
96
|
-
color: color
|
|
97
|
-
});
|
|
98
|
-
} else if (component === SEARCH_BOX) {
|
|
99
|
-
dropdownItem.leftAddon = /*#__PURE__*/_jsx(Search, {
|
|
100
|
-
color: color
|
|
101
|
-
});
|
|
102
|
-
} else if (component === COMBO_BOX) {
|
|
103
|
-
dropdownItem.type = 'subMenu';
|
|
104
|
-
dropdownItem.label = label;
|
|
105
|
-
dropdownItem.subItems = sharedProps.options.map((option, index) => {
|
|
106
|
-
option.id = "".concat(instanceUID, "-option-").concat(index);
|
|
107
|
-
|
|
108
|
-
option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);
|
|
109
|
-
|
|
110
|
-
option.onKeyDown = e => {
|
|
111
|
-
if (e.key === ' ' || e.key === 'Enter') {
|
|
112
|
-
dropdownComponentProps.onSelectMenuItem(option);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
return option;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return dropdownItem;
|
|
121
|
-
}), [instanceUID, items]);
|
|
122
|
-
return [shortcutItems, dropdownMenuItems];
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export { useGenerateItems };
|
package/esm/index.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/esm/index.js
DELETED
package/esm/propTypes.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PropTypes, describe } from 'react-desc';
|
|
2
|
-
|
|
3
|
-
const outOfTheBoxType = PropTypes.oneOf(['ds-button', 'ds-icon-item', 'ds-separator', 'ds-search-box', 'ds-combo-box']).description('out-of-the-box toolbar components');
|
|
4
|
-
const toolbarItemProps = {
|
|
5
|
-
component: PropTypes.oneOfType([outOfTheBoxType, PropTypes.element]).description('Main component').isRequired,
|
|
6
|
-
hasShortcut: PropTypes.bool.description('Whether to include the component as a shortcut in the toolbar or not').defaultValue(false),
|
|
7
|
-
shortcutComponent: PropTypes.element.description('Component to render as a shortcut in the toolbar'),
|
|
8
|
-
shortcutProps: PropTypes.object.description('Shortcut component props'),
|
|
9
|
-
dropdownComponentProps: PropTypes.object.description('Dropdown component props'),
|
|
10
|
-
sharedProps: PropTypes.object.description('Props shared by shortcut component and dropdown component'),
|
|
11
|
-
contextualRegion: PropTypes.element.description('Component that can be rendered as an adjacent region to the shortcut component'),
|
|
12
|
-
contextualRegionProps: PropTypes.object.description('Contextual region component props')
|
|
13
|
-
};
|
|
14
|
-
const itemPropTypes = PropTypes.shape(toolbarItemProps).description('Items props');
|
|
15
|
-
const overflowButtonPropTypes = {
|
|
16
|
-
ariaLabel: PropTypes.string,
|
|
17
|
-
buttonType: PropTypes.oneOf(['secondary', 'text']),
|
|
18
|
-
style: PropTypes.object
|
|
19
|
-
};
|
|
20
|
-
const miniToolbarProps = {
|
|
21
|
-
items: PropTypes.arrayOf(itemPropTypes).description('Array of items').isRequired,
|
|
22
|
-
overflowButtonProps: PropTypes.shape(overflowButtonPropTypes).description('Overflow button props')
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const ToolbarItem = () => null;
|
|
26
|
-
|
|
27
|
-
const ToolbarItemWithSchema = describe(ToolbarItem);
|
|
28
|
-
ToolbarItemWithSchema.propTypes = toolbarItemProps;
|
|
29
|
-
|
|
30
|
-
export { ToolbarItemWithSchema, miniToolbarProps };
|
package/esm/styles.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import DSButton from '@elliemae/ds-button';
|
|
3
|
-
|
|
4
|
-
const Container = /*#__PURE__*/styled.ul.withConfig({
|
|
5
|
-
componentId: "sc-18ftw1x-0"
|
|
6
|
-
})(["display:flex;align-items:center;justify-content:center;width:fit-content;padding:0 6px;"]);
|
|
7
|
-
const Separator = /*#__PURE__*/styled.span.withConfig({
|
|
8
|
-
componentId: "sc-18ftw1x-1"
|
|
9
|
-
})(["height:24px;width:1px;margin:6px;border-left:1px solid #bbb;"]);
|
|
10
|
-
const Item = /*#__PURE__*/styled.li.withConfig({
|
|
11
|
-
componentId: "sc-18ftw1x-2"
|
|
12
|
-
})(["display:flex;margin:6px;cursor:pointer;"]);
|
|
13
|
-
const StyledButton = /*#__PURE__*/styled(DSButton).withConfig({
|
|
14
|
-
componentId: "sc-18ftw1x-3"
|
|
15
|
-
})(["&:not(:focus){border-color:transparent;}"]);
|
|
16
|
-
|
|
17
|
-
export { Container, Item, Separator, StyledButton };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MiniToolbarPropsT } from '../index.d';
|
|
4
|
-
declare const MiniToolbar: {
|
|
5
|
-
({ items, overflowButtonProps }: MiniToolbarPropsT): React.ReactElement;
|
|
6
|
-
propTypes: {
|
|
7
|
-
items: import("react-desc").PropTypesDescValue;
|
|
8
|
-
overflowButtonProps: {
|
|
9
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
10
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
-
};
|
|
12
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
declare const MiniToolbarWithSchema: {
|
|
17
|
-
(props?: unknown): JSX.Element;
|
|
18
|
-
propTypes: unknown;
|
|
19
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
20
|
-
};
|
|
21
|
-
export { MiniToolbar, MiniToolbarWithSchema };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MiniToolbarIconItemPropsT } from '../../index.d';
|
|
3
|
-
declare const MiniToolbarSearchButton: (props: MiniToolbarIconItemPropsT) => React.ReactElement;
|
|
4
|
-
declare const MiniToolbarSearchBox: (props: Record<string, unknown>) => JSX.Element;
|
|
5
|
-
export { MiniToolbarSearchButton, MiniToolbarSearchBox };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { MiniToolbarButton } from './Button';
|
|
2
|
-
export { MiniToolbarIcon } from './IconItem';
|
|
3
|
-
export { MiniToolbarSearchBox } from './SearchBox';
|
|
4
|
-
export { MiniToolbarSeparator } from './Separator';
|
|
5
|
-
export { MiniToolbarComboBox } from './ComboBox';
|
|
6
|
-
export declare const ICON_ITEM = "ds-icon-item";
|
|
7
|
-
export declare const SEPARATOR = "ds-separator";
|
|
8
|
-
export declare const BUTTON = "ds-button";
|
|
9
|
-
export declare const SEARCH_BOX = "ds-search-box";
|
|
10
|
-
export declare const COMBO_BOX = "ds-combo-box";
|
package/types/index.d.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type SvgIconSizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
3
|
-
declare type SvgIconColorType = ['neutral', '900'] | ['neutral', '500'] | ['neutral', '0'] | ['danger', '900'] | ['warning', '600'] | ['success', '900'] | ['brand-primary', '600'];
|
|
4
|
-
declare type SharedProps = {
|
|
5
|
-
options?: Record<string, unknown>[];
|
|
6
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
7
|
-
Icon?: React.ComponentType<Record<string, unknown>>;
|
|
8
|
-
label?: string;
|
|
9
|
-
} & Record<string, unknown>;
|
|
10
|
-
declare type ShortcutProps = {
|
|
11
|
-
style?: React.CSSProperties;
|
|
12
|
-
} & Record<string, unknown>;
|
|
13
|
-
declare type ContextualRegionProps = {
|
|
14
|
-
position?: 'left' | 'right';
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
} & Record<string, unknown>;
|
|
17
|
-
declare type DropdownComponentProps = {
|
|
18
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
19
|
-
label?: string;
|
|
20
|
-
Icon?: React.ComponentType<Record<string, unknown>>;
|
|
21
|
-
color?: SvgIconColorType;
|
|
22
|
-
onSelectMenuItem: (option: Record<string, unknown>) => void;
|
|
23
|
-
} & Record<string, unknown>;
|
|
24
|
-
declare type OverflowButtonProps = {
|
|
25
|
-
ariaLabel?: string;
|
|
26
|
-
style?: React.CSSProperties;
|
|
27
|
-
buttonType?: 'secondary' | 'text';
|
|
28
|
-
};
|
|
29
|
-
interface DefaultIconItemProps {
|
|
30
|
-
Icon: React.ComponentType<{
|
|
31
|
-
size: SvgIconSizeType;
|
|
32
|
-
color: SvgIconColorType;
|
|
33
|
-
}>;
|
|
34
|
-
size?: SvgIconSizeType;
|
|
35
|
-
color?: SvgIconColorType;
|
|
36
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
37
|
-
ariaLabel?: string;
|
|
38
|
-
style?: React.CSSProperties;
|
|
39
|
-
}
|
|
40
|
-
declare type MiniToolbarIconItemPropsT = DefaultIconItemProps & Record<string, unknown>;
|
|
41
|
-
declare type MiniToolbarButtonPropsT = {
|
|
42
|
-
ariaLabel: string;
|
|
43
|
-
} & Record<string, unknown>;
|
|
44
|
-
interface MiniToolbarItemT {
|
|
45
|
-
component: 'ds-button' | 'ds-icon-item' | 'ds-separator' | 'ds-search-box' | 'ds-combo-box' | React.ReactElement;
|
|
46
|
-
hasShortcut?: boolean;
|
|
47
|
-
shortcutComponent?: React.ReactElement;
|
|
48
|
-
shortcutProps?: ShortcutProps;
|
|
49
|
-
dropdownComponentProps?: DropdownComponentProps;
|
|
50
|
-
sharedProps?: SharedProps;
|
|
51
|
-
contextualRegion?: React.ReactElement;
|
|
52
|
-
contextualRegionProps?: ContextualRegionProps;
|
|
53
|
-
[key: string]: unknown;
|
|
54
|
-
}
|
|
55
|
-
interface ToolbarShortcutPropsT {
|
|
56
|
-
Component: React.ComponentType<Record<string, unknown>>;
|
|
57
|
-
shortcutProps: ShortcutProps;
|
|
58
|
-
sharedProps: SharedProps;
|
|
59
|
-
ContextualRegion: React.ComponentType<Record<string, unknown>>;
|
|
60
|
-
contextualRegionProps: ContextualRegionProps;
|
|
61
|
-
}
|
|
62
|
-
interface MiniToolbarPropsT {
|
|
63
|
-
items: MiniToolbarItemT[];
|
|
64
|
-
overflowButtonProps?: OverflowButtonProps;
|
|
65
|
-
}
|
|
66
|
-
declare type GeneratedDropdownItemT = {
|
|
67
|
-
id?: string;
|
|
68
|
-
label?: string;
|
|
69
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
70
|
-
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
71
|
-
leftAddon?: React.ReactElement;
|
|
72
|
-
subItems?: Record<string, unknown>[];
|
|
73
|
-
type?: 'separator' | 'subMenu';
|
|
74
|
-
};
|
|
75
|
-
export { MiniToolbarIconItemPropsT, MiniToolbarButtonPropsT, MiniToolbarItemT, ToolbarShortcutPropsT, MiniToolbarPropsT, GeneratedDropdownItemT, };
|
package/types/index.d.ts
DELETED
package/types/propTypes.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
declare const miniToolbarProps: {
|
|
4
|
-
items: import("react-desc").PropTypesDescValue;
|
|
5
|
-
overflowButtonProps: {
|
|
6
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
7
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
8
|
-
};
|
|
9
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
declare const ToolbarItemWithSchema: {
|
|
13
|
-
(props?: unknown): JSX.Element;
|
|
14
|
-
propTypes: unknown;
|
|
15
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
16
|
-
};
|
|
17
|
-
export { ToolbarItemWithSchema, miniToolbarProps };
|
package/types/styles.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const Container: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
-
declare const Separator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
declare const Item: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
declare const StyledButton: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, any, any>;
|
|
5
|
-
export { Container, Separator, Item, StyledButton };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export const testItems: ({
|
|
2
|
-
component: string;
|
|
3
|
-
hasShortcut: boolean;
|
|
4
|
-
shortcutProps: {
|
|
5
|
-
size: string;
|
|
6
|
-
onClick: jest.Mock<null, []>;
|
|
7
|
-
ariaLabel: string;
|
|
8
|
-
};
|
|
9
|
-
dropdownComponentProps: {
|
|
10
|
-
label: string;
|
|
11
|
-
size: string;
|
|
12
|
-
onClick: jest.Mock<null, []>;
|
|
13
|
-
};
|
|
14
|
-
sharedProps: {
|
|
15
|
-
Icon: (rest: any) => JSX.Element;
|
|
16
|
-
color: string[];
|
|
17
|
-
onClick?: undefined;
|
|
18
|
-
};
|
|
19
|
-
} | {
|
|
20
|
-
component: string;
|
|
21
|
-
hasShortcut: boolean;
|
|
22
|
-
shortcutProps: {
|
|
23
|
-
size: string;
|
|
24
|
-
onClick?: undefined;
|
|
25
|
-
ariaLabel?: undefined;
|
|
26
|
-
};
|
|
27
|
-
dropdownComponentProps: {
|
|
28
|
-
label: string;
|
|
29
|
-
size: string;
|
|
30
|
-
onClick?: undefined;
|
|
31
|
-
};
|
|
32
|
-
sharedProps: {
|
|
33
|
-
Icon: (rest: any) => JSX.Element;
|
|
34
|
-
onClick: jest.Mock<null, []>;
|
|
35
|
-
color: string[];
|
|
36
|
-
};
|
|
37
|
-
} | {
|
|
38
|
-
component: string;
|
|
39
|
-
hasShortcut: boolean;
|
|
40
|
-
shortcutProps: {
|
|
41
|
-
size: string;
|
|
42
|
-
onClick: jest.Mock<null, []>;
|
|
43
|
-
ariaLabel?: undefined;
|
|
44
|
-
};
|
|
45
|
-
dropdownComponentProps: {
|
|
46
|
-
label: string;
|
|
47
|
-
size: string;
|
|
48
|
-
onClick: jest.Mock<null, []>;
|
|
49
|
-
};
|
|
50
|
-
sharedProps: {
|
|
51
|
-
Icon: (rest: any) => JSX.Element;
|
|
52
|
-
color: string[];
|
|
53
|
-
onClick: jest.Mock<null, []>;
|
|
54
|
-
};
|
|
55
|
-
} | {
|
|
56
|
-
component: string;
|
|
57
|
-
hasShortcut: boolean;
|
|
58
|
-
shortcutProps?: undefined;
|
|
59
|
-
dropdownComponentProps?: undefined;
|
|
60
|
-
sharedProps?: undefined;
|
|
61
|
-
} | {
|
|
62
|
-
component: string;
|
|
63
|
-
hasShortcut: boolean;
|
|
64
|
-
shortcutProps: {
|
|
65
|
-
size: string;
|
|
66
|
-
onClick?: undefined;
|
|
67
|
-
ariaLabel?: undefined;
|
|
68
|
-
};
|
|
69
|
-
dropdownComponentProps: {
|
|
70
|
-
label: string;
|
|
71
|
-
size: string;
|
|
72
|
-
onClick?: undefined;
|
|
73
|
-
};
|
|
74
|
-
sharedProps: {
|
|
75
|
-
Icon: (rest: any) => JSX.Element;
|
|
76
|
-
color: string[];
|
|
77
|
-
onClick?: undefined;
|
|
78
|
-
};
|
|
79
|
-
})[];
|
|
80
|
-
export function addContextualRegionToItems(isOpen: any): ({
|
|
81
|
-
component: string;
|
|
82
|
-
hasShortcut: boolean;
|
|
83
|
-
shortcutProps: {
|
|
84
|
-
size: string;
|
|
85
|
-
onClick: jest.Mock<null, []>;
|
|
86
|
-
ariaLabel: string;
|
|
87
|
-
};
|
|
88
|
-
dropdownComponentProps: {
|
|
89
|
-
label: string;
|
|
90
|
-
size: string;
|
|
91
|
-
onClick: jest.Mock<null, []>;
|
|
92
|
-
};
|
|
93
|
-
sharedProps: {
|
|
94
|
-
Icon: (rest: any) => JSX.Element;
|
|
95
|
-
color: string[];
|
|
96
|
-
onClick?: undefined;
|
|
97
|
-
};
|
|
98
|
-
} | {
|
|
99
|
-
component: string;
|
|
100
|
-
hasShortcut: boolean;
|
|
101
|
-
shortcutProps: {
|
|
102
|
-
size: string;
|
|
103
|
-
onClick?: undefined;
|
|
104
|
-
ariaLabel?: undefined;
|
|
105
|
-
};
|
|
106
|
-
dropdownComponentProps: {
|
|
107
|
-
label: string;
|
|
108
|
-
size: string;
|
|
109
|
-
onClick?: undefined;
|
|
110
|
-
};
|
|
111
|
-
sharedProps: {
|
|
112
|
-
Icon: (rest: any) => JSX.Element;
|
|
113
|
-
onClick: jest.Mock<null, []>;
|
|
114
|
-
color: string[];
|
|
115
|
-
};
|
|
116
|
-
} | {
|
|
117
|
-
component: string;
|
|
118
|
-
hasShortcut: boolean;
|
|
119
|
-
shortcutProps: {
|
|
120
|
-
size: string;
|
|
121
|
-
onClick: jest.Mock<null, []>;
|
|
122
|
-
ariaLabel?: undefined;
|
|
123
|
-
};
|
|
124
|
-
dropdownComponentProps: {
|
|
125
|
-
label: string;
|
|
126
|
-
size: string;
|
|
127
|
-
onClick: jest.Mock<null, []>;
|
|
128
|
-
};
|
|
129
|
-
sharedProps: {
|
|
130
|
-
Icon: (rest: any) => JSX.Element;
|
|
131
|
-
color: string[];
|
|
132
|
-
onClick: jest.Mock<null, []>;
|
|
133
|
-
};
|
|
134
|
-
} | {
|
|
135
|
-
component: string;
|
|
136
|
-
hasShortcut: boolean;
|
|
137
|
-
shortcutProps?: undefined;
|
|
138
|
-
dropdownComponentProps?: undefined;
|
|
139
|
-
sharedProps?: undefined;
|
|
140
|
-
} | {
|
|
141
|
-
component: string;
|
|
142
|
-
hasShortcut: boolean;
|
|
143
|
-
shortcutProps: {
|
|
144
|
-
size: string;
|
|
145
|
-
onClick?: undefined;
|
|
146
|
-
ariaLabel?: undefined;
|
|
147
|
-
};
|
|
148
|
-
dropdownComponentProps: {
|
|
149
|
-
label: string;
|
|
150
|
-
size: string;
|
|
151
|
-
onClick?: undefined;
|
|
152
|
-
};
|
|
153
|
-
sharedProps: {
|
|
154
|
-
Icon: (rest: any) => JSX.Element;
|
|
155
|
-
color: string[];
|
|
156
|
-
onClick?: undefined;
|
|
157
|
-
};
|
|
158
|
-
})[];
|
|
159
|
-
export const shortcutCb: jest.Mock<null, []>;
|
|
160
|
-
export const dropdownCb: jest.Mock<null, []>;
|
|
161
|
-
export const sharedCb: jest.Mock<null, []>;
|