@elliemae/ds-app-picker 1.61.12 → 1.61.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AppPickerImpl.js","sources":["../../src/AppPickerImpl.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable object-curly-newline */\n/* eslint-disable prefer-template */\nimport React, { useEffect, useCallback, useRef } from 'react';\nimport { chunk } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { keys } from './utils';\nimport { DSAppPickerImplType } from './types/AppPickerTypes';\n\nconst blockName = 'app-picker';\nconst Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');\nconst Grid = aggregatedClasses('div')(blockName, 'grid');\nconst Row = aggregatedClasses('div')(blockName, 'row');\nconst Chip = aggregatedClasses('button')(blockName, 'chip', ({ disabled, selected }) => ({\n disabled,\n selected,\n}));\nconst ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');\nconst Separator = aggregatedClasses('hr')(blockName, 'separator');\nconst SectionTitle = aggregatedClasses('p')(blockName, 'section-title');\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}) => {\n const allFocusableButtons = useRef([]);\n const selectedButton = useRef(null);\n\n useEffect(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-selected') === 'true') {\n selectedButton.current = index;\n }\n });\n\n if (selectedButton.current) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButton.current].focus();\n } else {\n allFocusableButtons?.current[0]?.focus();\n }\n }, [wrapperRef]);\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = (e) => {\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\n const handleOnClick = useCallback((e, app) => {\n if (app.onClick) app.onClick(e, app);\n }, []);\n\n const handleOnKeyDownWrapper = useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const buildRows = (appList, prevIndex = 0) => {\n const rows = chunk(appList, 3); // divides array in subarrays of 3 items\n const formattedRows = rows.map((row, index) => (\n <Row key={index}>\n {row.map((app, key) => {\n const { label, disabled, selected, icon: Icon } = app;\n return (\n <Chip\n key={key}\n classProps={{ disabled, selected }}\n onClick={(e) => handleOnClick(e, app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n aria-selected={selected}\n aria-setsize={apps.length + customApps.length}\n aria-posinset={key + prevIndex}\n >\n <Icon className=\"app-picker__icon\" size=\"m\" />\n <ChipLabel>{label}</ChipLabel>\n </Chip>\n );\n })}\n </Row>\n ));\n return formattedRows;\n };\n\n const AppsRows = () => buildRows(apps, 1);\n const CustomRows = () => buildRows(customApps, apps.length);\n\n return (\n <Wrapper role=\"listbox\" ref={wrapperRef} onKeyDown={handleOnKeyDownWrapper} data-testid=\"app-picker__wrapper\">\n <SectionTitle data-testid=\"app-picker__main-title\" aria-hidden>\n {sectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__main-grid\">\n <AppsRows />\n </Grid>\n {!!customApps.length && (\n <>\n <Separator aria-hidden />\n <SectionTitle data-testid=\"app-picker__custom-title\" aria-hidden>\n {customSectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__custom-grid\">\n <CustomRows />\n </Grid>\n </>\n )}\n </Wrapper>\n );\n};\n\nexport default AppPickerImpl;\n"],"names":["blockName","Wrapper","aggregatedClasses","Grid","Row","Chip","disabled","selected","ChipLabel","Separator","SectionTitle","AppPickerImpl","apps","customApps","sectionTitle","customSectionTitle","close","wrapperRef","onKeyDown","triggerRef","allFocusableButtons","useRef","selectedButton","useEffect","current","querySelectorAll","forEach","e","index","hasAttribute","push","getAttribute","focus","handleKeyDown","key","keys","ESC","TAB","shiftKey","target","preventDefault","length","handleOnClick","useCallback","app","onClick","handleOnKeyDownWrapper","buildRows","appList","prevIndex","rows","chunk","formattedRows","map","row","React","label","Icon","icon","AppsRows","CustomRows"],"mappings":";;;;;;;;;;;AAAA;AAaA,IAAMA,SAAS,GAAG,YAAlB;AACA,IAAMC,OAAO,GAAGC,8BAAiB,CAAC,IAAD,CAAjB,CAAwBF,SAAxB,EAAmC,SAAnC,CAAhB;AACA,IAAMG,IAAI,GAAGD,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,MAApC,CAAb;AACA,IAAMI,GAAG,GAAGF,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,CAAZ;AACA,IAAMK,IAAI,GAAGH,8BAAiB,CAAC,QAAD,CAAjB,CAA4BF,SAA5B,EAAuC,MAAvC,EAA+C;AAAA,MAAGM,QAAH,QAAGA,QAAH;AAAA,MAAaC,QAAb,QAAaA,QAAb;AAAA,SAA6B;AACvFD,IAAAA,QAAQ,EAARA,QADuF;AAEvFC,IAAAA,QAAQ,EAARA;AAFuF,GAA7B;AAAA,CAA/C,CAAb;AAIA,IAAMC,SAAS,GAAGN,8BAAiB,CAAC,GAAD,CAAjB,CAAuBF,SAAvB,EAAkC,YAAlC,CAAlB;AACA,IAAM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AC,YAAD;AAAc,mBAAY,0BAA1B;AAAqD;AAArD,KACGxC,kBADH,CAFF,eAKEwC,wCAAC,IAAD;AAAM,mBAAY;AAAlB,kBACEA,wCAAC,UAAD,OADF,CALF,CARJ,CADF;AAqBD;;;;"}
1
+ {"version":3,"file":"AppPickerImpl.js","sources":["../../src/AppPickerImpl.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable object-curly-newline */\n/* eslint-disable prefer-template */\nimport React, { useEffect, useCallback, useRef } from 'react';\nimport { chunk } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { keys } from './utils';\nimport { DSAppPickerImplType } from './types/AppPickerTypes';\n\nconst blockName = 'app-picker';\nconst Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');\nconst Grid = aggregatedClasses('div')(blockName, 'grid');\nconst Row = aggregatedClasses('div')(blockName, 'row');\nconst Chip = aggregatedClasses('button')(blockName, 'chip', ({ disabled, selected }) => ({\n disabled,\n selected,\n}));\nconst ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');\nconst Separator = aggregatedClasses('hr')(blockName, 'separator');\nconst SectionTitle = aggregatedClasses('p')(blockName, 'section-title');\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}) => {\n const allFocusableButtons = useRef([]);\n const selectedButton = useRef(null);\n\n useEffect(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-selected') === 'true') {\n selectedButton.current = index;\n }\n });\n\n if (selectedButton.current) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButton.current].focus();\n } else {\n allFocusableButtons?.current[0]?.focus();\n }\n }, [wrapperRef]);\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = (e) => {\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\n const handleOnClick = useCallback((e, app) => {\n if (app.onClick) app.onClick(e, app);\n }, []);\n\n const handleOnKeyDownWrapper = useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const buildRows = (appList, prevIndex = 0) => {\n const rows = chunk(appList, 3); // divides array in subarrays of 3 items\n const formattedRows = rows.map((row, index) => (\n <Row key={index}>\n {row.map((app, key) => {\n const { label, disabled, selected, icon: Icon } = app;\n return (\n <Chip\n key={key}\n classProps={{ disabled, selected }}\n onClick={(e) => handleOnClick(e, app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n aria-selected={selected}\n aria-setsize={apps.length + customApps.length}\n aria-posinset={key + prevIndex}\n >\n <Icon className=\"app-picker__icon\" size=\"m\" />\n <ChipLabel>{label}</ChipLabel>\n </Chip>\n );\n })}\n </Row>\n ));\n return formattedRows;\n };\n\n const AppsRows = () => buildRows(apps, 1);\n const CustomRows = () => buildRows(customApps, apps.length);\n\n return (\n <Wrapper role=\"listbox\" ref={wrapperRef} onKeyDown={handleOnKeyDownWrapper} data-testid=\"app-picker__wrapper\">\n <SectionTitle data-testid=\"app-picker__main-title\" aria-hidden>\n {sectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__main-grid\">\n <AppsRows />\n </Grid>\n {!!customApps.length && (\n <>\n <Separator aria-hidden />\n <SectionTitle data-testid=\"app-picker__custom-title\" aria-hidden>\n {customSectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__custom-grid\">\n <CustomRows />\n </Grid>\n </>\n )}\n </Wrapper>\n );\n};\n\nexport default AppPickerImpl;\n"],"names":["blockName","Wrapper","aggregatedClasses","Grid","Row","Chip","disabled","selected","ChipLabel","Separator","SectionTitle","AppPickerImpl","apps","customApps","sectionTitle","customSectionTitle","close","wrapperRef","onKeyDown","triggerRef","allFocusableButtons","useRef","selectedButton","useEffect","current","querySelectorAll","forEach","e","index","hasAttribute","push","getAttribute","focus","handleKeyDown","key","keys","ESC","TAB","shiftKey","target","preventDefault","length","handleOnClick","useCallback","app","onClick","handleOnKeyDownWrapper","buildRows","appList","prevIndex","rows","chunk","formattedRows","map","row","React","label","Icon","icon","AppsRows","CustomRows"],"mappings":";;;;;;;;;;;AAAA;AAaA,IAAMA,SAAS,GAAG,YAAlB;AACA,IAAMC,OAAO,GAAGC,8BAAiB,CAAC,IAAD,CAAjB,CAAwBF,SAAxB,EAAmC,SAAnC,CAAhB;AACA,IAAMG,IAAI,GAAGD,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,MAApC,CAAb;AACA,IAAMI,GAAG,GAAGF,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,CAAZ;AACA,IAAMK,IAAI,GAAGH,8BAAiB,CAAC,QAAD,CAAjB,CAA4BF,SAA5B,EAAuC,MAAvC,EAA+C;EAAA,IAAGM,QAAH,QAAGA,QAAH;MAAaC,QAAb,QAAaA,QAAb;EAAA,OAA6B;IACvFD,QAAQ,EAARA,QADuF;IAEvFC,QAAQ,EAARA;GAF0D;AAAA,CAA/C,CAAb;AAIA,IAAMC,SAAS,GAAGN,8BAAiB,CAAC,GAAD,CAAjB,CAAuBF,SAAvB,EAAkC,YAAlC,CAAlB;AACA,I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AAC6B,MAAL,GAAc5B,UAAU,CAAC4B,MATzC;UAUE,iBAAeP,GAAG,GAAGe;wBAErBM,wCAAC,IAAD;UAAM,SAAS,EAAC,kBAAhB;UAAmC,IAAI,EAAC;UAZ1C,eAaEA,wCAAC,SAAD,QAAYC,KAAZ,CAbF,CADF;OAFD,CADH,CAD6B;KAAT,CAAtB;IAwBA,OAAOJ,aAAP;GA1BF;;EA6BA,IAAMO,QAAQ,GAAG,SAAXA,QAAW;IAAA,OAAMZ,SAAS,CAACnC,IAAD,EAAO,CAAP,CAAf;GAAjB;;EACA,IAAMgD,UAAU,GAAG,SAAbA,UAAa;IAAA,OAAMb,SAAS,CAAClC,UAAD,EAAaD,IAAI,CAAC6B,MAAlB,CAAf;GAAnB;;EAEA,oBACEc,wCAAC,OAAD;IAAS,IAAI,EAAC,SAAd;IAAwB,GAAG,EAAEtC,UAA7B;IAAyC,SAAS,EAAE6B,sBAApD;IAA4E,eAAY;kBACtFS,wCAAC,YAAD;IAAc,eAAY,wBAA1B;IAAmD;KAChDzC,YADH,CADF,eAIEyC,wCAAC,IAAD;IAAM,eAAY;kBAChBA,wCAAC,QAAD,OADF,CAJF,EAOG,CAAC,CAAC1C,UAAU,CAAC4B,MAAb,iBACCc,+FACEA,wCAAC,SAAD;IAAW;IADb,eAEEA,wCAAC,YAAD;IAAc,eAAY,0BAA1B;IAAqD;KAClDxC,kBADH,CAFF,eAKEwC,wCAAC,IAAD;IAAM,eAAY;kBAChBA,wCAAC,UAAD,OADF,CALF,CARJ,CADF;AAqBD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DSAppPicker.js","sources":["../../src/DSAppPicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport DSPopover from '@elliemae/ds-popover';\nimport { mergeRefs } from '@elliemae/ds-utilities';\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 fill={['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 wrapperRef = useRef(null);\n const defaultTriggerRef = useRef(null);\n\n useEffect(() => {\n if (actionRef) {\n actionRef.current.focusToIndex = (index) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n }\n }, [actionRef, apps, customApps]);\n\n const handleOnClose = () => {\n if (typeof isOpen === 'boolean') {\n setOpen(isOpen);\n } else {\n setOpen(false);\n }\n onClose();\n };\n\n const handleOnClickOutside = (e: MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = () => (\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 />\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }) => (\n <DSButton\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"text\"\n icon={<Icon />}\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e) => {\n onClick(e);\n setOpen(true);\n }}\n />\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 width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.propTypes = propTypes;\n\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],"names":["DSAppPicker","apps","customApps","sectionTitle","customSectionTitle","icon","Icon","React","MenuPicker","renderTrigger","isOpen","onClose","actionRef","onKeyDown","onClick","onClickOutside","triggerRef","useState","open","setOpen","wrapperRef","useRef","defaultTriggerRef","useEffect","current","focusToIndex","index","parent","buttons","querySelectorAll","focus","handleOnClose","handleOnClickOutside","e","AppPickerContent","RenderTrigger","ref","DSButton","mergeRefs","DSPopover","padding","width","propTypes","AppPickerWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,WAA4B,GAAG,SAA/BA,WAA+B,OAc/B;AAAA,uBAbJC,IAaI;AAAA,MAbJA,IAaI,0BAbG,EAaH;AAAA,6BAZJC,UAYI;AAAA,MAZJA,UAYI,gCAZS,EAYT;AAAA,+BAXJC,YAWI;AAAA,MAXJA,YAWI,kCAXW,cAWX;AAAA,mCAVJC,kBAUI;AAAA,MAVJA,kBAUI,sCAViB,qBAUjB;AAAA,uBATJC,IASI;AAAA,MATEC,IASF,0BATS;AAAA,wBAAMC,wCAACC,kBAAD;AAAY,MAAA,IAAI,EAAE,CAAC,eAAD,EAAkB,GAAlB,CAAlB;AAA0C,MAAA,IAAI,EAAC;AAA/C,MAAN;AAAA,GAST;AAAA,MARJC,aAQI,QARJA,aAQI;AAAA,MAPJC,MAOI,QAPJA,MAOI;AAAA,0BANJC,OAMI;AAAA,MANJA,OAMI,6BANM;AAAA,WAAM,IAAN;AAAA,GAMN;AAAA,MALJC,SAKI,QALJA,SAKI;AAAA,MAJJC,SAII,QAJJA,SAII;AAAA,0BAHJC,OAGI;AAAA,MAHJA,QAGI,6BAHM;AAAA,WAAM,IAAN;AAAA,GAGN;AAAA,iCAFJC,cAEI;AAAA,MAFJA,cAEI,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 {"version":3,"file":"DSAppPicker.js","sources":["../../src/DSAppPicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport DSPopover from '@elliemae/ds-popover';\nimport { mergeRefs } from '@elliemae/ds-utilities';\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 fill={['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 wrapperRef = useRef(null);\n const defaultTriggerRef = useRef(null);\n\n useEffect(() => {\n if (actionRef) {\n actionRef.current.focusToIndex = (index) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n }\n }, [actionRef, apps, customApps]);\n\n const handleOnClose = () => {\n if (typeof isOpen === 'boolean') {\n setOpen(isOpen);\n } else {\n setOpen(false);\n }\n onClose();\n };\n\n const handleOnClickOutside = (e: MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = () => (\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 />\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }) => (\n <DSButton\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"text\"\n icon={<Icon />}\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e) => {\n onClick(e);\n setOpen(true);\n }}\n />\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 width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.propTypes = propTypes;\n\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],"names":["DSAppPicker","apps","customApps","sectionTitle","customSectionTitle","icon","Icon","React","MenuPicker","renderTrigger","isOpen","onClose","actionRef","onKeyDown","onClick","onClickOutside","triggerRef","useState","open","setOpen","wrapperRef","useRef","defaultTriggerRef","useEffect","current","focusToIndex","index","parent","buttons","querySelectorAll","focus","handleOnClose","handleOnClickOutside","e","AppPickerContent","RenderTrigger","ref","DSButton","mergeRefs","DSPopover","padding","width","propTypes","AppPickerWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,WAA4B,GAAG,SAA/BA,WAA+B,OAc/B;EAAA,qBAbJC,IAaI;MAbJA,IAaI,0BAbG,EAaH;6BAZJC,UAYI;MAZJA,UAYI,gCAZS,EAYT;+BAXJC,YAWI;MAXJA,YAWI,kCAXW,cAWX;mCAVJC,kBAUI;MAVJA,kBAUI,sCAViB,qBAUjB;uBATJC,IASI;MATEC,IASF,0BATS;IAAA,oBAAMC,wCAACC,kBAAD;MAAY,IAAI,EAAE,CAAC,eAAD,EAAkB,GAAlB,CAAlB;MAA0C,IAAI,EAAC;MAArD;GAST;MARJC,aAQI,QARJA,aAQI;MAPJC,MAOI,QAPJA,MAOI;0BANJC,OAMI;MANJA,OAMI,6BANM;IAAA,OAAM,IAAN;GAMN;MALJC,SAKI,QALJA,SAKI;MAJJC,S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AAEC,kBAJtB;MAKE,KAAK,EAAE2B,aALT;MAME,UAAU,EAAEX,UANd;MAOE,SAAS,EAAEP,SAPb;MAQE,UAAU,EAAEG,UAAU,IAAIM;MATL;GAAzB;;EAaA,IAAMa,aAAa,GACjB1B,aAAa,IACZ;IAAA,IAAG2B,GAAH,SAAGA,GAAH;IAAA,oBACC7B,wCAAC8B,4BAAD;MACE,eAAY,oBADd;MAEE,EAAE,EAAC,oBAFL;MAGE,UAAU,EAAC,MAHb;MAIE,IAAI,eAAE9B,wCAAC,IAAD,OAJR;MAKE,QAAQ,EAAE+B,qBAAS,CAACF,GAAD,EAAMd,iBAAN,CALrB;MAME,OAAO,EAAE,iBAACW,CAAD,EAAO;QACdnB,QAAO,CAACmB,CAAD,CAAP;;QACAd,OAAO,CAAC,IAAD,CAAP;;MATL;GAFH;;EAgBA,oBACEZ,wCAACgC,6BAAD;IACE,OAAO,eAAEhC,wCAAC,gBAAD,OADX;IAEE,MAAM,EAAE,OAAOG,MAAP,KAAkB,SAAlB,GAA8BA,MAA9B,GAAuCQ,IAFjD;IAGE,cAAc,EAAEc,oBAHlB;IAIE,SAAS,EAAC,QAJZ;IAKE,eAAe,EAAC,OALlB;IAME,aAAa,EAAEG,aANjB;IAOE,SAAS,MAPX;IAQE,KAAK,EAAE;MACLK,OAAO,EAAE,GADJ;MAELC,KAAK,EAAE;;IAXb;AAeD;;AAEDzC,WAAW,CAAC0C,SAAZ,GAAwBA,mBAAxB;IAEMC,mBAAmB,GAAGC,kBAAQ,CAAC5C,WAAD;AACpC2C,mBAAmB,CAACD,SAApB,GAAgCA,mBAAhC;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\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};\n"],"names":["propTypes","apps","PropTypes","array","description","isRequired","customApps","sectionTitle","string","defaultValue","customSectionTitle","icon","func","MenuPicker","renderTrigger","actionRef","oneOfType","shape","current","any","isOpen","bool","onClose","onKeyDown","onClick","onClickOutside"],"mappings":";;;;;;;IAGaA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAEC,mBAAS,CAACC,KAAV,CAAgBC,WAAhB,CACJ,oGADI,EAEJC,UAHqB;AAIvBC,EAAAA,UAAU,EAAEJ,mBAAS,CAACC,KAAV,CAAgBC,WAAhB,CACV,sGADU,CAJW;AAOvBG,EAAAA,YAAY,EAAEL,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,oBAA7B,EAAmDK,YAAnD,CAAgE,cAAhE,CAPS;AAQvBC,EAAAA,kBAAkB,EAAER,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sBAA7B,EAAqDK,YAArD,CAAkE,qBAAlE,CARG;AASvBE,EAAAA,IAAI,EAAET,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uBAA3B,EAAoDK,YAApD,CAAiEI,kBAAjE,CATiB;AAUvBC,EAAAA,aAAa,EAAEZ,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,2BAA3B,CAVQ;AAWvBW,EAAAA,SAAS,EAAEb,mBAAS,CAACc,SAAV,CAAoB,CAACd,mBAAS,CAACU,IAAX,EAAiBV,mBAAS,CAACe,KAAV,CAAgB;AAAEC,IAAAA,OAAO,EAAEhB,mBAAS,CAACiB;AAArB,GAAhB,CAAjB,CAApB,EAAmFf,WAAnF,CACT,qGADS,CAXY;AAcvBgB,EAAAA,MAAM,EAAElB,mBAAS,CAACmB,IAAV,CAAejB,WAAf,CAA2B,6CAA3B,CAde;AAevBkB,EAAAA,OAAO,EAAEpB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6CAA3B,CAfc;AAgBvBmB,EAAAA,SAAS,EAAErB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6BAA3B,CAhBY;AAiBvBoB,EAAAA,OAAO,EAAEtB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uCAA3B,CAjBc;AAkBvBqB,EAAAA,cAAc,EAAEvB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6DAA3B;AAlBO;;;;"}
1
+ {"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\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};\n"],"names":["propTypes","apps","PropTypes","array","description","isRequired","customApps","sectionTitle","string","defaultValue","customSectionTitle","icon","func","MenuPicker","renderTrigger","actionRef","oneOfType","shape","current","any","isOpen","bool","onClose","onKeyDown","onClick","onClickOutside"],"mappings":";;;;;;;IAGaA,SAAS,GAAG;EACvBC,IAAI,EAAEC,mBAAS,CAACC,KAAV,CAAgBC,WAAhB,CACJ,oGADI,EAEJC,UAHqB;EAIvBC,UAAU,EAAEJ,mBAAS,CAACC,KAAV,CAAgBC,WAAhB,CACV,sGADU,CAJW;EAOvBG,YAAY,EAAEL,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,oBAA7B,EAAmDK,YAAnD,CAAgE,cAAhE,CAPS;EAQvBC,kBAAkB,EAAER,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sBAA7B,EAAqDK,YAArD,CAAkE,qBAAlE,CARG;EASvBE,IAAI,EAAET,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uBAA3B,EAAoDK,YAApD,CAAiEI,kBAAjE,CATiB;EAUvBC,aAAa,EAAEZ,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,2BAA3B,CAVQ;EAWvBW,SAAS,EAAEb,mBAAS,CAACc,SAAV,CAAoB,CAACd,mBAAS,CAACU,IAAX,EAAiBV,mBAAS,CAACe,KAAV,CAAgB;IAAEC,OAAO,EAAEhB,mBAAS,CAACiB;GAArC,CAAjB,CAApB,EAAmFf,WAAnF,CACT,qGADS,CAXY;EAcvBgB,MAAM,EAAElB,mBAAS,CAACmB,IAAV,CAAejB,WAAf,CAA2B,6CAA3B,CAde;EAevBkB,OAAO,EAAEpB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6CAA3B,CAfc;EAgBvBmB,SAAS,EAAErB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6BAA3B,CAhBY;EAiBvBoB,OAAO,EAAEtB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uCAA3B,CAjBc;EAkBvBqB,cAAc,EAAEvB,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6DAA3B;AAlBO;;;;"}
package/cjs/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export 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"],"names":["keys","LEFT","UP","RIGHT","DOWN","ENTER","SPACE","TAB","ESC","HOME","END"],"mappings":";;;;IAAaA,IAAI,GAAG;AAClBC,EAAAA,IAAI,EAAE,WADY;AAElBC,EAAAA,EAAE,EAAE,SAFc;AAGlBC,EAAAA,KAAK,EAAE,YAHW;AAIlBC,EAAAA,IAAI,EAAE,WAJY;AAKlBC,EAAAA,KAAK,EAAE,OALW;AAMlBC,EAAAA,KAAK,EAAE,EANW;AAOlBC,EAAAA,GAAG,EAAE,KAPa;AAQlBC,EAAAA,GAAG,EAAE,QARa;AASlBC,EAAAA,IAAI,EAAE,MATY;AAUlBC,EAAAA,GAAG,EAAE;AAVa;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export 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"],"names":["keys","LEFT","UP","RIGHT","DOWN","ENTER","SPACE","TAB","ESC","HOME","END"],"mappings":";;;;IAAaA,IAAI,GAAG;EAClBC,IAAI,EAAE,WADY;EAElBC,EAAE,EAAE,SAFc;EAGlBC,KAAK,EAAE,YAHW;EAIlBC,IAAI,EAAE,WAJY;EAKlBC,KAAK,EAAE,OALW;EAMlBC,KAAK,EAAE,EANW;EAOlBC,GAAG,EAAE,KAPa;EAQlBC,GAAG,EAAE,QARa;EASlBC,IAAI,EAAE,MATY;EAUlBC,GAAG,EAAE;AAVa;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppPickerImpl.js","sources":["../../src/AppPickerImpl.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable object-curly-newline */\n/* eslint-disable prefer-template */\nimport React, { useEffect, useCallback, useRef } from 'react';\nimport { chunk } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { keys } from './utils';\nimport { DSAppPickerImplType } from './types/AppPickerTypes';\n\nconst blockName = 'app-picker';\nconst Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');\nconst Grid = aggregatedClasses('div')(blockName, 'grid');\nconst Row = aggregatedClasses('div')(blockName, 'row');\nconst Chip = aggregatedClasses('button')(blockName, 'chip', ({ disabled, selected }) => ({\n disabled,\n selected,\n}));\nconst ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');\nconst Separator = aggregatedClasses('hr')(blockName, 'separator');\nconst SectionTitle = aggregatedClasses('p')(blockName, 'section-title');\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}) => {\n const allFocusableButtons = useRef([]);\n const selectedButton = useRef(null);\n\n useEffect(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-selected') === 'true') {\n selectedButton.current = index;\n }\n });\n\n if (selectedButton.current) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButton.current].focus();\n } else {\n allFocusableButtons?.current[0]?.focus();\n }\n }, [wrapperRef]);\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = (e) => {\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\n const handleOnClick = useCallback((e, app) => {\n if (app.onClick) app.onClick(e, app);\n }, []);\n\n const handleOnKeyDownWrapper = useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const buildRows = (appList, prevIndex = 0) => {\n const rows = chunk(appList, 3); // divides array in subarrays of 3 items\n const formattedRows = rows.map((row, index) => (\n <Row key={index}>\n {row.map((app, key) => {\n const { label, disabled, selected, icon: Icon } = app;\n return (\n <Chip\n key={key}\n classProps={{ disabled, selected }}\n onClick={(e) => handleOnClick(e, app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n aria-selected={selected}\n aria-setsize={apps.length + customApps.length}\n aria-posinset={key + prevIndex}\n >\n <Icon className=\"app-picker__icon\" size=\"m\" />\n <ChipLabel>{label}</ChipLabel>\n </Chip>\n );\n })}\n </Row>\n ));\n return formattedRows;\n };\n\n const AppsRows = () => buildRows(apps, 1);\n const CustomRows = () => buildRows(customApps, apps.length);\n\n return (\n <Wrapper role=\"listbox\" ref={wrapperRef} onKeyDown={handleOnKeyDownWrapper} data-testid=\"app-picker__wrapper\">\n <SectionTitle data-testid=\"app-picker__main-title\" aria-hidden>\n {sectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__main-grid\">\n <AppsRows />\n </Grid>\n {!!customApps.length && (\n <>\n <Separator aria-hidden />\n <SectionTitle data-testid=\"app-picker__custom-title\" aria-hidden>\n {customSectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__custom-grid\">\n <CustomRows />\n </Grid>\n </>\n )}\n </Wrapper>\n );\n};\n\nexport default AppPickerImpl;\n"],"names":["blockName","Wrapper","aggregatedClasses","Grid","Row","Chip","disabled","selected","ChipLabel","Separator","SectionTitle","AppPickerImpl","apps","customApps","sectionTitle","customSectionTitle","close","wrapperRef","onKeyDown","triggerRef","allFocusableButtons","useRef","selectedButton","useEffect","current","querySelectorAll","forEach","e","index","hasAttribute","push","getAttribute","focus","handleKeyDown","key","keys","ESC","TAB","shiftKey","target","preventDefault","length","handleOnClick","useCallback","app","onClick","handleOnKeyDownWrapper","buildRows","appList","prevIndex","rows","chunk","formattedRows","map","row","label","Icon","icon","AppsRows","CustomRows"],"mappings":";;;;;AAAA;AAaA,IAAMA,SAAS,GAAG,YAAlB;AACA,IAAMC,OAAO,GAAGC,iBAAiB,CAAC,IAAD,CAAjB,CAAwBF,SAAxB,EAAmC,SAAnC,CAAhB;AACA,IAAMG,IAAI,GAAGD,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,MAApC,CAAb;AACA,IAAMI,GAAG,GAAGF,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,CAAZ;AACA,IAAMK,IAA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SAAd;AAAwB,IAAA,GAAG,EAAExB,UAA7B;AAAyC,IAAA,SAAS,EAAE6B,sBAApD;AAA4E,mBAAY;AAAxF,kBACE,oBAAC,YAAD;AAAc,mBAAY,wBAA1B;AAAmD;AAAnD,KACGhC,YADH,CADF,eAIE,oBAAC,IAAD;AAAM,mBAAY;AAAlB,kBACE,oBAAC,QAAD,OADF,CAJF,EAOG,CAAC,CAACD,UAAU,CAAC4B,MAAb,iBACC,uDACE,oBAAC,SAAD;AAAW;AAAX,IADF,eAEE,oBAAC,YAAD;AAAc,mBAAY,0BAA1B;AAAqD;AAArD,KACG1B,kBADH,CAFF,eAKE,oBAAC,IAAD;AAAM,mBAAY;AAAlB,kBACE,oBAAC,UAAD,OADF,CALF,CARJ,CADF;AAqBD;;;;"}
1
+ {"version":3,"file":"AppPickerImpl.js","sources":["../../src/AppPickerImpl.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable object-curly-newline */\n/* eslint-disable prefer-template */\nimport React, { useEffect, useCallback, useRef } from 'react';\nimport { chunk } from 'lodash';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { keys } from './utils';\nimport { DSAppPickerImplType } from './types/AppPickerTypes';\n\nconst blockName = 'app-picker';\nconst Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');\nconst Grid = aggregatedClasses('div')(blockName, 'grid');\nconst Row = aggregatedClasses('div')(blockName, 'row');\nconst Chip = aggregatedClasses('button')(blockName, 'chip', ({ disabled, selected }) => ({\n disabled,\n selected,\n}));\nconst ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');\nconst Separator = aggregatedClasses('hr')(blockName, 'separator');\nconst SectionTitle = aggregatedClasses('p')(blockName, 'section-title');\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}) => {\n const allFocusableButtons = useRef([]);\n const selectedButton = useRef(null);\n\n useEffect(() => {\n wrapperRef?.current?.querySelectorAll('button').forEach((e, index) => {\n if (!e.hasAttribute('disabled')) {\n allFocusableButtons?.current?.push(e);\n }\n if (e.getAttribute('aria-selected') === 'true') {\n selectedButton.current = index;\n }\n });\n\n if (selectedButton.current) {\n wrapperRef?.current?.querySelectorAll('button')[selectedButton.current].focus();\n } else {\n allFocusableButtons?.current[0]?.focus();\n }\n }, [wrapperRef]);\n\n // eslint-disable-next-line max-statements\n const handleKeyDown = (e) => {\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\n const handleOnClick = useCallback((e, app) => {\n if (app.onClick) app.onClick(e, app);\n }, []);\n\n const handleOnKeyDownWrapper = useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n if (!onKeyDown && e.key === keys.ESC) {\n close();\n }\n },\n [onKeyDown, close],\n );\n\n const buildRows = (appList, prevIndex = 0) => {\n const rows = chunk(appList, 3); // divides array in subarrays of 3 items\n const formattedRows = rows.map((row, index) => (\n <Row key={index}>\n {row.map((app, key) => {\n const { label, disabled, selected, icon: Icon } = app;\n return (\n <Chip\n key={key}\n classProps={{ disabled, selected }}\n onClick={(e) => handleOnClick(e, app)}\n onKeyDown={handleKeyDown}\n data-testid=\"app-picker__chip\"\n aria-disabled={disabled}\n disabled={disabled}\n aria-selected={selected}\n aria-setsize={apps.length + customApps.length}\n aria-posinset={key + prevIndex}\n >\n <Icon className=\"app-picker__icon\" size=\"m\" />\n <ChipLabel>{label}</ChipLabel>\n </Chip>\n );\n })}\n </Row>\n ));\n return formattedRows;\n };\n\n const AppsRows = () => buildRows(apps, 1);\n const CustomRows = () => buildRows(customApps, apps.length);\n\n return (\n <Wrapper role=\"listbox\" ref={wrapperRef} onKeyDown={handleOnKeyDownWrapper} data-testid=\"app-picker__wrapper\">\n <SectionTitle data-testid=\"app-picker__main-title\" aria-hidden>\n {sectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__main-grid\">\n <AppsRows />\n </Grid>\n {!!customApps.length && (\n <>\n <Separator aria-hidden />\n <SectionTitle data-testid=\"app-picker__custom-title\" aria-hidden>\n {customSectionTitle}\n </SectionTitle>\n <Grid data-testid=\"app-picker__custom-grid\">\n <CustomRows />\n </Grid>\n </>\n )}\n </Wrapper>\n );\n};\n\nexport default AppPickerImpl;\n"],"names":["blockName","Wrapper","aggregatedClasses","Grid","Row","Chip","disabled","selected","ChipLabel","Separator","SectionTitle","AppPickerImpl","apps","customApps","sectionTitle","customSectionTitle","close","wrapperRef","onKeyDown","triggerRef","allFocusableButtons","useRef","selectedButton","useEffect","current","querySelectorAll","forEach","e","index","hasAttribute","push","getAttribute","focus","handleKeyDown","key","keys","ESC","TAB","shiftKey","target","preventDefault","length","handleOnClick","useCallback","app","onClick","handleOnKeyDownWrapper","buildRows","appList","prevIndex","rows","chunk","formattedRows","map","row","label","Icon","icon","AppsRows","CustomRows"],"mappings":";;;;;AAAA;AAaA,IAAMA,SAAS,GAAG,YAAlB;AACA,IAAMC,OAAO,GAAGC,iBAAiB,CAAC,IAAD,CAAjB,CAAwBF,SAAxB,EAAmC,SAAnC,CAAhB;AACA,IAAMG,IAAI,GAAGD,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,MAApC,CAAb;AACA,IAAMI,GAAG,GAAGF,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,CAAZ;AACA,IAAMK,IAAI,G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ADF;AAqBD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DSAppPicker.js","sources":["../../src/DSAppPicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport DSPopover from '@elliemae/ds-popover';\nimport { mergeRefs } from '@elliemae/ds-utilities';\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 fill={['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 wrapperRef = useRef(null);\n const defaultTriggerRef = useRef(null);\n\n useEffect(() => {\n if (actionRef) {\n actionRef.current.focusToIndex = (index) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n }\n }, [actionRef, apps, customApps]);\n\n const handleOnClose = () => {\n if (typeof isOpen === 'boolean') {\n setOpen(isOpen);\n } else {\n setOpen(false);\n }\n onClose();\n };\n\n const handleOnClickOutside = (e: MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = () => (\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 />\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }) => (\n <DSButton\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"text\"\n icon={<Icon />}\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e) => {\n onClick(e);\n setOpen(true);\n }}\n />\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 width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.propTypes = propTypes;\n\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],"names":["DSAppPicker","apps","customApps","sectionTitle","customSectionTitle","icon","Icon","renderTrigger","isOpen","onClose","actionRef","onKeyDown","onClick","onClickOutside","triggerRef","useState","open","setOpen","wrapperRef","useRef","defaultTriggerRef","useEffect","current","focusToIndex","index","parent","buttons","querySelectorAll","focus","handleOnClose","handleOnClickOutside","e","AppPickerContent","RenderTrigger","ref","mergeRefs","padding","width","propTypes","AppPickerWithSchema","describe"],"mappings":";;;;;;;;;;;;;;IAUMA,WAA4B,GAAG,SAA/BA,WAA+B,OAc/B;AAAA,uBAbJC,IAaI;AAAA,MAbJA,IAaI,0BAbG,EAaH;AAAA,6BAZJC,UAYI;AAAA,MAZJA,UAYI,gCAZS,EAYT;AAAA,+BAXJC,YAWI;AAAA,MAXJA,YAWI,kCAXW,cAWX;AAAA,mCAVJC,kBAUI;AAAA,MAVJA,kBAUI,sCAViB,qBAUjB;AAAA,uBATJC,IASI;AAAA,MATEC,IASF,0BATS;AAAA,wBAAM,oBAAC,UAAD;AAAY,MAAA,IAAI,EAAE,CAAC,eAAD,EAAkB,GAAlB,CAAlB;AAA0C,MAAA,IAAI,EAAC;AAA/C,MAAN;AAAA,GAST;AAAA,MARJC,aAQI,QARJA,aAQI;AAAA,MAPJC,MAOI,QAPJA,MAOI;AA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ACLG,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,KAAK,EAAE;AAFF;AART,IADF;AAeD;;AAEDrC,WAAW,CAACsC,SAAZ,GAAwBA,SAAxB;IAEMC,mBAAmB,GAAGC,QAAQ,CAACxC,WAAD;AACpCuC,mBAAmB,CAACD,SAApB,GAAgCA,SAAhC;;;;"}
1
+ {"version":3,"file":"DSAppPicker.js","sources":["../../src/DSAppPicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport DSPopover from '@elliemae/ds-popover';\nimport { mergeRefs } from '@elliemae/ds-utilities';\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 fill={['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 wrapperRef = useRef(null);\n const defaultTriggerRef = useRef(null);\n\n useEffect(() => {\n if (actionRef) {\n actionRef.current.focusToIndex = (index) => {\n if (wrapperRef.current) {\n const parent = wrapperRef.current;\n const buttons = [...parent.querySelectorAll('button')];\n buttons[index].focus();\n }\n };\n }\n }, [actionRef, apps, customApps]);\n\n const handleOnClose = () => {\n if (typeof isOpen === 'boolean') {\n setOpen(isOpen);\n } else {\n setOpen(false);\n }\n onClose();\n };\n\n const handleOnClickOutside = (e: MouseEvent) => {\n setOpen(false);\n onClose();\n onClickOutside(e);\n };\n\n const AppPickerContent = () => (\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 />\n );\n\n const RenderTrigger =\n renderTrigger ||\n (({ ref }) => (\n <DSButton\n data-testid=\"app-picker__button\"\n id=\"app-picker__button\"\n buttonType=\"text\"\n icon={<Icon />}\n innerRef={mergeRefs(ref, defaultTriggerRef)}\n onClick={(e) => {\n onClick(e);\n setOpen(true);\n }}\n />\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 width: 'fit-content',\n }}\n />\n );\n};\n\nDSAppPicker.propTypes = propTypes;\n\nconst AppPickerWithSchema = describe(DSAppPicker);\nAppPickerWithSchema.propTypes = propTypes;\n\nexport { DSAppPicker, AppPickerWithSchema };\nexport default DSAppPicker;\n"],"names":["DSAppPicker","apps","customApps","sectionTitle","customSectionTitle","icon","Icon","renderTrigger","isOpen","onClose","actionRef","onKeyDown","onClick","onClickOutside","triggerRef","useState","open","setOpen","wrapperRef","useRef","defaultTriggerRef","useEffect","current","focusToIndex","index","parent","buttons","querySelectorAll","focus","handleOnClose","handleOnClickOutside","e","AppPickerContent","RenderTrigger","ref","mergeRefs","padding","width","propTypes","AppPickerWithSchema","describe"],"mappings":";;;;;;;;;;;;;;IAUMA,WAA4B,GAAG,SAA/BA,WAA+B,OAc/B;EAAA,qBAbJC,IAaI;MAbJA,IAaI,0BAbG,EAaH;6BAZJC,UAYI;MAZJA,UAYI,gCAZS,EAYT;+BAXJC,YAWI;MAXJA,YAWI,kCAXW,cAWX;mCAVJC,kBAUI;MAVJA,kBAUI,sCAViB,qBAUjB;uBATJC,IASI;MATEC,IASF,0BATS;IAAA,oBAAM,oBAAC,UAAD;MAAY,IAAI,EAAE,CAAC,eAAD,EAAkB,GAA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{ PropTypes } from 'react-desc';\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};\n"],"names":["propTypes","apps","PropTypes","array","description","isRequired","customApps","sectionTitle","string","defaultValue","customSectionTitle","icon","func","MenuPicker","renderTrigger","actionRef","oneOfType","shape","current","any","isOpen","bool","onClose","onKeyDown","onClick","onClickOutside"],"mappings":";;;IAGaA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAEC,SAAS,CAACC,KAAV,CAAgBC,WAAhB,CACJ,oGADI,EAEJC,UAHqB;AAIvBC,EAAAA,UAAU,EAAEJ,SAAS,CAACC,KAAV,CAAgBC,WAAhB,CACV,sGADU,CAJW;AAOvBG,EAAAA,YAAY,EAAEL,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,oBAA7B,EAAmDK,YAAnD,CAAgE,cAAhE,CAPS;AAQvBC,EAAAA,kBAAkB,EAAER,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sBAA7B,EAAqDK,YAArD,CAAkE,qBAAlE,CARG;AASvBE,EAAAA,IAAI,EAAET,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uBAA3B,EAAoDK,YAApD,CAAiEI,UAAjE,CATiB;AAUvBC,EAAAA,aAAa,EAAEZ,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,2BAA3B,CAVQ;AAWvBW,EAAAA,SAAS,EAAEb,SAAS,CAACc,SAAV,CAAoB,CAACd,SAAS,CAACU,IAAX,EAAiBV,SAAS,CAACe,KAAV,CAAgB;AAAEC,IAAAA,OAAO,EAAEhB,SAAS,CAACiB;AAArB,GAAhB,CAAjB,CAApB,EAAmFf,WAAnF,CACT,qGADS,CAXY;AAcvBgB,EAAAA,MAAM,EAAElB,SAAS,CAACmB,IAAV,CAAejB,WAAf,CAA2B,6CAA3B,CAde;AAevBkB,EAAAA,OAAO,EAAEpB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6CAA3B,CAfc;AAgBvBmB,EAAAA,SAAS,EAAErB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6BAA3B,CAhBY;AAiBvBoB,EAAAA,OAAO,EAAEtB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uCAA3B,CAjBc;AAkBvBqB,EAAAA,cAAc,EAAEvB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6DAA3B;AAlBO;;;;"}
1
+ {"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\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};\n"],"names":["propTypes","apps","PropTypes","array","description","isRequired","customApps","sectionTitle","string","defaultValue","customSectionTitle","icon","func","MenuPicker","renderTrigger","actionRef","oneOfType","shape","current","any","isOpen","bool","onClose","onKeyDown","onClick","onClickOutside"],"mappings":";;;IAGaA,SAAS,GAAG;EACvBC,IAAI,EAAEC,SAAS,CAACC,KAAV,CAAgBC,WAAhB,CACJ,oGADI,EAEJC,UAHqB;EAIvBC,UAAU,EAAEJ,SAAS,CAACC,KAAV,CAAgBC,WAAhB,CACV,sGADU,CAJW;EAOvBG,YAAY,EAAEL,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,oBAA7B,EAAmDK,YAAnD,CAAgE,cAAhE,CAPS;EAQvBC,kBAAkB,EAAER,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sBAA7B,EAAqDK,YAArD,CAAkE,qBAAlE,CARG;EASvBE,IAAI,EAAET,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uBAA3B,EAAoDK,YAApD,CAAiEI,UAAjE,CATiB;EAUvBC,aAAa,EAAEZ,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,2BAA3B,CAVQ;EAWvBW,SAAS,EAAEb,SAAS,CAACc,SAAV,CAAoB,CAACd,SAAS,CAACU,IAAX,EAAiBV,SAAS,CAACe,KAAV,CAAgB;IAAEC,OAAO,EAAEhB,SAAS,CAACiB;GAArC,CAAjB,CAApB,EAAmFf,WAAnF,CACT,qGADS,CAXY;EAcvBgB,MAAM,EAAElB,SAAS,CAACmB,IAAV,CAAejB,WAAf,CAA2B,6CAA3B,CAde;EAevBkB,OAAO,EAAEpB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6CAA3B,CAfc;EAgBvBmB,SAAS,EAAErB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6BAA3B,CAhBY;EAiBvBoB,OAAO,EAAEtB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,uCAA3B,CAjBc;EAkBvBqB,cAAc,EAAEvB,SAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,6DAA3B;AAlBO;;;;"}
package/esm/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export 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"],"names":["keys","LEFT","UP","RIGHT","DOWN","ENTER","SPACE","TAB","ESC","HOME","END"],"mappings":"IAAaA,IAAI,GAAG;AAClBC,EAAAA,IAAI,EAAE,WADY;AAElBC,EAAAA,EAAE,EAAE,SAFc;AAGlBC,EAAAA,KAAK,EAAE,YAHW;AAIlBC,EAAAA,IAAI,EAAE,WAJY;AAKlBC,EAAAA,KAAK,EAAE,OALW;AAMlBC,EAAAA,KAAK,EAAE,EANW;AAOlBC,EAAAA,GAAG,EAAE,KAPa;AAQlBC,EAAAA,GAAG,EAAE,QARa;AASlBC,EAAAA,IAAI,EAAE,MATY;AAUlBC,EAAAA,GAAG,EAAE;AAVa;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export 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"],"names":["keys","LEFT","UP","RIGHT","DOWN","ENTER","SPACE","TAB","ESC","HOME","END"],"mappings":"IAAaA,IAAI,GAAG;EAClBC,IAAI,EAAE,WADY;EAElBC,EAAE,EAAE,SAFc;EAGlBC,KAAK,EAAE,YAHW;EAIlBC,IAAI,EAAE,WAJY;EAKlBC,KAAK,EAAE,OALW;EAMlBC,KAAK,EAAE,EANW;EAOlBC,GAAG,EAAE,KAPa;EAQlBC,GAAG,EAAE,QARa;EASlBC,IAAI,EAAE,MATY;EAUlBC,GAAG,EAAE;AAVa;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-app-picker",
3
- "version": "1.61.12",
3
+ "version": "1.61.13",
4
4
  "license": "MIT",
5
5
  "description": "Ellie Mae - Dim Sum - App Picker",
6
6
  "module": "esm/index.js",
@@ -16,11 +16,11 @@
16
16
  "build": "node ../../scripts/build/build.js"
17
17
  },
18
18
  "dependencies": {
19
- "@elliemae/ds-button": "1.61.12",
20
- "@elliemae/ds-classnames": "1.61.12",
21
- "@elliemae/ds-icons": "1.61.12",
22
- "@elliemae/ds-popover": "1.61.12",
23
- "@elliemae/ds-utilities": "1.61.12",
19
+ "@elliemae/ds-button": "1.61.13",
20
+ "@elliemae/ds-classnames": "1.61.13",
21
+ "@elliemae/ds-icons": "1.61.13",
22
+ "@elliemae/ds-popover": "1.61.13",
23
+ "@elliemae/ds-utilities": "1.61.13",
24
24
  "react-desc": "^4.1.2"
25
25
  },
26
26
  "peerDependencies": {