@telia-ace/widget-ui 1.0.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.
- package/LICENSE.txt +6 -0
- package/README.md +3 -0
- package/lib/components/anchor-link.d.ts +4 -0
- package/lib/components/anchor-link.js +7 -0
- package/lib/components/button.d.ts +4 -0
- package/lib/components/button.js +64 -0
- package/lib/components/checkbox.d.ts +7 -0
- package/lib/components/checkbox.js +39 -0
- package/lib/components/drawer/drawer.d.ts +21 -0
- package/lib/components/drawer/drawer.js +150 -0
- package/lib/components/drawer/index.d.ts +3 -0
- package/lib/components/drawer/index.js +29 -0
- package/lib/components/dropdown/dropdown.d.ts +9 -0
- package/lib/components/dropdown/dropdown.js +155 -0
- package/lib/components/dropdown/index.d.ts +4 -0
- package/lib/components/dropdown/index.js +10 -0
- package/lib/components/dropdown/use-position.d.ts +5 -0
- package/lib/components/dropdown/use-position.js +57 -0
- package/lib/components/empty.d.ts +4 -0
- package/lib/components/empty.js +40 -0
- package/lib/components/grid.d.ts +7 -0
- package/lib/components/grid.js +64 -0
- package/lib/components/html.d.ts +12 -0
- package/lib/components/html.js +78 -0
- package/lib/components/icon.d.ts +7 -0
- package/lib/components/icon.js +35 -0
- package/lib/components/index.d.ts +58 -0
- package/lib/components/index.js +69 -0
- package/lib/components/input.d.ts +10 -0
- package/lib/components/input.js +94 -0
- package/lib/components/item-list.d.ts +10 -0
- package/lib/components/item-list.js +62 -0
- package/lib/components/item-tree.d.ts +13 -0
- package/lib/components/item-tree.js +55 -0
- package/lib/components/lightbox.d.ts +6 -0
- package/lib/components/lightbox.js +92 -0
- package/lib/components/link.d.ts +11 -0
- package/lib/components/link.js +99 -0
- package/lib/components/list.d.ts +9 -0
- package/lib/components/list.js +56 -0
- package/lib/components/modal/confirm.d.ts +12 -0
- package/lib/components/modal/confirm.js +61 -0
- package/lib/components/modal/index.d.ts +4 -0
- package/lib/components/modal/index.js +10 -0
- package/lib/components/modal/modal.d.ts +10 -0
- package/lib/components/modal/modal.js +127 -0
- package/lib/components/not-found.d.ts +9 -0
- package/lib/components/not-found.js +55 -0
- package/lib/components/overlay.d.ts +8 -0
- package/lib/components/overlay.js +73 -0
- package/lib/components/paragraph.d.ts +11 -0
- package/lib/components/paragraph.js +66 -0
- package/lib/components/portal.d.ts +7 -0
- package/lib/components/portal.js +61 -0
- package/lib/components/route-link.d.ts +11 -0
- package/lib/components/route-link.js +115 -0
- package/lib/components/symbol-badge.d.ts +15 -0
- package/lib/components/symbol-badge.js +197 -0
- package/lib/components/tab-stop.d.ts +18 -0
- package/lib/components/tab-stop.js +100 -0
- package/lib/components/text-link.d.ts +8 -0
- package/lib/components/text-link.js +62 -0
- package/lib/components/text.d.ts +4 -0
- package/lib/components/text.js +35 -0
- package/lib/components/timestamp.d.ts +13 -0
- package/lib/components/timestamp.js +39 -0
- package/lib/components/tooltip.d.ts +8 -0
- package/lib/components/tooltip.js +127 -0
- package/lib/components/transition-component.d.ts +30 -0
- package/lib/components/transition-component.js +77 -0
- package/lib/components/typography.d.ts +9 -0
- package/lib/components/typography.js +43 -0
- package/lib/components/widget-link.d.ts +10 -0
- package/lib/components/widget-link.js +116 -0
- package/lib/contexts/index.d.ts +9 -0
- package/lib/contexts/index.js +15 -0
- package/lib/create-react-component.d.ts +11 -0
- package/lib/create-react-component.js +18 -0
- package/lib/hooks/index.d.ts +27 -0
- package/lib/hooks/index.js +58 -0
- package/lib/hooks/use-action.d.ts +4 -0
- package/lib/hooks/use-action.js +21 -0
- package/lib/hooks/use-children.d.ts +4 -0
- package/lib/hooks/use-children.js +70 -0
- package/lib/hooks/use-columns.d.ts +2 -0
- package/lib/hooks/use-columns.js +6 -0
- package/lib/hooks/use-component-descriptor.d.ts +2 -0
- package/lib/hooks/use-component-descriptor.js +6 -0
- package/lib/hooks/use-component-node.d.ts +6 -0
- package/lib/hooks/use-component-node.js +37 -0
- package/lib/hooks/use-component-platform.d.ts +4 -0
- package/lib/hooks/use-component-platform.js +39 -0
- package/lib/hooks/use-component.d.ts +3 -0
- package/lib/hooks/use-component.js +57 -0
- package/lib/hooks/use-container.d.ts +2 -0
- package/lib/hooks/use-container.js +6 -0
- package/lib/hooks/use-context.d.ts +3 -0
- package/lib/hooks/use-context.js +50 -0
- package/lib/hooks/use-dispatch.d.ts +3 -0
- package/lib/hooks/use-dispatch.js +64 -0
- package/lib/hooks/use-event-listener.d.ts +2 -0
- package/lib/hooks/use-event-listener.js +21 -0
- package/lib/hooks/use-events.d.ts +3 -0
- package/lib/hooks/use-events.js +12 -0
- package/lib/hooks/use-is-mounted.d.ts +3 -0
- package/lib/hooks/use-is-mounted.js +14 -0
- package/lib/hooks/use-key-press.d.ts +2 -0
- package/lib/hooks/use-key-press.js +46 -0
- package/lib/hooks/use-layout.d.ts +3 -0
- package/lib/hooks/use-layout.js +50 -0
- package/lib/hooks/use-previous.d.ts +2 -0
- package/lib/hooks/use-previous.js +11 -0
- package/lib/hooks/use-properties.d.ts +6 -0
- package/lib/hooks/use-properties.js +9 -0
- package/lib/hooks/use-render-state.d.ts +4 -0
- package/lib/hooks/use-render-state.js +66 -0
- package/lib/hooks/use-route-data.d.ts +4 -0
- package/lib/hooks/use-route-data.js +54 -0
- package/lib/hooks/use-router.d.ts +3 -0
- package/lib/hooks/use-router.js +9 -0
- package/lib/hooks/use-scroll.d.ts +2 -0
- package/lib/hooks/use-scroll.js +71 -0
- package/lib/hooks/use-settings.d.ts +3 -0
- package/lib/hooks/use-settings.js +38 -0
- package/lib/hooks/use-toggle.d.ts +2 -0
- package/lib/hooks/use-toggle.js +28 -0
- package/lib/hooks/use-transition-end.d.ts +2 -0
- package/lib/hooks/use-transition-end.js +62 -0
- package/lib/hooks/use-unique-menu.d.ts +2 -0
- package/lib/hooks/use-unique-menu.js +15 -0
- package/lib/hooks/use-widget-event.d.ts +3 -0
- package/lib/hooks/use-widget-event.js +21 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +92 -0
- package/lib/styles.d.ts +19 -0
- package/lib/styles.js +53 -0
- package/lib/utils/animations.d.ts +18 -0
- package/lib/utils/animations.js +104 -0
- package/lib/utils/browser.d.ts +12 -0
- package/lib/utils/browser.js +54 -0
- package/lib/utils/convert-to-string-attributes.d.ts +2 -0
- package/lib/utils/convert-to-string-attributes.js +23 -0
- package/lib/utils/create-empty-component.d.ts +4 -0
- package/lib/utils/create-empty-component.js +25 -0
- package/lib/utils/embedded-link-mapper.d.ts +4 -0
- package/lib/utils/embedded-link-mapper.js +62 -0
- package/lib/utils/filter-css-props.d.ts +8 -0
- package/lib/utils/filter-css-props.js +28 -0
- package/lib/utils/generic-hash-link.d.ts +8 -0
- package/lib/utils/generic-hash-link.js +70 -0
- package/lib/utils/heading-styles.d.ts +1 -0
- package/lib/utils/heading-styles.js +48 -0
- package/lib/utils/index.d.ts +12 -0
- package/lib/utils/index.js +28 -0
- package/lib/utils/process-html-string.d.ts +4 -0
- package/lib/utils/process-html-string.js +16 -0
- package/lib/utils/render-instructions.d.ts +8 -0
- package/lib/utils/render-instructions.js +19 -0
- package/lib-esm/components/anchor-link.d.ts +4 -0
- package/lib-esm/components/anchor-link.js +5 -0
- package/lib-esm/components/button.d.ts +4 -0
- package/lib-esm/components/button.js +36 -0
- package/lib-esm/components/checkbox.d.ts +7 -0
- package/lib-esm/components/checkbox.js +34 -0
- package/lib-esm/components/drawer/drawer.d.ts +21 -0
- package/lib-esm/components/drawer/drawer.js +121 -0
- package/lib-esm/components/drawer/index.d.ts +3 -0
- package/lib-esm/components/drawer/index.js +3 -0
- package/lib-esm/components/dropdown/dropdown.d.ts +9 -0
- package/lib-esm/components/dropdown/dropdown.js +127 -0
- package/lib-esm/components/dropdown/index.d.ts +4 -0
- package/lib-esm/components/dropdown/index.js +3 -0
- package/lib-esm/components/dropdown/use-position.d.ts +5 -0
- package/lib-esm/components/dropdown/use-position.js +53 -0
- package/lib-esm/components/empty.d.ts +4 -0
- package/lib-esm/components/empty.js +35 -0
- package/lib-esm/components/grid.d.ts +7 -0
- package/lib-esm/components/grid.js +36 -0
- package/lib-esm/components/html.d.ts +12 -0
- package/lib-esm/components/html.js +53 -0
- package/lib-esm/components/icon.d.ts +7 -0
- package/lib-esm/components/icon.js +30 -0
- package/lib-esm/components/index.d.ts +58 -0
- package/lib-esm/components/index.js +30 -0
- package/lib-esm/components/input.d.ts +10 -0
- package/lib-esm/components/input.js +69 -0
- package/lib-esm/components/item-list.d.ts +10 -0
- package/lib-esm/components/item-list.js +34 -0
- package/lib-esm/components/item-tree.d.ts +13 -0
- package/lib-esm/components/item-tree.js +50 -0
- package/lib-esm/components/lightbox.d.ts +6 -0
- package/lib-esm/components/lightbox.js +64 -0
- package/lib-esm/components/link.d.ts +11 -0
- package/lib-esm/components/link.js +71 -0
- package/lib-esm/components/list.d.ts +9 -0
- package/lib-esm/components/list.js +31 -0
- package/lib-esm/components/modal/confirm.d.ts +12 -0
- package/lib-esm/components/modal/confirm.js +33 -0
- package/lib-esm/components/modal/index.d.ts +4 -0
- package/lib-esm/components/modal/index.js +3 -0
- package/lib-esm/components/modal/modal.d.ts +10 -0
- package/lib-esm/components/modal/modal.js +99 -0
- package/lib-esm/components/not-found.d.ts +9 -0
- package/lib-esm/components/not-found.js +27 -0
- package/lib-esm/components/overlay.d.ts +8 -0
- package/lib-esm/components/overlay.js +45 -0
- package/lib-esm/components/paragraph.d.ts +11 -0
- package/lib-esm/components/paragraph.js +38 -0
- package/lib-esm/components/portal.d.ts +7 -0
- package/lib-esm/components/portal.js +36 -0
- package/lib-esm/components/route-link.d.ts +11 -0
- package/lib-esm/components/route-link.js +90 -0
- package/lib-esm/components/symbol-badge.d.ts +15 -0
- package/lib-esm/components/symbol-badge.js +192 -0
- package/lib-esm/components/tab-stop.d.ts +18 -0
- package/lib-esm/components/tab-stop.js +75 -0
- package/lib-esm/components/text-link.d.ts +8 -0
- package/lib-esm/components/text-link.js +34 -0
- package/lib-esm/components/text.d.ts +4 -0
- package/lib-esm/components/text.js +30 -0
- package/lib-esm/components/timestamp.d.ts +13 -0
- package/lib-esm/components/timestamp.js +33 -0
- package/lib-esm/components/tooltip.d.ts +8 -0
- package/lib-esm/components/tooltip.js +99 -0
- package/lib-esm/components/transition-component.d.ts +30 -0
- package/lib-esm/components/transition-component.js +72 -0
- package/lib-esm/components/typography.d.ts +9 -0
- package/lib-esm/components/typography.js +38 -0
- package/lib-esm/components/widget-link.d.ts +10 -0
- package/lib-esm/components/widget-link.js +88 -0
- package/lib-esm/contexts/index.d.ts +9 -0
- package/lib-esm/contexts/index.js +12 -0
- package/lib-esm/create-react-component.d.ts +11 -0
- package/lib-esm/create-react-component.js +16 -0
- package/lib-esm/hooks/index.d.ts +27 -0
- package/lib-esm/hooks/index.js +26 -0
- package/lib-esm/hooks/use-action.d.ts +4 -0
- package/lib-esm/hooks/use-action.js +14 -0
- package/lib-esm/hooks/use-children.d.ts +4 -0
- package/lib-esm/hooks/use-children.js +65 -0
- package/lib-esm/hooks/use-columns.d.ts +2 -0
- package/lib-esm/hooks/use-columns.js +4 -0
- package/lib-esm/hooks/use-component-descriptor.d.ts +2 -0
- package/lib-esm/hooks/use-component-descriptor.js +4 -0
- package/lib-esm/hooks/use-component-node.d.ts +6 -0
- package/lib-esm/hooks/use-component-node.js +35 -0
- package/lib-esm/hooks/use-component-platform.d.ts +4 -0
- package/lib-esm/hooks/use-component-platform.js +34 -0
- package/lib-esm/hooks/use-component.d.ts +3 -0
- package/lib-esm/hooks/use-component.js +52 -0
- package/lib-esm/hooks/use-container.d.ts +2 -0
- package/lib-esm/hooks/use-container.js +4 -0
- package/lib-esm/hooks/use-context.d.ts +3 -0
- package/lib-esm/hooks/use-context.js +45 -0
- package/lib-esm/hooks/use-dispatch.d.ts +3 -0
- package/lib-esm/hooks/use-dispatch.js +59 -0
- package/lib-esm/hooks/use-event-listener.d.ts +2 -0
- package/lib-esm/hooks/use-event-listener.js +19 -0
- package/lib-esm/hooks/use-events.d.ts +3 -0
- package/lib-esm/hooks/use-events.js +7 -0
- package/lib-esm/hooks/use-is-mounted.d.ts +3 -0
- package/lib-esm/hooks/use-is-mounted.js +12 -0
- package/lib-esm/hooks/use-key-press.d.ts +2 -0
- package/lib-esm/hooks/use-key-press.js +41 -0
- package/lib-esm/hooks/use-layout.d.ts +3 -0
- package/lib-esm/hooks/use-layout.js +45 -0
- package/lib-esm/hooks/use-previous.d.ts +2 -0
- package/lib-esm/hooks/use-previous.js +9 -0
- package/lib-esm/hooks/use-properties.d.ts +6 -0
- package/lib-esm/hooks/use-properties.js +7 -0
- package/lib-esm/hooks/use-render-state.d.ts +4 -0
- package/lib-esm/hooks/use-render-state.js +61 -0
- package/lib-esm/hooks/use-route-data.d.ts +4 -0
- package/lib-esm/hooks/use-route-data.js +49 -0
- package/lib-esm/hooks/use-router.d.ts +3 -0
- package/lib-esm/hooks/use-router.js +7 -0
- package/lib-esm/hooks/use-scroll.d.ts +2 -0
- package/lib-esm/hooks/use-scroll.js +66 -0
- package/lib-esm/hooks/use-settings.d.ts +3 -0
- package/lib-esm/hooks/use-settings.js +33 -0
- package/lib-esm/hooks/use-toggle.d.ts +2 -0
- package/lib-esm/hooks/use-toggle.js +26 -0
- package/lib-esm/hooks/use-transition-end.d.ts +2 -0
- package/lib-esm/hooks/use-transition-end.js +60 -0
- package/lib-esm/hooks/use-unique-menu.d.ts +2 -0
- package/lib-esm/hooks/use-unique-menu.js +10 -0
- package/lib-esm/hooks/use-widget-event.d.ts +3 -0
- package/lib-esm/hooks/use-widget-event.js +16 -0
- package/lib-esm/index.d.ts +9 -0
- package/lib-esm/index.js +7 -0
- package/lib-esm/styles.d.ts +19 -0
- package/lib-esm/styles.js +26 -0
- package/lib-esm/utils/animations.d.ts +18 -0
- package/lib-esm/utils/animations.js +101 -0
- package/lib-esm/utils/browser.d.ts +12 -0
- package/lib-esm/utils/browser.js +51 -0
- package/lib-esm/utils/convert-to-string-attributes.d.ts +2 -0
- package/lib-esm/utils/convert-to-string-attributes.js +21 -0
- package/lib-esm/utils/create-empty-component.d.ts +4 -0
- package/lib-esm/utils/create-empty-component.js +20 -0
- package/lib-esm/utils/embedded-link-mapper.d.ts +4 -0
- package/lib-esm/utils/embedded-link-mapper.js +57 -0
- package/lib-esm/utils/filter-css-props.d.ts +8 -0
- package/lib-esm/utils/filter-css-props.js +25 -0
- package/lib-esm/utils/generic-hash-link.d.ts +8 -0
- package/lib-esm/utils/generic-hash-link.js +63 -0
- package/lib-esm/utils/heading-styles.d.ts +1 -0
- package/lib-esm/utils/heading-styles.js +44 -0
- package/lib-esm/utils/index.d.ts +12 -0
- package/lib-esm/utils/index.js +10 -0
- package/lib-esm/utils/process-html-string.d.ts +4 -0
- package/lib-esm/utils/process-html-string.js +10 -0
- package/lib-esm/utils/render-instructions.d.ts +8 -0
- package/lib-esm/utils/render-instructions.js +12 -0
- package/package.json +47 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
var react_1 = __importStar(require("react"));
|
|
42
|
+
var TabStop = /** @class */ (function (_super) {
|
|
43
|
+
__extends(TabStop, _super);
|
|
44
|
+
function TabStop() {
|
|
45
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
+
_this.state = {
|
|
47
|
+
boundFocus: false,
|
|
48
|
+
};
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
TabStop.prototype.componentWillMount = function () {
|
|
52
|
+
var settings = this.props.container.get('accessibilitySettings');
|
|
53
|
+
if (settings && settings.boundFocus) {
|
|
54
|
+
this.setState({
|
|
55
|
+
boundFocus: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
TabStop.prototype.componentDidMount = function () {
|
|
60
|
+
if (!this.state.boundFocus) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
var widgetDOMElement = this.props.container.get('widgetDOMElement');
|
|
64
|
+
if (this.node && widgetDOMElement) {
|
|
65
|
+
this.onFocusListener = this.node.addEventListener('focus', function () {
|
|
66
|
+
var focusable = widgetDOMElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
67
|
+
var filtered = [].filter.call(focusable, function (el) {
|
|
68
|
+
if (typeof window === 'undefined') {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
var style = window.getComputedStyle(el);
|
|
72
|
+
if (style.display === 'none' || (el.offsetWidth <= 0 && el.offsetHeight <= 0)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
});
|
|
77
|
+
var firstFocusable = filtered[0];
|
|
78
|
+
if (firstFocusable) {
|
|
79
|
+
firstFocusable.focus();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
TabStop.prototype.componentWillUnmount = function () {
|
|
85
|
+
if (this.node) {
|
|
86
|
+
this.node.removeEventListener('focus', this.onFocusListener);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
TabStop.prototype.render = function () {
|
|
90
|
+
var _this = this;
|
|
91
|
+
if (!this.state.boundFocus) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return (react_1.default.createElement("div", { style: { opacity: 0 }, tabIndex: 0, ref: function (node) {
|
|
95
|
+
_this.node = node;
|
|
96
|
+
} }));
|
|
97
|
+
};
|
|
98
|
+
return TabStop;
|
|
99
|
+
}(react_1.Component));
|
|
100
|
+
exports.default = TabStop;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props as LinkProps } from './link';
|
|
3
|
+
export declare type Props = Merge<LinkProps, {
|
|
4
|
+
text: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}>;
|
|
7
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "text" | "to" | "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement> | "disabled" | "description" | "routeName" | "params"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
53
|
+
var html_1 = __importDefault(require("./html"));
|
|
54
|
+
var link_1 = __importDefault(require("./link"));
|
|
55
|
+
var text_1 = __importDefault(require("./text"));
|
|
56
|
+
exports.default = (0, react_1.forwardRef)(function (_a, ref) {
|
|
57
|
+
var className = _a.className, description = _a.description, text = _a.text, children = _a.children, other = __rest(_a, ["className", "description", "text", "children"]);
|
|
58
|
+
return (react_1.default.createElement(link_1.default, __assign({ className: (0, widget_utilities_1.appendClassNames)(className, 'humany-text-link') }, other, { ref: ref }),
|
|
59
|
+
children,
|
|
60
|
+
react_1.default.createElement(text_1.default, null, text),
|
|
61
|
+
description ? react_1.default.createElement(html_1.default, { html: description, className: "humany-description" }) : null));
|
|
62
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var utils_1 = require("../utils");
|
|
31
|
+
var Text = function (_a) {
|
|
32
|
+
var className = _a.className, children = _a.children, other = __rest(_a, ["className", "children"]);
|
|
33
|
+
return (react_1.default.createElement("span", __assign({ className: (0, widget_utilities_1.appendClassNames)(className, 'humany-text') }, (0, utils_1.convertToStringAttributes)(other)), children));
|
|
34
|
+
};
|
|
35
|
+
exports.default = Text;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum DateFormats {
|
|
3
|
+
HH_MM = "hh:mm",
|
|
4
|
+
YYYY_MM_DD = "yyyy-mm-dd",
|
|
5
|
+
YYYY_MM_DD_HH_MM = "yyyy-mm-dd hh:mm"
|
|
6
|
+
}
|
|
7
|
+
export declare type Props = {
|
|
8
|
+
timestamp: string;
|
|
9
|
+
format?: DateFormats;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Timestamp: React.FC<Props>;
|
|
13
|
+
export default Timestamp;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DateFormats = void 0;
|
|
7
|
+
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var DateFormats;
|
|
10
|
+
(function (DateFormats) {
|
|
11
|
+
DateFormats["HH_MM"] = "hh:mm";
|
|
12
|
+
DateFormats["YYYY_MM_DD"] = "yyyy-mm-dd";
|
|
13
|
+
DateFormats["YYYY_MM_DD_HH_MM"] = "yyyy-mm-dd hh:mm";
|
|
14
|
+
})(DateFormats = exports.DateFormats || (exports.DateFormats = {}));
|
|
15
|
+
var Timestamp = function (_a) {
|
|
16
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.format, format = _c === void 0 ? DateFormats.HH_MM : _c, timestamp = _a.timestamp;
|
|
17
|
+
return (react_1.default.createElement("span", { className: (0, widget_utilities_1.appendClassNames)(className, 'humany-timestamp') }, formatDate(timestamp, format)));
|
|
18
|
+
};
|
|
19
|
+
exports.default = Timestamp;
|
|
20
|
+
var asTwoDigitString = function (input) {
|
|
21
|
+
return "0".concat(input).slice(-2);
|
|
22
|
+
};
|
|
23
|
+
/* formats date to hh:mm, yyyy-mm-dd or yyyy-mm-dd hh:mm format */
|
|
24
|
+
function formatDate(unformattedDate, format) {
|
|
25
|
+
var date = new Date(unformattedDate);
|
|
26
|
+
var dateArray = date.toTimeString().split(' ')[0].split(':');
|
|
27
|
+
var timeString = dateArray.length > 1 ? "".concat(dateArray[0], ":").concat(dateArray[1]) : dateArray[0];
|
|
28
|
+
var year = date.getFullYear();
|
|
29
|
+
var month = date.getMonth() + 1;
|
|
30
|
+
var day = date.getDate();
|
|
31
|
+
var dateString = "".concat(year, "-").concat(asTwoDigitString(month), "-").concat(asTwoDigitString(day));
|
|
32
|
+
if (format === DateFormats.YYYY_MM_DD) {
|
|
33
|
+
return dateString;
|
|
34
|
+
}
|
|
35
|
+
if (format === DateFormats.HH_MM) {
|
|
36
|
+
return timeString;
|
|
37
|
+
}
|
|
38
|
+
return "".concat(dateString, " ").concat(timeString);
|
|
39
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
41
|
+
var t = {};
|
|
42
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
43
|
+
t[p] = s[p];
|
|
44
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
45
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
46
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
47
|
+
t[p[i]] = s[p[i]];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
52
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
53
|
+
if (!m) return o;
|
|
54
|
+
var i = m.call(o), r, ar = [], e;
|
|
55
|
+
try {
|
|
56
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
57
|
+
}
|
|
58
|
+
catch (error) { e = { error: error }; }
|
|
59
|
+
finally {
|
|
60
|
+
try {
|
|
61
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
62
|
+
}
|
|
63
|
+
finally { if (e) throw e.error; }
|
|
64
|
+
}
|
|
65
|
+
return ar;
|
|
66
|
+
};
|
|
67
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
68
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
69
|
+
};
|
|
70
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
+
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
72
|
+
var react_1 = __importStar(require("react"));
|
|
73
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
74
|
+
var dropdown_1 = require("./dropdown");
|
|
75
|
+
var portal_1 = __importDefault(require("./portal"));
|
|
76
|
+
var Tooltip = function (_a) {
|
|
77
|
+
var className = _a.className, children = _a.children, content = _a.content, _b = _a.sticky, sticky = _b === void 0 ? false : _b, other = __rest(_a, ["className", "children", "content", "sticky"]);
|
|
78
|
+
var _c = __read((0, react_1.useState)(false), 2), open = _c[0], setOpen = _c[1];
|
|
79
|
+
var id = (0, react_1.useRef)((0, widget_utilities_1.uuid)());
|
|
80
|
+
var ref = (0, react_1.useRef)();
|
|
81
|
+
var _d = __read((0, dropdown_1.useCursorPosition)(open, id.current, ref.current), 2), _e = _d[0], x = _e.x, y = _e.y, set = _d[1];
|
|
82
|
+
var clickHandler = function (event) {
|
|
83
|
+
var target = event.target;
|
|
84
|
+
if (!ref.current || !target) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (ref.current !== target && !ref.current.contains(target)) {
|
|
88
|
+
setOpen(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
(0, react_1.useEffect)(function () {
|
|
92
|
+
if (!sticky) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
window.addEventListener('click', clickHandler);
|
|
96
|
+
return function () {
|
|
97
|
+
window.removeEventListener('click', clickHandler);
|
|
98
|
+
};
|
|
99
|
+
}, [open, sticky]);
|
|
100
|
+
var handleMouseEvent = (0, react_1.useCallback)(function (e, value) {
|
|
101
|
+
set(e, ref.current);
|
|
102
|
+
setOpen(value);
|
|
103
|
+
}, [set, setOpen]);
|
|
104
|
+
return (react_1.default.createElement(Trigger, { ref: ref, className: "humany-tooltip-trigger", onMouseEnter: !sticky ? function (e) { return handleMouseEvent(e, true); } : undefined, onMouseLeave: !sticky ? function (e) { return handleMouseEvent(e, false); } : undefined, onTouchEnd: sticky ? function (e) { return handleMouseEvent(e, !open); } : undefined, onClick: sticky ? function (e) { return handleMouseEvent(e, !open); } : undefined },
|
|
105
|
+
children,
|
|
106
|
+
open && (react_1.default.createElement(portal_1.default, null,
|
|
107
|
+
react_1.default.createElement(TooltipContainer, __assign({ className: (0, widget_utilities_1.appendClassNames)(className, 'humany-tooltip-container'), x: x, y: y }, other), content)))));
|
|
108
|
+
};
|
|
109
|
+
var Trigger = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
110
|
+
var TooltipContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: #ffffff;\n background: #161616;\n border-radius: ", ";\n padding: calc(", " * 2);\n font-size: ", ";\n font-family: ", ";\n position: absolute;\n z-index: 10;\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n i,\n svg {\n margin-right: ", ";\n }\n\n ", ";\n"], ["\n color: #ffffff;\n background: #161616;\n border-radius: ", ";\n padding: calc(", " * 2);\n font-size: ", ";\n font-family: ", ";\n position: absolute;\n z-index: 10;\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n i,\n svg {\n margin-right: ", ";\n }\n\n ", ";\n"])), function (p) { return p.theme.borderRadius; }, 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.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.type; }, function (p) { return (p.color ? p.color : 'inherit'); }, function (p) { return p.theme.sizes.small; }, function (p) {
|
|
111
|
+
var css = '';
|
|
112
|
+
if (p.y > 0) {
|
|
113
|
+
css += "top: calc(2px + ".concat(p.y || '0', "px);");
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
css += "bottom: 2px;";
|
|
117
|
+
}
|
|
118
|
+
if (p.x > 0) {
|
|
119
|
+
css += "right: calc(2px + ".concat(p.x || '0', "px);");
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
css += "left: 2px;";
|
|
123
|
+
}
|
|
124
|
+
return css;
|
|
125
|
+
});
|
|
126
|
+
exports.default = Tooltip;
|
|
127
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type Props = {
|
|
3
|
+
in: boolean;
|
|
4
|
+
timeout?: number | {
|
|
5
|
+
enter?: number;
|
|
6
|
+
exit?: number;
|
|
7
|
+
};
|
|
8
|
+
mountOnEnter?: boolean;
|
|
9
|
+
unmountOnExit?: boolean;
|
|
10
|
+
children?: any;
|
|
11
|
+
transitions?: string | {
|
|
12
|
+
enter: TransitionInfo;
|
|
13
|
+
exit: TransitionInfo;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare type TransitionInfo = {
|
|
17
|
+
type: string;
|
|
18
|
+
easing?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Wrapper component for Transition from 'react-transition-group'
|
|
22
|
+
* Controls animated enter/exit transitions of a child component bu dynamically creating
|
|
23
|
+
* css that is forwarded to the child component.
|
|
24
|
+
*
|
|
25
|
+
* TODO:
|
|
26
|
+
* Extend to accept more specific transitions (TransitionStateSettings) to enable different
|
|
27
|
+
* enter and exit animations, timings and easings
|
|
28
|
+
*/
|
|
29
|
+
declare const TransitionComponent: React.FC<Props>;
|
|
30
|
+
export default TransitionComponent;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var react_transition_group_1 = require("react-transition-group");
|
|
8
|
+
var utils_1 = require("../utils");
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper component for Transition from 'react-transition-group'
|
|
11
|
+
* Controls animated enter/exit transitions of a child component bu dynamically creating
|
|
12
|
+
* css that is forwarded to the child component.
|
|
13
|
+
*
|
|
14
|
+
* TODO:
|
|
15
|
+
* Extend to accept more specific transitions (TransitionStateSettings) to enable different
|
|
16
|
+
* enter and exit animations, timings and easings
|
|
17
|
+
*/
|
|
18
|
+
var TransitionComponent = function (props) {
|
|
19
|
+
var inState = props.in, _a = props.mountOnEnter, mountOnEnter = _a === void 0 ? true : _a, _b = props.unmountOnExit, unmountOnExit = _b === void 0 ? true : _b, timeout = props.timeout, children = props.children, transitions = props.transitions;
|
|
20
|
+
var generateTransitionDefinition = function () {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
if (!transitions || transitions === 'none') {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (typeof transitions === 'string') {
|
|
26
|
+
return {
|
|
27
|
+
enter: {
|
|
28
|
+
transitionKeys: transitions,
|
|
29
|
+
duration: !!timeout
|
|
30
|
+
? typeof timeout === 'number'
|
|
31
|
+
? timeout
|
|
32
|
+
: timeout.enter
|
|
33
|
+
: 200,
|
|
34
|
+
easing: 'ease-in',
|
|
35
|
+
},
|
|
36
|
+
exit: {
|
|
37
|
+
transitionKeys: transitions,
|
|
38
|
+
duration: !!timeout
|
|
39
|
+
? typeof timeout === 'number'
|
|
40
|
+
? timeout
|
|
41
|
+
: timeout.exit
|
|
42
|
+
: 200,
|
|
43
|
+
easing: 'ease-out',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (typeof transitions === 'object') {
|
|
48
|
+
var enter = transitions.enter, exit = transitions.exit;
|
|
49
|
+
return {
|
|
50
|
+
enter: {
|
|
51
|
+
transitionKeys: (_a = transitions.enter) === null || _a === void 0 ? void 0 : _a.type,
|
|
52
|
+
duration: !!timeout
|
|
53
|
+
? typeof timeout === 'number'
|
|
54
|
+
? timeout
|
|
55
|
+
: timeout.enter
|
|
56
|
+
: 200,
|
|
57
|
+
easing: !!enter.easing ? enter.easing : 'ease-in',
|
|
58
|
+
},
|
|
59
|
+
exit: {
|
|
60
|
+
transitionKeys: (_b = transitions.enter) === null || _b === void 0 ? void 0 : _b.type,
|
|
61
|
+
duration: !!timeout
|
|
62
|
+
? typeof timeout === 'number'
|
|
63
|
+
? timeout
|
|
64
|
+
: timeout.enter
|
|
65
|
+
: 200,
|
|
66
|
+
easing: !!exit.easing ? exit.easing : 'ease-out',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var def = generateTransitionDefinition();
|
|
72
|
+
return (react_1.default.createElement(react_transition_group_1.Transition, { timeout: {
|
|
73
|
+
enter: (def && def.enter.duration) || 0,
|
|
74
|
+
exit: (def && def.exit.duration) || 0,
|
|
75
|
+
}, in: inState, appear: true, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnExit, onEnter: function (node) { return node.clientHeight; } }, function (state) { return children && children(state, def && utils_1.transitionComposer.compose(state, def)); }));
|
|
76
|
+
};
|
|
77
|
+
exports.default = TransitionComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
variant: TypographyVariant;
|
|
5
|
+
component?: React.ElementType;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const Typography: React.FC<Props>;
|
|
9
|
+
export default Typography;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var react_1 = __importDefault(require("react"));
|
|
22
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
|
+
var hooks_1 = require("../hooks");
|
|
24
|
+
var defaultVariantMapping = {
|
|
25
|
+
h1: 'h1',
|
|
26
|
+
h2: 'h2',
|
|
27
|
+
h3: 'h3',
|
|
28
|
+
h4: 'h4',
|
|
29
|
+
h5: 'h5',
|
|
30
|
+
h6: 'h6',
|
|
31
|
+
p: 'p',
|
|
32
|
+
span: 'span',
|
|
33
|
+
};
|
|
34
|
+
var Typography = function (_a) {
|
|
35
|
+
var variant = _a.variant, component = _a.component, className = _a.className, children = _a.children;
|
|
36
|
+
var _b = (0, hooks_1.useContext)().typographyVariantMapping, typographyVariantMapping = _b === void 0 ? {} : _b;
|
|
37
|
+
var variantMapping = __assign(__assign({}, defaultVariantMapping), typographyVariantMapping);
|
|
38
|
+
var Component = component || variantMapping[variant] || 'span';
|
|
39
|
+
return (react_1.default.createElement(Base, { className: className, as: Component }, children));
|
|
40
|
+
};
|
|
41
|
+
var Base = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
42
|
+
exports.default = Typography;
|
|
43
|
+
var templateObject_1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props as LinkProps } from './link';
|
|
3
|
+
export declare type Props = Merge<LinkProps, {
|
|
4
|
+
widgetName: string;
|
|
5
|
+
activationOptions?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "to" | "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement> | "disabled" | "routeName" | "params" | "widgetName" | "activationOptions"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
export default _default;
|