@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.
Files changed (96) hide show
  1. package/dist/cjs/Components/MiniToolbar.js +81 -0
  2. package/dist/cjs/Components/MiniToolbar.js.map +7 -0
  3. package/dist/cjs/Components/ToolbarShortcut.js +79 -0
  4. package/dist/cjs/Components/ToolbarShortcut.js.map +7 -0
  5. package/dist/cjs/Components/outOfTheBox/Button.js +57 -0
  6. package/dist/cjs/Components/outOfTheBox/Button.js.map +7 -0
  7. package/dist/cjs/Components/outOfTheBox/ComboBox.js +51 -0
  8. package/dist/cjs/Components/outOfTheBox/ComboBox.js.map +7 -0
  9. package/dist/cjs/Components/outOfTheBox/IconItem.js +50 -0
  10. package/dist/cjs/Components/outOfTheBox/IconItem.js.map +7 -0
  11. package/dist/cjs/Components/outOfTheBox/SearchBox.js +71 -0
  12. package/dist/cjs/Components/outOfTheBox/SearchBox.js.map +7 -0
  13. package/dist/cjs/Components/outOfTheBox/Separator.js +39 -0
  14. package/dist/cjs/Components/outOfTheBox/Separator.js.map +7 -0
  15. package/dist/cjs/Components/outOfTheBox/index.js +53 -0
  16. package/dist/cjs/Components/outOfTheBox/index.js.map +7 -0
  17. package/dist/cjs/hooks/useGenerateItems.js +131 -0
  18. package/dist/cjs/hooks/useGenerateItems.js.map +7 -0
  19. package/dist/cjs/index.d.js +27 -0
  20. package/dist/cjs/index.d.js.map +7 -0
  21. package/dist/cjs/index.js +38 -0
  22. package/dist/cjs/index.js.map +7 -0
  23. package/dist/cjs/propTypes.js +69 -0
  24. package/dist/cjs/propTypes.js.map +7 -0
  25. package/dist/cjs/styles.js +62 -0
  26. package/dist/cjs/styles.js.map +7 -0
  27. package/dist/esm/Components/MiniToolbar.js +52 -0
  28. package/dist/esm/Components/MiniToolbar.js.map +7 -0
  29. package/dist/esm/Components/ToolbarShortcut.js +52 -0
  30. package/dist/esm/Components/ToolbarShortcut.js.map +7 -0
  31. package/dist/esm/Components/outOfTheBox/Button.js +30 -0
  32. package/dist/esm/Components/outOfTheBox/Button.js.map +7 -0
  33. package/dist/esm/Components/outOfTheBox/ComboBox.js +24 -0
  34. package/dist/esm/Components/outOfTheBox/ComboBox.js.map +7 -0
  35. package/dist/esm/Components/outOfTheBox/IconItem.js +21 -0
  36. package/dist/esm/Components/outOfTheBox/IconItem.js.map +7 -0
  37. package/dist/esm/Components/outOfTheBox/SearchBox.js +44 -0
  38. package/dist/esm/Components/outOfTheBox/SearchBox.js.map +7 -0
  39. package/dist/esm/Components/outOfTheBox/Separator.js +10 -0
  40. package/dist/esm/Components/outOfTheBox/Separator.js.map +7 -0
  41. package/dist/esm/Components/outOfTheBox/index.js +24 -0
  42. package/dist/esm/Components/outOfTheBox/index.js.map +7 -0
  43. package/dist/esm/hooks/useGenerateItems.js +115 -0
  44. package/dist/esm/hooks/useGenerateItems.js.map +7 -0
  45. package/dist/esm/index.d.js +2 -0
  46. package/dist/esm/index.d.js.map +7 -0
  47. package/dist/esm/index.js +9 -0
  48. package/dist/esm/index.js.map +7 -0
  49. package/dist/esm/propTypes.js +40 -0
  50. package/dist/esm/propTypes.js.map +7 -0
  51. package/dist/esm/styles.js +33 -0
  52. package/dist/esm/styles.js.map +7 -0
  53. package/package.json +51 -42
  54. package/cjs/Components/MiniToolbar.js +0 -70
  55. package/cjs/Components/ToolbarShortcut.js +0 -72
  56. package/cjs/Components/outOfTheBox/Button.js +0 -29
  57. package/cjs/Components/outOfTheBox/ComboBox.js +0 -25
  58. package/cjs/Components/outOfTheBox/IconItem.js +0 -36
  59. package/cjs/Components/outOfTheBox/SearchBox.js +0 -55
  60. package/cjs/Components/outOfTheBox/Separator.js +0 -19
  61. package/cjs/Components/outOfTheBox/index.js +0 -26
  62. package/cjs/hooks/useGenerateItems.js +0 -134
  63. package/cjs/index.d.js +0 -2
  64. package/cjs/index.js +0 -12
  65. package/cjs/propTypes.js +0 -35
  66. package/cjs/styles.js +0 -29
  67. package/esm/Components/MiniToolbar.js +0 -60
  68. package/esm/Components/ToolbarShortcut.js +0 -63
  69. package/esm/Components/outOfTheBox/Button.js +0 -20
  70. package/esm/Components/outOfTheBox/ComboBox.js +0 -17
  71. package/esm/Components/outOfTheBox/IconItem.js +0 -28
  72. package/esm/Components/outOfTheBox/SearchBox.js +0 -45
  73. package/esm/Components/outOfTheBox/Separator.js +0 -11
  74. package/esm/Components/outOfTheBox/index.js +0 -13
  75. package/esm/hooks/useGenerateItems.js +0 -125
  76. package/esm/index.d.js +0 -1
  77. package/esm/index.js +0 -2
  78. package/esm/propTypes.js +0 -30
  79. package/esm/styles.js +0 -17
  80. package/types/Components/MiniToolbar.d.ts +0 -21
  81. package/types/Components/ToolbarShortcut.d.ts +0 -4
  82. package/types/Components/outOfTheBox/Button.d.ts +0 -3
  83. package/types/Components/outOfTheBox/ComboBox.d.ts +0 -3
  84. package/types/Components/outOfTheBox/IconItem.d.ts +0 -4
  85. package/types/Components/outOfTheBox/SearchBox.d.ts +0 -5
  86. package/types/Components/outOfTheBox/Separator.d.ts +0 -3
  87. package/types/Components/outOfTheBox/index.d.ts +0 -10
  88. package/types/hooks/useGenerateItems.d.ts +0 -4
  89. package/types/index.d.d.ts +0 -75
  90. package/types/index.d.ts +0 -2
  91. package/types/propTypes.d.ts +0 -17
  92. package/types/styles.d.ts +0 -5
  93. package/types/tests/DSMiniToolbar.events.test.d.ts +0 -1
  94. package/types/tests/DSMiniToolbar.keyboard.test.d.ts +0 -1
  95. package/types/tests/DSMiniToolbar.test.d.ts +0 -1
  96. package/types/tests/utils.test.d.ts +0 -161
