@deskpro/deskpro-ui 0.1.3 → 0.1.7
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/dist/cjs/components/AttachmentTag/AttachmentTag.d.ts.map +1 -1
- package/dist/cjs/components/AttachmentTag/AttachmentTag.js +1 -1
- package/dist/cjs/components/Avatar/Avatar.d.ts +2 -2
- package/dist/cjs/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.js +5 -3
- package/dist/cjs/components/Menu/Menu.d.ts +11 -1
- package/dist/cjs/components/Menu/Menu.d.ts.map +1 -1
- package/dist/cjs/components/TabbedSection/Tabs.d.ts.map +1 -1
- package/dist/cjs/components/TabbedSection/Tabs.js +4 -4
- package/dist/cjs/components/TabbedSection/types.d.ts +2 -0
- package/dist/cjs/components/TabbedSection/types.d.ts.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/components/AttachmentTag/AttachmentTag.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js +5 -3
- package/dist/esm/components/TabbedSection/Tabs.js +4 -4
- package/package.json +3 -2
- package/.idea/.gitignore +0 -8
- package/.idea/deskpro-ui.iml +0 -8
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
|
@@ -36,7 +36,7 @@ export var AttachmentTag = forwardRef(function AttachmentTag(_a, ref) {
|
|
|
36
36
|
React.createElement(Size, null, displayFileSize)),
|
|
37
37
|
match({ withClose: withClose, isLoading: isLoading })
|
|
38
38
|
.with({ isLoading: true }, function () { return React.createElement(InlineLoadingSpinner, null); })
|
|
39
|
-
.with({ withClose: true }, function () { return (React.createElement(IconButton, { minimal: true, onClick: onClose, icon: faTimes })); })
|
|
39
|
+
.with({ withClose: true }, function () { return (React.createElement(IconButton, { role: "button", "aria-label": "close-attachment", minimal: true, onClick: onClose, icon: faTimes })); })
|
|
40
40
|
.otherwise(function () { return null; })));
|
|
41
41
|
});
|
|
42
42
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -9,6 +9,7 @@ import { GetLabelColorByChar } from "../../utils/getRandomColor";
|
|
|
9
9
|
import { Stack } from "../../layout";
|
|
10
10
|
import { Tooltip } from "../Tooltip";
|
|
11
11
|
import { dpNameProp } from "../../utils";
|
|
12
|
+
import { faUser } from "@fortawesome/free-regular-svg-icons";
|
|
12
13
|
var AvaImage = styled.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n height: ", "px;\n width: ", "px;\n min-height: ", "px;\n min-width: ", "px;\n max-height: ", "px;\n max-width: ", "px;\n object-fit: cover;\n ", "\n"], ["\n display: flex;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n height: ", "px;\n width: ", "px;\n min-height: ", "px;\n min-width: ", "px;\n max-height: ", "px;\n max-width: ", "px;\n object-fit: cover;\n ", "\n"])), function (_a) {
|
|
13
14
|
var size = _a.size;
|
|
14
15
|
return size;
|
|
@@ -73,7 +74,7 @@ export var StatusCircle = styled.div(templateObject_4 || (templateObject_4 = __m
|
|
|
73
74
|
return (rounded ? "border-radius: 50%;" : "");
|
|
74
75
|
});
|
|
75
76
|
export var Avatar = React.memo(function (_a) {
|
|
76
|
-
var imageStyles = _a.imageStyles, name = _a.name,
|
|
77
|
+
var imageStyles = _a.imageStyles, _b = _a.backupIcon, backupIcon = _b === void 0 ? faUser : _b, name = _a.name, _c = _a.size, size = _c === void 0 ? 18 : _c, themeColor = _a.themeColor, onlineStatus = _a.onlineStatus, showOnlineBadge = _a.showOnlineBadge, _d = _a.showTooltip, showTooltip = _d === void 0 ? true : _d, _e = _a.rounded, rounded = _e === void 0 ? true : _e, props = __rest(_a, ["imageStyles", "backupIcon", "name", "size", "themeColor", "onlineStatus", "showOnlineBadge", "showTooltip", "rounded"]);
|
|
77
78
|
var statusColor = useMemo(function () {
|
|
78
79
|
if (!showOnlineBadge) {
|
|
79
80
|
return undefined;
|
|
@@ -126,16 +127,17 @@ export var Avatar = React.memo(function (_a) {
|
|
|
126
127
|
if (name && initials) {
|
|
127
128
|
return React.createElement(TagCircleLetter, { name: name, size: size });
|
|
128
129
|
}
|
|
129
|
-
return (React.createElement(TagCircleIcon, { icon:
|
|
130
|
+
return (React.createElement(TagCircleIcon, { icon: backupIcon, color: themeColor !== null && themeColor !== void 0 ? themeColor : "brandShade", size: size }));
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
132
|
-
return React.createElement(Icon, { icon:
|
|
133
|
+
return React.createElement(Icon, { icon: backupIcon, size: size });
|
|
133
134
|
}
|
|
134
135
|
}, [
|
|
135
136
|
props,
|
|
136
137
|
name,
|
|
137
138
|
initials,
|
|
138
139
|
themeColor,
|
|
140
|
+
backupIcon,
|
|
139
141
|
size,
|
|
140
142
|
imgContainerStyle,
|
|
141
143
|
showTooltip,
|
|
@@ -6,7 +6,7 @@ import { headingStyles } from "../Typography";
|
|
|
6
6
|
import { dpNameProp } from "../../utils";
|
|
7
7
|
export var TabWrapperCSS = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
8
8
|
var active = _a.active, isTicketHistory = _a.isTicketHistory;
|
|
9
|
-
return active && isTicketHistory ? headingStyles.h1 : headingStyles.h2;
|
|
9
|
+
return (active && isTicketHistory ? headingStyles.h1 : headingStyles.h2);
|
|
10
10
|
});
|
|
11
11
|
var TabWrapper = styled(Stack)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-style: normal;\n font-weight: ", ";\n font-size: 11px;\n line-height: 110%;\n cursor: default;\n align-items: center;\n justify-content: center;\n pointer-events: ", ";\n color: ", ";\n border-bottom: ", ";\n padding: 0 3px 6px 3px;\n\n :hover {\n color: ", ";\n cursor: pointer;\n }\n\n ", ";\n\n ", ";\n"], ["\n font-family: ", ";\n font-style: normal;\n font-weight: ", ";\n font-size: 11px;\n line-height: 110%;\n cursor: default;\n align-items: center;\n justify-content: center;\n pointer-events: ", ";\n color: ", ";\n border-bottom: ", ";\n padding: 0 3px 6px 3px;\n\n :hover {\n color: ", ";\n cursor: pointer;\n }\n\n ", ";\n\n ", ";\n"])), function (_a) {
|
|
12
12
|
var theme = _a.theme;
|
|
@@ -27,7 +27,7 @@ var TabWrapper = styled(Stack)(templateObject_4 || (templateObject_4 = __makeTem
|
|
|
27
27
|
return props.active ? "solid 2px ".concat(props.theme.colors.brandPrimary) : "none";
|
|
28
28
|
}, function (props) { return props.theme.colors.grey100; }, function (_a) {
|
|
29
29
|
var active = _a.active, tabStyle = _a.tabStyle, theme = _a.theme;
|
|
30
|
-
return tabStyle === "button" && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px
|
|
30
|
+
return tabStyle === "button" && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px\n ", ";\n border-right-width: 0;\n\n :first-of-type {\n border-left-width: 0;\n }\n\n padding: 7px;\n\n ", ";\n "], ["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px\n ", ";\n border-right-width: 0;\n\n :first-of-type {\n border-left-width: 0;\n }\n\n padding: 7px;\n\n ", ";\n "])), theme.colors.grey20, active ? theme.colors.brandPrimary : theme.colors.grey20, active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.colors.brandShade20));
|
|
31
31
|
}, TabWrapperCSS);
|
|
32
32
|
var StyledTabBar = styled(Stack)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"], ["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"])), function (_a) {
|
|
33
33
|
var tabStyle = _a.tabStyle, theme = _a.theme;
|
|
@@ -39,11 +39,11 @@ var StyledTabBar = styled(Stack)(templateObject_5 || (templateObject_5 = __makeT
|
|
|
39
39
|
export function TabbedSectionTabs(_a) {
|
|
40
40
|
var tabs = _a.tabs, activeTab = _a.activeTab, onTabChange = _a.onTabChange, children = _a.children, tabsWrapperStyles = _a.tabsWrapperStyles, rightElement = _a.rightElement, _b = _a.tabType, tabType = _b === void 0 ? "tab" : _b, className = _a.className;
|
|
41
41
|
return (React.createElement(React.Fragment, null,
|
|
42
|
-
React.createElement(StyledTabBar, __assign({}, dpNameProp("TabbedSectionTabs"), { style: tabsWrapperStyles, tabStyle: tabType, justify: "space-around", className: className }),
|
|
42
|
+
React.createElement(StyledTabBar, __assign({}, dpNameProp("TabbedSectionTabs"), { style: tabsWrapperStyles, tabStyle: tabType, justify: "space-around", className: className, role: "tablist" }),
|
|
43
43
|
tabs.map(function (tab, index) {
|
|
44
44
|
return (React.createElement(TabWrapper, { key: index, disabled: tab.disabled, active: tab.id === activeTab, onClick: function () {
|
|
45
45
|
onTabChange(tab);
|
|
46
|
-
}, tabStyle: tabType }, tab.title));
|
|
46
|
+
}, tabStyle: tabType, role: "tab", "aria-selected": tab.id === activeTab, "aria-controls": tab.controls }, tab.title));
|
|
47
47
|
}),
|
|
48
48
|
rightElement),
|
|
49
49
|
children));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deskpro/deskpro-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "UI components used in Deskpro",
|
|
5
5
|
"author": "Deskpro",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"ts-pattern": "3.3.5",
|
|
73
73
|
"use-debounce": "7.0.1",
|
|
74
74
|
"uuid": "^8.3.2",
|
|
75
|
-
"yup": "
|
|
75
|
+
"yup": "0.31.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@babel/core": "^7.16.0",
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"@typescript-eslint/eslint-plugin": "5.6.0",
|
|
102
102
|
"@typescript-eslint/parser": "5.6.0",
|
|
103
103
|
"@typescript/lib-dom": "npm:@types/web",
|
|
104
|
+
"@types/yup": "^0.29.11",
|
|
104
105
|
"chromatic": "6.2.0",
|
|
105
106
|
"conditional-type-checks": "1.0.5",
|
|
106
107
|
"cross-env": "^7.0.3",
|
package/.idea/.gitignore
DELETED
package/.idea/deskpro-ui.iml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
|
5
|
-
<orderEntry type="inheritedJdk" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/deskpro-ui.iml" filepath="$PROJECT_DIR$/.idea/deskpro-ui.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED