@hh.ru/magritte-ui-action-list 5.4.4 → 5.4.5

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/ActionList.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- import { ActionListProps } from './types';
2
+ import { ActionListProps } from '@hh.ru/magritte-ui-action-list/types';
3
3
  export declare const ActionList: FC<ActionListProps>;
package/ActionList.js CHANGED
@@ -16,9 +16,13 @@ const ActionList = ({ children, dropProps, bottomSheetProps, visible, ...commonP
16
16
  }
17
17
  closedByKeyboardRef.current = false;
18
18
  }
19
- }, [dropProps.activatorRef, visible]);
20
- return (jsxs(Fragment, { children: [jsx(Drop, { ...dropProps, ...commonProps, autoFocusWhenOpened: true, keyboardNavigationMode: "list", onKeyDown: (event) => {
21
- if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {
19
+ }, [visible]);
20
+ return (jsxs(Fragment, { children: [jsx(Drop, { ...dropProps, ...commonProps, autoFocusWhenOpened: true, keyboardNavigationMode: "list", onKeyDownCapture: (event) => {
21
+ if (keyboardMatches(event.nativeEvent, [
22
+ keyboardKeys.Enter,
23
+ keyboardKeys.Escape,
24
+ keyboardKeys.Space,
25
+ ])) {
22
26
  closedByKeyboardRef.current = true;
23
27
  }
24
28
  }, ref: dropRefCallback, space: 400, visible: visible, children: children }), jsx(BottomSheet, { ...bottomSheetProps, ...commonProps, height: "content", visible: visible, children: children })] }));
package/ActionList.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ActionList.js","sources":["../src/ActionList.tsx"],"sourcesContent":["import { FC, KeyboardEvent as ReactKeyboardEvent, useEffect, useRef } from 'react';\n\nimport { keyboardKeys, keyboardMatches } from '@hh.ru/magritte-common-keyboard';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionListProps } from '@hh.ru/magritte-ui-action-list/types';\nimport { BottomSheet } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\n\nexport const ActionList: FC<ActionListProps> = ({ children, dropProps, bottomSheetProps, visible, ...commonProps }) => {\n const closedByKeyboardRef = useRef(false);\n const dropRef = useRef<HTMLElement>(null);\n const dropRefCallback = useMultipleRefs(dropRef, dropProps.ref);\n\n useEffect(() => {\n if (!visible) {\n if (closedByKeyboardRef.current && dropProps.activatorRef.current !== null) {\n dropProps.activatorRef.current.focus();\n }\n closedByKeyboardRef.current = false;\n }\n }, [dropProps.activatorRef, visible]);\n\n return (\n <>\n <Drop\n {...dropProps}\n {...commonProps}\n autoFocusWhenOpened\n keyboardNavigationMode=\"list\"\n onKeyDown={(event: ReactKeyboardEvent) => {\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n closedByKeyboardRef.current = true;\n }\n }}\n ref={dropRefCallback}\n space={400}\n visible={visible}\n >\n {children}\n </Drop>\n <BottomSheet {...bottomSheetProps} {...commonProps} height=\"content\" visible={visible}>\n {children}\n </BottomSheet>\n </>\n );\n};\n\nActionList.displayName = 'ActionList';\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAQa,MAAA,UAAU,GAAwB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,KAAI;AAClH,IAAA,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAEhE,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,OAAO,EAAE;YACV,IAAI,mBAAmB,CAAC,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,OAAO,KAAK,IAAI,EAAE;AACxE,gBAAA,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AAC1C,aAAA;AACD,YAAA,mBAAmB,CAAC,OAAO,GAAG,KAAK,CAAC;AACvC,SAAA;KACJ,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtC,QACIA,4BACIC,GAAC,CAAA,IAAI,OACG,SAAS,EAAA,GACT,WAAW,EACf,mBAAmB,QACnB,sBAAsB,EAAC,MAAM,EAC7B,SAAS,EAAE,CAAC,KAAyB,KAAI;AACrC,oBAAA,IAAI,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE;AAC9E,wBAAA,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;AACtC,qBAAA;AACL,iBAAC,EACD,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,OAAO,EAEf,QAAA,EAAA,QAAQ,GACN,EACPA,GAAA,CAAC,WAAW,EAAA,EAAA,GAAK,gBAAgB,EAAM,GAAA,WAAW,EAAE,MAAM,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAChF,QAAA,EAAA,QAAQ,EACC,CAAA,CAAA,EAAA,CACf,EACL;AACN,EAAE;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"ActionList.js","sources":["../src/ActionList.tsx"],"sourcesContent":["import { FC, KeyboardEvent as ReactKeyboardEvent, useEffect, useRef } from 'react';\n\nimport { keyboardKeys, keyboardMatches } from '@hh.ru/magritte-common-keyboard';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionListProps } from '@hh.ru/magritte-ui-action-list/types';\nimport { BottomSheet } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\n\nexport const ActionList: FC<ActionListProps> = ({ children, dropProps, bottomSheetProps, visible, ...commonProps }) => {\n const closedByKeyboardRef = useRef(false);\n const dropRef = useRef<HTMLElement>(null);\n const dropRefCallback = useMultipleRefs(dropRef, dropProps.ref);\n\n useEffect(() => {\n if (!visible) {\n if (closedByKeyboardRef.current && dropProps.activatorRef.current !== null) {\n dropProps.activatorRef.current.focus();\n }\n closedByKeyboardRef.current = false;\n }\n }, [visible]);\n\n return (\n <>\n <Drop\n {...dropProps}\n {...commonProps}\n autoFocusWhenOpened\n keyboardNavigationMode=\"list\"\n onKeyDownCapture={(event: ReactKeyboardEvent) => {\n if (\n keyboardMatches(event.nativeEvent, [\n keyboardKeys.Enter,\n keyboardKeys.Escape,\n keyboardKeys.Space,\n ])\n ) {\n closedByKeyboardRef.current = true;\n }\n }}\n ref={dropRefCallback}\n space={400}\n visible={visible}\n >\n {children}\n </Drop>\n <BottomSheet {...bottomSheetProps} {...commonProps} height=\"content\" visible={visible}>\n {children}\n </BottomSheet>\n </>\n );\n};\n\nActionList.displayName = 'ActionList';\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAQa,MAAA,UAAU,GAAwB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,KAAI;AAClH,IAAA,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAEhE,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,OAAO,EAAE;YACV,IAAI,mBAAmB,CAAC,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,OAAO,KAAK,IAAI,EAAE;AACxE,gBAAA,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AAC1C,aAAA;AACD,YAAA,mBAAmB,CAAC,OAAO,GAAG,KAAK,CAAC;AACvC,SAAA;AACL,KAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,QACIA,4BACIC,GAAC,CAAA,IAAI,OACG,SAAS,EAAA,GACT,WAAW,EACf,mBAAmB,QACnB,sBAAsB,EAAC,MAAM,EAC7B,gBAAgB,EAAE,CAAC,KAAyB,KAAI;AAC5C,oBAAA,IACI,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE;AAC/B,wBAAA,YAAY,CAAC,KAAK;AAClB,wBAAA,YAAY,CAAC,MAAM;AACnB,wBAAA,YAAY,CAAC,KAAK;AACrB,qBAAA,CAAC,EACJ;AACE,wBAAA,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;AACtC,qBAAA;AACL,iBAAC,EACD,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,OAAO,EAEf,QAAA,EAAA,QAAQ,GACN,EACPA,GAAA,CAAC,WAAW,EAAA,EAAA,GAAK,gBAAgB,EAAM,GAAA,WAAW,EAAE,MAAM,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAChF,QAAA,EAAA,QAAQ,EACC,CAAA,CAAA,EAAA,CACf,EACL;AACN,EAAE;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { type ActionListProps } from './types';
2
- export * from './ActionList';
1
+ export { type ActionListProps } from '@hh.ru/magritte-ui-action-list/types';
2
+ export * from '@hh.ru/magritte-ui-action-list/ActionList';
3
3
  export * from '@hh.ru/magritte-ui-theme-provider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-action-list",
3
- "version": "5.4.4",
3
+ "version": "5.4.5",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -16,17 +16,18 @@
16
16
  "eslint-test": "yarn root:eslint-test $(pwd)",
17
17
  "ts-config": "yarn root:ts-config $(pwd)",
18
18
  "ts-check": "yarn root:ts-check $(pwd)",
19
- "test": "yarn root:test $(pwd)"
19
+ "test": "yarn root:test $(pwd)",
20
+ "watch": "yarn root:watch $(pwd)"
20
21
  },
21
22
  "dependencies": {
22
- "@hh.ru/magritte-common-keyboard": "4.0.0",
23
- "@hh.ru/magritte-common-use-multiple-refs": "1.1.2",
24
- "@hh.ru/magritte-internal-drop-base": "6.0.1",
25
- "@hh.ru/magritte-ui-bottom-sheet": "4.1.33",
26
- "@hh.ru/magritte-ui-breakpoint": "4.0.2",
27
- "@hh.ru/magritte-ui-button": "5.0.1",
28
- "@hh.ru/magritte-ui-drop": "6.0.2",
29
- "@hh.ru/magritte-ui-theme-provider": "1.1.24"
23
+ "@hh.ru/magritte-common-keyboard": "4.0.1",
24
+ "@hh.ru/magritte-common-use-multiple-refs": "1.1.3",
25
+ "@hh.ru/magritte-internal-drop-base": "6.0.2",
26
+ "@hh.ru/magritte-ui-bottom-sheet": "4.1.34",
27
+ "@hh.ru/magritte-ui-breakpoint": "4.0.3",
28
+ "@hh.ru/magritte-ui-button": "5.0.2",
29
+ "@hh.ru/magritte-ui-drop": "6.0.3",
30
+ "@hh.ru/magritte-ui-theme-provider": "1.1.25"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "react": ">=18.2.0"
@@ -34,5 +35,5 @@
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
- "gitHead": "4480faadc19af08673481a84a62f77d081e9be2e"
38
- }
38
+ "gitHead": "bdbcf07ae5f66002ea09633961d0c9c008c70cd6"
39
+ }