@@ -0,0 +1,131 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __reExport = (target, module2, copyDefault, desc) => {
27
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
28
+ for (let key of __getOwnPropNames(module2))
29
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
30
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
31
+ }
32
+ return target;
33
+ };
34
+ var __toESM = (module2, isNodeMode) => {
35
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
36
+ };
37
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
38
+ return (module2, temp) => {
39
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
40
+ };
41
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
42
+ var useGenerateItems_exports = {};
43
+ __export(useGenerateItems_exports, {
44
+ useGenerateItems: () => useGenerateItems
45
+ });
46
+ var React = __toESM(require("react"));
47
+ var import_react = __toESM(require("react"));
48
+ var import_uid = require("uid");
49
+ var import_ds_icons = require("@elliemae/ds-icons");
50
+ var import_outOfTheBox = require("../Components/outOfTheBox");
51
+ var import_ToolbarShortcut = require("../Components/ToolbarShortcut");
52
+ var import_SearchBox = require("../Components/outOfTheBox/SearchBox");
53
+ const useGenerateItems = (items) => {
54
+ const instanceUID = (0, import_react.useMemo)(() => (0, import_uid.uid)(6), []);
55
+ const shortcutItems = (0, import_react.useMemo)(() => items.filter((item) => item.hasShortcut || item.component === import_outOfTheBox.SEARCH_BOX || item.contextualRegion).map((item, index) => {
56
+ const { component, shortcutComponent, shortcutProps, sharedProps, contextualRegion, contextualRegionProps } = item;
57
+ let Component;
58
+ let ContextualRegion;
59
+ if (component === import_outOfTheBox.SEPARATOR)
60
+ return /* @__PURE__ */ import_react.default.createElement(import_outOfTheBox.MiniToolbarSeparator, null);
61
+ if (component === import_outOfTheBox.BUTTON)
62
+ Component = import_outOfTheBox.MiniToolbarButton;
63
+ else if (component === import_outOfTheBox.ICON_ITEM)
64
+ Component = import_outOfTheBox.MiniToolbarIcon;
65
+ else if (component === import_outOfTheBox.COMBO_BOX)
66
+ Component = import_outOfTheBox.MiniToolbarComboBox;
67
+ else if (component === import_outOfTheBox.SEARCH_BOX) {
68
+ if (item.hasShortcut) {
69
+ Component = import_SearchBox.MiniToolbarSearchButton;
70
+ }
71
+ ContextualRegion = import_outOfTheBox.MiniToolbarSearchBox;
72
+ }
73
+ if (!ContextualRegion) {
74
+ ContextualRegion = contextualRegion;
75
+ }
76
+ if (!Component) {
77
+ Component = shortcutComponent;
78
+ }
79
+ return /* @__PURE__ */ import_react.default.createElement(import_ToolbarShortcut.ToolbarShortcut, {
80
+ key: `${instanceUID}-shortcut-${index}`,
81
+ Component,
82
+ shortcutProps,
83
+ sharedProps,
84
+ ContextualRegion,
85
+ contextualRegionProps
86
+ });
87
+ }), [instanceUID, items]);
88
+ const dropdownMenuItems = (0, import_react.useMemo)(() => items.map((item, index) => {
89
+ const { component, sharedProps, dropdownComponentProps } = item;
90
+ const dropdownItem = {};
91
+ const { Icon, color, label, onClick } = __spreadValues(__spreadValues({}, sharedProps), dropdownComponentProps);
92
+ if (component === import_outOfTheBox.SEPARATOR)
93
+ dropdownItem.type = "separator";
94
+ else {
95
+ dropdownItem.id = `${instanceUID}-dropdown-${index}`;
96
+ dropdownItem.onClick = () => onClick(item);
97
+ dropdownItem.label = label;
98
+ dropdownItem.onKeyDown = (e) => {
99
+ if (e.key === "Enter" || e.key === " ") {
100
+ onClick(item);
101
+ }
102
+ };
103
+ }
104
+ if (component === import_outOfTheBox.ICON_ITEM) {
105
+ dropdownItem.leftAddon = /* @__PURE__ */ import_react.default.createElement(Icon, {
106
+ color
107
+ });
108
+ } else if (component === import_outOfTheBox.SEARCH_BOX) {
109
+ dropdownItem.leftAddon = /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Search, {
110
+ color
111
+ });
112
+ } else if (component === import_outOfTheBox.COMBO_BOX) {
113
+ dropdownItem.type = "subMenu";
114
+ dropdownItem.label = label;
115
+ dropdownItem.subItems = sharedProps.options.map((option, index2) => {
116
+ option.id = `${instanceUID}-option-${index2}`;
117
+ option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);
118
+ option.onKeyDown = (e) => {
119
+ if (e.key === " " || e.key === "Enter") {
120
+ dropdownComponentProps.onSelectMenuItem(option);
121
+ }
122
+ };
123
+ return option;
124
+ });
125
+ }
126
+ return dropdownItem;
127
+ }), [instanceUID, items]);
128
+ return [shortcutItems, dropdownMenuItems];
129
+ };
130
+ module.exports = __toCommonJS(useGenerateItems_exports);
131
+ //# sourceMappingURL=useGenerateItems.js.map
@@ -0,0 +1,7 @@
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,kCACnC,cACA;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
+ }
@@ -0,0 +1,27 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __reExport = (target, module2, copyDefault, desc) => {
9
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
+ for (let key of __getOwnPropNames(module2))
11
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
+ }
14
+ return target;
15
+ };
16
+ var __toESM = (module2, isNodeMode) => {
17
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
+ };
19
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
+ return (module2, temp) => {
21
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
+ };
23
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
+ var index_d_exports = {};
25
+ var React = __toESM(require("react"));
26
+ module.exports = __toCommonJS(index_d_exports);
27
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var src_exports = {};
29
+ __export(src_exports, {
30
+ MiniToolbar: () => import_MiniToolbar.MiniToolbar,
31
+ MiniToolbarWithSchema: () => import_MiniToolbar.MiniToolbarWithSchema,
32
+ ToolbarItemWithSchema: () => import_propTypes.ToolbarItemWithSchema
33
+ });
34
+ var React = __toESM(require("react"));
35
+ var import_MiniToolbar = require("./Components/MiniToolbar");
36
+ var import_propTypes = require("./propTypes");
37
+ module.exports = __toCommonJS(src_exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,69 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var propTypes_exports = {};
29
+ __export(propTypes_exports, {
30
+ ToolbarItemWithSchema: () => ToolbarItemWithSchema,
31
+ miniToolbarProps: () => miniToolbarProps
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_react_desc = require("react-desc");
35
+ const outOfTheBoxType = import_react_desc.PropTypes.oneOf([
36
+ "ds-button",
37
+ "ds-icon-item",
38
+ "ds-separator",
39
+ "ds-search-box",
40
+ "ds-combo-box"
41
+ ]).description("out-of-the-box toolbar components");
42
+ const toolbarItemProps = {
43
+ component: import_react_desc.PropTypes.oneOfType([
44
+ outOfTheBoxType,
45
+ import_react_desc.PropTypes.element
46
+ ]).description("Main component").isRequired,
47
+ hasShortcut: import_react_desc.PropTypes.bool.description("Whether to include the component as a shortcut in the toolbar or not").defaultValue(false),
48
+ shortcutComponent: import_react_desc.PropTypes.element.description("Component to render as a shortcut in the toolbar"),
49
+ shortcutProps: import_react_desc.PropTypes.object.description("Shortcut component props"),
50
+ dropdownComponentProps: import_react_desc.PropTypes.object.description("Dropdown component props"),
51
+ sharedProps: import_react_desc.PropTypes.object.description("Props shared by shortcut component and dropdown component"),
52
+ contextualRegion: import_react_desc.PropTypes.element.description("Component that can be rendered as an adjacent region to the shortcut component"),
53
+ contextualRegionProps: import_react_desc.PropTypes.object.description("Contextual region component props")
54
+ };
55
+ const itemPropTypes = import_react_desc.PropTypes.shape(toolbarItemProps).description("Items props");
56
+ const overflowButtonPropTypes = {
57
+ ariaLabel: import_react_desc.PropTypes.string,
58
+ buttonType: import_react_desc.PropTypes.oneOf(["secondary", "text"]),
59
+ style: import_react_desc.PropTypes.object
60
+ };
61
+ const miniToolbarProps = {
62
+ items: import_react_desc.PropTypes.arrayOf(itemPropTypes).description("Array of items").isRequired,
63
+ overflowButtonProps: import_react_desc.PropTypes.shape(overflowButtonPropTypes).description("Overflow button props")
64
+ };
65
+ const ToolbarItem = () => null;
66
+ const ToolbarItemWithSchema = (0, import_react_desc.describe)(ToolbarItem);
67
+ ToolbarItemWithSchema.propTypes = toolbarItemProps;
68
+ module.exports = __toCommonJS(propTypes_exports);
69
+ //# sourceMappingURL=propTypes.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,62 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var styles_exports = {};
29
+ __export(styles_exports, {
30
+ Container: () => Container,
31
+ Item: () => Item,
32
+ Separator: () => Separator,
33
+ StyledButton: () => StyledButton
34
+ });
35
+ var React = __toESM(require("react"));
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var import_ds_button = require("@elliemae/ds-button");
38
+ const Container = import_styled_components.default.ul`
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: fit-content;
43
+ padding: 0 6px;
44
+ `;
45
+ const Separator = import_styled_components.default.span`
46
+ height: 24px;
47
+ width: 1px;
48
+ margin: 6px;
49
+ border-left: 1px solid #bbb;
50
+ `;
51
+ const Item = import_styled_components.default.li`
52
+ display: flex;
53
+ margin: 6px;
54
+ cursor: pointer;
55
+ `;
56
+ const StyledButton = (0, import_styled_components.default)(import_ds_button.DSButton)`
57
+ &:not(:focus) {
58
+ border-color: transparent;
59
+ }
60
+ `;
61
+ module.exports = __toCommonJS(styles_exports);
62
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ import React2, { useState, useCallback } from "react";
3
+ import { describe } from "react-desc";
4
+ import { DSDropdownMenu } from "@elliemae/ds-dropdownmenu";
5
+ import { MoreOptionsVert } from "@elliemae/ds-icons";
6
+ import { StyledButton, Container } from "../styles";
7
+ import { miniToolbarProps } from "../propTypes";
8
+ import { useGenerateItems } from "../hooks/useGenerateItems";
9
+ const Elipsis = /* @__PURE__ */ React2.createElement(MoreOptionsVert, {
10
+ color: ["brand-primary", "600"],
11
+ size: "m"
12
+ });
13
+ const MiniToolbar = ({ items, overflowButtonProps }) => {
14
+ const [shortcutItems, dropdownMenuItems] = useGenerateItems(items);
15
+ const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
16
+ const closeDropdownMenu = useCallback(() => setIsDropdownMenuOpen(false), []);
17
+ const openDropdownMenu = useCallback(() => setIsDropdownMenuOpen(true), []);
18
+ const openDropdownMenuKeyPress = useCallback((e) => {
19
+ if (e.key === " ") {
20
+ setIsDropdownMenuOpen(true);
21
+ }
22
+ }, []);
23
+ const { ariaLabel, style, buttonType = "secondary" } = overflowButtonProps || {};
24
+ return /* @__PURE__ */ React2.createElement(Container, {
25
+ role: "toolbar",
26
+ "data-testid": "ds-mini-toolbar"
27
+ }, shortcutItems, /* @__PURE__ */ React2.createElement(DSDropdownMenu, {
28
+ "data-testid": "ds-mini-toolbar__dropdown-menu",
29
+ isOpen: isDropdownMenuOpen,
30
+ onSelectMenuItem: closeDropdownMenu,
31
+ onClickOutsideMenu: closeDropdownMenu,
32
+ options: dropdownMenuItems,
33
+ triggerComponent: /* @__PURE__ */ React2.createElement(StyledButton, {
34
+ "aria-label": ariaLabel,
35
+ "data-testid": "ds-mini-toolbar__elipsis",
36
+ size: "m",
37
+ style,
38
+ buttonType,
39
+ onClick: openDropdownMenu,
40
+ onKeyPress: openDropdownMenuKeyPress,
41
+ leftIcon: Elipsis
42
+ })
43
+ }));
44
+ };
45
+ MiniToolbar.propTypes = miniToolbarProps;
46
+ const MiniToolbarWithSchema = describe(MiniToolbar);
47
+ MiniToolbarWithSchema.propTypes = miniToolbarProps;
48
+ export {
49
+ MiniToolbar,
50
+ MiniToolbarWithSchema
51
+ };
52
+ //# sourceMappingURL=MiniToolbar.js.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,52 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import * as React from "react";
18
+ import React2, { useRef, useEffect } from "react";
19
+ import { Item } from "../styles";
20
+ const ToolbarShortcut = (props) => {
21
+ const { Component, shortcutProps, sharedProps, ContextualRegion, contextualRegionProps } = props;
22
+ const leftRef = useRef(null);
23
+ const rightRef = useRef(null);
24
+ const timerLeft = useRef(null);
25
+ const timerRight = useRef(null);
26
+ const { position = "left", isOpen = false } = contextualRegionProps || {};
27
+ const { style } = shortcutProps || {};
28
+ const mergedProps = __spreadValues(__spreadValues({}, sharedProps), shortcutProps);
29
+ useEffect(() => {
30
+ if (isOpen && leftRef.current) {
31
+ timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);
32
+ }
33
+ if (isOpen && rightRef.current) {
34
+ timerRight.current = setTimeout(() => rightRef.current.focus(), 200);
35
+ }
36
+ return () => {
37
+ clearTimeout(timerLeft.current);
38
+ clearTimeout(timerRight.current);
39
+ };
40
+ }, [isOpen, leftRef, rightRef]);
41
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, __spreadValues({
42
+ innerRef: leftRef
43
+ }, contextualRegionProps))), Component && /* @__PURE__ */ React2.createElement(Item, {
44
+ style
45
+ }, /* @__PURE__ */ React2.createElement(Component, __spreadValues({}, mergedProps))), isOpen && position === "right" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, __spreadValues({
46
+ innerRef: rightRef
47
+ }, contextualRegionProps))));
48
+ };
49
+ export {
50
+ ToolbarShortcut
51
+ };
52
+ //# sourceMappingURL=ToolbarShortcut.js.map
@@ -0,0 +1,7 @@
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,kCACf,cACA;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,KAAa,0BAG5C,aACC,qCAAC,MAAD;AAAA,IAAM;AAAA,KACJ,qCAAC,WAAD,mBAAe,gBAGlB,UAAU,aAAa,WACtB,qCAAC,MAAD,MACE,qCAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,KAAc;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import React2 from "react";
22
+ import { DSButton } from "@elliemae/ds-button";
23
+ const MiniToolbarButton = (props) => /* @__PURE__ */ React2.createElement(DSButton, __spreadProps(__spreadValues({}, props), {
24
+ "aria-label": props.ariaLabel,
25
+ "data-testid": "ds-mini-toolbar__shortcut"
26
+ }));
27
+ export {
28
+ MiniToolbarButton
29
+ };
30
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1,7 @@
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,iCAAc,QAAd;AAAA,EAAqB,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import * as React from "react";
18
+ import React2 from "react";
19
+ import { DSComboBox2 } from "@elliemae/ds-form";
20
+ const MiniToolbarComboBox = (props) => /* @__PURE__ */ React2.createElement(DSComboBox2, __spreadValues({}, props));
21
+ export {
22
+ MiniToolbarComboBox
23
+ };
24
+ //# sourceMappingURL=ComboBox.js.map
@@ -0,0 +1,7 @@
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,mBAAiB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { StyledButton } from "../../styles";
4
+ const MiniToolbarIcon = (props) => {
5
+ const { Icon, size, color, onClick, ariaLabel, style, buttonType = "secondary" } = props;
6
+ return /* @__PURE__ */ React2.createElement(StyledButton, {
7
+ "aria-label": ariaLabel,
8
+ buttonType,
9
+ onClick,
10
+ style,
11
+ leftIcon: /* @__PURE__ */ React2.createElement(Icon, {
12
+ size,
13
+ color
14
+ }),
15
+ "data-testid": "ds-mini-toolbar__shortcut"
16
+ });
17
+ };
18
+ export {
19
+ MiniToolbarIcon
20
+ };
21
+ //# sourceMappingURL=IconItem.js.map
@@ -0,0 +1,7 @@
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
+ }