@elliemae/ds-mini-toolbar 2.2.0-alpha.3 → 2.2.0-next.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.
Files changed (53) hide show
  1. package/cjs/Components/MiniToolbar.js +49 -60
  2. package/cjs/Components/ToolbarShortcut.js +60 -60
  3. package/cjs/Components/outOfTheBox/Button.js +27 -39
  4. package/cjs/Components/outOfTheBox/ComboBox.js +25 -39
  5. package/cjs/Components/outOfTheBox/IconItem.js +30 -44
  6. package/cjs/Components/outOfTheBox/SearchBox.js +48 -51
  7. package/cjs/Components/outOfTheBox/Separator.js +18 -38
  8. package/cjs/Components/outOfTheBox/index.js +26 -53
  9. package/cjs/hooks/useGenerateItems.js +101 -87
  10. package/cjs/index.d.js +2 -27
  11. package/cjs/index.js +12 -38
  12. package/cjs/propTypes.js +27 -61
  13. package/cjs/styles.js +29 -62
  14. package/esm/Components/MiniToolbar.js +33 -25
  15. package/esm/Components/ToolbarShortcut.js +46 -26
  16. package/esm/Components/outOfTheBox/Button.js +18 -10
  17. package/esm/Components/outOfTheBox/ComboBox.js +17 -10
  18. package/esm/Components/outOfTheBox/IconItem.js +22 -15
  19. package/esm/Components/outOfTheBox/SearchBox.js +38 -22
  20. package/esm/Components/outOfTheBox/Separator.js +10 -9
  21. package/esm/Components/outOfTheBox/index.js +13 -24
  22. package/esm/hooks/useGenerateItems.js +85 -62
  23. package/esm/index.d.js +1 -2
  24. package/esm/index.js +2 -9
  25. package/esm/propTypes.js +19 -29
  26. package/esm/styles.js +17 -33
  27. package/package.json +6 -6
  28. package/cjs/Components/MiniToolbar.js.map +0 -7
  29. package/cjs/Components/ToolbarShortcut.js.map +0 -7
  30. package/cjs/Components/outOfTheBox/Button.js.map +0 -7
  31. package/cjs/Components/outOfTheBox/ComboBox.js.map +0 -7
  32. package/cjs/Components/outOfTheBox/IconItem.js.map +0 -7
  33. package/cjs/Components/outOfTheBox/SearchBox.js.map +0 -7
  34. package/cjs/Components/outOfTheBox/Separator.js.map +0 -7
  35. package/cjs/Components/outOfTheBox/index.js.map +0 -7
  36. package/cjs/hooks/useGenerateItems.js.map +0 -7
  37. package/cjs/index.d.js.map +0 -7
  38. package/cjs/index.js.map +0 -7
  39. package/cjs/propTypes.js.map +0 -7
  40. package/cjs/styles.js.map +0 -7
  41. package/esm/Components/MiniToolbar.js.map +0 -7
  42. package/esm/Components/ToolbarShortcut.js.map +0 -7
  43. package/esm/Components/outOfTheBox/Button.js.map +0 -7
  44. package/esm/Components/outOfTheBox/ComboBox.js.map +0 -7
  45. package/esm/Components/outOfTheBox/IconItem.js.map +0 -7
  46. package/esm/Components/outOfTheBox/SearchBox.js.map +0 -7
  47. package/esm/Components/outOfTheBox/Separator.js.map +0 -7
  48. package/esm/Components/outOfTheBox/index.js.map +0 -7
  49. package/esm/hooks/useGenerateItems.js.map +0 -7
  50. package/esm/index.d.js.map +0 -7
  51. package/esm/index.js.map +0 -7
  52. package/esm/propTypes.js.map +0 -7
  53. package/esm/styles.js.map +0 -7
@@ -1,102 +1,125 @@
1
- import * as React from "react";
2
- import React2, { useMemo } from "react";
3
- import { uid } from "uid";
4
- import { Search } from "@elliemae/ds-icons";
5
- import {
6
- ICON_ITEM,
7
- SEPARATOR,
8
- BUTTON,
9
- SEARCH_BOX,
10
- COMBO_BOX,
11
- MiniToolbarButton,
12
- MiniToolbarSeparator,
13
- MiniToolbarSearchBox,
14
- MiniToolbarIcon,
15
- MiniToolbarComboBox
16
- } from "../Components/outOfTheBox";
17
- import { ToolbarShortcut } from "../Components/ToolbarShortcut";
18
- import { MiniToolbarSearchButton } from "../Components/outOfTheBox/SearchBox";
19
- const useGenerateItems = (items) => {
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 => {
20
28
  const instanceUID = useMemo(() => uid(6), []);
21
- const shortcutItems = useMemo(() => items.filter((item) => item.hasShortcut || item.component === SEARCH_BOX || item.contextualRegion).map((item, index) => {
22
- const { component, shortcutComponent, shortcutProps, sharedProps, contextualRegion, contextualRegionProps } = item;
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;
23
38
  let Component;
24
39
  let ContextualRegion;
25
- if (component === SEPARATOR)
26
- return /* @__PURE__ */ React2.createElement(MiniToolbarSeparator, null);
27
- if (component === BUTTON)
28
- Component = MiniToolbarButton;
29
- else if (component === ICON_ITEM)
30
- Component = MiniToolbarIcon;
31
- else if (component === COMBO_BOX)
32
- Component = MiniToolbarComboBox;
33
- else if (component === SEARCH_BOX) {
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) {
34
42
  if (item.hasShortcut) {
35
43
  Component = MiniToolbarSearchButton;
36
44
  }
45
+
37
46
  ContextualRegion = MiniToolbarSearchBox;
38
47
  }
48
+
39
49
  if (!ContextualRegion) {
40
50
  ContextualRegion = contextualRegion;
41
51
  }
52
+
42
53
  if (!Component) {
43
54
  Component = shortcutComponent;
44
55
  }
45
- return /* @__PURE__ */ React2.createElement(ToolbarShortcut, {
46
- key: `${instanceUID}-shortcut-${index}`,
47
- Component,
48
- shortcutProps,
49
- sharedProps,
50
- ContextualRegion,
51
- contextualRegionProps
52
- });
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));
53
64
  }), [instanceUID, items]);
