@elliemae/ds-hooks-keyboard-navigation 3.36.0-next.0 → 3.36.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSHooksKeyboardNavigation.js +5 -10
- package/dist/cjs/DSHooksKeyboardNavigation.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +1 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/DSHooksKeyboardNavigation.js +5 -10
- package/dist/esm/DSHooksKeyboardNavigation.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils.js +1 -2
- package/dist/esm/utils.js.map +1 -1
- package/package.json +5 -5
|
@@ -64,23 +64,18 @@ const useKeyboardNavigation = (props) => {
|
|
|
64
64
|
);
|
|
65
65
|
const handleParentOnBlur = (0, import_ds_hooks_on_blur_out.useOnBlurOut)(config);
|
|
66
66
|
const prevArrowKeys = (0, import_react.useMemo)(() => {
|
|
67
|
-
if (direction === "vertical")
|
|
68
|
-
|
|
69
|
-
if (direction === "horizontal")
|
|
70
|
-
return ["ArrowLeft"];
|
|
67
|
+
if (direction === "vertical") return ["ArrowUp"];
|
|
68
|
+
if (direction === "horizontal") return ["ArrowLeft"];
|
|
71
69
|
return ["ArrowUp", "ArrowLeft"];
|
|
72
70
|
}, [direction]);
|
|
73
71
|
const nextArrowKeys = (0, import_react.useMemo)(() => {
|
|
74
|
-
if (direction === "vertical")
|
|
75
|
-
|
|
76
|
-
if (direction === "horizontal")
|
|
77
|
-
return ["ArrowRight"];
|
|
72
|
+
if (direction === "vertical") return ["ArrowDown"];
|
|
73
|
+
if (direction === "horizontal") return ["ArrowRight"];
|
|
78
74
|
return ["ArrowDown", "ArrowRight"];
|
|
79
75
|
}, [direction]);
|
|
80
76
|
const onKeyDown = (0, import_react.useCallback)(
|
|
81
77
|
(e) => {
|
|
82
|
-
if (userOnKeyDown)
|
|
83
|
-
userOnKeyDown(e);
|
|
78
|
+
if (userOnKeyDown) userOnKeyDown(e);
|
|
84
79
|
const { key } = e;
|
|
85
80
|
const index = options.findIndex((option) => option === focusedOptionMutable.current);
|
|
86
81
|
if (prevArrowKeys.includes(key)) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSHooksKeyboardNavigation.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\nimport { useCallback, useMemo, useRef } from 'react';\nimport { useOnBlurOut, type DSHooksUseOBlurOutT } from '@elliemae/ds-hooks-on-blur-out';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { type DSHooksKeyboardNaviationT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { findInCircularList } from './utils.js';\n\nconst defaultFocusCriteria = () => true;\nconst useKeyboardNavigation = (props: DSHooksKeyboardNaviationT.Props) => {\n const {\n options,\n direction = 'agnostic',\n disableRoving = false,\n focusCriteria = defaultFocusCriteria,\n onKeyDown: userOnKeyDown,\n focusedOption,\n setFocusedOption,\n } = props;\n const previousFocusedOption = useRef<string | null>(null);\n const focusedOptionMutable = useRef<string | null>(null);\n\n const config: {\n onBlur: DSHooksUseOBlurOutT.OnBlurCb;\n } = useMemo(\n () => ({\n onBlur: () => {\n // if (e.currentTarget !== e.target) return;\n if (options.includes(focusedOption as string)) {\n previousFocusedOption.current = focusedOption;\n setFocusedOption(null);\n }\n },\n }),\n [focusedOption, options, setFocusedOption],\n );\n const handleParentOnBlur = useOnBlurOut(config);\n\n const prevArrowKeys = useMemo(() => {\n if (direction === 'vertical') return ['ArrowUp'];\n if (direction === 'horizontal') return ['ArrowLeft'];\n return ['ArrowUp', 'ArrowLeft'];\n }, [direction]);\n const nextArrowKeys = useMemo(() => {\n if (direction === 'vertical') return ['ArrowDown'];\n if (direction === 'horizontal') return ['ArrowRight'];\n return ['ArrowDown', 'ArrowRight'];\n }, [direction]);\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n if (userOnKeyDown) userOnKeyDown(e);\n const { key } = e;\n const index = options.findIndex((option) => option === focusedOptionMutable.current);\n if (prevArrowKeys.includes(key)) {\n e.preventDefault();\n const previous = findInCircularList(options, index, focusCriteria, -1);\n setFocusedOption(options[previous]);\n } else if (nextArrowKeys.includes(key)) {\n e.preventDefault();\n const next = findInCircularList(options, index, focusCriteria, 1);\n\n setFocusedOption(options[next]);\n }\n },\n [userOnKeyDown, options, prevArrowKeys, nextArrowKeys, focusCriteria, setFocusedOption],\n );\n\n const getItemProps = useCallback(\n (dsId: string) => ({\n innerRef: (el: HTMLElement | null) => {\n if (el && dsId === focusedOption && focusedOptionMutable.current !== dsId) {\n el?.focus();\n }\n },\n onFocus: () => {\n setFocusedOption(dsId);\n focusedOptionMutable.current = dsId;\n },\n tabIndex: (disableRoving ||\n dsId === focusedOption ||\n (focusedOptionMutable.current === dsId && (focusedOption === null || !options.includes(focusedOption))) ||\n // (previousFocusedOption.current === dsId && focusedOption === null) ||\n (dsId === options[0] && focusedOptionMutable.current === null && previousFocusedOption.current === null)\n ? 0\n : -1) as TypescriptHelpersT.WCAGTabIndex,\n }),\n [disableRoving, focusedOption, options, setFocusedOption],\n );\n\n const getWrapperProps = useCallback(\n () => ({\n onKeyDown,\n onBlur: handleParentOnBlur,\n }),\n [onKeyDown, handleParentOnBlur],\n );\n\n return useMemo(\n () => ({ getWrapperProps, getItemProps, focusedOption, setFocusedOption }),\n [getWrapperProps, getItemProps, focusedOption, setFocusedOption],\n );\n};\n\nconst UseKeyboardNavigationWithSchema = describe(useKeyboardNavigation);\nUseKeyboardNavigationWithSchema.propTypes = propTypes;\n\nexport { useKeyboardNavigation, UseKeyboardNavigationWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mapp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C,YAAI,MAAM,SAAS,iBAAiB,qBAAqB,YAAY,MAAM;AACzE,cAAI,MAAM;AAAA,QACZ;AAAA,MACF;AAAA,MACA,SAAS,MAAM;AACb,yBAAiB,IAAI;AACrB,6BAAqB,UAAU;AAAA,MACjC;AAAA,MACA,UAAW,iBACX,SAAS,iBACR,qBAAqB,YAAY,SAAS,kBAAkB,QAAQ,CAAC,QAAQ,SAAS,aAAa;AAAA,MAEnG,SAAS,QAAQ,CAAC,KAAK,qBAAqB,YAAY,QAAQ,sBAAsB,YAAY,OAC/F,IACA;AAAA,IACN;AAAA,IACA,CAAC,eAAe,eAAe,SAAS,gBAAgB;AAAA,EAC1D;AAEA,QAAM,sBAAkB;AAAA,IACtB,OAAO;AAAA,MACL;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,IACA,CAAC,WAAW,kBAAkB;AAAA,EAChC;AAEA,aAAO;AAAA,IACL,OAAO,EAAE,iBAAiB,cAAc,eAAe,iBAAiB;AAAA,IACxE,CAAC,iBAAiB,cAAc,eAAe,gBAAgB;AAAA,EACjE;AACF;AAEA,MAAM,sCAAkC,kCAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
6
|
"names": ["import_react_desc_prop_types"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,5 +34,4 @@ __export(src_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_DSHooksKeyboardNavigation = require("./DSHooksKeyboardNavigation.js");
|
|
37
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
38
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export { UseKeyboardNavigationWithSchema, useKeyboardNavigation } from './DSHooksKeyboardNavigation.js';\nexport { type DSHooksKeyboardNaviationT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uCAAuE;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uCAAuE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -34,8 +34,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
const findInCircularList = (list, from, criteria = () => true, step = 1) => {
|
|
36
36
|
for (let i = (from + step + list.length) % list.length; i !== from && from > -1; i = (i + step + list.length) % list.length) {
|
|
37
|
-
if (criteria(list[i]))
|
|
38
|
-
return i;
|
|
37
|
+
if (criteria(list[i])) return i;
|
|
39
38
|
}
|
|
40
39
|
return from;
|
|
41
40
|
};
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const findInCircularList = <T>(\n list: T[],\n from: number,\n criteria: (item: T) => boolean = () => true,\n step = 1,\n // eslint-disable-next-line max-params\n): number => {\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n if (criteria(list[i])) return i;\n }\n\n return from; // return same item\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB,CAChC,MACA,MACA,WAAiC,MAAM,MACvC,OAAO,MAEI;AACX,WACM,KAAK,OAAO,OAAO,KAAK,UAAU,KAAK,QAC3C,MAAM,QAAQ,OAAO,IACrB,KAAK,IAAI,OAAO,KAAK,UAAU,KAAK,QACpC;AACA,QAAI,SAAS,KAAK,CAAC,CAAC
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB,CAChC,MACA,MACA,WAAiC,MAAM,MACvC,OAAO,MAEI;AACX,WACM,KAAK,OAAO,OAAO,KAAK,UAAU,KAAK,QAC3C,MAAM,QAAQ,OAAO,IACrB,KAAK,IAAI,OAAO,KAAK,UAAU,KAAK,QACpC;AACA,QAAI,SAAS,KAAK,CAAC,CAAC,EAAG,QAAO;AAAA,EAChC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,23 +30,18 @@ const useKeyboardNavigation = (props) => {
|
|
|
30
30
|
);
|
|
31
31
|
const handleParentOnBlur = useOnBlurOut(config);
|
|
32
32
|
const prevArrowKeys = useMemo(() => {
|
|
33
|
-
if (direction === "vertical")
|
|
34
|
-
|
|
35
|
-
if (direction === "horizontal")
|
|
36
|
-
return ["ArrowLeft"];
|
|
33
|
+
if (direction === "vertical") return ["ArrowUp"];
|
|
34
|
+
if (direction === "horizontal") return ["ArrowLeft"];
|
|
37
35
|
return ["ArrowUp", "ArrowLeft"];
|
|
38
36
|
}, [direction]);
|
|
39
37
|
const nextArrowKeys = useMemo(() => {
|
|
40
|
-
if (direction === "vertical")
|
|
41
|
-
|
|
42
|
-
if (direction === "horizontal")
|
|
43
|
-
return ["ArrowRight"];
|
|
38
|
+
if (direction === "vertical") return ["ArrowDown"];
|
|
39
|
+
if (direction === "horizontal") return ["ArrowRight"];
|
|
44
40
|
return ["ArrowDown", "ArrowRight"];
|
|
45
41
|
}, [direction]);
|
|
46
42
|
const onKeyDown = useCallback(
|
|
47
43
|
(e) => {
|
|
48
|
-
if (userOnKeyDown)
|
|
49
|
-
userOnKeyDown(e);
|
|
44
|
+
if (userOnKeyDown) userOnKeyDown(e);
|
|
50
45
|
const { key } = e;
|
|
51
46
|
const index = options.findIndex((option) => option === focusedOptionMutable.current);
|
|
52
47
|
if (prevArrowKeys.includes(key)) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSHooksKeyboardNavigation.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useCallback, useMemo, useRef } from 'react';\nimport { useOnBlurOut, type DSHooksUseOBlurOutT } from '@elliemae/ds-hooks-on-blur-out';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { type DSHooksKeyboardNaviationT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { findInCircularList } from './utils.js';\n\nconst defaultFocusCriteria = () => true;\nconst useKeyboardNavigation = (props: DSHooksKeyboardNaviationT.Props) => {\n const {\n options,\n direction = 'agnostic',\n disableRoving = false,\n focusCriteria = defaultFocusCriteria,\n onKeyDown: userOnKeyDown,\n focusedOption,\n setFocusedOption,\n } = props;\n const previousFocusedOption = useRef<string | null>(null);\n const focusedOptionMutable = useRef<string | null>(null);\n\n const config: {\n onBlur: DSHooksUseOBlurOutT.OnBlurCb;\n } = useMemo(\n () => ({\n onBlur: () => {\n // if (e.currentTarget !== e.target) return;\n if (options.includes(focusedOption as string)) {\n previousFocusedOption.current = focusedOption;\n setFocusedOption(null);\n }\n },\n }),\n [focusedOption, options, setFocusedOption],\n );\n const handleParentOnBlur = useOnBlurOut(config);\n\n const prevArrowKeys = useMemo(() => {\n if (direction === 'vertical') return ['ArrowUp'];\n if (direction === 'horizontal') return ['ArrowLeft'];\n return ['ArrowUp', 'ArrowLeft'];\n }, [direction]);\n const nextArrowKeys = useMemo(() => {\n if (direction === 'vertical') return ['ArrowDown'];\n if (direction === 'horizontal') return ['ArrowRight'];\n return ['ArrowDown', 'ArrowRight'];\n }, [direction]);\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n if (userOnKeyDown) userOnKeyDown(e);\n const { key } = e;\n const index = options.findIndex((option) => option === focusedOptionMutable.current);\n if (prevArrowKeys.includes(key)) {\n e.preventDefault();\n const previous = findInCircularList(options, index, focusCriteria, -1);\n setFocusedOption(options[previous]);\n } else if (nextArrowKeys.includes(key)) {\n e.preventDefault();\n const next = findInCircularList(options, index, focusCriteria, 1);\n\n setFocusedOption(options[next]);\n }\n },\n [userOnKeyDown, options, prevArrowKeys, nextArrowKeys, focusCriteria, setFocusedOption],\n );\n\n const getItemProps = useCallback(\n (dsId: string) => ({\n innerRef: (el: HTMLElement | null) => {\n if (el && dsId === focusedOption && focusedOptionMutable.current !== dsId) {\n el?.focus();\n }\n },\n onFocus: () => {\n setFocusedOption(dsId);\n focusedOptionMutable.current = dsId;\n },\n tabIndex: (disableRoving ||\n dsId === focusedOption ||\n (focusedOptionMutable.current === dsId && (focusedOption === null || !options.includes(focusedOption))) ||\n // (previousFocusedOption.current === dsId && focusedOption === null) ||\n (dsId === options[0] && focusedOptionMutable.current === null && previousFocusedOption.current === null)\n ? 0\n : -1) as TypescriptHelpersT.WCAGTabIndex,\n }),\n [disableRoving, focusedOption, options, setFocusedOption],\n );\n\n const getWrapperProps = useCallback(\n () => ({\n onKeyDown,\n onBlur: handleParentOnBlur,\n }),\n [onKeyDown, handleParentOnBlur],\n );\n\n return useMemo(\n () => ({ getWrapperProps, getItemProps, focusedOption, setFocusedOption }),\n [getWrapperProps, getItemProps, focusedOption, setFocusedOption],\n );\n};\n\nconst UseKeyboardNavigationWithSchema = describe(useKeyboardNavigation);\nUseKeyboardNavigationWithSchema.propTypes = propTypes;\n\nexport { useKeyboardNavigation, UseKeyboardNavigationWithSch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,cAAI,MAAM;AAAA,QACZ;AAAA,MACF;AAAA,MACA,SAAS,MAAM;AACb,yBAAiB,IAAI;AACrB,6BAAqB,UAAU;AAAA,MACjC;AAAA,MACA,UAAW,iBACX,SAAS,iBACR,qBAAqB,YAAY,SAAS,kBAAkB,QAAQ,CAAC,QAAQ,SAAS,aAAa;AAAA,MAEnG,SAAS,QAAQ,CAAC,KAAK,qBAAqB,YAAY,QAAQ,sBAAsB,YAAY,OAC/F,IACA;AAAA,IACN;AAAA,IACA,CAAC,eAAe,eAAe,SAAS,gBAAgB;AAAA,EAC1D;AAEA,QAAM,kBAAkB;AAAA,IACtB,OAAO;AAAA,MACL;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,IACA,CAAC,WAAW,kBAAkB;AAAA,EAChC;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,iBAAiB,cAAc,eAAe,iBAAiB;AAAA,IACxE,CAAC,iBAAiB,cAAc,eAAe,gBAAgB;AAAA,EACjE;AACF;AAEA,MAAM,kCAAkC,SAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { UseKeyboardNavigationWithSchema, useKeyboardNavigation } from './DSHooksKeyboardNavigation.js';\nexport { type DSHooksKeyboardNaviationT } from './react-desc-prop-types.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iCAAiC,6BAA6B;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iCAAiC,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
const findInCircularList = (list, from, criteria = () => true, step = 1) => {
|
|
3
3
|
for (let i = (from + step + list.length) % list.length; i !== from && from > -1; i = (i + step + list.length) % list.length) {
|
|
4
|
-
if (criteria(list[i]))
|
|
5
|
-
return i;
|
|
4
|
+
if (criteria(list[i])) return i;
|
|
6
5
|
}
|
|
7
6
|
return from;
|
|
8
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.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const findInCircularList = <T>(\n list: T[],\n from: number,\n criteria: (item: T) => boolean = () => true,\n step = 1,\n // eslint-disable-next-line max-params\n): number => {\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n if (criteria(list[i])) return i;\n }\n\n return from; // return same item\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAChC,MACA,MACA,WAAiC,MAAM,MACvC,OAAO,MAEI;AACX,WACM,KAAK,OAAO,OAAO,KAAK,UAAU,KAAK,QAC3C,MAAM,QAAQ,OAAO,IACrB,KAAK,IAAI,OAAO,KAAK,UAAU,KAAK,QACpC;AACA,QAAI,SAAS,KAAK,CAAC,CAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAChC,MACA,MACA,WAAiC,MAAM,MACvC,OAAO,MAEI;AACX,WACM,KAAK,OAAO,OAAO,KAAK,UAAU,KAAK,QAC3C,MAAM,QAAQ,OAAO,IACrB,KAAK,IAAI,OAAO,KAAK,UAAU,KAAK,QACpC;AACA,QAAI,SAAS,KAAK,CAAC,CAAC,EAAG,QAAO;AAAA,EAChC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-hooks-keyboard-navigation",
|
|
3
|
-
"version": "3.36.0-next.
|
|
3
|
+
"version": "3.36.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Hooks Keyboaord Navigation",
|
|
6
6
|
"files": [
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-hooks-on-blur-out": "3.36.0-next.
|
|
40
|
-
"@elliemae/ds-props-helpers": "3.36.0-next.
|
|
41
|
-
"@elliemae/ds-typescript-helpers": "3.36.0-next.
|
|
39
|
+
"@elliemae/ds-hooks-on-blur-out": "3.36.0-next.2",
|
|
40
|
+
"@elliemae/ds-props-helpers": "3.36.0-next.2",
|
|
41
|
+
"@elliemae/ds-typescript-helpers": "3.36.0-next.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
45
45
|
"@xstyled/system": "3.7.0",
|
|
46
46
|
"styled-components": "~5.3.9",
|
|
47
47
|
"styled-system": "~5.1.5",
|
|
48
|
-
"@elliemae/ds-monorepo-devops": "3.36.0-next.
|
|
48
|
+
"@elliemae/ds-monorepo-devops": "3.36.0-next.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"lodash": "^4.17.21",
|