@hh.ru/magritte-ui-action-list 8.1.119 → 8.1.120

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 '@hh.ru/magritte-ui-action-list/types';
2
+ import { ActionListProps } from './types';
3
3
  export declare const ActionList: FC<ActionListProps>;
package/ActionList.js CHANGED
@@ -7,28 +7,47 @@ import { Drop } from '@hh.ru/magritte-ui-drop';
7
7
  import { VSpacing } from '@hh.ru/magritte-ui-spacing';
8
8
 
9
9
  const ActionList = ({ children, dropProps, bottomSheetProps, visible, ...commonProps }) => {
10
- const closedByKeyboardRef = useRef(false);
11
- const dropRef = useRef(null);
12
- const dropRefCallback = useMultipleRefs(dropRef, dropProps.ref);
13
- useEffect(() => {
14
- if (!visible) {
15
- if (closedByKeyboardRef.current && dropProps.activatorRef.current !== null) {
16
- dropProps.activatorRef.current.focus();
17
- }
18
- closedByKeyboardRef.current = false;
19
- }
20
- }, [dropProps.activatorRef, visible]);
21
- return (jsxs(Fragment, { children: [jsx(Drop, { ...dropProps, ...commonProps, autoFocusWhenOpened: true, keyboardNavigationMode: "list", onKeyDownCapture: (event) => {
22
- if (keyboardMatches(event.nativeEvent, [
23
- keyboardKeys.Enter,
24
- keyboardKeys.Escape,
25
- keyboardKeys.Space,
26
- ])) {
27
- closedByKeyboardRef.current = true;
28
- }
29
- }, ref: dropRefCallback, padding: dropProps.padding ?? 16, visible: visible, children: children }), jsxs(BottomSheet, { ...bottomSheetProps, ...commonProps, height: "content", visible: visible, children: [children, jsx(VSpacing, { default: 16 })] })] }));
10
+ const closedByKeyboardRef = useRef(false);
11
+ const dropRef = useRef(null);
12
+ const dropRefCallback = useMultipleRefs(dropRef, dropProps.ref);
13
+ useEffect(() => {
14
+ if (!visible) {
15
+ if (closedByKeyboardRef.current && dropProps.activatorRef.current !== null) {
16
+ dropProps.activatorRef.current.focus();
17
+ }
18
+ closedByKeyboardRef.current = false;
19
+ }
20
+ }, [dropProps.activatorRef, visible]);
21
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
22
+ /* @__PURE__ */ jsx(
23
+ Drop,
24
+ {
25
+ ...dropProps,
26
+ ...commonProps,
27
+ autoFocusWhenOpened: true,
28
+ keyboardNavigationMode: "list",
29
+ onKeyDownCapture: (event) => {
30
+ if (keyboardMatches(event.nativeEvent, [
31
+ keyboardKeys.Enter,
32
+ keyboardKeys.Escape,
33
+ keyboardKeys.Space
34
+ ])) {
35
+ closedByKeyboardRef.current = true;
36
+ }
37
+ },
38
+ ref: dropRefCallback,
39
+ padding: dropProps.padding ?? 16,
40
+ visible,
41
+ children
42
+ }
43
+ ),
44
+ /* @__PURE__ */ jsxs(BottomSheet, { ...bottomSheetProps, ...commonProps, height: "content", visible, children: [
45
+ children,
46
+ /* @__PURE__ */ jsx(VSpacing, { default: 16 })
47
+ ] })
48
+ ] });
30
49
  };
31
- ActionList.displayName = 'ActionList';
50
+ ActionList.displayName = "ActionList";
32
51
 
33
52
  export { ActionList };
