@elliemae/ds-app-picker 1.57.1 → 2.0.0-alpha.11

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.
@@ -1,47 +1,42 @@
1
- import React, { useRef, useEffect, useCallback } from 'react';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import { useRef, useEffect, useCallback } from 'react';
2
3
  import { chunk } from 'lodash';
3
4
  import { aggregatedClasses } from '@elliemae/ds-classnames';
4
5
  import { keys } from './utils.js';
5
-
6
- /* eslint-disable react/prop-types */
7
- var blockName = 'app-picker';
8
- var Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');
9
- var Grid = aggregatedClasses('div')(blockName, 'grid');
10
- var Row = aggregatedClasses('div')(blockName, 'row');
11
- var Chip = aggregatedClasses('button')(blockName, 'chip', function (_ref) {
12
- var disabled = _ref.disabled,
13
- selected = _ref.selected;
14
- return {
15
- disabled: disabled,
16
- selected: selected
17
- };
18
- });
19
- var ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');
20
- var Separator = aggregatedClasses('hr')(blockName, 'separator');
21
- var SectionTitle = aggregatedClasses('p')(blockName, 'section-title');
22
-
23
- var AppPickerImpl = function AppPickerImpl(_ref2) {
24
- var _ref2$apps = _ref2.apps,
25
- apps = _ref2$apps === void 0 ? [] : _ref2$apps,
26
- _ref2$customApps = _ref2.customApps,
27
- customApps = _ref2$customApps === void 0 ? [] : _ref2$customApps,
28
- _ref2$sectionTitle = _ref2.sectionTitle,
29
- sectionTitle = _ref2$sectionTitle === void 0 ? 'APPLICATIONS' : _ref2$sectionTitle,
30
- _ref2$customSectionTi = _ref2.customSectionTitle,
31
- customSectionTitle = _ref2$customSectionTi === void 0 ? 'CUSTOM APPLICATIONS' : _ref2$customSectionTi,
32
- _ref2$close = _ref2.close,
33
- close = _ref2$close === void 0 ? function () {
34
- return null;
35
- } : _ref2$close,
36
- wrapperRef = _ref2.wrapperRef,
37
- onKeyDown = _ref2.onKeyDown,
38
- triggerRef = _ref2.triggerRef;
39
- var allFocusableButtons = useRef([]);
40
- var selectedButton = useRef(null);
41
- useEffect(function () {
6
+ import { jsxs, Fragment } from 'react/jsx-runtime';
7
+
8
+ var _Separator;
9
+ const blockName = 'app-picker';
10
+ const Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');
11
+ const Grid = aggregatedClasses('div')(blockName, 'grid');
12
+ const Row = aggregatedClasses('div')(blockName, 'row');
13
+ const Chip = aggregatedClasses('button')(blockName, 'chip', ({
14
+ disabled,
15
+ selected
16
+ }) => ({
17
+ disabled,
18
+ selected
19
+ }));
20
+ const ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');
21
+ const Separator = aggregatedClasses('hr')(blockName, 'separator');
22
+ const SectionTitle = aggregatedClasses('p')(blockName, 'section-title');
23
+
24
+ const AppPickerImpl = ({
25
+ apps = [],
26
+ customApps = [],
27
+ sectionTitle = 'APPLICATIONS',
28
+ customSectionTitle = 'CUSTOM APPLICATIONS',
29
+ close = () => null,
30
+ wrapperRef,
31
+ onKeyDown,
32
+ triggerRef
33
+ }) => {
34
+ const allFocusableButtons = useRef([]);
35
+ const selectedButton = useRef(null);
36
+ useEffect(() => {
42
37
  var _wrapperRef$current;
43
38
 
44
- wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelectorAll('button').forEach(function (e, index) {
39
+ wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelectorAll('button').forEach((e, index) => {
45
40
  if (!e.hasAttribute('disabled')) {
46
41
  var _allFocusableButtons$;
47
42
 
@@ -64,7 +59,7 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
64
59
  }
65
60
  }, [wrapperRef]); // eslint-disable-next-line max-statements
66
61
 
67
- var handleKeyDown = function handleKeyDown(e) {
62
+ const handleKeyDown = e => {
68
63
  var _triggerRef$current;
69
64
 
70
65
  switch (e.key) {
@@ -92,10 +87,10 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
92
87
  }
93
88
  };
94
89
 
95
- var handleOnClick = useCallback(function (e, app) {
90
+ const handleOnClick = useCallback((e, app) => {
96
91
  if (app.onClick) app.onClick(e, app);
97
92
  }, []);
98
- var handleOnKeyDownWrapper = useCallback(function (e) {
93
+ const handleOnKeyDownWrapper = useCallback(e => {
99
94
  if (onKeyDown) onKeyDown(e);
100
95
 
101
96
  if (!onKeyDown && e.key === keys.ESC) {
@@ -103,70 +98,62 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
103
98
  }
104
99
  }, [onKeyDown, close]);
105
100
 
106
- var buildRows = function buildRows(appList) {
107
- var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
108
- var rows = chunk(appList, 3); // divides array in subarrays of 3 items
109
-
110
- var formattedRows = rows.map(function (row, index) {
111
- return /*#__PURE__*/React.createElement(Row, {
112
- key: index
113
- }, row.map(function (app, key) {
114
- var label = app.label,
115
- disabled = app.disabled,
116
- selected = app.selected,
117
- Icon = app.icon;
118
- return /*#__PURE__*/React.createElement(Chip, {
119
- key: key,
120
- classProps: {
121
- disabled: disabled,
122
- selected: selected
123
- },
124
- onClick: function onClick(e) {
125
- return handleOnClick(e, app);
126
- },
127
- onKeyDown: handleKeyDown,
128
- "data-testid": "app-picker__chip",
129
- "aria-disabled": disabled,
130
- disabled: disabled,
131
- "aria-selected": selected,
132
- "aria-setsize": apps.length + customApps.length,
133
- "aria-posinset": key + prevIndex
134
- }, /*#__PURE__*/React.createElement(Icon, {
135
- className: "app-picker__icon",
136
- size: "m"
137
- }), /*#__PURE__*/React.createElement(ChipLabel, null, label));
138
- }));
139
- });
101
+ const buildRows = (appList, prevIndex = 0) => {
102
+ const rows = chunk(appList, 3); // divides array in subarrays of 3 items
103
+
104
+ const formattedRows = rows.map((row, index) => /*#__PURE__*/_jsx(Row, {}, index, row.map((app, key) => {
105
+ const {
106
+ label,
107
+ disabled,
108
+ selected,
109
+ icon: Icon
110
+ } = app;
111
+ return /*#__PURE__*/_jsx(Chip, {
112
+ classProps: {
113
+ disabled,
114
+ selected
115
+ },
116
+ onClick: e => handleOnClick(e, app),
117
+ onKeyDown: handleKeyDown,
118
+ "data-testid": "app-picker__chip",
119
+ "aria-disabled": disabled,
120
+ disabled: disabled,
121
+ "aria-selected": selected,
122
+ "aria-setsize": apps.length + customApps.length,
123
+ "aria-posinset": key + prevIndex
124
+ }, key, /*#__PURE__*/_jsx(Icon, {
125
+ className: "app-picker__icon",
126
+ size: "m"
127
+ }), /*#__PURE__*/_jsx(ChipLabel, {}, void 0, label));
128
+ })));
140
129
  return formattedRows;
141
130
  };
142
131
 
143
- var AppsRows = function AppsRows() {
144
- return buildRows(apps, 1);
145
- };
132
+ const AppsRows = () => buildRows(apps, 1);
146
133
 
147
- var CustomRows = function CustomRows() {
148
- return buildRows(customApps, apps.length);
149
- };
134
+ const CustomRows = () => buildRows(customApps, apps.length);
150
135
 
151
- return /*#__PURE__*/React.createElement(Wrapper, {
136
+ return /*#__PURE__*/jsxs(Wrapper, {
152
137
  role: "listbox",
153
138
  ref: wrapperRef,
154
139
  onKeyDown: handleOnKeyDownWrapper,
155
- "data-testid": "app-picker__wrapper"
156
- }, /*#__PURE__*/React.createElement(SectionTitle, {
157
- "data-testid": "app-picker__main-title",
158
- "aria-hidden": true
159
- }, sectionTitle), /*#__PURE__*/React.createElement(Grid, {
160
- "data-testid": "app-picker__main-grid"
161
- }, /*#__PURE__*/React.createElement(AppsRows, null)), !!customApps.length && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Separator, {
162
- "aria-hidden": true
163
- }), /*#__PURE__*/React.createElement(SectionTitle, {
164
- "data-testid": "app-picker__custom-title",
165
- "aria-hidden": true
166
- }, customSectionTitle), /*#__PURE__*/React.createElement(Grid, {
167
- "data-testid": "app-picker__custom-grid"
168
- }, /*#__PURE__*/React.createElement(CustomRows, null))));
140
+ "data-testid": "app-picker__wrapper",
141
+ children: [/*#__PURE__*/_jsx(SectionTitle, {
142
+ "data-testid": "app-picker__main-title",
143
+ "aria-hidden": true
144
+ }, void 0, sectionTitle), /*#__PURE__*/_jsx(Grid, {
145
+ "data-testid": "app-picker__main-grid"
146
+ }, void 0, /*#__PURE__*/_jsx(AppsRows, {})), !!customApps.length && /*#__PURE__*/jsxs(Fragment, {
147
+ children: [_Separator || (_Separator = /*#__PURE__*/_jsx(Separator, {
148
+ "aria-hidden": true
149
+ })), /*#__PURE__*/_jsx(SectionTitle, {
150
+ "data-testid": "app-picker__custom-title",
151
+ "aria-hidden": true
152
+ }, void 0, customSectionTitle), /*#__PURE__*/_jsx(Grid, {
153
+ "data-testid": "app-picker__custom-grid"
154
+ }, void 0, /*#__PURE__*/_jsx(CustomRows, {}))]
155
+ })]
156
+ });
169
157
  };
170
158
 
171
159
  export { AppPickerImpl as default };
172
- //# sourceMappingURL=AppPickerImpl.js.map
@@ -1,73 +1,50 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
2
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
3
- import React, { useState, useRef, useEffect } from 'react';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import { useState, useRef, useEffect } from 'react';
4
4
  import { describe } from 'react-desc';
5
- import { MenuPicker } from '@elliemae/ds-icons';
5
+ import MenuPicker from '@elliemae/ds-icons/MenuPicker';
6
6
  import DSButton from '@elliemae/ds-button';
7
7
  import DSPopover from '@elliemae/ds-popover';
8
8
  import { mergeRefs } from '@elliemae/ds-utilities';
9
9
  import AppPickerImpl from './AppPickerImpl.js';
10
10
  import { propTypes } from './propTypes.js';
11
- import 'lodash';
12
- import '@elliemae/ds-classnames';
13
- import './utils.js';
14
11
 
15
- var DSAppPicker = function DSAppPicker(_ref) {
16
- var _ref$apps = _ref.apps,
17
- apps = _ref$apps === void 0 ? [] : _ref$apps,
18
- _ref$customApps = _ref.customApps,
19
- customApps = _ref$customApps === void 0 ? [] : _ref$customApps,
20
- _ref$sectionTitle = _ref.sectionTitle,
21
- sectionTitle = _ref$sectionTitle === void 0 ? 'APPLICATIONS' : _ref$sectionTitle,
22
- _ref$customSectionTit = _ref.customSectionTitle,
23
- customSectionTitle = _ref$customSectionTit === void 0 ? 'CUSTOM APPLICATIONS' : _ref$customSectionTit,
24
- _ref$icon = _ref.icon,
25
- Icon = _ref$icon === void 0 ? function () {
26
- return /*#__PURE__*/React.createElement(MenuPicker, {
27
- fill: ['brand-primary', 700],
28
- size: "m"
29
- });
30
- } : _ref$icon,
31
- renderTrigger = _ref.renderTrigger,
32
- isOpen = _ref.isOpen,
33
- _ref$onClose = _ref.onClose,
34
- onClose = _ref$onClose === void 0 ? function () {
35
- return null;
36
- } : _ref$onClose,
37
- actionRef = _ref.actionRef,
38
- onKeyDown = _ref.onKeyDown,
39
- _ref$onClick = _ref.onClick,
40
- _onClick = _ref$onClick === void 0 ? function () {
41
- return null;
42
- } : _ref$onClick,
43
- _ref$onClickOutside = _ref.onClickOutside,
44
- onClickOutside = _ref$onClickOutside === void 0 ? function () {
45
- return null;
46
- } : _ref$onClickOutside,
47
- triggerRef = _ref.triggerRef;
12
+ const DSAppPicker = ({
13
+ apps = [],
14
+ customApps = [],
15
+ sectionTitle = 'APPLICATIONS',
16
+ customSectionTitle = 'CUSTOM APPLICATIONS',
17
+ icon: Icon = () => /*#__PURE__*/_jsx(MenuPicker, {
18
+ fill: ['brand-primary', 700],
19
+ size: "m"
20
+ }),
21
+ renderTrigger,
22
+ isOpen,
23
+ onClose = () => null,
24
+ actionRef,
25
+ onKeyDown,
26
+ onClick = () => null,
27
+ onClickOutside = () => null,
28
+ triggerRef
29
+ }) => {
30
+ var _Icon;
48
31
 
49
- var _useState = useState(false),
50
- _useState2 = _slicedToArray(_useState, 2),
51
- open = _useState2[0],
52
- setOpen = _useState2[1];
53
-
54
- var wrapperRef = useRef(null);
55
- var defaultTriggerRef = useRef(null);
56
- useEffect(function () {
32
+ const [open, setOpen] = useState(false);
33
+ const wrapperRef = useRef(null);
34
+ const defaultTriggerRef = useRef(null);
35
+ useEffect(() => {
57
36
  if (actionRef) {
58
- actionRef.current.focusToIndex = function (index) {
37
+ actionRef.current.focusToIndex = index => {
59
38
  if (wrapperRef.current) {
60
- var parent = wrapperRef.current;
61
-
62
- var buttons = _toConsumableArray(parent.querySelectorAll('button'));
63
-
39
+ const parent = wrapperRef.current;
40
+ const buttons = [...parent.querySelectorAll('button')];
64
41
  buttons[index].focus();
65
42
  }
66
43
  };
67
44
  }
68
45
  }, [actionRef, apps, customApps]);
69
46
 
70
- var handleOnClose = function handleOnClose() {
47
+ const handleOnClose = () => {
71
48
  if (typeof isOpen === 'boolean') {
72
49
  setOpen(isOpen);
73
50
  } else {
@@ -77,43 +54,39 @@ var DSAppPicker = function DSAppPicker(_ref) {
77
54
  onClose();
78
55
  };
79
56
 
80
- var handleOnClickOutside = function handleOnClickOutside(e) {
57
+ const handleOnClickOutside = e => {
81
58
  setOpen(false);
82
59
  onClose();
83
60
  onClickOutside(e);
84
61
  };
85
62
 
86
- var AppPickerContent = function AppPickerContent() {
87
- return /*#__PURE__*/React.createElement(AppPickerImpl, {
88
- apps: apps,
89
- customApps: customApps,
90
- sectionTitle: sectionTitle,
91
- customSectionTitle: customSectionTitle,
92
- close: handleOnClose,
93
- wrapperRef: wrapperRef,
94
- onKeyDown: onKeyDown,
95
- triggerRef: triggerRef || defaultTriggerRef
96
- });
97
- };
98
-
99
- var RenderTrigger = renderTrigger || function (_ref2) {
100
- var ref = _ref2.ref;
101
- return /*#__PURE__*/React.createElement(DSButton, {
102
- "data-testid": "app-picker__button",
103
- id: "app-picker__button",
104
- buttonType: "text",
105
- icon: /*#__PURE__*/React.createElement(Icon, null),
106
- innerRef: mergeRefs(ref, defaultTriggerRef),
107
- onClick: function onClick(e) {
108
- _onClick(e);
63
+ const AppPickerContent = () => /*#__PURE__*/_jsx(AppPickerImpl, {
64
+ apps: apps,
65
+ customApps: customApps,
66
+ sectionTitle: sectionTitle,
67
+ customSectionTitle: customSectionTitle,
68
+ close: handleOnClose,
69
+ wrapperRef: wrapperRef,
70
+ onKeyDown: onKeyDown,
71
+ triggerRef: triggerRef || defaultTriggerRef
72
+ });
109
73
 
110
- setOpen(true);
111
- }
112
- });
113
- };
74
+ const RenderTrigger = renderTrigger || (({
75
+ ref
76
+ }) => /*#__PURE__*/_jsx(DSButton, {
77
+ "data-testid": "app-picker__button",
78
+ id: "app-picker__button",
79
+ buttonType: "text",
80
+ icon: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {})),
81
+ innerRef: mergeRefs(ref, defaultTriggerRef),
82
+ onClick: e => {
83
+ onClick(e);
84
+ setOpen(true);
85
+ }
86
+ }));
114
87
 
115
- return /*#__PURE__*/React.createElement(DSPopover, {
116
- content: /*#__PURE__*/React.createElement(AppPickerContent, null),
88
+ return /*#__PURE__*/_jsx(DSPopover, {
89
+ content: /*#__PURE__*/_jsx(AppPickerContent, {}),
117
90
  isOpen: typeof isOpen === 'boolean' ? isOpen : open,
118
91
  onClickOutside: handleOnClickOutside,
119
92
  placement: "bottom",
@@ -127,9 +100,7 @@ var DSAppPicker = function DSAppPicker(_ref) {
127
100
  });
128
101
  };
129
102
 
130
- DSAppPicker.propTypes = propTypes;
131
- var AppPickerWithSchema = describe(DSAppPicker);
103
+ const AppPickerWithSchema = describe(DSAppPicker);
132
104
  AppPickerWithSchema.propTypes = propTypes;
133
105
 
134
106
  export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default };
135
- //# sourceMappingURL=DSAppPicker.js.map
package/esm/index.js CHANGED
@@ -1,15 +1 @@
1
1
  export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default } from './DSAppPicker.js';
2
- import '@babel/runtime/helpers/esm/toConsumableArray';
3
- import '@babel/runtime/helpers/esm/slicedToArray';
4
- import 'react';
5
- import 'react-desc';
6
- import '@elliemae/ds-icons';
7
- import '@elliemae/ds-button';
8
- import '@elliemae/ds-popover';
9
- import '@elliemae/ds-utilities';
10
- import './AppPickerImpl.js';
11
- import 'lodash';
12
- import '@elliemae/ds-classnames';
13
- import './utils.js';
14
- import './propTypes.js';
15
- //# sourceMappingURL=index.js.map
package/esm/propTypes.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PropTypes } from 'react-desc';
2
- import { MenuPicker } from '@elliemae/ds-icons';
2
+ import MenuPicker from '@elliemae/ds-icons/MenuPicker';
3
3
 
4
- var propTypes = {
4
+ const propTypes = {
5
5
  apps: PropTypes.array.description('Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]').isRequired,
6
6
  customApps: PropTypes.array.description('Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]'),
7
7
  sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),
@@ -19,4 +19,3 @@ var propTypes = {
19
19
  };
20
20
 
21
21
  export { propTypes };
22
- //# sourceMappingURL=propTypes.js.map
@@ -1,2 +1 @@
1
1
 
2
- //# sourceMappingURL=AppPickerTypes.js.map
package/esm/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- var keys = {
1
+ const keys = {
2
2
  LEFT: 'ArrowLeft',
3
3
  UP: 'ArrowUp',
4
4
  RIGHT: 'ArrowRight',
@@ -12,4 +12,3 @@ var keys = {
12
12
  };
13
13
 
14
14
  export { keys };
15
- //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,14 +1,50 @@
1
1
  {
2
2
  "name": "@elliemae/ds-app-picker",
3
- "version": "1.57.1",
3
+ "version": "2.0.0-alpha.11",
4
4
  "license": "MIT",
5
- "description": "Ellie Mae - Dim Sum - App Picker",
6
- "module": "esm/index.js",
7
- "main": "cjs/index.js",
5
+ "description": "ICE MT - Dimsum - App Picker",
6
+ "module": "./esm/index.js",
7
+ "main": "./cjs/index.js",
8
+ "types": "./types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./esm/index.js",
12
+ "require": "./cjs/index.js"
13
+ },
14
+ "./utils": {
15
+ "import": "./esm/utils.js",
16
+ "require": "./cjs/utils.js"
17
+ },
18
+ "./types/AppPickerTypes": {
19
+ "import": "./esm/types/AppPickerTypes.js",
20
+ "require": "./cjs/types/AppPickerTypes.js"
21
+ },
22
+ "./propTypes": {
23
+ "import": "./esm/propTypes.js",
24
+ "require": "./cjs/propTypes.js"
25
+ },
26
+ "./DSAppPicker": {
27
+ "import": "./esm/DSAppPicker.js",
28
+ "require": "./cjs/DSAppPicker.js"
29
+ },
30
+ "./AppPickerImpl": {
31
+ "import": "./esm/AppPickerImpl.js",
32
+ "require": "./cjs/AppPickerImpl.js"
33
+ }
34
+ },
8
35
  "sideEffects": [
9
36
  "*.css",
10
37
  "*.scss"
11
38
  ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
42
+ },
43
+ "engines": {
44
+ "npm": ">=7",
45
+ "node": ">=14"
46
+ },
47
+ "author": "ICE MT",
12
48
  "scripts": {
13
49
  "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
14
50
  "prebuild": "exit 0",
@@ -16,20 +52,20 @@
16
52
  "build": "node ../../scripts/build/build.js"
17
53
  },
18
54
  "dependencies": {
19
- "@elliemae/ds-button": "1.57.1",
20
- "@elliemae/ds-classnames": "1.57.1",
21
- "@elliemae/ds-icons": "1.57.1",
22
- "@elliemae/ds-popover": "1.57.1",
23
- "@elliemae/ds-utilities": "1.57.1",
24
- "react-desc": "^4.1.2"
55
+ "@elliemae/ds-button": "2.0.0-alpha.11",
56
+ "@elliemae/ds-classnames": "2.0.0-alpha.11",
57
+ "@elliemae/ds-icons": "2.0.0-alpha.11",
58
+ "@elliemae/ds-popover": "2.0.0-alpha.11",
59
+ "react-desc": "^4.1.3"
25
60
  },
26
61
  "peerDependencies": {
27
- "lodash": "^4.17.20",
28
- "react": "^17.0.1",
29
- "react-dom": "^17.0.1"
62
+ "lodash": "^4.17.21",
63
+ "react": "^17.0.2",
64
+ "react-dom": "^17.0.2"
30
65
  },
31
66
  "publishConfig": {
32
67
  "access": "public",
33
- "directory": "dist"
68
+ "directory": "dist",
69
+ "generateSubmodules": true
34
70
  }
35
71
  }
@@ -0,0 +1,3 @@
1
+ import { DSAppPickerImplType } from './types/AppPickerTypes';
2
+ declare const AppPickerImpl: DSAppPickerImplType;
3
+ export default AppPickerImpl;
@@ -0,0 +1,5 @@
1
+ import type { DSAppPickerType } from './types/AppPickerTypes';
2
+ declare const DSAppPicker: DSAppPickerType;
3
+ declare const AppPickerWithSchema: any;
4
+ export { DSAppPicker, AppPickerWithSchema };
5
+ export default DSAppPicker;
@@ -0,0 +1,2 @@
1
+ export * from './DSAppPicker';
2
+ export { default } from './DSAppPicker';
@@ -0,0 +1,14 @@
1
+ export declare const propTypes: {
2
+ apps: any;
3
+ customApps: any;
4
+ sectionTitle: any;
5
+ customSectionTitle: any;
6
+ icon: any;
7
+ renderTrigger: any;
8
+ actionRef: any;
9
+ isOpen: any;
10
+ onClose: any;
11
+ onKeyDown: any;
12
+ onClick: any;
13
+ onClickOutside: any;
14
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import type { SvgIconType } from '@elliemae/ds-icons';
3
+ export interface AppItemType {
4
+ label: string;
5
+ icon: React.Component;
6
+ onClick: () => void | null;
7
+ disabled?: boolean;
8
+ selected?: boolean;
9
+ }
10
+ export interface AppPickerPropsType {
11
+ apps: AppItemType[];
12
+ customApps: AppItemType[];
13
+ sectionTitle: string;
14
+ customSectionTitle: string;
15
+ icon: SvgIconType;
16
+ onKeyDown?: (e: KeyboardEvent) => void;
17
+ actionRef?: React.RefObject<{
18
+ focusToIndex: (index: number) => void;
19
+ }>;
20
+ onClick?: (e: MouseEvent) => void;
21
+ onClickOutside?: (e: MouseEvent) => void;
22
+ renderTrigger?: JSX.Element;
23
+ isOpen?: boolean;
24
+ onClose?: () => void;
25
+ }
26
+ export interface AppPickerImplProps {
27
+ apps: AppItemType[];
28
+ customApps: AppItemType[];
29
+ sectionTitle: string;
30
+ customSectionTitle: string;
31
+ close?: () => void;
32
+ onKeyDown: (e: KeyboardEvent) => void;
33
+ wrapperRef: React.RefObject<HTMLDivElement>;
34
+ triggerRef: React.RefObject<HTMLElement>;
35
+ }
36
+ export declare type DSAppPickerImplType = React.ComponentType<AppPickerImplProps>;
37
+ export declare type DSAppPickerType = React.ComponentType<AppPickerPropsType>;
@@ -0,0 +1,12 @@
1
+ export declare const keys: {
2
+ LEFT: string;
3
+ UP: string;
4
+ RIGHT: string;
5
+ DOWN: string;
6
+ ENTER: string;
7
+ SPACE: string;
8
+ TAB: string;
9
+ ESC: string;
10
+ HOME: string;
11
+ END: string;
12
+ };
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-app-picker/AppPickerImpl",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/AppPickerImpl.js",
9
- "module": "../esm/AppPickerImpl.js"
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@elliemae/ds-app-picker/DSAppPicker",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ],
7
- "private": true,
8
- "main": "../cjs/DSAppPicker.js",
9
- "module": "../esm/DSAppPicker.js"
10
- }