@hitachivantara/uikit-react-lab 3.41.7 → 3.41.8

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.41.8](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-lab@3.41.7...@hitachivantara/uikit-react-lab@3.41.8) (2022-04-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **NotificationPanel:** toggles pointer cursor according to available onClick param. HVUIKIT-2740 ([9f7f1c2](https://github.com/lumada-design/hv-uikit-react/commit/9f7f1c264126fc29e961d4a21fab93e401a3d4ea))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.41.7](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-lab@3.41.6...@hitachivantara/uikit-react-lab@3.41.7) (2022-04-15)
7
18
 
8
19
  **Note:** Version bump only for package @hitachivantara/uikit-react-lab
@@ -75,16 +75,16 @@ var Notification = function Notification(_ref) {
75
75
  }, title)), title);
76
76
  return /*#__PURE__*/_react.default.createElement("div", {
77
77
  onClick: function onClick(event) {
78
- return _onClick(event, notificationId);
78
+ return _onClick === null || _onClick === void 0 ? void 0 : _onClick(event, notificationId);
79
79
  },
80
80
  onKeyPress: function onKeyPress(event) {
81
- return _onKeyPress(event, notificationId);
81
+ return _onKeyPress === null || _onKeyPress === void 0 ? void 0 : _onKeyPress(event, notificationId);
82
82
  },
83
83
  className: (0, _clsx.default)(className, classes.root, isHighlighted && classes.notificationWrapperDropdown, isRead && classes.read),
84
84
  role: "button",
85
85
  tabIndex: 0
86
86
  }, /*#__PURE__*/_react.default.createElement("div", {
87
- className: (0, _clsx.default)(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen)
87
+ className: (0, _clsx.default)(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen, !!_onClick && classes.clickable)
88
88
  }, /*#__PURE__*/_react.default.createElement("div", {
89
89
  className: classes.iconContainer
90
90
  }, icon), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(NotificationWithTooltip, null), /*#__PURE__*/_react.default.createElement("div", {
@@ -161,7 +161,12 @@ process.env.NODE_ENV !== "production" ? Notification.propTypes = {
161
161
  /**
162
162
  * Styles applied to the notification message actions dropdown.
163
163
  */
164
- notificationActionWrapper: _propTypes.default.string
164
+ notificationActionWrapper: _propTypes.default.string,
165
+
166
+ /**
167
+ * Styles applied to the notification when clickable
168
+ */
169
+ clickable: _propTypes.default.string
165
170
  }).isRequired,
166
171
 
167
172
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/NotificationPanel/Notification/Notification.js"],"names":["dayjs","extend","relativeTime","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","PropTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","styles","name"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEAA,eAAMC,MAAN,CAAaC,qBAAb;;AAEA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD;AAAA,SAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAA/C;AAAA,CAApB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,SAAD,EAAYC,KAAZ,EAAsB;AAC3C,MAAMC,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,WAAMF,SAAN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;AACA;AACEjC,EAAAA,cAAc,EAAEwB,mBAAUU,IAlGH;;AAmGvB;AACF;AACA;AACEjC,EAAAA,aAAa,EAAEuB,mBAAUI;AAtGF,CAAzB;;eAyGe,sBAAWO,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAAgE9C,YAAhE,C","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick(event, notificationId)}\n onKeyPress={(event) => onKeyPress(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
1
+ {"version":3,"sources":["../../../src/NotificationPanel/Notification/Notification.js"],"names":["dayjs","extend","relativeTime","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","clickable","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","PropTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","styles","name"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEAA,eAAMC,MAAN,CAAaC,qBAAb;;AAEA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD;AAAA,SAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAA/C;AAAA,CAApB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,SAAD,EAAYC,KAAZ,EAAsB;AAC3C,MAAMC,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,WAAMF,SAAN;AAAA,GAA1B,CAD2C,CAE3C;;;AACA,SAAO,iCAAYE,iBAAZ,EAA+BD,KAA/B,EAAsC,KAAtC,EAA6CP,WAA7C,EAA0D;AAAES,IAAAA,KAAK,EAAE;AAAT,GAA1D,CAAP;AACD,CAJD;;AAMA,IAAMC,YAAY,GAAG,SAAfA,YAAe,OAYf;AAAA,MAXJC,OAWI,QAXJA,OAWI;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AAAA,aAAa,EAAEwB,mBAAUI;AA1GF,CAAzB;;eA6Ge,sBAAWO,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAAgE/C,YAAhE,C","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick?.(event, notificationId)}\n onKeyPress={(event) => onKeyPress?.(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n [classes.clickable]: !!onClick,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n /**\n * Styles applied to the notification when clickable\n */\n clickable: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
@@ -72,7 +72,6 @@ var styles = function styles(theme) {
72
72
  color: theme.hv.palette.accent.acce1,
73
73
  padding: "17px",
74
74
  paddingRight: 0,
75
- cursor: "pointer",
76
75
  "&:focus": {
77
76
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
78
77
  outline: "5px solid ".concat(theme.hv.palette.atmosphere.atmo3),
@@ -86,7 +85,10 @@ var styles = function styles(theme) {
86
85
  "& $notificationActionWrapper": {
87
86
  display: "block"
88
87
  }
89
- })
88
+ }),
89
+ "&$clickable": {
90
+ cursor: "pointer"
91
+ }
90
92
  },
91
93
  iconContainer: {
92
94
  width: "32px",
@@ -121,6 +123,7 @@ var styles = function styles(theme) {
121
123
  },
122
124
  hide: {},
123
125
  read: {},
126
+ clickable: {},
124
127
  notificationWrapperDropdown: {
125
128
  outline: "3px solid ".concat(theme.hv.palette.atmosphere.atmo3),
126
129
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA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AiBC,UAAjB,CAA4BI,KAA3C;AAFC;AANiB,KAtGJ;AAkHzBoC,IAAAA,wBAAwB,EAAE;AACxB3C,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,KAlHD;AAsHzBqC,IAAAA,yBAAyB,EAAE;AACzB,iBAAW;AACTC,QAAAA,SAAS,EAAE;AADF;AADc;AAtHF,GAAZ;AAAA,CAAf;;eA6HejD,M","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n cursor: \"pointer\",\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
1
+ {"version":3,"sources":["../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","clickable","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,SADM;AAEpBC,EAAAA,YAAY,EAAE,OAFM;AAGpBC,EAAAA,YAAY,EAAE,KAHM;AAIpBC,EAAAA,aAAa,EAAE,MAJK;AAKpBC,EAAAA,SAAS,EAAE;AALS,CAAtB;;AAQA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAFzC;AAGJC,MAAAA,MAAM,EAAE,iBAHJ;AAIJ,iBAAW;AACTC,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C,CADE;AAETP,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFpC;AAGT,wCAAgC;AAC9BR,UAAAA,OAAO,EAAE;AADqB;AAHvB,OAJP;AAWJ,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KADrC;AAERF,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KAA3C,CAFC;AAGR,mBAAW;AACTR,UAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADpC;AAETD,UAAAA,OAAO,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EH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFlB;AAG3B,sCAAgC;AAC9BR,QAAAA,OAAO,EAAE;AADqB,OAHL;AAM3B,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADrC;AAERD,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C;AAFC;AANiB,KA1GJ;AAsHzBqC,IAAAA,wBAAwB,EAAE;AACxB5C,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,KAtHD;AA0HzBsC,IAAAA,yBAAyB,EAAE;AACzB,iBAAW;AACTC,QAAAA,SAAS,EAAE;AADF;AADc;AA1HF,GAAZ;AAAA,CAAf;;eAiIelD,M","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&$clickable\": {\n cursor: \"pointer\",\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n clickable: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
@@ -58,16 +58,16 @@ var Notification = function Notification(_ref) {
58
58
  }, title)), title);
59
59
  return /*#__PURE__*/React.createElement("div", {
60
60
  onClick: function onClick(event) {
61
- return _onClick(event, notificationId);
61
+ return _onClick === null || _onClick === void 0 ? void 0 : _onClick(event, notificationId);
62
62
  },
63
63
  onKeyPress: function onKeyPress(event) {
64
- return _onKeyPress(event, notificationId);
64
+ return _onKeyPress === null || _onKeyPress === void 0 ? void 0 : _onKeyPress(event, notificationId);
65
65
  },
66
66
  className: clsx(className, classes.root, isHighlighted && classes.notificationWrapperDropdown, isRead && classes.read),
67
67
  role: "button",
68
68
  tabIndex: 0
69
69
  }, /*#__PURE__*/React.createElement("div", {
70
- className: clsx(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen)
70
+ className: clsx(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen, !!_onClick && classes.clickable)
71
71
  }, /*#__PURE__*/React.createElement("div", {
72
72
  className: classes.iconContainer
73
73
  }, icon), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NotificationWithTooltip, null), /*#__PURE__*/React.createElement("div", {
@@ -144,7 +144,12 @@ process.env.NODE_ENV !== "production" ? Notification.propTypes = {
144
144
  /**
145
145
  * Styles applied to the notification message actions dropdown.
146
146
  */
147
- notificationActionWrapper: PropTypes.string
147
+ notificationActionWrapper: PropTypes.string,
148
+
149
+ /**
150
+ * Styles applied to the notification when clickable
151
+ */
152
+ clickable: PropTypes.string
148
153
  }).isRequired,
149
154
 
150
155
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/NotificationPanel/Notification/Notification.js"],"names":["React","PropTypes","clsx","dayjs","relativeTime","HvTypography","withTooltip","withStyles","styles","extend","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","name"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kCAA1C;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEAL,KAAK,CAACM,MAAN,CAAaL,YAAb;;AAEA,IAAMM,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD;AAAA,SAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAA/C;AAAA,CAApB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,SAAD,EAAYC,KAAZ,EAAsB;AAC3C,MAAMC,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,WAAMF,SAAN;AAAA,GAA1B,CAD2C,CAE3C;;;AACA,SAAOV,WAAW,CAACY,iBAAD,EAAoBD,KAApB,EAA2B,KAA3B,EAAkCP,WAAlC,EAA+C;AAAES,IAAAA,KAAK,EAAE;AAAT,GAA/C,CAAlB;AACD,CAJD;;AAMA,IAAMC,YAAY,GAAG,SAAfA,YAAe,OAYf;AAAA,MAXJC,OAWI,QAXJA,OAWI;AAAA,MAVJC,SAUI,QAVJA,SAUI;AAAA,MATJC,cASI,QATJA,cASI;AAAA,MARJC,KAQI,QARJA,KAQI;AAAA,MAPJC,MAOI,QAPJA,MAOI;AAAA,MANJC,IAMI,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AV,CAAgE5C,YAAhE,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick(event, notificationId)}\n onKeyPress={(event) => onKeyPress(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
1
+ {"version":3,"sources":["../../../../src/NotificationPanel/Notification/Notification.js"],"names":["React","PropTypes","clsx","dayjs","relativeTime","HvTypography","withTooltip","withStyles","styles","extend","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","clickable","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","name"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kCAA1C;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEAL,KAAK,CAACM,MAAN,CAAaL,YAAb;;AAEA,IAAMM,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD;AAAA,SAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAA/C;AAAA,CAApB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,SAAD,EAAYC,KAAZ,EAAsB;AAC3C,MAAMC,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,WAAMF,SAAN;AAAA,GAA1B,CAD2C,CAE3C;;;AACA,SAAOV,WAAW,CAACY,iBAAD,EAAoBD,KAApB,EAA2B,KAA3B,EAAkCP,WAAlC,EAA+C;AAAES,IAAAA,KAAK,EAAE;AAAT,GAA/C,CAAlB;AACD,CAJD;;AAMA,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AAEzB,SAAS,CAAC6D,OA1FO;;AA2FvB;AACF;AACA;AACElC,EAAAA,OAAO,EAAE3B,SAAS,CAAC8D,IA9FI;;AA+FvB;AACF;AACA;AACElC,EAAAA,UAAU,EAAE5B,SAAS,CAAC8D,IAlGC;;AAmGvB;AACF;AACA;AACEjC,EAAAA,cAAc,EAAE7B,SAAS,CAAC+D,IAtGH;;AAuGvB;AACF;AACA;AACEjC,EAAAA,aAAa,EAAE9B,SAAS,CAACyD;AA1GF,CAAzB;AA6GA,eAAenD,UAAU,CAACC,MAAD,EAAS;AAAEyD,EAAAA,IAAI,EAAE;AAAR,CAAT,CAAV,CAAgE7C,YAAhE,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick?.(event, notificationId)}\n onKeyPress={(event) => onKeyPress?.(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n [classes.clickable]: !!onClick,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n /**\n * Styles applied to the notification when clickable\n */\n clickable: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
@@ -56,7 +56,6 @@ var styles = function styles(theme) {
56
56
  color: theme.hv.palette.accent.acce1,
57
57
  padding: "17px",
58
58
  paddingRight: 0,
59
- cursor: "pointer",
60
59
  "&:focus": {
61
60
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
62
61
  outline: "5px solid ".concat(theme.hv.palette.atmosphere.atmo3),
@@ -70,7 +69,10 @@ var styles = function styles(theme) {
70
69
  "& $notificationActionWrapper": {
71
70
  display: "block"
72
71
  }
73
- })
72
+ }),
73
+ "&$clickable": {
74
+ cursor: "pointer"
75
+ }
74
76
  },
75
77
  iconContainer: {
76
78
  width: "32px",
@@ -105,6 +107,7 @@ var styles = function styles(theme) {
105
107
  },
106
108
  hide: {},
107
109
  read: {},
110
+ clickable: {},
108
111
  notificationWrapperDropdown: {
109
112
  outline: "3px solid ".concat(theme.hv.palette.atmosphere.atmo3),
110
113
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;;;;;;;;;AAAA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,SADM;AAEpBC,EAAAA,YAAY,EAAE,OAFM;AAGpBC,EAAAA,YAAY,EAAE,KAHM;AAIpBC,EAAAA,aAAa,EAAE,MAJK;AAKpBC,EAAAA,SAAS,EAAE;AALS,CAAtB;;AAQA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAFzC;AAGJC,MAAAA,MAAM,EAAE,iBAHJ;AAIJ,iBAAW;AACTC,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C,CADE;AAETP,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFpC;AAGT,wCAAgC;AAC9BR,UAAAA,OAAO,EAAE;AADqB;AAHvB,OAJP;AAWJ,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KADrC;AAERF,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KAA3C,CAFC;AAGR,mBAAW;AACTR,UAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAi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,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFlB;AAG3B,sCAAgC;AAC9BR,QAAAA,OAAO,EAAE;AADqB,OAHL;AAM3B,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADrC;AAERD,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C;AAFC;AANiB,KAtGJ;AAkHzBoC,IAAAA,wBAAwB,EAAE;AACxB3C,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,KAlHD;AAsHzBqC,IAAAA,yBAAyB,EAAE;AACzB,iBAAW;AACTC,QAAAA,SAAS,EAAE;AADF;AADc;AAtHF,GAAZ;AAAA,CAAf;;AA6HA,eAAejD,MAAf","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n cursor: \"pointer\",\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
1
+ {"version":3,"sources":["../../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","clickable","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;;;;;;;;;AAAA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,SADM;AAEpBC,EAAAA,YAAY,EAAE,OAFM;AAGpBC,EAAAA,YAAY,EAAE,KAHM;AAIpBC,EAAAA,aAAa,EAAE,MAJK;AAKpBC,EAAAA,SAAS,EAAE;AALS,CAAtB;;AAQA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAFzC;AAGJC,MAAAA,MAAM,EAAE,iBAHJ;AAIJ,iBAAW;AACTC,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C,CADE;AAETP,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFpC;AAGT,wCAAgC;AAC9BR,UAAAA,OAAO,EAAE;AADqB;AAHvB,OAJP;AAWJ,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAA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C,IAAAA,IAAI,EAAE,EAvGmB;AAwGzBC,IAAAA,IAAI,EAAE,EAxGmB;AAyGzBC,IAAAA,SAAS,EAAE,EAzGc;AA0GzBC,IAAAA,2BAA2B,EAAE;AAC3BrC,MAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C,CADoB;AAE3BP,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFlB;AAG3B,sCAAgC;AAC9BR,QAAAA,OAAO,EAAE;AADqB,OAHL;AAM3B,gBAAU;AACRC,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADrC;AAERD,QAAAA,OAAO,sBAAeT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAA3C;AAFC;AANiB,KA1GJ;AAsHzBqC,IAAAA,wBAAwB,EAAE;AACxB5C,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,KAtHD;AA0HzBsC,IAAAA,yBAAyB,EAAE;AACzB,iBAAW;AACTC,QAAAA,SAAS,EAAE;AADF;AADc;AA1HF,GAAZ;AAAA,CAAf;;AAiIA,eAAelD,MAAf","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&$clickable\": {\n cursor: \"pointer\",\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n clickable: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
@@ -53,13 +53,13 @@ const Notification = ({
53
53
  variant: isRead ? "normalText" : "highlightText"
54
54
  }, title)), title);
55
55
  return /*#__PURE__*/React.createElement("div", {
56
- onClick: event => onClick(event, notificationId),
57
- onKeyPress: event => onKeyPress(event, notificationId),
56
+ onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick(event, notificationId),
57
+ onKeyPress: event => onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(event, notificationId),
58
58
  className: clsx(className, classes.root, isHighlighted && classes.notificationWrapperDropdown, isRead && classes.read),
59
59
  role: "button",
60
60
  tabIndex: 0
61
61
  }, /*#__PURE__*/React.createElement("div", {
62
- className: clsx(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen)
62
+ className: clsx(classes.notificationWrapper, isHighlighted && classes.notificationDropdownOpen, !!onClick && classes.clickable)
63
63
  }, /*#__PURE__*/React.createElement("div", {
64
64
  className: classes.iconContainer
65
65
  }, icon), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NotificationWithTooltip, null), /*#__PURE__*/React.createElement("div", {
@@ -136,7 +136,12 @@ process.env.NODE_ENV !== "production" ? Notification.propTypes = {
136
136
  /**
137
137
  * Styles applied to the notification message actions dropdown.
138
138
  */
139
- notificationActionWrapper: PropTypes.string
139
+ notificationActionWrapper: PropTypes.string,
140
+
141
+ /**
142
+ * Styles applied to the notification when clickable
143
+ */
144
+ clickable: PropTypes.string
140
145
  }).isRequired,
141
146
 
142
147
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/NotificationPanel/Notification/Notification.js"],"names":["React","PropTypes","clsx","dayjs","relativeTime","HvTypography","withTooltip","withStyles","styles","extend","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","name"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kCAA1C;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEAL,KAAK,CAACM,MAAN,CAAaL,YAAb;;AAEA,MAAMM,WAAW,GAAIC,GAAD,IAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAAnE;;AAEA,MAAMC,cAAc,GAAG,CAACC,SAAD,EAAYC,KAAZ,KAAsB;AAC3C,QAAMC,iBAAiB,GAAG,MAAMF,SAAhC,CAD2C,CAE3C;;;AACA,SAAOV,WAAW,CAACY,iBAAD,EAAoBD,KAApB,EAA2B,KAA3B,EAAkCP,WAAlC,EAA+C;AAAES,IAAAA,KAAK,EAAE;AAAT,GAA/C,CAAlB;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAG,CAAC;AACpBC,EAAAA,OADoB;AAEpBC,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AAV,CAAgE5C,YAAhE,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick(event, notificationId)}\n onKeyPress={(event) => onKeyPress(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
1
+ {"version":3,"sources":["../../../../src/NotificationPanel/Notification/Notification.js"],"names":["React","PropTypes","clsx","dayjs","relativeTime","HvTypography","withTooltip","withStyles","styles","extend","hideTooltip","evt","target","scrollHeight","clientHeight","wrapperTooltip","Component","label","ComponentFunction","style","Notification","classes","className","notificationId","title","isRead","icon","date","onClick","onKeyPress","rightContainer","isHighlighted","getTime","fromNow","d","format","isSame","Date","now","NotificationWithTooltip","messageContainer","event","root","notificationWrapperDropdown","read","notificationWrapper","notificationDropdownOpen","clickable","iconContainer","timeContainer","bullet","hide","time","notificationActionWrapper","propTypes","shape","string","isRequired","bool","oneOfType","number","object","element","func","node","name"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kCAA1C;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEAL,KAAK,CAACM,MAAN,CAAaL,YAAb;;AAEA,MAAMM,WAAW,GAAIC,GAAD,IAASA,GAAG,CAACC,MAAJ,CAAWC,YAAX,IAA2BF,GAAG,CAACC,MAAJ,CAAWE,YAAnE;;AAEA,MAAMC,cAAc,GAAG,CAACC,SAAD,EAAYC,KAAZ,KAAsB;AAC3C,QAAMC,iBAAiB,GAAG,MAAMF,SAAhC,CAD2C,CAE3C;;;AACA,SAAOV,WAAW,CAACY,iBAAD,EAAoBD,KAApB,EAA2B,KAA3B,EAAkCP,WAAlC,EAA+C;AAAES,IAAAA,KAAK,EAAE;AAAT,GAA/C,CAAlB;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAG,CAAC;AACpBC,EAAAA,OADoB;AAEpBC,EAAAA,SAFoB;AAGpBC,EAAAA,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GvB;AACF;AACA;AACEjC,EAAAA,aAAa,EAAE9B,SAAS,CAACyD;AA1GF,CAAzB;AA6GA,eAAenD,UAAU,CAACC,MAAD,EAAS;AAAEyD,EAAAA,IAAI,EAAE;AAAR,CAAT,CAAV,CAAgE7C,YAAhE,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport relativeTime from \"dayjs/plugin/relativeTime\";\nimport { HvTypography, withTooltip } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\n\ndayjs.extend(relativeTime);\n\nconst hideTooltip = (evt) => evt.target.scrollHeight <= evt.target.clientHeight;\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n // override thr withTooltip styles as we want to use the styles of the component\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip, { style: {} });\n};\n\nconst Notification = ({\n classes,\n className,\n notificationId,\n title,\n isRead,\n icon,\n date,\n onClick,\n onKeyPress,\n rightContainer,\n isHighlighted,\n}) => {\n const getTime = () => {\n if (!isRead) {\n return dayjs(date).fromNow();\n }\n\n const d = dayjs(date);\n let format = \"D MMMM YYYY, h:mm A\";\n\n if (d.isSame(Date.now(), \"week\")) {\n format = \"ddd, h:mm A\";\n }\n\n return d.format(format);\n };\n\n const NotificationWithTooltip = wrapperTooltip(\n <div className={classes.messageContainer}>\n <HvTypography variant={isRead ? \"normalText\" : \"highlightText\"}>{title}</HvTypography>\n </div>,\n title\n );\n\n return (\n <div\n onClick={(event) => onClick?.(event, notificationId)}\n onKeyPress={(event) => onKeyPress?.(event, notificationId)}\n className={clsx(className, classes.root, {\n [classes.notificationWrapperDropdown]: isHighlighted,\n [classes.read]: isRead,\n })}\n role=\"button\"\n tabIndex={0}\n >\n <div\n className={clsx(classes.notificationWrapper, {\n [classes.notificationDropdownOpen]: isHighlighted,\n [classes.clickable]: !!onClick,\n })}\n >\n <div className={classes.iconContainer}>{icon}</div>\n <div>\n <NotificationWithTooltip />\n <div className={classes.timeContainer}>\n <div\n className={clsx(classes.bullet, {\n [classes.hide]: isRead,\n })}\n />\n <div className={classes.time}>{getTime()}</div>\n </div>\n </div>\n </div>\n <div className={classes.notificationActionWrapper}>{rightContainer}</div>\n </div>\n );\n};\n\nNotification.propTypes = {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root of the accordion.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the notification wrapper.\n */\n notificationWrapper: PropTypes.string,\n\n /**\n * Styles applied to the notification wrapper when the actions dropdown is open.\n */\n notificationWrapperDropdown: PropTypes.string,\n\n /**\n * Styles applied to the notification icon container.\n */\n iconContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification message container.\n */\n messageContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification time container.\n */\n timeContainer: PropTypes.string,\n\n /**\n * Styles applied to the notification bullet.\n */\n bullet: PropTypes.string,\n\n /**\n * Styles applied to the content when it is hidden.\n */\n hide: PropTypes.string,\n\n /**\n * Styles applied to the notification time indicator.\n */\n time: PropTypes.string,\n /**\n * Styles applied to the notification is read.\n */\n read: PropTypes.string,\n /**\n * Styles applied when the notification dropdown is open.\n */\n notificationDropdownOpen: PropTypes.string,\n\n /**\n * Styles applied to the notification message actions dropdown.\n */\n notificationActionWrapper: PropTypes.string,\n /**\n * Styles applied to the notification when clickable\n */\n clickable: PropTypes.string,\n }).isRequired,\n\n /**\n * Class names to be applied to the accordion.\n */\n className: PropTypes.string,\n /**\n * Notification id\n */\n notificationId: PropTypes.string,\n /**\n * Title of the notification\n */\n title: PropTypes.string.isRequired,\n /**\n * 'true' if the notification has been read or 'false' if it has not been read\n */\n isRead: PropTypes.bool.isRequired,\n /**\n * date the notification was created\n */\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n /**\n * renderable icon that denotes the status of the notification\n */\n icon: PropTypes.element,\n /**\n * Click action applied to the notification\n */\n onClick: PropTypes.func,\n /**\n * On Key Press action applied to the notification\n */\n onKeyPress: PropTypes.func,\n /**\n * Actions to be executed by the notification, available in the dropdown menu\n */\n rightContainer: PropTypes.node,\n /**\n * Denotes index of clicked notification\n */\n isHighlighted: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanelNotification\" })(Notification);\n"],"file":"Notification.js"}
@@ -48,7 +48,6 @@ const styles = theme => ({
48
48
  color: theme.hv.palette.accent.acce1,
49
49
  padding: "17px",
50
50
  paddingRight: 0,
51
- cursor: "pointer",
52
51
  "&:focus": {
53
52
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
54
53
  outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,
@@ -62,7 +61,10 @@ const styles = theme => ({
62
61
  "& $notificationActionWrapper": {
63
62
  display: "block"
64
63
  }
65
- })
64
+ }),
65
+ "&$clickable": {
66
+ cursor: "pointer"
67
+ }
66
68
  },
67
69
  iconContainer: {
68
70
  width: "32px",
@@ -97,6 +99,7 @@ const styles = theme => ({
97
99
  },
98
100
  hide: {},
99
101
  read: {},
102
+ clickable: {},
100
103
  notificationWrapperDropdown: {
101
104
  outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,
102
105
  backgroundColor: theme.hv.palette.atmosphere.atmo3,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;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ASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAAM;AAFhD;AANiB,GAtGJ;AAkHzBoC,EAAAA,wBAAwB,EAAE;AACxB3C,IAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,GAlHD;AAsHzBqC,EAAAA,yBAAyB,EAAE;AACzB,eAAW;AACTC,MAAAA,SAAS,EAAE;AADF;AADc;AAtHF,CAAZ,CAAf;;AA6HA,eAAejD,MAAf","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n cursor: \"pointer\",\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
1
+ {"version":3,"sources":["../../../../src/NotificationPanel/Notification/styles.js"],"names":["outlineStyles","outlineColor","outlineStyle","outlineWidth","outlineOffset","boxShadow","styles","theme","root","display","backgroundColor","hv","palette","atmosphere","atmo1","margin","outline","atmo3","atmo2","notificationWrapper","minHeight","marginRight","spacing","xs","color","accent","acce1","padding","paddingRight","cursor","iconContainer","width","minWidth","sm","messageContainer","maxWidth","lineClamp","boxOrient","overflow","wordBreak","title","typography","highlightText","marginBottom","timeContainer","vizText","alignItems","bullet","height","borderRadius","hide","read","clickable","notificationWrapperDropdown","notificationDropdownOpen","notificationActionWrapper","marginTop"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,SADM;AAEpBC,EAAAA,YAAY,EAAE,OAFM;AAGpBC,EAAAA,YAAY,EAAE,KAHM;AAIpBC,EAAAA,aAAa,EAAE,MAJK;AAKpBC,EAAAA,SAAS,EAAE;AALS,CAAtB;;AAQA,MAAMC,MAAM,GAAIC,KAAD,KAAY;AACzBC,EAAAA,IAAI,EAAE;AACJC,IAAAA,OAAO,EAAE,MADL;AAEJC,IAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAFzC;AAGJC,IAAAA,MAAM,EAAE,iBAHJ;AAIJ,eAAW;AACTC,MAAAA,OAAO,EAAG,aAAYT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAAM,EAD/C;AAETP,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFpC;AAGT,sCAAgC;AAC9BR,QAAAA,OAAO,EAAE;AADqB;AAHvB,KAJP;AAWJ,cAAU;AACRC,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KADrC;AAERF,MAAAA,OAAO,EAAG,aAAYT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BK,KAAM,EAFhD;AAGR,iBAAW;AACTR,QAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADpC;AAETD,QAAAA,OAAO,EAAG,aAAYT,KAAK,CAACI,E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,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAFlB;AAG3B,oCAAgC;AAC9BR,MAAAA,OAAO,EAAE;AADqB,KAHL;AAM3B,cAAU;AACRC,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KADrC;AAERD,MAAAA,OAAO,EAAG,aAAYT,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI,KAAM;AAFhD;AANiB,GA1GJ;AAsHzBqC,EAAAA,wBAAwB,EAAE;AACxB5C,IAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,GAtHD;AA0HzBsC,EAAAA,yBAAyB,EAAE;AACzB,eAAW;AACTC,MAAAA,SAAS,EAAE;AADF;AADc;AA1HF,CAAZ,CAAf;;AAiIA,eAAelD,MAAf","sourcesContent":["const outlineStyles = {\n outlineColor: \"#52A8EC\",\n outlineStyle: \"solid\",\n outlineWidth: \"0px\",\n outlineOffset: \"-1px\",\n boxShadow: \"0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)\",\n};\n\nconst styles = (theme) => ({\n root: {\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n margin: \"3px 3px 6px 3px\",\n \"&:hover\": {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n\n \"&.focus-visible\": {\n ...outlineStyles,\n },\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"&$read\": {\n ...outlineStyles,\n },\n\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n },\n notificationWrapper: {\n display: \"flex\",\n minHeight: \"72px\",\n marginRight: theme.hv.spacing.xs,\n color: theme.hv.palette.accent.acce1,\n padding: \"17px\",\n paddingRight: 0,\n\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `5px solid ${theme.hv.palette.atmosphere.atmo3}`,\n boxShadow: \"none\",\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&.focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n },\n\n \"&$clickable\": {\n cursor: \"pointer\",\n },\n },\n\n iconContainer: {\n width: \"32px\",\n minWidth: \"32px\",\n marginRight: `${theme.hv.spacing.sm}px`,\n },\n\n messageContainer: {\n width: \"196px\",\n maxWidth: \"196px\",\n display: \"-webkit-box\",\n lineClamp: 2,\n boxOrient: \"vertical\",\n overflow: \"hidden\",\n wordBreak: \"break-all\",\n },\n\n title: {\n ...theme.hv.typography.highlightText,\n marginBottom: \"5px\",\n },\n timeContainer: {\n ...theme.hv.typography.vizText,\n display: \"flex\",\n alignItems: \"center\",\n },\n bullet: {\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n marginRight: \"4px\",\n backgroundColor: theme.hv.palette.accent.acce1,\n\n \"&$hide\": {\n display: \"none\",\n },\n },\n hide: {},\n read: {},\n clickable: {},\n notificationWrapperDropdown: {\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n \"& $notificationActionWrapper\": {\n display: \"block\",\n },\n \"&$read\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: `3px solid ${theme.hv.palette.atmosphere.atmo3}`,\n },\n },\n\n notificationDropdownOpen: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n\n notificationActionWrapper: {\n \"& > div\": {\n marginTop: 17,\n },\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-lab",
3
- "version": "3.41.7",
3
+ "version": "3.41.8",
4
4
  "description": "A collection of contributed React components for the Hitachi Vantara's Design System.",
5
5
  "homepage": "https://github.com/lumada-design/hv-uikit-react",
6
6
  "license": "Apache-2.0",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "83c85021d6842f5fc4299069cc94b6c0263274e8"
86
+ "gitHead": "b56cd62ca44fba35522ef9146d4f876dbd4c8edd"
87
87
  }