@telia-ace/knowledge-widget-ui 1.0.10 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/{lib-esm → dist}/components/dialog-link.d.ts +12 -12
- package/{lib → dist}/components/dialog-list.d.ts +7 -7
- package/{lib-esm → dist}/components/drawer-list.d.ts +5 -5
- package/{lib → dist}/components/dropdown-actions.d.ts +11 -11
- package/{lib → dist}/components/dropdown-list.d.ts +5 -5
- package/{lib → dist}/components/favorite-button.d.ts +17 -17
- package/{lib-esm → dist}/components/feedback.d.ts +11 -11
- package/{lib-esm → dist}/components/guide-list.d.ts +46 -46
- package/{lib → dist}/components/index.d.ts +10 -10
- package/{lib → dist}/components/loader.d.ts +9 -9
- package/{lib-esm → dist}/components/metadata.d.ts +17 -17
- package/{lib → dist}/hooks/index.d.ts +5 -5
- package/{lib-esm → dist}/hooks/use-arrow-keys.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-debounce.d.ts +2 -2
- package/{lib → dist}/hooks/use-favorites.d.ts +8 -8
- package/{lib-esm → dist}/hooks/use-hover.d.ts +2 -2
- package/{lib → dist}/index.d.ts +7 -7
- package/dist/index.js +1385 -0
- package/dist/index.js.map +1 -0
- package/{lib-esm → dist}/missing-type-exports.d.ts +47 -47
- package/{lib-esm → dist}/styles.d.ts +8 -7
- package/{lib-esm → dist}/utils/embedded-link-mapper.d.ts +3 -3
- package/{lib-esm → dist}/utils/guide-render-instructions.d.ts +9 -9
- package/{lib → dist}/utils/index.d.ts +1 -1
- package/package.json +12 -13
- package/lib/components/dialog-link.d.ts +0 -12
- package/lib/components/dialog-link.js +0 -40
- package/lib/components/dialog-list.js +0 -72
- package/lib/components/drawer-list.d.ts +0 -5
- package/lib/components/drawer-list.js +0 -43
- package/lib/components/dropdown-actions.js +0 -25
- package/lib/components/dropdown-list.js +0 -66
- package/lib/components/favorite-button.js +0 -65
- package/lib/components/feedback.d.ts +0 -11
- package/lib/components/feedback.js +0 -84
- package/lib/components/guide-list.d.ts +0 -46
- package/lib/components/guide-list.js +0 -202
- package/lib/components/index.js +0 -28
- package/lib/components/loader.js +0 -50
- package/lib/components/metadata.d.ts +0 -17
- package/lib/components/metadata.js +0 -35
- package/lib/hooks/index.js +0 -14
- package/lib/hooks/use-arrow-keys.d.ts +0 -3
- package/lib/hooks/use-arrow-keys.js +0 -48
- package/lib/hooks/use-debounce.d.ts +0 -2
- package/lib/hooks/use-debounce.js +0 -41
- package/lib/hooks/use-favorites.js +0 -81
- package/lib/hooks/use-hover.d.ts +0 -2
- package/lib/hooks/use-hover.js +0 -29
- package/lib/index.js +0 -44
- package/lib/missing-type-exports.d.ts +0 -47
- package/lib/missing-type-exports.js +0 -3
- package/lib/styles.d.ts +0 -7
- package/lib/styles.js +0 -50
- package/lib/utils/embedded-link-mapper.d.ts +0 -3
- package/lib/utils/embedded-link-mapper.js +0 -62
- package/lib/utils/guide-render-instructions.d.ts +0 -9
- package/lib/utils/guide-render-instructions.js +0 -56
- package/lib/utils/index.js +0 -8
- package/lib-esm/components/dialog-link.js +0 -35
- package/lib-esm/components/dialog-list.d.ts +0 -7
- package/lib-esm/components/dialog-list.js +0 -44
- package/lib-esm/components/drawer-list.js +0 -38
- package/lib-esm/components/dropdown-actions.d.ts +0 -11
- package/lib-esm/components/dropdown-actions.js +0 -20
- package/lib-esm/components/dropdown-list.d.ts +0 -5
- package/lib-esm/components/dropdown-list.js +0 -38
- package/lib-esm/components/favorite-button.d.ts +0 -17
- package/lib-esm/components/favorite-button.js +0 -40
- package/lib-esm/components/feedback.js +0 -59
- package/lib-esm/components/guide-list.js +0 -173
- package/lib-esm/components/index.d.ts +0 -10
- package/lib-esm/components/index.js +0 -10
- package/lib-esm/components/loader.d.ts +0 -9
- package/lib-esm/components/loader.js +0 -21
- package/lib-esm/components/metadata.js +0 -30
- package/lib-esm/hooks/index.d.ts +0 -5
- package/lib-esm/hooks/index.js +0 -4
- package/lib-esm/hooks/use-arrow-keys.js +0 -46
- package/lib-esm/hooks/use-debounce.js +0 -39
- package/lib-esm/hooks/use-favorites.d.ts +0 -8
- package/lib-esm/hooks/use-favorites.js +0 -79
- package/lib-esm/hooks/use-hover.js +0 -27
- package/lib-esm/index.d.ts +0 -7
- package/lib-esm/index.js +0 -6
- package/lib-esm/missing-type-exports.js +0 -2
- package/lib-esm/styles.js +0 -24
- package/lib-esm/utils/embedded-link-mapper.js +0 -57
- package/lib-esm/utils/guide-render-instructions.js +0 -51
- package/lib-esm/utils/index.d.ts +0 -1
- package/lib-esm/utils/index.js +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { invertedHoverButton, List, list } from '@telia-ace/widget-ui';
|
|
28
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
29
|
-
import React, { forwardRef } from 'react';
|
|
30
|
-
import styled from 'styled-components';
|
|
31
|
-
import DialogLink from './dialog-link';
|
|
32
|
-
export default forwardRef(function (_a, ref) {
|
|
33
|
-
var className = _a.className, dialog = _a.dialog, other = __rest(_a, ["className", "dialog"]);
|
|
34
|
-
return !!dialog.length ? (React.createElement(StyledList, __assign({ className: appendClassNames(className, 'humany-dialog'), items: dialog, renderItem: function (item) { return (React.createElement("li", { key: item.connection, "data-dialog": item.connection },
|
|
35
|
-
React.createElement(DialogLink, __assign({}, item)))); } }, other, { ref: ref }))) : null;
|
|
36
|
-
});
|
|
37
|
-
var StyledList = styled(List)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n a {\n min-width: 150px;\n max-width: 400px;\n display: block;\n white-space: normal;\n ", "\n }\n\n i {\n margin: 0 ", " 0 0;\n }\n"], ["\n ", "\n a {\n min-width: 150px;\n max-width: 400px;\n display: block;\n white-space: normal;\n ", "\n }\n\n i {\n margin: 0 ", " 0 0;\n }\n"])), list, function (p) {
|
|
38
|
-
var _a;
|
|
39
|
-
return invertedHoverButton({
|
|
40
|
-
primaryColor: (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary,
|
|
41
|
-
secondaryColor: '#FFFFFF',
|
|
42
|
-
});
|
|
43
|
-
}, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
44
|
-
var templateObject_1;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { Drawer, ItemList, itemList } from '@telia-ace/widget-ui';
|
|
28
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
29
|
-
import React from 'react';
|
|
30
|
-
import styled from 'styled-components';
|
|
31
|
-
var DrawerList = function (_a) {
|
|
32
|
-
var trigger = _a.trigger, header = _a.header, className = _a.className, animation = _a.animation, fullScreen = _a.fullScreen, onToggle = _a.onToggle, children = _a.children, ref = _a.ref, closeButtonAriaLabel = _a.closeButtonAriaLabel, other = __rest(_a, ["trigger", "header", "className", "animation", "fullScreen", "onToggle", "children", "ref", "closeButtonAriaLabel"]);
|
|
33
|
-
return (React.createElement(Drawer, { className: appendClassNames(className, 'humany-drawer-list'), trigger: trigger, header: header, animation: animation, fullScreen: fullScreen, onToggle: onToggle, closeButtonAriaLabel: closeButtonAriaLabel },
|
|
34
|
-
React.createElement(StyledItemList, __assign({}, other), children)));
|
|
35
|
-
};
|
|
36
|
-
export default DrawerList;
|
|
37
|
-
var StyledItemList = styled(ItemList)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n font-family: ", ";\n padding: ", ";\n > ul > li {\n overflow: visible;\n font-weight: 300;\n font-size: ", ";\n }\n"], ["\n ", "\n font-family: ", ";\n padding: ", ";\n > ul > li {\n overflow: visible;\n font-weight: 300;\n font-size: ", ";\n }\n"])), itemList, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
38
|
-
var templateObject_1;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ItemRenderer } from '@telia-ace/widget-ui';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
trigger: React.ReactElement;
|
|
5
|
-
header?: React.ReactElement;
|
|
6
|
-
items?: any[];
|
|
7
|
-
renderItem?: ItemRenderer;
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
declare const DropdownActions: React.FC<Props>;
|
|
11
|
-
export default DropdownActions;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { Dropdown, List } from '@telia-ace/widget-ui';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
var DropdownActions = function (_a) {
|
|
9
|
-
var items = _a.items, renderItem = _a.renderItem, trigger = _a.trigger, header = _a.header, children = _a.children;
|
|
10
|
-
return (React.createElement(Dropdown, { className: "humany-dropdown-actions", trigger: trigger },
|
|
11
|
-
React.createElement(Wrapper, null,
|
|
12
|
-
!!header && React.createElement(Header, null, header),
|
|
13
|
-
items && renderItem && (React.createElement(StyledList, { items: items, renderItem: renderItem })),
|
|
14
|
-
children)));
|
|
15
|
-
};
|
|
16
|
-
export default DropdownActions;
|
|
17
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: #fff;\n border: #ccc 1px solid;\n box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n font-family: ", ";\n font-size: ", ";\n"], ["\n background: #fff;\n border: #ccc 1px solid;\n box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n font-family: ", ";\n font-size: ", ";\n"])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
18
|
-
var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: 0;\n font-size: ", ";\n font-weight: normal;\n white-space: nowrap;\n display: flex;\n align-items: center;\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: 0;\n font-weight: normal;\n padding-bottom: 0;\n }\n\n svg,\n i {\n margin-right: ", ";\n }\n"], ["\n padding: ", ";\n padding-bottom: 0;\n font-size: ", ";\n font-weight: normal;\n white-space: nowrap;\n display: flex;\n align-items: center;\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: 0;\n font-weight: normal;\n padding-bottom: 0;\n }\n\n svg,\n i {\n margin-right: ", ";\n }\n"])), function (p) { return p.theme.sizes.normal; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { return p.theme.sizes.small; });
|
|
19
|
-
var StyledList = styled(List)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n padding: ", " 0;\n\n li {\n background: #fff;\n\n a {\n display: block;\n font-size: ", ";\n padding: ", ";\n cursor: pointer;\n color: #555;\n text-decoration: none;\n\n &:hover {\n background: #f9f9f9;\n color: ", ";\n }\n }\n }\n"], ["\n list-style: none;\n padding: 0;\n margin: 0;\n padding: ", " 0;\n\n li {\n background: #fff;\n\n a {\n display: block;\n font-size: ", ";\n padding: ", ";\n cursor: pointer;\n color: #555;\n text-decoration: none;\n\n &:hover {\n background: #f9f9f9;\n color: ", ";\n }\n }\n }\n"])), function (p) { return p.theme.sizes.small; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a, _b; return "".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " ").concat((_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.normal); }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; });
|
|
20
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { Dropdown, headingElement, ItemList, itemList } from '@telia-ace/widget-ui';
|
|
28
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
29
|
-
import React from 'react';
|
|
30
|
-
import styled, { css } from 'styled-components';
|
|
31
|
-
var DropdownList = function (_a) {
|
|
32
|
-
var trigger = _a.trigger, className = _a.className, children = _a.children, closeButtonAriaLabel = _a.closeButtonAriaLabel, other = __rest(_a, ["trigger", "className", "children", "closeButtonAriaLabel"]);
|
|
33
|
-
return (React.createElement(Dropdown, { className: appendClassNames(className, 'humany-dropdown-list'), closeButtonAriaLabel: closeButtonAriaLabel, trigger: trigger },
|
|
34
|
-
React.createElement(StyledItemList, __assign({}, other), children)));
|
|
35
|
-
};
|
|
36
|
-
export default DropdownList;
|
|
37
|
-
var StyledItemList = styled(ItemList)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n font-family: ", ";\n > div {\n ", "\n }\n > ul > li {\n overflow: visible;\n font-weight: 300;\n font-size: ", ";\n\n a {\n display: inline-block;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n }\n }\n"], ["\n ", "\n font-family: ", ";\n > div {\n ", "\n }\n > ul > li {\n overflow: visible;\n font-weight: 300;\n font-size: ", ";\n\n a {\n display: inline-block;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n }\n }\n"])), itemList, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, headingElement('> h1', css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n line-height: 1.2em;\n "], ["\n font-size: ", ";\n line-height: 1.2em;\n "])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; })), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
38
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FavoriteActions } from '../hooks';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
isFavorite: boolean;
|
|
5
|
-
actions: FavoriteActions;
|
|
6
|
-
id: string;
|
|
7
|
-
addFavoriteTooltip?: string;
|
|
8
|
-
removeFavoriteCancelLabel?: string;
|
|
9
|
-
removeFavoriteConfirmLabel?: string;
|
|
10
|
-
removeFavoriteHeader?: string;
|
|
11
|
-
removeFavoriteLabel?: string;
|
|
12
|
-
removeFavoriteTooltip?: string;
|
|
13
|
-
buttonLabel?: string;
|
|
14
|
-
guideTitle?: string;
|
|
15
|
-
};
|
|
16
|
-
declare const FavoriteButton: React.FC<Props>;
|
|
17
|
-
export default FavoriteButton;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { Confirm, StyledText, SymbolBadge } from '@telia-ace/widget-ui';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
7
|
-
import styled, { css } from 'styled-components';
|
|
8
|
-
import { StyledListButton } from '../styles';
|
|
9
|
-
var FavoriteButton = function (_a) {
|
|
10
|
-
var addFavoriteTooltip = _a.addFavoriteTooltip, removeFavoriteCancelLabel = _a.removeFavoriteCancelLabel, removeFavoriteConfirmLabel = _a.removeFavoriteConfirmLabel, removeFavoriteHeader = _a.removeFavoriteHeader, removeFavoriteLabel = _a.removeFavoriteLabel, removeFavoriteTooltip = _a.removeFavoriteTooltip, id = _a.id, isFavorite = _a.isFavorite, guideTitle = _a.guideTitle, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? '' : _b, _c = _a.actions, addFavorite = _c.addFavorite, removeFavorite = _c.removeFavorite;
|
|
11
|
-
var remove = useCallback(function () {
|
|
12
|
-
removeFavorite(id);
|
|
13
|
-
}, [id, removeFavorite]);
|
|
14
|
-
var add = useCallback(function () {
|
|
15
|
-
addFavorite(id);
|
|
16
|
-
}, [id, addFavorite]);
|
|
17
|
-
var tooltip = "".concat(isFavorite ? removeFavoriteTooltip : addFavoriteTooltip).concat(guideTitle ? ": \"".concat(guideTitle, "\"") : '');
|
|
18
|
-
return (React.createElement(React.Fragment, null, isFavorite ? (React.createElement(Confirm, { trigger: React.createElement(StyledButton, { className: "humany-favorite-button", title: tooltip, "aria-label": tooltip, "data-favorite": "true", "data-has-label": buttonLabel ? 'true' : 'false', "data-has-symbol": "true" },
|
|
19
|
-
React.createElement(SymbolBadge, { size: 16, symbol: { type: 'Svg', content: 'star-empty' } }),
|
|
20
|
-
buttonLabel && React.createElement(StyledText, null, buttonLabel)), onConfirm: remove, cancelLabel: removeFavoriteCancelLabel, confirmLabel: removeFavoriteConfirmLabel, header: removeFavoriteHeader, text: removeFavoriteLabel })) : (React.createElement(StyledButton, { className: "humany-favorite-button", title: tooltip, "aria-label": tooltip, onClick: add, "data-favorite": "false", "data-has-label": buttonLabel ? 'true' : 'false', "data-has-symbol": "true" },
|
|
21
|
-
React.createElement(SymbolBadge, { size: 16, symbol: { type: 'Svg', content: 'star-empty' } }),
|
|
22
|
-
buttonLabel && React.createElement(StyledText, null, buttonLabel)))));
|
|
23
|
-
};
|
|
24
|
-
export default FavoriteButton;
|
|
25
|
-
var StyledButton = styled(StyledListButton)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n grid-area: favorite;\n\n &:focus {\n ", ";\n }\n\n ", "\n"], ["\n grid-area: favorite;\n\n &:focus {\n ", ";\n }\n\n ", "\n"])), function (p) {
|
|
26
|
-
var _a;
|
|
27
|
-
return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n svg {\n ", "\n }\n "], ["\n svg {\n ", "\n }\n "])), function (p) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
return p['data-favorite'] === 'true'
|
|
30
|
-
? "\n fill: transparent;\n\n path {\n fill: transparent;\n }\n "
|
|
31
|
-
: "\n fill: ".concat((_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text, ";\n\n path {\n fill: ").concat((_b = p.theme.colors) === null || _b === void 0 ? void 0 : _b.text, ";\n }\n ");
|
|
32
|
-
});
|
|
33
|
-
}, function (p) {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
35
|
-
return ((_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text) && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n svg {\n stroke: ", ";\n\n path {\n stroke: ", ";\n }\n\n ", "\n }\n\n &:hover {\n svg {\n ", "\n }\n }\n "], ["\n svg {\n stroke: ", ";\n\n path {\n stroke: ", ";\n }\n\n ", "\n }\n\n &:hover {\n svg {\n ", "\n }\n }\n "])), (_b = p.theme.colors) === null || _b === void 0 ? void 0 : _b.text, (_c = p.theme.colors) === null || _c === void 0 ? void 0 : _c.text, p['data-favorite'] === 'true' &&
|
|
36
|
-
"\n fill: ".concat((_d = p.theme.colors) === null || _d === void 0 ? void 0 : _d.text, ";\n\n path {\n fill: ").concat((_e = p.theme.colors) === null || _e === void 0 ? void 0 : _e.text, ";\n }\n "), p['data-favorite'] === 'true'
|
|
37
|
-
? "\n fill: transparent;\n\n path {\n fill: transparent;\n }\n "
|
|
38
|
-
: "\n fill: ".concat((_f = p.theme.colors) === null || _f === void 0 ? void 0 : _f.text, ";\n\n path {\n fill: ").concat((_g = p.theme.colors) === null || _g === void 0 ? void 0 : _g.text, ";\n }\n "));
|
|
39
|
-
});
|
|
40
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { Button, convertToStringAttributes, Icon, invertedHoverButton, StyledText, } from '@telia-ace/widget-ui';
|
|
28
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
29
|
-
import React, { forwardRef } from 'react';
|
|
30
|
-
import styled, { css } from 'styled-components';
|
|
31
|
-
export default forwardRef(function (_a, ref) {
|
|
32
|
-
var _b = _a.onFeedback, onFeedback = _b === void 0 ? function () { } : _b, _c = _a.direction, direction = _c === void 0 ? 'horizontal' : _c, className = _a.className, header = _a.header, positive = _a.positive, negative = _a.negative, selected = _a.selected, other = __rest(_a, ["onFeedback", "direction", "className", "header", "positive", "negative", "selected"]);
|
|
33
|
-
return (React.createElement(Wrapper, __assign({ className: appendClassNames(className, 'humany-feedback'), "data-direction": direction }, convertToStringAttributes(other), { ref: ref }),
|
|
34
|
-
!!header && React.createElement(Header, null, header),
|
|
35
|
-
React.createElement(FeedbackButton, { className: "humany-feedback-button", disabled: !!selected, "aria-pressed": selected === 'positive', "data-selected": selected === 'positive', "data-direction": direction, onClick: function () { return onFeedback('positive'); } },
|
|
36
|
-
React.createElement(Icon, { faIcon: "smile-o" }),
|
|
37
|
-
React.createElement("span", null, positive)),
|
|
38
|
-
React.createElement(FeedbackButton, { className: "humany-feedback-button", disabled: !!selected, "aria-pressed": selected === 'negative', "data-selected": selected === 'negative', "data-direction": direction, onClick: function () { return onFeedback('negative'); } },
|
|
39
|
-
React.createElement(Icon, { faIcon: "frown-o" }),
|
|
40
|
-
React.createElement("span", null, negative))));
|
|
41
|
-
});
|
|
42
|
-
var Header = styled(StyledText)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-weight: normal;\n margin: 0 0 ", ";\n font-size: ", ";\n display: block;\n"], ["\n font-weight: normal;\n margin: 0 0 ", ";\n font-size: ", ";\n display: block;\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
43
|
-
var FeedbackButton = styled(Button)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n font-size: ", ";\n font-weight: 300;\n && {\n margin-right: ", ";\n }\n\n ", "\n\n ", "\n\n ", "\n\n i {\n margin: 0 ", " 0 0;\n }\n"], ["\n display: inline-block;\n font-size: ", ";\n font-weight: 300;\n && {\n margin-right: ", ";\n }\n\n ", "\n\n ", "\n\n ", "\n\n i {\n margin: 0 ", " 0 0;\n }\n"])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.large; }, function (p) {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
return p['data-direction'] === 'horizontal' && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 225px;\n max-width: calc(50% - ", " - ", ");\n "], ["\n width: 225px;\n max-width: calc(50% - ", " - ", ");\n "])), (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.large, (_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.small);
|
|
46
|
-
}, function (p) {
|
|
47
|
-
return p['data-direction'] === 'vertical' && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n min-width: 190px;\n "], ["\n min-width: 190px;\n "])));
|
|
48
|
-
}, function (p) {
|
|
49
|
-
var _a;
|
|
50
|
-
return invertedHoverButton({
|
|
51
|
-
active: p['data-selected'],
|
|
52
|
-
primaryColor: (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary,
|
|
53
|
-
secondaryColor: '#FFFFFF',
|
|
54
|
-
});
|
|
55
|
-
}, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
56
|
-
var Wrapper = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
57
|
-
return p['data-direction'] === 'vertical' && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n > button {\n width: 100%;\n &:not(:last-child) {\n margin-bottom: ", ";\n }\n }\n "], ["\n > button {\n width: 100%;\n &:not(:last-child) {\n margin-bottom: ", ";\n }\n }\n "])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
58
|
-
});
|
|
59
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
28
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
29
|
-
if (!m) return o;
|
|
30
|
-
var i = m.call(o), r, ar = [], e;
|
|
31
|
-
try {
|
|
32
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
33
|
-
}
|
|
34
|
-
catch (error) { e = { error: error }; }
|
|
35
|
-
finally {
|
|
36
|
-
try {
|
|
37
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38
|
-
}
|
|
39
|
-
finally { if (e) throw e.error; }
|
|
40
|
-
}
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
import { borderTabStyle, convertToStringAttributes, headingElement, ItemList, itemList, List, list, SymbolBadge, TextLink, usePrevious, useRouteData, } from '@telia-ace/widget-ui';
|
|
44
|
-
import { appendClassNames, createParams, htmlParentContains, } from '@telia-ace/widget-utilities';
|
|
45
|
-
import React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
46
|
-
import styled, { css, ThemeContext } from 'styled-components';
|
|
47
|
-
import { useFavorites } from '../hooks';
|
|
48
|
-
import FavoriteButton from './favorite-button';
|
|
49
|
-
import Metadata from './metadata';
|
|
50
|
-
var Tags = function (_a) {
|
|
51
|
-
var tags = _a.tags;
|
|
52
|
-
if (!tags.filter(function (t) { return t.symbol; }).length) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
return (React.createElement(StyledTagList, { className: "humany-guide-list-tags", items: tags, renderItem: function (_a) {
|
|
56
|
-
var id = _a.id, symbol = _a.symbol, title = _a.title;
|
|
57
|
-
return symbol && (React.createElement("li", { key: id, "data-tag": id },
|
|
58
|
-
React.createElement(StyledTagIcon, { size: 18, symbol: symbol, title: title })));
|
|
59
|
-
} }));
|
|
60
|
-
};
|
|
61
|
-
export var AccordionListItem = forwardRef(function (_a, ref) {
|
|
62
|
-
var title = _a.title, id = _a.id, route = _a.route, symbolSize = _a.symbolSize, collapseUri = _a.collapseUri, children = _a.children;
|
|
63
|
-
var params = useRouteData().params;
|
|
64
|
-
return (React.createElement(ActiveAccordionListItem, { ref: ref, "data-guide": id },
|
|
65
|
-
React.createElement(TextLink, { title: title, "aria-label": title, routeName: route, params: createParams(__assign(__assign({}, params), { uriName: collapseUri ? collapseUri : undefined, id: undefined, guide: undefined, accordion: undefined })), text: title },
|
|
66
|
-
React.createElement(SymbolBadge, { size: symbolSize, symbol: { type: 'Svg', content: 'caret-up' } })),
|
|
67
|
-
children));
|
|
68
|
-
});
|
|
69
|
-
var ActiveAccordionListItem = styled.li(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > a { \n grid-column: 1 / -1\n font-weight: bold;\n margin: 0 0 ", " 0;\n }\n\n > div {\n grid-column: 1 / -1\n }\n"], ["\n > a { \n grid-column: 1 / -1\n font-weight: bold;\n margin: 0 0 ", " 0;\n }\n\n > div {\n grid-column: 1 / -1\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
70
|
-
export default forwardRef(function (_a, ref) {
|
|
71
|
-
var _b = _a.expandable, expandable = _b === void 0 ? false : _b, _c = _a.routing, routing = _c === void 0 ? {} : _c, _d = _a.paramMappers, paramMappers = _d === void 0 ? {} : _d, _e = _a.symbolSize, symbolSize = _e === void 0 ? 11 : _e, _f = _a.pageRole, pageRole = _f === void 0 ? 'link' : _f, _g = _a.pageCaret, pageCaret = _g === void 0 ? 'down' : _g, _h = _a.showTags, showTags = _h === void 0 ? false : _h, _j = _a.showFavoriteToggle, showFavoriteToggle = _j === void 0 ? false : _j, _k = _a.localPaging, localPaging = _k === void 0 ? false : _k, _l = _a.onItemClick, onItemClick = _l === void 0 ? function () { } : _l, _m = _a.dispatch, dispatch = _m === void 0 ? function () { } : _m, _o = _a.metadata, metadata = _o === void 0 ? {} : _o, pageLabel = _a.pageLabel, className = _a.className, children = _a.children, items = _a.items, renderItem = _a.renderItem, addFavoriteTooltip = _a.addFavoriteTooltip, removeFavoriteCancelLabel = _a.removeFavoriteCancelLabel, removeFavoriteConfirmLabel = _a.removeFavoriteConfirmLabel, removeFavoriteHeader = _a.removeFavoriteHeader, removeFavoriteLabel = _a.removeFavoriteLabel, removeFavoriteTooltip = _a.removeFavoriteTooltip, other = __rest(_a, ["expandable", "routing", "paramMappers", "symbolSize", "pageRole", "pageCaret", "showTags", "showFavoriteToggle", "localPaging", "onItemClick", "dispatch", "metadata", "pageLabel", "className", "children", "items", "renderItem", "addFavoriteTooltip", "removeFavoriteCancelLabel", "removeFavoriteConfirmLabel", "removeFavoriteHeader", "removeFavoriteLabel", "removeFavoriteTooltip"]);
|
|
72
|
-
var _p = useContext(ThemeContext).accessibility.isTabbing, isTabbing = _p === void 0 ? false : _p;
|
|
73
|
-
var innerRef = useRef();
|
|
74
|
-
var prevItems = usePrevious(items);
|
|
75
|
-
var _q = routing.guide, guideRoute = _q === void 0 ? 'guide' : _q, _r = routing.page, pageRoute = _r === void 0 ? 'index' : _r;
|
|
76
|
-
var _s = paramMappers.guide, mapGuideParams = _s === void 0 ? function (_a) {
|
|
77
|
-
var id = _a.id;
|
|
78
|
-
return createParams({ guide: id });
|
|
79
|
-
} : _s, _t = paramMappers.page, mapPageParams = _t === void 0 ? function () { return createParams(); } : _t;
|
|
80
|
-
var _u = __read(useFavorites(), 2), favorites = _u[0], actions = _u[1];
|
|
81
|
-
useImperativeHandle(ref, function () { return innerRef.current; });
|
|
82
|
-
var defaultRenderer = function (guide) {
|
|
83
|
-
var id = guide.id, title = guide.title, tags = guide.tags, published = guide.published, modified = guide.modified, publishedBy = guide.publishedBy, modifiedBy = guide.modifiedBy;
|
|
84
|
-
return (React.createElement("li", { key: id, "data-guide": id, "has-metadata": ((!!(metadata === null || metadata === void 0 ? void 0 : metadata.showPublished) && !!published) ||
|
|
85
|
-
(!!(metadata === null || metadata === void 0 ? void 0 : metadata.showModified) && !!modified)).toString() },
|
|
86
|
-
React.createElement(TextLink, { className: "humany-guide-link", title: title, "aria-label": title, routeName: guideRoute, onClick: function (e) { return onItemClick(e, guide); }, params: mapGuideParams(guide), text: title },
|
|
87
|
-
React.createElement(SymbolBadge, { size: symbolSize, symbol: {
|
|
88
|
-
type: 'Svg',
|
|
89
|
-
content: expandable ? 'caret-down' : 'caret-right',
|
|
90
|
-
} })),
|
|
91
|
-
showFavoriteToggle && (React.createElement(FavoriteButton, { guideTitle: title, addFavoriteTooltip: addFavoriteTooltip, removeFavoriteCancelLabel: removeFavoriteCancelLabel, removeFavoriteConfirmLabel: removeFavoriteConfirmLabel, removeFavoriteHeader: removeFavoriteHeader, removeFavoriteLabel: removeFavoriteLabel, removeFavoriteTooltip: removeFavoriteTooltip, isFavorite: favorites.indexOf(id) > -1, actions: actions, id: id })),
|
|
92
|
-
showTags && React.createElement(Tags, { tags: tags }),
|
|
93
|
-
React.createElement(StyledMetadata, __assign({}, metadata, { indent: expandable ? undefined : symbolSize, modified: modified, published: published, publishedBy: publishedBy, modifiedBy: modifiedBy }))));
|
|
94
|
-
};
|
|
95
|
-
var renderer = useCallback(function (guide, index, items) {
|
|
96
|
-
if (renderItem) {
|
|
97
|
-
return renderItem(guide, index, items, defaultRenderer);
|
|
98
|
-
}
|
|
99
|
-
return defaultRenderer(guide, index, items);
|
|
100
|
-
}, [renderItem, defaultRenderer]);
|
|
101
|
-
var onPageClick = useCallback(function (e) {
|
|
102
|
-
if (localPaging) {
|
|
103
|
-
e.preventDefault();
|
|
104
|
-
dispatch('page', mapPageParams());
|
|
105
|
-
}
|
|
106
|
-
}, [dispatch, localPaging]);
|
|
107
|
-
useEffect(function () {
|
|
108
|
-
if (isTabbing && prevItems && prevItems.length < items.length && innerRef.current) {
|
|
109
|
-
var elements = innerRef.current.querySelectorAll('.humany-guide-list > ul > li');
|
|
110
|
-
var listItemElem = elements[prevItems.length];
|
|
111
|
-
if (elements.length === items.length && prevItems.length) {
|
|
112
|
-
var nextListItem = elements[prevItems.length];
|
|
113
|
-
if (nextListItem) {
|
|
114
|
-
var focusNext = nextListItem.querySelector('.humany-guide-link');
|
|
115
|
-
focusNext && focusNext.focus();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else if (listItemElem) {
|
|
119
|
-
var observer = new MutationObserver(function (mutations, observer) {
|
|
120
|
-
mutations.forEach(function (mutation) {
|
|
121
|
-
if (mutation.addedNodes) {
|
|
122
|
-
var found = Array.from(mutation.addedNodes).find(function (node) { return node.tagName === 'A'; });
|
|
123
|
-
if (found &&
|
|
124
|
-
htmlParentContains(innerRef.current, document.activeElement)) {
|
|
125
|
-
isTabbing && found.focus();
|
|
126
|
-
observer.disconnect();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
observer.observe(listItemElem, {
|
|
132
|
-
attributes: false,
|
|
133
|
-
characterData: false,
|
|
134
|
-
childList: true,
|
|
135
|
-
subtree: true,
|
|
136
|
-
attributeOldValue: false,
|
|
137
|
-
characterDataOldValue: false,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
var hasMetaData = !!Object.keys(metadata).filter(function (k) { return typeof metadata[k] !== 'undefined'; }).length;
|
|
143
|
-
return (React.createElement(StyledItemList, __assign({ className: appendClassNames(className, 'humany-guide-list'), "data-item-count": items.length, items: items, renderItem: renderer, expandable: expandable ? 'true' : 'false', "grid-items": showTags || showFavoriteToggle || hasMetaData ? 'true' : 'false' }, convertToStringAttributes(other), { ref: innerRef }),
|
|
144
|
-
pageLabel ? (React.createElement(TextLink, { text: pageLabel, title: pageLabel, "aria-label": pageLabel, routeName: pageRoute, role: pageRole, params: mapPageParams(), onClick: onPageClick },
|
|
145
|
-
React.createElement(SymbolBadge, { size: symbolSize, symbol: { type: 'Svg', content: "caret-".concat(pageCaret) } }))) : null,
|
|
146
|
-
children));
|
|
147
|
-
});
|
|
148
|
-
var StyledItemList = styled(ItemList)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n padding: ", ";\n overflow: auto;\n justify-content: flex-start;\n white-space: nowrap;\n font-weight: 300;\n text-decoration: none;\n\n > div {\n ", "\n }\n\n > ul > li {\n ", "\n > a {\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n display: inline-block;\n\n svg {\n margin: 0 calc(", "*2) 0 0;\n line {\n stroke: ", ";\n }\n }\n\n ", "\n\n &:focus {\n ", ";\n }\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n }\n }\n\n > a {\n color: ", ";\n margin: ", " 0 0;\n align-self: flex-start;\n align-items: center;\n display: flex;\n\n span {\n text-decoration: underline;\n }\n\n svg {\n margin: 0 calc(", "*2) 0 0;\n line {\n stroke: ", ";\n }\n }\n\n &:focus {\n ", ";\n }\n }\n"], ["\n ", "\n padding: ", ";\n overflow: auto;\n justify-content: flex-start;\n white-space: nowrap;\n font-weight: 300;\n text-decoration: none;\n\n > div {\n ", "\n }\n\n > ul > li {\n ", "\n > a {\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n display: inline-block;\n\n svg {\n margin: 0 calc(", "*2) 0 0;\n line {\n stroke: ", ";\n }\n }\n\n ", "\n\n &:focus {\n ", ";\n }\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n }\n }\n\n > a {\n color: ", ";\n margin: ", " 0 0;\n align-self: flex-start;\n align-items: center;\n display: flex;\n\n span {\n text-decoration: underline;\n }\n\n svg {\n margin: 0 calc(", "*2) 0 0;\n line {\n stroke: ", ";\n }\n }\n\n &:focus {\n ", ";\n }\n }\n"])), itemList, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.large; }, headingElement('> h1', css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n white-space: pre-wrap;\n "], ["\n white-space: pre-wrap;\n "])))), function (p) {
|
|
149
|
-
return p['grid-items'] === 'true' && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto 1fr 1fr;\n gap: 0px 0px;\n grid-template-areas: '. favorite tags';\n align-items: center;\n\n > button {\n margin: 0 0 0 ", ";\n\n &[data-favorite='false'] {\n ", ";\n &:focus {\n opacity: 1;\n }\n }\n }\n\n > span {\n font-size: ", ";\n }\n\n &:hover {\n button[data-favorite='false'] {\n display: flex;\n justify-self: flex-start;\n }\n }\n\n &[has-metadata='true'] {\n grid-template-rows: 1fr 1fr;\n grid-template-areas:\n '. favorite tags'\n 'metadata metadata metadata';\n }\n "], ["\n display: grid;\n grid-template-columns: auto 1fr 1fr;\n gap: 0px 0px;\n grid-template-areas: '. favorite tags';\n align-items: center;\n\n > button {\n margin: 0 0 0 ", ";\n\n &[data-favorite='false'] {\n ", ";\n &:focus {\n opacity: 1;\n }\n }\n }\n\n > span {\n font-size: ", ";\n }\n\n &:hover {\n button[data-favorite='false'] {\n display: flex;\n justify-self: flex-start;\n }\n }\n\n &[has-metadata='true'] {\n grid-template-rows: 1fr 1fr;\n grid-template-areas:\n '. favorite tags'\n 'metadata metadata metadata';\n }\n "])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) ? 'opacity: 0;' : 'display: none;'; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.small; });
|
|
150
|
-
}, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) {
|
|
151
|
-
return p.expandable === 'true' && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n align-items: center;\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n svg {\n margin: 0 0 0 ", ";\n }\n "], ["\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n align-items: center;\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n svg {\n margin: 0 0 0 ", ";\n }\n "])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
152
|
-
}, function (p) {
|
|
153
|
-
var _a;
|
|
154
|
-
return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n text-decoration: underline;\n "], ["\n ", "\n text-decoration: underline;\n "])), borderTabStyle);
|
|
155
|
-
}, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) {
|
|
156
|
-
var _a;
|
|
157
|
-
return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n text-decoration: underline;\n "], ["\n ", "\n text-decoration: underline;\n "])), borderTabStyle);
|
|
158
|
-
});
|
|
159
|
-
var StyledTagList = styled(List)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n display: flex;\n margin: 0 0 0 auto;\n grid-area: tags;\n\n li,\n li:last-child {\n margin: 0 0 0 ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n"], ["\n ", "\n display: flex;\n margin: 0 0 0 auto;\n grid-area: tags;\n\n li,\n li:last-child {\n margin: 0 0 0 ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n"])), list, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
160
|
-
var StyledTagIcon = styled(SymbolBadge)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: block;\n color: ", ";\n ", "\n"], ["\n display: block;\n color: ", ";\n ", "\n"])), function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) {
|
|
161
|
-
if (p.symbol.type === 'Uri') {
|
|
162
|
-
return "\n width: ".concat(p.size, "px;\n height: ").concat(p.size, "px;\n ");
|
|
163
|
-
}
|
|
164
|
-
if (p.symbol.type === 'FontAwesome') {
|
|
165
|
-
return "\n font-size: ".concat(p.size, "px;\n ");
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
var StyledMetadata = styled(Metadata)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n grid-area: metadata;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ", ";\n ", "\n"], ["\n grid-area: metadata;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ", ";\n ", "\n"])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.small; }, function (p) {
|
|
169
|
-
var _a;
|
|
170
|
-
return typeof p.indent === 'number' &&
|
|
171
|
-
"text-indent: calc(".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " * 2 + ").concat(p.indent, "px);");
|
|
172
|
-
});
|
|
173
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as DialogLink } from './dialog-link';
|
|
2
|
-
export { default as DialogList } from './dialog-list';
|
|
3
|
-
export { default as DrawerList } from './drawer-list';
|
|
4
|
-
export { default as DropdownActions } from './dropdown-actions';
|
|
5
|
-
export { default as DropdownList } from './dropdown-list';
|
|
6
|
-
export { default as FavoriteButton } from './favorite-button';
|
|
7
|
-
export { default as Feedback } from './feedback';
|
|
8
|
-
export { AccordionListItem, default as GuideList } from './guide-list';
|
|
9
|
-
export { default as Loader, Wrapper as LoaderWrapper } from './loader';
|
|
10
|
-
export { default as Metadata } from './metadata';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as DialogLink } from './dialog-link';
|
|
2
|
-
export { default as DialogList } from './dialog-list';
|
|
3
|
-
export { default as DrawerList } from './drawer-list';
|
|
4
|
-
export { default as DropdownActions } from './dropdown-actions';
|
|
5
|
-
export { default as DropdownList } from './dropdown-list';
|
|
6
|
-
export { default as FavoriteButton } from './favorite-button';
|
|
7
|
-
export { default as Feedback } from './feedback';
|
|
8
|
-
export { AccordionListItem, default as GuideList } from './guide-list';
|
|
9
|
-
export { default as Loader, Wrapper as LoaderWrapper } from './loader';
|
|
10
|
-
export { default as Metadata } from './metadata';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type Props = {
|
|
3
|
-
loading: boolean | undefined;
|
|
4
|
-
};
|
|
5
|
-
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
|
|
6
|
-
'data-loading': boolean;
|
|
7
|
-
}, never>;
|
|
8
|
-
declare const Loader: React.SFC<Props>;
|
|
9
|
-
export default Loader;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled, { keyframes } from 'styled-components';
|
|
7
|
-
var spin = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 100% {\n transform: rotate(360deg);\n }\n"], ["\n 100% {\n transform: rotate(360deg);\n }\n"])));
|
|
8
|
-
var dash = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35px;\n }\n 100% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -124px;\n }\n"], ["\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35px;\n }\n 100% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -124px;\n }\n"])));
|
|
9
|
-
var SpinnerSvg = styled.svg(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n animation: ", " 2s linear infinite;\n height: 100%;\n transform-origin: center center;\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n transition: 200ms ease-out opacity;\n"], ["\n animation: ", " 2s linear infinite;\n height: 100%;\n transform-origin: center center;\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n transition: 200ms ease-out opacity;\n"])), spin);
|
|
10
|
-
export var Wrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n width: 100%;\n pointer-events: ", "\n display: flex;\n flex-direction: column;\n justify-content: center;\n transition: 200ms ease-out opacity;\n box-sizing: border-box;\n overflow: hidden;\n ", " {\n opacity: ", "\n }\n"], ["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n width: 100%;\n pointer-events: ", "\n display: flex;\n flex-direction: column;\n justify-content: center;\n transition: 200ms ease-out opacity;\n box-sizing: border-box;\n overflow: hidden;\n ", " {\n opacity: ", "\n }\n"])), function (p) { return (p['data-loading'] ? 'all' : 'none'); }, SpinnerSvg, function (p) { return (p['data-loading'] ? '1' : '0'); });
|
|
11
|
-
var Spinner = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n margin: 0 auto;\n width: 100px;\n &:before {\n content: '';\n display: block;\n padding-top: 100%;\n }\n"], ["\n position: relative;\n margin: 0 auto;\n width: 100px;\n &:before {\n content: '';\n display: block;\n padding-top: 100%;\n }\n"])));
|
|
12
|
-
var SpinnerCircle = styled.circle(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n animation: ", " 1.5s ease-in-out infinite;\n stroke-linecap: round;\n stroke: ", ";\n stroke-width: 2px;\n"], ["\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n animation: ", " 1.5s ease-in-out infinite;\n stroke-linecap: round;\n stroke: ", ";\n stroke-width: 2px;\n"])), dash, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; });
|
|
13
|
-
var Loader = function (_a) {
|
|
14
|
-
var _b = _a.loading, loading = _b === void 0 ? false : _b;
|
|
15
|
-
return (React.createElement(Wrapper, { className: "humany-loader", "data-loading": loading },
|
|
16
|
-
React.createElement(Spinner, { className: "humany-spinner" },
|
|
17
|
-
React.createElement(SpinnerSvg, { viewBox: "25 25 50 50" },
|
|
18
|
-
React.createElement(SpinnerCircle, { cx: "50", cy: "50", r: "20", fill: "none", "stroke-width": "2", "stroke-miterlimit": "10" })))));
|
|
19
|
-
};
|
|
20
|
-
export default Loader;
|
|
21
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { DateFormats, Text, Timestamp } from '@telia-ace/widget-ui';
|
|
6
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
|
-
var Metadata = function (_a) {
|
|
10
|
-
var _b = _a.format, format = _b === void 0 ? DateFormats.YYYY_MM_DD_HH_MM : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.byLabel, byLabel = _d === void 0 ? '' : _d, _e = _a.modifiedLabel, modifiedLabel = _e === void 0 ? '' : _e, _f = _a.publishedLabel, publishedLabel = _f === void 0 ? '' : _f, _g = _a.modifiedBy, modifiedBy = _g === void 0 ? '' : _g, _h = _a.publishedBy, publishedBy = _h === void 0 ? '' : _h, _j = _a.showModified, showModified = _j === void 0 ? false : _j, _k = _a.showPublished, showPublished = _k === void 0 ? false : _k, modified = _a.modified, published = _a.published;
|
|
11
|
-
var publishedTimestamp = showPublished && published ? (React.createElement(StyledTimestamp, { format: format, timestamp: published })) : null;
|
|
12
|
-
var modifiedTimestamp = showModified && modified ? React.createElement(StyledTimestamp, { format: format, timestamp: modified }) : null;
|
|
13
|
-
if (!publishedTimestamp && !modifiedTimestamp) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return (React.createElement(StyledText, { className: appendClassNames(className, 'humany-metadata') },
|
|
17
|
-
publishedTimestamp && (React.createElement(StyledText, { className: "humany-published" },
|
|
18
|
-
publishedLabel,
|
|
19
|
-
publishedTimestamp,
|
|
20
|
-
byLabel && publishedBy && " ".concat(byLabel.replace('{{editor}}', publishedBy)))),
|
|
21
|
-
modifiedTimestamp && (React.createElement(StyledText, { className: "humany-modified" },
|
|
22
|
-
publishedTimestamp && ', ',
|
|
23
|
-
modifiedLabel,
|
|
24
|
-
modifiedTimestamp,
|
|
25
|
-
byLabel && modifiedBy && " ".concat(byLabel.replace('{{editor}}', modifiedBy))))));
|
|
26
|
-
};
|
|
27
|
-
export default Metadata;
|
|
28
|
-
var StyledTimestamp = styled(Timestamp)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:not(:first-child) {\n margin-left: 4px;\n }\n &:not(:last-child) {\n margin-right: 4px;\n }\n"], ["\n &:not(:first-child) {\n margin-left: 4px;\n }\n &:not(:last-child) {\n margin-right: 4px;\n }\n"])));
|
|
29
|
-
var StyledText = styled(Text)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-style: italic;\n"], ["\n font-style: italic;\n"])));
|
|
30
|
-
var templateObject_1, templateObject_2;
|
package/lib-esm/hooks/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as useArrowKeys } from './use-arrow-keys';
|
|
2
|
-
export { default as useDebounce } from './use-debounce';
|
|
3
|
-
export { default as useFavorites } from './use-favorites';
|
|
4
|
-
export type { FavoriteActions } from './use-favorites';
|
|
5
|
-
export { default as useHover } from './use-hover';
|
package/lib-esm/hooks/index.js
DELETED