@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.
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentTag.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentTag/AttachmentTag.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoC,UAAU,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,OAAO,EAAQ,MAAM,SAAS,CAAC;AA2CxC,eAAO,MAAM,IAAI;aAAyB,SAAS,GAAG,OAAO;SAO5D,CAAC;AAiBF,eAAO,MAAM,aAAa;cAVd,MAAM;cACN,MAAM;UACV,OAAO;mBACC,WAAW,iBAAiB,CAAC,KAAK,IAAI;;;;;2CAmDpD,CAAC"}
1
+ {"version":3,"file":"AttachmentTag.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentTag/AttachmentTag.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoC,UAAU,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,OAAO,EAAQ,MAAM,SAAS,CAAC;AA2CxC,eAAO,MAAM,IAAI;aAAyB,SAAS,GAAG,OAAO;SAO5D,CAAC;AAiBF,eAAO,MAAM,aAAa;cAVd,MAAM;cACN,MAAM;UACV,OAAO;mBACC,WAAW,iBAAiB,CAAC,KAAK,IAAI;;;;;2CAyDpD,CAAC"}
@@ -39,7 +39,7 @@ exports.AttachmentTag = (0, react_1.forwardRef)(function AttachmentTag(_a, ref)
39
39
  React.createElement(Size, null, displayFileSize)),
40
40
  (0, ts_pattern_1.match)({ withClose: withClose, isLoading: isLoading })
41
41
  .with({ isLoading: true }, function () { return React.createElement(LoadingAttachment_1.InlineLoadingSpinner, null); })
42
- .with({ withClose: true }, function () { return (React.createElement(Button_1.IconButton, { minimal: true, onClick: onClose, icon: free_solid_svg_icons_1.faTimes })); })
42
+ .with({ withClose: true }, function () { return (React.createElement(Button_1.IconButton, { role: "button", "aria-label": "close-attachment", minimal: true, onClick: onClose, icon: free_solid_svg_icons_1.faTimes })); })
43
43
  .otherwise(function () { return null; })));
44
44
  });
45
45
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -26,7 +26,7 @@ interface ImageAvatarProps {
26
26
  imageUrl?: string | null;
27
27
  }
