@gravity-ui/dashkit 6.0.0-beta.1 → 6.0.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.
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.css +26 -0
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.d.ts +13 -0
- package/build/cjs/components/ActionsToolbar/ActionsToolbar.js +17 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +3 -0
- package/build/esm/components/ActionsToolbar/ActionsToolbar.css +26 -0
- package/build/esm/components/ActionsToolbar/ActionsToolbar.d.ts +14 -0
- package/build/esm/components/ActionsToolbar/ActionsToolbar.js +13 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.actions-toolbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: fixed;
|
|
4
|
+
width: fit-content;
|
|
5
|
+
padding: 8px;
|
|
6
|
+
border-radius: var(--g-border-radius-l);
|
|
7
|
+
background-color: var(--g-color-base-background);
|
|
8
|
+
box-shadow: 0px 5px 6px 0px var(--g-color-sfx-shadow);
|
|
9
|
+
}
|
|
10
|
+
.actions-toolbar__button {
|
|
11
|
+
transition: all 0.2s ease;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 98px;
|
|
17
|
+
height: 68px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
border-radius: var(--g-border-radius-s);
|
|
20
|
+
}
|
|
21
|
+
.actions-toolbar__button:hover {
|
|
22
|
+
background-color: var(--g-color-base-generic);
|
|
23
|
+
}
|
|
24
|
+
.actions-toolbar__icon {
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
+
export interface ActionsToolbarProps {
|
|
4
|
+
controls: ActionsToolbarButton[];
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ActionsToolbarButton {
|
|
8
|
+
icon: IconProps['data'];
|
|
9
|
+
text: React.ReactNode;
|
|
10
|
+
handler: () => void;
|
|
11
|
+
iconSize?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const ActionsToolbar: React.FC<ActionsToolbarProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionsToolbar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const b = (0, bem_cn_lite_1.default)('actions-toolbar');
|
|
9
|
+
const WidgetButton = ({ icon, text, handler }) => (react_1.default.createElement("div", { className: b('button'), onClick: handler },
|
|
10
|
+
react_1.default.createElement(uikit_1.Icon, { size: '18', className: b('icon'), data: icon }),
|
|
11
|
+
react_1.default.createElement(uikit_1.Text, { variant: 'body-1' }, text)));
|
|
12
|
+
const ActionsToolbar = (props) => {
|
|
13
|
+
return (react_1.default.createElement("div", { className: `${b()} ${props.className}` }, props.controls.map((button, index) => {
|
|
14
|
+
return (react_1.default.createElement(WidgetButton, { key: index, icon: button.icon, text: button.text, handler: button.handler }));
|
|
15
|
+
})));
|
|
16
|
+
};
|
|
17
|
+
exports.ActionsToolbar = ActionsToolbar;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionsToolbar = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
tslib_1.__exportStar(require("./DashKit"), exports);
|
|
6
|
+
var ActionsToolbar_1 = require("./ActionsToolbar/ActionsToolbar");
|
|
7
|
+
Object.defineProperty(exports, "ActionsToolbar", { enumerable: true, get: function () { return ActionsToolbar_1.ActionsToolbar; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.actions-toolbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: fixed;
|
|
4
|
+
width: fit-content;
|
|
5
|
+
padding: 8px;
|
|
6
|
+
border-radius: var(--g-border-radius-l);
|
|
7
|
+
background-color: var(--g-color-base-background);
|
|
8
|
+
box-shadow: 0px 5px 6px 0px var(--g-color-sfx-shadow);
|
|
9
|
+
}
|
|
10
|
+
.actions-toolbar__button {
|
|
11
|
+
transition: all 0.2s ease;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 98px;
|
|
17
|
+
height: 68px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
border-radius: var(--g-border-radius-s);
|
|
20
|
+
}
|
|
21
|
+
.actions-toolbar__button:hover {
|
|
22
|
+
background-color: var(--g-color-base-generic);
|
|
23
|
+
}
|
|
24
|
+
.actions-toolbar__icon {
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
+
import './ActionsToolbar.css';
|
|
4
|
+
export interface ActionsToolbarProps {
|
|
5
|
+
controls: ActionsToolbarButton[];
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ActionsToolbarButton {
|
|
9
|
+
icon: IconProps['data'];
|
|
10
|
+
text: React.ReactNode;
|
|
11
|
+
handler: () => void;
|
|
12
|
+
iconSize?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const ActionsToolbar: React.FC<ActionsToolbarProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import block from 'bem-cn-lite';
|
|
3
|
+
import { Icon, Text } from '@gravity-ui/uikit';
|
|
4
|
+
import './ActionsToolbar.css';
|
|
5
|
+
const b = block('actions-toolbar');
|
|
6
|
+
const WidgetButton = ({ icon, text, handler }) => (React.createElement("div", { className: b('button'), onClick: handler },
|
|
7
|
+
React.createElement(Icon, { size: '18', className: b('icon'), data: icon }),
|
|
8
|
+
React.createElement(Text, { variant: 'body-1' }, text)));
|
|
9
|
+
export const ActionsToolbar = (props) => {
|
|
10
|
+
return (React.createElement("div", { className: `${b()} ${props.className}` }, props.controls.map((button, index) => {
|
|
11
|
+
return (React.createElement(WidgetButton, { key: index, icon: button.icon, text: button.text, handler: button.handler }));
|
|
12
|
+
})));
|
|
13
|
+
};
|