@gravity-ui/dashkit 6.1.0 → 6.2.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/build/cjs/components/ActionPanel/ActionPanel.css +43 -0
- package/build/cjs/components/ActionPanel/ActionPanel.d.ts +13 -0
- package/build/cjs/components/ActionPanel/ActionPanel.js +15 -0
- package/build/cjs/components/DashKitView/DashKitView.d.ts +6 -2
- package/build/cjs/components/GridItem/GridItem.css +1 -1
- package/build/cjs/components/OverlayControls/OverlayControls.css +3 -2
- package/build/cjs/components/OverlayControls/OverlayControls.js +1 -1
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/components/index.js +1 -0
- package/build/esm/components/ActionPanel/ActionPanel.css +43 -0
- package/build/esm/components/ActionPanel/ActionPanel.d.ts +14 -0
- package/build/esm/components/ActionPanel/ActionPanel.js +11 -0
- package/build/esm/components/DashKitView/DashKitView.d.ts +7 -2
- package/build/esm/components/GridItem/GridItem.css +1 -1
- package/build/esm/components/OverlayControls/OverlayControls.css +3 -2
- package/build/esm/components/OverlayControls/OverlayControls.js +1 -1
- package/build/esm/components/index.d.ts +1 -0
- package/build/esm/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.dashkit-action-panel {
|
|
2
|
+
background-color: var(--g-color-base-float);
|
|
3
|
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 20px;
|
|
6
|
+
display: flex;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
padding: 8px;
|
|
9
|
+
gap: 0;
|
|
10
|
+
left: 50%;
|
|
11
|
+
transform: translateX(-50%);
|
|
12
|
+
z-index: 1;
|
|
13
|
+
}
|
|
14
|
+
.dashkit-action-panel__item {
|
|
15
|
+
height: 68px;
|
|
16
|
+
width: 98px;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
transition: 0.3s background-color ease-in-out;
|
|
22
|
+
border-radius: 6px;
|
|
23
|
+
padding: 0 12px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
.dashkit-action-panel__item:hover {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background-color: var(--g-color-base-simple-hover);
|
|
31
|
+
}
|
|
32
|
+
.dashkit-action-panel__icon {
|
|
33
|
+
margin-bottom: 4px;
|
|
34
|
+
}
|
|
35
|
+
.dashkit-action-panel__title {
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
line-height: 16px;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ActionPanelItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
title: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ActionPanelProps = {
|
|
10
|
+
items: ActionPanelItem[];
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const ActionPanel: (props: ActionPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionPanel = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const cn_1 = require("../../utils/cn");
|
|
7
|
+
const b = (0, cn_1.cn)('dashkit-action-panel');
|
|
8
|
+
const ActionPanel = (props) => {
|
|
9
|
+
return (react_1.default.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
|
|
10
|
+
return (react_1.default.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
|
|
11
|
+
react_1.default.createElement("div", { className: b('icon') }, item.icon),
|
|
12
|
+
react_1.default.createElement("div", { className: b('title'), title: item.title }, item.title)));
|
|
13
|
+
})));
|
|
14
|
+
};
|
|
15
|
+
exports.ActionPanel = ActionPanel;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RegisterManager } from '../../utils';
|
|
3
|
+
import type { DashKitProps } from '../DashKit';
|
|
4
|
+
declare const DashKitViewForwardedMeta: React.ForwardRefExoticComponent<DashKitProps & {
|
|
5
|
+
registerManager: RegisterManager;
|
|
6
|
+
} & React.RefAttributes<unknown>>;
|
|
1
7
|
export default DashKitViewForwardedMeta;
|
|
2
|
-
declare const DashKitViewForwardedMeta: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
-
import React from "react";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
.dashkit-overlay-controls {
|
|
2
2
|
position: absolute;
|
|
3
3
|
display: flex;
|
|
4
|
+
background-color: var(--g-color-base-float);
|
|
5
|
+
border-radius: var(--g-border-radius-m);
|
|
6
|
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
|
|
4
7
|
}
|
|
5
8
|
.dashkit-overlay-controls__default-controls {
|
|
6
9
|
display: flex;
|
|
7
|
-
background: var(--g-color-base-generic-ultralight);
|
|
8
|
-
border-radius: var(--g-border-radius-m);
|
|
9
10
|
}
|
|
10
11
|
.dashkit-overlay-controls_position_top_right {
|
|
11
12
|
top: 7px;
|
|
@@ -210,7 +210,7 @@ class OverlayControls extends react_1.default.Component {
|
|
|
210
210
|
OverlayControls.contextType = DashKitContext_1.DashKitContext;
|
|
211
211
|
OverlayControls.defaultProps = {
|
|
212
212
|
position: OverlayControlsPosition.TopRight,
|
|
213
|
-
view: '
|
|
213
|
+
view: 'flat',
|
|
214
214
|
size: 'm',
|
|
215
215
|
};
|
|
216
216
|
exports.default = OverlayControls;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.dashkit-action-panel {
|
|
2
|
+
background-color: var(--g-color-base-float);
|
|
3
|
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 20px;
|
|
6
|
+
display: flex;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
padding: 8px;
|
|
9
|
+
gap: 0;
|
|
10
|
+
left: 50%;
|
|
11
|
+
transform: translateX(-50%);
|
|
12
|
+
z-index: 1;
|
|
13
|
+
}
|
|
14
|
+
.dashkit-action-panel__item {
|
|
15
|
+
height: 68px;
|
|
16
|
+
width: 98px;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
transition: 0.3s background-color ease-in-out;
|
|
22
|
+
border-radius: 6px;
|
|
23
|
+
padding: 0 12px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
.dashkit-action-panel__item:hover {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background-color: var(--g-color-base-simple-hover);
|
|
31
|
+
}
|
|
32
|
+
.dashkit-action-panel__icon {
|
|
33
|
+
margin-bottom: 4px;
|
|
34
|
+
}
|
|
35
|
+
.dashkit-action-panel__title {
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
line-height: 16px;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ActionPanel.css';
|
|
3
|
+
export type ActionPanelItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export type ActionPanelProps = {
|
|
11
|
+
items: ActionPanelItem[];
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const ActionPanel: (props: ActionPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import './ActionPanel.css';
|
|
4
|
+
const b = cn('dashkit-action-panel');
|
|
5
|
+
export const ActionPanel = (props) => {
|
|
6
|
+
return (React.createElement("div", { className: b(null, props.className) }, props.items.map((item) => {
|
|
7
|
+
return (React.createElement("div", { role: "button", className: b('item', item.className), key: `dk-action-panel-${item.id}`, onClick: item.onClick },
|
|
8
|
+
React.createElement("div", { className: b('icon') }, item.icon),
|
|
9
|
+
React.createElement("div", { className: b('title'), title: item.title }, item.title)));
|
|
10
|
+
})));
|
|
11
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RegisterManager } from '../../utils';
|
|
3
|
+
import type { DashKitProps } from '../DashKit';
|
|
4
|
+
import './DashKitView.css';
|
|
5
|
+
declare const DashKitViewForwardedMeta: React.ForwardRefExoticComponent<DashKitProps & {
|
|
6
|
+
registerManager: RegisterManager;
|
|
7
|
+
} & React.RefAttributes<unknown>>;
|
|
1
8
|
export default DashKitViewForwardedMeta;
|
|
2
|
-
declare const DashKitViewForwardedMeta: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
-
import React from "react";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
.dashkit-overlay-controls {
|
|
2
2
|
position: absolute;
|
|
3
3
|
display: flex;
|
|
4
|
+
background-color: var(--g-color-base-float);
|
|
5
|
+
border-radius: var(--g-border-radius-m);
|
|
6
|
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
|
|
4
7
|
}
|
|
5
8
|
.dashkit-overlay-controls__default-controls {
|
|
6
9
|
display: flex;
|
|
7
|
-
background: var(--g-color-base-generic-ultralight);
|
|
8
|
-
border-radius: var(--g-border-radius-m);
|
|
9
10
|
}
|
|
10
11
|
.dashkit-overlay-controls_position_top_right {
|
|
11
12
|
top: 7px;
|
|
@@ -207,7 +207,7 @@ class OverlayControls extends React.Component {
|
|
|
207
207
|
OverlayControls.contextType = DashKitContext;
|
|
208
208
|
OverlayControls.defaultProps = {
|
|
209
209
|
position: OverlayControlsPosition.TopRight,
|
|
210
|
-
view: '
|
|
210
|
+
view: 'flat',
|
|
211
211
|
size: 'm',
|
|
212
212
|
};
|
|
213
213
|
export default OverlayControls;
|