@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
package/lib-esm/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnchorLink, Button, Checkbox, Confirm, DateFormats, Drawer, DrawerAnimationType, Dropdown, Empty, Grid, Html, Icon, Input, ItemList, ItemTree, Lightbox, Link, List, Modal, NotFound, Overlay, Paragraph, Portal, RouteLink, SymbolBadge, TabStop, Text, TextLink, Timestamp, Tooltip, TransitionComponent, Typography, WidgetLink, } from './components';
|
|
2
|
+
import { ColumnContext, ComponentNodeContext, ComponentPropertyContext, ContainerContext, RoutingContext, } from './contexts';
|
|
3
|
+
import { default as createReactComponent } from './create-react-component';
|
|
4
|
+
import { useAction, useChildren, useColumns, useComponent, useComponentDescriptor, useComponentNode, useComponentPlatform, useContainer, useContext, useDispatch, useEventListener, useEvents, useIsMounted, useKeyPress, useLayout, usePrevious, useProperties, useRenderState, useRouteData, useRouter, useScroll, useSettings, useToggle, useTransitionEnd, useUniqueMenu, useWidgetEvent, } from './hooks';
|
|
5
|
+
import { borderTabStyle, buttonCss, contentBox, invertedHoverButton, itemList, linkTabStyle, list, paddedBorderTabStyle, StyledText, } from './styles';
|
|
6
|
+
import { createEmptyComponent, filterCssProps, filterCssPropsStyle, headingElement, transitionComposer, } from './utils';
|
|
7
|
+
export { AnchorLink, borderTabStyle, Button, buttonCss, Checkbox, ColumnContext, ComponentNodeContext, ComponentPropertyContext, Confirm, ContainerContext, contentBox, createEmptyComponent, createReactComponent, DateFormats, Drawer, DrawerAnimationType, Dropdown, filterCssProps, filterCssPropsStyle, Grid, headingElement, Html, Icon, Input, invertedHoverButton, ItemList, ItemTree, Lightbox, Link, linkTabStyle, List, paddedBorderTabStyle, RoutingContext, SymbolBadge, Text, TextLink, TransitionComponent, transitionComposer, Typography, useChildren, useColumns, useComponent, useComponentDescriptor, useComponentNode, useComponentPlatform, useContainer, useContext, useDispatch, useIsMounted, useLayout, useProperties, useRenderState, useRouteData, useRouter, useScroll, useTransitionEnd, useAction, useEventListener, useEvents, useKeyPress, usePrevious, useSettings, useToggle, useUniqueMenu, useWidgetEvent, Empty, Modal, NotFound, Overlay, Paragraph, Portal, RouteLink, TabStop, Timestamp, Tooltip, WidgetLink, itemList, list, StyledText, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type InvertedHoverButtonSettings = {
|
|
3
|
+
primaryColor: string;
|
|
4
|
+
secondaryColor: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const contentBox: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
|
|
8
|
+
'data-loading'?: boolean | undefined;
|
|
9
|
+
}, any>>;
|
|
10
|
+
export declare const buttonCss: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
11
|
+
export declare const invertedHoverButton: ({ primaryColor, secondaryColor, active, }: InvertedHoverButtonSettings) => import("styled-components").FlattenInterpolation<any>;
|
|
12
|
+
export declare const borderTabStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
13
|
+
export declare const linkTabStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
14
|
+
export declare const paddedBorderTabStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
15
|
+
export declare const CloseButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").RefAttributes<HTMLButtonElement>>, any, any, never>;
|
|
16
|
+
export declare const StyledText: import("styled-components").StyledComponent<import("react").FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, any, {}, never>;
|
|
17
|
+
export declare const list: import("styled-components").FlattenInterpolation<any>;
|
|
18
|
+
export declare const itemList: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
6
|
+
import { Button, Text } from './components';
|
|
7
|
+
import { headingElement } from './utils';
|
|
8
|
+
export var contentBox = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-direction: column;\n background: #ffffff;\n border-radius: ", ";\n border: ", ";\n box-shadow: ", ";\n ", "\n"], ["\n display: flex;\n justify-content: center;\n flex-direction: column;\n background: #ffffff;\n border-radius: ", ";\n border: ", ";\n box-shadow: ", ";\n ", "\n"])), function (p) { return p.theme.borderRadius; }, function (p) { return p.theme.border; }, function (p) { return p.theme.boxShadow || 'none'; }, function (p) { return p['data-loading'] && 'min-height: 150px;'; });
|
|
9
|
+
export var buttonCss = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n cursor: pointer;\n text-align: center;\n border: none;\n padding: ", ";\n border-radius: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 300;\n"], ["\n cursor: pointer;\n text-align: center;\n border: none;\n padding: ", ";\n border-radius: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 300;\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { return p.theme.borderRadius; }, 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; });
|
|
10
|
+
export var invertedHoverButton = function (_a) {
|
|
11
|
+
var primaryColor = _a.primaryColor, secondaryColor = _a.secondaryColor, active = _a.active;
|
|
12
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n border: 1px solid ", ";\n background-color: ", ";\n\n color: ", ";\n transition: background-color 200ms ease-out, color 200ms ease-out;\n\n span,\n i,\n p,\n a {\n transition: color 200ms ease-out;\n color: ", ";\n font-size: ", ";\n }\n\n ", "\n"], ["\n ", "\n border: 1px solid ", ";\n background-color: ", ";\n\n color: ", ";\n transition: background-color 200ms ease-out, color 200ms ease-out;\n\n span,\n i,\n p,\n a {\n transition: color 200ms ease-out;\n color: ", ";\n font-size: ", ";\n }\n\n ", "\n"])), buttonCss, active ? secondaryColor : primaryColor, active ? primaryColor : secondaryColor, active ? secondaryColor : primaryColor, active ? secondaryColor : primaryColor, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) {
|
|
13
|
+
return !p.disabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n color: ", ";\n\n span,\n i,\n p,\n a {\n color: ", ";\n }\n }\n\n &:focus {\n ", ";\n }\n "], ["\n &:hover {\n background-color: ", ";\n color: ", ";\n\n span,\n i,\n p,\n a {\n color: ", ";\n }\n }\n\n &:focus {\n ", ";\n }\n "])), primaryColor, secondaryColor, secondaryColor, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && borderTabStyle; });
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export var borderTabStyle = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n outline: ", ";\n color: ", ";\n border-color: transparent;\n"], ["\n outline: ", ";\n color: ", ";\n border-color: transparent;\n"])), function (p) { var _a; return (_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.border; }, function (p) { var _a, _b; return (_b = (_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.colors) === null || _b === void 0 ? void 0 : _b.inactiveText; });
|
|
17
|
+
export var linkTabStyle = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n text-decoration: underline;\n"], ["\n ", "\n text-decoration: underline;\n"])), borderTabStyle);
|
|
18
|
+
export var paddedBorderTabStyle = css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n outline-offset: ", ";\n"], ["\n ", "\n outline-offset: ", ";\n"])), borderTabStyle, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
19
|
+
export var CloseButton = styled(Button)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n right: ", ";\n z-index: 1;\n\n svg {\n stroke: ", ";\n }\n\n &:focus {\n ", ";\n }\n"], ["\n position: absolute;\n top: ", ";\n right: ", ";\n z-index: 1;\n\n svg {\n stroke: ", ";\n }\n\n &:focus {\n ", ";\n }\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.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) {
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n padding: ", ";\n height: 15px;\n box-sizing: content-box;\n "], ["\n ", "\n padding: ", ";\n height: 15px;\n box-sizing: content-box;\n "])), borderTabStyle, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
22
|
+
});
|
|
23
|
+
export var StyledText = styled(Text)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: normal;\n line-height: 1.2em;\n color: ", ";\n"], ["\n font-size: ", ";\n font-weight: normal;\n line-height: 1.2em;\n color: ", ";\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.colors) === null || _a === void 0 ? void 0 : _a.text; });
|
|
24
|
+
export var list = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: 0;\n margin: 0;\n list-style: none;\n > li {\n margin: 0 0 ", ";\n white-space: nowrap;\n text-overflow: ellipsis;\n min-width: 0;\n &:focus {\n outline-offset: -2px;\n }\n > a {\n text-decoration: none;\n }\n }\n > li:last-child {\n margin: 0;\n }\n"], ["\n padding: 0;\n margin: 0;\n list-style: none;\n > li {\n margin: 0 0 ", ";\n white-space: nowrap;\n text-overflow: ellipsis;\n min-width: 0;\n &:focus {\n outline-offset: -2px;\n }\n > a {\n text-decoration: none;\n }\n }\n > li:last-child {\n margin: 0;\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; });
|
|
25
|
+
export var itemList = css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n > div {\n ", "\n }\n > ul {\n ", "\n }\n\n ", "\n"], ["\n > div {\n ", "\n }\n > ul {\n ", "\n }\n\n ", "\n"])), headingElement('> h1', css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n margin: 0 0 ", ";\n font-size: ", ";\n font-weight: normal;\n line-height: 1.8em;\n color: ", ";\n "], ["\n margin: 0 0 ", ";\n font-size: ", ";\n font-weight: normal;\n line-height: 1.8em;\n color: ", ";\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.medium; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; })), list, headingElement('h1', css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n\n i {\n margin: 7px ", " 0 0;\n width: 24px;\n display: inline-block;\n vertical-align: text-bottom;\n align-self: flex-start;\n min-width: 24px;\n min-height: 24px;\n text-align: center;\n }\n "], ["\n display: flex;\n align-items: center;\n\n i {\n margin: 7px ", " 0 0;\n width: 24px;\n display: inline-block;\n vertical-align: text-bottom;\n align-self: flex-start;\n min-width: 24px;\n min-height: 24px;\n text-align: center;\n }\n "])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; })));
|
|
26
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransitionStatus } from 'react-transition-group/Transition';
|
|
2
|
+
import { FlattenInterpolation } from 'styled-components';
|
|
3
|
+
export declare type CssTransitions = {
|
|
4
|
+
[key: string]: FlattenInterpolation<any>;
|
|
5
|
+
};
|
|
6
|
+
export declare type TransitionStateSettings = {
|
|
7
|
+
transitionKeys: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
easing?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const transitionComposer: {
|
|
12
|
+
compose: (status: TransitionStatus | undefined, definitions: {
|
|
13
|
+
enter: TransitionStateSettings;
|
|
14
|
+
exit: TransitionStateSettings;
|
|
15
|
+
}) => false | import("styled-components").FlattenSimpleInterpolation | "" | undefined;
|
|
16
|
+
composeViewTransition: (status: TransitionStatus, type: string, direction?: "forth" | "back" | undefined) => false | import("styled-components").FlattenSimpleInterpolation | "" | undefined;
|
|
17
|
+
get: (title: string) => any;
|
|
18
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
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 { css } from 'styled-components';
|
|
6
|
+
var inEnteringState = function (status) {
|
|
7
|
+
return status === 'entering' || status === 'entered';
|
|
8
|
+
};
|
|
9
|
+
var inExitingState = function (status) {
|
|
10
|
+
return status === 'exiting' || status === 'exited';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* List of basic transition presets
|
|
14
|
+
*/
|
|
15
|
+
var partials = {
|
|
16
|
+
fade: {
|
|
17
|
+
in: 'opacity: 1;',
|
|
18
|
+
out: 'opacity: 0;',
|
|
19
|
+
},
|
|
20
|
+
'slide-left': {
|
|
21
|
+
in: 'transform: translateX(0);',
|
|
22
|
+
out: 'transform: translateX(-100%);',
|
|
23
|
+
},
|
|
24
|
+
'slide-right': {
|
|
25
|
+
in: 'transform: translateX(0);',
|
|
26
|
+
out: 'transform: translateX(100%);',
|
|
27
|
+
},
|
|
28
|
+
'slide-up': {
|
|
29
|
+
in: 'transform: translateY(0);',
|
|
30
|
+
out: 'transform: translateY(100%);',
|
|
31
|
+
},
|
|
32
|
+
'slide-down': {
|
|
33
|
+
in: 'transform: translateY(0);',
|
|
34
|
+
out: 'transform: translateY(-100%);',
|
|
35
|
+
},
|
|
36
|
+
scale: {
|
|
37
|
+
in: 'transform: scale(1);',
|
|
38
|
+
out: 'transform: scale(0);',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
var transformTransitions = ['slide-up', 'slide-down', 'slide-left', 'slide-right', 'scale'];
|
|
42
|
+
export var transitionComposer = {
|
|
43
|
+
compose: function (status, definitions) {
|
|
44
|
+
if (status === void 0) { status = 'exited'; }
|
|
45
|
+
var enter = definitions.enter, exit = definitions.exit;
|
|
46
|
+
var inKeys = enter.transitionKeys.split(' ');
|
|
47
|
+
var transitionProperty = transformTransitions.indexOf(inKeys[0]) > -1 ? 'transform' : 'opacity';
|
|
48
|
+
if (inEnteringState(status)) {
|
|
49
|
+
if (inKeys && inKeys.length > 0) {
|
|
50
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n transition: ", " ", "ms ", ";\n "], ["\n ", "\n transition: ", " ", "ms ", ";\n "])), inKeys &&
|
|
51
|
+
inKeys.length > 0 &&
|
|
52
|
+
inKeys.map(function (key) { return (partials[key] ? partials[key].in : ''); }), transitionProperty, enter.duration, enter.easing);
|
|
53
|
+
}
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
var inBase = inKeys &&
|
|
57
|
+
inKeys.length > 0 && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), inKeys.map(function (key) { return (partials[key] ? partials[key].out : ''); }));
|
|
58
|
+
if (inExitingState(status)) {
|
|
59
|
+
var outKeys = exit.transitionKeys.split(' ');
|
|
60
|
+
if (outKeys && outKeys.length > 0 && status === 'exiting') {
|
|
61
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n ", "\n transition: ", " ", "ms ", ";\n "], ["\n ", ";\n ", "\n transition: ", " ", "ms ", ";\n "])), inBase, outKeys.map(function (key) { return (partials[key] ? partials[key].out : ''); }), transitionProperty, exit.duration, exit.easing);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* When a component is mounted, it starts with the 'exited' state.
|
|
65
|
+
* So instead of forcing the component that utilizes this function to add the original state
|
|
66
|
+
* of the to-be-animated property, we apply the out-state values of the entering transitions.
|
|
67
|
+
*/
|
|
68
|
+
return inBase;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
composeViewTransition: function (status, type, direction) {
|
|
72
|
+
if (type === 'slide') {
|
|
73
|
+
return transitionComposer.compose(status, {
|
|
74
|
+
enter: {
|
|
75
|
+
transitionKeys: direction === 'forth' ? 'slide-right' : 'slide-left',
|
|
76
|
+
duration: 500,
|
|
77
|
+
},
|
|
78
|
+
exit: {
|
|
79
|
+
transitionKeys: direction === 'forth' ? 'slide-left' : 'slide-right',
|
|
80
|
+
duration: 500,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (type === 'fade') {
|
|
85
|
+
return transitionComposer.compose(status, {
|
|
86
|
+
enter: {
|
|
87
|
+
transitionKeys: 'fade',
|
|
88
|
+
duration: 500,
|
|
89
|
+
},
|
|
90
|
+
exit: {
|
|
91
|
+
transitionKeys: 'fade',
|
|
92
|
+
duration: 500,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
get: function (title) {
|
|
98
|
+
return partials[title];
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum Browsers {
|
|
2
|
+
Opera = "opera",
|
|
3
|
+
Chrome = "chrome",
|
|
4
|
+
Firefox = "firefox",
|
|
5
|
+
Safari = "safari",
|
|
6
|
+
Edge = "edge",
|
|
7
|
+
EdgeChromium = "edge-chromium",
|
|
8
|
+
Blink = "blink",
|
|
9
|
+
IE = "internet-explorer"
|
|
10
|
+
}
|
|
11
|
+
declare const _default: () => Browsers | void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export var Browsers;
|
|
2
|
+
(function (Browsers) {
|
|
3
|
+
Browsers["Opera"] = "opera";
|
|
4
|
+
Browsers["Chrome"] = "chrome";
|
|
5
|
+
Browsers["Firefox"] = "firefox";
|
|
6
|
+
Browsers["Safari"] = "safari";
|
|
7
|
+
Browsers["Edge"] = "edge";
|
|
8
|
+
Browsers["EdgeChromium"] = "edge-chromium";
|
|
9
|
+
Browsers["Blink"] = "blink";
|
|
10
|
+
Browsers["IE"] = "internet-explorer";
|
|
11
|
+
})(Browsers || (Browsers = {}));
|
|
12
|
+
export default (function () {
|
|
13
|
+
var opr = window.opr, opera = window.opera, InstallTrigger = window.InstallTrigger, HTMLElement = window.HTMLElement, safari = window.safari, documentMode = window.documentMode, StyleMedia = window.StyleMedia, chrome = window.chrome, CSS = window.CSS;
|
|
14
|
+
// Opera 8.0+
|
|
15
|
+
var isOpera = (!!opr && !!opr.addons) || !!opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
16
|
+
if (isOpera) {
|
|
17
|
+
return Browsers.Opera;
|
|
18
|
+
}
|
|
19
|
+
// Firefox 1.0+
|
|
20
|
+
if (InstallTrigger) {
|
|
21
|
+
return Browsers.Firefox;
|
|
22
|
+
}
|
|
23
|
+
// Safari 3.0+ '[object HTMLElementConstructor]'
|
|
24
|
+
var safariCheck = (function (p) {
|
|
25
|
+
return p.toString() === '[object SafariRemoteNotification]';
|
|
26
|
+
})(!safari || (typeof safari !== 'undefined' && safari.pushNotification));
|
|
27
|
+
if (/constructor/i.test(HTMLElement) || safariCheck) {
|
|
28
|
+
return Browsers.Safari;
|
|
29
|
+
}
|
|
30
|
+
// Internet Explorer 6-11
|
|
31
|
+
var isIE = /*@cc_on!@*/ false || !!documentMode;
|
|
32
|
+
if (isIE) {
|
|
33
|
+
return Browsers.IE;
|
|
34
|
+
}
|
|
35
|
+
// Edge 20+
|
|
36
|
+
if (!isIE && !!StyleMedia) {
|
|
37
|
+
return Browsers.Edge;
|
|
38
|
+
}
|
|
39
|
+
// Chrome 1 - 79
|
|
40
|
+
var isChrome = !!chrome && (!!chrome.webstore || !!chrome.runtime);
|
|
41
|
+
if (isChrome) {
|
|
42
|
+
return Browsers.Chrome;
|
|
43
|
+
}
|
|
44
|
+
// Edge (based on chromium) detection
|
|
45
|
+
if (isChrome && navigator.userAgent.indexOf('Edg') !== -1) {
|
|
46
|
+
return Browsers.EdgeChromium;
|
|
47
|
+
}
|
|
48
|
+
if ((isChrome || isOpera) && !!CSS) {
|
|
49
|
+
return Browsers.Blink;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { kebabCase } from '@telia-ace/widget-utilities';
|
|
2
|
+
var types = ['string', 'number'];
|
|
3
|
+
export default (function (props) {
|
|
4
|
+
return Object.keys(props).reduce(function (result, key) {
|
|
5
|
+
var value = typeof props[key] === 'undefined' ? '' : props[key];
|
|
6
|
+
var type = typeof value;
|
|
7
|
+
if (types.indexOf(type) > -1) {
|
|
8
|
+
var sub = key.substring(0, 5);
|
|
9
|
+
if (sub === 'data-' || sub === 'aria-') {
|
|
10
|
+
result[kebabCase(key)] = value.toString();
|
|
11
|
+
}
|
|
12
|
+
else if (key.substring(0, 4) !== 'css-') {
|
|
13
|
+
result[key] = value.toString();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
result[key] = value;
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}, {});
|
|
21
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Empty } from '../components';
|
|
14
|
+
var createEmptyComponent = function (container, props) {
|
|
15
|
+
if (container.get('seoConfiguration')) {
|
|
16
|
+
return React.createElement(Empty, __assign({}, props));
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
export default createEmptyComponent;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { AnchorLink, WidgetLink } from '../components';
|
|
25
|
+
// Determine if href starts with a hashtag
|
|
26
|
+
var isAnchorLink = function (href) {
|
|
27
|
+
var re = new RegExp('^#', 'i');
|
|
28
|
+
var match = re.test(href);
|
|
29
|
+
return match;
|
|
30
|
+
};
|
|
31
|
+
var embeddedLinkMapper = function (container) {
|
|
32
|
+
return function (_a) {
|
|
33
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
34
|
+
var _b = container.get('$widget'), implementation = _b.implementation, currentWidgetName = _b.name;
|
|
35
|
+
var _c = props.href, href = _c === void 0 ? '' : _c;
|
|
36
|
+
if (isAnchorLink(href)) {
|
|
37
|
+
return (React.createElement(AnchorLink, { smooth: true, to: href }, children));
|
|
38
|
+
}
|
|
39
|
+
var escapedBindings = implementation.bindings
|
|
40
|
+
.map(function (binding) { return binding.replace(/\./g, '\\.'); })
|
|
41
|
+
.join('|');
|
|
42
|
+
var regexp = new RegExp("^((http[s]?:)?//)?(".concat(escapedBindings, ")/([^\\s]+)"));
|
|
43
|
+
var expArray = regexp.exec(href);
|
|
44
|
+
if (expArray && expArray.length >= 4) {
|
|
45
|
+
var targetWidgetName = expArray[4];
|
|
46
|
+
var targetWidget = implementation.widgets.get(targetWidgetName);
|
|
47
|
+
// blob links should not be treated as a widget link
|
|
48
|
+
if (targetWidget &&
|
|
49
|
+
!targetWidgetName.startsWith('blob?') &&
|
|
50
|
+
!targetWidgetName.startsWith(currentWidgetName)) {
|
|
51
|
+
return React.createElement(WidgetLink, { widgetName: targetWidgetName }, children);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return React.createElement("a", __assign({}, props), children);
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export default embeddedLinkMapper;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const filterCssProps: (props: any) => {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
};
|
|
4
|
+
declare type FilterCssPropsStyle = {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const filterCssPropsStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<FilterCssPropsStyle, any>>;
|
|
8
|
+
export default filterCssProps;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { css } from 'styled-components';
|
|
6
|
+
var filterCssProps = function (props) {
|
|
7
|
+
var cssProps = {};
|
|
8
|
+
Object.keys(props).forEach(function (key) {
|
|
9
|
+
if (key.indexOf('css-') > -1) {
|
|
10
|
+
cssProps[key] = props[key];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return cssProps;
|
|
14
|
+
};
|
|
15
|
+
export var filterCssPropsStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
16
|
+
var css = '';
|
|
17
|
+
Object.keys(filterCssProps(p)).forEach(function (key) {
|
|
18
|
+
if (key.indexOf('css-') > -1) {
|
|
19
|
+
css += "".concat(key.replace('css-', ''), ":").concat(p[key], ";");
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return css;
|
|
23
|
+
});
|
|
24
|
+
export default filterCssProps;
|
|
25
|
+
var templateObject_1;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
export var genericHashLink = function (props, As) {
|
|
25
|
+
var hashFragment = '';
|
|
26
|
+
var reset = function () {
|
|
27
|
+
hashFragment = '';
|
|
28
|
+
};
|
|
29
|
+
var getElementAndScroll = function (scrollFunction) {
|
|
30
|
+
var element = document.getElementById(hashFragment);
|
|
31
|
+
if (element !== null) {
|
|
32
|
+
scrollFunction(element);
|
|
33
|
+
reset();
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
};
|
|
38
|
+
var handleClick = function (e) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
reset();
|
|
41
|
+
if (props.onClick)
|
|
42
|
+
props.onClick(e);
|
|
43
|
+
// try to get hash fragment
|
|
44
|
+
if (typeof props.to === 'string') {
|
|
45
|
+
hashFragment = props.to.split('#').slice(1).join('#');
|
|
46
|
+
}
|
|
47
|
+
// if hash fragment is present
|
|
48
|
+
if (hashFragment !== '') {
|
|
49
|
+
getElementAndScroll(props.scroll ||
|
|
50
|
+
(function (el) {
|
|
51
|
+
return props.smooth
|
|
52
|
+
? el.scrollIntoView({ behavior: 'smooth' })
|
|
53
|
+
: el.scrollIntoView();
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
|
+
var scroll = props.scroll, smooth = props.smooth, to = props.to, filteredProps = __rest(props, ["scroll", "smooth", "to"]);
|
|
59
|
+
if (As === 'a') {
|
|
60
|
+
filteredProps.href = 'javascript:;';
|
|
61
|
+
}
|
|
62
|
+
return (React.createElement(As, __assign({}, filteredProps, { onClick: handleClick }), props.children));
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const headingElement: (element: string, style: any) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 __read = (this && this.__read) || function (o, n) {
|
|
6
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
7
|
+
if (!m) return o;
|
|
8
|
+
var i = m.call(o), r, ar = [], e;
|
|
9
|
+
try {
|
|
10
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11
|
+
}
|
|
12
|
+
catch (error) { e = { error: error }; }
|
|
13
|
+
finally {
|
|
14
|
+
try {
|
|
15
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
16
|
+
}
|
|
17
|
+
finally { if (e) throw e.error; }
|
|
18
|
+
}
|
|
19
|
+
return ar;
|
|
20
|
+
};
|
|
21
|
+
import { css } from 'styled-components';
|
|
22
|
+
export var headingElement = function (element, style) {
|
|
23
|
+
var defaultTag = element;
|
|
24
|
+
var prefix = '';
|
|
25
|
+
if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(element)) {
|
|
26
|
+
defaultTag = element;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
var match = element.match(/h1|h2|h3|h4|h5|h6/);
|
|
30
|
+
if (match === null || match === void 0 ? void 0 : match[0]) {
|
|
31
|
+
defaultTag = match[0];
|
|
32
|
+
var _a = __read(element.split(defaultTag), 1), pre = _a[0];
|
|
33
|
+
prefix = pre;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var renderTag = function (element, pre, mapping) {
|
|
37
|
+
if (mapping[element]) {
|
|
38
|
+
return "".concat(pre).concat(mapping[element]);
|
|
39
|
+
}
|
|
40
|
+
return "".concat(pre).concat(element);
|
|
41
|
+
};
|
|
42
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n ", "\n }\n "], ["\n ", " {\n ", "\n }\n "])), function (p) { return renderTag(defaultTag, prefix, p.theme.typographyVariantMapping || {}); }, style);
|
|
43
|
+
};
|
|
44
|
+
var templateObject_1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { transitionComposer } from './animations';
|
|
2
|
+
export type { TransitionStateSettings } from './animations';
|
|
3
|
+
export { Browsers, default as browser } from './browser';
|
|
4
|
+
export { default as convertToStringAttributes } from './convert-to-string-attributes';
|
|
5
|
+
export { default as createEmptyComponent } from './create-empty-component';
|
|
6
|
+
export { default as embeddedLinkMapper } from './embedded-link-mapper';
|
|
7
|
+
export { default as filterCssProps, filterCssPropsStyle } from './filter-css-props';
|
|
8
|
+
export { genericHashLink } from './generic-hash-link';
|
|
9
|
+
export type { Props as GenericHashLinkProps } from './generic-hash-link';
|
|
10
|
+
export { headingElement } from './heading-styles';
|
|
11
|
+
export { default as processHtmlString } from './process-html-string';
|
|
12
|
+
export { defaultRenderInstructions } from './render-instructions';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { transitionComposer } from './animations';
|
|
2
|
+
export { Browsers, default as browser } from './browser';
|
|
3
|
+
export { default as convertToStringAttributes } from './convert-to-string-attributes';
|
|
4
|
+
export { default as createEmptyComponent } from './create-empty-component';
|
|
5
|
+
export { default as embeddedLinkMapper } from './embedded-link-mapper';
|
|
6
|
+
export { default as filterCssProps, filterCssPropsStyle } from './filter-css-props';
|
|
7
|
+
export { genericHashLink } from './generic-hash-link';
|
|
8
|
+
export { headingElement } from './heading-styles';
|
|
9
|
+
export { default as processHtmlString } from './process-html-string';
|
|
10
|
+
export { defaultRenderInstructions } from './render-instructions';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Container } from '@webprovisions/platform';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const defaultRenderInstructions: (container: Container) => {
|
|
4
|
+
transform: {
|
|
5
|
+
a: ({ children, ...props }: any) => JSX.Element;
|
|
6
|
+
img: (attrs: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLImageElement>, HTMLImageElement>) => JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Lightbox } from '../components';
|
|
3
|
+
import embeddedLinkMapper from './embedded-link-mapper';
|
|
4
|
+
var imageLightboxRenderer = function (attrs) { return React.createElement(Lightbox, { attrs: attrs }); };
|
|
5
|
+
export var defaultRenderInstructions = function (container) {
|
|
6
|
+
return {
|
|
7
|
+
transform: {
|
|
8
|
+
a: embeddedLinkMapper(container),
|
|
9
|
+
img: imageLightboxRenderer,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
};
|