@hitachivantara/uikit-react-core 3.62.5 → 3.63.0

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 (86) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/AppSwitcher/Action/Action.d.ts +75 -0
  3. package/dist/AppSwitcher/Action/Action.js +304 -0
  4. package/dist/AppSwitcher/Action/Action.js.map +1 -0
  5. package/dist/AppSwitcher/Action/index.d.ts +2 -0
  6. package/dist/AppSwitcher/Action/index.js +14 -0
  7. package/dist/AppSwitcher/Action/index.js.map +1 -0
  8. package/dist/AppSwitcher/Action/styles.js +60 -0
  9. package/dist/AppSwitcher/Action/styles.js.map +1 -0
  10. package/dist/AppSwitcher/AppSwitcher.d.ts +67 -0
  11. package/dist/AppSwitcher/AppSwitcher.js +282 -0
  12. package/dist/AppSwitcher/AppSwitcher.js.map +1 -0
  13. package/dist/AppSwitcher/TitleWithTooltip.js +76 -0
  14. package/dist/AppSwitcher/TitleWithTooltip.js.map +1 -0
  15. package/dist/AppSwitcher/index.d.ts +5 -0
  16. package/dist/AppSwitcher/index.js +24 -0
  17. package/dist/AppSwitcher/index.js.map +1 -0
  18. package/dist/AppSwitcher/styles.js +95 -0
  19. package/dist/AppSwitcher/styles.js.map +1 -0
  20. package/dist/Avatar/Avatar.d.ts +4 -0
  21. package/dist/Avatar/Avatar.js +19 -8
  22. package/dist/Avatar/Avatar.js.map +1 -1
  23. package/dist/Chart/chartPlotlyOverrides.js +2 -2
  24. package/dist/Chart/chartPlotlyOverrides.js.map +1 -1
  25. package/dist/FileUploader/File/styles.js +2 -1
  26. package/dist/FileUploader/File/styles.js.map +1 -1
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.js +9 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/legacy/AppSwitcher/Action/Action.d.ts +75 -0
  31. package/dist/legacy/AppSwitcher/Action/Action.js +259 -0
  32. package/dist/legacy/AppSwitcher/Action/Action.js.map +1 -0
  33. package/dist/legacy/AppSwitcher/Action/index.d.ts +2 -0
  34. package/dist/legacy/AppSwitcher/Action/index.js +3 -0
  35. package/dist/legacy/AppSwitcher/Action/index.js.map +1 -0
  36. package/dist/legacy/AppSwitcher/Action/styles.js +52 -0
  37. package/dist/legacy/AppSwitcher/Action/styles.js.map +1 -0
  38. package/dist/legacy/AppSwitcher/AppSwitcher.d.ts +67 -0
  39. package/dist/legacy/AppSwitcher/AppSwitcher.js +260 -0
  40. package/dist/legacy/AppSwitcher/AppSwitcher.js.map +1 -0
  41. package/dist/legacy/AppSwitcher/TitleWithTooltip.js +45 -0
  42. package/dist/legacy/AppSwitcher/TitleWithTooltip.js.map +1 -0
  43. package/dist/legacy/AppSwitcher/index.d.ts +5 -0
  44. package/dist/legacy/AppSwitcher/index.js +3 -0
  45. package/dist/legacy/AppSwitcher/index.js.map +1 -0
  46. package/dist/legacy/AppSwitcher/styles.js +78 -0
  47. package/dist/legacy/AppSwitcher/styles.js.map +1 -0
  48. package/dist/legacy/Avatar/Avatar.d.ts +4 -0
  49. package/dist/legacy/Avatar/Avatar.js +19 -8
  50. package/dist/legacy/Avatar/Avatar.js.map +1 -1
  51. package/dist/legacy/Chart/chartPlotlyOverrides.js +2 -2
  52. package/dist/legacy/Chart/chartPlotlyOverrides.js.map +1 -1
  53. package/dist/legacy/FileUploader/File/styles.js +2 -1
  54. package/dist/legacy/FileUploader/File/styles.js.map +1 -1
  55. package/dist/legacy/index.d.ts +3 -0
  56. package/dist/legacy/index.js +1 -0
  57. package/dist/legacy/index.js.map +1 -1
  58. package/dist/modern/AppSwitcher/Action/Action.d.ts +75 -0
  59. package/dist/modern/AppSwitcher/Action/Action.js +242 -0
  60. package/dist/modern/AppSwitcher/Action/Action.js.map +1 -0
  61. package/dist/modern/AppSwitcher/Action/index.d.ts +2 -0
  62. package/dist/modern/AppSwitcher/Action/index.js +3 -0
  63. package/dist/modern/AppSwitcher/Action/index.js.map +1 -0
  64. package/dist/modern/AppSwitcher/Action/styles.js +50 -0
  65. package/dist/modern/AppSwitcher/Action/styles.js.map +1 -0
  66. package/dist/modern/AppSwitcher/AppSwitcher.d.ts +67 -0
  67. package/dist/modern/AppSwitcher/AppSwitcher.js +254 -0
  68. package/dist/modern/AppSwitcher/AppSwitcher.js.map +1 -0
  69. package/dist/modern/AppSwitcher/TitleWithTooltip.js +41 -0
  70. package/dist/modern/AppSwitcher/TitleWithTooltip.js.map +1 -0
  71. package/dist/modern/AppSwitcher/index.d.ts +5 -0
  72. package/dist/modern/AppSwitcher/index.js +3 -0
  73. package/dist/modern/AppSwitcher/index.js.map +1 -0
  74. package/dist/modern/AppSwitcher/styles.js +67 -0
  75. package/dist/modern/AppSwitcher/styles.js.map +1 -0
  76. package/dist/modern/Avatar/Avatar.d.ts +4 -0
  77. package/dist/modern/Avatar/Avatar.js +20 -9
  78. package/dist/modern/Avatar/Avatar.js.map +1 -1
  79. package/dist/modern/Chart/chartPlotlyOverrides.js +2 -2
  80. package/dist/modern/Chart/chartPlotlyOverrides.js.map +1 -1
  81. package/dist/modern/FileUploader/File/styles.js +2 -1
  82. package/dist/modern/FileUploader/File/styles.js.map +1 -1
  83. package/dist/modern/index.d.ts +3 -0
  84. package/dist/modern/index.js +1 -0
  85. package/dist/modern/index.js.map +1 -1
  86. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
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.63.0](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-core@3.62.7...@hitachivantara/uikit-react-core@3.63.0) (2022-04-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **AssetInventory:** realign List View Row values HVUIKIT-6343 ([#2753](https://github.com/lumada-design/hv-uikit-react/issues/2753)) ([a90219c](https://github.com/lumada-design/hv-uikit-react/commit/a90219cffdebeea8283f80bd7f6a060b035335fb))
12
+ * **Avatar:** fix Avatar stories ([4fad9f5](https://github.com/lumada-design/hv-uikit-react/commit/4fad9f596c6f02c0abad324f59f16b7f42e9b84d))
13
+ * **chart:** allow change bgcolor of charts. ([6ed5086](https://github.com/lumada-design/hv-uikit-react/commit/6ed50866f5cb70825427ccdd4bf750998c94e499))
14
+
15
+
16
+ ### Features
17
+
18
+ * **AppSwitcherPanel:** promote component to core ([#2729](https://github.com/lumada-design/hv-uikit-react/issues/2729)) ([4c27f28](https://github.com/lumada-design/hv-uikit-react/commit/4c27f28097fce81fc0b48b82aab093f7674a77f8))
19
+
20
+
21
+
22
+
23
+
24
+ ## 3.62.7 (2022-04-22)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **FileUploader:** realigned upload value HVUIKIT-6340 ([2e26913](https://github.com/lumada-design/hv-uikit-react/commit/2e26913c531175fcb3ad21cc911dac3326131411))
30
+
31
+
32
+
33
+
34
+
35
+ ## [3.62.6](https://github.com/lumada-design/hv-uikit-react/compare/@hitachivantara/uikit-react-core@3.62.5...@hitachivantara/uikit-react-core@3.62.6) (2022-04-20)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * **Avatar:** add containerProps ([#2747](https://github.com/lumada-design/hv-uikit-react/issues/2747)) ([872a22c](https://github.com/lumada-design/hv-uikit-react/commit/872a22c69083eda96ac02cd7c831b25c8153dac0))
41
+
42
+
43
+
44
+
45
+
6
46
  ## 3.62.5 (2022-04-19)
7
47
 
8
48
 
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import { StandardProps } from "@material-ui/core";
3
+
4
+ export interface HvAppSwitcherActionApplication {
5
+ /**
6
+ * Id of the application.
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Name of the application, this is the value that will be displayed on the component.
11
+ */
12
+ name: string;
13
+ /**
14
+ * The color to be applied to the item's border and to the default icon.
15
+ * You can use either an HEX or color name from the palette.
16
+ */
17
+ color?: string;
18
+ /**
19
+ * URL with the icon location to be used to represent the application.
20
+ * iconUrl will only be used if no iconElement is provided.
21
+ */
22
+ iconUrl?: string;
23
+ /**
24
+ * Element to be added as the icon representing the application.
25
+ * The iconElement will be the primary option to be displayed.
26
+ */
27
+ iconElement?: React.ReactNode;
28
+ /**
29
+ * Small description of the application.
30
+ */
31
+ description?: string;
32
+ /**
33
+ * URL where the application is accesible.
34
+ */
35
+ url?: string;
36
+ /**
37
+ * Defines if the application should be opened in the same tab or in a new one.
38
+ */
39
+ target?: "_top" | "_blank";
40
+ /**
41
+ * If true, the item will be disabled.
42
+ */
43
+ disabled?: boolean;
44
+ /**
45
+ * True when the application is selected, false otherwise.
46
+ */
47
+ isSelected?: boolean;
48
+ }
49
+
50
+ export type HvAppSwitcherActionClassKey =
51
+ | "root"
52
+ | "typography"
53
+ | "selected"
54
+ | "icon"
55
+ | "iconUrl"
56
+ | "title"
57
+ | "iconInfo";
58
+
59
+ export interface HvAppSwitcherActionProps
60
+ extends StandardProps<React.HTMLAttributes<HTMLElement>, HvAppSwitcherActionClassKey> {
61
+ /**
62
+ * The application data to be used to render the Action object.
63
+ */
64
+ application: HvAppSwitcherActionApplication;
65
+ /**
66
+ * Callback triggered when the action is clicked.
67
+ */
68
+ onClickCallback?: (event: MouseEvent, application?: HvAppSwitcherActionApplication) => void;
69
+ /**
70
+ * Must return a boolean stating if the action element is selected or not.
71
+ */
72
+ isSelectedCallback?: (application?: HvAppSwitcherActionApplication) => boolean;
73
+ }
74
+
75
+ export default function HvAppSwitcherAction(props: HvAppSwitcherActionProps): JSX.Element | null;
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.keys.js");
4
+
5
+ require("core-js/modules/es.array.filter.js");
6
+
7
+ require("core-js/modules/es.object.to-string.js");
8
+
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+
11
+ require("core-js/modules/web.dom-collections.for-each.js");
12
+
13
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
14
+
15
+ require("core-js/modules/es.array.iterator.js");
16
+
17
+ require("core-js/modules/es.string.iterator.js");
18
+
19
+ require("core-js/modules/es.weak-map.js");
20
+
21
+ require("core-js/modules/web.dom-collections.iterator.js");
22
+
23
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
24
+
25
+ var _typeof = require("@babel/runtime/helpers/typeof");
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+ exports.default = void 0;
31
+
32
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
33
+
34
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
35
+
36
+ require("core-js/modules/es.function.name.js");
37
+
38
+ require("core-js/modules/es.symbol.js");
39
+
40
+ require("core-js/modules/es.symbol.description.js");
41
+
42
+ require("core-js/modules/es.regexp.exec.js");
43
+
44
+ require("core-js/modules/es.string.split.js");
45
+
46
+ var _react = _interopRequireWildcard(require("react"));
47
+
48
+ var _propTypes = _interopRequireDefault(require("prop-types"));
49
+
50
+ var _clsx = _interopRequireDefault(require("clsx"));
51
+
52
+ var _core = require("@material-ui/core");
53
+
54
+ var _uikitReactIcons = require("@hitachivantara/uikit-react-icons");
55
+
56
+ var _ = require("../..");
57
+
58
+ var _styles = _interopRequireDefault(require("./styles"));
59
+
60
+ var _TitleWithTooltip = _interopRequireDefault(require("../TitleWithTooltip"));
61
+
62
+ 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); }
63
+
64
+ 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; }
65
+
66
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
67
+
68
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
69
+
70
+ var getColor = function getColor(theme, color, defaultColor) {
71
+ return theme.palette[color] || color || defaultColor;
72
+ };
73
+
74
+ var Action = function Action(props) {
75
+ var id = props.id,
76
+ className = props.className,
77
+ classes = props.classes,
78
+ application = props.application,
79
+ _props$onClickCallbac = props.onClickCallback,
80
+ onClickCallback = _props$onClickCallbac === void 0 ? function () {} : _props$onClickCallbac,
81
+ _props$isSelectedCall = props.isSelectedCallback,
82
+ isSelectedCallback = _props$isSelectedCall === void 0 ? function () {
83
+ return false;
84
+ } : _props$isSelectedCall;
85
+ var name = application.name,
86
+ description = application.description,
87
+ disabled = application.disabled,
88
+ iconElement = application.iconElement,
89
+ iconUrl = application.iconUrl,
90
+ url = application.url,
91
+ target = application.target;
92
+ var theme = (0, _core.useTheme)();
93
+ var color = disabled ? theme.hv.palette.atmosphere.atmo5 : getColor(theme, application.color, theme.hv.palette.accent.acce1);
94
+
95
+ var _useState = (0, _react.useState)(true),
96
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
97
+ validIconUrl = _useState2[0],
98
+ setValidIconUrl = _useState2[1];
99
+
100
+ var renderApplicationIcon = function renderApplicationIcon() {
101
+ if (iconElement) {
102
+ return iconElement;
103
+ }
104
+
105
+ if (iconUrl && validIconUrl) {
106
+ return /*#__PURE__*/_react.default.createElement("img", {
107
+ className: classes.iconUrl,
108
+ src: iconUrl,
109
+ onError: function onError() {
110
+ setValidIconUrl(false);
111
+ },
112
+ alt: description
113
+ });
114
+ }
115
+
116
+ var brokenTitle = name.split(" ");
117
+ var initials = brokenTitle[0].substring(0, 1) + (brokenTitle[1] ? brokenTitle[1].substring(0, 1) : "");
118
+ return /*#__PURE__*/_react.default.createElement(_.HvAvatar, {
119
+ size: "SM",
120
+ backgroundColor: color,
121
+ variant: "square"
122
+ }, initials);
123
+ };
124
+
125
+ var isSelected = isSelectedCallback(application);
126
+ /**
127
+ * Handles the onClick event and triggers the appropriate callback if it exists.
128
+ */
129
+
130
+ var handleOnClick = function handleOnClick(event) {
131
+ if (disabled) {
132
+ event.preventDefault();
133
+ return;
134
+ }
135
+
136
+ onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback(event, _objectSpread(_objectSpread({}, application), {}, {
137
+ isSelected: isSelected
138
+ }));
139
+ };
140
+
141
+ var isLink = url != null;
142
+ return /*#__PURE__*/_react.default.createElement(_.HvListItem, {
143
+ id: id,
144
+ interactive: true,
145
+ tabIndex: 0,
146
+ selected: isSelected,
147
+ disabled: disabled,
148
+ className: (0, _clsx.default)(className, classes.root, disabled && classes.disabled, isSelected && classes.selected)
149
+ }, /*#__PURE__*/_react.default.createElement(_.HvTypography, {
150
+ component: isLink ? "a" : "button",
151
+ href: isLink ? url : undefined,
152
+ target: isLink ? target || "_top" : undefined,
153
+ className: classes.typography,
154
+ onClick: handleOnClick,
155
+ style: {
156
+ borderColor: color
157
+ }
158
+ }, /*#__PURE__*/_react.default.createElement("div", {
159
+ className: classes.icon
160
+ }, renderApplicationIcon()), /*#__PURE__*/_react.default.createElement(_TitleWithTooltip.default, {
161
+ title: name,
162
+ className: classes.title
163
+ }), description && /*#__PURE__*/_react.default.createElement(_.HvTooltip, {
164
+ disableFocusListener: true,
165
+ disableTouchListener: true,
166
+ title: /*#__PURE__*/_react.default.createElement(_.HvTypography, null, description)
167
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_uikitReactIcons.Info, {
168
+ className: classes.iconInfo,
169
+ role: "img",
170
+ "aria-label": description
171
+ })))));
172
+ };
173
+
174
+ process.env.NODE_ENV !== "production" ? Action.propTypes = {
175
+ /**
176
+ * Identifier to be applied to the root element.
177
+ */
178
+ id: _propTypes.default.string,
179
+
180
+ /**
181
+ * Class names to be applied to the root element.
182
+ */
183
+ className: _propTypes.default.string,
184
+
185
+ /**
186
+ * A Jss object used to override or extend the component styles.
187
+ */
188
+ classes: _propTypes.default.shape({
189
+ /**
190
+ * Styles applied to the component root class.
191
+ */
192
+ root: _propTypes.default.string,
193
+
194
+ /**
195
+ * Styles applied to the component root class when disabled.
196
+ */
197
+ disabled: _propTypes.default.string,
198
+
199
+ /**
200
+ * Styles applied to the typography element.
201
+ */
202
+ typography: _propTypes.default.string,
203
+
204
+ /**
205
+ * Styles applied to the component root class when selected.
206
+ */
207
+ selected: _propTypes.default.string,
208
+
209
+ /**
210
+ * Styles applied to the icon container.
211
+ */
212
+ icon: _propTypes.default.string,
213
+
214
+ /**
215
+ * Styles applied to the icon.
216
+ */
217
+ iconUrl: _propTypes.default.string,
218
+
219
+ /**
220
+ * Styles applied to the action title element.
221
+ */
222
+ title: _propTypes.default.string,
223
+
224
+ /**
225
+ * Styles applied to the info icon element.
226
+ */
227
+ iconInfo: _propTypes.default.string
228
+ }).isRequired,
229
+
230
+ /**
231
+ * The application data to be used to render the Action object.
232
+ */
233
+ application: _propTypes.default.shape({
234
+ /**
235
+ * Id of the application.
236
+ */
237
+ id: _propTypes.default.string,
238
+
239
+ /**
240
+ * Name of the application, this is the value that will be displayed on the component.
241
+ */
242
+ name: _propTypes.default.string.isRequired,
243
+
244
+ /**
245
+ * The color to be applied to the item's border and to the default icon.
246
+ * You can use either an HEX or color name from the palette.
247
+ */
248
+ color: _propTypes.default.string,
249
+
250
+ /**
251
+ * URL with the icon location to be used to represent the application.
252
+ * iconUrl will only be used if no iconElement is provided.
253
+ */
254
+ iconUrl: _propTypes.default.string,
255
+
256
+ /**
257
+ * Element to be added as the icon representing the application.
258
+ * The iconElement will be the primary option to be displayed.
259
+ */
260
+ iconElement: _propTypes.default.element,
261
+
262
+ /**
263
+ * Small description of the application.
264
+ */
265
+ description: _propTypes.default.string,
266
+
267
+ /**
268
+ * URL where the application is accessible.
269
+ */
270
+ url: _propTypes.default.string,
271
+
272
+ /**
273
+ * Defines if the application should be opened in the same tab or in a new one.
274
+ */
275
+ target: _propTypes.default.oneOf(["_top", "_blank"]),
276
+
277
+ /**
278
+ * If true, the item will be disabled.
279
+ */
280
+ disabled: _propTypes.default.bool,
281
+
282
+ /**
283
+ * True when the application is selected, false otherwise.
284
+ */
285
+ isSelected: _propTypes.default.bool
286
+ }).isRequired,
287
+
288
+ /**
289
+ * Callback triggered when the action is clicked.
290
+ */
291
+ onClickCallback: _propTypes.default.func,
292
+
293
+ /**
294
+ * Must return a boolean stating if the action element is selected or not.
295
+ */
296
+ isSelectedCallback: _propTypes.default.func
297
+ } : void 0;
298
+
299
+ var _default = (0, _core.withStyles)(_styles.default, {
300
+ name: "HvAppSwitcherAction"
301
+ })(Action);
302
+
303
+ exports.default = _default;
304
+ //# sourceMappingURL=Action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/AppSwitcher/Action/Action.js"],"names":["getColor","theme","color","defaultColor","palette","Action","props","id","className","classes","application","onClickCallback","isSelectedCallback","name","description","disabled","iconElement","iconUrl","url","target","hv","atmosphere","atmo5","accent","acce1","validIconUrl","setValidIconUrl","renderApplicationIcon","brokenTitle","split","initials","substring","isSelected","handleOnClick","event","preventDefault","isLink","root","selected","undefined","typography","borderColor","icon","title","iconInfo","propTypes","PropTypes","string","shape","isRequired","element","oneOf","bool","func","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQC,KAAR,EAAeC,YAAf;AAAA,SAAgCF,KAAK,CAACG,OAAN,CAAcF,KAAd,KAAwBA,KAAxB,IAAiCC,YAAjE;AAAA,CAAjB;;AAEA,IAAME,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD,EAAW;AACxB,MACEC,EADF,GAOID,KAPJ,CACEC,EADF;AAAA,MAEEC,SAFF,GAOIF,KAPJ,CAEEE,SAFF;AAAA,MAGEC,OAHF,GAOIH,KAPJ,CAGEG,OAHF;AAAA,MAIEC,WAJF,GAOIJ,KAPJ,CAIEI,WAJF;AAAA,8BAOIJ,KAPJ,CAKEK,eALF;AAAA,MAKEA,eALF,sCAKoB,YAAM,CAAE,CAL5B;AAAA,8BAOIL,KAPJ,CAMEM,kBANF;AAAA,MAMEA,kBANF,sCAMuB;AAAA,WAAM,KAAN;AAAA,GANvB;AASA,MAAQC,IAAR,GAA2EH,WAA3E,CAAQG,IAAR;AAAA,MAAcC,WAAd,GAA2EJ,WAA3E,CAAcI,WAAd;AAAA,MAA2BC,QAA3B,GAA2EL,WAA3E,CAA2BK,QAA3B;AAAA,MAAqCC,WAArC,GAA2EN,WAA3E,CAAqCM,WAArC;AAAA,MAAkDC,OAAlD,GAA2EP,WAA3E,CAAkDO,OAAlD;AAAA,MAA2DC,GAA3D,GAA2ER,WAA3E,CAA2DQ,GAA3D;AAAA,MAAgEC,MAAhE,GAA2ET,WAA3E,CAAgES,MAAhE;AAEA,MAA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C,IAAAA,KAAK,EAAE4C,mBAAUC,MAbU;;AAc3B;AACJ;AACA;AACA;AACI9B,IAAAA,OAAO,EAAE6B,mBAAUC,MAlBQ;;AAmB3B;AACJ;AACA;AACA;AACI/B,IAAAA,WAAW,EAAE8B,mBAAUI,OAvBI;;AAwB3B;AACJ;AACA;AACIpC,IAAAA,WAAW,EAAEgC,mBAAUC,MA3BI;;AA4B3B;AACJ;AACA;AACI7B,IAAAA,GAAG,EAAE4B,mBAAUC,MA/BY;;AAgC3B;AACJ;AACA;AACI5B,IAAAA,MAAM,EAAE2B,mBAAUK,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,CAAhB,CAnCmB;;AAoC3B;AACJ;AACA;AACIpC,IAAAA,QAAQ,EAAE+B,mBAAUM,IAvCO;;AAwC3B;AACJ;AACA;AACIpB,IAAAA,UAAU,EAAEc,mBAAUM;AA3CK,GAAhB,EA4CVH,UA/Fc;;AAiGjB;AACF;AACA;AACEtC,EAAAA,eAAe,EAAEmC,mBAAUO,IApGV;;AAqGjB;AACF;AACA;AACEzC,EAAAA,kBAAkB,EAAEkC,mBAAUO;AAxGb,CAAnB;;eA2Ge,sBAAWC,eAAX,EAAmB;AAAEzC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAAoDR,MAApD,C","sourcesContent":["import React, { useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport clsx from \"clsx\";\nimport { useTheme, withStyles } from \"@material-ui/core\";\n\nimport { Info } from \"@hitachivantara/uikit-react-icons\";\nimport { HvTypography, HvAvatar, HvTooltip, HvListItem } from \"../..\";\n\nimport styles from \"./styles\";\n\nimport TitleWithTooltip from \"../TitleWithTooltip\";\n\nconst getColor = (theme, color, defaultColor) => theme.palette[color] || color || defaultColor;\n\nconst Action = (props) => {\n const {\n id,\n className,\n classes,\n application,\n onClickCallback = () => {},\n isSelectedCallback = () => false,\n } = props;\n\n const { name, description, disabled, iconElement, iconUrl, url, target } = application;\n\n const theme = useTheme();\n const color = disabled\n ? theme.hv.palette.atmosphere.atmo5\n : getColor(theme, application.color, theme.hv.palette.accent.acce1);\n\n const [validIconUrl, setValidIconUrl] = useState(true);\n\n const renderApplicationIcon = () => {\n if (iconElement) {\n return iconElement;\n }\n\n if (iconUrl && validIconUrl) {\n return (\n <img\n className={classes.iconUrl}\n src={iconUrl}\n onError={() => {\n setValidIconUrl(false);\n }}\n alt={description}\n />\n );\n }\n\n const brokenTitle = name.split(\" \");\n const initials =\n brokenTitle[0].substring(0, 1) + (brokenTitle[1] ? brokenTitle[1].substring(0, 1) : \"\");\n\n return (\n <HvAvatar size=\"SM\" backgroundColor={color} variant=\"square\">\n {initials}\n </HvAvatar>\n );\n };\n\n const isSelected = isSelectedCallback(application);\n\n /**\n * Handles the onClick event and triggers the appropriate callback if it exists.\n */\n const handleOnClick = (event) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onClickCallback?.(event, { ...application, isSelected });\n };\n\n const isLink = url != null;\n\n return (\n <HvListItem\n id={id}\n interactive\n tabIndex={0}\n selected={isSelected}\n disabled={disabled}\n className={clsx(className, classes.root, {\n [classes.disabled]: disabled,\n [classes.selected]: isSelected,\n })}\n >\n <HvTypography\n component={isLink ? \"a\" : \"button\"}\n href={isLink ? url : undefined}\n target={isLink ? target || \"_top\" : undefined}\n className={classes.typography}\n onClick={handleOnClick}\n style={{ borderColor: color }}\n >\n <div className={classes.icon}>{renderApplicationIcon()}</div>\n\n <TitleWithTooltip title={name} className={classes.title} />\n\n {description && (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={<HvTypography>{description}</HvTypography>}\n >\n <div>\n <Info className={classes.iconInfo} role=\"img\" aria-label={description} />\n </div>\n </HvTooltip>\n )}\n </HvTypography>\n </HvListItem>\n );\n};\n\nAction.propTypes = {\n /**\n * Identifier to be applied to the root element.\n */\n id: PropTypes.string,\n\n /**\n * Class names to be applied to the root element.\n */\n className: PropTypes.string,\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 class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component root class when disabled.\n */\n disabled: PropTypes.string,\n /**\n * Styles applied to the typography element.\n */\n typography: PropTypes.string,\n /**\n * Styles applied to the component root class when selected.\n */\n selected: PropTypes.string,\n /**\n * Styles applied to the icon container.\n */\n icon: PropTypes.string,\n /**\n * Styles applied to the icon.\n */\n iconUrl: PropTypes.string,\n /**\n * Styles applied to the action title element.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the info icon element.\n */\n iconInfo: PropTypes.string,\n }).isRequired,\n\n /**\n * The application data to be used to render the Action object.\n */\n application: PropTypes.shape({\n /**\n * Id of the application.\n */\n id: PropTypes.string,\n /**\n * Name of the application, this is the value that will be displayed on the component.\n */\n name: PropTypes.string.isRequired,\n /**\n * The color to be applied to the item's border and to the default icon.\n * You can use either an HEX or color name from the palette.\n */\n color: PropTypes.string,\n /**\n * URL with the icon location to be used to represent the application.\n * iconUrl will only be used if no iconElement is provided.\n */\n iconUrl: PropTypes.string,\n /**\n * Element to be added as the icon representing the application.\n * The iconElement will be the primary option to be displayed.\n */\n iconElement: PropTypes.element,\n /**\n * Small description of the application.\n */\n description: PropTypes.string,\n /**\n * URL where the application is accessible.\n */\n url: PropTypes.string,\n /**\n * Defines if the application should be opened in the same tab or in a new one.\n */\n target: PropTypes.oneOf([\"_top\", \"_blank\"]),\n /**\n * If true, the item will be disabled.\n */\n disabled: PropTypes.bool,\n /**\n * True when the application is selected, false otherwise.\n */\n isSelected: PropTypes.bool,\n }).isRequired,\n\n /**\n * Callback triggered when the action is clicked.\n */\n onClickCallback: PropTypes.func,\n /**\n * Must return a boolean stating if the action element is selected or not.\n */\n isSelectedCallback: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvAppSwitcherAction\" })(Action);\n"],"file":"Action.js"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./Action";
2
+ export * from "./Action";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _Action = _interopRequireDefault(require("./Action"));
11
+
12
+ var _default = _Action.default;
13
+ exports.default = _default;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/AppSwitcher/Action/index.js"],"names":["Action"],"mappings":";;;;;;;;;AAAA;;eAEeA,e","sourcesContent":["import Action from \"./Action\";\n\nexport default Action;\n"],"file":"index.js"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var styles = function styles(theme) {
9
+ return {
10
+ root: {
11
+ width: "100%",
12
+ maxWidth: 280,
13
+ minHeight: 52,
14
+ marginRight: theme.hv.spacing.sm
15
+ },
16
+ disabled: {},
17
+ selected: {},
18
+ typography: {
19
+ display: "flex",
20
+ justifyContent: "flex-start",
21
+ alignItems: "center",
22
+ width: "100%",
23
+ minHeight: 52,
24
+ padding: "6px ".concat(theme.hv.spacing.xs, "px"),
25
+ border: "none",
26
+ borderLeft: "solid 2px ".concat(theme.hv.palette.accent.acce1),
27
+ cursor: "pointer",
28
+ textDecoration: "inherit",
29
+ color: "inherit",
30
+ backgroundColor: "inherit",
31
+ "$disabled &": {
32
+ cursor: "not-allowed"
33
+ }
34
+ },
35
+ icon: {
36
+ display: "flex",
37
+ minWidth: 40,
38
+ justifyContent: "center"
39
+ },
40
+ title: {
41
+ flexGrow: 1,
42
+ margin: "0 ".concat(theme.hv.spacing.xs, "px"),
43
+ textAlign: "left",
44
+ overflow: "hidden",
45
+ whiteSpace: "nowrap",
46
+ textOverflow: "ellipsis",
47
+ color: "inherit"
48
+ },
49
+ iconInfo: {
50
+ minWidth: 32
51
+ },
52
+ iconUrl: {
53
+ width: 32
54
+ }
55
+ };
56
+ };
57
+
58
+ var _default = styles;
59
+ exports.default = _default;
60
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/AppSwitcher/Action/styles.js"],"names":["styles","theme","root","width","maxWidth","minHeight","marginRight","hv","spacing","sm","disabled","selected","typography","display","justifyContent","alignItems","padding","xs","border","borderLeft","palette","accent","acce1","cursor","textDecoration","color","backgroundColor","icon","minWidth","title","flexGrow","margin","textAlign","overflow","whiteSpace","textOverflow","iconInfo","iconUrl"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,KAAK,EAAE,MADH;AAEJC,MAAAA,QAAQ,EAAE,GAFN;AAGJC,MAAAA,SAAS,EAAE,EAHP;AAIJC,MAAAA,WAAW,EAAEL,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBC;AAJ1B,KADmB;AAOzBC,IAAAA,QAAQ,EAAE,EAPe;AAQzBC,IAAAA,QAAQ,EAAE,EARe;AAUzBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,OAAO,EAAE,MADC;AAEVC,MAAAA,cAAc,EAAE,YAFN;AAGVC,MAAAA,UAAU,EAAE,QAHF;AAKVZ,MAAAA,KAAK,EAAE,MALG;AAMVE,MAAAA,SAAS,EAAE,EAND;AAQVW,MAAAA,OAAO,gBAASf,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBS,EAA1B,OARG;AAUVC,MAAAA,MAAM,EAAE,MAVE;AAWVC,MAAAA,UAAU,sBAAelB,KAAK,CAACM,EAAN,CAASa,OAAT,CAAiBC,MAAjB,CAAwBC,KAAvC,CAXA;AAaVC,MAAAA,MAAM,EAAE,SAbE;AAeVC,MAAAA,cAAc,EAAE,SAfN;AAgBVC,MAAAA,KAAK,EAAE,SAhBG;AAiBVC,MAAAA,eAAe,EAAE,SAjBP;AAmBV,qBAAe;AACbH,QAAAA,MAAM,EAAE;AADK;AAnBL,KAVa;AAkCzBI,IAAAA,IAAI,EAAE;AACJd,MAAAA,OAAO,EAAE,MADL;AAEJe,MAAAA,QAAQ,EAAE,EAFN;AAGJd,MAAAA,cAAc,EAAE;AAHZ,KAlCmB;AAwCzBe,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,CADL;AAELC,MAAAA,MAAM,cAAO9B,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBS,EAAxB,OAFD;AAILe,MAAAA,SAAS,EAAE,MAJN;AAMLC,MAAAA,QAAQ,EAAE,QANL;AAOLC,MAAAA,UAAU,EAAE,QAPP;AAQLC,MAAAA,YAAY,EAAE,UART;AAULV,MAAAA,KAAK,EAAE;AAVF,KAxCkB;AAqDzBW,IAAAA,QAAQ,EAAE;AACRR,MAAAA,QAAQ,EAAE;AADF,KArDe;AAyDzBS,IAAAA,OAAO,EAAE;AACPlC,MAAAA,KAAK,EAAE;AADA;AAzDgB,GAAZ;AAAA,CAAf;;eA8DeH,M","sourcesContent":["const styles = (theme) => ({\n root: {\n width: \"100%\",\n maxWidth: 280,\n minHeight: 52,\n marginRight: theme.hv.spacing.sm,\n },\n disabled: {},\n selected: {},\n\n typography: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n\n width: \"100%\",\n minHeight: 52,\n\n padding: `6px ${theme.hv.spacing.xs}px`,\n\n border: \"none\",\n borderLeft: `solid 2px ${theme.hv.palette.accent.acce1}`,\n\n cursor: \"pointer\",\n\n textDecoration: \"inherit\",\n color: \"inherit\",\n backgroundColor: \"inherit\",\n\n \"$disabled &\": {\n cursor: \"not-allowed\",\n },\n },\n\n icon: {\n display: \"flex\",\n minWidth: 40,\n justifyContent: \"center\",\n },\n\n title: {\n flexGrow: 1,\n margin: `0 ${theme.hv.spacing.xs}px`,\n\n textAlign: \"left\",\n\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n\n color: \"inherit\",\n },\n\n iconInfo: {\n minWidth: 32,\n },\n\n iconUrl: {\n width: 32,\n },\n});\n\nexport default styles;\n"],"file":"styles.js"}
@@ -0,0 +1,67 @@
1
+ import * as React from "react";
2
+ import { StandardProps } from "@material-ui/core";
3
+
4
+ import { HvAppSwitcherActionApplication } from "./Action";
5
+
6
+ export type HvAppSwitcherClassKey =
7
+ | "root"
8
+ | "single"
9
+ | "dual"
10
+ | "fluid"
11
+ | "title"
12
+ | "actionsContainer"
13
+ | "footerContainer"
14
+ | "closed"
15
+ | "open"
16
+ | "item"
17
+ | "itemSelected"
18
+ | "itemDisabled"
19
+ | "itemTrigger"
20
+ | "itemIcon"
21
+ | "itemTitle"
22
+ | "itemInfoIcon";
23
+
24
+ export interface HvAppSwitcherProps
25
+ extends StandardProps<React.HTMLAttributes<HTMLElement>, HvAppSwitcherClassKey> {
26
+ /**
27
+ * Number of columns to render. One, two, or whatever fits the component's width.
28
+ */
29
+ layout?: "single" | "dual" | "fluid";
30
+
31
+ /**
32
+ * Title to be displayed on the header of the component.
33
+ */
34
+ title?: string;
35
+ /**
36
+ * The list of applications to be used to render the actions on the component.
37
+ */
38
+ applications: HvAppSwitcherActionApplication[];
39
+
40
+ /**
41
+ * Triggered when an action is clicked.
42
+ */
43
+ onActionClickedCallback?: (
44
+ event: MouseEvent,
45
+ application?: HvAppSwitcherActionApplication
46
+ ) => void;
47
+ /**
48
+ * Must return a boolean stating if the action element is selected or not.
49
+ */
50
+ isActionSelectedCallback?: (application?: HvAppSwitcherActionApplication) => boolean;
51
+
52
+ /**
53
+ * Element to be added to the header container, if none is provided a label with the title will be added.
54
+ */
55
+ header?: string | React.ReactNode;
56
+ /**
57
+ * Element to be added to the footer container.
58
+ */
59
+ footer?: string | React.ReactNode;
60
+
61
+ /**
62
+ * Flag stating if the panel is opened or closed.
63
+ */
64
+ isOpen?: boolean;
65
+ }
66
+
67
+ export default function HvAppSwitcher(props: HvAppSwitcherProps): JSX.Element | null;