54
65
  const dropdownMenuItems = useMemo(() => items.map((item, index) => {
55
- const { component, sharedProps, dropdownComponentProps } = item;
66
+ const {
67
+ component,
68
+ sharedProps,
69
+ dropdownComponentProps
70
+ } = item;
56
71
  const dropdownItem = {};
57
- const { Icon, color, label, onClick } = {
58
- ...sharedProps,
59
- ...dropdownComponentProps
60
- };
61
- if (component === SEPARATOR)
62
- dropdownItem.type = "separator";
63
- else {
64
- dropdownItem.id = `${instanceUID}-dropdown-${index}`;
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
+
65
83
  dropdownItem.onClick = () => onClick(item);
84
+
66
85
  dropdownItem.label = label;
67
- dropdownItem.onKeyDown = (e) => {
68
- if (e.key === "Enter" || e.key === " ") {
86
+
87
+ dropdownItem.onKeyDown = e => {
88
+ if (e.key === 'Enter' || e.key === ' ') {
69
89
  onClick(item);
70
90
  }
71
91
  };
72
92
  }
93
+
73
94
  if (component === ICON_ITEM) {
74
- dropdownItem.leftAddon = /* @__PURE__ */ React2.createElement(Icon, {
75
- color
95
+ dropdownItem.leftAddon = /*#__PURE__*/_jsx(Icon, {
96
+ color: color
76
97
  });
77
98
  } else if (component === SEARCH_BOX) {
78
- dropdownItem.leftAddon = /* @__PURE__ */ React2.createElement(Search, {
79
- color
99
+ dropdownItem.leftAddon = /*#__PURE__*/_jsx(Search, {
100
+ color: color
80
101
  });
81
102
  } else if (component === COMBO_BOX) {
82
- dropdownItem.type = "subMenu";
103
+ dropdownItem.type = 'subMenu';
83
104
  dropdownItem.label = label;
84
- dropdownItem.subItems = sharedProps.options.map((option, index2) => {
85
- option.id = `${instanceUID}-option-${index2}`;
105
+ dropdownItem.subItems = sharedProps.options.map((option, index) => {
106
+ option.id = "".concat(instanceUID, "-option-").concat(index);
107
+
86
108
  option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);
87
- option.onKeyDown = (e) => {
88
- if (e.key === " " || e.key === "Enter") {
109
+
110
+ option.onKeyDown = e => {
111
+ if (e.key === ' ' || e.key === 'Enter') {
89
112
  dropdownComponentProps.onSelectMenuItem(option);
90
113
  }
91
114
  };
115
+
92
116
  return option;
93
117
  });
94
118
  }
119
+
95
120
  return dropdownItem;
96
121
  }), [instanceUID, items]);
97
122
  return [shortcutItems, dropdownMenuItems];
98
123
  };
99
- export {
100
- useGenerateItems
101
- };
102
- //# sourceMappingURL=useGenerateItems.js.map
124
+
125
+ export { useGenerateItems };
package/esm/index.d.js CHANGED
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=index.d.js.map
1
+
package/esm/index.js CHANGED
@@ -1,9 +1,2 @@
1
- import * as React from "react";
2
- import { MiniToolbar, MiniToolbarWithSchema } from "./Components/MiniToolbar";
3
- import { ToolbarItemWithSchema } from "./propTypes";
4
- export {
5
- MiniToolbar,
6
- MiniToolbarWithSchema,
7
- ToolbarItemWithSchema
8
- };
9
- //# sourceMappingURL=index.js.map
1
+ export { MiniToolbar, MiniToolbarWithSchema } from './Components/MiniToolbar.js';
2
+ export { ToolbarItemWithSchema } from './propTypes.js';
package/esm/propTypes.js CHANGED
@@ -1,40 +1,30 @@
1
- import * as React from "react";
2
- import { PropTypes, describe } from "react-desc";
3
- const outOfTheBoxType = PropTypes.oneOf([
4
- "ds-button",
5
- "ds-icon-item",
6
- "ds-separator",
7
- "ds-search-box",
8
- "ds-combo-box"
9
- ]).description("out-of-the-box toolbar components");
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');
10
4
  const toolbarItemProps = {
11
- component: PropTypes.oneOfType([
12
- outOfTheBoxType,
13
- PropTypes.element
14
- ]).description("Main component").isRequired,
15
- hasShortcut: PropTypes.bool.description("Whether to include the component as a shortcut in the toolbar or not").defaultValue(false),
16
- shortcutComponent: PropTypes.element.description("Component to render as a shortcut in the toolbar"),
17
- shortcutProps: PropTypes.object.description("Shortcut component props"),
18
- dropdownComponentProps: PropTypes.object.description("Dropdown component props"),
19
- sharedProps: PropTypes.object.description("Props shared by shortcut component and dropdown component"),
20
- contextualRegion: PropTypes.element.description("Component that can be rendered as an adjacent region to the shortcut component"),
21
- contextualRegionProps: PropTypes.object.description("Contextual region component props")
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')
22
13
  };
23
- const itemPropTypes = PropTypes.shape(toolbarItemProps).description("Items props");
14
+ const itemPropTypes = PropTypes.shape(toolbarItemProps).description('Items props');
24
15
  const overflowButtonPropTypes = {
25
16
  ariaLabel: PropTypes.string,
26
- buttonType: PropTypes.oneOf(["secondary", "text"]),
17
+ buttonType: PropTypes.oneOf(['secondary', 'text']),
27
18
  style: PropTypes.object
28
19
  };
29
20
  const miniToolbarProps = {
30
- items: PropTypes.arrayOf(itemPropTypes).description("Array of items").isRequired,
31
- overflowButtonProps: PropTypes.shape(overflowButtonPropTypes).description("Overflow button props")
21
+ items: PropTypes.arrayOf(itemPropTypes).description('Array of items').isRequired,
22
+ overflowButtonProps: PropTypes.shape(overflowButtonPropTypes).description('Overflow button props')
32
23
  };
24
+
33
25
  const ToolbarItem = () => null;
26
+
34
27
  const ToolbarItemWithSchema = describe(ToolbarItem);
35
28
  ToolbarItemWithSchema.propTypes = toolbarItemProps;
36
- export {
37
- ToolbarItemWithSchema,
38
- miniToolbarProps
39
- };
40
- //# sourceMappingURL=propTypes.js.map
29
+
30
+ export { ToolbarItemWithSchema, miniToolbarProps };
package/esm/styles.js CHANGED
@@ -1,33 +1,17 @@
1
- import * as React from "react";
2
- import styled from "styled-components";
3
- import { DSButton } from "@elliemae/ds-button";
4
- const Container = styled.ul`
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
- width: fit-content;
9
- padding: 0 6px;
10
- `;
11
- const Separator = styled.span`
12
- height: 24px;
13
- width: 1px;
14
- margin: 6px;
15
- border-left: 1px solid #bbb;
16
- `;
17
- const Item = styled.li`
18
- display: flex;
19
- margin: 6px;
20
- cursor: pointer;
21
- `;
22
- const StyledButton = styled(DSButton)`
23
- &:not(:focus) {
24
- border-color: transparent;
25
- }
26
- `;
27
- export {
28
- Container,
29
- Item,
30
- Separator,
31
- StyledButton
32
- };
33
- //# sourceMappingURL=styles.js.map
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-mini-toolbar",
3
- "version": "2.2.0-alpha.3",
3
+ "version": "2.2.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - MiniToolbar",
6
6
  "module": "./esm/index.js",
@@ -72,11 +72,11 @@
72
72
  "build": "node ../../scripts/build/build.js"
73
73
  },
74
74
  "dependencies": {
75
- "@elliemae/ds-button": "2.2.0-alpha.3",
76
- "@elliemae/ds-dropdownmenu": "2.2.0-alpha.3",
77
- "@elliemae/ds-form": "2.2.0-alpha.3",
78
- "@elliemae/ds-icons": "2.2.0-alpha.3",
79
- "@elliemae/ds-system": "2.2.0-alpha.3",
75
+ "@elliemae/ds-button": "2.2.0-next.2",
76
+ "@elliemae/ds-dropdownmenu": "2.2.0-next.2",
77
+ "@elliemae/ds-form": "2.2.0-next.2",
78
+ "@elliemae/ds-icons": "2.2.0-next.2",
79
+ "@elliemae/ds-system": "2.2.0-next.2",
80
80
  "react-desc": "~4.1.3",
81
81
  "uid": "~2.0.0"
82
82
  },
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Components/MiniToolbar.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useState, useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { StyledButton, Container } from '../styles';\nimport { miniToolbarProps } from '../propTypes';\nimport { useGenerateItems } from '../hooks/useGenerateItems';\nimport { MiniToolbarPropsT } from '../index.d';\n\nconst Elipsis = <MoreOptionsVert color={['brand-primary', '600']} size=\"m\" />;\n\nconst MiniToolbar = ({ items, overflowButtonProps }: MiniToolbarPropsT): React.ReactElement => {\n const [shortcutItems, dropdownMenuItems] = useGenerateItems(items);\n const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState<boolean>(false);\n\n const closeDropdownMenu = useCallback(() => setIsDropdownMenuOpen(false), []);\n const openDropdownMenu = useCallback(() => setIsDropdownMenuOpen(true), []);\n const openDropdownMenuKeyPress = useCallback((e) => {\n if (e.key === ' ') {\n setIsDropdownMenuOpen(true);\n }\n }, []);\n\n const { ariaLabel, style, buttonType = 'secondary' } = overflowButtonProps || {};\n\n return (\n <Container role=\"toolbar\" data-testid=\"ds-mini-toolbar\">\n {shortcutItems}\n <DSDropdownMenu\n data-testid=\"ds-mini-toolbar__dropdown-menu\"\n isOpen={isDropdownMenuOpen}\n onSelectMenuItem={closeDropdownMenu}\n onClickOutsideMenu={closeDropdownMenu}\n options={dropdownMenuItems}\n triggerComponent={\n <StyledButton\n aria-label={ariaLabel}\n data-testid=\"ds-mini-toolbar__elipsis\"\n size=\"m\"\n style={style}\n buttonType={buttonType}\n onClick={openDropdownMenu}\n onKeyPress={openDropdownMenuKeyPress}\n leftIcon={Elipsis}\n />\n }\n />\n </Container>\n );\n};\n\nMiniToolbar.propTypes = miniToolbarProps;\nconst MiniToolbarWithSchema = describe(MiniToolbar);\nMiniToolbarWithSchema.propTypes = miniToolbarProps;\n\nexport { MiniToolbar, MiniToolbarWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,wBAAyB;AACzB,6BAA+B;AAC/B,sBAAgC;AAChC,oBAAwC;AACxC,uBAAiC;AACjC,8BAAiC;AAGjC,MAAM,UAAU,mDAAC,iCAAD;AAAA,EAAiB,OAAO,CAAC,iBAAiB;AAAA,EAAQ,MAAK;AAAA;AAEvE,MAAM,cAAc,CAAC,EAAE,OAAO,0BAAiE;AAC7F,QAAM,CAAC,eAAe,qBAAqB,8CAAiB;AAC5D,QAAM,CAAC,oBAAoB,yBAAyB,2BAAkB;AAEtE,QAAM,oBAAoB,8BAAY,MAAM,sBAAsB,QAAQ;AAC1E,QAAM,mBAAmB,8BAAY,MAAM,sBAAsB,OAAO;AACxE,QAAM,2BAA2B,8BAAY,CAAC,MAAM;AAClD,QAAI,EAAE,QAAQ,KAAK;AACjB,4BAAsB;AAAA;AAAA,KAEvB;AAEH,QAAM,EAAE,WAAW,OAAO,aAAa,gBAAgB,uBAAuB;AAE9E,SACE,mDAAC,yBAAD;AAAA,IAAW,MAAK;AAAA,IAAU,eAAY;AAAA,KACnC,eACD,mDAAC,uCAAD;AAAA,IACE,eAAY;AAAA,IACZ,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,SAAS;AAAA,IACT,kBACE,mDAAC,4BAAD;AAAA,MACE,cAAY;AAAA,MACZ,eAAY;AAAA,MACZ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA;AAAA;AAAA;AAQtB,YAAY,YAAY;AACxB,MAAM,wBAAwB,gCAAS;AACvC,sBAAsB,YAAY;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Components/ToolbarShortcut.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useRef, useEffect } from 'react';\nimport { Item } from '../styles';\nimport { ToolbarShortcutPropsT } from '../index.d';\n\nconst ToolbarShortcut = (props: ToolbarShortcutPropsT): React.ReactElement => {\n const { Component, shortcutProps, sharedProps, ContextualRegion, contextualRegionProps } = props;\n const leftRef = useRef<HTMLElement | null>(null);\n const rightRef = useRef<HTMLElement | null>(null);\n const timerLeft = useRef<ReturnType<typeof setInterval> | null>(null);\n const timerRight = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const { position = 'left', isOpen = false } = contextualRegionProps || {};\n const { style } = shortcutProps || {};\n\n const mergedProps = {\n ...sharedProps,\n ...shortcutProps,\n };\n\n useEffect(() => {\n if (isOpen && leftRef.current) {\n timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);\n }\n if (isOpen && rightRef.current) {\n timerRight.current = setTimeout(() => rightRef.current.focus(), 200);\n }\n\n return () => {\n clearTimeout(timerLeft.current);\n clearTimeout(timerRight.current);\n };\n }, [isOpen, leftRef, rightRef]);\n\n return (\n <>\n {isOpen && position === 'left' && (\n <Item>\n <ContextualRegion innerRef={leftRef} {...contextualRegionProps} />\n </Item>\n )}\n {Component && (\n <Item style={style}>\n <Component {...mergedProps} />\n </Item>\n )}\n {isOpen && position === 'right' && (\n <Item>\n <ContextualRegion innerRef={rightRef} {...contextualRegionProps} />\n </Item>\n )}\n </>\n );\n};\n\nexport { ToolbarShortcut };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,oBAAqB;AAGrB,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,yBAA2B;AAC3C,QAAM,WAAW,yBAA2B;AAC5C,QAAM,YAAY,yBAA8C;AAChE,QAAM,aAAa,yBAA8C;AAEjE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB;AACvE,QAAM,EAAE,UAAU,iBAAiB;AAEnC,QAAM,cAAc;AAAA,OACf;AAAA,OACA;AAAA;AAGL,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,SAAS;AAAA;AAEhE,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,SAAS;AAAA;AAGlE,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,mBAAa,WAAW;AAAA;AAAA,KAEzB,CAAC,QAAQ,SAAS;AAErB,SACE,wFACG,UAAU,aAAa,UACtB,mDAAC,oBAAD,MACE,mDAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,OAAa;AAAA,OAG5C,aACC,mDAAC,oBAAD;AAAA,IAAM;AAAA,KACJ,mDAAC,WAAD;AAAA,OAAe;AAAA,OAGlB,UAAU,aAAa,WACtB,mDAAC,oBAAD,MACE,mDAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,OAAc;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/Button.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst MiniToolbarButton = (props: Record<string, unknown>): React.ReactElement => (\n <DSButton {...props} aria-label={props.ariaLabel} data-testid=\"ds-mini-toolbar__shortcut\" />\n);\n\nexport { MiniToolbarButton };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAAyB;AAEzB,MAAM,oBAAoB,CAAC,UACzB,mDAAC,2BAAD;AAAA,KAAc;AAAA,EAAO,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/ComboBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { DSComboBox2 } from '@elliemae/ds-form';\n\nconst MiniToolbarComboBox = (props: Record<string, unknown>): React.ReactElement => <DSComboBox2 {...props} />;\n\nexport { MiniToolbarComboBox };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,qBAA4B;AAE5B,MAAM,sBAAsB,CAAC,UAAuD,mDAAC,4BAAD;AAAA,KAAiB;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/IconItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarIcon = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { Icon, size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Icon size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nexport { MiniToolbarIcon };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAA6B;AAG7B,MAAM,kBAAkB,CAAC,UAAyD;AAChF,QAAM,EAAE,MAAM,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAEnF,SACE,mDAAC,4BAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,mDAAC,MAAD;AAAA,MAAM;AAAA,MAAY;AAAA;AAAA,IAC5B,eAAY;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/SearchBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarSearchButton = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Search size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nconst MiniToolbarSearchBox = (props: Record<string, unknown>): JSX.Element => (\n <DSSearchBox clearable showIcon={false} {...props} />\n);\n\nexport { MiniToolbarSearchButton, MiniToolbarSearchBox };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,sBAAuB;AACvB,qBAA4B;AAC5B,oBAA6B;AAG7B,MAAM,0BAA0B,CAAC,UAAyD;AACxF,QAAM,EAAE,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAE7E,SACE,mDAAC,4BAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,mDAAC,wBAAD;AAAA,MAAQ;AAAA,MAAY;AAAA;AAAA,IAC9B,eAAY;AAAA;AAAA;AAKlB,MAAM,uBAAuB,CAAC,UAC5B,mDAAC,4BAAD;AAAA,EAAa,WAAS;AAAA,EAAC,UAAU;AAAA,KAAW;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/Separator.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { Separator } from '../../styles';\n\nconst MiniToolbarSeparator = (): React.ReactElement => (\n <Separator data-testid=\"ds-mini-toolbar__separator\" />\n);\n\nexport { MiniToolbarSeparator };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAA0B;AAE1B,MAAM,uBAAuB,MAC3B,mDAAC,yBAAD;AAAA,EAAW,eAAY;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Components/outOfTheBox/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { MiniToolbarButton } from './Button';\nexport { MiniToolbarIcon } from './IconItem';\nexport { MiniToolbarSearchBox } from './SearchBox';\nexport { MiniToolbarSeparator } from './Separator';\nexport { MiniToolbarComboBox } from './ComboBox';\n\nexport const ICON_ITEM = 'ds-icon-item';\nexport const SEPARATOR = 'ds-separator';\nexport const BUTTON = 'ds-button';\nexport const SEARCH_BOX = 'ds-search-box';\nexport const COMBO_BOX = 'ds-combo-box';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAkC;AAClC,sBAAgC;AAChC,uBAAqC;AACrC,uBAAqC;AACrC,sBAAoC;AAE7B,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,aAAa;AACnB,MAAM,YAAY;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useGenerateItems.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { Search } from '@elliemae/ds-icons';\nimport {\n ICON_ITEM,\n SEPARATOR,\n BUTTON,\n SEARCH_BOX,\n COMBO_BOX,\n MiniToolbarButton,\n MiniToolbarSeparator,\n MiniToolbarSearchBox,\n MiniToolbarIcon,\n MiniToolbarComboBox,\n} from '../Components/outOfTheBox';\nimport { ToolbarShortcut } from '../Components/ToolbarShortcut';\nimport { MiniToolbarSearchButton } from '../Components/outOfTheBox/SearchBox';\nimport { GeneratedDropdownItemT, MiniToolbarItemT } from '../index.d';\n\nconst useGenerateItems = (items: MiniToolbarItemT[]): [React.ReactElement[], GeneratedDropdownItemT[]] => {\n const instanceUID = useMemo(() => uid(6), []);\n\n const shortcutItems = useMemo(\n () =>\n items\n .filter((item) => item.hasShortcut || item.component === SEARCH_BOX || item.contextualRegion)\n .map((item, index) => {\n const { component, shortcutComponent, shortcutProps, sharedProps, contextualRegion, contextualRegionProps } =\n item;\n\n let Component;\n let ContextualRegion;\n\n if (component === SEPARATOR) return <MiniToolbarSeparator />;\n if (component === BUTTON) Component = MiniToolbarButton;\n else if (component === ICON_ITEM) Component = MiniToolbarIcon;\n else if (component === COMBO_BOX) Component = MiniToolbarComboBox;\n else if (component === SEARCH_BOX) {\n if (item.hasShortcut) {\n Component = MiniToolbarSearchButton;\n }\n ContextualRegion = MiniToolbarSearchBox;\n }\n if (!ContextualRegion) {\n ContextualRegion = contextualRegion;\n }\n if (!Component) {\n Component = shortcutComponent;\n }\n\n return (\n <ToolbarShortcut\n key={`${instanceUID}-shortcut-${index}`}\n Component={Component}\n shortcutProps={shortcutProps}\n sharedProps={sharedProps}\n ContextualRegion={ContextualRegion}\n contextualRegionProps={contextualRegionProps}\n />\n );\n }),\n [instanceUID, items],\n );\n\n const dropdownMenuItems = useMemo(\n () =>\n items.map((item, index) => {\n const { component, sharedProps, dropdownComponentProps } = item;\n const dropdownItem: GeneratedDropdownItemT = {};\n\n const { Icon, color, label, onClick } = {\n ...sharedProps,\n ...dropdownComponentProps,\n };\n\n if (component === SEPARATOR) dropdownItem.type = 'separator';\n else {\n dropdownItem.id = `${instanceUID}-dropdown-${index}`;\n dropdownItem.onClick = () => onClick(item);\n dropdownItem.label = label;\n dropdownItem.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick(item);\n }\n };\n }\n\n if (component === ICON_ITEM) {\n dropdownItem.leftAddon = <Icon color={color} />;\n } else if (component === SEARCH_BOX) {\n dropdownItem.leftAddon = <Search color={color} />;\n } else if (component === COMBO_BOX) {\n dropdownItem.type = 'subMenu';\n dropdownItem.label = label;\n dropdownItem.subItems = sharedProps.options.map((option, index) => {\n option.id = `${instanceUID}-option-${index}`;\n option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);\n option.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n dropdownComponentProps.onSelectMenuItem(option);\n }\n };\n return option;\n });\n }\n\n return dropdownItem;\n }),\n [instanceUID, items],\n );\n\n return [shortcutItems, dropdownMenuItems];\n};\n\nexport { useGenerateItems };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,iBAAoB;AACpB,sBAAuB;AACvB,yBAWO;AACP,6BAAgC;AAChC,uBAAwC;AAGxC,MAAM,mBAAmB,CAAC,UAAgF;AACxG,QAAM,cAAc,0BAAQ,MAAM,oBAAI,IAAI;AAE1C,QAAM,gBAAgB,0BACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,iCAAc,KAAK,kBAC3E,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,mDAAC,yCAAD;AACpC,QAAI,cAAc;AAAQ,kBAAY;AAAA,aAC7B,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc,+BAAY;AACjC,UAAI,KAAK,aAAa;AACpB,oBAAY;AAAA;AAEd,yBAAmB;AAAA;AAErB,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA;AAErB,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA;AAGd,WACE,mDAAC,wCAAD;AAAA,MACE,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAIV,CAAC,aAAa;AAGhB,QAAM,oBAAoB,0BACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC;AAE7C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY;AAAA,SACnC;AAAA,SACA;AAAA;AAGL,QAAI,cAAc;AAAW,mBAAa,OAAO;AAAA,SAC5C;AACH,mBAAa,KAAK,GAAG,wBAAwB;AAC7C,mBAAa,UAAU,MAAM,QAAQ;AACrC,mBAAa,QAAQ;AACrB,mBAAa,YAAY,CAAC,MAA2B;AACnD,YAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,kBAAQ;AAAA;AAAA;AAAA;AAKd,QAAI,cAAc,8BAAW;AAC3B,mBAAa,YAAY,mDAAC,MAAD;AAAA,QAAM;AAAA;AAAA,eACtB,cAAc,+BAAY;AACnC,mBAAa,YAAY,mDAAC,wBAAD;AAAA,QAAQ;AAAA;AAAA,eACxB,cAAc,8BAAW;AAClC,mBAAa,OAAO;AACpB,mBAAa,QAAQ;AACrB,mBAAa,WAAW,YAAY,QAAQ,IAAI,CAAC,QAAQ,WAAU;AACjE,eAAO,KAAK,GAAG,sBAAsB;AACrC,eAAO,UAAU,MAAM,uBAAuB,iBAAiB;AAC/D,eAAO,YAAY,CAAC,MAA2B;AAC7C,cAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,mCAAuB,iBAAiB;AAAA;AAAA;AAG5C,eAAO;AAAA;AAAA;AAIX,WAAO;AAAA,MAEX,CAAC,aAAa;AAGhB,SAAO,CAAC,eAAe;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.d.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\n\ntype SvgIconSizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\ntype SvgIconColorType =\n | ['neutral', '900']\n | ['neutral', '500']\n | ['neutral', '0']\n | ['danger', '900']\n | ['warning', '600']\n | ['success', '900']\n | ['brand-primary', '600'];\n\ntype SharedProps = {\n options?: Record<string, unknown>[];\n onClick?: (item: MiniToolbarItemT) => void;\n Icon?: React.ComponentType<Record<string, unknown>>;\n label?: string;\n} & Record<string, unknown>;\n\ntype ShortcutProps = {\n style?: React.CSSProperties;\n} & Record<string, unknown>;\n\ntype ContextualRegionProps = {\n position?: 'left' | 'right';\n isOpen: boolean;\n} & Record<string, unknown>;\n\ntype DropdownComponentProps = {\n onClick?: (item: MiniToolbarItemT) => void;\n label?: string;\n Icon?: React.ComponentType<Record<string, unknown>>;\n color?: SvgIconColorType;\n onSelectMenuItem: (option: Record<string, unknown>) => void;\n} & Record<string, unknown>;\n\ntype OverflowButtonProps = {\n ariaLabel?: string;\n style?: React.CSSProperties;\n buttonType?: 'secondary' | 'text';\n};\ninterface DefaultIconItemProps {\n Icon: React.ComponentType<{ size: SvgIconSizeType; color: SvgIconColorType }>;\n size?: SvgIconSizeType;\n color?: SvgIconColorType;\n onClick?: (item: MiniToolbarItemT) => void;\n ariaLabel?: string;\n style?: React.CSSProperties;\n}\n\ntype MiniToolbarIconItemPropsT = DefaultIconItemProps & Record<string, unknown>;\n\ntype MiniToolbarButtonPropsT = { ariaLabel: string } & Record<string, unknown>;\n\ninterface MiniToolbarItemT {\n component: 'ds-button' | 'ds-icon-item' | 'ds-separator' | 'ds-search-box' | 'ds-combo-box' | React.ReactElement;\n hasShortcut?: boolean;\n shortcutComponent?: React.ReactElement;\n shortcutProps?: ShortcutProps;\n dropdownComponentProps?: DropdownComponentProps;\n sharedProps?: SharedProps;\n contextualRegion?: React.ReactElement;\n contextualRegionProps?: ContextualRegionProps;\n [key: string]: unknown;\n}\n\ninterface ToolbarShortcutPropsT {\n Component: React.ComponentType<Record<string, unknown>>;\n shortcutProps: ShortcutProps;\n sharedProps: SharedProps;\n ContextualRegion: React.ComponentType<Record<string, unknown>>;\n contextualRegionProps: ContextualRegionProps;\n}\n\ninterface MiniToolbarPropsT {\n items: MiniToolbarItemT[];\n overflowButtonProps?: OverflowButtonProps;\n}\n\ntype GeneratedDropdownItemT = {\n id?: string;\n label?: string;\n onClick?: (item: MiniToolbarItemT) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n leftAddon?: React.ReactElement;\n subItems?: Record<string, unknown>[];\n type?: 'separator' | 'subMenu';\n};\n\nexport {\n MiniToolbarIconItemPropsT,\n MiniToolbarButtonPropsT,\n MiniToolbarItemT,\n ToolbarShortcutPropsT,\n MiniToolbarPropsT,\n GeneratedDropdownItemT,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
- "names": []
7
- }
package/cjs/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { MiniToolbar, MiniToolbarWithSchema } from './Components/MiniToolbar';\nexport { ToolbarItemWithSchema } from './propTypes';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmD;AACnD,uBAAsC;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes, describe } from 'react-desc';\n\nconst outOfTheBoxType = PropTypes.oneOf([\n 'ds-button',\n 'ds-icon-item',\n 'ds-separator',\n 'ds-search-box',\n 'ds-combo-box',\n]).description('out-of-the-box toolbar components');\n\nconst toolbarItemProps = {\n component: PropTypes.oneOfType([\n outOfTheBoxType,\n PropTypes.element,\n ]).description('Main component').isRequired,\n hasShortcut: PropTypes.bool\n .description(\n 'Whether to include the component as a shortcut in the toolbar or not',\n )\n .defaultValue(false),\n shortcutComponent: PropTypes.element.description(\n 'Component to render as a shortcut in the toolbar',\n ),\n shortcutProps: PropTypes.object.description('Shortcut component props'),\n dropdownComponentProps: PropTypes.object.description(\n 'Dropdown component props',\n ),\n sharedProps: PropTypes.object.description(\n 'Props shared by shortcut component and dropdown component',\n ),\n contextualRegion: PropTypes.element.description(\n 'Component that can be rendered as an adjacent region to the shortcut component',\n ),\n contextualRegionProps: PropTypes.object.description(\n 'Contextual region component props',\n ),\n};\n\nconst itemPropTypes = PropTypes.shape(toolbarItemProps).description(\n 'Items props',\n);\n\nconst overflowButtonPropTypes = {\n ariaLabel: PropTypes.string,\n buttonType: PropTypes.oneOf(['secondary', 'text']),\n style: PropTypes.object,\n};\n\nconst miniToolbarProps = {\n items: PropTypes.arrayOf(itemPropTypes).description('Array of items')\n .isRequired,\n overflowButtonProps: PropTypes.shape(overflowButtonPropTypes).description(\n 'Overflow button props',\n ),\n};\n\nconst ToolbarItem = () => null;\n\nconst ToolbarItemWithSchema = describe(ToolbarItem);\nToolbarItemWithSchema.propTypes = toolbarItemProps;\nexport { ToolbarItemWithSchema, miniToolbarProps };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAoC;AAEpC,MAAM,kBAAkB,4BAAU,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC,YAAY;AAEf,MAAM,mBAAmB;AAAA,EACvB,WAAW,4BAAU,UAAU;AAAA,IAC7B;AAAA,IACA,4BAAU;AAAA,KACT,YAAY,kBAAkB;AAAA,EACjC,aAAa,4BAAU,KACpB,YACC,wEAED,aAAa;AAAA,EAChB,mBAAmB,4BAAU,QAAQ,YACnC;AAAA,EAEF,eAAe,4BAAU,OAAO,YAAY;AAAA,EAC5C,wBAAwB,4BAAU,OAAO,YACvC;AAAA,EAEF,aAAa,4BAAU,OAAO,YAC5B;AAAA,EAEF,kBAAkB,4BAAU,QAAQ,YAClC;AAAA,EAEF,uBAAuB,4BAAU,OAAO,YACtC;AAAA;AAIJ,MAAM,gBAAgB,4BAAU,MAAM,kBAAkB,YACtD;AAGF,MAAM,0BAA0B;AAAA,EAC9B,WAAW,4BAAU;AAAA,EACrB,YAAY,4BAAU,MAAM,CAAC,aAAa;AAAA,EAC1C,OAAO,4BAAU;AAAA;AAGnB,MAAM,mBAAmB;AAAA,EACvB,OAAO,4BAAU,QAAQ,eAAe,YAAY,kBACjD;AAAA,EACH,qBAAqB,4BAAU,MAAM,yBAAyB,YAC5D;AAAA;AAIJ,MAAM,cAAc,MAAM;AAE1B,MAAM,wBAAwB,gCAAS;AACvC,sBAAsB,YAAY;",
6
- "names": []
7
- }
package/cjs/styles.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import styled from 'styled-components';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst Container = styled.ul`\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n padding: 0 6px;\n`;\n\nconst Separator = styled.span`\n height: 24px;\n width: 1px;\n margin: 6px;\n border-left: 1px solid #bbb;\n`;\n\nconst Item = styled.li`\n display: flex;\n margin: 6px;\n cursor: pointer;\n`;\n\nconst StyledButton = styled(DSButton)`\n &:not(:focus) {\n border-color: transparent;\n }\n`;\n\nexport { Container, Separator, Item, StyledButton };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,uBAAyB;AAEzB,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQzB,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOzB,MAAM,OAAO,iCAAO;AAAA;AAAA;AAAA;AAAA;AAMpB,MAAM,eAAe,sCAAO;AAAA;AAAA;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Components/MiniToolbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { StyledButton, Container } from '../styles';\nimport { miniToolbarProps } from '../propTypes';\nimport { useGenerateItems } from '../hooks/useGenerateItems';\nimport { MiniToolbarPropsT } from '../index.d';\n\nconst Elipsis = <MoreOptionsVert color={['brand-primary', '600']} size=\"m\" />;\n\nconst MiniToolbar = ({ items, overflowButtonProps }: MiniToolbarPropsT): React.ReactElement => {\n const [shortcutItems, dropdownMenuItems] = useGenerateItems(items);\n const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState<boolean>(false);\n\n const closeDropdownMenu = useCallback(() => setIsDropdownMenuOpen(false), []);\n const openDropdownMenu = useCallback(() => setIsDropdownMenuOpen(true), []);\n const openDropdownMenuKeyPress = useCallback((e) => {\n if (e.key === ' ') {\n setIsDropdownMenuOpen(true);\n }\n }, []);\n\n const { ariaLabel, style, buttonType = 'secondary' } = overflowButtonProps || {};\n\n return (\n <Container role=\"toolbar\" data-testid=\"ds-mini-toolbar\">\n {shortcutItems}\n <DSDropdownMenu\n data-testid=\"ds-mini-toolbar__dropdown-menu\"\n isOpen={isDropdownMenuOpen}\n onSelectMenuItem={closeDropdownMenu}\n onClickOutsideMenu={closeDropdownMenu}\n options={dropdownMenuItems}\n triggerComponent={\n <StyledButton\n aria-label={ariaLabel}\n data-testid=\"ds-mini-toolbar__elipsis\"\n size=\"m\"\n style={style}\n buttonType={buttonType}\n onClick={openDropdownMenu}\n onKeyPress={openDropdownMenuKeyPress}\n leftIcon={Elipsis}\n />\n }\n />\n </Container>\n );\n};\n\nMiniToolbar.propTypes = miniToolbarProps;\nconst MiniToolbarWithSchema = describe(MiniToolbar);\nMiniToolbarWithSchema.propTypes = miniToolbarProps;\n\nexport { MiniToolbar, MiniToolbarWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,UAAU,qCAAC,iBAAD;AAAA,EAAiB,OAAO,CAAC,iBAAiB;AAAA,EAAQ,MAAK;AAAA;AAEvE,MAAM,cAAc,CAAC,EAAE,OAAO,0BAAiE;AAC7F,QAAM,CAAC,eAAe,qBAAqB,iBAAiB;AAC5D,QAAM,CAAC,oBAAoB,yBAAyB,SAAkB;AAEtE,QAAM,oBAAoB,YAAY,MAAM,sBAAsB,QAAQ;AAC1E,QAAM,mBAAmB,YAAY,MAAM,sBAAsB,OAAO;AACxE,QAAM,2BAA2B,YAAY,CAAC,MAAM;AAClD,QAAI,EAAE,QAAQ,KAAK;AACjB,4BAAsB;AAAA;AAAA,KAEvB;AAEH,QAAM,EAAE,WAAW,OAAO,aAAa,gBAAgB,uBAAuB;AAE9E,SACE,qCAAC,WAAD;AAAA,IAAW,MAAK;AAAA,IAAU,eAAY;AAAA,KACnC,eACD,qCAAC,gBAAD;AAAA,IACE,eAAY;AAAA,IACZ,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,SAAS;AAAA,IACT,kBACE,qCAAC,cAAD;AAAA,MACE,cAAY;AAAA,MACZ,eAAY;AAAA,MACZ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA;AAAA;AAAA;AAQtB,YAAY,YAAY;AACxB,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Components/ToolbarShortcut.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useEffect } from 'react';\nimport { Item } from '../styles';\nimport { ToolbarShortcutPropsT } from '../index.d';\n\nconst ToolbarShortcut = (props: ToolbarShortcutPropsT): React.ReactElement => {\n const { Component, shortcutProps, sharedProps, ContextualRegion, contextualRegionProps } = props;\n const leftRef = useRef<HTMLElement | null>(null);\n const rightRef = useRef<HTMLElement | null>(null);\n const timerLeft = useRef<ReturnType<typeof setInterval> | null>(null);\n const timerRight = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const { position = 'left', isOpen = false } = contextualRegionProps || {};\n const { style } = shortcutProps || {};\n\n const mergedProps = {\n ...sharedProps,\n ...shortcutProps,\n };\n\n useEffect(() => {\n if (isOpen && leftRef.current) {\n timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);\n }\n if (isOpen && rightRef.current) {\n timerRight.current = setTimeout(() => rightRef.current.focus(), 200);\n }\n\n return () => {\n clearTimeout(timerLeft.current);\n clearTimeout(timerRight.current);\n };\n }, [isOpen, leftRef, rightRef]);\n\n return (\n <>\n {isOpen && position === 'left' && (\n <Item>\n <ContextualRegion innerRef={leftRef} {...contextualRegionProps} />\n </Item>\n )}\n {Component && (\n <Item style={style}>\n <Component {...mergedProps} />\n </Item>\n )}\n {isOpen && position === 'right' && (\n <Item>\n <ContextualRegion innerRef={rightRef} {...contextualRegionProps} />\n </Item>\n )}\n </>\n );\n};\n\nexport { ToolbarShortcut };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,OAA2B;AAC3C,QAAM,WAAW,OAA2B;AAC5C,QAAM,YAAY,OAA8C;AAChE,QAAM,aAAa,OAA8C;AAEjE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB;AACvE,QAAM,EAAE,UAAU,iBAAiB;AAEnC,QAAM,cAAc;AAAA,OACf;AAAA,OACA;AAAA;AAGL,YAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,SAAS;AAAA;AAEhE,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,SAAS;AAAA;AAGlE,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,mBAAa,WAAW;AAAA;AAAA,KAEzB,CAAC,QAAQ,SAAS;AAErB,SACE,4DACG,UAAU,aAAa,UACtB,qCAAC,MAAD,MACE,qCAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,OAAa;AAAA,OAG5C,aACC,qCAAC,MAAD;AAAA,IAAM;AAAA,KACJ,qCAAC,WAAD;AAAA,OAAe;AAAA,OAGlB,UAAU,aAAa,WACtB,qCAAC,MAAD,MACE,qCAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,OAAc;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/Button.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst MiniToolbarButton = (props: Record<string, unknown>): React.ReactElement => (\n <DSButton {...props} aria-label={props.ariaLabel} data-testid=\"ds-mini-toolbar__shortcut\" />\n);\n\nexport { MiniToolbarButton };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,oBAAoB,CAAC,UACzB,qCAAC,UAAD;AAAA,KAAc;AAAA,EAAO,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/ComboBox.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSComboBox2 } from '@elliemae/ds-form';\n\nconst MiniToolbarComboBox = (props: Record<string, unknown>): React.ReactElement => <DSComboBox2 {...props} />;\n\nexport { MiniToolbarComboBox };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,sBAAsB,CAAC,UAAuD,qCAAC,aAAD;AAAA,KAAiB;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/IconItem.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarIcon = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { Icon, size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Icon size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nexport { MiniToolbarIcon };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAAyD;AAChF,QAAM,EAAE,MAAM,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAEnF,SACE,qCAAC,cAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,qCAAC,MAAD;AAAA,MAAM;AAAA,MAAY;AAAA;AAAA,IAC5B,eAAY;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/SearchBox.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarSearchButton = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Search size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nconst MiniToolbarSearchBox = (props: Record<string, unknown>): JSX.Element => (\n <DSSearchBox clearable showIcon={false} {...props} />\n);\n\nexport { MiniToolbarSearchButton, MiniToolbarSearchBox };\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAGA,MAAM,0BAA0B,CAAC,UAAyD;AACxF,QAAM,EAAE,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAE7E,SACE,qCAAC,cAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,qCAAC,QAAD;AAAA,MAAQ;AAAA,MAAY;AAAA;AAAA,IAC9B,eAAY;AAAA;AAAA;AAKlB,MAAM,uBAAuB,CAAC,UAC5B,qCAAC,aAAD;AAAA,EAAa,WAAS;AAAA,EAAC,UAAU;AAAA,KAAW;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/Separator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Separator } from '../../styles';\n\nconst MiniToolbarSeparator = (): React.ReactElement => (\n <Separator data-testid=\"ds-mini-toolbar__separator\" />\n);\n\nexport { MiniToolbarSeparator };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,uBAAuB,MAC3B,qCAAC,WAAD;AAAA,EAAW,eAAY;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { MiniToolbarButton } from './Button';\nexport { MiniToolbarIcon } from './IconItem';\nexport { MiniToolbarSearchBox } from './SearchBox';\nexport { MiniToolbarSeparator } from './Separator';\nexport { MiniToolbarComboBox } from './ComboBox';\n\nexport const ICON_ITEM = 'ds-icon-item';\nexport const SEPARATOR = 'ds-separator';\nexport const BUTTON = 'ds-button';\nexport const SEARCH_BOX = 'ds-search-box';\nexport const COMBO_BOX = 'ds-combo-box';\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEO,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,aAAa;AACnB,MAAM,YAAY;",
6
- "names": []
7
- }