@cloud-ru/ds-uikit-product-widget 1.1.1 → 2.0.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 +14 -0
- package/README.md +7 -7
- package/dist/cjs/components/Widget/Widget.js +2 -1
- package/dist/cjs/types.d.ts +5 -3
- package/dist/esm/components/Widget/Widget.js +3 -2
- package/dist/esm/types.d.ts +5 -3
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/components/Widget/Widget.tsx +11 -1
- package/src/types.ts +4 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/ds-uikit-product-widget",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Карточка продуктового виджета с кликабельным заголовком, SegmentControl, действиями и состояниями loading/error.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"classnames": "^2.5.1",
|
|
43
|
-
"@cloud-ru/ds-adaptive": "^1.0.
|
|
44
|
-
"@cloud-ru/ds-icons": "^1.7.
|
|
45
|
-
"@cloud-ru/ds-list": "^3.0.
|
|
46
|
-
"@cloud-ru/ds-
|
|
47
|
-
"@cloud-ru/ds-
|
|
43
|
+
"@cloud-ru/ds-adaptive": "^1.0.3",
|
|
44
|
+
"@cloud-ru/ds-icons": "^1.7.1",
|
|
45
|
+
"@cloud-ru/ds-list": "^3.0.3",
|
|
46
|
+
"@cloud-ru/ds-info-block": "^1.0.4",
|
|
47
|
+
"@cloud-ru/ds-button": "^1.0.5",
|
|
48
|
+
"@cloud-ru/ds-materials": "^2.0.2",
|
|
48
49
|
"@cloud-ru/ds-locale": "^1.0.0",
|
|
49
|
-
"@cloud-ru/ds-
|
|
50
|
-
"@cloud-ru/ds-
|
|
51
|
-
"@cloud-ru/ds-
|
|
52
|
-
"@cloud-ru/ds-
|
|
53
|
-
"@cloud-ru/ds-
|
|
54
|
-
"@cloud-ru/ds-utils": "^1.2.0"
|
|
50
|
+
"@cloud-ru/ds-segment-control": "^1.0.18",
|
|
51
|
+
"@cloud-ru/ds-tooltip": "^1.0.16",
|
|
52
|
+
"@cloud-ru/ds-uikit-product-title-clickable": "^2.0.1",
|
|
53
|
+
"@cloud-ru/ds-utils": "^1.3.0",
|
|
54
|
+
"@cloud-ru/ds-skeleton": "^1.0.3"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -26,6 +26,7 @@ function WidgetComponent({
|
|
|
26
26
|
segmentControl,
|
|
27
27
|
...rest
|
|
28
28
|
}: WidgetProps) {
|
|
29
|
+
const { title, icon, titleTag, children: headerChildren, ...headerProps } = header;
|
|
29
30
|
const { layoutType: contextLayoutType } = useAdaptiveLayout();
|
|
30
31
|
const isMobile = isMobileLayout(contextLayoutType);
|
|
31
32
|
const wide = wideProp && !isMobile;
|
|
@@ -63,7 +64,16 @@ function WidgetComponent({
|
|
|
63
64
|
<Skeleton loading className={styles.skeletonTitle} />
|
|
64
65
|
</div>
|
|
65
66
|
) : (
|
|
66
|
-
<TitleClickable
|
|
67
|
+
<TitleClickable
|
|
68
|
+
{...headerProps}
|
|
69
|
+
className={cn(styles.titleClickable, header.className)}
|
|
70
|
+
content={
|
|
71
|
+
<>
|
|
72
|
+
<TitleClickable.SimpleTitle title={title} icon={icon} titleTag={titleTag} />
|
|
73
|
+
{headerChildren}
|
|
74
|
+
</>
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
67
77
|
)}
|
|
68
78
|
|
|
69
79
|
{!wide && (
|
package/src/types.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { ButtonProps } from '@cloud-ru/ds-button';
|
|
|
2
2
|
import type { InfoBlockProps } from '@cloud-ru/ds-info-block';
|
|
3
3
|
import type { SegmentControlProps } from '@cloud-ru/ds-segment-control';
|
|
4
4
|
import { TooltipProps } from '@cloud-ru/ds-tooltip';
|
|
5
|
-
import {
|
|
5
|
+
import { TitleClickable } from '@cloud-ru/ds-uikit-product-title-clickable';
|
|
6
6
|
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
7
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
7
|
+
import { MouseEventHandler, PropsWithChildren, ReactNode } from 'react';
|
|
8
8
|
|
|
9
9
|
import { BUTTON_TYPE } from './constants';
|
|
10
10
|
|
|
@@ -12,10 +12,7 @@ export type WidgetState = 'default' | 'loading' | 'error';
|
|
|
12
12
|
|
|
13
13
|
export type WidgetLayoutType = 'desktop' | 'mobile';
|
|
14
14
|
|
|
15
|
-
export type WidgetHeaderProps =
|
|
16
|
-
TitleClickableProps,
|
|
17
|
-
'title' | 'icon' | 'avatar' | 'href' | 'target' | 'onClick' | 'titleTag' | 'fullWidth' | 'children' | 'className'
|
|
18
|
-
>;
|
|
15
|
+
export type WidgetHeaderProps = TitleClickable.SimpleTitleProps & PropsWithChildren<{ href: string }>;
|
|
19
16
|
|
|
20
17
|
export type WidgetLoadingStateProps = {
|
|
21
18
|
/** Кастомный контент для состояния загрузки. */
|
|
@@ -117,13 +114,7 @@ type DroplistAction = BaseAction &
|
|
|
117
114
|
};
|
|
118
115
|
|
|
119
116
|
export type Action =
|
|
120
|
-
|
|
|
121
|
-
| OutlineAction
|
|
122
|
-
| TonalAction
|
|
123
|
-
| FunctionAction
|
|
124
|
-
| SimpleAction
|
|
125
|
-
| KebabAction
|
|
126
|
-
| DroplistAction;
|
|
117
|
+
ButtonAction | OutlineAction | TonalAction | FunctionAction | SimpleAction | KebabAction | DroplistAction;
|
|
127
118
|
|
|
128
119
|
export type WidgetAction = Action;
|
|
129
120
|
|