@kaizen/components 1.42.3 → 1.42.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "1.42.3",
3
+ "version": "1.42.4",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -85,9 +85,6 @@
85
85
  "@rollup/plugin-alias": "^5.1.0",
86
86
  "@rollup/plugin-babel": "^6.0.4",
87
87
  "@rollup/plugin-commonjs": "^25.0.7",
88
- "@rollup/plugin-image": "^3.0.3",
89
- "@rollup/plugin-json": "^6.1.0",
90
- "@rollup/plugin-node-resolve": "^15.2.3",
91
88
  "@rollup/plugin-typescript": "^11.1.6",
92
89
  "@types/lodash.debounce": "^4.0.9",
93
90
  "@types/react-dom": "^18.2.23",
@@ -100,7 +97,6 @@
100
97
  "query-string": "^9.0.0",
101
98
  "react-intl": "^6.6.4",
102
99
  "rollup": "^4.13.2",
103
- "rollup-plugin-dts": "^6.1.0",
104
100
  "rollup-plugin-ignore": "^1.0.10",
105
101
  "rollup-plugin-node-externals": "^7.1.1",
106
102
  "rollup-plugin-postcss": "^4.0.2",
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from "react"
2
2
  import classnames from "classnames"
3
+ import { FocusOn } from "react-focus-on"
3
4
  import { usePopper } from "react-popper"
4
5
  import styles from "./MenuDropdown.module.scss"
5
6
 
@@ -106,22 +107,30 @@ export const MenuDropdown = ({
106
107
  }, [autoHide, handleDocumentClickForAutoHide])
107
108
 
108
109
  return (
109
- // Disabling these because we don't want this to be keyboard focusable.
110
- // Esc keypress should be used instead for the same behaviour (hasn't been implemented here yet)
111
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
112
- <div
113
- id={id}
114
- ref={setPopperElement}
115
- {...attributes.popper}
116
- style={popperStyles.popper}
117
- className={classnames(
118
- styles.menuContainer,
119
- width == "default" && styles.defaultWidth
120
- )}
121
- onClick={handleRootClick}
110
+ <FocusOn
111
+ enabled={!!referenceElement}
112
+ scrollLock={false}
113
+ noIsolation
114
+ shards={referenceElement ? [referenceElement] : undefined}
115
+ onEscapeKey={hideMenuDropdown}
122
116
  >
123
- {children}
124
- </div>
117
+ {/* eslint-disable-next-line
118
+ jsx-a11y/click-events-have-key-events,
119
+ jsx-a11y/no-static-element-interactions */}
120
+ <div
121
+ id={id}
122
+ ref={setPopperElement}
123
+ {...attributes.popper}
124
+ style={popperStyles.popper}
125
+ className={classnames(
126
+ styles.menuContainer,
127
+ width == "default" && styles.defaultWidth
128
+ )}
129
+ onClick={handleRootClick}
130
+ >
131
+ {children}
132
+ </div>
133
+ </FocusOn>
125
134
  )
126
135
  }
127
136