@synerise/ds-popover 1.1.0 → 1.1.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popover@1.1.0...@synerise/ds-popover@1.1.1) (2025-11-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **date-picker:** dropdown state ([e16e4ce](https://github.com/Synerise/synerise-design/commit/e16e4ce8374c374512d0dc59a2361000ab89c8b9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 1.1.0 (2025-11-06)
|
|
7
18
|
|
|
8
19
|
|
package/dist/Popover.types.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export type PopoverOptions = {
|
|
|
18
18
|
componentId?: string;
|
|
19
19
|
autoUpdate?: boolean | AutoUpdateOptions;
|
|
20
20
|
open?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @default true
|
|
23
|
+
* set to false in order to prevent returning focus to the trigger element after popover closes
|
|
24
|
+
*/
|
|
25
|
+
returnFocus?: boolean;
|
|
21
26
|
offsetConfig?: OffsetConfig;
|
|
22
27
|
flipConfig?: FlipConfig;
|
|
23
28
|
shiftConfig?: ShiftConfig;
|
|
@@ -20,6 +20,8 @@ export var PopoverContent = /*#__PURE__*/forwardRef(function PopoverContent(_ref
|
|
|
20
20
|
descriptionId = _usePopoverContext.descriptionId,
|
|
21
21
|
transitionStyles = _usePopoverContext.transitionStyles,
|
|
22
22
|
componentId = _usePopoverContext.componentId,
|
|
23
|
+
_usePopoverContext$re = _usePopoverContext.returnFocus,
|
|
24
|
+
returnFocus = _usePopoverContext$re === void 0 ? true : _usePopoverContext$re,
|
|
23
25
|
zIndex = _usePopoverContext.zIndex;
|
|
24
26
|
var theme = useTheme();
|
|
25
27
|
var _useState = useState(false),
|
|
@@ -55,7 +57,8 @@ export var PopoverContent = /*#__PURE__*/forwardRef(function PopoverContent(_ref
|
|
|
55
57
|
}, /*#__PURE__*/React.createElement(FloatingFocusManager, {
|
|
56
58
|
initialFocus: -1,
|
|
57
59
|
context: floatingContext,
|
|
58
|
-
modal: modal
|
|
60
|
+
modal: modal,
|
|
61
|
+
returnFocus: returnFocus
|
|
59
62
|
}, /*#__PURE__*/React.createElement("div", _extends({}, dataProps, {
|
|
60
63
|
ref: ref,
|
|
61
64
|
style: _extends({}, floatingStyles, style, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type OpenChangeReason } from '@floating-ui/react';
|
|
2
2
|
import { type PopoverOptions } from '../Popover.types';
|
|
3
|
-
export declare const usePopover: ({ initialOpen, placement, modal, trigger, open: controlledOpen, onOpenChange: setControlledOpen, onDismiss, transitionDuration, getPopupContainer, autoUpdate: autoUpdateWhileMounted, dismissConfig, offsetConfig, flipConfig, shiftConfig, testId, componentId, listNavigationConfig, getTransitionConfig, zIndex, }?: PopoverOptions) => {
|
|
3
|
+
export declare const usePopover: ({ initialOpen, placement, modal, trigger, open: controlledOpen, onOpenChange: setControlledOpen, onDismiss, transitionDuration, getPopupContainer, autoUpdate: autoUpdateWhileMounted, dismissConfig, offsetConfig, flipConfig, shiftConfig, testId, componentId, returnFocus, listNavigationConfig, getTransitionConfig, zIndex, }?: PopoverOptions) => {
|
|
4
4
|
modal: boolean | undefined;
|
|
5
5
|
labelId: string | undefined;
|
|
6
6
|
getPopupContainer: ((element: HTMLElement) => HTMLElement) | undefined;
|
|
@@ -9,6 +9,7 @@ export declare const usePopover: ({ initialOpen, placement, modal, trigger, open
|
|
|
9
9
|
setDescriptionId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
10
10
|
testId: string;
|
|
11
11
|
zIndex: number | undefined;
|
|
12
|
+
returnFocus: boolean | undefined;
|
|
12
13
|
componentId: string | undefined;
|
|
13
14
|
placement: import("@floating-ui/utils").Placement;
|
|
14
15
|
strategy: import("@floating-ui/utils").Strategy;
|
package/dist/hooks/usePopover.js
CHANGED
|
@@ -30,6 +30,7 @@ export var usePopover = function usePopover(_temp) {
|
|
|
30
30
|
_ref$testId = _ref.testId,
|
|
31
31
|
testId = _ref$testId === void 0 ? 'noTestId' : _ref$testId,
|
|
32
32
|
componentId = _ref.componentId,
|
|
33
|
+
returnFocus = _ref.returnFocus,
|
|
33
34
|
listNavigationConfig = _ref.listNavigationConfig,
|
|
34
35
|
_ref$getTransitionCon = _ref.getTransitionConfig,
|
|
35
36
|
getTransitionConfig = _ref$getTransitionCon === void 0 ? getDefaultTransitionConfig : _ref$getTransitionCon,
|
|
@@ -111,7 +112,8 @@ export var usePopover = function usePopover(_temp) {
|
|
|
111
112
|
setDescriptionId: setDescriptionId,
|
|
112
113
|
testId: testId,
|
|
113
114
|
zIndex: zIndex,
|
|
115
|
+
returnFocus: returnFocus,
|
|
114
116
|
componentId: componentId
|
|
115
117
|
});
|
|
116
|
-
}, [getPopupContainer, isMounted, setOpen, transitionDuration, styles, interactions, data, modal, labelId, descriptionId, zIndex, testId, componentId]);
|
|
118
|
+
}, [getPopupContainer, isMounted, setOpen, transitionDuration, styles, interactions, data, modal, labelId, descriptionId, zIndex, testId, returnFocus, componentId]);
|
|
117
119
|
};
|
|
@@ -7,6 +7,7 @@ export declare const usePopoverContext: () => {
|
|
|
7
7
|
setDescriptionId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
8
8
|
testId: string;
|
|
9
9
|
zIndex: number | undefined;
|
|
10
|
+
returnFocus: boolean | undefined;
|
|
10
11
|
componentId: string | undefined;
|
|
11
12
|
placement: import("@floating-ui/utils").Placement;
|
|
12
13
|
strategy: import("@floating-ui/utils").Strategy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-popover",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Popover UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@synerise/ds-core": "*",
|
|
44
44
|
"react": ">=16.9.0 <= 18.3.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "085189e79075b23a8fb86ce9b7d930f6ac7b3d23"
|
|
47
47
|
}
|