@moda/om 21.6.12 → 21.7.0

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.
@@ -5,5 +5,6 @@ export type SlidingPaneProps = React.HTMLAttributes<HTMLDivElement> & {
5
5
  title: string;
6
6
  visible: boolean;
7
7
  onClose: () => void;
8
+ autoFocus?: boolean;
8
9
  };
9
10
  export declare const SlidingPane: React.FC<SlidingPaneProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda/om",
3
- "version": "21.6.12",
3
+ "version": "21.7.0",
4
4
  "description": "Moda Operandi design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -12,6 +12,7 @@ export type SlidingPaneProps = React.HTMLAttributes<HTMLDivElement> & {
12
12
  title: string;
13
13
  visible: boolean;
14
14
  onClose: () => void;
15
+ autoFocus?: boolean;
15
16
  };
16
17
 
17
18
  export const SlidingPane: React.FC<SlidingPaneProps> = ({
@@ -20,6 +21,7 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
20
21
  visible,
21
22
  children,
22
23
  onClose,
24
+ autoFocus = true,
23
25
  ...rest
24
26
  }) => {
25
27
  return (
@@ -31,7 +33,12 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
31
33
  onClick={onClose}
32
34
  ></div>
33
35
 
34
- <FocusOn enabled={visible} onClickOutside={onClose} onEscapeKey={onClose}>
36
+ <FocusOn
37
+ enabled={visible}
38
+ autoFocus={autoFocus}
39
+ onClickOutside={onClose}
40
+ onEscapeKey={onClose}
41
+ >
35
42
  <div
36
43
  className={classNames('SlidingPane', className, {
37
44
  'SlidingPane--active': visible