28
28
  interface BaseAvatarProps {
29
- backupIcon: AnyIcon;
29
+ backupIcon?: AnyIcon;
30
30
  name?: string;
31
31
  size?: AvatarSize;
32
32
  imageStyles?: CSSProperties;
@@ -39,7 +39,7 @@ interface BaseAvatarProps {
39
39
  */
40
40
  rounded?: boolean;
41
41
  }
42
- export declare const Avatar: React.MemoExoticComponent<({ imageStyles, name, size, themeColor, onlineStatus, showOnlineBadge, showTooltip, rounded, ...props }: AvatarProps) => JSX.Element>;
42
+ export declare const Avatar: React.MemoExoticComponent<({ imageStyles, backupIcon, name, size, themeColor, onlineStatus, showOnlineBadge, showTooltip, rounded, ...props }: AvatarProps) => JSX.Element>;
43
43
  export declare const isFaIconAvatarProps: (avatarProps: AvatarProps) => avatarProps is FaIconAvatarProps & BaseAvatarProps;
44
44
  export declare const isImageAvatarProps: (avatarProps: AvatarProps) => avatarProps is ImageAvatarProps & BaseAvatarProps;
45
45
  export declare const AvatarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("../../layout").StackProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAQ,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAqC5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,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,MAAM,iJAYd,WAAW,iBA+Hf,CAAC;AAOF,eAAO,MAAM,mBAAmB,gBACjB,WAAW,uDAEQ,CAAC;AACnC,eAAO,MAAM,kBAAkB,gBAChB,WAAW,sDAEC,CAAC;AAE5B,eAAO,MAAM,eAAe;;;;;UAIjB,MAAM;kCAGhB,CAAC"}
@@ -12,6 +12,7 @@ var getRandomColor_1 = require("../../utils/getRandomColor");
12
12
  var layout_1 = require("../../layout");
13
13
  var Tooltip_1 = require("../Tooltip");
14
14
  var utils_1 = require("../../utils");
15
+ var free_regular_svg_icons_1 = require("@fortawesome/free-regular-svg-icons");
15
16
  var AvaImage = styled_components_1.default.img(templateObject_1 || (templateObject_1 = (0, tslib_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) {
16
17
  var size = _a.size;
17
18
  return size;
@@ -76,7 +77,7 @@ exports.StatusCircle = styled_components_1.default.div(templateObject_4 || (temp
76
77
  return (rounded ? "border-radius: 50%;" : "");
77
78
  });
78
79
  exports.Avatar = React.memo(function (_a) {
79
- var imageStyles = _a.imageStyles, name = _a.name, _b = _a.size, size = _b === void 0 ? 18 : _b, themeColor = _a.themeColor, onlineStatus = _a.onlineStatus, showOnlineBadge = _a.showOnlineBadge, _c = _a.showTooltip, showTooltip = _c === void 0 ? true : _c, _d = _a.rounded, rounded = _d === void 0 ? true : _d, props = (0, tslib_1.__rest)(_a, ["imageStyles", "name", "size", "themeColor", "onlineStatus", "showOnlineBadge", "showTooltip", "rounded"]);
80
+ var imageStyles = _a.imageStyles, _b = _a.backupIcon, backupIcon = _b === void 0 ? free_regular_svg_icons_1.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 = (0, tslib_1.__rest)(_a, ["imageStyles", "backupIcon", "name", "size", "themeColor", "onlineStatus", "showOnlineBadge", "showTooltip", "rounded"]);
80
81
  var statusColor = (0, react_1.useMemo)(function () {
81
82
  if (!showOnlineBadge) {
82
83
  return undefined;
@@ -129,16 +130,17 @@ exports.Avatar = React.memo(function (_a) {
129
130
  if (name && initials) {
130
131
  return React.createElement(LabelTag_1.TagCircleLetter, { name: name, size: size });
131
132
  }
132
- return (React.createElement(LabelTag_1.TagCircleIcon, { icon: props.backupIcon, color: themeColor !== null && themeColor !== void 0 ? themeColor : "brandShade", size: size }));
133
+ return (React.createElement(LabelTag_1.TagCircleIcon, { icon: backupIcon, color: themeColor !== null && themeColor !== void 0 ? themeColor : "brandShade", size: size }));
133
134
  }
134
135
  else {
135
- return React.createElement(Icon_1.Icon, { icon: props.backupIcon, size: size });
136
+ return React.createElement(Icon_1.Icon, { icon: backupIcon, size: size });
136
137
  }
137
138
  }, [
138
139
  props,
139
140
  name,
140
141
  initials,
141
142
  themeColor,
143
+ backupIcon,
142
144
  size,
143
145
  imgContainerStyle,
144
146
  showTooltip,
@@ -1,6 +1,6 @@
1
1
  /// <reference types="@typescript/lib-dom" />
2
2
  import * as React from "react";
3
- import { ReactNode } from "react";
3
+ import { HTMLAttributes, ReactNode } from "react";
4
4
  import { AnyIcon } from "../Icon";
5
5
  interface MenuProps {
6
6
  children?: ReactNode | ((active: boolean) => ReactNode);
@@ -14,6 +14,16 @@ interface MenuDividerProps {
14
14
  title?: ReactNode;
15
15
  }
16
16
  export declare function MenuDivider({ title }: MenuDividerProps): JSX.Element;
17
+ export declare type MenuItemProps = {
18
+ active?: boolean;
19
+ children?: ReactNode;
20
+ disabled?: boolean;
21
+ icon?: AnyIcon | JSX.Element | null;
22
+ rightIcon?: AnyIcon | JSX.Element | null;
23
+ label?: ReactNode;
24
+ htmlTitle?: string;
25
+ iconColor?: string;
26
+ } & HTMLAttributes<HTMLAnchorElement>;
17
27
  export declare const MenuItem: React.ForwardRefExoticComponent<{
18
28
  active?: boolean | undefined;
19
29
  children?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8B,SAAS,EAAO,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,OAAO,EAAmB,MAAM,SAAS,CAAC;AAUnD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC;IACxD,mBAAmB;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAY,EACZ,YAAmB,EACnB,QAAQ,GACT,EAAE,SAAS,eAWX;AAED,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,eAUtD;AAaD,eAAO,MAAM,QAAQ;;eATR,SAAS;;;;YAIZ,SAAS;;;qFAiEjB,CAAC"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/Menu.tsx"],"names":[],"mapp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AM,SAAS,CAAC;AAI7C,eAAO,MAAM,aAAa;YACkB,OAAO;;6CAElD,CAAC;AA8DF,wBAAgB,iBAAiB,CAAC,KAAK,GAAG,MAAM,EAAE,EAChD,IAAI,EACJ,SAAS,EACT,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,OAAe,EACf,SAAS,GACV,EAAE,kBAAkB,CAAC,KAAK,CAAC,eA8B3B"}
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/TabbedSection/Tabs.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,eAAO,MAAM,aAAa;YAKd,OAAO;;6CAGlB,CAAC;AA+DF,wBAAgB,iBAAiB,CAAC,KAAK,GAAG,MAAM,EAAE,EAChD,IAAI,EACJ,SAAS,EACT,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,OAAe,EACf,SAAS,GACV,EAAE,kBAAkB,CAAC,KAAK,CAAC,eAkC3B"}
@@ -9,7 +9,7 @@ var Typography_1 = require("../Typography");
9
9
  var utils_1 = require("../../utils");
10
10
  exports.TabWrapperCSS = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
11
11
  var active = _a.active, isTicketHistory = _a.isTicketHistory;
12
- return active && isTicketHistory ? Typography_1.headingStyles.h1 : Typography_1.headingStyles.h2;
12
+ return (active && isTicketHistory ? Typography_1.headingStyles.h1 : Typography_1.headingStyles.h2);
13
13
  });
14
14
  var TabWrapper = (0, styled_components_1.default)(Stack_1.Stack)(templateObject_4 || (templateObject_4 = (0, tslib_1.__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) {
15
15
  var theme = _a.theme;
@@ -30,7 +30,7 @@ var TabWrapper = (0, styled_components_1.default)(Stack_1.Stack)(templateObject_
30
30
  return props.active ? "solid 2px ".concat(props.theme.colors.brandPrimary) : "none";
31
31
  }, function (props) { return props.theme.colors.grey100; }, function (_a) {
32
32
  var active = _a.active, tabStyle = _a.tabStyle, theme = _a.theme;
33
- return tabStyle === "button" && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px ", ";\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 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 && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.colors.brandShade20));
33
+ return tabStyle === "button" && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__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 && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.colors.brandShade20));
34
34
  }, exports.TabWrapperCSS);
35
35
  var StyledTabBar = (0, styled_components_1.default)(Stack_1.Stack)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"], ["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"])), function (_a) {
36
36
  var tabStyle = _a.tabStyle, theme = _a.theme;
@@ -42,11 +42,11 @@ var StyledTabBar = (0, styled_components_1.default)(Stack_1.Stack)(templateObjec
42
42
  function TabbedSectionTabs(_a) {
43
43
  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;
44
44
  return (React.createElement(React.Fragment, null,
45
- React.createElement(StyledTabBar, (0, tslib_1.__assign)({}, (0, utils_1.dpNameProp)("TabbedSectionTabs"), { style: tabsWrapperStyles, tabStyle: tabType, justify: "space-around", className: className }),
45
+ React.createElement(StyledTabBar, (0, tslib_1.__assign)({}, (0, utils_1.dpNameProp)("TabbedSectionTabs"), { style: tabsWrapperStyles, tabStyle: tabType, justify: "space-around", className: className, role: "tablist" }),
46
46
  tabs.map(function (tab, index) {
47
47
  return (React.createElement(TabWrapper, { key: index, disabled: tab.disabled, active: tab.id === activeTab, onClick: function () {
48
48
  onTabChange(tab);
49
- }, tabStyle: tabType }, tab.title));
49
+ }, tabStyle: tabType, role: "tab", "aria-selected": tab.id === activeTab, "aria-controls": tab.controls }, tab.title));
50
50
  }),
51
51
  rightElement),
52
52
  children));
@@ -4,6 +4,8 @@ export interface TabbedSectionTabType<TabId = string> {
4
4
  id: TabId;
5
5
  title: string;
6
6
  disabled?: boolean;
7
+ /** used to set the aria-controls prop of tab */
8
+ controls?: string;
7
9
  }
8
10
  export declare type TabbedSectionProps<TabId> = {
9
11
  children?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/TabbedSection/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,oBAAoB,CAAC,KAAK,GAAG,MAAM;IAClD,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,kBAAkB,CAAC,KAAK,IAAI;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC1D,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/TabbedSection/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,oBAAoB,CA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