34
53
  //# sourceMappingURL=ActionList.js.map
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';\nimport { VSpacing } from '@hh.ru/magritte-ui-spacing';\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 as React.Ref<HTMLElement>);\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 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 padding={dropProps.padding ?? 16}\n visible={visible}\n >\n {children}\n </Drop>\n <BottomSheet {...bottomSheetProps} {...commonProps} height=\"content\" visible={visible}>\n {children}\n <VSpacing default={16} />\n </BottomSheet>\n </>\n );\n};\n\nActionList.displayName = 'ActionList';\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASa,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,GAA6B,CAAC,CAAC;IAE1F,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,OAAO,EAAE;AACV,YAAA,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;AACD,YAAA,mBAAmB,CAAC,OAAO,GAAG,KAAK,CAAC;SACvC;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,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;qBACtC;iBACJ,EACD,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,SAAS,CAAC,OAAO,IAAI,EAAE,EAChC,OAAO,EAAE,OAAO,YAEf,QAAQ,EAAA,CACN,EACPD,IAAA,CAAC,WAAW,EAAA,EAAA,GAAK,gBAAgB,EAAM,GAAA,WAAW,EAAE,MAAM,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAChF,QAAA,EAAA,CAAA,QAAQ,EACTC,GAAC,CAAA,QAAQ,IAAC,OAAO,EAAE,EAAE,EAAI,CAAA,CAAA,EAAA,CACf,CACf,EAAA,CAAA,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';\nimport { VSpacing } from '@hh.ru/magritte-ui-spacing';\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 as React.Ref<HTMLElement>);\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 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 padding={dropProps.padding ?? 16}\n visible={visible}\n >\n {children}\n </Drop>\n <BottomSheet {...bottomSheetProps} {...commonProps} height=\"content\" visible={visible}>\n {children}\n <VSpacing default={16} />\n </BottomSheet>\n </>\n );\n};\n\nActionList.displayName = 'ActionList';\n"],"names":[],"mappings":";;;;;;;;AASa,MAAA,UAAA,GAAkC,CAAC,EAAE,QAAA,EAAU,WAAW,gBAAkB,EAAA,OAAA,EAAS,GAAG,WAAA,EAAkB,KAAA;AACnH,EAAM,MAAA,mBAAA,GAAsB,OAAO,KAAK,CAAA,CAAA;AACxC,EAAM,MAAA,OAAA,GAAU,OAAoB,IAAI,CAAA,CAAA;AACxC,EAAA,MAAM,eAAkB,GAAA,eAAA,CAAgB,OAAS,EAAA,SAAA,CAAU,GAA6B,CAAA,CAAA;AAExF,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,IAAI,CAAC,OAAS,EAAA;AACV,MAAA,IAAI,mBAAoB,CAAA,OAAA,IAAW,SAAU,CAAA,YAAA,CAAa,YAAY,IAAM,EAAA;AACxE,QAAU,SAAA,CAAA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te-ui-action-list/ActionList';
1
+ export { type ActionListProps } from './types';
2
+ export * from './ActionList';
package/index.mock.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- export { type ActionListProps } from '@hh.ru/magritte-ui-action-list/types';
2
+ export { type ActionListProps } from './types';
3
3
  export declare const ActionList: FC<Record<string, unknown>>;
package/index.mock.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
2
2
 
3
- const ActionList = mockComponent('ActionList', undefined, {
4
- withChildren: true,
3
+ const ActionList = mockComponent("ActionList", void 0, {
4
+ withChildren: true
5
5
  });
6
6
 
7
7
  export { ActionList };
package/index.mock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type ActionListProps } from '@hh.ru/magritte-ui-action-list/types';\n\nexport const ActionList: FC<Record<string, unknown>> = mockComponent('ActionList', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;MAMa,UAAU,GAAgC,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE;AAC1F,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
1
+ {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type ActionListProps } from '@hh.ru/magritte-ui-action-list/types';\n\nexport const ActionList: FC<Record<string, unknown>> = mockComponent('ActionList', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;AAMa,MAAA,UAAA,GAA0C,aAAc,CAAA,YAAA,EAAc,KAAW,CAAA,EAAA;AAAA,EAC1F,YAAc,EAAA,IAAA;AAClB,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-action-list",
3
- "version": "8.1.119",
3
+ "version": "8.1.120",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@hh.ru/magritte-common-keyboard": "4.3.6",
23
23
  "@hh.ru/magritte-common-use-multiple-refs": "1.1.12",
24
- "@hh.ru/magritte-internal-drop-base": "7.2.21",
25
- "@hh.ru/magritte-ui-bottom-sheet": "9.4.48",
24
+ "@hh.ru/magritte-internal-drop-base": "7.2.22",
25
+ "@hh.ru/magritte-ui-bottom-sheet": "9.4.49",
26
26
  "@hh.ru/magritte-ui-breakpoint": "6.1.2",
27
- "@hh.ru/magritte-ui-button": "7.3.6",
28
- "@hh.ru/magritte-ui-drop": "12.3.60",
27
+ "@hh.ru/magritte-ui-button": "7.3.7",
28
+ "@hh.ru/magritte-ui-drop": "12.3.61",
29
29
  "@hh.ru/magritte-ui-mock-component": "1.1.8",
30
- "@hh.ru/magritte-ui-spacing": "2.1.30"
30
+ "@hh.ru/magritte-ui-spacing": "2.1.31"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=18.2.0"
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "b0ff5da48fb29d516c8289082560ee1882d16986"
38
+ "gitHead": "f6539d7a0e7cd42dd851458db1de04a748bbee03"
39
39
  }