@elliemae/ds-menu 2.3.0-alpha.1 → 2.3.0-alpha.6

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 (118) hide show
  1. package/{cjs/Menu.js → dist/cjs/DSMenu.js} +5 -29
  2. package/dist/cjs/DSMenu.js.map +7 -0
  3. package/dist/cjs/Menu.js +60 -0
  4. package/dist/cjs/Menu.js.map +7 -0
  5. package/{cjs → dist/cjs}/MenuCombobox.js +2 -2
  6. package/dist/cjs/MenuCombobox.js.map +7 -0
  7. package/{cjs → dist/cjs}/MenuContext.js +0 -0
  8. package/{cjs → dist/cjs}/MenuContext.js.map +0 -0
  9. package/{cjs → dist/cjs}/MenuExports.js +9 -1
  10. package/dist/cjs/MenuExports.js.map +7 -0
  11. package/{cjs → dist/cjs}/MenuItems/CheckboxGroup.js +0 -0
  12. package/{cjs → dist/cjs}/MenuItems/CheckboxGroup.js.map +0 -0
  13. package/{cjs → dist/cjs}/MenuItems/MenuItem.js +0 -0
  14. package/{cjs → dist/cjs}/MenuItems/MenuItem.js.map +0 -0
  15. package/{cjs → dist/cjs}/MenuItems/MenuItemCheckable.js +0 -0
  16. package/{cjs → dist/cjs}/MenuItems/MenuItemCheckable.js.map +0 -0
  17. package/{cjs → dist/cjs}/MenuItems/MenuItemCheckbox.js +2 -2
  18. package/dist/cjs/MenuItems/MenuItemCheckbox.js.map +7 -0
  19. package/{cjs → dist/cjs}/MenuItems/MenuItemRadio.js +0 -0
  20. package/{cjs → dist/cjs}/MenuItems/MenuItemRadio.js.map +0 -0
  21. package/{cjs → dist/cjs}/MenuItems/RadioGroup.js +0 -0
  22. package/{cjs → dist/cjs}/MenuItems/RadioGroup.js.map +0 -0
  23. package/{cjs → dist/cjs}/MenuItems/SearchableGroup.js +2 -2
  24. package/dist/cjs/MenuItems/SearchableGroup.js.map +7 -0
  25. package/{cjs → dist/cjs}/MenuItems/SearchableList.js +0 -0
  26. package/{cjs → dist/cjs}/MenuItems/SearchableList.js.map +0 -0
  27. package/{cjs → dist/cjs}/MenuItems/SelectionGroup.js +0 -0
  28. package/{cjs → dist/cjs}/MenuItems/SelectionGroup.js.map +0 -0
  29. package/{cjs → dist/cjs}/MenuItems/Separator.js +0 -0
  30. package/{cjs → dist/cjs}/MenuItems/Separator.js.map +0 -0
  31. package/{cjs → dist/cjs}/MenuItems/SubMenu.js +2 -2
  32. package/dist/cjs/MenuItems/SubMenu.js.map +7 -0
  33. package/{cjs → dist/cjs}/MenuItems/menuItemFactory.js +0 -0
  34. package/{cjs → dist/cjs}/MenuItems/menuItemFactory.js.map +0 -0
  35. package/{cjs → dist/cjs}/MenuItems/renderMenuItems.js +0 -0
  36. package/{cjs → dist/cjs}/MenuItems/renderMenuItems.js.map +0 -0
  37. package/{cjs → dist/cjs}/VirtualMenuList.js +0 -0
  38. package/{cjs → dist/cjs}/VirtualMenuList.js.map +0 -0
  39. package/{cjs → dist/cjs}/index.js +0 -0
  40. package/{cjs → dist/cjs}/index.js.map +0 -0
  41. package/{cjs → dist/cjs}/utils/useHeightByAmountOfItems.js +0 -0
  42. package/{cjs → dist/cjs}/utils/useHeightByAmountOfItems.js.map +0 -0
  43. package/{esm/Menu.js → dist/esm/DSMenu.js} +2 -26
  44. package/dist/esm/DSMenu.js.map +7 -0
  45. package/dist/esm/Menu.js +31 -0
  46. package/dist/esm/Menu.js.map +7 -0
  47. package/{esm → dist/esm}/MenuCombobox.js +1 -1
  48. package/dist/esm/MenuCombobox.js.map +7 -0
  49. package/{esm → dist/esm}/MenuContext.js +0 -0
  50. package/{esm → dist/esm}/MenuContext.js.map +0 -0
  51. package/dist/esm/MenuExports.js +7 -0
  52. package/{esm → dist/esm}/MenuExports.js.map +1 -1
  53. package/{esm → dist/esm}/MenuItems/CheckboxGroup.js +0 -0
  54. package/{esm → dist/esm}/MenuItems/CheckboxGroup.js.map +0 -0
  55. package/{esm → dist/esm}/MenuItems/MenuItem.js +0 -0
  56. package/{esm → dist/esm}/MenuItems/MenuItem.js.map +0 -0
  57. package/{esm → dist/esm}/MenuItems/MenuItemCheckable.js +0 -0
  58. package/{esm → dist/esm}/MenuItems/MenuItemCheckable.js.map +0 -0
  59. package/{esm → dist/esm}/MenuItems/MenuItemCheckbox.js +1 -1
  60. package/{esm → dist/esm}/MenuItems/MenuItemCheckbox.js.map +1 -1
  61. package/{esm → dist/esm}/MenuItems/MenuItemRadio.js +0 -0
  62. package/{esm → dist/esm}/MenuItems/MenuItemRadio.js.map +0 -0
  63. package/{esm → dist/esm}/MenuItems/RadioGroup.js +0 -0
  64. package/{esm → dist/esm}/MenuItems/RadioGroup.js.map +0 -0
  65. package/{esm → dist/esm}/MenuItems/SearchableGroup.js +1 -1
  66. package/dist/esm/MenuItems/SearchableGroup.js.map +7 -0
  67. package/{esm → dist/esm}/MenuItems/SearchableList.js +0 -0
  68. package/{esm → dist/esm}/MenuItems/SearchableList.js.map +0 -0
  69. package/{esm → dist/esm}/MenuItems/SelectionGroup.js +0 -0
  70. package/{esm → dist/esm}/MenuItems/SelectionGroup.js.map +0 -0
  71. package/{esm → dist/esm}/MenuItems/Separator.js +0 -0
  72. package/{esm → dist/esm}/MenuItems/Separator.js.map +0 -0
  73. package/{esm → dist/esm}/MenuItems/SubMenu.js +1 -1
  74. package/dist/esm/MenuItems/SubMenu.js.map +7 -0
  75. package/{esm → dist/esm}/MenuItems/menuItemFactory.js +0 -0
  76. package/{esm → dist/esm}/MenuItems/menuItemFactory.js.map +0 -0
  77. package/{esm → dist/esm}/MenuItems/renderMenuItems.js +0 -0
  78. package/{esm → dist/esm}/MenuItems/renderMenuItems.js.map +0 -0
  79. package/{esm → dist/esm}/VirtualMenuList.js +0 -0
  80. package/{esm → dist/esm}/VirtualMenuList.js.map +0 -0
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/{esm → dist/esm}/index.js.map +0 -0
  83. package/{esm → dist/esm}/utils/useHeightByAmountOfItems.js +0 -0
  84. package/{esm → dist/esm}/utils/useHeightByAmountOfItems.js.map +0 -0
  85. package/package.json +72 -66
  86. package/cjs/Menu.js.map +0 -7
  87. package/cjs/MenuCombobox.js.map +0 -7
  88. package/cjs/MenuExports.js.map +0 -7
  89. package/cjs/MenuItems/MenuItemCheckbox.js.map +0 -7
  90. package/cjs/MenuItems/SearchableGroup.js.map +0 -7
  91. package/cjs/MenuItems/SubMenu.js.map +0 -7
  92. package/esm/Menu.js.map +0 -7
  93. package/esm/MenuCombobox.js.map +0 -7
  94. package/esm/MenuExports.js +0 -3
  95. package/esm/MenuItems/SearchableGroup.js.map +0 -7
  96. package/esm/MenuItems/SubMenu.js.map +0 -7
  97. package/types/Menu.d.ts +0 -12
  98. package/types/MenuCombobox.d.ts +0 -28
  99. package/types/MenuContext.d.ts +0 -4
  100. package/types/MenuExports.d.ts +0 -1
  101. package/types/MenuItems/CheckboxGroup.d.ts +0 -32
  102. package/types/MenuItems/MenuItem.d.ts +0 -79
  103. package/types/MenuItems/MenuItemCheckable.d.ts +0 -78
  104. package/types/MenuItems/MenuItemCheckbox.d.ts +0 -7
  105. package/types/MenuItems/MenuItemRadio.d.ts +0 -28
  106. package/types/MenuItems/RadioGroup.d.ts +0 -26
  107. package/types/MenuItems/SearchableGroup.d.ts +0 -10
  108. package/types/MenuItems/SearchableList.d.ts +0 -95
  109. package/types/MenuItems/SelectionGroup.d.ts +0 -87
  110. package/types/MenuItems/Separator.d.ts +0 -32
  111. package/types/MenuItems/SubMenu.d.ts +0 -109
  112. package/types/MenuItems/menuItemFactory.d.ts +0 -2
  113. package/types/MenuItems/renderMenuItems.d.ts +0 -1
  114. package/types/VirtualMenuList.d.ts +0 -10
  115. package/types/index.d.ts +0 -14
  116. package/types/tests/Menu.test.d.ts +0 -1
  117. package/types/tests/MenuItem.test.d.ts +0 -1
  118. package/types/utils/useHeightByAmountOfItems.d.ts +0 -7
