@hitachivantara/uikit-react-lab 3.41.6 → 3.41.9

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 +27 -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 +5 -2
  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 +5 -2
  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 +5 -2
  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 +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
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.9](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-lab@3.41.8...@hitachivantara/uikit-react-lab@3.41.9) (2022-04-19)
7
+
8
+ **Note:** Version bump only for package @hitachivantara/uikit-react-lab
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **NotificationPanel:** toggles pointer cursor according to available onClick param. HVUIKIT-2740 ([9f7f1c2](https://github.com/lumada-design/hv-uikit-react/commit/9f7f1c264126fc29e961d4a21fab93e401a3d4ea))
20
+
21
+
22
+
23
+
24
+
25
+ ## [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)
26
+
27
+ **Note:** Version bump only for package @hitachivantara/uikit-react-lab
28
+
29
+
30
+
31
+
32
+
6
33
  ## [3.41.6](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-lab@3.41.5...@hitachivantara/uikit-react-lab@3.41.6) (2022-04-14)
7
34
 
8
35
 
@@ -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,167 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getSelectorIcons = exports.default = void 0;
9
+
10
+ require("core-js/modules/es.array.from.js");
11
+
12
+ require("core-js/modules/es.string.iterator.js");
13
+
14
+ require("core-js/modules/es.array.map.js");
15
+
16
+ require("core-js/modules/es.array.concat.js");
17
+
18
+ require("core-js/modules/es.object.to-string.js");
19
+
20
+ require("core-js/modules/es.regexp.to-string.js");
21
+
22
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
23
+
24
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
25
+
26
+ var _react = _interopRequireDefault(require("react"));
27
+
28
+ var _propTypes = _interopRequireDefault(require("prop-types"));
29
+
30
+ var _clsx = _interopRequireDefault(require("clsx"));
31
+
32
+ var _core = require("@material-ui/core");
33
+
34
+ var _uikitReactCore = require("@hitachivantara/uikit-react-core");
35
+
36
+ var _uikitReactIcons = require("@hitachivantara/uikit-react-icons");
37
+
38
+ var _styles = _interopRequireDefault(require("./styles"));
39
+
40
+ var _excluded = ["className", "classes", "pages", "page", "onPageChange", "getItemAriaLabel", "id"];
41
+
42
+ var getSelectorIcons = function getSelectorIcons(classes, options) {
43
+ var disabled = options.disabled;
44
+ var color = disabled && ["atmo3", "atmo5"] || undefined;
45
+ var checkedColor = disabled && ["atmo3", "atmo5"] || undefined;
46
+ return {
47
+ radio: /*#__PURE__*/_react.default.createElement(_uikitReactIcons.RadioButtonUnselected, {
48
+ color: color,
49
+ className: classes.icon,
50
+ iconSize: "XS"
51
+ }),
52
+ radioChecked: /*#__PURE__*/_react.default.createElement(_uikitReactIcons.CurrentStep, {
53
+ color: checkedColor,
54
+ className: classes.icon,
55
+ iconSize: "XS"
56
+ })
57
+ };
58
+ };
59
+ /**
60
+ * DotPagination description/documentation paragraph
61
+ */
62
+
63
+
64
+ exports.getSelectorIcons = getSelectorIcons;
65
+
66
+ var HvDotPagination = function HvDotPagination(props) {
67
+ var className = props.className,
68
+ classes = props.classes,
69
+ _props$pages = props.pages,
70
+ pages = _props$pages === void 0 ? 1 : _props$pages,
71
+ _props$page = props.page,
72
+ page = _props$page === void 0 ? 0 : _props$page,
73
+ onPageChange = props.onPageChange,
74
+ getItemAriaLabel = props.getItemAriaLabel,
75
+ id = props.id,
76
+ others = (0, _objectWithoutProperties2.default)(props, _excluded);
77
+
78
+ var range = function range(n) {
79
+ return Array.from(Array(n), function (v, i) {
80
+ return i;
81
+ });
82
+ };
83
+
84
+ var icons = getSelectorIcons(classes, {});
85
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
86
+ className: (0, _clsx.default)(className, classes.root)
87
+ }, others), /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvRadioGroup, {
88
+ classes: {
89
+ horizontal: classes.horizontal
90
+ },
91
+ orientation: "horizontal"
92
+ }, range(pages).map(function (pg, i) {
93
+ return /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvRadio, {
94
+ classes: {
95
+ root: classes.radioRoot
96
+ },
97
+ key: "dot_navigation".concat(id && id.toString(), "_item").concat(i.toString()),
98
+ value: i,
99
+ checked: page === i,
100
+ onChange: function onChange() {
101
+ return onPageChange(i);
102
+ },
103
+ icon: icons.radio,
104
+ checkedIcon: icons.radioChecked,
105
+ "aria-label": getItemAriaLabel(i)
106
+ });
107
+ })));
108
+ };
109
+
110
+ process.env.NODE_ENV !== "production" ? HvDotPagination.propTypes = {
111
+ /**
112
+ * Class names to be applied.
113
+ */
114
+ className: _propTypes.default.string,
115
+
116
+ /**
117
+ * A Jss Object used to override or extend the styles applied.
118
+ */
119
+ classes: _propTypes.default.shape({
120
+ /**
121
+ * Styles applied to the component root class.
122
+ */
123
+ root: _propTypes.default.string,
124
+
125
+ /**
126
+ * Styles applied to the radio button group to overrrite horizontal class margins.
127
+ */
128
+ horizontal: _propTypes.default.string,
129
+
130
+ /**
131
+ * Styles applied to the radio root ( to override radio group horizontal )
132
+ */
133
+ radioRoot: _propTypes.default.string
134
+ }).isRequired,
135
+
136
+ /**
137
+ * The number of pages the component has.
138
+ */
139
+ pages: _propTypes.default.number,
140
+
141
+ /**
142
+ * The currently selected page (0-indexed).
143
+ */
144
+ page: _propTypes.default.number,
145
+
146
+ /**
147
+ * Function called when the page changes.
148
+ */
149
+ onPageChange: _propTypes.default.func,
150
+
151
+ /**
152
+ * Function called to get the respective aria label.
153
+ */
154
+ getItemAriaLabel: _propTypes.default.func,
155
+
156
+ /**
157
+ * Component id used to generate unique radio keys ( to avoid repeated keys in case multiple dotPagination components are needed)
158
+ */
159
+ id: _propTypes.default.number
160
+ } : void 0;
161
+
162
+ var _default = (0, _core.withStyles)(_styles.default, {
163
+ name: "HvDotPagination"
164
+ })(HvDotPagination);
165
+
166
+ exports.default = _default;
167
+ //# sourceMappingURL=DotPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/DotPagination/DotPagination.js"],"names":["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","PropTypes","string","shape","isRequired","number","func","sty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CAAgB;AACvB;AACJ;AACA;AACIT,IAAAA,IAAI,EAAEO,mBAAUC,MAJO;;AAKvB;AACJ;AACA;AACIP,IAAAA,UAAU,EAAEM,mBAAUC,MARC;;AASvB;AACJ;AACA;AACIJ,IAAAA,SAAS,EAAEG,mBAAUC;AAZE,GAAhB,EAaNE,UArBuB;;AAsB1B;AACF;AACA;AACEvB,EAAAA,KAAK,EAAEoB,mBAAUI,MAzBS;;AA0B1B;AACF;AACA;AACEvB,EAAAA,IAAI,EAAEmB,mBAAUI,MA7BU;;AA8B1B;AACF;AACA;AACEtB,EAAAA,YAAY,EAAEkB,mBAAUK,IAjCE;;AAkC1B;AACF;AACA;AACEtB,EAAAA,gBAAgB,EAAEiB,mBAAUK,IArCF;;AAsC1B;AACF;AACA;AACErB,EAAAA,EAAE,EAAEgB,mBAAUI;AAzCY,CAA5B;;eA4Ce,sBAAWE,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAAgD9B,eAAhD,C","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,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "default", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _DotPagination.default;
12
+ }
13
+ });
14
+
15
+ var _DotPagination = _interopRequireDefault(require("./DotPagination"));
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/DotPagination/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from \"./DotPagination\";\n"],"file":"index.js"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var styles = function styles() {
9
+ return {
10
+ root: {
11
+ display: "flex",
12
+ justifyContent: "center"
13
+ },
14
+ horizontal: {
15
+ marginLeft: 0,
16
+ width: "auto"
17
+ },
18
+ radioRoot: {
19
+ marginLeft: "0"
20
+ }
21
+ };
22
+ };
23
+
24
+ var _default = styles;
25
+ exports.default = _default;
26
+ //# 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;;eAgBeL,M","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"}
@@ -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;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;AAAA,MAVJC,SAUI,QAVJA,SAUI;AAAA,MATJC,cASI,QATJA,cASI;AAAA,MARJC,KAQI,QARJA,KAQI;AAAA,MAPJC,MAOI,QAPJA,MAOI;AAAA,MANJC,IAMI,QANJA,IAMI;AAAA,MALJC,IAKI,QALJA,IAKI;AAAA,MAJJC,QAII,QAJJA,OAII;AAAA,MAHJC,WAGI,QAHJA,UAGI;AAAA,MAFJC,cAEI,QAFJA,cAEI;AAAA,MADJC,aACI,QADJA,aACI;;AACJ,MAAMC,OAAO,GAAG,SAAVA,OAAU,GAAM;AACpB,QAAI,CAACP,MAAL,EAAa;AACX,aAAO,oBAAME,IAAN,EAAYM,OAAZ,EAAP;AACD;;AAED,QAAMC,CAAC,GAAG,oBAAMP,IAAN,CAAV;AACA,QAAIQ,MAAM,GAAG,qBAAb;;AAEA,QAAID,CAAC,CAACE,MAAF,CA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;;AA2EvB;AACF;AACA;AACEhC,EAAAA,MAAM,EAAE6B,mBAAUI,IAAV,CAAeD,UA9EA;;AA+EvB;AACF;AACA;AACE9B,EAAAA,IAAI,EAAE2B,mBAAUK,SAAV,CAAoB,CAACL,mBAAUE,MAAX,EAAmBF,mBAAUM,MAA7B,EAAqCN,mBAAUO,MAA/C,CAApB,EAA4EJ,UAlF3D;;AAmFvB;AACF;AACA;AACE/B,EAAAA,IAAI,EAAE4B,mBAAUQ,OAtFO;;AAuFvB;AACF;AACA;AACElC,EAAAA,OAAO,EAAE0B,mBAAUS,IA1FI;;AA2FvB;AACF;AACA;AACElC,EAAAA,UAAU,EAAEyB,mBAAUS,IA9FC;;AA+FvB;AACF;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,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;AAmFvB;AACF;AACA;AACE/B,EAAAA,IAAI,EAAE4B,mBAAUK,SAAV,CAAoB,CAACL,mBAAUE,MAAX,EAAmBF,mBAAUM,MAA7B,EAAqCN,mBAAUO,MAA/C,CAApB,EAA4EJ,UAtF3D;;AAuFvB;AACF;AACA;AACEhC,EAAAA,IAAI,EAAE6B,mBAAUQ,OA1FO;;AA2FvB;AACF;AACA;AACEnC,EAAAA,OAAO,EAAE2B,mBAAUS,IA9FI;;AA+FvB;AACF;AACA;AACEnC,EAAAA,UAAU,EAAE0B,mBAAUS,IAlGC;;AAmGvB;AACF;AACA;AACElC,EAAAA,cAAc,EAAEyB,mBAAUU,IAtGH;;AAuGvB;AACF;AACA;AACElC,EAAAA,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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EArGmB;AAsGzBC,IAAAA,2BAA2B,EAAE;AAC3BpC,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,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,E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IN5B,MAAAA,WAAW,EAAE,KAJP;AAKNX,MAAAA,eAAe,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBa,MAAjB,CAAwBC,KALnC;AAON,gBAAU;AACRjB,QAAAA,OAAO,EAAE;AADD;AAPJ,KA5FiB;AAuGzByC,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;;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"}
package/dist/index.d.ts CHANGED
@@ -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";
package/dist/index.js CHANGED
@@ -37,7 +37,8 @@ var _exportNames = {
37
37
  HvColorPicker: true,
38
38
  HvQueryBuilder: true,
39
39
  HvInlineEditor: true,
40
- HvProgressBar: true
40
+ HvProgressBar: true,
41
+ HvDotPagination: true
41
42
  };
42
43
  Object.defineProperty(exports, "HvAppSwitcherPanel", {
43
44
  enumerable: true,
@@ -51,6 +52,12 @@ Object.defineProperty(exports, "HvColorPicker", {
51
52
  return _ColorPicker.default;
52
53
  }
53
54
  });
55
+ Object.defineProperty(exports, "HvDotPagination", {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _DotPagination.default;
59
+ }
60
+ });
54
61
  Object.defineProperty(exports, "HvDrawer", {
55
62
  enumerable: true,
56
63
  get: function get() {
@@ -188,6 +195,8 @@ var _InlineEditor = _interopRequireDefault(require("./InlineEditor"));
188
195
 
189
196
  var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
190
197
 
198
+ var _DotPagination = _interopRequireDefault(require("./DotPagination"));
199
+
191
200
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
192
201
 
193
202
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","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,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