@particle-network/ui-react 0.6.2-beta.0 → 0.7.0-beta.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type SimplePopoverPlacement = 'top' | 'bottom' | 'left' | 'right'
|
|
2
|
+
export type SimplePopoverPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
3
|
export type SimplePopoverTriggerType = 'click' | 'hover';
|
|
4
4
|
export interface UXSimplePopoverProps {
|
|
5
5
|
/** Popover content */
|
|
@@ -19,7 +19,5 @@ export interface UXSimplePopoverProps {
|
|
|
19
19
|
trigger?: string;
|
|
20
20
|
content?: string;
|
|
21
21
|
};
|
|
22
|
-
/** popovertargetaction when triggerType is click: 'toggle' | 'show' | 'hide' */
|
|
23
|
-
popoverTargetAction?: 'toggle' | 'show' | 'hide';
|
|
24
22
|
}
|
|
25
23
|
export declare const UXSimplePopover: React.FC<UXSimplePopoverProps>;
|
|
@@ -5,7 +5,7 @@ const UXSimplePopover = (props)=>{
|
|
|
5
5
|
const { content, children, triggerType = 'hover', placement = 'top', delay = 300, closeDelay = 100, classNames = {
|
|
6
6
|
trigger: '',
|
|
7
7
|
content: ''
|
|
8
|
-
}
|
|
8
|
+
} } = props;
|
|
9
9
|
const id = useId().replace(/:/g, '');
|
|
10
10
|
const popoverId = `simple-popover-${id}`;
|
|
11
11
|
const anchorName = `--simple-popover-${id}`;
|
|
@@ -61,8 +61,8 @@ const UXSimplePopover = (props)=>{
|
|
|
61
61
|
const isClick = 'click' === triggerType;
|
|
62
62
|
const trigger = isClick ? /*#__PURE__*/ jsx("button", {
|
|
63
63
|
type: "button",
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
popoverTarget: popoverId,
|
|
65
|
+
popoverTargetAction: "toggle",
|
|
66
66
|
className: classNames.trigger,
|
|
67
67
|
style: {
|
|
68
68
|
margin: 0,
|