@appquality/unguess-design-system 2.10.16 → 2.10.19
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 +37 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +58 -33
- package/build/stories/dropdowns/menuheader/_types.d.ts +5 -0
- package/build/stories/dropdowns/menuheader/index.d.ts +3 -0
- package/build/stories/navigation/app-header/index.stories.d.ts +1 -0
- package/build/stories/navigation/header/header-item/_types.d.ts +20 -0
- package/build/stories/navigation/header/header-item/headerItem.d.ts +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# v2.10.19 (Thu May 12 2022)
|
|
2
|
+
|
|
3
|
+
#### ⚠️ Pushed to `master`
|
|
4
|
+
|
|
5
|
+
- Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- fix(header-dropdown): fix z-index issues ([@cannarocks](https://github.com/cannarocks))
|
|
7
|
+
|
|
8
|
+
#### Authors: 1
|
|
9
|
+
|
|
10
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v2.10.18 (Thu May 12 2022)
|
|
15
|
+
|
|
16
|
+
#### ⚠️ Pushed to `master`
|
|
17
|
+
|
|
18
|
+
- fix(brand-item): update ws schema ([@cannarocks](https://github.com/cannarocks))
|
|
19
|
+
|
|
20
|
+
#### Authors: 1
|
|
21
|
+
|
|
22
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# v2.10.17 (Thu May 12 2022)
|
|
27
|
+
|
|
28
|
+
#### 🐛 Bug Fix
|
|
29
|
+
|
|
30
|
+
- feat(brand-item): add workspaces selector when there is more then one… [#52](https://github.com/AppQuality/unguess-design-system/pull/52) ([@cannarocks](https://github.com/cannarocks))
|
|
31
|
+
|
|
32
|
+
#### Authors: 1
|
|
33
|
+
|
|
34
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
1
38
|
# v2.10.16 (Fri May 06 2022)
|
|
2
39
|
|
|
3
40
|
#### ⚠️ Pushed to `master`
|
package/build/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./stories/dropdowns/menu";
|
|
|
20
20
|
export * from "./stories/dropdowns/multiselect";
|
|
21
21
|
export * from "./stories/dropdowns/select";
|
|
22
22
|
export * from "./stories/dropdowns/autocomplete";
|
|
23
|
+
export * from "./stories/dropdowns/menuheader";
|
|
23
24
|
export * from "./stories/forms/checkbox";
|
|
24
25
|
export * from "./stories/forms/checkbox/cards";
|
|
25
26
|
export * as FormField from "./stories/forms/field";
|
package/build/index.js
CHANGED
|
@@ -385,11 +385,11 @@ var ContentCard = styled__default["default"](reactNotifications.Well)(templateOb
|
|
|
385
385
|
- To group related content
|
|
386
386
|
*/
|
|
387
387
|
var Card = function (props) { return jsxRuntime.jsx(ContentCard, __assign({}, props)); };
|
|
388
|
-
var ContainerCard = styled__default["default"](Card)(templateObject_2$
|
|
388
|
+
var ContainerCard = styled__default["default"](Card)(templateObject_2$k || (templateObject_2$k = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), function (_a) {
|
|
389
389
|
var theme = _a.theme;
|
|
390
390
|
return theme.borderRadii.xl;
|
|
391
391
|
});
|
|
392
|
-
var templateObject_1$R, templateObject_2$
|
|
392
|
+
var templateObject_1$R, templateObject_2$k;
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
395
|
* Tags let users categorize content using a keyword.
|
|
@@ -641,12 +641,12 @@ var CampaignCardSkeleton = function () {
|
|
|
641
641
|
};
|
|
642
642
|
|
|
643
643
|
var flexCenter = styled.css(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
644
|
-
var flexColumnCenter = styled.css(templateObject_2$
|
|
644
|
+
var flexColumnCenter = styled.css(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n ", ";\n flex-direction: column;\n"], ["\n ", ";\n flex-direction: column;\n"])), flexCenter);
|
|
645
645
|
var flexStart = styled.css(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n align-items: ", ";\n"])), function (_a) {
|
|
646
646
|
var theme = _a.theme;
|
|
647
647
|
return (theme.rtl ? "flex-end" : "flex-start");
|
|
648
648
|
});
|
|
649
|
-
var cardStyle = styled.css(templateObject_4$
|
|
649
|
+
var cardStyle = styled.css(templateObject_4$a || (templateObject_4$a = __makeTemplateObject(["\n border-radius: ", ";\n padding: ", ";\n border: 1px solid ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n\n &:hover {\n box-shadow: ", ";\n }\n\n cursor: pointer;\n"], ["\n border-radius: ", ";\n padding: ", ";\n border: 1px solid ", ";\n display: flex;\n flex-direction: column;\n height: 100%;\n\n &:hover {\n box-shadow: ", ";\n }\n\n cursor: pointer;\n"])), function (_a) {
|
|
650
650
|
var theme = _a.theme;
|
|
651
651
|
return theme.borderRadii.lg;
|
|
652
652
|
}, function (_a) {
|
|
@@ -659,7 +659,7 @@ var cardStyle = styled.css(templateObject_4$9 || (templateObject_4$9 = __makeTem
|
|
|
659
659
|
var theme = _a.theme;
|
|
660
660
|
return theme.shadows.boxShadow(theme);
|
|
661
661
|
});
|
|
662
|
-
var templateObject_1$O, templateObject_2$
|
|
662
|
+
var templateObject_1$O, templateObject_2$j, templateObject_3$c, templateObject_4$a;
|
|
663
663
|
|
|
664
664
|
var getStatusIcon = function (status) {
|
|
665
665
|
switch (status) {
|
|
@@ -684,7 +684,7 @@ var getTypeDataIcon = function (type) {
|
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
686
|
var Wrapper$1 = styled__default["default"](Card)(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), cardStyle);
|
|
687
|
-
var StyledTag$1 = styled__default["default"](Tag)(templateObject_2$
|
|
687
|
+
var StyledTag$1 = styled__default["default"](Tag)(templateObject_2$i || (templateObject_2$i = __makeTemplateObject(["\n color: ", ";\n max-width: 75%;\n cursor: pointer;\n"], ["\n color: ", ";\n max-width: 75%;\n cursor: pointer;\n"])), function (_a) {
|
|
688
688
|
var theme = _a.theme;
|
|
689
689
|
return theme.palette.grey["700"];
|
|
690
690
|
});
|
|
@@ -701,7 +701,7 @@ var StyledTagNew$1 = styled__default["default"](Tag)(templateObject_3$b || (temp
|
|
|
701
701
|
var theme = _a.theme;
|
|
702
702
|
return theme.palette.white;
|
|
703
703
|
});
|
|
704
|
-
var StyledLabel$2 = styled__default["default"](Label)(templateObject_4$
|
|
704
|
+
var StyledLabel$2 = styled__default["default"](Label)(templateObject_4$9 || (templateObject_4$9 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n cursor: pointer;\n"], ["\n font-size: ", ";\n color: ", ";\n cursor: pointer;\n"])), function (_a) {
|
|
705
705
|
var theme = _a.theme;
|
|
706
706
|
return theme.fontSizes.sm;
|
|
707
707
|
}, function (_a) {
|
|
@@ -745,7 +745,7 @@ var CampaignCard = function (props) {
|
|
|
745
745
|
}
|
|
746
746
|
return props.isLoading ? (jsxRuntime.jsx(CampaignCardSkeleton, {})) : (jsxRuntime.jsxs(Wrapper$1, __assign({}, props, { children: [jsxRuntime.jsxs(CardHeader, { children: [jsxRuntime.jsx(StyledLabel$2, __assign({ isRegular: true }, { children: date })), isNew && (jsxRuntime.jsx(StyledTagNew$1, __assign({ hue: theme.palette.fuschia["600"], isPill: true, size: "medium", title: labelNew ? labelNew : "New!" }, { children: labelNew ? labelNew : "New!" })))] }), jsxRuntime.jsxs(CardBody$1, { children: [jsxRuntime.jsx(StyledLabel$2, __assign({ isRegular: true }, { children: projectTitleCut })), jsxRuntime.jsx(StyledTitleLabel$1, __assign({ isRegular: true }, { children: campaignTitleCut }))] }), jsxRuntime.jsx(Divider$1, {}), jsxRuntime.jsxs(CardFooter$1, { children: [props.pillText && (jsxRuntime.jsxs(StyledTag$1, __assign({ size: "large", isPill: true, isRegular: true, hue: theme.palette.grey[100] }, { children: [jsxRuntime.jsx(Tag.Avatar, { children: jsxRuntime.jsx(PillIcon, {}) }), props.pillText] }))), jsxRuntime.jsx(StatusIcon, {})] })] })));
|
|
747
747
|
};
|
|
748
|
-
var templateObject_1$N, templateObject_2$
|
|
748
|
+
var templateObject_1$N, templateObject_2$i, templateObject_3$b, templateObject_4$9, templateObject_5$4, templateObject_6$2, templateObject_7$1, templateObject_8$1, templateObject_9;
|
|
749
749
|
|
|
750
750
|
var Wrapper = styled__default["default"](Card)(templateObject_1$M || (templateObject_1$M = __makeTemplateObject(["\n border-radius: ", ";\n padding: ", ";\n border: 1px solid ", ";\n display: flex;\n flex-direction: column;\n\n &:hover {\n box-shadow: ", ";\n }\n"], ["\n border-radius: ", ";\n padding: ", ";\n border: 1px solid ", ";\n display: flex;\n flex-direction: column;\n\n &:hover {\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
751
751
|
var theme = _a.theme;
|
|
@@ -760,7 +760,7 @@ var Wrapper = styled__default["default"](Card)(templateObject_1$M || (templateOb
|
|
|
760
760
|
var theme = _a.theme;
|
|
761
761
|
return theme.shadows.boxShadow(theme);
|
|
762
762
|
});
|
|
763
|
-
var StyledTagNew = styled__default["default"](Tag)(templateObject_2$
|
|
763
|
+
var StyledTagNew = styled__default["default"](Tag)(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n height: ", "px;\n padding: ", "px\n ", "px;\n color: ", ";\n position: absolute;\n right: 16px;\n top: 16px;\n"], ["\n height: ", "px;\n padding: ", "px\n ", "px;\n color: ", ";\n position: absolute;\n right: 16px;\n top: 16px;\n"])), function (_a) {
|
|
764
764
|
var theme = _a.theme;
|
|
765
765
|
return theme.space.base * 6;
|
|
766
766
|
}, function (_a) {
|
|
@@ -780,7 +780,7 @@ var StyledLabel$1 = styled__default["default"](Label)(templateObject_3$a || (tem
|
|
|
780
780
|
var theme = _a.theme;
|
|
781
781
|
return theme.palette.grey["500"];
|
|
782
782
|
});
|
|
783
|
-
var StyledTitleLabel = styled__default["default"](Label)(templateObject_4$
|
|
783
|
+
var StyledTitleLabel = styled__default["default"](Label)(templateObject_4$8 || (templateObject_4$8 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n word-wrap: break-word;\n cursor: pointer;\n"], ["\n color: ", ";\n font-size: ", ";\n word-wrap: break-word;\n cursor: pointer;\n"])), function (_a) {
|
|
784
784
|
var theme = _a.theme;
|
|
785
785
|
return theme.palette.blue["600"];
|
|
786
786
|
}, function (_a) {
|
|
@@ -808,7 +808,7 @@ var ProductCard = function (props) {
|
|
|
808
808
|
}
|
|
809
809
|
return props.isLoading ? (jsxRuntime.jsx(CampaignCardSkeleton, {})) : (jsxRuntime.jsxs(Wrapper, __assign({}, props, { children: [jsxRuntime.jsxs(CardBody, __assign({ onClick: props.onCtaClick }, { children: [isNew && (jsxRuntime.jsx(StyledTagNew, __assign({ hue: theme.palette.fuschia["600"], isPill: true, size: "medium", title: labelNew ? labelNew : "New!" }, { children: labelNew ? labelNew : "New!" }))), props.icon && jsxRuntime.jsx(IconContainer$1, { children: props.icon }), props.preTitle && (jsxRuntime.jsx(StyledLabel$1, __assign({ isRegular: true }, { children: props.preTitle }))), jsxRuntime.jsx(StyledTitleLabel, __assign({ isRegular: true }, { children: productTitleCut }))] })), jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(CardFooter, { children: jsxRuntime.jsx(Button, __assign({ isPill: true, isPrimary: true, onClick: props.onCtaClick }, { children: props.ctaLabel })) })] })));
|
|
810
810
|
};
|
|
811
|
-
var templateObject_1$M, templateObject_2$
|
|
811
|
+
var templateObject_1$M, templateObject_2$h, templateObject_3$a, templateObject_4$8, templateObject_5$3, templateObject_6$1, templateObject_7, templateObject_8;
|
|
812
812
|
|
|
813
813
|
/**
|
|
814
814
|
* Title is a basic component used to display a title. Often used in card headers.
|
|
@@ -1133,6 +1133,8 @@ var templateObject_1$I;
|
|
|
1133
1133
|
*/
|
|
1134
1134
|
var Autocomplete = function (props) { return jsxRuntime.jsx(reactDropdowns.Autocomplete, __assign({}, props)); };
|
|
1135
1135
|
|
|
1136
|
+
var MenuHeaderItem = function (props) { return (jsxRuntime.jsx(reactDropdowns.HeaderItem, __assign({}, props))); };
|
|
1137
|
+
|
|
1136
1138
|
var UgCheckbox = styled__default["default"](reactForms.Checkbox)(templateObject_1$H || (templateObject_1$H = __makeTemplateObject([""], [""])));
|
|
1137
1139
|
/**
|
|
1138
1140
|
* A Checkbox lets users select and unselect options from a list.
|
|
@@ -1151,7 +1153,7 @@ var StyledCard$1 = styled__default["default"](Card)(templateObject_1$G || (templ
|
|
|
1151
1153
|
var theme = _a.theme;
|
|
1152
1154
|
return theme.palette.blue[300];
|
|
1153
1155
|
});
|
|
1154
|
-
var IconWrapper$1 = styled__default["default"].div(templateObject_2$
|
|
1156
|
+
var IconWrapper$1 = styled__default["default"].div(templateObject_2$g || (templateObject_2$g = __makeTemplateObject(["\n margin: ", "px auto;\n"], ["\n margin: ", "px auto;\n"])), function (_a) {
|
|
1155
1157
|
var theme = _a.theme;
|
|
1156
1158
|
return theme.space.base;
|
|
1157
1159
|
});
|
|
@@ -1162,7 +1164,7 @@ var LabelWrapper = styled__default["default"](Label)(templateObject_3$9 || (temp
|
|
|
1162
1164
|
var theme = _a.theme;
|
|
1163
1165
|
return theme.palette.grey[600];
|
|
1164
1166
|
});
|
|
1165
|
-
var StyledLabel = styled__default["default"](Label)(templateObject_4$
|
|
1167
|
+
var StyledLabel = styled__default["default"](Label)(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n margin: ", "px auto;\n"], ["\n margin: ", "px auto;\n"])), function (_a) {
|
|
1166
1168
|
var theme = _a.theme;
|
|
1167
1169
|
return theme.space.base;
|
|
1168
1170
|
});
|
|
@@ -1174,7 +1176,7 @@ var CheckboxCard = function (props) {
|
|
|
1174
1176
|
};
|
|
1175
1177
|
return (jsxRuntime.jsxs(StyledCard$1, __assign({}, props.card, props, props && !props.disabled && { onClick: handleToggle }, { className: checked ? "card-active" : "" }, { children: [jsxRuntime.jsx(IconWrapper$1, { children: (props.iconActive && checked) ? props.iconActive : props.icon }), jsxRuntime.jsx(LabelWrapper, { children: props.label }), jsxRuntime.jsx(Checkbox, __assign({}, props, { checked: checked, value: checked ? 1 : 0, onClick: function (e) { return e.stopPropagation(); } }, { children: jsxRuntime.jsx(StyledLabel, __assign({ hidden: true }, { children: props.label })) }))] })));
|
|
1176
1178
|
};
|
|
1177
|
-
var templateObject_1$G, templateObject_2$
|
|
1179
|
+
var templateObject_1$G, templateObject_2$g, templateObject_3$9, templateObject_4$7;
|
|
1178
1180
|
|
|
1179
1181
|
var UgField = styled__default["default"](reactForms.Field)(templateObject_1$F || (templateObject_1$F = __makeTemplateObject([""], [""])));
|
|
1180
1182
|
/**
|
|
@@ -1190,7 +1192,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1190
1192
|
});
|
|
1191
1193
|
|
|
1192
1194
|
var UgInput = styled__default["default"](reactForms.Input)(templateObject_1$E || (templateObject_1$E = __makeTemplateObject([""], [""])));
|
|
1193
|
-
var Hint = styled__default["default"](reactForms.Hint)(templateObject_2$
|
|
1195
|
+
var Hint = styled__default["default"](reactForms.Hint)(templateObject_2$f || (templateObject_2$f = __makeTemplateObject([""], [""])));
|
|
1194
1196
|
/**
|
|
1195
1197
|
* An Input lets users enter text into a field.
|
|
1196
1198
|
* <hr>
|
|
@@ -1199,7 +1201,7 @@ var Hint = styled__default["default"](reactForms.Hint)(templateObject_2$e || (te
|
|
|
1199
1201
|
* - To enter multiline text, use a Textarea
|
|
1200
1202
|
**/
|
|
1201
1203
|
var Input = function (props) { return jsxRuntime.jsx(UgInput, __assign({}, props)); };
|
|
1202
|
-
var templateObject_1$E, templateObject_2$
|
|
1204
|
+
var templateObject_1$E, templateObject_2$f;
|
|
1203
1205
|
|
|
1204
1206
|
var UgMediaInput = styled__default["default"](reactForms.MediaInput)(templateObject_1$D || (templateObject_1$D = __makeTemplateObject([""], [""])));
|
|
1205
1207
|
/**
|
|
@@ -1248,7 +1250,7 @@ var StyledCard = styled__default["default"](Card)(templateObject_1$B || (templat
|
|
|
1248
1250
|
var theme = _a.theme;
|
|
1249
1251
|
return theme.palette.blue[300];
|
|
1250
1252
|
});
|
|
1251
|
-
var IconWrapper = styled__default["default"].div(templateObject_2$
|
|
1253
|
+
var IconWrapper = styled__default["default"].div(templateObject_2$e || (templateObject_2$e = __makeTemplateObject(["\n margin: ", "px auto;\n"], ["\n margin: ", "px auto;\n"])), function (_a) {
|
|
1252
1254
|
var theme = _a.theme;
|
|
1253
1255
|
return theme.space.base;
|
|
1254
1256
|
});
|
|
@@ -1265,7 +1267,7 @@ var StyledText = styled__default["default"](reactTypography.LG)(templateObject_3
|
|
|
1265
1267
|
var theme = _a.theme;
|
|
1266
1268
|
return theme.colors.primaryHue;
|
|
1267
1269
|
});
|
|
1268
|
-
var Circle = styled__default["default"].div(templateObject_4$
|
|
1270
|
+
var Circle = styled__default["default"].div(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n padding: ", "px;\n border-radius: 50%;\n background-color: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-left: auto;\n ", "\n"], ["\n width: ", "px;\n height: ", "px;\n padding: ", "px;\n border-radius: 50%;\n background-color: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-left: auto;\n ", "\n"])), function (_a) {
|
|
1269
1271
|
var theme = _a.theme;
|
|
1270
1272
|
return theme.space.base * 6;
|
|
1271
1273
|
}, function (_a) {
|
|
@@ -1293,7 +1295,7 @@ var RadioCard = function (_a) {
|
|
|
1293
1295
|
var card = _a.card, icon = _a.icon, iconActive = _a.iconActive, props = __rest(_a, ["card", "icon", "iconActive"]);
|
|
1294
1296
|
return (jsxRuntime.jsxs(StyledCard, __assign({}, card, props, { className: props.checked ? "card-active" : "", onClick: function () { props.onChecked && props.onChecked(props.value); } }, { children: [jsxRuntime.jsx(Circle, __assign({ checked: (_b = props.checked) !== null && _b !== void 0 ? _b : false }, { children: jsxRuntime.jsx(SvgCheckLg, { fill: "white" }) })), jsxRuntime.jsx(IconWrapper, { children: (iconActive && props.checked) ? iconActive : icon }), jsxRuntime.jsx("input", { hidden: true, type: "radio", value: props.value, name: props.name, checked: props.checked }), jsxRuntime.jsx(StyledDivider, {}), jsxRuntime.jsx(StyledText, { children: props.label })] })));
|
|
1295
1297
|
};
|
|
1296
|
-
var templateObject_1$B, templateObject_2$
|
|
1298
|
+
var templateObject_1$B, templateObject_2$e, templateObject_3$8, templateObject_4$6, templateObject_5$2;
|
|
1297
1299
|
|
|
1298
1300
|
var UgTextarea = styled__default["default"](reactForms.Textarea)(templateObject_1$A || (templateObject_1$A = __makeTemplateObject([""], [""])));
|
|
1299
1301
|
/**
|
|
@@ -1457,8 +1459,12 @@ var UgHeaderItem = styled__default["default"](reactChrome.HeaderItem)(templateOb
|
|
|
1457
1459
|
var theme = _a.theme;
|
|
1458
1460
|
return theme.fonts.system;
|
|
1459
1461
|
});
|
|
1462
|
+
styled__default["default"](reactChrome.HeaderItemWrapper)(templateObject_2$d || (templateObject_2$d = __makeTemplateObject(["\n font-family: ", ";\n"], ["\n font-family: ", ";\n"])), function (_a) {
|
|
1463
|
+
var theme = _a.theme;
|
|
1464
|
+
return theme.fonts.system;
|
|
1465
|
+
});
|
|
1460
1466
|
var HeaderItem = function (props) { return jsxRuntime.jsx(UgHeaderItem, __assign({}, props)); };
|
|
1461
|
-
var templateObject_1$u;
|
|
1467
|
+
var templateObject_1$u, templateObject_2$d;
|
|
1462
1468
|
|
|
1463
1469
|
var UgHeaderItemText = styled__default["default"](reactChrome.HeaderItemText)(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n font-family: ", ";\n"], ["\n font-family: ", ";\n"])), function (_a) {
|
|
1464
1470
|
var theme = _a.theme;
|
|
@@ -1514,6 +1520,16 @@ var SvgMenuStroke = function SvgMenuStroke(props) {
|
|
|
1514
1520
|
})));
|
|
1515
1521
|
};
|
|
1516
1522
|
|
|
1523
|
+
/**
|
|
1524
|
+
* Type components come in small, medium, large, extra-large, extra-extra-large, and extra-extra-extra-large.
|
|
1525
|
+
*/
|
|
1526
|
+
var SM = function (props) { return jsxRuntime.jsx(reactTypography.SM, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.sm } : {} }, props)); };
|
|
1527
|
+
var MD = function (props) { return jsxRuntime.jsx(reactTypography.MD, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.md } : {} }, props)); };
|
|
1528
|
+
var LG = function (props) { return jsxRuntime.jsx(reactTypography.LG, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.lg } : {} }, props)); };
|
|
1529
|
+
var XL = function (props) { return jsxRuntime.jsx(reactTypography.XL, __assign({}, props)); };
|
|
1530
|
+
var XXL = function (props) { return jsxRuntime.jsx(reactTypography.XXL, __assign({}, props)); };
|
|
1531
|
+
var XXXL = function (props) { return jsxRuntime.jsx(reactTypography.XXXL, __assign({}, props)); };
|
|
1532
|
+
|
|
1517
1533
|
var LogoIconContainer = styled__default["default"](reactChrome.HeaderItem)(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n margin-right: 2px;\n border-right: none;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"], ["\n margin-right: 2px;\n border-right: none;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"])), function (_a) {
|
|
1518
1534
|
var theme = _a.theme;
|
|
1519
1535
|
return theme.breakpoints.sm;
|
|
@@ -1528,7 +1544,17 @@ var BrandName = styled__default["default"](reactChrome.HeaderItem)(templateObjec
|
|
|
1528
1544
|
var theme = _a.theme;
|
|
1529
1545
|
return theme.breakpoints.sm;
|
|
1530
1546
|
});
|
|
1531
|
-
var
|
|
1547
|
+
var DropdownItem = styled__default["default"](reactChrome.HeaderItem)(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n margin-right: auto;\n margin-left: -8px;\n color: ", ";\n font-family: ", ";\n z-index: 2;\n @media (max-width: ", ") {\n display: none;\n }\n"], ["\n margin-right: auto;\n margin-left: -8px;\n color: ", ";\n font-family: ", ";\n z-index: 2;\n @media (max-width: ", ") {\n display: none;\n }\n"])), function (_a) {
|
|
1548
|
+
var theme = _a.theme;
|
|
1549
|
+
return theme.palette.blue["600"];
|
|
1550
|
+
}, function (_a) {
|
|
1551
|
+
var theme = _a.theme;
|
|
1552
|
+
return theme.fonts.system;
|
|
1553
|
+
}, function (_a) {
|
|
1554
|
+
var theme = _a.theme;
|
|
1555
|
+
return theme.breakpoints.sm;
|
|
1556
|
+
});
|
|
1557
|
+
var MenuItem$1 = styled__default["default"](reactChrome.HeaderItem)(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n color: ", ";\n position: absolute;\n left: 0;\n @media (min-width: ", ") {\n display: none;\n }\n"], ["\n color: ", ";\n position: absolute;\n left: 0;\n @media (min-width: ", ") {\n display: none;\n }\n"])), function (_a) {
|
|
1532
1558
|
var theme = _a.theme;
|
|
1533
1559
|
return theme.palette.blue["600"];
|
|
1534
1560
|
}, function (_a) {
|
|
@@ -1536,9 +1562,17 @@ var MenuItem$1 = styled__default["default"](reactChrome.HeaderItem)(templateObje
|
|
|
1536
1562
|
return theme.breakpoints.sm;
|
|
1537
1563
|
});
|
|
1538
1564
|
var BrandItem = function (props) {
|
|
1539
|
-
|
|
1565
|
+
var _a = React.useState(props.activeWorkspace), selectedWorkspace = _a[0], setSelectedWorkspace = _a[1];
|
|
1566
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(MenuItem$1, __assign({}, props, { onClick: props.toggleMenu }, { children: [jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(SvgMenuStroke, {}) }), props.menuLabel && jsxRuntime.jsx(HeaderItemText, { children: props.menuLabel })] })), jsxRuntime.jsx(LogoIconContainer, __assign({}, props, { hasLogo: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }) })), props.workspaces && props.workspaces.length > 1 ? (jsxRuntime.jsx(DropdownItem, { children: jsxRuntime.jsxs(Dropdown, __assign({ selectedItem: selectedWorkspace, onSelect: function (workspace) {
|
|
1567
|
+
setSelectedWorkspace(workspace);
|
|
1568
|
+
props.onWorkspaceChange && props.onWorkspaceChange(workspace);
|
|
1569
|
+
}, downshiftProps: {
|
|
1570
|
+
itemToString: function (item) { return item && item.company; },
|
|
1571
|
+
} }, { children: [jsxRuntime.jsx(reactDropdowns.Field, { children: jsxRuntime.jsx(Select, __assign({ style: { color: theme.colors.primaryHue } }, { children: selectedWorkspace
|
|
1572
|
+
? selectedWorkspace.company + "'s workspace"
|
|
1573
|
+
: "Select workspace" })) }), jsxRuntime.jsxs(Menu, { children: [jsxRuntime.jsx(MenuHeaderItem, { children: jsxRuntime.jsx(MD, __assign({ isBold: true, style: { color: theme.palette.grey[800] } }, { children: props.workspacesLabel || "Workspaces" })) }), jsxRuntime.jsx(Separator, {}), props.workspaces.map(function (item) { return (jsxRuntime.jsx(Item, __assign({ value: item }, { children: item.company }))); })] })] })) })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.brandName && (jsxRuntime.jsx(BrandName, __assign({}, props, { children: jsxRuntime.jsx(HeaderItemText, { children: props.brandName }) }))) }))] }));
|
|
1540
1574
|
};
|
|
1541
|
-
var templateObject_1$s, templateObject_2$c, templateObject_3$7;
|
|
1575
|
+
var templateObject_1$s, templateObject_2$c, templateObject_3$7, templateObject_4$5;
|
|
1542
1576
|
|
|
1543
1577
|
var UgHeader = styled__default["default"](reactChrome.Header)(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n height: ", ";\n"], ["\n height: ", ";\n"])), theme.components.chrome.header.height);
|
|
1544
1578
|
/**
|
|
@@ -1837,16 +1871,6 @@ var templateObject_1$h;
|
|
|
1837
1871
|
*/
|
|
1838
1872
|
var Title = function (props) { return jsxRuntime.jsx(reactNotifications.Title, __assign({}, props)); };
|
|
1839
1873
|
|
|
1840
|
-
/**
|
|
1841
|
-
* Type components come in small, medium, large, extra-large, extra-extra-large, and extra-extra-extra-large.
|
|
1842
|
-
*/
|
|
1843
|
-
var SM = function (props) { return jsxRuntime.jsx(reactTypography.SM, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.sm } : {} }, props)); };
|
|
1844
|
-
var MD = function (props) { return jsxRuntime.jsx(reactTypography.MD, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.md } : {} }, props)); };
|
|
1845
|
-
var LG = function (props) { return jsxRuntime.jsx(reactTypography.LG, __assign({ style: props.isMonospace ? { lineHeight: theme.lineHeights.lg } : {} }, props)); };
|
|
1846
|
-
var XL = function (props) { return jsxRuntime.jsx(reactTypography.XL, __assign({}, props)); };
|
|
1847
|
-
var XXL = function (props) { return jsxRuntime.jsx(reactTypography.XXL, __assign({}, props)); };
|
|
1848
|
-
var XXXL = function (props) { return jsxRuntime.jsx(reactTypography.XXXL, __assign({}, props)); };
|
|
1849
|
-
|
|
1850
1874
|
/**
|
|
1851
1875
|
* Login Form
|
|
1852
1876
|
* <hr>
|
|
@@ -2475,6 +2499,7 @@ exports.MediaFigure = MediaFigure;
|
|
|
2475
2499
|
exports.MediaInput = MediaInput;
|
|
2476
2500
|
exports.MediaItem = MediaItem;
|
|
2477
2501
|
exports.Menu = Menu;
|
|
2502
|
+
exports.MenuHeaderItem = MenuHeaderItem;
|
|
2478
2503
|
exports.Message = Message;
|
|
2479
2504
|
exports.Modal = Modal;
|
|
2480
2505
|
exports.ModalFullScreen = ModalFullScreen;
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
import { ComponentMeta, Story } from "@storybook/react";
|
|
3
3
|
import { AppHeaderArgs } from "./_types";
|
|
4
4
|
export declare const Default: Story<AppHeaderArgs>;
|
|
5
|
+
export declare const MultipleWorkspaces: Story<AppHeaderArgs>;
|
|
5
6
|
declare const _default: ComponentMeta<({ brand, avatar, isLoading, ...args }: AppHeaderArgs) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, HTMLAttributes } from "react";
|
|
2
2
|
import { IHeaderItemProps, IHeaderItemTextProps } from "@zendeskgarden/react-chrome";
|
|
3
|
+
export interface Workspace {
|
|
4
|
+
id: number;
|
|
5
|
+
company: string;
|
|
6
|
+
tokens?: number;
|
|
7
|
+
logo?: string;
|
|
8
|
+
csm?: {
|
|
9
|
+
id: number;
|
|
10
|
+
email: string;
|
|
11
|
+
name: string;
|
|
12
|
+
profile_id: number;
|
|
13
|
+
tryber_wp_user_id: number;
|
|
14
|
+
picture?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
3
17
|
export interface HeaderItemArgs extends IHeaderItemProps {
|
|
4
18
|
/** Maximizes the width of a flex item in the header */
|
|
5
19
|
maxX?: boolean;
|
|
@@ -21,6 +35,10 @@ export interface BrandItemArgs extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
21
35
|
brandName?: string;
|
|
22
36
|
/** Add a descriptive text to the menu item icon*/
|
|
23
37
|
menuLabel?: string;
|
|
38
|
+
workspacesLabel?: string;
|
|
39
|
+
activeWorkspace?: Workspace;
|
|
40
|
+
workspaces?: Workspace[];
|
|
41
|
+
onWorkspaceChange?: (workspace: Workspace) => void;
|
|
24
42
|
/** Triggered when the menu item is clicked */
|
|
25
43
|
toggleMenu?: () => void;
|
|
26
44
|
}
|
|
@@ -30,3 +48,5 @@ export interface HeaderItemTextArgs extends IHeaderItemTextProps {
|
|
|
30
48
|
}
|
|
31
49
|
export interface HeaderItemIconArgs extends HTMLAttributes<HTMLDivElement> {
|
|
32
50
|
}
|
|
51
|
+
export interface HeaderItemWrapperArgs extends HTMLAttributes<HTMLDivElement> {
|
|
52
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { HeaderItemArgs } from "./_types";
|
|
2
|
+
import { HeaderItemArgs, HeaderItemWrapperArgs } from "./_types";
|
|
3
3
|
declare const HeaderItem: (props: HeaderItemArgs) => JSX.Element;
|
|
4
|
-
|
|
4
|
+
declare const HeaderItemWrapper: (props: HeaderItemWrapperArgs) => JSX.Element;
|
|
5
|
+
export { HeaderItem, HeaderItemWrapper };
|