@telia-ace/widget-ui 1.0.7 → 1.0.10
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/{lib-esm → dist}/components/anchor-link.d.ts +0 -0
- package/{lib-esm → dist}/components/button.d.ts +0 -0
- package/{lib-esm → dist}/components/checkbox.d.ts +0 -0
- package/{lib-esm → dist}/components/drawer/drawer.d.ts +0 -0
- package/{lib-esm → dist}/components/drawer/index.d.ts +0 -0
- package/{lib-esm → dist}/components/dropdown/dropdown.d.ts +0 -0
- package/{lib-esm → dist}/components/dropdown/index.d.ts +0 -0
- package/{lib-esm → dist}/components/dropdown/use-position.d.ts +0 -0
- package/{lib-esm → dist}/components/empty.d.ts +0 -0
- package/{lib-esm → dist}/components/grid.d.ts +0 -0
- package/{lib-esm → dist}/components/html.d.ts +0 -0
- package/{lib-esm → dist}/components/icon.d.ts +0 -0
- package/{lib-esm → dist}/components/index.d.ts +0 -0
- package/{lib-esm → dist}/components/input.d.ts +0 -0
- package/{lib-esm → dist}/components/item-list.d.ts +0 -0
- package/{lib-esm → dist}/components/item-tree.d.ts +0 -0
- package/{lib-esm → dist}/components/lightbox.d.ts +0 -0
- package/{lib-esm → dist}/components/link.d.ts +0 -0
- package/{lib-esm → dist}/components/list.d.ts +0 -0
- package/{lib-esm → dist}/components/modal/confirm.d.ts +0 -0
- package/{lib-esm → dist}/components/modal/index.d.ts +0 -0
- package/{lib-esm → dist}/components/modal/modal.d.ts +0 -0
- package/{lib-esm → dist}/components/not-found.d.ts +0 -0
- package/{lib-esm → dist}/components/overlay.d.ts +0 -0
- package/{lib-esm → dist}/components/paragraph.d.ts +0 -0
- package/{lib-esm → dist}/components/portal.d.ts +0 -0
- package/{lib-esm → dist}/components/route-link.d.ts +0 -0
- package/{lib-esm → dist}/components/symbol-badge.d.ts +0 -0
- package/{lib-esm → dist}/components/tab-stop.d.ts +0 -0
- package/{lib-esm → dist}/components/text-link.d.ts +0 -0
- package/{lib-esm → dist}/components/text.d.ts +0 -0
- package/{lib-esm → dist}/components/timestamp.d.ts +0 -0
- package/{lib-esm → dist}/components/tooltip.d.ts +0 -0
- package/{lib-esm → dist}/components/transition-component.d.ts +0 -0
- package/{lib-esm → dist}/components/typography.d.ts +0 -0
- package/{lib-esm → dist}/components/widget-link.d.ts +0 -0
- package/{lib-esm → dist}/contexts/index.d.ts +0 -0
- package/{lib-esm → dist}/create-react-component.d.ts +0 -0
- package/{lib-esm → dist}/hooks/index.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-action.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-children.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-columns.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-component-descriptor.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-component-node.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-component-platform.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-component.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-container.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-context.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-dispatch.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-event-listener.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-events.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-is-mounted.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-key-press.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-layout.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-previous.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-properties.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-render-state.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-route-data.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-router.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-scroll.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-settings.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-toggle.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-transition-end.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-unique-menu.d.ts +0 -0
- package/{lib-esm → dist}/hooks/use-widget-event.d.ts +0 -0
- package/{lib-esm → dist}/index.d.ts +0 -0
- package/dist/index.js +2988 -0
- package/dist/index.js.map +1 -0
- package/{lib-esm → dist}/styles.d.ts +0 -0
- package/{lib-esm → dist}/utils/animations.d.ts +0 -0
- package/{lib-esm → dist}/utils/browser.d.ts +0 -0
- package/{lib-esm → dist}/utils/convert-to-string-attributes.d.ts +0 -0
- package/{lib-esm → dist}/utils/create-empty-component.d.ts +0 -0
- package/{lib-esm → dist}/utils/embedded-link-mapper.d.ts +0 -0
- package/{lib-esm → dist}/utils/filter-css-props.d.ts +0 -0
- package/{lib-esm → dist}/utils/generic-hash-link.d.ts +0 -0
- package/{lib-esm → dist}/utils/heading-styles.d.ts +0 -0
- package/{lib-esm → dist}/utils/index.d.ts +0 -0
- package/{lib-esm → dist}/utils/process-html-string.d.ts +0 -0
- package/{lib-esm → dist}/utils/render-instructions.d.ts +0 -0
- package/package.json +11 -12
- package/lib/components/anchor-link.d.ts +0 -4
- package/lib/components/anchor-link.js +0 -7
- package/lib/components/button.d.ts +0 -4
- package/lib/components/button.js +0 -64
- package/lib/components/checkbox.d.ts +0 -7
- package/lib/components/checkbox.js +0 -39
- package/lib/components/drawer/drawer.d.ts +0 -21
- package/lib/components/drawer/drawer.js +0 -150
- package/lib/components/drawer/index.d.ts +0 -3
- package/lib/components/drawer/index.js +0 -29
- package/lib/components/dropdown/dropdown.d.ts +0 -9
- package/lib/components/dropdown/dropdown.js +0 -155
- package/lib/components/dropdown/index.d.ts +0 -4
- package/lib/components/dropdown/index.js +0 -10
- package/lib/components/dropdown/use-position.d.ts +0 -5
- package/lib/components/dropdown/use-position.js +0 -57
- package/lib/components/empty.d.ts +0 -4
- package/lib/components/empty.js +0 -40
- package/lib/components/grid.d.ts +0 -7
- package/lib/components/grid.js +0 -64
- package/lib/components/html.d.ts +0 -12
- package/lib/components/html.js +0 -78
- package/lib/components/icon.d.ts +0 -7
- package/lib/components/icon.js +0 -35
- package/lib/components/index.d.ts +0 -58
- package/lib/components/index.js +0 -69
- package/lib/components/input.d.ts +0 -10
- package/lib/components/input.js +0 -94
- package/lib/components/item-list.d.ts +0 -10
- package/lib/components/item-list.js +0 -62
- package/lib/components/item-tree.d.ts +0 -13
- package/lib/components/item-tree.js +0 -55
- package/lib/components/lightbox.d.ts +0 -6
- package/lib/components/lightbox.js +0 -92
- package/lib/components/link.d.ts +0 -11
- package/lib/components/link.js +0 -99
- package/lib/components/list.d.ts +0 -9
- package/lib/components/list.js +0 -56
- package/lib/components/modal/confirm.d.ts +0 -12
- package/lib/components/modal/confirm.js +0 -61
- package/lib/components/modal/index.d.ts +0 -4
- package/lib/components/modal/index.js +0 -10
- package/lib/components/modal/modal.d.ts +0 -10
- package/lib/components/modal/modal.js +0 -127
- package/lib/components/not-found.d.ts +0 -9
- package/lib/components/not-found.js +0 -55
- package/lib/components/overlay.d.ts +0 -8
- package/lib/components/overlay.js +0 -73
- package/lib/components/paragraph.d.ts +0 -11
- package/lib/components/paragraph.js +0 -66
- package/lib/components/portal.d.ts +0 -7
- package/lib/components/portal.js +0 -61
- package/lib/components/route-link.d.ts +0 -11
- package/lib/components/route-link.js +0 -115
- package/lib/components/symbol-badge.d.ts +0 -15
- package/lib/components/symbol-badge.js +0 -205
- package/lib/components/tab-stop.d.ts +0 -18
- package/lib/components/tab-stop.js +0 -100
- package/lib/components/text-link.d.ts +0 -8
- package/lib/components/text-link.js +0 -62
- package/lib/components/text.d.ts +0 -4
- package/lib/components/text.js +0 -35
- package/lib/components/timestamp.d.ts +0 -13
- package/lib/components/timestamp.js +0 -39
- package/lib/components/tooltip.d.ts +0 -8
- package/lib/components/tooltip.js +0 -127
- package/lib/components/transition-component.d.ts +0 -30
- package/lib/components/transition-component.js +0 -77
- package/lib/components/typography.d.ts +0 -9
- package/lib/components/typography.js +0 -43
- package/lib/components/widget-link.d.ts +0 -10
- package/lib/components/widget-link.js +0 -116
- package/lib/contexts/index.d.ts +0 -9
- package/lib/contexts/index.js +0 -15
- package/lib/create-react-component.d.ts +0 -11
- package/lib/create-react-component.js +0 -18
- package/lib/hooks/index.d.ts +0 -27
- package/lib/hooks/index.js +0 -58
- package/lib/hooks/use-action.d.ts +0 -4
- package/lib/hooks/use-action.js +0 -21
- package/lib/hooks/use-children.d.ts +0 -4
- package/lib/hooks/use-children.js +0 -70
- package/lib/hooks/use-columns.d.ts +0 -2
- package/lib/hooks/use-columns.js +0 -6
- package/lib/hooks/use-component-descriptor.d.ts +0 -2
- package/lib/hooks/use-component-descriptor.js +0 -6
- package/lib/hooks/use-component-node.d.ts +0 -6
- package/lib/hooks/use-component-node.js +0 -37
- package/lib/hooks/use-component-platform.d.ts +0 -4
- package/lib/hooks/use-component-platform.js +0 -39
- package/lib/hooks/use-component.d.ts +0 -3
- package/lib/hooks/use-component.js +0 -57
- package/lib/hooks/use-container.d.ts +0 -2
- package/lib/hooks/use-container.js +0 -6
- package/lib/hooks/use-context.d.ts +0 -3
- package/lib/hooks/use-context.js +0 -50
- package/lib/hooks/use-dispatch.d.ts +0 -3
- package/lib/hooks/use-dispatch.js +0 -64
- package/lib/hooks/use-event-listener.d.ts +0 -2
- package/lib/hooks/use-event-listener.js +0 -21
- package/lib/hooks/use-events.d.ts +0 -3
- package/lib/hooks/use-events.js +0 -12
- package/lib/hooks/use-is-mounted.d.ts +0 -3
- package/lib/hooks/use-is-mounted.js +0 -14
- package/lib/hooks/use-key-press.d.ts +0 -2
- package/lib/hooks/use-key-press.js +0 -46
- package/lib/hooks/use-layout.d.ts +0 -3
- package/lib/hooks/use-layout.js +0 -50
- package/lib/hooks/use-previous.d.ts +0 -2
- package/lib/hooks/use-previous.js +0 -11
- package/lib/hooks/use-properties.d.ts +0 -6
- package/lib/hooks/use-properties.js +0 -9
- package/lib/hooks/use-render-state.d.ts +0 -4
- package/lib/hooks/use-render-state.js +0 -70
- package/lib/hooks/use-route-data.d.ts +0 -4
- package/lib/hooks/use-route-data.js +0 -58
- package/lib/hooks/use-router.d.ts +0 -3
- package/lib/hooks/use-router.js +0 -9
- package/lib/hooks/use-scroll.d.ts +0 -2
- package/lib/hooks/use-scroll.js +0 -71
- package/lib/hooks/use-settings.d.ts +0 -3
- package/lib/hooks/use-settings.js +0 -38
- package/lib/hooks/use-toggle.d.ts +0 -2
- package/lib/hooks/use-toggle.js +0 -28
- package/lib/hooks/use-transition-end.d.ts +0 -2
- package/lib/hooks/use-transition-end.js +0 -62
- package/lib/hooks/use-unique-menu.d.ts +0 -2
- package/lib/hooks/use-unique-menu.js +0 -15
- package/lib/hooks/use-widget-event.d.ts +0 -3
- package/lib/hooks/use-widget-event.js +0 -21
- package/lib/index.d.ts +0 -9
- package/lib/index.js +0 -98
- package/lib/styles.d.ts +0 -19
- package/lib/styles.js +0 -53
- package/lib/utils/animations.d.ts +0 -18
- package/lib/utils/animations.js +0 -104
- package/lib/utils/browser.d.ts +0 -12
- package/lib/utils/browser.js +0 -54
- package/lib/utils/convert-to-string-attributes.d.ts +0 -2
- package/lib/utils/convert-to-string-attributes.js +0 -23
- package/lib/utils/create-empty-component.d.ts +0 -3
- package/lib/utils/create-empty-component.js +0 -25
- package/lib/utils/embedded-link-mapper.d.ts +0 -3
- package/lib/utils/embedded-link-mapper.js +0 -62
- package/lib/utils/filter-css-props.d.ts +0 -8
- package/lib/utils/filter-css-props.js +0 -28
- package/lib/utils/generic-hash-link.d.ts +0 -8
- package/lib/utils/generic-hash-link.js +0 -70
- package/lib/utils/heading-styles.d.ts +0 -1
- package/lib/utils/heading-styles.js +0 -48
- package/lib/utils/index.d.ts +0 -12
- package/lib/utils/index.js +0 -28
- package/lib/utils/process-html-string.d.ts +0 -4
- package/lib/utils/process-html-string.js +0 -16
- package/lib/utils/render-instructions.d.ts +0 -8
- package/lib/utils/render-instructions.js +0 -19
- package/lib-esm/components/anchor-link.js +0 -5
- package/lib-esm/components/button.js +0 -36
- package/lib-esm/components/checkbox.js +0 -34
- package/lib-esm/components/drawer/drawer.js +0 -121
- package/lib-esm/components/drawer/index.js +0 -3
- package/lib-esm/components/dropdown/dropdown.js +0 -127
- package/lib-esm/components/dropdown/index.js +0 -3
- package/lib-esm/components/dropdown/use-position.js +0 -53
- package/lib-esm/components/empty.js +0 -35
- package/lib-esm/components/grid.js +0 -36
- package/lib-esm/components/html.js +0 -53
- package/lib-esm/components/icon.js +0 -30
- package/lib-esm/components/index.js +0 -30
- package/lib-esm/components/input.js +0 -69
- package/lib-esm/components/item-list.js +0 -34
- package/lib-esm/components/item-tree.js +0 -50
- package/lib-esm/components/lightbox.js +0 -64
- package/lib-esm/components/link.js +0 -71
- package/lib-esm/components/list.js +0 -31
- package/lib-esm/components/modal/confirm.js +0 -33
- package/lib-esm/components/modal/index.js +0 -3
- package/lib-esm/components/modal/modal.js +0 -99
- package/lib-esm/components/not-found.js +0 -27
- package/lib-esm/components/overlay.js +0 -45
- package/lib-esm/components/paragraph.js +0 -38
- package/lib-esm/components/portal.js +0 -36
- package/lib-esm/components/route-link.js +0 -90
- package/lib-esm/components/symbol-badge.js +0 -200
- package/lib-esm/components/tab-stop.js +0 -75
- package/lib-esm/components/text-link.js +0 -34
- package/lib-esm/components/text.js +0 -30
- package/lib-esm/components/timestamp.js +0 -33
- package/lib-esm/components/tooltip.js +0 -99
- package/lib-esm/components/transition-component.js +0 -72
- package/lib-esm/components/typography.js +0 -38
- package/lib-esm/components/widget-link.js +0 -88
- package/lib-esm/contexts/index.js +0 -12
- package/lib-esm/create-react-component.js +0 -16
- package/lib-esm/hooks/index.js +0 -26
- package/lib-esm/hooks/use-action.js +0 -14
- package/lib-esm/hooks/use-children.js +0 -65
- package/lib-esm/hooks/use-columns.js +0 -4
- package/lib-esm/hooks/use-component-descriptor.js +0 -4
- package/lib-esm/hooks/use-component-node.js +0 -35
- package/lib-esm/hooks/use-component-platform.js +0 -34
- package/lib-esm/hooks/use-component.js +0 -52
- package/lib-esm/hooks/use-container.js +0 -4
- package/lib-esm/hooks/use-context.js +0 -45
- package/lib-esm/hooks/use-dispatch.js +0 -59
- package/lib-esm/hooks/use-event-listener.js +0 -19
- package/lib-esm/hooks/use-events.js +0 -7
- package/lib-esm/hooks/use-is-mounted.js +0 -12
- package/lib-esm/hooks/use-key-press.js +0 -41
- package/lib-esm/hooks/use-layout.js +0 -45
- package/lib-esm/hooks/use-previous.js +0 -9
- package/lib-esm/hooks/use-properties.js +0 -7
- package/lib-esm/hooks/use-render-state.js +0 -65
- package/lib-esm/hooks/use-route-data.js +0 -53
- package/lib-esm/hooks/use-router.js +0 -7
- package/lib-esm/hooks/use-scroll.js +0 -66
- package/lib-esm/hooks/use-settings.js +0 -33
- package/lib-esm/hooks/use-toggle.js +0 -26
- package/lib-esm/hooks/use-transition-end.js +0 -60
- package/lib-esm/hooks/use-unique-menu.js +0 -10
- package/lib-esm/hooks/use-widget-event.js +0 -16
- package/lib-esm/index.js +0 -7
- package/lib-esm/styles.js +0 -26
- package/lib-esm/utils/animations.js +0 -101
- package/lib-esm/utils/browser.js +0 -51
- package/lib-esm/utils/convert-to-string-attributes.js +0 -21
- package/lib-esm/utils/create-empty-component.js +0 -20
- package/lib-esm/utils/embedded-link-mapper.js +0 -57
- package/lib-esm/utils/filter-css-props.js +0 -25
- package/lib-esm/utils/generic-hash-link.js +0 -63
- package/lib-esm/utils/heading-styles.js +0 -44
- package/lib-esm/utils/index.js +0 -10
- package/lib-esm/utils/process-html-string.js +0 -10
- package/lib-esm/utils/render-instructions.js +0 -12
|
@@ -1,100 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
});
|
package/lib/components/text.d.ts
DELETED
package/lib/components/text.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
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;
|
|
@@ -1,30 +0,0 @@
|
|
|
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;
|
|
@@ -1,77 +0,0 @@
|
|
|
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;
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,43 +0,0 @@
|
|
|
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;
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|