@hitachivantara/uikit-react-lab 3.41.5 → 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.
Files changed (47) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/DotPagination/DotPagination.d.ts +11 -0
  3. package/dist/DotPagination/DotPagination.js +167 -0
  4. package/dist/DotPagination/DotPagination.js.map +1 -0
  5. package/dist/DotPagination/index.d.ts +2 -0
  6. package/dist/DotPagination/index.js +16 -0
  7. package/dist/DotPagination/index.js.map +1 -0
  8. package/dist/DotPagination/styles.js +26 -0
  9. package/dist/DotPagination/styles.js.map +1 -0
  10. package/dist/NotificationPanel/Notification/Notification.js +9 -4
  11. package/dist/NotificationPanel/Notification/Notification.js.map +1 -1
  12. package/dist/NotificationPanel/Notification/styles.js +7 -3
  13. package/dist/NotificationPanel/Notification/styles.js.map +1 -1
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +10 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/legacy/DotPagination/DotPagination.d.ts +11 -0
  18. package/dist/legacy/DotPagination/DotPagination.js +136 -0
  19. package/dist/legacy/DotPagination/DotPagination.js.map +1 -0
  20. package/dist/legacy/DotPagination/index.d.ts +2 -0
  21. package/dist/legacy/DotPagination/index.js +2 -0
  22. package/dist/legacy/DotPagination/index.js.map +1 -0
  23. package/dist/legacy/DotPagination/styles.js +18 -0
  24. package/dist/legacy/DotPagination/styles.js.map +1 -0
  25. package/dist/legacy/NotificationPanel/Notification/Notification.js +9 -4
  26. package/dist/legacy/NotificationPanel/Notification/Notification.js.map +1 -1
  27. package/dist/legacy/NotificationPanel/Notification/styles.js +7 -3
  28. package/dist/legacy/NotificationPanel/Notification/styles.js.map +1 -1
  29. package/dist/legacy/index.d.ts +3 -0
  30. package/dist/legacy/index.js +1 -0
  31. package/dist/legacy/index.js.map +1 -1
  32. package/dist/modern/DotPagination/DotPagination.d.ts +11 -0
  33. package/dist/modern/DotPagination/DotPagination.js +124 -0
  34. package/dist/modern/DotPagination/DotPagination.js.map +1 -0
  35. package/dist/modern/DotPagination/index.d.ts +2 -0
  36. package/dist/modern/DotPagination/index.js +2 -0
  37. package/dist/modern/DotPagination/index.js.map +1 -0
  38. package/dist/modern/DotPagination/styles.js +16 -0
  39. package/dist/modern/DotPagination/styles.js.map +1 -0
  40. package/dist/modern/NotificationPanel/Notification/Notification.js +9 -4
  41. package/dist/modern/NotificationPanel/Notification/Notification.js.map +1 -1
  42. package/dist/modern/NotificationPanel/Notification/styles.js +7 -3
  43. package/dist/modern/NotificationPanel/Notification/styles.js.map +1 -1
  44. package/dist/modern/index.d.ts +3 -0
  45. package/dist/modern/index.js +1 -0
  46. package/dist/modern/index.js.map +1 -1
  47. package/package.json +2 -2
