@weavix/tracker-components 0.1.2 → 0.1.4
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/README.md +29 -1
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.classname.d.ts +1 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.classname.js +9 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.classname.js.map +1 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.css +45 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.css.map +1 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.d.ts +13 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.js +80 -0
- package/build/cjs/components/Icon/PriorityIcon/PriorityIcon.js.map +1 -0
- package/build/cjs/components/Icon/PriorityIcon/README.md +172 -0
- package/build/cjs/components/Icon/PriorityIcon/i18n.d.ts +6 -0
- package/build/cjs/components/Icon/PriorityIcon/i18n.js +13 -0
- package/build/cjs/components/Icon/PriorityIcon/i18n.js.map +1 -0
- package/build/cjs/components/Icon/PriorityIcon/index.d.ts +3 -0
- package/build/cjs/components/Icon/PriorityIcon/index.js +13 -0
- package/build/cjs/components/Icon/PriorityIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/PriorityIcon/types.d.ts +1 -0
- package/build/cjs/components/Icon/PriorityIcon/types.js +6 -0
- package/build/cjs/components/Icon/PriorityIcon/types.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/README.md +128 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.classname.d.ts +1 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.classname.js +9 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.classname.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.css +28 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.css.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.d.ts +10 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.js +43 -0
- package/build/cjs/components/Icon/StatusIcon/StatusIcon.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/i18n.d.ts +6 -0
- package/build/cjs/components/Icon/StatusIcon/i18n.js +13 -0
- package/build/cjs/components/Icon/StatusIcon/i18n.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/index.d.ts +3 -0
- package/build/cjs/components/Icon/StatusIcon/index.js +13 -0
- package/build/cjs/components/Icon/StatusIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/types.d.ts +3 -0
- package/build/cjs/components/Icon/StatusIcon/types.js +6 -0
- package/build/cjs/components/Icon/StatusIcon/types.js.map +1 -0
- package/build/cjs/components/Icon/StatusIcon/utils.d.ts +3 -0
- package/build/cjs/components/Icon/StatusIcon/utils.js +39 -0
- package/build/cjs/components/Icon/StatusIcon/utils.js.map +1 -0
- package/build/cjs/components/Icon/index.d.ts +2 -0
- package/build/cjs/components/Icon/index.js +22 -0
- package/build/cjs/components/Icon/index.js.map +1 -1
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.classname.d.ts +1 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.classname.js +3 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.classname.js.map +1 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.css +45 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.css.map +1 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.d.ts +13 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.js +73 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.js.map +1 -0
- package/build/esm/components/Icon/PriorityIcon/PriorityIcon.scss +64 -0
- package/build/esm/components/Icon/PriorityIcon/README.md +172 -0
- package/build/esm/components/Icon/PriorityIcon/i18n.d.ts +6 -0
- package/build/esm/components/Icon/PriorityIcon/i18n.js +7 -0
- package/build/esm/components/Icon/PriorityIcon/i18n.js.map +1 -0
- package/build/esm/components/Icon/PriorityIcon/index.d.ts +3 -0
- package/build/esm/components/Icon/PriorityIcon/index.js +2 -0
- package/build/esm/components/Icon/PriorityIcon/index.js.map +1 -0
- package/build/esm/components/Icon/PriorityIcon/types.d.ts +1 -0
- package/build/esm/components/Icon/PriorityIcon/types.js +2 -0
- package/build/esm/components/Icon/PriorityIcon/types.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/README.md +128 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.classname.d.ts +1 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.classname.js +3 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.classname.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.css +28 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.css.map +1 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.d.ts +10 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.js +36 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/StatusIcon.scss +46 -0
- package/build/esm/components/Icon/StatusIcon/i18n.d.ts +6 -0
- package/build/esm/components/Icon/StatusIcon/i18n.js +7 -0
- package/build/esm/components/Icon/StatusIcon/i18n.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/index.d.ts +3 -0
- package/build/esm/components/Icon/StatusIcon/index.js +2 -0
- package/build/esm/components/Icon/StatusIcon/index.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/types.d.ts +3 -0
- package/build/esm/components/Icon/StatusIcon/types.js +2 -0
- package/build/esm/components/Icon/StatusIcon/types.js.map +1 -0
- package/build/esm/components/Icon/StatusIcon/utils.d.ts +3 -0
- package/build/esm/components/Icon/StatusIcon/utils.js +33 -0
- package/build/esm/components/Icon/StatusIcon/utils.js.map +1 -0
- package/build/esm/components/Icon/index.d.ts +2 -0
- package/build/esm/components/Icon/index.js +2 -0
- package/build/esm/components/Icon/index.js.map +1 -1
- package/package.json +3 -3
- package/build/cjs/components/Icon/Icon.classname.d.ts +0 -1
- package/build/cjs/components/Icon/Icon.classname.js +0 -9
- package/build/cjs/components/Icon/Icon.classname.js.map +0 -1
- package/build/esm/components/Icon/Icon.classname.d.ts +0 -1
- package/build/esm/components/Icon/Icon.classname.js +0 -3
- package/build/esm/components/Icon/Icon.classname.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @weavix/tracker-components
|
|
2
2
|
|
|
3
|
-
Shared UI component library for **Yandex Tracker plugins**. Provides ready-made React components for selecting queues, fields, and meta entities (projects, portfolios, goals), displaying issue-type and entity icons, and building collapsible sections — all styled to match the Tracker design system.
|
|
3
|
+
Shared UI component library for **Yandex Tracker plugins**. Provides ready-made React components for selecting queues, fields, and meta entities (projects, portfolios, goals), displaying issue-type, priority, status, and entity icons, and building collapsible sections — all styled to match the Tracker design system.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -35,6 +35,8 @@ pnpm add @weavix/tracker-components
|
|
|
35
35
|
| Component | Description | README |
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| [`IssueTypeIcon`](#issuetypeicon) | Icon for a Tracker issue type (task, bug, epic, …). | [→ README](src/components/Icon/IssueTypeIcon/README.md) |
|
|
38
|
+
| [`PriorityIcon`](#priorityicon) | Icon for an issue priority level (blocker, critical, normal, …). Supports optional colored background. | [→ README](src/components/Icon/PriorityIcon/README.md) |
|
|
39
|
+
| [`StatusIcon`](#statusicon) | Icon for a Tracker issue status. Maps `IssueStatus` values to distinct icons and colors. | [→ README](src/components/Icon/StatusIcon/README.md) |
|
|
38
40
|
| [`MetaEntityIcon`](#metaentityicon) | Dispatcher icon that renders the correct icon for any meta entity type (project, portfolio, goal, key result). | [→ README](src/components/Icon/MetaEntityIcon/README.md) |
|
|
39
41
|
| [`ProjectIcon`](#projecticon) | Colored icon for a project entity. Color is deterministically derived from the project ID. | [→ README](src/components/Icon/ProjectIcon/README.md) |
|
|
40
42
|
| [`PortfolioIcon`](#portfolioicon) | Colored icon for a portfolio entity. Color is deterministically derived from the portfolio ID. | [→ README](src/components/Icon/PortfolioIcon/README.md) |
|
|
@@ -125,6 +127,32 @@ import {IssueTypeIcon} from '@weavix/tracker-components';
|
|
|
125
127
|
|
|
126
128
|
---
|
|
127
129
|
|
|
130
|
+
### PriorityIcon
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
134
|
+
|
|
135
|
+
<PriorityIcon priority="critical" />
|
|
136
|
+
<PriorityIcon priority="blocker" showBackground backgroundSize={32} />
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
→ Full documentation: [src/components/Icon/PriorityIcon/README.md](src/components/Icon/PriorityIcon/README.md)
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### StatusIcon
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import {StatusIcon} from '@weavix/tracker-components';
|
|
147
|
+
|
|
148
|
+
<StatusIcon statusType="inProgress" />
|
|
149
|
+
<StatusIcon statusType="done" size={24} title="Done" />
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
→ Full documentation: [src/components/Icon/StatusIcon/README.md](src/components/Icon/StatusIcon/README.md)
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
128
156
|
### MetaEntityIcon
|
|
129
157
|
|
|
130
158
|
```tsx
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cnPriorityIcon: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cnPriorityIcon = void 0;
|
|
7
|
+
var _cn = require("./../../cn");
|
|
8
|
+
var cnPriorityIcon = exports.cnPriorityIcon = (0, _cn.block)('priority-icon');
|
|
9
|
+
// #sourceMappingURL=PriorityIcon.classname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cn","require","cnPriorityIcon","exports","block"],"sources":["PriorityIcon.classname.ts"],"sourcesContent":["import {block} from '~/src/components/cn';\n\nexport const cnPriorityIcon = block('priority-icon');\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AAEO,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,SAAK,EAAC,eAAe,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.tpc-priority-icon_priority_blocker {
|
|
2
|
+
color: var(--g-color-text-danger);
|
|
3
|
+
}
|
|
4
|
+
.tpc-priority-icon_priority_critical {
|
|
5
|
+
color: var(--g-color-text-warning-heavy);
|
|
6
|
+
}
|
|
7
|
+
.tpc-priority-icon_priority_critical.tpc-priority-icon_metaEntity {
|
|
8
|
+
color: var(--g-color-text-danger-heavy);
|
|
9
|
+
}
|
|
10
|
+
.tpc-priority-icon_priority_important {
|
|
11
|
+
color: var(--g-color-text-warning);
|
|
12
|
+
}
|
|
13
|
+
.tpc-priority-icon_priority_trivial {
|
|
14
|
+
color: var(--g-color-text-hint);
|
|
15
|
+
}
|
|
16
|
+
.tpc-priority-icon_priority_normal, .tpc-priority-icon_priority_minor, .tpc-priority-icon_priority_minimal {
|
|
17
|
+
color: var(--g-color-text-secondary);
|
|
18
|
+
}
|
|
19
|
+
.tpc-priority-icon__background {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
}
|
|
27
|
+
.tpc-priority-icon__background_priority_blocker {
|
|
28
|
+
background: var(--g-color-base-danger-light);
|
|
29
|
+
}
|
|
30
|
+
.tpc-priority-icon__background_priority_critical {
|
|
31
|
+
background: var(--g-color-base-warning-light);
|
|
32
|
+
}
|
|
33
|
+
.tpc-priority-icon__background_priority_critical.tpc-priority-icon-background_metaEntity {
|
|
34
|
+
background: var(--g-color-base-danger-light);
|
|
35
|
+
}
|
|
36
|
+
.tpc-priority-icon__background_priority_important {
|
|
37
|
+
background: var(--g-color-base-warning-light);
|
|
38
|
+
}
|
|
39
|
+
.tpc-priority-icon__background_priority_trivial {
|
|
40
|
+
background: var(--g-color-base-neutral-light);
|
|
41
|
+
}
|
|
42
|
+
.tpc-priority-icon__background_priority_normal, .tpc-priority-icon__background_priority_minor, .tpc-priority-icon__background_priority_minimal {
|
|
43
|
+
background: var(--g-color-base-neutral-light);
|
|
44
|
+
}
|
|
45
|
+
/*# sourceMappingURL=PriorityIcon.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PriorityIcon.scss"],"names":[],"mappings":"AACI;EACI,iCAAA;AAAR;AAGI;EACI,wCAAA;AADR;AAGQ;EACI,uCAAA;AADZ;AAKI;EACI,kCAAA;AAHR;AAMI;EACI,+BAAA;AAJR;AAOI;EAGI,oCAAA;AAPR;AAUI;EACI,aAAA;EACA,mBAAA;EACA,uBAAA;EAEA,WAAA;EACA,YAAA;EAEA,kBAAA;AAVR;AAaI;EACI,4CAAA;AAXR;AAcI;EACI,6CAAA;AAZR;AAcQ;EACI,4CAAA;AAZZ;AAgBI;EACI,6CAAA;AAdR;AAiBI;EACI,6CAAA;AAfR;AAkBI;EAGI,6CAAA;AAlBR","file":"PriorityIcon.css","sourcesContent":[".tpc-priority-icon {\n &_priority_blocker {\n color: var(--g-color-text-danger);\n }\n\n &_priority_critical {\n color: var(--g-color-text-warning-heavy);\n\n &.tpc-priority-icon_metaEntity {\n color: var(--g-color-text-danger-heavy);\n }\n }\n\n &_priority_important {\n color: var(--g-color-text-warning);\n }\n\n &_priority_trivial {\n color: var(--g-color-text-hint);\n }\n\n &_priority_normal,\n &_priority_minor,\n &_priority_minimal {\n color: var(--g-color-text-secondary);\n }\n\n &__background {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n\n border-radius: 50%;\n }\n\n &__background_priority_blocker {\n background: var(--g-color-base-danger-light);\n }\n\n &__background_priority_critical {\n background: var(--g-color-base-warning-light);\n\n &.tpc-priority-icon-background_metaEntity {\n background: var(--g-color-base-danger-light);\n }\n }\n\n &__background_priority_important {\n background: var(--g-color-base-warning-light);\n }\n\n &__background_priority_trivial {\n background: var(--g-color-base-neutral-light);\n }\n\n &__background_priority_normal,\n &__background_priority_minor,\n &__background_priority_minimal {\n background: var(--g-color-base-neutral-light);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { IconRefugeProps } from '../IconRefuge';
|
|
3
|
+
import type { Priority } from './types';
|
|
4
|
+
import './PriorityIcon.scss';
|
|
5
|
+
export type PriorityIconProps = Partial<Pick<IconRefugeProps, 'containerClassName' | 'title'>> & {
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
priority?: Priority;
|
|
9
|
+
showBackground?: boolean;
|
|
10
|
+
backgroundSize?: number;
|
|
11
|
+
metaEntity?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const PriorityIcon: FC<PriorityIconProps>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PriorityIcon = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _icons = require("@gravity-ui/icons");
|
|
9
|
+
var _uikit = require("@gravity-ui/uikit");
|
|
10
|
+
var _useLocalizedString2 = require("./../../../hooks/useLocalizedString");
|
|
11
|
+
var _IconRefuge = require("../IconRefuge");
|
|
12
|
+
var _PriorityIcon = require("./PriorityIcon.classname");
|
|
13
|
+
var _i18n = require("./i18n");
|
|
14
|
+
require("./PriorityIcon.css");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
var getIconData = function getIconData(priority, metaEntity) {
|
|
18
|
+
switch (priority) {
|
|
19
|
+
case 'blocker':
|
|
20
|
+
return _icons.CircleExclamation;
|
|
21
|
+
case 'critical':
|
|
22
|
+
return metaEntity ? _icons.CircleExclamation : _icons.ChevronsUpWide;
|
|
23
|
+
case 'minor':
|
|
24
|
+
return _icons.ChevronDownWide;
|
|
25
|
+
case 'trivial':
|
|
26
|
+
case 'minimal':
|
|
27
|
+
return _icons.ChevronsDownWide;
|
|
28
|
+
case 'important':
|
|
29
|
+
return _icons.ChevronUpWide;
|
|
30
|
+
default:
|
|
31
|
+
return _icons.Equal;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var PriorityIcon = exports.PriorityIcon = function PriorityIcon(_ref) {
|
|
35
|
+
var className = _ref.className,
|
|
36
|
+
containerClassName = _ref.containerClassName,
|
|
37
|
+
_ref$priority = _ref.priority,
|
|
38
|
+
priority = _ref$priority === void 0 ? 'normal' : _ref$priority,
|
|
39
|
+
_ref$size = _ref.size,
|
|
40
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
41
|
+
title = _ref.title,
|
|
42
|
+
showBackground = _ref.showBackground,
|
|
43
|
+
backgroundSize = _ref.backgroundSize,
|
|
44
|
+
metaEntity = _ref.metaEntity;
|
|
45
|
+
var config = (0, _uikit.getConfig)();
|
|
46
|
+
var _useLocalizedString = (0, _useLocalizedString2.useLocalizedString)(_i18n.defaultMessages, config.lang),
|
|
47
|
+
t = _useLocalizedString.t;
|
|
48
|
+
var ariaLabel = title ? t('priority-label', {
|
|
49
|
+
priority: title
|
|
50
|
+
}) : undefined;
|
|
51
|
+
var iconNode = /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconRefuge.IconRefuge, {
|
|
52
|
+
containerClassName: containerClassName,
|
|
53
|
+
className: (0, _PriorityIcon.cnPriorityIcon)({
|
|
54
|
+
priority: priority,
|
|
55
|
+
metaEntity: metaEntity
|
|
56
|
+
}, className),
|
|
57
|
+
data: getIconData(priority, metaEntity),
|
|
58
|
+
refugeSize: size,
|
|
59
|
+
title: title,
|
|
60
|
+
"aria-label": ariaLabel,
|
|
61
|
+
"aria-hidden": !title || undefined
|
|
62
|
+
});
|
|
63
|
+
if (!showBackground) {
|
|
64
|
+
return iconNode;
|
|
65
|
+
}
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
67
|
+
className: (0, _PriorityIcon.cnPriorityIcon)('background', {
|
|
68
|
+
priority: priority,
|
|
69
|
+
metaEntity: metaEntity
|
|
70
|
+
}),
|
|
71
|
+
style: backgroundSize ? {
|
|
72
|
+
width: backgroundSize,
|
|
73
|
+
height: backgroundSize,
|
|
74
|
+
minWidth: backgroundSize
|
|
75
|
+
} : undefined,
|
|
76
|
+
children: iconNode
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
PriorityIcon.displayName = 'PriorityIcon';
|
|
80
|
+
// #sourceMappingURL=PriorityIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_icons","_uikit","_useLocalizedString2","_IconRefuge","_PriorityIcon","_i18n","_jsxRuntime","e","__esModule","default","getIconData","priority","metaEntity","CircleExclamation","ChevronsUpWide","ChevronDownWide","ChevronsDownWide","ChevronUpWide","Equal","PriorityIcon","exports","_ref","className","containerClassName","_ref$priority","_ref$size","size","title","showBackground","backgroundSize","config","getConfig","_useLocalizedString","useLocalizedString","defaultMessages","lang","t","ariaLabel","undefined","iconNode","_jsx","IconRefuge","cnPriorityIcon","data","refugeSize","style","width","height","minWidth","children","displayName"],"sources":["PriorityIcon.tsx"],"sourcesContent":["import React, {type FC} from 'react';\n\nimport {\n ChevronDownWide,\n ChevronUpWide,\n ChevronsDownWide,\n ChevronsUpWide,\n CircleExclamation,\n Equal,\n} from '@gravity-ui/icons';\nimport {type IconData, getConfig} from '@gravity-ui/uikit';\n\nimport {useLocalizedString} from '~/src/hooks/useLocalizedString';\n\nimport type {IconRefugeProps} from '../IconRefuge';\nimport {IconRefuge} from '../IconRefuge';\n\nimport {cnPriorityIcon} from './PriorityIcon.classname';\nimport {defaultMessages} from './i18n';\nimport type {Priority} from './types';\n\nimport './PriorityIcon.scss';\n\nexport type PriorityIconProps = Partial<Pick<IconRefugeProps, 'containerClassName' | 'title'>> & {\n className?: string;\n size?: number;\n priority?: Priority;\n showBackground?: boolean;\n backgroundSize?: number;\n metaEntity?: boolean;\n};\n\nconst getIconData = (priority: Priority, metaEntity?: boolean): IconData => {\n switch (priority) {\n case 'blocker':\n return CircleExclamation;\n case 'critical':\n return metaEntity ? CircleExclamation : ChevronsUpWide;\n case 'minor':\n return ChevronDownWide;\n case 'trivial':\n case 'minimal':\n return ChevronsDownWide;\n case 'important':\n return ChevronUpWide;\n default:\n return Equal;\n }\n};\n\nexport const PriorityIcon: FC<PriorityIconProps> = ({\n className,\n containerClassName,\n priority = 'normal',\n size = 16,\n title,\n showBackground,\n backgroundSize,\n metaEntity,\n}) => {\n const config = getConfig();\n const {t} = useLocalizedString(defaultMessages, config.lang);\n const ariaLabel = title ? t('priority-label', {priority: title}) : undefined;\n\n const iconNode = (\n <IconRefuge\n containerClassName={containerClassName}\n className={cnPriorityIcon({priority, metaEntity}, className)}\n data={getIconData(priority, metaEntity)}\n refugeSize={size}\n title={title}\n aria-label={ariaLabel}\n aria-hidden={!title || undefined}\n />\n );\n\n if (!showBackground) {\n return iconNode;\n }\n\n return (\n <div\n className={cnPriorityIcon('background', {priority, metaEntity})}\n style={\n backgroundSize\n ? {\n width: backgroundSize,\n height: backgroundSize,\n minWidth: backgroundSize,\n }\n : undefined\n }\n >\n {iconNode}\n </div>\n );\n};\n\nPriorityIcon.displayName = 'PriorityIcon';\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# PriorityIcon
|
|
2
|
+
|
|
3
|
+
<!-- description:start -->
|
|
4
|
+
Displays the icon for a Tracker issue priority level (blocker, critical, normal, minor, etc.). Each priority maps to a distinct icon and color. Unknown priority keys fall back to the normal icon.
|
|
5
|
+
<!-- description:end -->
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
11
|
+
|
|
12
|
+
<PriorityIcon priority="critical" />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Component props
|
|
16
|
+
|
|
17
|
+
<!-- props:start -->
|
|
18
|
+
```ts
|
|
19
|
+
{
|
|
20
|
+
/**
|
|
21
|
+
* Priority key. Known values are listed below; any other string is
|
|
22
|
+
* accepted and falls back to the normal icon.
|
|
23
|
+
*/
|
|
24
|
+
priority?:
|
|
25
|
+
| 'blocker'
|
|
26
|
+
| 'critical'
|
|
27
|
+
| 'important'
|
|
28
|
+
| 'minor'
|
|
29
|
+
| 'minimal'
|
|
30
|
+
| 'normal'
|
|
31
|
+
| 'trivial'
|
|
32
|
+
| string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Size of the icon in pixels.
|
|
36
|
+
* @default 16
|
|
37
|
+
*/
|
|
38
|
+
size?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Additional CSS class applied to the icon element.
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Additional CSS class applied to the outer container element.
|
|
47
|
+
*/
|
|
48
|
+
containerClassName?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Human-readable display name for the priority (e.g. `"Critical"`, `"Normal"`).
|
|
52
|
+
* When provided, an accessible label `"Priority: <title>"` is rendered for
|
|
53
|
+
* screen readers. When omitted, the icon is treated as decorative (`aria-hidden`).
|
|
54
|
+
*/
|
|
55
|
+
title?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* When true, renders a circular colored background behind the icon.
|
|
59
|
+
*/
|
|
60
|
+
showBackground?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Size of the background circle in pixels. Only used when `showBackground` is true.
|
|
64
|
+
*/
|
|
65
|
+
backgroundSize?: number;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* When true, applies meta-entity color variants (e.g. `critical` uses
|
|
69
|
+
* the blocker icon and danger color instead of warning).
|
|
70
|
+
*/
|
|
71
|
+
metaEntity?: boolean;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
<!-- props:end -->
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Examples
|
|
79
|
+
|
|
80
|
+
### Single icon
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
84
|
+
|
|
85
|
+
<PriorityIcon priority="blocker" />
|
|
86
|
+
<PriorityIcon priority="critical" />
|
|
87
|
+
<PriorityIcon priority="normal" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Custom size
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<PriorityIcon priority="critical" size={24} />
|
|
94
|
+
<PriorityIcon priority="critical" size={32} />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### With background
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<PriorityIcon priority="blocker" showBackground backgroundSize={32} />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Alongside issue summary
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
107
|
+
|
|
108
|
+
export const IssueRow = ({issue}: {issue: {priority: string; summary: string}}) => (
|
|
109
|
+
<div style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
110
|
+
<PriorityIcon priority={issue.priority} size={16} />
|
|
111
|
+
<span>{issue.summary}</span>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### All known priorities
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
120
|
+
|
|
121
|
+
const PRIORITIES = [
|
|
122
|
+
'blocker', 'critical', 'important', 'normal', 'minor', 'minimal', 'trivial',
|
|
123
|
+
] as const;
|
|
124
|
+
|
|
125
|
+
export const PriorityGallery = () => (
|
|
126
|
+
<div style={{display: 'flex', flexWrap: 'wrap', gap: 16}}>
|
|
127
|
+
{PRIORITIES.map((p) => (
|
|
128
|
+
<div key={p} style={{display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4}}>
|
|
129
|
+
<PriorityIcon priority={p} size={24} />
|
|
130
|
+
<span style={{fontSize: 11}}>{p}</span>
|
|
131
|
+
</div>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### From Tracker API
|
|
138
|
+
|
|
139
|
+
Requires the `"tracker:issues:read"` permission in your plugin's `manifest.json`:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"permissions": {
|
|
144
|
+
"data": ["tracker:issues:read"]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
import {PriorityIcon} from '@weavix/tracker-components';
|
|
151
|
+
|
|
152
|
+
const priority = await trackerApi.v3.get['/issues/{id}/{field}']({
|
|
153
|
+
pathParams: {
|
|
154
|
+
id: 'ISSUEKEY-1',
|
|
155
|
+
field: 'priority',
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
<PriorityIcon
|
|
160
|
+
priority={priority.data.key}
|
|
161
|
+
title={priority.data.display}
|
|
162
|
+
/>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Notes
|
|
168
|
+
|
|
169
|
+
- The `priority` value is matched case-sensitively against the known keys. Values returned by the Tracker API (e.g. `"blocker"`, `"critical"`) match directly without transformation.
|
|
170
|
+
- Passing an unknown string does not throw — the component renders the normal (default) icon.
|
|
171
|
+
- When `title` is omitted the icon is treated as decorative and gets `aria-hidden="true"`. Pass `title` (e.g. `priority.display` from the API) to make the icon accessible.
|
|
172
|
+
- The `metaEntity` prop changes the icon and color for `critical` priority to match the blocker appearance, used in meta-entity contexts like goals and projects.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultMessages = void 0;
|
|
7
|
+
var defaultMessages = exports.defaultMessages = {
|
|
8
|
+
'priority-label': {
|
|
9
|
+
ru: 'Приоритет: {priority}',
|
|
10
|
+
en: 'Priority: {priority}'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
// #sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultMessages","exports","ru","en"],"sources":["i18n.ts"],"sourcesContent":["export const defaultMessages = {\n 'priority-label': {\n ru: 'Приоритет: {priority}',\n en: 'Priority: {priority}',\n },\n};\n"],"mappings":";;;;;;AAAO,IAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC3B,gBAAgB,EAAE;IACdE,EAAE,EAAE,uBAAuB;IAC3BC,EAAE,EAAE;EACR;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PriorityIcon", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _PriorityIcon.PriorityIcon;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _PriorityIcon = require("./PriorityIcon");
|
|
13
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_PriorityIcon","require"],"sources":["index.ts"],"sourcesContent":["export {PriorityIcon} from './PriorityIcon';\nexport type {PriorityIconProps} from './PriorityIcon';\nexport type {Priority} from './types';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Priority = 'blocker' | 'critical' | 'important' | 'minor' | 'minimal' | 'normal' | 'trivial';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type Priority =\n | 'blocker'\n | 'critical'\n | 'important'\n | 'minor'\n | 'minimal'\n | 'normal'\n | 'trivial';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# StatusIcon
|
|
2
|
+
|
|
3
|
+
<!-- description:start -->
|
|
4
|
+
Displays the icon for a Tracker issue status. Each status type maps to a distinct SVG icon and color. Unknown status keys fall back to a question-mark icon.
|
|
5
|
+
<!-- description:end -->
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {StatusIcon} from '@weavix/tracker-components';
|
|
11
|
+
|
|
12
|
+
<StatusIcon statusType="inProgress" />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Component props
|
|
16
|
+
|
|
17
|
+
<!-- props:start -->
|
|
18
|
+
```ts
|
|
19
|
+
{
|
|
20
|
+
/**
|
|
21
|
+
* Status type/key from the Tracker API. Accepts `IssueStatus` values.
|
|
22
|
+
* Unknown values fall back to a question-mark icon.
|
|
23
|
+
*/
|
|
24
|
+
statusType?:
|
|
25
|
+
| 'new'
|
|
26
|
+
| 'inProgress'
|
|
27
|
+
| 'paused'
|
|
28
|
+
| 'done'
|
|
29
|
+
| 'cancelled'
|
|
30
|
+
| 'unknown'
|
|
31
|
+
| string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Size of the icon in pixels.
|
|
35
|
+
* @default 16
|
|
36
|
+
*/
|
|
37
|
+
size?: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Additional CSS class applied to the icon element.
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Additional CSS class applied to the outer container element.
|
|
46
|
+
*/
|
|
47
|
+
containerClassName?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Human-readable status name (e.g. `"In progress"`, `"Done"`).
|
|
51
|
+
* When provided, an accessible label `"Status: <title>"` is rendered for
|
|
52
|
+
* screen readers. When omitted, the icon is treated as decorative (`aria-hidden`).
|
|
53
|
+
*/
|
|
54
|
+
title?: string;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
<!-- props:end -->
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Single icon
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import {StatusIcon} from '@weavix/tracker-components';
|
|
67
|
+
|
|
68
|
+
<StatusIcon statusType="new" />
|
|
69
|
+
<StatusIcon statusType="inProgress" />
|
|
70
|
+
<StatusIcon statusType="done" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Custom size
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<StatusIcon statusType="inProgress" size={24} />
|
|
77
|
+
<StatusIcon statusType="inProgress" size={32} />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Alongside issue summary
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import {StatusIcon} from '@weavix/tracker-components';
|
|
84
|
+
|
|
85
|
+
export const IssueRow = ({issue}: {issue: {statusType: string; summary: string}}) => (
|
|
86
|
+
<div style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
87
|
+
<StatusIcon statusType={issue.statusType} size={16} />
|
|
88
|
+
<span>{issue.summary}</span>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### From Tracker API — issue status
|
|
94
|
+
|
|
95
|
+
Requires the `"tracker:issues:read"` permission in your plugin's `manifest.json`:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"permissions": {
|
|
100
|
+
"data": ["tracker:issues:read"]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import {StatusIcon} from '@weavix/tracker-components';
|
|
107
|
+
|
|
108
|
+
const status = await trackerApi.v3.get['/issues/{id}/{field}']({
|
|
109
|
+
pathParams: {
|
|
110
|
+
id: 'ISSUEKEY-1',
|
|
111
|
+
field: 'status',
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
<StatusIcon
|
|
116
|
+
statusType={status.data.key}
|
|
117
|
+
title={status.data.display}
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Notes
|
|
124
|
+
|
|
125
|
+
- The `statusType` value is matched case-sensitively. Values returned by the Tracker API match directly without transformation.
|
|
126
|
+
- Passing an unknown string does not throw — the component renders a question-mark fallback icon.
|
|
127
|
+
- When `title` is omitted the icon is treated as decorative and gets `aria-hidden="true"`. Pass `title` (e.g. `status.display` from the API) to make the icon accessible.
|
|
128
|
+
- The component accepts the `IssueStatus` type union (issue statuses), which is exported from the package.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cnStatusIcon: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cnStatusIcon = void 0;
|
|
7
|
+
var _cn = require("./../../cn");
|
|
8
|
+
var cnStatusIcon = exports.cnStatusIcon = (0, _cn.block)('status-icon');
|
|
9
|
+
// #sourceMappingURL=StatusIcon.classname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cn","require","cnStatusIcon","exports","block"],"sources":["StatusIcon.classname.ts"],"sourcesContent":["import {block} from '~/src/components/cn';\n\nexport const cnStatusIcon = block('status-icon');\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AAEO,IAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,SAAK,EAAC,aAAa,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.tpc-status-icon_status_new, .tpc-status-icon_status_draft {
|
|
2
|
+
color: var(--g-color-text-misc-heavy);
|
|
3
|
+
}
|
|
4
|
+
.tpc-status-icon_status_inProgress, .tpc-status-icon_status_in_progress {
|
|
5
|
+
color: var(--g-color-text-info);
|
|
6
|
+
}
|
|
7
|
+
.tpc-status-icon_status_paused, .tpc-status-icon_status_at_risk {
|
|
8
|
+
color: var(--g-color-text-warning-heavy);
|
|
9
|
+
}
|
|
10
|
+
.tpc-status-icon_status_postponed, .tpc-status-icon_status_draft2 {
|
|
11
|
+
color: var(--g-color-base-neutral-heavy);
|
|
12
|
+
}
|
|
13
|
+
.tpc-status-icon_status_done, .tpc-status-icon_status_launched, .tpc-status-icon_status_achieved, .tpc-status-icon_status_partially_achieved, .tpc-status-icon_status_according_to_plan {
|
|
14
|
+
color: var(--g-color-text-positive);
|
|
15
|
+
}
|
|
16
|
+
.tpc-status-icon_status_cancelled {
|
|
17
|
+
color: var(--g-color-text-complementary);
|
|
18
|
+
}
|
|
19
|
+
.tpc-status-icon_status_blocked, .tpc-status-icon_status_not_achieved {
|
|
20
|
+
color: var(--g-color-text-danger-heavy);
|
|
21
|
+
}
|
|
22
|
+
.tpc-status-icon_status_exceeded {
|
|
23
|
+
color: var(--g-color-text-utility);
|
|
24
|
+
}
|
|
25
|
+
.tpc-status-icon_status_unknown {
|
|
26
|
+
color: var(--g-color-text-misc-heavy);
|
|
27
|
+
}
|
|
28
|
+
/*# sourceMappingURL=StatusIcon.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["StatusIcon.scss"],"names":[],"mappings":"AACI;EAEI,qCAAA;AADR;AAII;EAEI,+BAAA;AAHR;AAMI;EAEI,wCAAA;AALR;AAQI;EAEI,wCAAA;AAPR;AAUI;EAKI,mCAAA;AAZR;AAeI;EACI,wCAAA;AAbR;AAgBI;EAEI,uCAAA;AAfR;AAkBI;EACI,kCAAA;AAhBR;AAmBI;EACI,qCAAA;AAjBR","file":"StatusIcon.css","sourcesContent":[".tpc-status-icon {\n &_status_new,\n &_status_draft {\n color: var(--g-color-text-misc-heavy);\n }\n\n &_status_inProgress,\n &_status_in_progress {\n color: var(--g-color-text-info);\n }\n\n &_status_paused,\n &_status_at_risk {\n color: var(--g-color-text-warning-heavy);\n }\n\n &_status_postponed,\n &_status_draft2 {\n color: var(--g-color-base-neutral-heavy);\n }\n\n &_status_done,\n &_status_launched,\n &_status_achieved,\n &_status_partially_achieved,\n &_status_according_to_plan {\n color: var(--g-color-text-positive);\n }\n\n &_status_cancelled {\n color: var(--g-color-text-complementary);\n }\n\n &_status_blocked,\n &_status_not_achieved {\n color: var(--g-color-text-danger-heavy);\n }\n\n &_status_exceeded {\n color: var(--g-color-text-utility);\n }\n\n &_status_unknown {\n color: var(--g-color-text-misc-heavy);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type IconRefugeProps } from '../IconRefuge';
|
|
3
|
+
import type { GoalStatus, IssueStatus, MetaEntityStatus } from './types';
|
|
4
|
+
import './StatusIcon.scss';
|
|
5
|
+
export type StatusIconProps = Partial<Pick<IconRefugeProps, 'containerClassName' | 'title'>> & {
|
|
6
|
+
statusType?: IssueStatus | MetaEntityStatus | GoalStatus;
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const StatusIcon: FC<StatusIconProps>;
|