@elliemae/ds-app-picker 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AppPickerImpl.js +19 -8
- package/dist/cjs/AppPickerImpl.js.map +2 -2
- package/dist/cjs/DSAppPicker.js +6 -2
- package/dist/cjs/DSAppPicker.js.map +2 -2
- package/dist/cjs/hooks/useKeepTrackButtons.js +12 -3
- package/dist/cjs/hooks/useKeepTrackButtons.js.map +2 -2
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/propTypes.js +4 -0
- package/dist/cjs/propTypes.js.map +1 -1
- package/dist/cjs/styles.js +4 -0
- package/dist/cjs/styles.js.map +1 -1
- package/dist/cjs/types/AppPickerTypes.js +4 -0
- package/dist/cjs/types/AppPickerTypes.js.map +1 -1
- package/dist/cjs/utils.js +4 -0
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/AppPickerImpl.js +15 -8
- package/dist/esm/AppPickerImpl.js.map +2 -2
- package/dist/esm/DSAppPicker.js +2 -2
- package/dist/esm/DSAppPicker.js.map +2 -2
- package/dist/esm/hooks/useKeepTrackButtons.js +8 -3
- package/dist/esm/hooks/useKeepTrackButtons.js.map +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/styles.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/types/AppPickerImpl.d.ts +1 -1
- package/dist/types/DSAppPicker.d.ts +2 -2
- package/dist/types/hooks/useKeepTrackButtons.d.ts +9 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/tests/a11y/axe.test.d.ts +1 -0
- package/package.json +13 -11
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -31,9 +35,9 @@ var React = __toESM(require("react"));
|
|
|
31
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
36
|
var import_react = require("react");
|
|
33
37
|
var import_ds_chip = require("@elliemae/ds-chip");
|
|
34
|
-
var import_utils = require("./utils");
|
|
35
|
-
var import_styles = require("./styles");
|
|
36
|
-
var import_useKeepTrackButtons = require("./hooks/useKeepTrackButtons");
|
|
38
|
+
var import_utils = require("./utils.js");
|
|
39
|
+
var import_styles = require("./styles.js");
|
|
40
|
+
var import_useKeepTrackButtons = require("./hooks/useKeepTrackButtons.js");
|
|
37
41
|
const AppPickerImpl = ({
|
|
38
42
|
apps = [],
|
|
39
43
|
customApps = [],
|
|
@@ -48,7 +52,12 @@ const AppPickerImpl = ({
|
|
|
48
52
|
wasOpenedByKeyboardRef,
|
|
49
53
|
triggerIsInternal
|
|
50
54
|
}) => {
|
|
51
|
-
const { allFocusableButtons } = (0, import_useKeepTrackButtons.useKeepTrackButtons)(
|
|
55
|
+
const { allFocusableButtons } = (0, import_useKeepTrackButtons.useKeepTrackButtons)({
|
|
56
|
+
wrapperRef,
|
|
57
|
+
wasOpenedByKeyboardRef,
|
|
58
|
+
actionRef,
|
|
59
|
+
triggerIsInternal
|
|
60
|
+
});
|
|
52
61
|
const handleKeyDown = (0, import_react.useCallback)(
|
|
53
62
|
(e) => {
|
|
54
63
|
switch (e.key) {
|
|
@@ -95,7 +104,7 @@ const AppPickerImpl = ({
|
|
|
95
104
|
(appList, prevIndex, title) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: appList.map((app, index) => {
|
|
96
105
|
const { label, disabled, selected, icon: Icon, id } = app;
|
|
97
106
|
const IconComp = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "app-picker__icon", size: "m" });
|
|
98
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItem, { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
108
|
import_ds_chip.DSChip,
|
|
100
109
|
{
|
|
101
110
|
onClick: handleOnClick(app),
|
|
@@ -105,6 +114,7 @@ const AppPickerImpl = ({
|
|
|
105
114
|
disabled,
|
|
106
115
|
selected,
|
|
107
116
|
"aria-selected": selected,
|
|
117
|
+
role: "option",
|
|
108
118
|
id,
|
|
109
119
|
"aria-label": `${label}. ${title} (${index + prevIndex} of ${totalAppsLength})`,
|
|
110
120
|
icon: IconComp,
|
|
@@ -143,6 +153,7 @@ const AppPickerImpl = ({
|
|
|
143
153
|
import_styles.StyledWrapper,
|
|
144
154
|
{
|
|
145
155
|
forwardedAs: "ul",
|
|
156
|
+
role: "listbox",
|
|
146
157
|
ref: convertedTypeReference,
|
|
147
158
|
onKeyDown: handleOnKeyDownWrapper,
|
|
148
159
|
"data-testid": "app-picker__wrapper",
|
|
@@ -152,11 +163,11 @@ const AppPickerImpl = ({
|
|
|
152
163
|
tabIndex: -1,
|
|
153
164
|
"aria-label": `Application picker, ${sectionTitle} (${apps.length} apps)${customApps.length > 0 ? `, ${customSectionTitle} (${customApps.length} apps)` : ""}`,
|
|
154
165
|
children: [
|
|
155
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTitle, { "data-testid": "app-picker__main-title", children: sectionTitle }) }),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTitle, { "data-testid": "app-picker__main-title", role: "presentation", children: sectionTitle }) }),
|
|
156
167
|
AppsRows,
|
|
157
168
|
customApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledSeparator, {}) }),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTitle, { "data-testid": "app-picker__custom-title", children: customSectionTitle }) }),
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledSeparator, { role: "presentation" }) }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTitle, { "data-testid": "app-picker__custom-title", role: "presentation", children: customSectionTitle }) }),
|
|
160
171
|
CustomRows
|
|
161
172
|
] })
|
|
162
173
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/AppPickerImpl.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\nimport React, { useCallback, useMemo } from 'react';\nimport { DSChip } from '@elliemae/ds-chip';\nimport { keys } from './utils';\nimport type { AppItemType, DSAppPickerImplType } from './types/AppPickerTypes';\nimport { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from './styles';\nimport { useKeepTrackButtons } from './hooks/useKeepTrackButtons';\n\nconst AppPickerImpl: DSAppPickerImplType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n close = () => null,\n wrapperRef,\n onKeyDown,\n triggerRef,\n isOverflow,\n actionRef,\n wasOpenedByKeyboardRef,\n triggerIsInternal,\n}) => {\n const { allFocusableButtons } = useKeepTrackButtons(wrapperRef
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\nimport React, { useCallback, useMemo } from 'react';\nimport { DSChip } from '@elliemae/ds-chip';\nimport { keys } from './utils.js';\nimport type { AppItemType, DSAppPickerImplType } from './types/AppPickerTypes.js';\nimport { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from './styles.js';\nimport { useKeepTrackButtons } from './hooks/useKeepTrackButtons.js';\n\nconst AppPickerImpl: DSAppPickerImplType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n close = () => null,\n wrapperRef,\n onKeyDown,\n triggerRef,\n isOverflow,\n actionRef,\n wasOpenedByKeyboardRef,\n triggerIsInternal,\n}) => {\n const { allFocusableButtons } = useKeepTrackButtons({\n wrapperRef,\n wasOpenedByKeyboardRef,\n actionRef,\n triggerIsInternal,\n });\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n switch (e.key) {\n case keys.ESC:\n triggerRef?.current?.focus();\n close();\n break;\n case keys.TAB:\n if (e.shiftKey) {\n if (e.target === allFocusableButtons.current[0]) {\n e.preventDefault();\n allFocusableButtons?.current[allFocusableButtons.current.length - 1]?.focus();\n }\n } else if (e.target === allFocusableButtons.current[allFocusableButtons.current.length - 1]) {\n e.preventDefault();\n allFocusableButtons?.current[0]?.focus();\n }\n break;\n default:\n break;\n }\n },\n [allFocusableButtons, close, triggerRef],\n );\n\n const handleOnClick = useCallback(\n (app: AppItemType) => (e: React.MouseEvent) => {\n if (app.onClick) app.onClick(e, app);\n },\n [],\n );\n\n const handleOnKeyDownWrapper = useCallback(\n (e: React.KeyboardEvent) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const totalAppsLength = useMemo(() => apps.length + customApps.length, [apps.length, customApps.length]);\n\n const buildRows = useCallback(\n (appList: AppItemType[], prevIndex: number, title: string): JSX.Element => (\n <>\n {appList.map((app, index) => {\n const { label, disabled, selected, icon: Icon, id } = app;\n\n // eslint-disable-next-line react/no-unstable-nested-components\n const IconComp = () => <Icon className=\"app-picker__icon\" size=\"m\" />;\n\n return (\n <StyledListItem role=\"presentation\">\n <DSChip\n key={index}\n onClick={handleOnClick(app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n selected={selected}\n aria-selected={selected}\n role=\"option\"\n id={id}\n aria-label={`${label}. ${title} (${index + prevIndex} of ${totalAppsLength})`}\n icon={IconComp}\n label={label}\n />\n </StyledListItem>\n );\n })}\n </>\n ),\n [handleKeyDown, handleOnClick, totalAppsLength],\n );\n\n const AppsRows = useMemo(() => buildRows(apps, 1, sectionTitle), [apps, buildRows, sectionTitle]);\n const CustomRows = useMemo(\n () => buildRows(customApps, apps.length, customSectionTitle),\n [apps.length, buildRows, customApps, customSectionTitle],\n );\n\n const layout = useMemo(() => {\n const cols = ['repeat(3, 92px)'];\n let appsRows = 0;\n let customRows = 0;\n const rows = [];\n if (apps.length > 0) {\n appsRows = apps.length / 3;\n rows.push('68px', `repeat(${appsRows}, 68px})`);\n }\n if (customApps.length > 0) {\n customRows = customApps.length / 3;\n rows.push('9px', '68px', `repeat(${customRows}, 68px})`);\n }\n return {\n rows,\n cols,\n };\n }, [apps.length, customApps.length]);\n\n // Needed just for typescript reasons\n const convertedTypeReference = wrapperRef as unknown as React.RefObject<HTMLDivElement> &\n React.RefObject<HTMLUListElement>;\n\n return (\n <StyledWrapper\n forwardedAs=\"ul\"\n role=\"listbox\"\n ref={convertedTypeReference}\n onKeyDown={handleOnKeyDownWrapper}\n data-testid=\"app-picker__wrapper\"\n isOverflow={isOverflow}\n cols={layout.cols}\n rows={layout.rows}\n tabIndex={-1}\n aria-label={`Application picker, ${sectionTitle} (${apps.length} apps)${\n customApps.length > 0 ? `, ${customSectionTitle} (${customApps.length} apps)` : ''\n }`}\n >\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledTitle data-testid=\"app-picker__main-title\" role=\"presentation\">\n {sectionTitle}\n </StyledTitle>\n </StyledListItemFullRow>\n {AppsRows}\n {customApps.length > 0 && (\n <>\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledSeparator role=\"presentation\" />\n </StyledListItemFullRow>\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledTitle data-testid=\"app-picker__custom-title\" role=\"presentation\">\n {customSectionTitle}\n </StyledTitle>\n </StyledListItemFullRow>\n {CustomRows}\n </>\n )}\n </StyledWrapper>\n );\n};\n\nexport default AppPickerImpl;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8EjB;AA3EN,mBAA4C;AAC5C,qBAAuB;AACvB,mBAAqB;AAErB,oBAAmG;AACnG,iCAAoC;AAEpC,MAAM,gBAAqC,CAAC;AAAA,EAC1C,OAAO,CAAC;AAAA,EACR,aAA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AAoB;AAAA,IACzD;AACA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,KAAK,QAAQ,WAAW,MAAM,CAAC;AAGnC,QAAM,yBAAyB;AAG/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAY;AAAA,MACZ,MAAK;AAAA,MACL,KAAK;AAAA,MACL,WAAW;AAAA,MACX,eAAY;AAAA,MACZ;AAAA,MACA,MAAM,OAAO;AAAA,MACb,MAAM,OAAO;AAAA,MACb,UAAU;AAAA,MACV,cAAY,uBAAuB,iBAAiB,KAAK,eACvD,WAAW,SAAS,IAAI,KAAK,uBAAuB,WAAW,iBAAiB;AAAA,MAGlF;AAAA,oDAAC,uCAAsB,eAAW,MAAC,MAAK,SACtC,sDAAC,6BAAY,eAAY,0BAAyB,MAAK,gBACpD,wBACH,GACF;AAAA,QACC;AAAA,QACA,WAAW,SAAS,KACnB,4EACE;AAAA,sDAAC,uCAAsB,eAAW,MAAC,MAAK,SACtC,sDAAC,iCAAgB,MAAK,gBAAe,GACvC;AAAA,UACA,4CAAC,uCAAsB,eAAW,MAAC,MAAK,SACtC,sDAAC,6BAAY,eAAY,4BAA2B,MAAK,gBACtD,8BACH,GACF;AAAA,UACC;AAAA,WACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/DSAppPicker.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -37,8 +41,8 @@ var import_ds_button = require("@elliemae/ds-button");
|
|
|
37
41
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
42
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
43
|
var import_ds_popover = __toESM(require("@elliemae/ds-popover"));
|
|
40
|
-
var import_AppPickerImpl = __toESM(require("./AppPickerImpl"));
|
|
41
|
-
var import_propTypes = require("./propTypes");
|
|
44
|
+
var import_AppPickerImpl = __toESM(require("./AppPickerImpl.js"));
|
|
45
|
+
var import_propTypes = require("./propTypes.js");
|
|
42
46
|
const DSAppPicker = ({
|
|
43
47
|
apps = [],
|
|
44
48
|
customApps = [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSAppPicker.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport DSPopover from '@elliemae/ds-popover';\nimport AppPickerImpl from './AppPickerImpl';\nimport { propTypes } from './propTypes';\nimport type { DSAppPickerType } from './types/AppPickerTypes';\n\nconst DSAppPicker: DSAppPickerType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n icon: Icon = () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n renderTrigger,\n isOpen,\n onClose = () => null,\n actionRef,\n onKeyDown,\n onClick = () => null,\n onClickOutside = () => null,\n triggerRef,\n}) => {\n const [open, setOpen] = useState(false);\n const [isOverflow, setIsOverflow] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const defaultTriggerRef = useRef(null);\n const wasOpenedByKeyboardRef = useRef(false);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToIndex = (index: number) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n actionRef.current.focusWrapper = () => {\n wrapperRef.current?.focus();\n };\n }\n }, [actionRef, apps, customApps]);\n\n useEffect(() => {\n setTimeout(() => {\n if (wrapperRef.current) {\n const { scrollHeight, clientHeight } = wrapperRef.current;\n if (scrollHeight > clientHeight) return setIsOverflow(true);\n }\n return setIsOverflow(false);\n });\n }, [isOpen, open]);\n\n const handleOnClose = useCallback(() => {\n setOpen(false);\n onClose();\n }, [onClose]);\n\n const handleOnClickOutside = (e: React.MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = useCallback(\n () => (\n <AppPickerImpl\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n close={handleOnClose}\n wrapperRef={wrapperRef}\n onKeyDown={onKeyDown}\n triggerRef={triggerRef || defaultTriggerRef}\n actionRef={actionRef}\n triggerIsInternal={!renderTrigger}\n wasOpenedByKeyboardRef={wasOpenedByKeyboardRef}\n isOverflow={isOverflow}\n />\n ),\n [\n actionRef,\n apps,\n customApps,\n customSectionTitle,\n handleOnClose,\n isOverflow,\n onKeyDown,\n renderTrigger,\n sectionTitle,\n triggerRef,\n ],\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }: { ref: React.RefObject<HTMLButtonElement> }) => (\n <DSButtonV2\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"icon\"\n aria-haspopup=\"true\"\n aria-expanded={isOpen ?? open}\n aria-label=\"Application picker\"\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e: React.MouseEvent | React.KeyboardEvent) => {\n wasOpenedByKeyboardRef.current = e.detail === 0;\n onClick(e);\n setOpen(true);\n }}\n >\n <Icon />\n </DSButtonV2>\n ));\n\n return (\n <DSPopover\n content={<AppPickerContent />}\n isOpen={typeof isOpen === 'boolean' ? isOpen : open}\n onClickOutside={handleOnClickOutside}\n placement=\"bottom\"\n interactionType=\"click\"\n renderTrigger={RenderTrigger}\n showArrow\n style={{\n padding: '0',\n maxWidth: '1000px',\n width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.displayName = 'DSAppPicker';\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport DSPopover from '@elliemae/ds-popover';\nimport AppPickerImpl from './AppPickerImpl.js';\nimport { propTypes } from './propTypes.js';\nimport type { DSAppPickerType } from './types/AppPickerTypes.js';\n\nconst DSAppPicker: DSAppPickerType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n icon: Icon = () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n renderTrigger,\n isOpen,\n onClose = () => null,\n actionRef,\n onKeyDown,\n onClick = () => null,\n onClickOutside = () => null,\n triggerRef,\n}) => {\n const [open, setOpen] = useState(false);\n const [isOverflow, setIsOverflow] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const defaultTriggerRef = useRef(null);\n const wasOpenedByKeyboardRef = useRef(false);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToIndex = (index: number) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n actionRef.current.focusWrapper = () => {\n wrapperRef.current?.focus();\n };\n }\n }, [actionRef, apps, customApps]);\n\n useEffect(() => {\n setTimeout(() => {\n if (wrapperRef.current) {\n const { scrollHeight, clientHeight } = wrapperRef.current;\n if (scrollHeight > clientHeight) return setIsOverflow(true);\n }\n return setIsOverflow(false);\n });\n }, [isOpen, open]);\n\n const handleOnClose = useCallback(() => {\n setOpen(false);\n onClose();\n }, [onClose]);\n\n const handleOnClickOutside = (e: React.MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = useCallback(\n () => (\n <AppPickerImpl\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n close={handleOnClose}\n wrapperRef={wrapperRef}\n onKeyDown={onKeyDown}\n triggerRef={triggerRef || defaultTriggerRef}\n actionRef={actionRef}\n triggerIsInternal={!renderTrigger}\n wasOpenedByKeyboardRef={wasOpenedByKeyboardRef}\n isOverflow={isOverflow}\n />\n ),\n [\n actionRef,\n apps,\n customApps,\n customSectionTitle,\n handleOnClose,\n isOverflow,\n onKeyDown,\n renderTrigger,\n sectionTitle,\n triggerRef,\n ],\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }: { ref: React.RefObject<HTMLButtonElement> }) => (\n <DSButtonV2\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"icon\"\n aria-haspopup=\"true\"\n aria-expanded={isOpen ?? open}\n aria-label=\"Application picker\"\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e: React.MouseEvent | React.KeyboardEvent) => {\n wasOpenedByKeyboardRef.current = e.detail === 0;\n onClick(e);\n setOpen(true);\n }}\n >\n <Icon />\n </DSButtonV2>\n ));\n\n return (\n <DSPopover\n content={<AppPickerContent />}\n isOpen={typeof isOpen === 'boolean' ? isOpen : open}\n onClickOutside={handleOnClickOutside}\n placement=\"bottom\"\n interactionType=\"click\"\n renderTrigger={RenderTrigger}\n showArrow\n style={{\n padding: '0',\n maxWidth: '1000px',\n width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.displayName = 'DSAppPicker';\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgBF;AAfrB,mBAAgE;AAChE,sBAA2B;AAC3B,uBAA2B;AAC3B,0BAA0B;AAC1B,8BAAyB;AACzB,wBAAsB;AACtB,2BAA0B;AAC1B,uBAA0B;AAG1B,MAAM,cAA+B,CAAC;AAAA,EACpC,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,MAAM,OAAO,MAAM,4CAAC,8BAAW,OAAO,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,EACzE;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB,iBAAiB,MAAM;AAAA,EACvB;AACF,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AACtC,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,KAAK;AAClD,QAAM,iBAAa,qBAAuB,IAAI;AAC9C,QAAM,wBAAoB,qBAAO,IAAI;AACrC,QAAM,6BAAyB,qBAAO,KAAK;AAE3C,8BAAU,MAAM;AACd,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,eAAe,CAAC,UAAkB;AA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MACH,YAAW;AAAA,MACX,iBAAc;AAAA,MACd,iBAAe,UAAU;AAAA,MACzB,cAAW;AAAA,MACX,cAAU,+BAAU,KAAK,iBAAiB;AAAA,MAC1C,SAAS,CAAC,MAA8C;AACtD,+BAAuB,UAAU,EAAE,WAAW;AAC9C,gBAAQ,CAAC;AACT,gBAAQ,IAAI;AAAA,MACd;AAAA,MAEA,sDAAC,QAAK;AAAA;AAAA,EACR;AAGJ,SACE;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACC,SAAS,4CAAC,oBAAiB;AAAA,MAC3B,QAAQ,OAAO,WAAW,YAAY,SAAS;AAAA,MAC/C,gBAAgB;AAAA,MAChB,WAAU;AAAA,MACV,iBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,WAAS;AAAA,MACT,OAAO;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,OAAO;AAAA,MACT;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,0BAAsB,kCAAS,WAAW;AAChD,oBAAoB,YAAY;AAGhC,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["AppPickerImpl", "DSPopover"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -29,8 +33,13 @@ __export(useKeepTrackButtons_exports, {
|
|
|
29
33
|
module.exports = __toCommonJS(useKeepTrackButtons_exports);
|
|
30
34
|
var React = __toESM(require("react"));
|
|
31
35
|
var import_react = require("react");
|
|
32
|
-
var import_utils = require("../utils");
|
|
33
|
-
const useKeepTrackButtons = (
|
|
36
|
+
var import_utils = require("../utils.js");
|
|
37
|
+
const useKeepTrackButtons = ({
|
|
38
|
+
wrapperRef,
|
|
39
|
+
wasOpenedByKeyboardRef,
|
|
40
|
+
actionRef,
|
|
41
|
+
triggerIsInternal
|
|
42
|
+
}) => {
|
|
34
43
|
const allFocusableButtons = (0, import_react.useRef)([]);
|
|
35
44
|
const selectedButton = (0, import_react.useRef)(null);
|
|
36
45
|
(0, import_react.useEffect)(() => {
|
|
@@ -44,7 +53,7 @@ const useKeepTrackButtons = (wrapperRef, wasOpenedByKeyboardRef, actionRef, trig
|
|
|
44
53
|
if (!e.hasAttribute("disabled")) {
|
|
45
54
|
allFocusableButtons?.current?.push(e);
|
|
46
55
|
}
|
|
47
|
-
if (e.getAttribute("aria-
|
|
56
|
+
if (e.getAttribute("aria-current") === "true") {
|
|
48
57
|
selectedButton.current = index;
|
|
49
58
|
}
|
|
50
59
|
if (wasOpenedByKeyboardRef.current || !triggerIsInternal) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useKeepTrackButtons.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport { useEffect, useRef } from 'react';\nimport { focusSelectedOrFirstAvailable } from '../utils';\nimport type { ActionRef } from '../types/AppPickerTypes';\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { useEffect, useRef } from 'react';\nimport { focusSelectedOrFirstAvailable } from '../utils.js';\nimport type { ActionRef } from '../types/AppPickerTypes.js';\n\ninterface UseKeepTrackButtonsT {\n wrapperRef: React.RefObject<HTMLDivElement>;\n wasOpenedByKeyboardRef: React.MutableRefObject<boolean>;\n actionRef?: ActionRef;\n triggerIsInternal?: boolean;\n}\n\nexport const useKeepTrackButtons = ({\n wrapperRef,\n wasOpenedByKeyboardRef,\n actionRef,\n triggerIsInternal,\n}: UseKeepTrackButtonsT) => {\n const allFocusableButtons = useRef<HTMLButtonElement[]>([]);\n const selectedButton = useRef<number | null>(null);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusSelectedOrFirstAvailable = () =>\n setTimeout(() => focusSelectedOrFirstAvailable(wrapperRef, allFocusableButtons, selectedButton));\n }\n }, [actionRef, wrapperRef]);\n\n useEffect(() => {\n setTimeout(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-current') === 'true') {\n selectedButton.current = index;\n }\n if (wasOpenedByKeyboardRef.current || !triggerIsInternal) {\n focusSelectedOrFirstAvailable(wrapperRef, allFocusableButtons, selectedButton);\n } else {\n wrapperRef.current?.focus();\n }\n });\n });\n }, [wasOpenedByKeyboardRef, wrapperRef, triggerIsInternal]);\n\n return { allFocusableButtons, selectedButton };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkC;AAClC,mBAA8C;AAUvC,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,QAAM,0BAAsB,qBAA4B,CAAC,CAAC;AAC1D,QAAM,qBAAiB,qBAAsB,IAAI;AAEjD,8BAAU,MAAM;AACd,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,gCAAgC,MAChD,WAAW,UAAM,4CAA8B,YAAY,qBAAqB,cAAc,CAAC;AAAA,IACnG;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAE1B,8BAAU,MAAM;AACd,eAAW,MAAM;AACf,kBAAY,SAAS,iBAAiB,QAAQ,EAAE,QAAQ,CAAC,GAAG,UAAU;AACpE,YAAI,CAAC,EAAE,aAAa,UAAU,GAAG;AAC/B,+BAAqB,SAAS,KAAK,CAAC;AAAA,QACtC;AACA,YAAI,EAAE,aAAa,cAAc,MAAM,QAAQ;AAC7C,yBAAe,UAAU;AAAA,QAC3B;AACA,YAAI,uBAAuB,WAAW,CAAC,mBAAmB;AACxD,0DAA8B,YAAY,qBAAqB,cAAc;AAAA,QAC/E,OAAO;AACL,qBAAW,SAAS,MAAM;AAAA,QAC5B;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,GAAG,CAAC,wBAAwB,YAAY,iBAAiB,CAAC;AAE1D,SAAO,EAAE,qBAAqB,eAAe;AAC/C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -19,6 +19,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
};
|
|
20
20
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
26
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
27
|
mod
|
|
24
28
|
));
|
|
@@ -29,6 +33,6 @@ __export(src_exports, {
|
|
|
29
33
|
});
|
|
30
34
|
module.exports = __toCommonJS(src_exports);
|
|
31
35
|
var React = __toESM(require("react"));
|
|
32
|
-
__reExport(src_exports, require("./DSAppPicker"), module.exports);
|
|
33
|
-
var import_DSAppPicker = __toESM(require("./DSAppPicker"));
|
|
36
|
+
__reExport(src_exports, require("./DSAppPicker.js"), module.exports);
|
|
37
|
+
var import_DSAppPicker = __toESM(require("./DSAppPicker.js"));
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './DSAppPicker';\n\nexport { default } from './DSAppPicker';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './DSAppPicker.js';\n\nexport { default } from './DSAppPicker.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,6BAAd;AAEA,yBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/propTypes.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { MenuPicker } from '@elliemae/ds-icons';\n\nexport const propTypes = {\n apps: PropTypes.array.description(\n 'Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]',\n ).isRequired,\n customApps: PropTypes.array.description(\n 'Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]',\n ),\n sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),\n customSectionTitle: PropTypes.string.description('custom section title').defaultValue('CUSTOM APPLICATIONS'),\n icon: PropTypes.func.description('trigger button s icon').defaultValue(MenuPicker),\n renderTrigger: PropTypes.func.description('Custom trigger component.'),\n actionRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker.',\n ),\n isOpen: PropTypes.bool.description('Wether the AppPicker should be open or not.'),\n onClose: PropTypes.func.description('Callback function when the AppPicker closes'),\n onKeyDown: PropTypes.func.description('OnKeyDown handler callback.'),\n onClick: PropTypes.func.description('Custom onClick for Trigger component.'),\n onClickOutside: PropTypes.func.description('Callback event when the user clicks outside the App Picker.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0B;AAC1B,sBAA2B;AAEpB,MAAM,YAAY;AAAA,EACvB,MAAM,kCAAU,MAAM;AAAA,IACpB;AAAA,EACF,EAAE;AAAA,EACF,YAAY,kCAAU,MAAM;AAAA,IAC1B;AAAA,EACF;AAAA,EACA,cAAc,kCAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,cAAc;AAAA,EAC5F,oBAAoB,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,qBAAqB;AAAA,EAC3G,MAAM,kCAAU,KAAK,YAAY,uBAAuB,EAAE,aAAa,0BAAU;AAAA,EACjF,eAAe,kCAAU,KAAK,YAAY,2BAA2B;AAAA,EACrE,WAAW,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC5F;AAAA,EACF;AAAA,EACA,QAAQ,kCAAU,KAAK,YAAY,6CAA6C;AAAA,EAChF,SAAS,kCAAU,KAAK,YAAY,6CAA6C;AAAA,EACjF,WAAW,kCAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,SAAS,kCAAU,KAAK,YAAY,uCAAuC;AAAA,EAC3E,gBAAgB,kCAAU,KAAK,YAAY,6DAA6D;AAC1G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const StyledWrapper = styled(Grid, { name: 'DSAppPicker', slot: 'root' })<{ isOverflow: boolean }>`\n align-items: center;\n min-width: 308px;\n min-height: 110px;\n max-height: 449px;\n width: 308px;\n overflow-y: auto;\n overflow-x: hidden;\n margin: 0;\n padding: ${({ isOverflow }) => (isOverflow ? '0 0 8px 16px' : '0 16px 8px 16px')};\n &:focus {\n outline: none;\n }\n`;\n\nexport const StyledListItem = styled.li`\n list-style: none;\n`;\n\nexport const StyledListItemFullRow = styled.li`\n list-style: none;\n grid-column: 1/4;\n`;\n\nexport const StyledTitle = styled('h3', { name: 'DSAppPicker', slot: 'title' })`\n color: ${({ theme }) => theme.colors.neutral[700]};\n font-size: ${({ theme }) => theme.fontSizes.value[400]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n margin: 12px 0 8px 0;\n line-height: 1.385;\n text-transform: uppercase;\n`;\n\nexport const StyledSeparator = styled('hr', { name: 'DSAppPicker', slot: 'separator' })`\n border-top: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n border-bottom: none;\n width: 99%;\n margin: 8px 0 0 0;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAAuB;AACvB,qBAAqB;AAEd,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,eAAe,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aASlE,CAAC,EAAE,WAAW,MAAO,aAAa,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAMzD,MAAM,iBAAiB,wBAAO;AAAA;AAAA;AAI9B,MAAM,wBAAwB,wBAAO;AAAA;AAAA;AAAA;AAKrC,MAAM,kBAAc,yBAAO,MAAM,EAAE,MAAM,eAAe,MAAM,QAAQ,CAAC;AAAA,WACnE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,eACnC,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA,iBACtC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,sBAAkB,yBAAO,MAAM,EAAE,MAAM,eAAe,MAAM,YAAY,CAAC;AAAA,0BAC5D,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/AppPickerTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { SvgIconType } from '@elliemae/ds-icons';\nimport type React from 'react';\n\nexport interface AppItemType {\n label: string;\n icon: React.ComponentType<{ className: string; size: string }>;\n onClick?: (e: React.MouseEvent, item: AppItemType) => void | null;\n disabled?: boolean;\n id?: string;\n selected?: boolean;\n}\n\nexport type ActionRef = React.MutableRefObject<{\n focusToIndex?: (index: number) => void;\n focusSelectedOrFirstAvailable?: () => void;\n focusWrapper: () => void;\n}>;\n\nexport interface AppPickerPropsType {\n apps: AppItemType[];\n customApps: AppItemType[];\n sectionTitle: string;\n customSectionTitle: string;\n icon: SvgIconType;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n actionRef?: ActionRef;\n onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;\n onClickOutside?: (e: React.MouseEvent) => void;\n renderTrigger?: React.ComponentType<unknown>;\n isOpen?: boolean;\n onClose?: () => void;\n triggerRef?: React.RefObject<HTMLButtonElement>;\n}\n\nexport interface AppPickerImplProps {\n apps: AppItemType[];\n customApps: AppItemType[];\n sectionTitle: string;\n customSectionTitle: string;\n close?: () => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n wrapperRef: React.RefObject<HTMLDivElement>;\n triggerRef: React.RefObject<HTMLElement>;\n actionRef?: ActionRef;\n isOverflow: boolean;\n triggerIsInternal: boolean;\n wasOpenedByKeyboardRef: React.MutableRefObject<boolean>;\n}\n\nexport type DSAppPickerImplType = React.ComponentType<AppPickerImplProps>;\nexport type DSAppPickerType = React.ComponentType<AppPickerPropsType>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type React from 'react';\n\nexport const keys = {\n LEFT: 'ArrowLeft',\n UP: 'ArrowUp',\n RIGHT: 'ArrowRight',\n DOWN: 'ArrowDown',\n ENTER: 'Enter',\n SPACE: '',\n TAB: 'Tab',\n ESC: 'Escape',\n HOME: 'Home',\n END: 'End',\n};\n\nexport const focusSelectedOrFirstAvailable = (\n wrapperRef: React.RefObject<HTMLDivElement>,\n allFocusableButtonsRef: React.MutableRefObject<HTMLButtonElement[]>,\n selectedButtonRef: React.MutableRefObject<number | null>,\n) => {\n if (selectedButtonRef.current !== null) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButtonRef.current].focus();\n } else {\n allFocusableButtonsRef?.current[0]?.focus();\n }\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AACP;AAEO,MAAM,gCAAgC,CAC3C,YACA,wBACA,sBACG;AACH,MAAI,kBAAkB,YAAY,MAAM;AACtC,gBAAY,SAAS,iBAAiB,QAAQ,EAAE,kBAAkB,OAAO,EAAE,MAAM;AAAA,EACnF,OAAO;AACL,4BAAwB,QAAQ,CAAC,GAAG,MAAM;AAAA,EAC5C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,9 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { DSChip } from "@elliemae/ds-chip";
|
|
5
|
-
import { keys } from "./utils";
|
|
6
|
-
import { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from "./styles";
|
|
7
|
-
import { useKeepTrackButtons } from "./hooks/useKeepTrackButtons";
|
|
5
|
+
import { keys } from "./utils.js";
|
|
6
|
+
import { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from "./styles.js";
|
|
7
|
+
import { useKeepTrackButtons } from "./hooks/useKeepTrackButtons.js";
|
|
8
8
|
const AppPickerImpl = ({
|
|
9
9
|
apps = [],
|
|
10
10
|
customApps = [],
|
|
@@ -19,7 +19,12 @@ const AppPickerImpl = ({
|
|
|
19
19
|
wasOpenedByKeyboardRef,
|
|
20
20
|
triggerIsInternal
|
|
21
21
|
}) => {
|
|
22
|
-
const { allFocusableButtons } = useKeepTrackButtons(
|
|
22
|
+
const { allFocusableButtons } = useKeepTrackButtons({
|
|
23
|
+
wrapperRef,
|
|
24
|
+
wasOpenedByKeyboardRef,
|
|
25
|
+
actionRef,
|
|
26
|
+
triggerIsInternal
|
|
27
|
+
});
|
|
23
28
|
const handleKeyDown = useCallback(
|
|
24
29
|
(e) => {
|
|
25
30
|
switch (e.key) {
|
|
@@ -66,7 +71,7 @@ const AppPickerImpl = ({
|
|
|
66
71
|
(appList, prevIndex, title) => /* @__PURE__ */ jsx(Fragment, { children: appList.map((app, index) => {
|
|
67
72
|
const { label, disabled, selected, icon: Icon, id } = app;
|
|
68
73
|
const IconComp = () => /* @__PURE__ */ jsx(Icon, { className: "app-picker__icon", size: "m" });
|
|
69
|
-
return /* @__PURE__ */ jsx(StyledListItem, { children: /* @__PURE__ */ jsx(
|
|
74
|
+
return /* @__PURE__ */ jsx(StyledListItem, { role: "presentation", children: /* @__PURE__ */ jsx(
|
|
70
75
|
DSChip,
|
|
71
76
|
{
|
|
72
77
|
onClick: handleOnClick(app),
|
|
@@ -76,6 +81,7 @@ const AppPickerImpl = ({
|
|
|
76
81
|
disabled,
|
|
77
82
|
selected,
|
|
78
83
|
"aria-selected": selected,
|
|
84
|
+
role: "option",
|
|
79
85
|
id,
|
|
80
86
|
"aria-label": `${label}. ${title} (${index + prevIndex} of ${totalAppsLength})`,
|
|
81
87
|
icon: IconComp,
|
|
@@ -114,6 +120,7 @@ const AppPickerImpl = ({
|
|
|
114
120
|
StyledWrapper,
|
|
115
121
|
{
|
|
116
122
|
forwardedAs: "ul",
|
|
123
|
+
role: "listbox",
|
|
117
124
|
ref: convertedTypeReference,
|
|
118
125
|
onKeyDown: handleOnKeyDownWrapper,
|
|
119
126
|
"data-testid": "app-picker__wrapper",
|
|
@@ -123,11 +130,11 @@ const AppPickerImpl = ({
|
|
|
123
130
|
tabIndex: -1,
|
|
124
131
|
"aria-label": `Application picker, ${sectionTitle} (${apps.length} apps)${customApps.length > 0 ? `, ${customSectionTitle} (${customApps.length} apps)` : ""}`,
|
|
125
132
|
children: [
|
|
126
|
-
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ jsx(StyledTitle, { "data-testid": "app-picker__main-title", children: sectionTitle }) }),
|
|
133
|
+
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ jsx(StyledTitle, { "data-testid": "app-picker__main-title", role: "presentation", children: sectionTitle }) }),
|
|
127
134
|
AppsRows,
|
|
128
135
|
customApps.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
-
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ jsx(StyledSeparator, {}) }),
|
|
130
|
-
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, children: /* @__PURE__ */ jsx(StyledTitle, { "data-testid": "app-picker__custom-title", children: customSectionTitle }) }),
|
|
136
|
+
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ jsx(StyledSeparator, { role: "presentation" }) }),
|
|
137
|
+
/* @__PURE__ */ jsx(StyledListItemFullRow, { "aria-hidden": true, role: "group", children: /* @__PURE__ */ jsx(StyledTitle, { "data-testid": "app-picker__custom-title", role: "presentation", children: customSectionTitle }) }),
|
|
131
138
|
CustomRows
|
|
132
139
|
] })
|
|
133
140
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/AppPickerImpl.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\nimport React, { useCallback, useMemo } from 'react';\nimport { DSChip } from '@elliemae/ds-chip';\nimport { keys } from './utils';\nimport type { AppItemType, DSAppPickerImplType } from './types/AppPickerTypes';\nimport { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from './styles';\nimport { useKeepTrackButtons } from './hooks/useKeepTrackButtons';\n\nconst AppPickerImpl: DSAppPickerImplType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n close = () => null,\n wrapperRef,\n onKeyDown,\n triggerRef,\n isOverflow,\n actionRef,\n wasOpenedByKeyboardRef,\n triggerIsInternal,\n}) => {\n const { allFocusableButtons } = useKeepTrackButtons(wrapperRef
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\nimport React, { useCallback, useMemo } from 'react';\nimport { DSChip } from '@elliemae/ds-chip';\nimport { keys } from './utils.js';\nimport type { AppItemType, DSAppPickerImplType } from './types/AppPickerTypes.js';\nimport { StyledWrapper, StyledSeparator, StyledListItemFullRow, StyledListItem, StyledTitle } from './styles.js';\nimport { useKeepTrackButtons } from './hooks/useKeepTrackButtons.js';\n\nconst AppPickerImpl: DSAppPickerImplType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n close = () => null,\n wrapperRef,\n onKeyDown,\n triggerRef,\n isOverflow,\n actionRef,\n wasOpenedByKeyboardRef,\n triggerIsInternal,\n}) => {\n const { allFocusableButtons } = useKeepTrackButtons({\n wrapperRef,\n wasOpenedByKeyboardRef,\n actionRef,\n triggerIsInternal,\n });\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n switch (e.key) {\n case keys.ESC:\n triggerRef?.current?.focus();\n close();\n break;\n case keys.TAB:\n if (e.shiftKey) {\n if (e.target === allFocusableButtons.current[0]) {\n e.preventDefault();\n allFocusableButtons?.current[allFocusableButtons.current.length - 1]?.focus();\n }\n } else if (e.target === allFocusableButtons.current[allFocusableButtons.current.length - 1]) {\n e.preventDefault();\n allFocusableButtons?.current[0]?.focus();\n }\n break;\n default:\n break;\n }\n },\n [allFocusableButtons, close, triggerRef],\n );\n\n const handleOnClick = useCallback(\n (app: AppItemType) => (e: React.MouseEvent) => {\n if (app.onClick) app.onClick(e, app);\n },\n [],\n );\n\n const handleOnKeyDownWrapper = useCallback(\n (e: React.KeyboardEvent) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const totalAppsLength = useMemo(() => apps.length + customApps.length, [apps.length, customApps.length]);\n\n const buildRows = useCallback(\n (appList: AppItemType[], prevIndex: number, title: string): JSX.Element => (\n <>\n {appList.map((app, index) => {\n const { label, disabled, selected, icon: Icon, id } = app;\n\n // eslint-disable-next-line react/no-unstable-nested-components\n const IconComp = () => <Icon className=\"app-picker__icon\" size=\"m\" />;\n\n return (\n <StyledListItem role=\"presentation\">\n <DSChip\n key={index}\n onClick={handleOnClick(app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n selected={selected}\n aria-selected={selected}\n role=\"option\"\n id={id}\n aria-label={`${label}. ${title} (${index + prevIndex} of ${totalAppsLength})`}\n icon={IconComp}\n label={label}\n />\n </StyledListItem>\n );\n })}\n </>\n ),\n [handleKeyDown, handleOnClick, totalAppsLength],\n );\n\n const AppsRows = useMemo(() => buildRows(apps, 1, sectionTitle), [apps, buildRows, sectionTitle]);\n const CustomRows = useMemo(\n () => buildRows(customApps, apps.length, customSectionTitle),\n [apps.length, buildRows, customApps, customSectionTitle],\n );\n\n const layout = useMemo(() => {\n const cols = ['repeat(3, 92px)'];\n let appsRows = 0;\n let customRows = 0;\n const rows = [];\n if (apps.length > 0) {\n appsRows = apps.length / 3;\n rows.push('68px', `repeat(${appsRows}, 68px})`);\n }\n if (customApps.length > 0) {\n customRows = customApps.length / 3;\n rows.push('9px', '68px', `repeat(${customRows}, 68px})`);\n }\n return {\n rows,\n cols,\n };\n }, [apps.length, customApps.length]);\n\n // Needed just for typescript reasons\n const convertedTypeReference = wrapperRef as unknown as React.RefObject<HTMLDivElement> &\n React.RefObject<HTMLUListElement>;\n\n return (\n <StyledWrapper\n forwardedAs=\"ul\"\n role=\"listbox\"\n ref={convertedTypeReference}\n onKeyDown={handleOnKeyDownWrapper}\n data-testid=\"app-picker__wrapper\"\n isOverflow={isOverflow}\n cols={layout.cols}\n rows={layout.rows}\n tabIndex={-1}\n aria-label={`Application picker, ${sectionTitle} (${apps.length} apps)${\n customApps.length > 0 ? `, ${customSectionTitle} (${customApps.length} apps)` : ''\n }`}\n >\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledTitle data-testid=\"app-picker__main-title\" role=\"presentation\">\n {sectionTitle}\n </StyledTitle>\n </StyledListItemFullRow>\n {AppsRows}\n {customApps.length > 0 && (\n <>\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledSeparator role=\"presentation\" />\n </StyledListItemFullRow>\n <StyledListItemFullRow aria-hidden role=\"group\">\n <StyledTitle data-testid=\"app-picker__custom-title\" role=\"presentation\">\n {customSectionTitle}\n </StyledTitle>\n </StyledListItemFullRow>\n {CustomRows}\n </>\n )}\n </StyledWrapper>\n );\n};\n\nexport default AppPickerImpl;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC8EjB,mBAK2B,KA8EzB,YAnFF;AA3EN,SAAgB,aAAa,eAAe;AAC5C,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,eAAe,iBAAiB,uBAAuB,gBAAgB,mBAAmB;AACnG,SAAS,2BAA2B;AAEpC,MAAM,gBAAqC,CAAC;AAAA,EAC1C,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,QAAQ,MAAM;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,oBAAoB,IAAI,oBAAoB;AAAA,IAClD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAA2B;AAC1B,cAAQ,EAAE,KAAK;AAAA,QACb,KAAK,KAAK;AACR,sBAAY,SAAS,MAAM;AAC3B,gBAAM;AACN;AAAA,QACF,KAAK,KAAK;AACR,cAAI,EAAE,UAAU;AACd,gBAAI,EAAE,WAAW,oBAAoB,QAAQ,CAAC,GAAG;AAC/C,gBAAE,eAAe;AACjB,mCAAqB,QAAQ,oBAAoB,QAAQ,SAAS,CAAC,GAAG,MAAM;AAAA,YAC9E;AAAA,UACF,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MAAK,SACtC,8BAAC,mBAAgB,MAAK,gBAAe,GACvC;AAAA,UACA,oBAAC,yBAAsB,eAAW,MAAC,MAAK,SACtC,8BAAC,eAAY,eAAY,4BAA2B,MAAK,gBACtD,8BACH,GACF;AAAA,UACC;AAAA,WACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSAppPicker.js
CHANGED
|
@@ -6,8 +6,8 @@ import { DSButtonV2 } from "@elliemae/ds-button";
|
|
|
6
6
|
import { mergeRefs } from "@elliemae/ds-utilities";
|
|
7
7
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
8
8
|
import DSPopover from "@elliemae/ds-popover";
|
|
9
|
-
import AppPickerImpl from "./AppPickerImpl";
|
|
10
|
-
import { propTypes } from "./propTypes";
|
|
9
|
+
import AppPickerImpl from "./AppPickerImpl.js";
|
|
10
|
+
import { propTypes } from "./propTypes.js";
|
|
11
11
|
const DSAppPicker = ({
|
|
12
12
|
apps = [],
|
|
13
13
|
customApps = [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSAppPicker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-prop-types */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport DSPopover from '@elliemae/ds-popover';\nimport AppPickerImpl from './AppPickerImpl';\nimport { propTypes } from './propTypes';\nimport type { DSAppPickerType } from './types/AppPickerTypes';\n\nconst DSAppPicker: DSAppPickerType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n icon: Icon = () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n renderTrigger,\n isOpen,\n onClose = () => null,\n actionRef,\n onKeyDown,\n onClick = () => null,\n onClickOutside = () => null,\n triggerRef,\n}) => {\n const [open, setOpen] = useState(false);\n const [isOverflow, setIsOverflow] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const defaultTriggerRef = useRef(null);\n const wasOpenedByKeyboardRef = useRef(false);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToIndex = (index: number) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n actionRef.current.focusWrapper = () => {\n wrapperRef.current?.focus();\n };\n }\n }, [actionRef, apps, customApps]);\n\n useEffect(() => {\n setTimeout(() => {\n if (wrapperRef.current) {\n const { scrollHeight, clientHeight } = wrapperRef.current;\n if (scrollHeight > clientHeight) return setIsOverflow(true);\n }\n return setIsOverflow(false);\n });\n }, [isOpen, open]);\n\n const handleOnClose = useCallback(() => {\n setOpen(false);\n onClose();\n }, [onClose]);\n\n const handleOnClickOutside = (e: React.MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = useCallback(\n () => (\n <AppPickerImpl\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n close={handleOnClose}\n wrapperRef={wrapperRef}\n onKeyDown={onKeyDown}\n triggerRef={triggerRef || defaultTriggerRef}\n actionRef={actionRef}\n triggerIsInternal={!renderTrigger}\n wasOpenedByKeyboardRef={wasOpenedByKeyboardRef}\n isOverflow={isOverflow}\n />\n ),\n [\n actionRef,\n apps,\n customApps,\n customSectionTitle,\n handleOnClose,\n isOverflow,\n onKeyDown,\n renderTrigger,\n sectionTitle,\n triggerRef,\n ],\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }: { ref: React.RefObject<HTMLButtonElement> }) => (\n <DSButtonV2\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"icon\"\n aria-haspopup=\"true\"\n aria-expanded={isOpen ?? open}\n aria-label=\"Application picker\"\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e: React.MouseEvent | React.KeyboardEvent) => {\n wasOpenedByKeyboardRef.current = e.detail === 0;\n onClick(e);\n setOpen(true);\n }}\n >\n <Icon />\n </DSButtonV2>\n ));\n\n return (\n <DSPopover\n content={<AppPickerContent />}\n isOpen={typeof isOpen === 'boolean' ? isOpen : open}\n onClickOutside={handleOnClickOutside}\n placement=\"bottom\"\n interactionType=\"click\"\n renderTrigger={RenderTrigger}\n showArrow\n style={{\n padding: '0',\n maxWidth: '1000px',\n width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.displayName = 'DSAppPicker';\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACgBF;AAfrB,SAAgB,UAAU,WAAW,QAAQ,mBAAmB;AAChE,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,SAAS,iBAAiB;AAG1B,MAAM,cAA+B,CAAC;AAAA,EACpC,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,MAAM,OAAO,MAAM,oBAAC,cAAW,OAAO,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,EACzE;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB,iBAAiB,MAAM;AAAA,EACvB;AACF,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,yBAAyB,OAAO,KAAK;AAE3C,YAAU,MAAM;AACd,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,eAAe,CAAC,UAAkB;AAClD,YAAI,WAAW,SAAS;AACtB,gBAAM,SAAS,WAAW;AAC1B,gBAAM,UAAU,CAAC,GAAG,OAAO,iBAAiB,QAAQ,CAAC;AACrD,kBAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-prop-types */\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport DSPopover from '@elliemae/ds-popover';\nimport AppPickerImpl from './AppPickerImpl.js';\nimport { propTypes } from './propTypes.js';\nimport type { DSAppPickerType } from './types/AppPickerTypes.js';\n\nconst DSAppPicker: DSAppPickerType = ({\n apps = [],\n customApps = [],\n sectionTitle = 'APPLICATIONS',\n customSectionTitle = 'CUSTOM APPLICATIONS',\n icon: Icon = () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n renderTrigger,\n isOpen,\n onClose = () => null,\n actionRef,\n onKeyDown,\n onClick = () => null,\n onClickOutside = () => null,\n triggerRef,\n}) => {\n const [open, setOpen] = useState(false);\n const [isOverflow, setIsOverflow] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const defaultTriggerRef = useRef(null);\n const wasOpenedByKeyboardRef = useRef(false);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToIndex = (index: number) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n actionRef.current.focusWrapper = () => {\n wrapperRef.current?.focus();\n };\n }\n }, [actionRef, apps, customApps]);\n\n useEffect(() => {\n setTimeout(() => {\n if (wrapperRef.current) {\n const { scrollHeight, clientHeight } = wrapperRef.current;\n if (scrollHeight > clientHeight) return setIsOverflow(true);\n }\n return setIsOverflow(false);\n });\n }, [isOpen, open]);\n\n const handleOnClose = useCallback(() => {\n setOpen(false);\n onClose();\n }, [onClose]);\n\n const handleOnClickOutside = (e: React.MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = useCallback(\n () => (\n <AppPickerImpl\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n close={handleOnClose}\n wrapperRef={wrapperRef}\n onKeyDown={onKeyDown}\n triggerRef={triggerRef || defaultTriggerRef}\n actionRef={actionRef}\n triggerIsInternal={!renderTrigger}\n wasOpenedByKeyboardRef={wasOpenedByKeyboardRef}\n isOverflow={isOverflow}\n />\n ),\n [\n actionRef,\n apps,\n customApps,\n customSectionTitle,\n handleOnClose,\n isOverflow,\n onKeyDown,\n renderTrigger,\n sectionTitle,\n triggerRef,\n ],\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }: { ref: React.RefObject<HTMLButtonElement> }) => (\n <DSButtonV2\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"icon\"\n aria-haspopup=\"true\"\n aria-expanded={isOpen ?? open}\n aria-label=\"Application picker\"\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e: React.MouseEvent | React.KeyboardEvent) => {\n wasOpenedByKeyboardRef.current = e.detail === 0;\n onClick(e);\n setOpen(true);\n }}\n >\n <Icon />\n </DSButtonV2>\n ));\n\n return (\n <DSPopover\n content={<AppPickerContent />}\n isOpen={typeof isOpen === 'boolean' ? isOpen : open}\n onClickOutside={handleOnClickOutside}\n placement=\"bottom\"\n interactionType=\"click\"\n renderTrigger={RenderTrigger}\n showArrow\n style={{\n padding: '0',\n maxWidth: '1000px',\n width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.displayName = 'DSAppPicker';\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBF;AAfrB,SAAgB,UAAU,WAAW,QAAQ,mBAAmB;AAChE,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,SAAS,iBAAiB;AAG1B,MAAM,cAA+B,CAAC;AAAA,EACpC,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,MAAM,OAAO,MAAM,oBAAC,cAAW,OAAO,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,EACzE;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB;AAAA,EACA;AAAA,EACA,UAAU,MAAM;AAAA,EAChB,iBAAiB,MAAM;AAAA,EACvB;AACF,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,yBAAyB,OAAO,KAAK;AAE3C,YAAU,MAAM;AACd,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,eAAe,CAAC,UAAkB;AAClD,YAAI,WAAW,SAAS;AACtB,gBAAM,SAAS,WAAW;AAC1B,gBAAM,UAAU,CAAC,GAAG,OAAO,iBAAiB,QAAQ,CAAC;AACrD,kBAAQ,KAAK,EAAE,MA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B,UAAU,EAAE,WAAW;AAC9C,gBAAQ,CAAC;AACT,gBAAQ,IAAI;AAAA,MACd;AAAA,MAEA,8BAAC,QAAK;AAAA;AAAA,EACR;AAGJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,oBAAC,oBAAiB;AAAA,MAC3B,QAAQ,OAAO,WAAW,YAAY,SAAS;AAAA,MAC/C,gBAAgB;AAAA,MAChB,WAAU;AAAA,MACV,iBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,WAAS;AAAA,MACT,OAAO;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,OAAO;AAAA,MACT;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,sBAAsB,SAAS,WAAW;AAChD,oBAAoB,YAAY;AAGhC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
-
import { focusSelectedOrFirstAvailable } from "../utils";
|
|
4
|
-
const useKeepTrackButtons = (
|
|
3
|
+
import { focusSelectedOrFirstAvailable } from "../utils.js";
|
|
4
|
+
const useKeepTrackButtons = ({
|
|
5
|
+
wrapperRef,
|
|
6
|
+
wasOpenedByKeyboardRef,
|
|
7
|
+
actionRef,
|
|
8
|
+
triggerIsInternal
|
|
9
|
+
}) => {
|
|
5
10
|
const allFocusableButtons = useRef([]);
|
|
6
11
|
const selectedButton = useRef(null);
|
|
7
12
|
useEffect(() => {
|
|
@@ -15,7 +20,7 @@ const useKeepTrackButtons = (wrapperRef, wasOpenedByKeyboardRef, actionRef, trig
|
|
|
15
20
|
if (!e.hasAttribute("disabled")) {
|
|
16
21
|
allFocusableButtons?.current?.push(e);
|
|
17
22
|
}
|
|
18
|
-
if (e.getAttribute("aria-
|
|
23
|
+
if (e.getAttribute("aria-current") === "true") {
|
|
19
24
|
selectedButton.current = index;
|
|
20
25
|
}
|
|
21
26
|
if (wasOpenedByKeyboardRef.current || !triggerIsInternal) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useKeepTrackButtons.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useEffect, useRef } from 'react';\nimport { focusSelectedOrFirstAvailable } from '../utils';\nimport type { ActionRef } from '../types/AppPickerTypes';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,cAAc;AAClC,SAAS,qCAAqC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useEffect, useRef } from 'react';\nimport { focusSelectedOrFirstAvailable } from '../utils.js';\nimport type { ActionRef } from '../types/AppPickerTypes.js';\n\ninterface UseKeepTrackButtonsT {\n wrapperRef: React.RefObject<HTMLDivElement>;\n wasOpenedByKeyboardRef: React.MutableRefObject<boolean>;\n actionRef?: ActionRef;\n triggerIsInternal?: boolean;\n}\n\nexport const useKeepTrackButtons = ({\n wrapperRef,\n wasOpenedByKeyboardRef,\n actionRef,\n triggerIsInternal,\n}: UseKeepTrackButtonsT) => {\n const allFocusableButtons = useRef<HTMLButtonElement[]>([]);\n const selectedButton = useRef<number | null>(null);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusSelectedOrFirstAvailable = () =>\n setTimeout(() => focusSelectedOrFirstAvailable(wrapperRef, allFocusableButtons, selectedButton));\n }\n }, [actionRef, wrapperRef]);\n\n useEffect(() => {\n setTimeout(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-current') === 'true') {\n selectedButton.current = index;\n }\n if (wasOpenedByKeyboardRef.current || !triggerIsInternal) {\n focusSelectedOrFirstAvailable(wrapperRef, allFocusableButtons, selectedButton);\n } else {\n wrapperRef.current?.focus();\n }\n });\n });\n }, [wasOpenedByKeyboardRef, wrapperRef, triggerIsInternal]);\n\n return { allFocusableButtons, selectedButton };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,cAAc;AAClC,SAAS,qCAAqC;AAUvC,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,QAAM,sBAAsB,OAA4B,CAAC,CAAC;AAC1D,QAAM,iBAAiB,OAAsB,IAAI;AAEjD,YAAU,MAAM;AACd,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,gCAAgC,MAChD,WAAW,MAAM,8BAA8B,YAAY,qBAAqB,cAAc,CAAC;AAAA,IACnG;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAE1B,YAAU,MAAM;AACd,eAAW,MAAM;AACf,kBAAY,SAAS,iBAAiB,QAAQ,EAAE,QAAQ,CAAC,GAAG,UAAU;AACpE,YAAI,CAAC,EAAE,aAAa,UAAU,GAAG;AAC/B,+BAAqB,SAAS,KAAK,CAAC;AAAA,QACtC;AACA,YAAI,EAAE,aAAa,cAAc,MAAM,QAAQ;AAC7C,yBAAe,UAAU;AAAA,QAC3B;AACA,YAAI,uBAAuB,WAAW,CAAC,mBAAmB;AACxD,wCAA8B,YAAY,qBAAqB,cAAc;AAAA,QAC/E,OAAO;AACL,qBAAW,SAAS,MAAM;AAAA,QAC5B;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,GAAG,CAAC,wBAAwB,YAAY,iBAAiB,CAAC;AAE1D,SAAO,EAAE,qBAAqB,eAAe;AAC/C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAppPicker';\n\nexport { default } from './DSAppPicker';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAppPicker.js';\n\nexport { default } from './DSAppPicker.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AAEd,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const StyledWrapper = styled(Grid, { name: 'DSAppPicker', slot: 'root' })<{ isOverflow: boolean }>`\n align-items: center;\n min-width: 308px;\n min-height: 110px;\n max-height: 449px;\n width: 308px;\n overflow-y: auto;\n overflow-x: hidden;\n margin: 0;\n padding: ${({ isOverflow }) => (isOverflow ? '0 0 8px 16px' : '0 16px 8px 16px')};\n &:focus {\n outline: none;\n }\n`;\n\nexport const StyledListItem = styled.li`\n list-style: none;\n`;\n\nexport const StyledListItemFullRow = styled.li`\n list-style: none;\n grid-column: 1/4;\n`;\n\nexport const StyledTitle = styled('h3', { name: 'DSAppPicker', slot: 'title' })`\n color: ${({ theme }) => theme.colors.neutral[700]};\n font-size: ${({ theme }) => theme.fontSizes.value[400]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n margin: 12px 0 8px 0;\n line-height: 1.385;\n text-transform: uppercase;\n`;\n\nexport const StyledSeparator = styled('hr', { name: 'DSAppPicker', slot: 'separator' })`\n border-top: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n border-bottom: none;\n width: 99%;\n margin: 8px 0 0 0;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,eAAe,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aASlE,CAAC,EAAE,WAAW,MAAO,aAAa,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAMzD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAI9B,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAKrC,MAAM,cAAc,OAAO,MAAM,EAAE,MAAM,eAAe,MAAM,QAAQ,CAAC;AAAA,WACnE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,eAAe,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aASlE,CAAC,EAAE,WAAW,MAAO,aAAa,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAMzD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAI9B,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAKrC,MAAM,cAAc,OAAO,MAAM,EAAE,MAAM,eAAe,MAAM,QAAQ,CAAC;AAAA,WACnE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,eACnC,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA,iBACtC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,kBAAkB,OAAO,MAAM,EAAE,MAAM,eAAe,MAAM,YAAY,CAAC;AAAA,0BAC5D,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\n\nexport const keys = {\n LEFT: 'ArrowLeft',\n UP: 'ArrowUp',\n RIGHT: 'ArrowRight',\n DOWN: 'ArrowDown',\n ENTER: 'Enter',\n SPACE: '',\n TAB: 'Tab',\n ESC: 'Escape',\n HOME: 'Home',\n END: 'End',\n};\n\nexport const focusSelectedOrFirstAvailable = (\n wrapperRef: React.RefObject<HTMLDivElement>,\n allFocusableButtonsRef: React.MutableRefObject<HTMLButtonElement[]>,\n selectedButtonRef: React.MutableRefObject<number | null>,\n) => {\n if (selectedButtonRef.current !== null) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButtonRef.current].focus();\n } else {\n allFocusableButtonsRef?.current[0]?.focus();\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AACP;AAEO,MAAM,gCAAgC,CAC3C,YACA,wBACA,sBACG;AACH,MAAI,kBAAkB,YAAY,MAAM;AACtC,gBAAY,SAAS,iBAAiB,QAAQ,EAAE,kBAAkB,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AACP;AAEO,MAAM,gCAAgC,CAC3C,YACA,wBACA,sBACG;AACH,MAAI,kBAAkB,YAAY,MAAM;AACtC,gBAAY,SAAS,iBAAiB,QAAQ,EAAE,kBAAkB,OAAO,EAAE,MAAM;AAAA,EACnF,OAAO;AACL,4BAAwB,QAAQ,CAAC,GAAG,MAAM;AAAA,EAC5C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DSAppPickerType } from './types/AppPickerTypes';
|
|
1
|
+
import type { DSAppPickerType } from './types/AppPickerTypes.js';
|
|
2
2
|
declare const DSAppPicker: DSAppPickerType;
|
|
3
|
-
declare const AppPickerWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<import("./types/AppPickerTypes").AppPickerPropsType>;
|
|
3
|
+
declare const AppPickerWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<import("./types/AppPickerTypes.js").AppPickerPropsType>;
|
|
4
4
|
export { DSAppPicker, AppPickerWithSchema };
|
|
5
5
|
export default DSAppPicker;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { ActionRef } from '../types/AppPickerTypes';
|
|
3
|
-
|
|
2
|
+
import type { ActionRef } from '../types/AppPickerTypes.js';
|
|
3
|
+
interface UseKeepTrackButtonsT {
|
|
4
|
+
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
5
|
+
wasOpenedByKeyboardRef: React.MutableRefObject<boolean>;
|
|
6
|
+
actionRef?: ActionRef;
|
|
7
|
+
triggerIsInternal?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const useKeepTrackButtons: ({ wrapperRef, wasOpenedByKeyboardRef, actionRef, triggerIsInternal, }: UseKeepTrackButtonsT) => {
|
|
4
10
|
allFocusableButtons: React.MutableRefObject<HTMLButtonElement[]>;
|
|
5
11
|
selectedButton: React.MutableRefObject<number | null>;
|
|
6
12
|
};
|
|
13
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './DSAppPicker';
|
|
2
|
-
export { default } from './DSAppPicker';
|
|
1
|
+
export * from './DSAppPicker.js';
|
|
2
|
+
export { default } from './DSAppPicker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-app-picker",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - App Picker",
|
|
6
6
|
"files": [
|
|
@@ -59,19 +59,21 @@
|
|
|
59
59
|
"indent": 4
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@elliemae/ds-button": "3.16.
|
|
63
|
-
"@elliemae/ds-chip": "3.16.
|
|
64
|
-
"@elliemae/ds-
|
|
65
|
-
"@elliemae/ds-
|
|
66
|
-
"@elliemae/ds-popover": "3.16.
|
|
67
|
-
"@elliemae/ds-props-helpers": "3.16.
|
|
68
|
-
"@elliemae/ds-system": "3.16.
|
|
69
|
-
"@elliemae/ds-utilities": "3.16.
|
|
62
|
+
"@elliemae/ds-button": "3.16.1",
|
|
63
|
+
"@elliemae/ds-chip": "3.16.1",
|
|
64
|
+
"@elliemae/ds-grid": "3.16.1",
|
|
65
|
+
"@elliemae/ds-icons": "3.16.1",
|
|
66
|
+
"@elliemae/ds-popover": "3.16.1",
|
|
67
|
+
"@elliemae/ds-props-helpers": "3.16.1",
|
|
68
|
+
"@elliemae/ds-system": "3.16.1",
|
|
69
|
+
"@elliemae/ds-utilities": "3.16.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@testing-library/jest-dom": "~5.16.
|
|
72
|
+
"@testing-library/jest-dom": "~5.16.5",
|
|
73
73
|
"@testing-library/react": "~12.1.3",
|
|
74
|
-
"
|
|
74
|
+
"@testing-library/user-event": "~13.5.0",
|
|
75
|
+
"jest-axe": "^7.0.1",
|
|
76
|
+
"styled-components": "~5.3.9"
|
|
75
77
|
},
|
|
76
78
|
"peerDependencies": {
|
|
77
79
|
"lodash": "^4.17.21",
|