@@ -25,13 +25,10 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
25
25
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
26
  };
27
27
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var Menu_exports = {};
29
- __export(Menu_exports, {
28
+ var DSMenu_exports = {};
29
+ __export(DSMenu_exports, {
30
30
  DSMenuWithSchema: () => DSMenuWithSchema,
31
- Menu: () => Menu,
32
- default: () => Menu_default,
33
- menuItemFactory: () => import_menuItemFactory.menuItemFactory,
34
- renderMenuItems: () => import_renderMenuItems.renderMenuItems
31
+ Menu: () => Menu
35
32
  });
36
33
  var React = __toESM(require("react"));
37
34
  var import_react = __toESM(require("react"));
@@ -43,17 +40,6 @@ var import_hooks = require("@elliemae/ds-utilities/hooks");
43
40
  var import_system = require("@elliemae/ds-utilities/system");
44
41
  var import_FocusGroup = require("@elliemae/ds-shared/FocusGroup");
45
42
  var import_ds_hidden = require("@elliemae/ds-hidden");
46
- var import_MenuItemRadio = require("./MenuItems/MenuItemRadio");
47
- var import_MenuItemCheckbox = require("./MenuItems/MenuItemCheckbox");
48
- var import_CheckboxGroup = require("./MenuItems/CheckboxGroup");
49
- var import_RadioGroup = require("./MenuItems/RadioGroup");
50
- var import_Separator = require("./MenuItems/Separator");
51
- var import_MenuItem = require("./MenuItems/MenuItem");
52
- var import_SubMenu = require("./MenuItems/SubMenu");
53
- var import_SearchableGroup = require("./MenuItems/SearchableGroup");
54
- var import_SelectionGroup = require("./MenuItems/SelectionGroup");
55
- var import_menuItemFactory = require("./MenuItems/menuItemFactory");
56
- var import_renderMenuItems = require("./MenuItems/renderMenuItems");
57
43
  var import_MenuContext = require("./MenuContext");
58
44
  const RESPONSIVE_HEIHGT_MARGIN = 120;
59
45
  const blockName = "menu";
@@ -137,15 +123,5 @@ const props = {
137
123
  DSMenu.propTypes = props;
138
124
  const DSMenuWithSchema = (0, import_react_desc.describe)(DSMenu);
139
125
  DSMenuWithSchema.propTypes = props;
140
- Menu.Item = import_MenuItem.MenuItem;
141
- Menu.ItemCheckbox = import_MenuItemCheckbox.MenuItemCheckbox;
142
- Menu.ItemRadio = import_MenuItemRadio.MenuItemRadio;
143
- Menu.SubMenu = import_SubMenu.SubMenu;
144
- Menu.Separator = import_Separator.MenuSeparator;
145
- Menu.CheckboxGroup = import_CheckboxGroup.CheckboxGroup;
146
- Menu.RadioGroup = import_RadioGroup.RadioGroup;
147
- Menu.SearchableGroup = import_SearchableGroup.SearchableGroup;
148
- Menu.SelectionGroup = import_SelectionGroup.SelectionGroup;
149
- var Menu_default = Menu;
150
- module.exports = __toCommonJS(Menu_exports);
151
- //# sourceMappingURL=Menu.js.map
126
+ module.exports = __toCommonJS(DSMenu_exports);
127
+ //# sourceMappingURL=DSMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSMenu.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useContext, useEffect, useMemo, useRef } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { omit } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { animated } from 'react-spring/web';\nimport { useOnClickOutside } from '@elliemae/ds-utilities/hooks';\nimport { mergeRefs } from '@elliemae/ds-utilities/system';\nimport { focusGroupManagerHoc, FocusGroupContext } from '@elliemae/ds-shared/FocusGroup';\nimport { useHiddenTransition } from '@elliemae/ds-hidden';\nimport { MenuContext } from './MenuContext';\n\nconst RESPONSIVE_HEIHGT_MARGIN = 120;\n\nconst blockName = 'menu';\n\nconst noop = () => {};\n\nconst MenuComponent = aggregatedClasses('div')(blockName, '', ({ menuComboBox, type }) => ({\n 'menu-combo-box': menuComboBox,\n [`type-${type}`]: type,\n}));\n\n/**\n * todo: -- IDEA -- each menu could have an overlay based on an overlay stack context so we can\n * capture the context of the clicks on very nested components\n */\n\nconst isChildOfType = (child, type) => child.type.name === type;\n\nconst DSMenu = ({\n containerProps = {},\n innerRef,\n as: MenuTag = animated.ul,\n children = undefined,\n onClickOutside = noop,\n // handlers from hidden\n visible = undefined,\n focusOnOpen = false,\n maxOption = 0,\n style = {},\n minWidth = undefined,\n maxWidth = undefined,\n closeMenu,\n responsiveHeight = false,\n ...otherProps\n}) => {\n const menuRef = useRef(null);\n const { focusFirst } = useContext(FocusGroupContext);\n const { destroyed, ...hiddenProps } = useHiddenTransition({ visible, style });\n\n // force no addon to the children if the menu doesn't have any item with leftAddon like SelectionGroup\n const nextChildren = useMemo(() => {\n const forceLeftAddon = React.Children.toArray(children).some(\n (child) =>\n isChildOfType(child, 'SelectionGroup') ||\n isChildOfType(child, 'MenuItemCheckbox') ||\n isChildOfType(child, 'MenuItemRadio') ||\n child.props.leftAddon,\n );\n\n return React.Children.map(\n children,\n (child) =>\n child &&\n React.cloneElement(child, {\n ...child.props,\n noAddon: !forceLeftAddon ? true : undefined,\n maxOption,\n closeMenu,\n }),\n );\n }, [children]);\n\n useOnClickOutside(menuRef, onClickOutside);\n\n useEffect(() => {\n if (focusOnOpen && visible) {\n setTimeout(() => {\n focusFirst();\n }, 0);\n }\n }, [visible, focusOnOpen]);\n // todo: find out a better approach to this\n return !hiddenProps.destroyed ? (\n <MenuContext.Provider value={{ visible, closeMenu }}>\n <MenuComponent\n data-testid={containerProps?.['data-testid'] ? containerProps['data-testid'] : 'em-ds-menu'}\n {...containerProps}\n as={MenuTag}\n classProps={{ ...(otherProps.classProps || {}), type: otherProps.type }}\n innerRef={mergeRefs(innerRef, menuRef)}\n role=\"menu\"\n {...omit(otherProps, ['scheduleUpdate'])}\n {...hiddenProps}\n >\n {/* eslint-disable indent */}\n <div\n className=\"menu-component-internal-wrapper\"\n style={{\n ...style,\n minWidth,\n maxWidth,\n ...(responsiveHeight\n ? {\n overflowY: 'scroll',\n maxHeight: responsiveHeight ? `${window.innerHeight - RESPONSIVE_HEIHGT_MARGIN}px` : undefined,\n }\n : {}),\n }}\n >\n {/* eslint-enable indent */}\n {nextChildren}\n </div>\n </MenuComponent>\n </MenuContext.Provider>\n ) : null;\n};\n\nconst Menu = focusGroupManagerHoc(DSMenu, { loop: true });\n\nconst props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description('Injected props to wrapper element of component'),\n /** Renders the menu with a specific html element */\n as: PropTypes.element.description('Renders the menu with a specific html element'),\n /** Handler when a user clicks outside the menu */\n onClickOutside: PropTypes.func.description('Handler when a user clicks outside the menu'),\n /** Whether the menu is visible or not */\n visible: PropTypes.bool.description('Whether the menu is visible or not'),\n /** When set to true, it's going to focus the first item */\n focusOnOpen: PropTypes.bool.description(\"When set to true, it's going to focus the first item\"),\n /** Customize menu minWidth. Can be undefined or 'number' */\n minWidth: PropTypes.number.description(\"Customize menu minWidth. Can be undefined or 'number'\"),\n /** Customize menu maxWidth. Can be undefined or 'number' */\n maxWidth: PropTypes.number.description(\"Customize menu maxWidth. Can be undefined or 'number'\"),\n};\n\nDSMenu.propTypes = props;\n\nconst DSMenuWithSchema = describe(DSMenu);\n\nDSMenuWithSchema.propTypes = props;\n\nexport { DSMenuWithSchema, Menu };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA8D;AAC9D,wBAAoC;AACpC,oBAAqB;AACrB,2BAAkC;AAClC,iBAAyB;AACzB,mBAAkC;AAClC,oBAA0B;AAC1B,wBAAwD;AACxD,uBAAoC;AACpC,yBAA4B;AAE5B,MAAM,2BAA2B;AAEjC,MAAM,YAAY;AAElB,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,gBAAgB,4CAAkB,OAAO,WAAW,IAAI,CAAC,EAAE,cAAc,WAAY;AAAA,EACzF,kBAAkB;AAAA,GACjB,QAAQ,SAAS;AAAA;AAQpB,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS;AAE3D,MAAM,SAAS,CAAC;AAAA,EACd,iBAAiB;AAAA,EACjB;AAAA,EAC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,SACI,mBACA;AAAA,QACE,WAAW;AAAA,QACX,WAAW,mBAAmB,GAAG,OAAO,cAAc,+BAA+B;AAAA,UAEvF;AAAA;AAAA,KAIL,kBAIL;AAAA;AAGN,MAAM,OAAO,4CAAqB,QAAQ,EAAE,MAAM;AAElD,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAE7C,IAAI,4BAAU,QAAQ,YAAY;AAAA,EAElC,gBAAgB,4BAAU,KAAK,YAAY;AAAA,EAE3C,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,aAAa,4BAAU,KAAK,YAAY;AAAA,EAExC,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,4BAAU,OAAO,YAAY;AAAA;AAGzC,OAAO,YAAY;AAEnB,MAAM,mBAAmB,gCAAS;AAElC,iBAAiB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,60 @@
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 Menu_exports = {};
29
+ __export(Menu_exports, {
30
+ DSMenuWithSchema: () => import_DSMenu.DSMenuWithSchema,
31
+ Menu: () => import_DSMenu.Menu,
32
+ default: () => Menu_default,
33
+ menuItemFactory: () => import_menuItemFactory.menuItemFactory,
34
+ renderMenuItems: () => import_renderMenuItems.renderMenuItems
35
+ });
36
+ var React = __toESM(require("react"));
37
+ var import_MenuItemRadio = require("./MenuItems/MenuItemRadio");
38
+ var import_MenuItemCheckbox = require("./MenuItems/MenuItemCheckbox");
39
+ var import_CheckboxGroup = require("./MenuItems/CheckboxGroup");
40
+ var import_RadioGroup = require("./MenuItems/RadioGroup");
41
+ var import_Separator = require("./MenuItems/Separator");
42
+ var import_MenuItem = require("./MenuItems/MenuItem");
43
+ var import_SubMenu = require("./MenuItems/SubMenu");
44
+ var import_SearchableGroup = require("./MenuItems/SearchableGroup");
45
+ var import_SelectionGroup = require("./MenuItems/SelectionGroup");
46
+ var import_menuItemFactory = require("./MenuItems/menuItemFactory");
47
+ var import_renderMenuItems = require("./MenuItems/renderMenuItems");
48
+ var import_DSMenu = require("./DSMenu");
49
+ import_DSMenu.Menu.Item = import_MenuItem.MenuItem;
50
+ import_DSMenu.Menu.ItemCheckbox = import_MenuItemCheckbox.MenuItemCheckbox;
51
+ import_DSMenu.Menu.ItemRadio = import_MenuItemRadio.MenuItemRadio;
52
+ import_DSMenu.Menu.SubMenu = import_SubMenu.SubMenu;
53
+ import_DSMenu.Menu.Separator = import_Separator.MenuSeparator;
54
+ import_DSMenu.Menu.CheckboxGroup = import_CheckboxGroup.CheckboxGroup;
55
+ import_DSMenu.Menu.RadioGroup = import_RadioGroup.RadioGroup;
56
+ import_DSMenu.Menu.SearchableGroup = import_SearchableGroup.SearchableGroup;
57
+ import_DSMenu.Menu.SelectionGroup = import_SelectionGroup.SelectionGroup;
58
+ var Menu_default = import_DSMenu.Menu;
59
+ module.exports = __toCommonJS(Menu_exports);
60
+ //# sourceMappingURL=Menu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Menu.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { MenuItemRadio } from './MenuItems/MenuItemRadio';\nimport { MenuItemCheckbox } from './MenuItems/MenuItemCheckbox';\nimport { CheckboxGroup } from './MenuItems/CheckboxGroup';\nimport { RadioGroup } from './MenuItems/RadioGroup';\nimport { MenuSeparator } from './MenuItems/Separator';\nimport { MenuItem } from './MenuItems/MenuItem';\nimport { SubMenu } from './MenuItems/SubMenu';\nimport { SearchableGroup } from './MenuItems/SearchableGroup';\nimport { SelectionGroup } from './MenuItems/SelectionGroup';\nimport { menuItemFactory } from './MenuItems/menuItemFactory';\nimport { renderMenuItems } from './MenuItems/renderMenuItems';\nimport { DSMenuWithSchema, Menu } from './DSMenu';\n\n\nMenu.Item = MenuItem;\nMenu.ItemCheckbox = MenuItemCheckbox;\nMenu.ItemRadio = MenuItemRadio;\nMenu.SubMenu = SubMenu;\nMenu.Separator = MenuSeparator;\nMenu.CheckboxGroup = CheckboxGroup;\nMenu.RadioGroup = RadioGroup;\nMenu.SearchableGroup = SearchableGroup;\nMenu.SelectionGroup = SelectionGroup;\n\nexport { menuItemFactory, renderMenuItems, DSMenuWithSchema, Menu };\nexport default Menu;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,2BAA8B;AAC9B,8BAAiC;AACjC,2BAA8B;AAC9B,wBAA2B;AAC3B,uBAA8B;AAC9B,sBAAyB;AACzB,qBAAwB;AACxB,6BAAgC;AAChC,4BAA+B;AAC/B,6BAAgC;AAChC,6BAAgC;AAChC,oBAAuC;AAGvC,mBAAK,OAAO;AACZ,mBAAK,eAAe;AACpB,mBAAK,YAAY;AACjB,mBAAK,UAAU;AACf,mBAAK,YAAY;AACjB,mBAAK,gBAAgB;AACrB,mBAAK,aAAa;AAClB,mBAAK,kBAAkB;AACvB,mBAAK,iBAAiB;AAGtB,IAAO,eAAQ;",
6
+ "names": []
7
+ }
@@ -33,7 +33,7 @@ var React = __toESM(require("react"));
33
33
  var import_react = __toESM(require("react"));
34
34
  var import_prop_types = __toESM(require("prop-types"));
35
35
  var import_SearchableList = require("./MenuItems/SearchableList");
36
- var import_Menu = require("./Menu");
36
+ var import_DSMenu = require("./DSMenu");
37
37
  function MenuCombobox({
38
38
  dropdownFilterOptions = {},
39
39
  options = [],
@@ -43,7 +43,7 @@ function MenuCombobox({
43
43
  loading = false,
44
44
  ...rest
45
45
  }) {
46
- return /* @__PURE__ */ import_react.default.createElement(import_Menu.Menu, {
46
+ return /* @__PURE__ */ import_react.default.createElement(import_DSMenu.Menu, {
47
47
  ...rest,
48
48
  classProps: { menuComboBox: true },
49
49
  innerRef,
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/MenuCombobox.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { SearchableList } from './MenuItems/SearchableList';\nimport { Menu } from './DSMenu';\n\nfunction MenuCombobox({\n dropdownFilterOptions = {},\n options = [],\n onSelectMenuItem = () => null,\n innerRef,\n maxOptions = 10,\n loading = false,\n ...rest\n}) {\n return (\n <Menu\n {...rest}\n classProps={{ menuComboBox: true }}\n innerRef={innerRef}\n visible\n >\n <SearchableList\n appendTermInList\n extraListProps={dropdownFilterOptions}\n items={options}\n onSelectMenuItem={onSelectMenuItem}\n maxOptions={maxOptions}\n loading={loading}\n />\n </Menu>\n );\n}\n\nMenuCombobox.propTypes = {\n /** Options */\n dropdownFilterOptions: PropTypes.shape({}),\n /** The option or menu items to render */\n options: PropTypes.arrayOf(PropTypes.object),\n /** Handler when a menu item is selected */\n onSelectMenuItem: PropTypes.func,\n /** Internal ref */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Max options to display in the list */\n maxOptions: PropTypes.number,\n /** Is loading */\n loading: PropTypes.bool,\n};\n\nexport default MenuCombobox;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAsB;AACtB,4BAA+B;AAC/B,oBAAqB;AAErB,sBAAsB;AAAA,EACpB,wBAAwB;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB,MAAM;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb,UAAU;AAAA,KACP;AAAA,GACF;AACD,SACE,mDAAC,oBAAD;AAAA,OACM;AAAA,IACJ,YAAY,EAAE,cAAc;AAAA,IAC5B;AAAA,IACA,SAAO;AAAA,KAEP,mDAAC,sCAAD;AAAA,IACE,kBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAMR,aAAa,YAAY;AAAA,EAEvB,uBAAuB,0BAAU,MAAM;AAAA,EAEvC,SAAS,0BAAU,QAAQ,0BAAU;AAAA,EAErC,kBAAkB,0BAAU;AAAA,EAE5B,UAAU,0BAAU,UAAU,CAAC,0BAAU,MAAM,0BAAU;AAAA,EAEzD,YAAY,0BAAU;AAAA,EAEtB,SAAS,0BAAU;AAAA;AAGrB,IAAO,uBAAQ;",
6
+ "names": []
7
+ }
File without changes
File without changes
@@ -5,6 +5,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
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
+ };
8
12
  var __reExport = (target, module2, copyDefault, desc) => {
9
13
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
14
  for (let key of __getOwnPropNames(module2))
@@ -22,7 +26,11 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
22
26
  };
23
27
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
28
  var MenuExports_exports = {};
29
+ __export(MenuExports_exports, {
30
+ DSMenuWithSchema: () => import_Menu.DSMenuWithSchema,
31
+ Menu: () => import_Menu.Menu
32
+ });
25
33
  var React = __toESM(require("react"));
26
- __reExport(MenuExports_exports, require("./Menu"));
34
+ var import_Menu = require("./Menu");
27
35
  module.exports = __toCommonJS(MenuExports_exports);
28
36
  //# sourceMappingURL=MenuExports.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/MenuExports.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export { DSMenuWithSchema, Menu } from './Menu';", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kBAAuC;",
6
+ "names": []
7
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -32,12 +32,12 @@ __export(MenuItemCheckbox_exports, {
32
32
  });
33
33
  var React = __toESM(require("react"));
34
34
  var import_react = __toESM(require("react"));
35
- var import_ds_form = require("@elliemae/ds-form");
35
+ var import_Checkbox = require("@elliemae/ds-form/Checkbox");
36
36
  var import_MenuItemCheckable = require("./MenuItemCheckable");
37
37
  var import_menuItemFactory = require("./menuItemFactory");
38
38
  const MenuItemCheckbox = ({ checked, ...rest }) => /* @__PURE__ */ import_react.default.createElement(import_MenuItemCheckable.MenuItemCheckable, {
39
39
  ...rest,
40
- leftAddon: /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSCheckbox, {
40
+ leftAddon: /* @__PURE__ */ import_react.default.createElement(import_Checkbox.DSCheckbox, {
41
41
  checked
42
42
  }),
43
43
  role: "menuitemcheckbox"
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/MenuItems/MenuItemCheckbox.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form/Checkbox';\nimport { MenuItemCheckable } from './MenuItemCheckable';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst MenuItemCheckbox = ({ checked, ...rest }) => (\n <MenuItemCheckable {...rest} leftAddon={<DSCheckbox checked={checked} />} role=\"menuitemcheckbox\" />\n);\n\nregisterMenuItem('checkbox', MenuItemCheckbox);\nexport { MenuItemCheckbox };\nexport default MenuItemCheckbox;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,sBAA2B;AAC3B,+BAAkC;AAClC,6BAAiC;AAEjC,MAAM,mBAAmB,CAAC,EAAE,YAAY,WACtC,mDAAC,4CAAD;AAAA,KAAuB;AAAA,EAAM,WAAW,mDAAC,4BAAD;AAAA,IAAY;AAAA;AAAA,EAAsB,MAAK;AAAA;AAGjF,6CAAiB,YAAY;AAE7B,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
File without changes
File without changes
File without changes
File without changes
@@ -35,7 +35,7 @@ var React = __toESM(require("react"));
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_ds_classnames = require("@elliemae/ds-classnames");
37
37
  var import_FocusGroup = require("@elliemae/ds-shared/FocusGroup");
38
- var import_ds_form = require("@elliemae/ds-form");
38
+ var import_SearchBox = require("@elliemae/ds-form/SearchBox");
39
39
  var import_react_desc = require("react-desc");
40
40
  var import_VirtualMenuList = require("../VirtualMenuList");
41
41
  var import_MenuContext = require("../MenuContext");
@@ -66,7 +66,7 @@ const SearchableGroup = ({
66
66
  }
67
67
  }, [focusOnOpen, visible]);
68
68
  const filteredChildren = (0, import_react.useMemo)(() => children.filter((child) => !searchTerm || child.props.label.toLowerCase().startsWith(searchTerm.toLowerCase())), [children, searchTerm]);
69
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SearchBoxWrapper, null, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, {
69
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SearchBoxWrapper, null, /* @__PURE__ */ import_react.default.createElement(import_SearchBox.DSSearchBox, {
70
70
  innerRef: searchRef,
71
71
  onSearch: ({ value }) => setSearchTerm(value),
72
72
  searchOnEnter: false,
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/MenuItems/SearchableGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useEffect, useMemo, useState, useRef, useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { focusGroupManagerHoc } from '@elliemae/ds-shared/FocusGroup';\nimport { DSSearchBox } from '@elliemae/ds-form/SearchBox';\nimport { PropTypes, describe } from 'react-desc';\nimport { VirtualMenuList } from '../VirtualMenuList';\nimport { MenuContext } from '../MenuContext';\n\nconst SearchBoxWrapper = aggregatedClasses('div')(\n 'menu-search-group',\n 'search-wrapper',\n);\nconst NoOptionsWrapper = aggregatedClasses('div')(\n 'menu-search-group',\n 'no-options',\n);\n\nconst SearchableGroup = ({\n children,\n amountItemsInWindow = 5,\n searchTerm: searchTermProp = '',\n noOptionsText = 'No options',\n height,\n width,\n focusOnOpen = false,\n}) => {\n const searchRef = useRef(null);\n const [searchTerm, setSearchTerm] = useState(searchTermProp);\n\n useEffect(() => {\n if (searchRef.current) searchRef.current.focus();\n }, []);\n\n const { visible } = useContext(MenuContext) || {};\n\n useEffect(() => {\n if (focusOnOpen && visible) {\n setTimeout(() => {\n if (searchRef.current) searchRef.current.focus();\n }, 0);\n }\n }, [focusOnOpen, visible]);\n\n const filteredChildren = useMemo(\n () =>\n children.filter(\n (child) =>\n !searchTerm ||\n child.props.label.toLowerCase().startsWith(searchTerm.toLowerCase()),\n ),\n [children, searchTerm],\n );\n\n return (\n <>\n <SearchBoxWrapper>\n <DSSearchBox\n innerRef={searchRef}\n onSearch={({ value }) => setSearchTerm(value)}\n searchOnEnter={false}\n showIcon={false}\n value={searchTerm}\n />\n </SearchBoxWrapper>\n {!filteredChildren.length && (\n <NoOptionsWrapper>{noOptionsText}</NoOptionsWrapper>\n )}\n <VirtualMenuList\n amountItemsInWindow={amountItemsInWindow}\n height={height}\n items={filteredChildren}\n width={width}\n />\n </>\n );\n};\n\nconst props = {\n /** The amount of items that are going to be rendered in the group */\n amountItemsInWindow: PropTypes.number.description(\n 'The amount of items that are going to be rendered in the group',\n ),\n /** A search term */\n searchTerm: PropTypes.string.description('A search term'),\n /** Text to show when there's no options to show */\n noOptionsText: PropTypes.string.description(\n \"Text to show when there's no options to show\",\n ),\n /** array of children for search list */\n children: PropTypes.array.description('array of children for search list'),\n /** height for virtual list wrapper */\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'height for virtual list wrapper',\n ),\n /** width for virtual list wrapper */\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'width for virtual list wrapper',\n ),\n /** weather to focus on searchable group on open */\n focusOnOpen: PropTypes.bool.description(\n 'weather to focus on searchable group on open',\n ),\n};\n\nSearchableGroup.propTypes = props;\n\nconst DSMenuSearchableGroupWithSchema = describe(SearchableGroup);\nDSMenuSearchableGroupWithSchema.propTypes = props;\n\nconst SearchableGroupHOC = focusGroupManagerHoc(SearchableGroup);\n\nexport { DSMenuSearchableGroupWithSchema, SearchableGroupHOC as SearchableGroup };\nexport default SearchableGroupHOC;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwE;AACxE,2BAAkC;AAClC,wBAAqC;AACrC,uBAA4B;AAC5B,wBAAoC;AACpC,6BAAgC;AAChC,yBAA4B;AAE5B,MAAM,mBAAmB,4CAAkB,OACzC,qBACA;AAEF,MAAM,mBAAmB,4CAAkB,OACzC,qBACA;AAGF,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,sBAAsB;AAAA,EACtB,YAAY,iBAAiB;AAAA,EAC7B,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,MACV;AACJ,QAAM,YAAY,yBAAO;AACzB,QAAM,CAAC,YAAY,iBAAiB,2BAAS;AAE7C,8BAAU,MAAM;AACd,QAAI,UAAU;AAAS,gBAAU,QAAQ;AAAA,KACxC;AAEH,QAAM,EAAE,YAAY,6BAAW,mCAAgB;AAE/C,8BAAU,MAAM;AACd,QAAI,eAAe,SAAS;AAC1B,iBAAW,MAAM;AACf,YAAI,UAAU;AAAS,oBAAU,QAAQ;AAAA,SACxC;AAAA;AAAA,KAEJ,CAAC,aAAa;AAEjB,QAAM,mBAAmB,0BACvB,MACE,SAAS,OACP,CAAC,UACC,CAAC,cACD,MAAM,MAAM,MAAM,cAAc,WAAW,WAAW,iBAE5D,CAAC,UAAU;AAGb,SACE,wFACE,mDAAC,kBAAD,MACE,mDAAC,8BAAD;AAAA,IACE,UAAU;AAAA,IACV,UAAU,CAAC,EAAE,YAAY,cAAc;AAAA,IACvC,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,OAGV,CAAC,iBAAiB,UACjB,mDAAC,kBAAD,MAAmB,gBAErB,mDAAC,wCAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA;AAAA;AAMR,MAAM,QAAQ;AAAA,EAEZ,qBAAqB,4BAAU,OAAO,YACpC;AAAA,EAGF,YAAY,4BAAU,OAAO,YAAY;AAAA,EAEzC,eAAe,4BAAU,OAAO,YAC9B;AAAA,EAGF,UAAU,4BAAU,MAAM,YAAY;AAAA,EAEtC,QAAQ,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAChE;AAAA,EAGF,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAC/D;AAAA,EAGF,aAAa,4BAAU,KAAK,YAC1B;AAAA;AAIJ,gBAAgB,YAAY;AAE5B,MAAM,kCAAkC,gCAAS;AACjD,gCAAgC,YAAY;AAE5C,MAAM,qBAAqB,4CAAqB;AAGhD,IAAO,0BAAQ;",
6
+ "names": []
7
+ }
File without changes
File without changes
File without changes
File without changes
@@ -40,7 +40,7 @@ var import_ds_hidden = require("@elliemae/ds-hidden");
40
40
  var import_ds_button = require("@elliemae/ds-button");
41
41
  var import_ds_popper = require("@elliemae/ds-popper");
42
42
  var import_styled_components = __toESM(require("styled-components"));
43
- var import_Menu = require("../Menu");
43
+ var import_DSMenu = require("../DSMenu");
44
44
  var import_MenuItem = require("./MenuItem");
45
45
  var import_menuItemFactory = require("./menuItemFactory");
46
46
  const ChevronRightComp = import_styled_components.default.div`
@@ -125,7 +125,7 @@ const SubMenu = ({
125
125
  size: "sm"
126
126
  }));
127
127
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_ds_popper.DSPopper, {
128
- contentComponent: /* @__PURE__ */ import_react.default.createElement(import_Menu.Menu, {
128
+ contentComponent: /* @__PURE__ */ import_react.default.createElement(import_DSMenu.Menu, {
129
129
  focusKeyBindings: {
130
130
  ArrowLeft: [() => focusItemByNode(itemRef.current), "exit"]
131
131
  },
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/MenuItems/SubMenu.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef, useState } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { ChevronSmallRight, MoreOptionsVert } from '@elliemae/ds-icons';\nimport { useFocusGroupItem } from '@elliemae/ds-shared/FocusGroup';\nimport { useHiddenController } from '@elliemae/ds-hidden';\nimport { DSButton, BUTTON_VARIANT } from '@elliemae/ds-button';\nimport { DSPopper, interactions } from '@elliemae/ds-popper';\nimport styled from 'styled-components';\nimport { Menu } from '../DSMenu';\nimport { MenuItem } from './MenuItem';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst ChevronRightComp = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 28px; // same width as the ellipsis button\n`;\n\nconst SubMenu = ({\n noAddon,\n leftAddon = undefined,\n label = undefined,\n interactionType = 'hover',\n children: subitems,\n rightAddonType,\n disabledAddonInactive,\n checkableProps = {},\n customRenderer,\n onClick,\n closeMenu,\n id,\n}) => {\n const itemRef = useRef(null);\n const focusOnOpen = useRef(false);\n const [isAddonHovered, setIsAddonHovered] = useState<boolean>(false);\n const {\n visible = false,\n onShow,\n onHide,\n } = useHiddenController(undefined, {\n interaction: 'click',\n });\n\n const interaction = rightAddonType === 'elipsis' ? 'click' : 'hover';\n\n const { focusItemByNode } = useFocusGroupItem();\n // todo: create a menu state to handle all related menu things\n const handleShowSubItemsWithMouse = (e) => {\n e.stopPropagation();\n onShow();\n focusOnOpen.current = true;\n };\n const handleShowWithMouse = (e) => {\n if (onClick) onClick(e);\n };\n const handleShowWithMouseHover = () => {\n setIsAddonHovered(true);\n onShow();\n focusOnOpen.current = false;\n };\n\n const handleShowWithKeyboard = () => {\n onShow();\n focusOnOpen.current = true;\n };\n\n const handleOnMouseEnter = useCallback(() => {\n setIsAddonHovered(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setIsAddonHovered(false);\n }, []);\n\n const hoverHandlers =\n interaction === 'hover'\n ? {\n onMouseEnter: handleShowWithMouseHover,\n onMouseLeave: () => {\n onHide();\n setIsAddonHovered(false);\n },\n }\n : { onClick: handleShowWithMouse };\n\n const rightAddon =\n rightAddonType === 'elipsis' ? (\n <DSButton\n aria-label=\"vertical-elipsis\"\n data-testid=\"vertical-elipsis\"\n buttonType=\"text\"\n leftIcon={\n <MoreOptionsVert\n className=\"submenu-arrow\"\n color={visible || isAddonHovered ? ['brand-primary', 800] : ['neutral', 500]}\n size=\"s\"\n />\n }\n onClick={(e) => handleShowSubItemsWithMouse(e)}\n size=\"m\"\n variant={BUTTON_VARIANT.DEFAULT}\n />\n ) : (\n <ChevronRightComp>\n <ChevronSmallRight\n data-testid=\"chevron-right\"\n className=\"submenu-arrow\"\n color={visible || isAddonHovered ? ['brand-primary', 800] : ['neutral', 500]}\n size=\"sm\"\n />\n </ChevronRightComp>\n );\n\n return (\n <>\n <DSPopper\n contentComponent={\n <Menu\n focusKeyBindings={{\n ArrowLeft: [() => focusItemByNode(itemRef.current), 'exit'],\n }}\n focusOnOpen={focusOnOpen.current}\n onExitFocusGroup={onHide}\n {...hoverHandlers}\n closeMenu={closeMenu}\n visible={visible}\n >\n {subitems}\n </Menu>\n }\n interactionType={interactionType}\n isOpen={visible}\n onOpen={(opening) => (opening ? onShow() : onHide())}\n placement=\"right-start\"\n showArrow={false}\n triggerComponent={\n <MenuItem\n customRenderer={customRenderer}\n disabledAddonInactive={disabledAddonInactive}\n id={id}\n innerRef={itemRef}\n label={label}\n leftAddon={leftAddon}\n noAddon={noAddon}\n onFocus={handleOnMouseEnter}\n onBlur={handleOnMouseLeave}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n {...hoverHandlers}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight' || e.key === 'Enter' || e.keyCode === 32) {\n handleShowWithKeyboard();\n }\n }}\n rightAddon={rightAddon}\n {...checkableProps}\n />\n }\n />\n </>\n );\n};\n\nconst props = {\n /** dont show addon for submenu */\n noAddon: PropTypes.bool.description('dont show addon for submenu'),\n /** left addon */\n leftAddon: PropTypes.node.description('left addon'),\n /** submenu label */\n label: PropTypes.string.description('submenu label'),\n /** A type indicating how to open/close the tooltip */\n interactionType: PropTypes.oneOf(interactions).description('A type indicating how to open/close the tooltip'),\n /** sub menu items */\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.node]).description('sub menu items'),\n /** right addon, ellipsis or undefined */\n rightAddonType: PropTypes.oneOf(['ellipsis']).description('right addon, ellipsis or undefined'),\n disabledAddonInactive: PropTypes.bool.description(''),\n /** props passed to MenuItem component */\n checkableProps: PropTypes.object.description('props passed to MenuItem component'),\n /** custom renderer for menu item */\n customRenderer: PropTypes.func.description('custom renderer for menu item'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n closeMenu: PropTypes.any.description(''),\n /** component id */\n id: PropTypes.string.description('component id'),\n};\n\nSubMenu.propTypes = props;\nregisterMenuItem('submenu', SubMenu);\n\nconst DSSubMenuWithSchema = describe(SubMenu);\n\nDSSubMenuWithSchema.propTypes = props;\n\nexport { DSSubMenuWithSchema, SubMenu };\nexport default SubMenu;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAqD;AACrD,wBAAoC;AACpC,sBAAmD;AACnD,wBAAkC;AAClC,uBAAoC;AACpC,uBAAyC;AACzC,uBAAuC;AACvC,+BAAmB;AACnB,oBAAqB;AACrB,sBAAyB;AACzB,6BAAiC;AAEjC,MAAM,mBAAmB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA,YAAY;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A,EAElD,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAE7C,gBAAgB,4BAAU,KAAK,YAAY;AAAA,EAE3C,SAAS,4BAAU,KAAK,YAAY;AAAA,EACpC,WAAW,4BAAU,IAAI,YAAY;AAAA,EAErC,IAAI,4BAAU,OAAO,YAAY;AAAA;AAGnC,QAAQ,YAAY;AACpB,6CAAiB,WAAW;AAE5B,MAAM,sBAAsB,gCAAS;AAErC,oBAAoB,YAAY;AAGhC,IAAO,kBAAQ;",
6
+ "names": []
7
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -8,17 +8,6 @@ import { useOnClickOutside } from "@elliemae/ds-utilities/hooks";
8
8
  import { mergeRefs } from "@elliemae/ds-utilities/system";
9
9
  import { focusGroupManagerHoc, FocusGroupContext } from "@elliemae/ds-shared/FocusGroup";
10
10
  import { useHiddenTransition } from "@elliemae/ds-hidden";
11
- import { MenuItemRadio } from "./MenuItems/MenuItemRadio";
12
- import { MenuItemCheckbox } from "./MenuItems/MenuItemCheckbox";
13
- import { CheckboxGroup } from "./MenuItems/CheckboxGroup";
14
- import { RadioGroup } from "./MenuItems/RadioGroup";
15
- import { MenuSeparator } from "./MenuItems/Separator";
16
- import { MenuItem } from "./MenuItems/MenuItem";
17
- import { SubMenu } from "./MenuItems/SubMenu";
18
- import { SearchableGroup } from "./MenuItems/SearchableGroup";
19
- import { SelectionGroup } from "./MenuItems/SelectionGroup";
20
- import { menuItemFactory } from "./MenuItems/menuItemFactory";
21
- import { renderMenuItems } from "./MenuItems/renderMenuItems";
22
11
  import { MenuContext } from "./MenuContext";
23
12
  const RESPONSIVE_HEIHGT_MARGIN = 120;
24
13
  const blockName = "menu";
@@ -102,21 +91,8 @@ const props = {
102
91
  DSMenu.propTypes = props;
103
92
  const DSMenuWithSchema = describe(DSMenu);
104
93
  DSMenuWithSchema.propTypes = props;
105
- Menu.Item = MenuItem;
106
- Menu.ItemCheckbox = MenuItemCheckbox;
107
- Menu.ItemRadio = MenuItemRadio;
108
- Menu.SubMenu = SubMenu;
109
- Menu.Separator = MenuSeparator;
110
- Menu.CheckboxGroup = CheckboxGroup;
111
- Menu.RadioGroup = RadioGroup;
112
- Menu.SearchableGroup = SearchableGroup;
113
- Menu.SelectionGroup = SelectionGroup;
114
- var Menu_default = Menu;
115
94
  export {
116
95
  DSMenuWithSchema,
117
- Menu,
118
- Menu_default as default,
119
- menuItemFactory,
120
- renderMenuItems
96
+ Menu
121
97
  };
122
- //# sourceMappingURL=Menu.js.map
98
+ //# sourceMappingURL=DSMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenu.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext, useEffect, useMemo, useRef } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { omit } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { animated } from 'react-spring/web';\nimport { useOnClickOutside } from '@elliemae/ds-utilities/hooks';\nimport { mergeRefs } from '@elliemae/ds-utilities/system';\nimport { focusGroupManagerHoc, FocusGroupContext } from '@elliemae/ds-shared/FocusGroup';\nimport { useHiddenTransition } from '@elliemae/ds-hidden';\nimport { MenuContext } from './MenuContext';\n\nconst RESPONSIVE_HEIHGT_MARGIN = 120;\n\nconst blockName = 'menu';\n\nconst noop = () => {};\n\nconst MenuComponent = aggregatedClasses('div')(blockName, '', ({ menuComboBox, type }) => ({\n 'menu-combo-box': menuComboBox,\n [`type-${type}`]: type,\n}));\n\n/**\n * todo: -- IDEA -- each menu could have an overlay based on an overlay stack context so we can\n * capture the context of the clicks on very nested components\n */\n\nconst isChildOfType = (child, type) => child.type.name === type;\n\nconst DSMenu = ({\n containerProps = {},\n innerRef,\n as: MenuTag = animated.ul,\n children = undefined,\n onClickOutside = noop,\n // handlers from hidden\n visible = undefined,\n focusOnOpen = false,\n maxOption = 0,\n style = {},\n minWidth = undefined,\n maxWidth = undefined,\n closeMenu,\n responsiveHeight = false,\n ...otherProps\n}) => {\n const menuRef = useRef(null);\n const { focusFirst } = useContext(FocusGroupContext);\n const { destroyed, ...hiddenProps } = useHiddenTransition({ visible, style });\n\n // force no addon to the children if the menu doesn't have any item with leftAddon like SelectionGroup\n const nextChildren = useMemo(() => {\n const forceLeftAddon = React.Children.toArray(children).some(\n (child) =>\n isChildOfType(child, 'SelectionGroup') ||\n isChildOfType(child, 'MenuItemCheckbox') ||\n isChildOfType(child, 'MenuItemRadio') ||\n child.props.leftAddon,\n );\n\n return React.Children.map(\n children,\n (child) =>\n child &&\n React.cloneElement(child, {\n ...child.props,\n noAddon: !forceLeftAddon ? true : undefined,\n maxOption,\n closeMenu,\n }),\n );\n }, [children]);\n\n useOnClickOutside(menuRef, onClickOutside);\n\n useEffect(() => {\n if (focusOnOpen && visible) {\n setTimeout(() => {\n focusFirst();\n }, 0);\n }\n }, [visible, focusOnOpen]);\n // todo: find out a better approach to this\n return !hiddenProps.destroyed ? (\n <MenuContext.Provider value={{ visible, closeMenu }}>\n <MenuComponent\n data-testid={containerProps?.['data-testid'] ? containerProps['data-testid'] : 'em-ds-menu'}\n {...containerProps}\n as={MenuTag}\n classProps={{ ...(otherProps.classProps || {}), type: otherProps.type }}\n innerRef={mergeRefs(innerRef, menuRef)}\n role=\"menu\"\n {...omit(otherProps, ['scheduleUpdate'])}\n {...hiddenProps}\n >\n {/* eslint-disable indent */}\n <div\n className=\"menu-component-internal-wrapper\"\n style={{\n ...style,\n minWidth,\n maxWidth,\n ...(responsiveHeight\n ? {\n overflowY: 'scroll',\n maxHeight: responsiveHeight ? `${window.innerHeight - RESPONSIVE_HEIHGT_MARGIN}px` : undefined,\n }\n : {}),\n }}\n >\n {/* eslint-enable indent */}\n {nextChildren}\n </div>\n </MenuComponent>\n </MenuContext.Provider>\n ) : null;\n};\n\nconst Menu = focusGroupManagerHoc(DSMenu, { loop: true });\n\nconst props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description('Injected props to wrapper element of component'),\n /** Renders the menu with a specific html element */\n as: PropTypes.element.description('Renders the menu with a specific html element'),\n /** Handler when a user clicks outside the menu */\n onClickOutside: PropTypes.func.description('Handler when a user clicks outside the menu'),\n /** Whether the menu is visible or not */\n visible: PropTypes.bool.description('Whether the menu is visible or not'),\n /** When set to true, it's going to focus the first item */\n focusOnOpen: PropTypes.bool.description(\"When set to true, it's going to focus the first item\"),\n /** Customize menu minWidth. Can be undefined or 'number' */\n minWidth: PropTypes.number.description(\"Customize menu minWidth. Can be undefined or 'number'\"),\n /** Customize menu maxWidth. Can be undefined or 'number' */\n maxWidth: PropTypes.number.description(\"Customize menu maxWidth. Can be undefined or 'number'\"),\n};\n\nDSMenu.propTypes = props;\n\nconst DSMenuWithSchema = describe(DSMenu);\n\nDSMenuWithSchema.propTypes = props;\n\nexport { DSMenuWithSchema, Menu };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,2BAA2B;AAEjC,MAAM,YAAY;AAElB,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,gBAAgB,kBAAkB,OAAO,WAAW,IAAI,CAAC,EAAE,cAAc,WAAY;AAAA,EACzF,kBAAkB;AAAA,GACjB,QAAQ,SAAS;AAAA;AAQpB,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS;AAE3D,MAAM,SAAS,CAAC;AAAA,EACd,iBAAiB;AAAA,EACjB;AAAA,EACA,IAAI,UAAU,SAAS;AAAA,EACvB,WAAW;AAAA,EACX,iBAAiB;AAAA,EAEjB,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,KAChB;AAAA,MACC;AACJ,QAAM,UAAU,OAAO;AACvB,QAAM,EAAE,eA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EAElC,gBAAgB,UAAU,KAAK,YAAY;AAAA,EAE3C,SAAS,UAAU,KAAK,YAAY;AAAA,EAEpC,aAAa,UAAU,KAAK,YAAY;AAAA,EAExC,UAAU,UAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,UAAU,OAAO,YAAY;AAAA;AAGzC,OAAO,YAAY;AAEnB,MAAM,mBAAmB,SAAS;AAElC,iBAAiB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ import { MenuItemRadio } from "./MenuItems/MenuItemRadio";
3
+ import { MenuItemCheckbox } from "./MenuItems/MenuItemCheckbox";
4
+ import { CheckboxGroup } from "./MenuItems/CheckboxGroup";
5
+ import { RadioGroup } from "./MenuItems/RadioGroup";
6
+ import { MenuSeparator } from "./MenuItems/Separator";
7
+ import { MenuItem } from "./MenuItems/MenuItem";
8
+ import { SubMenu } from "./MenuItems/SubMenu";
9
+ import { SearchableGroup } from "./MenuItems/SearchableGroup";
10
+ import { SelectionGroup } from "./MenuItems/SelectionGroup";
11
+ import { menuItemFactory } from "./MenuItems/menuItemFactory";
12
+ import { renderMenuItems } from "./MenuItems/renderMenuItems";
13
+ import { DSMenuWithSchema, Menu } from "./DSMenu";
14
+ Menu.Item = MenuItem;
15
+ Menu.ItemCheckbox = MenuItemCheckbox;
16
+ Menu.ItemRadio = MenuItemRadio;
17
+ Menu.SubMenu = SubMenu;
18
+ Menu.Separator = MenuSeparator;
19
+ Menu.CheckboxGroup = CheckboxGroup;
20
+ Menu.RadioGroup = RadioGroup;
21
+ Menu.SearchableGroup = SearchableGroup;
22
+ Menu.SelectionGroup = SelectionGroup;
23
+ var Menu_default = Menu;
24
+ export {
25
+ DSMenuWithSchema,
26
+ Menu,
27
+ Menu_default as default,
28
+ menuItemFactory,
29
+ renderMenuItems
30
+ };
31
+ //# sourceMappingURL=Menu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Menu.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { MenuItemRadio } from './MenuItems/MenuItemRadio';\nimport { MenuItemCheckbox } from './MenuItems/MenuItemCheckbox';\nimport { CheckboxGroup } from './MenuItems/CheckboxGroup';\nimport { RadioGroup } from './MenuItems/RadioGroup';\nimport { MenuSeparator } from './MenuItems/Separator';\nimport { MenuItem } from './MenuItems/MenuItem';\nimport { SubMenu } from './MenuItems/SubMenu';\nimport { SearchableGroup } from './MenuItems/SearchableGroup';\nimport { SelectionGroup } from './MenuItems/SelectionGroup';\nimport { menuItemFactory } from './MenuItems/menuItemFactory';\nimport { renderMenuItems } from './MenuItems/renderMenuItems';\nimport { DSMenuWithSchema, Menu } from './DSMenu';\n\n\nMenu.Item = MenuItem;\nMenu.ItemCheckbox = MenuItemCheckbox;\nMenu.ItemRadio = MenuItemRadio;\nMenu.SubMenu = SubMenu;\nMenu.Separator = MenuSeparator;\nMenu.CheckboxGroup = CheckboxGroup;\nMenu.RadioGroup = RadioGroup;\nMenu.SearchableGroup = SearchableGroup;\nMenu.SelectionGroup = SelectionGroup;\n\nexport { menuItemFactory, renderMenuItems, DSMenuWithSchema, Menu };\nexport default Menu;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,KAAK,OAAO;AACZ,KAAK,eAAe;AACpB,KAAK,YAAY;AACjB,KAAK,UAAU;AACf,KAAK,YAAY;AACjB,KAAK,gBAAgB;AACrB,KAAK,aAAa;AAClB,KAAK,kBAAkB;AACvB,KAAK,iBAAiB;AAGtB,IAAO,eAAQ;",
6
+ "names": []
7
+ }
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import React2 from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { SearchableList } from "./MenuItems/SearchableList";
5
- import { Menu } from "./Menu";
5
+ import { Menu } from "./DSMenu";
6
6
  function MenuCombobox({
7
7
  dropdownFilterOptions = {},
8
8
  options = [],
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/MenuCombobox.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { SearchableList } from './MenuItems/SearchableList';\nimport { Menu } from './DSMenu';\n\nfunction MenuCombobox({\n dropdownFilterOptions = {},\n options = [],\n onSelectMenuItem = () => null,\n innerRef,\n maxOptions = 10,\n loading = false,\n ...rest\n}) {\n return (\n <Menu\n {...rest}\n classProps={{ menuComboBox: true }}\n innerRef={innerRef}\n visible\n >\n <SearchableList\n appendTermInList\n extraListProps={dropdownFilterOptions}\n items={options}\n onSelectMenuItem={onSelectMenuItem}\n maxOptions={maxOptions}\n loading={loading}\n />\n </Menu>\n );\n}\n\nMenuCombobox.propTypes = {\n /** Options */\n dropdownFilterOptions: PropTypes.shape({}),\n /** The option or menu items to render */\n options: PropTypes.arrayOf(PropTypes.object),\n /** Handler when a menu item is selected */\n onSelectMenuItem: PropTypes.func,\n /** Internal ref */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Max options to display in the list */\n maxOptions: PropTypes.number,\n /** Is loading */\n loading: PropTypes.bool,\n};\n\nexport default MenuCombobox;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,sBAAsB;AAAA,EACpB,wBAAwB;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB,MAAM;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb,UAAU;AAAA,KACP;AAAA,GACF;AACD,SACE,qCAAC,MAAD;AAAA,OACM;AAAA,IACJ,YAAY,EAAE,cAAc;AAAA,IAC5B;AAAA,IACA,SAAO;AAAA,KAEP,qCAAC,gBAAD;AAAA,IACE,kBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAMR,aAAa,YAAY;AAAA,EAEvB,uBAAuB,UAAU,MAAM;AAAA,EAEvC,SAAS,UAAU,QAAQ,UAAU;AAAA,EAErC,kBAAkB,UAAU;AAAA,EAE5B,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU;AAAA,EAEzD,YAAY,UAAU;AAAA,EAEtB,SAAS,UAAU;AAAA;AAGrB,IAAO,uBAAQ;",
6
+ "names": []
7
+ }
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { DSMenuWithSchema, Menu } from "./Menu";
3
+ export {
4
+ DSMenuWithSchema,
5
+ Menu
6
+ };
7
+ //# sourceMappingURL=MenuExports.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/MenuExports.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Menu';"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSMenuWithSchema, Menu } from './Menu';"],
5
5
  "mappings": "AAAA;ACAA;",
6
6
  "names": []
7
7
  }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React2 from "react";
3
- import { DSCheckbox } from "@elliemae/ds-form";
3
+ import { DSCheckbox } from "@elliemae/ds-form/Checkbox";
4
4
  import { MenuItemCheckable } from "./MenuItemCheckable";
5
5
  import { registerMenuItem } from "./menuItemFactory";
6
6
  const MenuItemCheckbox = ({ checked, ...rest }) => /* @__PURE__ */ React2.createElement(MenuItemCheckable, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/MenuItems/MenuItemCheckbox.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { MenuItemCheckable } from './MenuItemCheckable';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst MenuItemCheckbox = ({ checked, ...rest }) => (\n <MenuItemCheckable {...rest} leftAddon={<DSCheckbox checked={checked} />} role=\"menuitemcheckbox\" />\n);\n\nregisterMenuItem('checkbox', MenuItemCheckbox);\nexport { MenuItemCheckbox };\nexport default MenuItemCheckbox;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form/Checkbox';\nimport { MenuItemCheckable } from './MenuItemCheckable';\nimport { registerMenuItem } from './menuItemFactory';\n\nconst MenuItemCheckbox = ({ checked, ...rest }) => (\n <MenuItemCheckable {...rest} leftAddon={<DSCheckbox checked={checked} />} role=\"menuitemcheckbox\" />\n);\n\nregisterMenuItem('checkbox', MenuItemCheckbox);\nexport { MenuItemCheckbox };\nexport default MenuItemCheckbox;\n"],
5
5
  "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,mBAAmB,CAAC,EAAE,YAAY,WACtC,qCAAC,mBAAD;AAAA,KAAuB;AAAA,EAAM,WAAW,qCAAC,YAAD;AAAA,IAAY;AAAA;AAAA,EAAsB,MAAK;AAAA;AAGjF,iBAAiB,YAAY;AAE7B,IAAO,2BAAQ;",
6
6
  "names": []
7
7
  }
File without changes
File without changes
File without changes
File without changes