@@ -0,0 +1,136 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["className", "classes", "pages", "page", "onPageChange", "getItemAriaLabel", "id"];
4
+ import "core-js/modules/es.array.from.js";
5
+ import "core-js/modules/es.string.iterator.js";
6
+ import "core-js/modules/es.array.map.js";
7
+ import "core-js/modules/es.array.concat.js";
8
+ import "core-js/modules/es.object.to-string.js";
9
+ import "core-js/modules/es.regexp.to-string.js";
10
+ import React from "react";
11
+ import PropTypes from "prop-types";
12
+ import clsx from "clsx";
13
+ import { withStyles } from "@material-ui/core";
14
+ import { HvRadio, HvRadioGroup } from "@hitachivantara/uikit-react-core";
15
+ import { CurrentStep, RadioButtonUnselected } from "@hitachivantara/uikit-react-icons";
16
+ import styles from "./styles";
17
+ export var getSelectorIcons = function getSelectorIcons(classes, options) {
18
+ var disabled = options.disabled;
19
+ var color = disabled && ["atmo3", "atmo5"] || undefined;
20
+ var checkedColor = disabled && ["atmo3", "atmo5"] || undefined;
21
+ return {
22
+ radio: /*#__PURE__*/React.createElement(RadioButtonUnselected, {
23
+ color: color,
24
+ className: classes.icon,
25
+ iconSize: "XS"
26
+ }),
27
+ radioChecked: /*#__PURE__*/React.createElement(CurrentStep, {
28
+ color: checkedColor,
29
+ className: classes.icon,
30
+ iconSize: "XS"
31
+ })
32
+ };
33
+ };
34
+ /**
35
+ * DotPagination description/documentation paragraph
36
+ */
37
+
38
+ var HvDotPagination = function HvDotPagination(props) {
39
+ var className = props.className,
40
+ classes = props.classes,
41
+ _props$pages = props.pages,
42
+ pages = _props$pages === void 0 ? 1 : _props$pages,
43
+ _props$page = props.page,
44
+ page = _props$page === void 0 ? 0 : _props$page,
45
+ onPageChange = props.onPageChange,
46
+ getItemAriaLabel = props.getItemAriaLabel,
47
+ id = props.id,
48
+ others = _objectWithoutProperties(props, _excluded);
49
+
50
+ var range = function range(n) {
51
+ return Array.from(Array(n), function (v, i) {
52
+ return i;
53
+ });
54
+ };
55
+
56
+ var icons = getSelectorIcons(classes, {});
57
+ return /*#__PURE__*/React.createElement("div", _extends({
58
+ className: clsx(className, classes.root)
59
+ }, others), /*#__PURE__*/React.createElement(HvRadioGroup, {
60
+ classes: {
61
+ horizontal: classes.horizontal
62
+ },
63
+ orientation: "horizontal"
64
+ }, range(pages).map(function (pg, i) {
65
+ return /*#__PURE__*/React.createElement(HvRadio, {
66
+ classes: {
67
+ root: classes.radioRoot
68
+ },
69
+ key: "dot_navigation".concat(id && id.toString(), "_item").concat(i.toString()),
70
+ value: i,
71
+ checked: page === i,
72
+ onChange: function onChange() {
73
+ return onPageChange(i);
74
+ },
75
+ icon: icons.radio,
76
+ checkedIcon: icons.radioChecked,
77
+ "aria-label": getItemAriaLabel(i)
78
+ });
79
+ })));
80
+ };
81
+
82
+ process.env.NODE_ENV !== "production" ? HvDotPagination.propTypes = {
83
+ /**
84
+ * Class names to be applied.
85
+ */
86
+ className: PropTypes.string,
87
+
88
+ /**
89
+ * A Jss Object used to override or extend the styles applied.
90
+ */
91
+ classes: PropTypes.shape({
92
+ /**
93
+ * Styles applied to the component root class.
94
+ */
95
+ root: PropTypes.string,
96
+
97
+ /**
98
+ * Styles applied to the radio button group to overrrite horizontal class margins.
99
+ */
100
+ horizontal: PropTypes.string,
101
+
102
+ /**
103
+ * Styles applied to the radio root ( to override radio group horizontal )
104
+ */
105
+ radioRoot: PropTypes.string
106
+ }).isRequired,
107
+
108
+ /**
109
+ * The number of pages the component has.
110
+ */
111
+ pages: PropTypes.number,
112
+
113
+ /**
114
+ * The currently selected page (0-indexed).
115
+ */
116
+ page: PropTypes.number,
117
+
118
+ /**
119
+ * Function called when the page changes.
120
+ */
121
+ onPageChange: PropTypes.func,
122
+
123
+ /**
124
+ * Function called to get the respective aria label.
125
+ */
126
+ getItemAriaLabel: PropTypes.func,
127
+
128
+ /**
129
+ * Component id used to generate unique radio keys ( to avoid repeated keys in case multiple dotPagination components are needed)
130
+ */
131
+ id: PropTypes.number
132
+ } : void 0;
133
+ export default withStyles(styles, {
134
+ name: "HvDotPagination"
135
+ })(HvDotPagination);
136
+ //# sourceMappingURL=DotPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/DotPagination.js"],"names":["React","PropTypes","clsx","withStyles","HvRadio","HvRadioGroup","CurrentStep","RadioButtonUnselected","styles","getSelectorIcons","classes","options","disabled","color","undefined","checkedColor","radio","icon","radioChecked","HvDotPagination","props","className","pages","page","onPageChange","getItemAriaLabel","id","others","range","n","Array","from","v","i","icons","root","horizontal","map","pg","radioRoot","toString","propTypes","string","shape","isRequired","number","func","name"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AACA,SAASC,OAAT,EAAkBC,YAAlB,QAAsC,kCAAtC;AACA,SAASC,WAAT,EAAsBC,qBAAtB,QAAmD,mCAAnD;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,OAAO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB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MARC;;AASvB;AACJ;AACA;AACIH,IAAAA,SAAS,EAAEtC,SAAS,CAACyC;AAZE,GAAhB,EAaNE,UArBuB;;AAsB1B;AACF;AACA;AACEtB,EAAAA,KAAK,EAAErB,SAAS,CAAC4C,MAzBS;;AA0B1B;AACF;AACA;AACEtB,EAAAA,IAAI,EAAEtB,SAAS,CAAC4C,MA7BU;;AA8B1B;AACF;AACA;AACErB,EAAAA,YAAY,EAAEvB,SAAS,CAAC6C,IAjCE;;AAkC1B;AACF;AACA;AACErB,EAAAA,gBAAgB,EAAExB,SAAS,CAAC6C,IArCF;;AAsC1B;AACF;AACA;AACEpB,EAAAA,EAAE,EAAEzB,SAAS,CAAC4C;AAzCY,CAA5B;AA4CA,eAAe1C,UAAU,CAACK,MAAD,EAAS;AAAEuC,EAAAA,IAAI,EAAE;AAAR,CAAT,CAAV,CAAgD5B,eAAhD,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport { HvRadio, HvRadioGroup } from \"@hitachivantara/uikit-react-core\";\nimport { CurrentStep, RadioButtonUnselected } from \"@hitachivantara/uikit-react-icons\";\nimport styles from \"./styles\";\n\nexport const getSelectorIcons = (classes, options) => {\n const { disabled } = options;\n const color = (disabled && [\"atmo3\", \"atmo5\"]) || undefined;\n const checkedColor = (disabled && [\"atmo3\", \"atmo5\"]) || undefined;\n\n return {\n radio: <RadioButtonUnselected color={color} className={classes.icon} iconSize=\"XS\" />,\n radioChecked: <CurrentStep color={checkedColor} className={classes.icon} iconSize=\"XS\" />,\n };\n};\n\n/**\n * DotPagination description/documentation paragraph\n */\nconst HvDotPagination = (props) => {\n const {\n className,\n classes,\n pages = 1,\n page = 0,\n onPageChange,\n getItemAriaLabel,\n id,\n ...others\n } = props;\n\n const range = (n) => Array.from(Array(n), (v, i) => i);\n\n const icons = getSelectorIcons(classes, {});\n\n return (\n <div className={clsx(className, classes.root)} {...others}>\n <HvRadioGroup classes={{ horizontal: classes.horizontal }} orientation=\"horizontal\">\n {range(pages).map((pg, i) => (\n <HvRadio\n classes={{ root: classes.radioRoot }}\n key={`dot_navigation${id && id.toString()}_item${i.toString()}`}\n value={i}\n checked={page === i}\n onChange={() => onPageChange(i)}\n icon={icons.radio}\n checkedIcon={icons.radioChecked}\n aria-label={getItemAriaLabel(i)}\n />\n ))}\n </HvRadioGroup>\n </div>\n );\n};\n\nHvDotPagination.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the radio button group to overrrite horizontal class margins.\n */\n horizontal: PropTypes.string,\n /**\n * Styles applied to the radio root ( to override radio group horizontal )\n */\n radioRoot: PropTypes.string,\n }).isRequired,\n /**\n * The number of pages the component has.\n */\n pages: PropTypes.number,\n /**\n * The currently selected page (0-indexed).\n */\n page: PropTypes.number,\n /**\n * Function called when the page changes.\n */\n onPageChange: PropTypes.func,\n /**\n * Function called to get the respective aria label.\n */\n getItemAriaLabel: PropTypes.func,\n /**\n * Component id used to generate unique radio keys ( to avoid repeated keys in case multiple dotPagination components are needed)\n */\n id: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvDotPagination\" })(HvDotPagination);\n"],"file":"DotPagination.js"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./DotPagination";
2
+ export * from "./DotPagination";
@@ -0,0 +1,2 @@
1
+ export { default } from "./DotPagination";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB","sourcesContent":["export { default } from \"./DotPagination\";\n"],"file":"index.js"}
@@ -0,0 +1,18 @@
1
+ var styles = function styles() {
2
+ return {
3
+ root: {
4
+ display: "flex",
5
+ justifyContent: "center"
6
+ },
7
+ horizontal: {
8
+ marginLeft: 0,
9
+ width: "auto"
10
+ },
11
+ radioRoot: {
12
+ marginLeft: "0"
13
+ }
14
+ };
15
+ };
16
+
17
+ export default styles;
18
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/styles.js"],"names":["styles","root","display","justifyContent","horizontal","marginLeft","width","radioRoot"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,cAAc,EAAE;AAFZ,KADc;AAMpBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,UAAU,EAAE,CADF;AAEVC,MAAAA,KAAK,EAAE;AAFG,KANQ;AAWpBC,IAAAA,SAAS,EAAE;AACTF,MAAAA,UAAU,EAAE;AADH;AAXS,GAAP;AAAA,CAAf;;AAgBA,eAAeL,MAAf","sourcesContent":["const styles = () => ({\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n\n horizontal: {\n marginLeft: 0,\n width: \"auto\",\n },\n\n radioRoot: {\n marginLeft: \"0\",\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,GA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AAS,CAACwD,IAAV,CAAeD,UA9EA;;AA+EvB;AACF;AACA;AACE7B,EAAAA,IAAI,EAAE1B,SAAS,CAACyD,SAAV,CAAoB,CAACzD,SAAS,CAACsD,MAAX,EAAmBtD,SAAS,CAAC0D,MAA7B,EAAqC1D,SAAS,CAAC2D,MAA/C,CAApB,EAA4EJ,UAlF3D;;AAmFvB;AACF;AACA;AACE9B,EAAAA,IAAI,EAAEzB,SAAS,CAAC4D,OAtFO;;AAuFvB;AACF;AACA;AACEjC,EAAAA,OAAO,EAAE3B,SAAS,CAAC6D,IA1FI;;AA2FvB;AACF;AACA;AACEjC,EAAAA,UAAU,EAAE5B,SAAS,CAAC6D,IA9FC;;AA+FvB;AACF;AACA;AACEhC,EAAAA,cAAc,EAAE7B,SAAS,CAAC8D,IAlGH;;AAmGvB;AACF;AACA;AACEhC,EAAAA,aAAa,EAAE9B,SAAS,CAACwD;AAtGF,CAAzB;AAyGA,eAAelD,UAAU,CAACC,MAAD,EAAS;AAAEwD,EAAAA,IAAI,EAAE;AAAR,CAAT,CAAV,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,OAA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yB,EAAEpD,SAAS,CAACuD,MAxDd;;AAyDvB;AACJ;AACA;AACIT,IAAAA,SAAS,EAAE9C,SAAS,CAACuD;AA5DE,GAAhB,EA6DNC,UAjEoB;;AAmEvB;AACF;AACA;AACEnC,EAAAA,SAAS,EAAErB,SAAS,CAACuD,MAtEE;;AAuEvB;AACF;AACA;AACEjC,EAAAA,cAAc,EAAEtB,SAAS,CAACuD,MA1EH;;AA2EvB;AACF;AACA;AACEhC,EAAAA,KAAK,EAAEvB,SAAS,CAACuD,MAAV,CAAiBC,UA9ED;;AA+EvB;AACF;AACA;AACEhC,EAAAA,MAAM,EAAExB,SAAS,CAACyD,IAAV,CAAeD,UAlFA;;AAmFvB;AACF;AACA;AACE9B,EAAAA,IAAI,EAAE1B,SAAS,CAAC0D,SAAV,CAAoB,CAAC1D,SAAS,CAACuD,MAAX,EAAmBvD,SAAS,CAAC2D,MAA7B,EAAqC3D,SAAS,CAAC4D,MAA/C,CAApB,EAA4EJ,UAtF3D;;AAuFvB;AACF;AACA;AACE/B,EAAAA,IAAI,EAAEzB,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",
@@ -83,7 +85,8 @@ var styles = function styles(theme) {
83
85
  display: "-webkit-box",
84
86
  lineClamp: 2,
85
87
  boxOrient: "vertical",
86
- overflow: "hidden"
88
+ overflow: "hidden",
89
+ wordBreak: "break-all"
87
90
  },
88
91
  title: _objectSpread(_objectSpread({}, theme.hv.typography.highlightText), {}, {
89
92
  marginBottom: "5px"
@@ -104,6 +107,7 @@ var styles = function styles(theme) {
104
107
  },
105
108
  hide: {},
106
109
  read: {},
110
+ clickable: {},
107
111
  notificationWrapperDropdown: {
108
112
  outline: "3px solid ".concat(theme.hv.palette.atmosphere.atmo3),
109
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","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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N,CAASC,OAAT,CAAiBC,UAAjB,CAA4BI;AADrB,KAjHD;AAqHzBoC,IAAAA,yBAAyB,EAAE;AACzB,iBAAW;AACTC,QAAAA,SAAS,EAAE;AADF;AADc;AArHF,GAAZ;AAAA,CAAf;;AA4HA,eAAehD,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 },\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","notification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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"}
@@ -39,3 +39,6 @@ export * from "./InlineEditor";
39
39
 
40
40
  export { default as HvProgressBar } from "./ProgressBar";
41
41
  export * from "./ProgressBar";
42
+
43
+ export { default as HvDotPagination } from "./DotPagination";
44
+ export * from "./DotPagination";
@@ -16,4 +16,5 @@ export { default as HvColorPicker } from "./ColorPicker";
16
16
  export { default as HvQueryBuilder } from "./QueryBuilder";
17
17
  export { default as HvInlineEditor } from "./InlineEditor";
18
18
  export { default as HvProgressBar } from "./ProgressBar";
19
+ export { default as HvDotPagination } from "./DotPagination";
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.js"],"names":["default","HvAppSwitcherPanel","HvFormComposer","HvNavigationAnchors","HvNotificationPanel","HvSlider","HvTable","HvTimeAgo","HvTimePicker","HvTag","HvDrawer","HvColorPicker","HvQueryBuilder","HvInlineEditor","HvProgressBar"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,kBAApB,QAA8C,oBAA9C;AACA,cAAc,oBAAd;AACA,SAASD,OAAO,IAAIE,cAApB,QAA0C,gBAA1C;AACA,SAASF,OAAO,IAAIG,mBAApB,QAA+C,qBAA/C;AACA,SAASH,OAAO,IAAII,mBAApB,QAA+C,qBAA/C;AACA,SAASJ,OAAO,IAAIK,QAApB,QAAoC,UAApC;AACA,SAASL,OAAO,IAAIM,OAApB,QAAmC,SAAnC;AACA,cAAc,SAAd;AACA,SAASN,OAAO,IAAIO,SAApB,QAAqC,WAArC;AACA,cAAc,WAAd;AACA,SAASP,OAAO,IAAIQ,YAApB,QAAwC,cAAxC;AACA,SAASR,OAAO,IAAIS,KAApB,QAAiC,OAAjC;AACA,SAAST,OAAO,IAAIU,QAApB,QAAoC,UAApC;AACA,SAASV,OAAO,IAAIW,aAApB,QAAyC,eAAzC;AACA,SAASX,OAAO,IAAIY,cAApB,QAA0C,gBAA1C;AACA,SAASZ,OAAO,IAAIa,cAApB,QAA0C,gBAA1C;AACA,SAASb,OAAO,IAAIc,aAApB,QAAyC,eAAzC","sourcesContent":["// components\nexport { default as HvAppSwitcherPanel } from \"./AppSwitcherPanel\";\nexport * from \"./AppSwitcherPanel\";\nexport { default as HvFormComposer } from \"./FormComposer\";\nexport { default as HvNavigationAnchors } from \"./NavigationAnchors\";\nexport { default as HvNotificationPanel } from \"./NotificationPanel\";\nexport { default as HvSlider } from \"./Slider\";\nexport { default as HvTable } from \"./Table\";\nexport * from \"./Table\";\nexport { default as HvTimeAgo } from \"./TimeAgo\";\nexport * from \"./TimeAgo\";\nexport { default as HvTimePicker } from \"./TimePicker\";\nexport { default as HvTag } from \"./Tag\";\nexport { default as HvDrawer } from \"./Drawer\";\nexport { default as HvColorPicker } from \"./ColorPicker\";\nexport { default as HvQueryBuilder } from \"./QueryBuilder\";\nexport { default as HvInlineEditor } from \"./InlineEditor\";\nexport { default as HvProgressBar } from \"./ProgressBar\";\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.js"],"names":["default","HvAppSwitcherPanel","HvFormComposer","HvNavigationAnchors","HvNotificationPanel","HvSlider","HvTable","HvTimeAgo","HvTimePicker","HvTag","HvDrawer","HvColorPicker","HvQueryBuilder","HvInlineEditor","HvProgressBar","HvDotPagination"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,kBAApB,QAA8C,oBAA9C;AACA,cAAc,oBAAd;AACA,SAASD,OAAO,IAAIE,cAApB,QAA0C,gBAA1C;AACA,SAASF,OAAO,IAAIG,mBAApB,QAA+C,qBAA/C;AACA,SAASH,OAAO,IAAII,mBAApB,QAA+C,qBAA/C;AACA,SAASJ,OAAO,IAAIK,QAApB,QAAoC,UAApC;AACA,SAASL,OAAO,IAAIM,OAApB,QAAmC,SAAnC;AACA,cAAc,SAAd;AACA,SAASN,OAAO,IAAIO,SAApB,QAAqC,WAArC;AACA,cAAc,WAAd;AACA,SAASP,OAAO,IAAIQ,YAApB,QAAwC,cAAxC;AACA,SAASR,OAAO,IAAIS,KAApB,QAAiC,OAAjC;AACA,SAAST,OAAO,IAAIU,QAApB,QAAoC,UAApC;AACA,SAASV,OAAO,IAAIW,aAApB,QAAyC,eAAzC;AACA,SAASX,OAAO,IAAIY,cAApB,QAA0C,gBAA1C;AACA,SAASZ,OAAO,IAAIa,cAApB,QAA0C,gBAA1C;AACA,SAASb,OAAO,IAAIc,aAApB,QAAyC,eAAzC;AACA,SAASd,OAAO,IAAIe,eAApB,QAA2C,iBAA3C","sourcesContent":["// components\nexport { default as HvAppSwitcherPanel } from \"./AppSwitcherPanel\";\nexport * from \"./AppSwitcherPanel\";\nexport { default as HvFormComposer } from \"./FormComposer\";\nexport { default as HvNavigationAnchors } from \"./NavigationAnchors\";\nexport { default as HvNotificationPanel } from \"./NotificationPanel\";\nexport { default as HvSlider } from \"./Slider\";\nexport { default as HvTable } from \"./Table\";\nexport * from \"./Table\";\nexport { default as HvTimeAgo } from \"./TimeAgo\";\nexport * from \"./TimeAgo\";\nexport { default as HvTimePicker } from \"./TimePicker\";\nexport { default as HvTag } from \"./Tag\";\nexport { default as HvDrawer } from \"./Drawer\";\nexport { default as HvColorPicker } from \"./ColorPicker\";\nexport { default as HvQueryBuilder } from \"./QueryBuilder\";\nexport { default as HvInlineEditor } from \"./InlineEditor\";\nexport { default as HvProgressBar } from \"./ProgressBar\";\nexport { default as HvDotPagination } from \"./DotPagination\";\n"],"file":"index.js"}
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { StandardProps } from "@material-ui/core";
3
+
4
+ export type HvDotPaginationClassKey = "root";
5
+
6
+ export type HvDotPaginationProps = StandardProps<
7
+ React.HTMLAttributes<HTMLDivElement>,
8
+ HvDotPaginationClassKey
9
+ >;
10
+
11
+ export default function HvDotPagination(props: HvDotPaginationProps): JSX.Element | null;
@@ -0,0 +1,124 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["className", "classes", "pages", "page", "onPageChange", "getItemAriaLabel", "id"];
4
+ import React from "react";
5
+ import PropTypes from "prop-types";
6
+ import clsx from "clsx";
7
+ import { withStyles } from "@material-ui/core";
8
+ import { HvRadio, HvRadioGroup } from "@hitachivantara/uikit-react-core";
9
+ import { CurrentStep, RadioButtonUnselected } from "@hitachivantara/uikit-react-icons";
10
+ import styles from "./styles";
11
+ export const getSelectorIcons = (classes, options) => {
12
+ const {
13
+ disabled
14
+ } = options;
15
+ const color = disabled && ["atmo3", "atmo5"] || undefined;
16
+ const checkedColor = disabled && ["atmo3", "atmo5"] || undefined;
17
+ return {
18
+ radio: /*#__PURE__*/React.createElement(RadioButtonUnselected, {
19
+ color: color,
20
+ className: classes.icon,
21
+ iconSize: "XS"
22
+ }),
23
+ radioChecked: /*#__PURE__*/React.createElement(CurrentStep, {
24
+ color: checkedColor,
25
+ className: classes.icon,
26
+ iconSize: "XS"
27
+ })
28
+ };
29
+ };
30
+ /**
31
+ * DotPagination description/documentation paragraph
32
+ */
33
+
34
+ const HvDotPagination = props => {
35
+ const {
36
+ className,
37
+ classes,
38
+ pages = 1,
39
+ page = 0,
40
+ onPageChange,
41
+ getItemAriaLabel,
42
+ id
43
+ } = props,
44
+ others = _objectWithoutProperties(props, _excluded);
45
+
46
+ const range = n => Array.from(Array(n), (v, i) => i);
47
+
48
+ const icons = getSelectorIcons(classes, {});
49
+ return /*#__PURE__*/React.createElement("div", _extends({
50
+ className: clsx(className, classes.root)
51
+ }, others), /*#__PURE__*/React.createElement(HvRadioGroup, {
52
+ classes: {
53
+ horizontal: classes.horizontal
54
+ },
55
+ orientation: "horizontal"
56
+ }, range(pages).map((pg, i) => /*#__PURE__*/React.createElement(HvRadio, {
57
+ classes: {
58
+ root: classes.radioRoot
59
+ },
60
+ key: `dot_navigation${id && id.toString()}_item${i.toString()}`,
61
+ value: i,
62
+ checked: page === i,
63
+ onChange: () => onPageChange(i),
64
+ icon: icons.radio,
65
+ checkedIcon: icons.radioChecked,
66
+ "aria-label": getItemAriaLabel(i)
67
+ }))));
68
+ };
69
+
70
+ process.env.NODE_ENV !== "production" ? HvDotPagination.propTypes = {
71
+ /**
72
+ * Class names to be applied.
73
+ */
74
+ className: PropTypes.string,
75
+
76
+ /**
77
+ * A Jss Object used to override or extend the styles applied.
78
+ */
79
+ classes: PropTypes.shape({
80
+ /**
81
+ * Styles applied to the component root class.
82
+ */
83
+ root: PropTypes.string,
84
+
85
+ /**
86
+ * Styles applied to the radio button group to overrrite horizontal class margins.
87
+ */
88
+ horizontal: PropTypes.string,
89
+
90
+ /**
91
+ * Styles applied to the radio root ( to override radio group horizontal )
92
+ */
93
+ radioRoot: PropTypes.string
94
+ }).isRequired,
95
+
96
+ /**
97
+ * The number of pages the component has.
98
+ */
99
+ pages: PropTypes.number,
100
+
101
+ /**
102
+ * The currently selected page (0-indexed).
103
+ */
104
+ page: PropTypes.number,
105
+
106
+ /**
107
+ * Function called when the page changes.
108
+ */
109
+ onPageChange: PropTypes.func,
110
+
111
+ /**
112
+ * Function called to get the respective aria label.
113
+ */
114
+ getItemAriaLabel: PropTypes.func,
115
+
116
+ /**
117
+ * Component id used to generate unique radio keys ( to avoid repeated keys in case multiple dotPagination components are needed)
118
+ */
119
+ id: PropTypes.number
120
+ } : void 0;
121
+ export default withStyles(styles, {
122
+ name: "HvDotPagination"
123
+ })(HvDotPagination);
124
+ //# sourceMappingURL=DotPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/DotPagination.js"],"names":["React","PropTypes","clsx","withStyles","HvRadio","HvRadioGroup","CurrentStep","RadioButtonUnselected","styles","getSelectorIcons","classes","options","disabled","color","undefined","checkedColor","radio","icon","radioChecked","HvDotPagination","props","className","pages","page","onPageChange","getItemAriaLabel","id","others","range","n","Array","from","v","i","icons","root","horizontal","map","pg","radioRoot","toString","propTypes","string","shape","isRequired","number","func","name"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,QAA2B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B1B;AACF;AACA;AACEtB,EAAAA,KAAK,EAAErB,SAAS,CAAC4C,MAzBS;;AA0B1B;AACF;AACA;AACEtB,EAAAA,IAAI,EAAEtB,SAAS,CAAC4C,MA7BU;;AA8B1B;AACF;AACA;AACErB,EAAAA,YAAY,EAAEvB,SAAS,CAAC6C,IAjCE;;AAkC1B;AACF;AACA;AACErB,EAAAA,gBAAgB,EAAExB,SAAS,CAAC6C,IArCF;;AAsC1B;AACF;AACA;AACEpB,EAAAA,EAAE,EAAEzB,SAAS,CAAC4C;AAzCY,CAA5B;AA4CA,eAAe1C,UAAU,CAACK,MAAD,EAAS;AAAEuC,EAAAA,IAAI,EAAE;AAAR,CAAT,CAAV,CAAgD5B,eAAhD,CAAf","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport { HvRadio, HvRadioGroup } from \"@hitachivantara/uikit-react-core\";\nimport { CurrentStep, RadioButtonUnselected } from \"@hitachivantara/uikit-react-icons\";\nimport styles from \"./styles\";\n\nexport const getSelectorIcons = (classes, options) => {\n const { disabled } = options;\n const color = (disabled && [\"atmo3\", \"atmo5\"]) || undefined;\n const checkedColor = (disabled && [\"atmo3\", \"atmo5\"]) || undefined;\n\n return {\n radio: <RadioButtonUnselected color={color} className={classes.icon} iconSize=\"XS\" />,\n radioChecked: <CurrentStep color={checkedColor} className={classes.icon} iconSize=\"XS\" />,\n };\n};\n\n/**\n * DotPagination description/documentation paragraph\n */\nconst HvDotPagination = (props) => {\n const {\n className,\n classes,\n pages = 1,\n page = 0,\n onPageChange,\n getItemAriaLabel,\n id,\n ...others\n } = props;\n\n const range = (n) => Array.from(Array(n), (v, i) => i);\n\n const icons = getSelectorIcons(classes, {});\n\n return (\n <div className={clsx(className, classes.root)} {...others}>\n <HvRadioGroup classes={{ horizontal: classes.horizontal }} orientation=\"horizontal\">\n {range(pages).map((pg, i) => (\n <HvRadio\n classes={{ root: classes.radioRoot }}\n key={`dot_navigation${id && id.toString()}_item${i.toString()}`}\n value={i}\n checked={page === i}\n onChange={() => onPageChange(i)}\n icon={icons.radio}\n checkedIcon={icons.radioChecked}\n aria-label={getItemAriaLabel(i)}\n />\n ))}\n </HvRadioGroup>\n </div>\n );\n};\n\nHvDotPagination.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the radio button group to overrrite horizontal class margins.\n */\n horizontal: PropTypes.string,\n /**\n * Styles applied to the radio root ( to override radio group horizontal )\n */\n radioRoot: PropTypes.string,\n }).isRequired,\n /**\n * The number of pages the component has.\n */\n pages: PropTypes.number,\n /**\n * The currently selected page (0-indexed).\n */\n page: PropTypes.number,\n /**\n * Function called when the page changes.\n */\n onPageChange: PropTypes.func,\n /**\n * Function called to get the respective aria label.\n */\n getItemAriaLabel: PropTypes.func,\n /**\n * Component id used to generate unique radio keys ( to avoid repeated keys in case multiple dotPagination components are needed)\n */\n id: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvDotPagination\" })(HvDotPagination);\n"],"file":"DotPagination.js"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./DotPagination";
2
+ export * from "./DotPagination";
@@ -0,0 +1,2 @@
1
+ export { default } from "./DotPagination";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB","sourcesContent":["export { default } from \"./DotPagination\";\n"],"file":"index.js"}
@@ -0,0 +1,16 @@
1
+ const styles = () => ({
2
+ root: {
3
+ display: "flex",
4
+ justifyContent: "center"
5
+ },
6
+ horizontal: {
7
+ marginLeft: 0,
8
+ width: "auto"
9
+ },
10
+ radioRoot: {
11
+ marginLeft: "0"
12
+ }
13
+ });
14
+
15
+ export default styles;
16
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/DotPagination/styles.js"],"names":["styles","root","display","justifyContent","horizontal","marginLeft","width","radioRoot"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;AACpBC,EAAAA,IAAI,EAAE;AACJC,IAAAA,OAAO,EAAE,MADL;AAEJC,IAAAA,cAAc,EAAE;AAFZ,GADc;AAMpBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,UAAU,EAAE,CADF;AAEVC,IAAAA,KAAK,EAAE;AAFG,GANQ;AAWpBC,EAAAA,SAAS,EAAE;AACTF,IAAAA,UAAU,EAAE;AADH;AAXS,CAAP,CAAf;;AAgBA,eAAeL,MAAf","sourcesContent":["const styles = () => ({\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n\n horizontal: {\n marginLeft: 0,\n width: \"auto\",\n },\n\n radioRoot: {\n marginLeft: \"0\",\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
  /**