@synerise/ds-list-item 1.2.6 → 1.3.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.
- package/CHANGELOG.md +6 -0
- package/dist/ListItem.d.ts +3 -3
- package/dist/ListItem.types.d.ts +4 -7
- package/dist/components/HoverTooltip/HoverTooltip.const.d.ts +6 -0
- package/dist/components/HoverTooltip/HoverTooltip.const.js +14 -0
- package/dist/components/HoverTooltip/HoverTooltip.d.ts +1 -1
- package/dist/components/HoverTooltip/HoverTooltip.js +31 -24
- package/dist/components/HoverTooltip/HoverTooltip.styles.d.ts +1 -0
- package/dist/components/HoverTooltip/HoverTooltip.styles.js +5 -0
- package/dist/components/HoverTooltip/HoverTooltip.types.d.ts +1 -1
- package/dist/components/ListContext/ListContext.d.ts +2 -0
- package/dist/components/ListContext/ListContextProvider.d.ts +1 -1
- package/dist/components/ListContext/ListContextProvider.js +11 -3
- package/dist/components/Text/Text.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -4
- package/dist/utils.d.ts +0 -34
- package/dist/utils.js +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@1.2.6...@synerise/ds-list-item@1.3.0) (2026-01-20)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **information-card:** migrate to popover ([de900e4](https://github.com/Synerise/synerise-design/commit/de900e4bc1c32a4bbbf175401374619e691023f2))
|
|
11
|
+
|
|
6
12
|
## [1.2.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@1.2.5...@synerise/ds-list-item@1.2.6) (2026-01-15)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @synerise/ds-list-item
|
package/dist/ListItem.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ declare const ListItem: React.ForwardRefExoticComponent<import("./ListItem.types
|
|
|
15
15
|
direction?: "ltr" | "rtl";
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
highlight?: string;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
popoverProps?: Pick<import("@synerise/ds-popover").PopoverOptions, "getPopupContainer" | "offsetConfig" | "flipConfig" | "shiftConfig" | "initialOpen"> & {
|
|
19
|
+
placement?: import("@synerise/ds-popover").LegacyPlacement;
|
|
20
20
|
};
|
|
21
21
|
key?: React.Key;
|
|
22
22
|
itemKey?: React.Key;
|
|
@@ -36,5 +36,5 @@ declare const ListItem: React.ForwardRefExoticComponent<import("./ListItem.types
|
|
|
36
36
|
subMenu?: ListItemProps[];
|
|
37
37
|
indentLevel?: number;
|
|
38
38
|
featured?: boolean;
|
|
39
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "children" | "onClick" | keyof import("./ListItem.types").ListItemDividerProps | "checked" | "selected" | "copyable" | "copyValue" | "copyHint" | "copyTooltip" | "timeToHideTooltip" | "tooltipProps" | "description" | "direction" | "disabled" | "highlight" | "
|
|
39
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "children" | "onClick" | keyof import("./ListItem.types").ListItemDividerProps | "checked" | "selected" | "copyable" | "copyValue" | "copyHint" | "copyTooltip" | "timeToHideTooltip" | "tooltipProps" | "description" | "direction" | "disabled" | "highlight" | "popoverProps" | "key" | "itemKey" | "noHover" | "onItemHover" | "ordered" | "parent" | "prefixel" | "prefixVisibilityTrigger" | "renderHoverTooltip" | "size" | "suffixel" | "suffixVisibilityTrigger" | "text" | "type" | "subMenu" | "indentLevel" | "featured"> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<HTMLDivElement>>;
|
|
40
40
|
export default ListItem;
|
package/dist/ListItem.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Component, ComponentType, ForwardRefExoticComponent, Key, KeyboardEvent, LegacyRef, MouseEvent, ReactNode, RefAttributes } from 'react';
|
|
1
|
+
import type { ComponentType, ForwardRefExoticComponent, Key, KeyboardEvent, MouseEvent, ReactNode, RefAttributes } from 'react';
|
|
3
2
|
import { type StyledComponent } from 'styled-components';
|
|
3
|
+
import { type LegacyPlacement, type PopoverOptions } from '@synerise/ds-popover';
|
|
4
4
|
import type { TooltipProps } from '@synerise/ds-tooltip';
|
|
5
5
|
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
6
6
|
export type AddonRenderer = (hovered: boolean) => ReactNode;
|
|
@@ -23,9 +23,6 @@ export type ItemData<EventType = MouseEvent | KeyboardEvent> = {
|
|
|
23
23
|
domEvent: EventType;
|
|
24
24
|
};
|
|
25
25
|
export type ListItemEventHandler<EventType> = (item: ItemData<EventType>) => void;
|
|
26
|
-
export type TriggerHandle = Component<TriggerProps> & {
|
|
27
|
-
getPopupDomNode: () => HTMLElement;
|
|
28
|
-
};
|
|
29
26
|
/**
|
|
30
27
|
* @deprecated
|
|
31
28
|
* provide Copyable type instead
|
|
@@ -67,8 +64,8 @@ export type BaseListItemProps = ListItemDividerProps & {
|
|
|
67
64
|
direction?: 'ltr' | 'rtl';
|
|
68
65
|
disabled?: boolean;
|
|
69
66
|
highlight?: string;
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
popoverProps?: Pick<PopoverOptions, 'getPopupContainer' | 'offsetConfig' | 'flipConfig' | 'shiftConfig' | 'initialOpen'> & {
|
|
68
|
+
placement?: LegacyPlacement;
|
|
72
69
|
};
|
|
73
70
|
key?: Key;
|
|
74
71
|
itemKey?: Key;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FlipConfig, type HoverConfig, type OffsetConfig, type ShiftConfig } from '@synerise/ds-popover';
|
|
2
|
+
export declare const TRANSITION_DURATION = 150;
|
|
3
|
+
export declare const OFFSET_CONFIG: OffsetConfig;
|
|
4
|
+
export declare const FLIP_CONFIG: FlipConfig;
|
|
5
|
+
export declare const HOVER_CONFIG: HoverConfig;
|
|
6
|
+
export declare const SHIFT_CONFIG: ShiftConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type HoverTooltipProps } from './HoverTooltip.types';
|
|
3
|
-
declare const HoverTooltip: ({
|
|
3
|
+
declare const HoverTooltip: ({ popoverProps, renderHoverTooltip, children, style, }: HoverTooltipProps) => React.JSX.Element;
|
|
4
4
|
export default HoverTooltip;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import Trigger from 'rc-trigger';
|
|
3
2
|
import React, { useCallback } from 'react';
|
|
4
3
|
import { useTheme } from '@synerise/ds-core';
|
|
5
|
-
import {
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger, getPlacement } from '@synerise/ds-popover';
|
|
5
|
+
import { FLIP_CONFIG, HOVER_CONFIG, OFFSET_CONFIG, SHIFT_CONFIG, TRANSITION_DURATION } from './HoverTooltip.const';
|
|
6
|
+
import { PropagationStopper } from './HoverTooltip.styles';
|
|
6
7
|
var HoverTooltip = function HoverTooltip(_ref) {
|
|
7
|
-
var
|
|
8
|
-
var hoverTooltipProps = _ref.hoverTooltipProps,
|
|
8
|
+
var popoverProps = _ref.popoverProps,
|
|
9
9
|
renderHoverTooltip = _ref.renderHoverTooltip,
|
|
10
10
|
children = _ref.children,
|
|
11
11
|
style = _ref.style;
|
|
@@ -16,26 +16,33 @@ var HoverTooltip = function HoverTooltip(_ref) {
|
|
|
16
16
|
return event.stopPropagation();
|
|
17
17
|
};
|
|
18
18
|
}, []);
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
var popoverPlacement = getPlacement((popoverProps == null ? void 0 : popoverProps.placement) || 'right');
|
|
20
|
+
return (
|
|
21
|
+
/*#__PURE__*/
|
|
22
|
+
// onKeyDown is used to disallow propagating key events to tooltip's container element
|
|
23
|
+
React.createElement(PropagationStopper, {
|
|
24
|
+
onKeyDown: cancelBubblingEvent,
|
|
25
|
+
onClick: cancelBubblingEvent
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Popover, _extends({
|
|
27
|
+
trigger: "hover",
|
|
28
|
+
modal: false,
|
|
29
|
+
componentId: "information-card",
|
|
30
|
+
testId: "information-card",
|
|
31
|
+
shiftConfig: SHIFT_CONFIG,
|
|
32
|
+
offsetConfig: OFFSET_CONFIG,
|
|
33
|
+
flipConfig: FLIP_CONFIG,
|
|
34
|
+
hoverConfig: HOVER_CONFIG,
|
|
35
|
+
transitionDuration: TRANSITION_DURATION,
|
|
32
36
|
zIndex: zIndex
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
}, popoverProps, {
|
|
38
|
+
placement: popoverPlacement
|
|
39
|
+
}), /*#__PURE__*/React.createElement(PopoverContent, null, renderHoverTooltip && renderHoverTooltip()), /*#__PURE__*/React.createElement(PopoverTrigger, {
|
|
40
|
+
asChild: true
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: _extends({
|
|
43
|
+
position: 'relative'
|
|
44
|
+
}, style)
|
|
45
|
+
}, children))))
|
|
46
|
+
);
|
|
40
47
|
};
|
|
41
48
|
export default HoverTooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PropagationStopper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,6 +3,6 @@ import type { BasicItemProps } from '../../ListItem.types';
|
|
|
3
3
|
export type HoverTooltipProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
style?: CSSProperties;
|
|
6
|
-
|
|
6
|
+
popoverProps?: BasicItemProps['popoverProps'];
|
|
7
7
|
renderHoverTooltip?: () => JSX.Element;
|
|
8
8
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type DelayConfig } from '@synerise/ds-popover';
|
|
1
2
|
import type { ListItemProps } from '../../ListItem.types';
|
|
2
3
|
export type ListContextProps = {
|
|
3
4
|
onClick?: ListItemProps['onClick'];
|
|
5
|
+
popoverDelay?: DelayConfig;
|
|
4
6
|
selectedKeys?: [];
|
|
5
7
|
multiple?: boolean;
|
|
6
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type ListContextProps } from './ListContext';
|
|
3
|
-
export declare const ListContextProvider: ({ children, ...rest }: ListContextProps & {
|
|
3
|
+
export declare const ListContextProvider: ({ children, popoverDelay, ...rest }: ListContextProps & {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
1
|
+
var _excluded = ["children", "popoverDelay"];
|
|
2
2
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { FloatingDelayGroup } from '@synerise/ds-popover';
|
|
4
5
|
import { ListContext } from './ListContext';
|
|
5
6
|
export var ListContextProvider = function ListContextProvider(_ref) {
|
|
6
7
|
var children = _ref.children,
|
|
8
|
+
_ref$popoverDelay = _ref.popoverDelay,
|
|
9
|
+
popoverDelay = _ref$popoverDelay === void 0 ? {
|
|
10
|
+
open: 100,
|
|
11
|
+
close: 400
|
|
12
|
+
} : _ref$popoverDelay,
|
|
7
13
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
8
|
-
return /*#__PURE__*/React.createElement(
|
|
14
|
+
return /*#__PURE__*/React.createElement(FloatingDelayGroup, {
|
|
15
|
+
delay: popoverDelay
|
|
16
|
+
}, /*#__PURE__*/React.createElement(ListContext.Provider, {
|
|
9
17
|
value: rest
|
|
10
|
-
}, children);
|
|
18
|
+
}, children));
|
|
11
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["checked", "className", "children", "itemKey", "noHover", "size", "prefixel", "suffixel", "copyable", "copyHint", "copyValue", "copyTooltip", "timeToHideTooltip", "tooltipProps", "disabled", "description", "parent", "ordered", "indentLevel", "onClick", "onMouseOver", "onMouseDown", "onMouseLeave", "onBlur", "onFocus", "onItemHover", "onKeyDown", "prefixVisibilityTrigger", "suffixVisibilityTrigger", "highlight", "style", "
|
|
1
|
+
var _excluded = ["checked", "className", "children", "itemKey", "noHover", "size", "prefixel", "suffixel", "copyable", "copyHint", "copyValue", "copyTooltip", "timeToHideTooltip", "tooltipProps", "disabled", "description", "parent", "ordered", "indentLevel", "onClick", "onMouseOver", "onMouseDown", "onMouseLeave", "onBlur", "onFocus", "onItemHover", "onKeyDown", "prefixVisibilityTrigger", "suffixVisibilityTrigger", "highlight", "style", "popoverProps", "renderHoverTooltip", "subMenu", "featured", "ItemComponent"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import copy from 'copy-to-clipboard';
|
|
@@ -43,7 +43,7 @@ var Text = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
43
43
|
suffixVisibilityTrigger = props.suffixVisibilityTrigger,
|
|
44
44
|
highlight = props.highlight,
|
|
45
45
|
style = props.style,
|
|
46
|
-
|
|
46
|
+
popoverProps = props.popoverProps,
|
|
47
47
|
renderHoverTooltip = props.renderHoverTooltip,
|
|
48
48
|
subMenu = props.subMenu,
|
|
49
49
|
featured = props.featured,
|
|
@@ -212,7 +212,7 @@ var Text = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
212
212
|
}, rest));
|
|
213
213
|
if (renderHoverTooltip) {
|
|
214
214
|
return /*#__PURE__*/React.createElement(HoverTooltip, {
|
|
215
|
-
|
|
215
|
+
popoverProps: popoverProps,
|
|
216
216
|
renderHoverTooltip: renderHoverTooltip,
|
|
217
217
|
style: style
|
|
218
218
|
}, TextNode);
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { default } from './ListItem';
|
|
|
2
2
|
export { HoverTooltip, GroupItem } from './components';
|
|
3
3
|
export { ListWrapper, type ListWrapperProps, } from './components/ListWrapper/ListWrapper';
|
|
4
4
|
export { useListContext } from './components/ListContext/ListContext';
|
|
5
|
+
export { ListContextProvider } from './components/ListContext/ListContextProvider';
|
|
5
6
|
export { itemSizes, itemTypes, type ListItemProps, type BasicItemProps, type ItemSize, type ItemType, type ItemData, type StyledListItem, type ListItemEventHandler, } from './ListItem.types';
|
|
6
7
|
export * from './ListItem.const';
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,6 @@ export { default } from './ListItem';
|
|
|
2
2
|
export { HoverTooltip, GroupItem } from './components';
|
|
3
3
|
export { ListWrapper } from './components/ListWrapper/ListWrapper';
|
|
4
4
|
export { useListContext } from './components/ListContext/ListContext';
|
|
5
|
+
export { ListContextProvider } from './components/ListContext/ListContextProvider';
|
|
5
6
|
export { itemSizes, itemTypes } from './ListItem.types';
|
|
6
7
|
export * from './ListItem.const';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-list-item",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "ListItem UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -38,18 +38,17 @@
|
|
|
38
38
|
"@floating-ui/react": "^0.27.16",
|
|
39
39
|
"@synerise/ds-divider": "^1.2.6",
|
|
40
40
|
"@synerise/ds-icon": "^1.10.0",
|
|
41
|
+
"@synerise/ds-popover": "^1.3.0",
|
|
41
42
|
"@synerise/ds-tooltip": "^1.3.5",
|
|
42
43
|
"@synerise/ds-utils": "^1.5.3",
|
|
43
44
|
"classnames": "^2.5.1",
|
|
44
|
-
"rc-trigger": "^5.3.4",
|
|
45
45
|
"uuid": "^8.3.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@synerise/ds-core": "*",
|
|
49
|
-
"antd": "4.24.16",
|
|
50
49
|
"copy-to-clipboard": "^3.3.1",
|
|
51
50
|
"react": ">=16.9.0 <= 18.3.1",
|
|
52
51
|
"styled-components": "^5.3.3"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "db758824923a2a231a0de460f0d6d10739514cda"
|
|
55
54
|
}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const TRIGGER_PLACEMENTS: {
|
|
2
|
-
left: {
|
|
3
|
-
points: string[];
|
|
4
|
-
offset: number[];
|
|
5
|
-
};
|
|
6
|
-
right: {
|
|
7
|
-
points: string[];
|
|
8
|
-
offset: number[];
|
|
9
|
-
};
|
|
10
|
-
top: {
|
|
11
|
-
points: string[];
|
|
12
|
-
offset: number[];
|
|
13
|
-
};
|
|
14
|
-
bottom: {
|
|
15
|
-
points: string[];
|
|
16
|
-
offset: number[];
|
|
17
|
-
};
|
|
18
|
-
topLeft: {
|
|
19
|
-
points: string[];
|
|
20
|
-
offset: number[];
|
|
21
|
-
};
|
|
22
|
-
topRight: {
|
|
23
|
-
points: string[];
|
|
24
|
-
offset: number[];
|
|
25
|
-
};
|
|
26
|
-
bottomRight: {
|
|
27
|
-
points: string[];
|
|
28
|
-
offset: number[];
|
|
29
|
-
};
|
|
30
|
-
bottomLeft: {
|
|
31
|
-
points: string[];
|
|
32
|
-
offset: number[];
|
|
33
|
-
};
|
|
34
|
-
};
|
package/dist/utils.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export var TRIGGER_PLACEMENTS = {
|
|
2
|
-
left: {
|
|
3
|
-
points: ['cr', 'cl'],
|
|
4
|
-
offset: [-8, 0]
|
|
5
|
-
},
|
|
6
|
-
right: {
|
|
7
|
-
points: ['cl', 'cr'],
|
|
8
|
-
offset: [0, 0]
|
|
9
|
-
},
|
|
10
|
-
top: {
|
|
11
|
-
points: ['bc', 'tc'],
|
|
12
|
-
offset: [0, -8]
|
|
13
|
-
},
|
|
14
|
-
bottom: {
|
|
15
|
-
points: ['tc', 'bc'],
|
|
16
|
-
offset: [0, 8]
|
|
17
|
-
},
|
|
18
|
-
topLeft: {
|
|
19
|
-
points: ['bl', 'tl'],
|
|
20
|
-
offset: [0, -8]
|
|
21
|
-
},
|
|
22
|
-
topRight: {
|
|
23
|
-
points: ['br', 'tr'],
|
|
24
|
-
offset: [0, -8]
|
|
25
|
-
},
|
|
26
|
-
bottomRight: {
|
|
27
|
-
points: ['tr', 'br'],
|
|
28
|
-
offset: [0, 8]
|
|
29
|
-
},
|
|
30
|
-
bottomLeft: {
|
|
31
|
-
points: ['tl', 'bl'],
|
|
32
|
-
offset: [0, 8]
|
|
33
|
-
}
|
|
34
|
-
};
|