@telia/teddy 0.7.14 → 0.7.15
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/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +4 -2
- package/dist/components/navigation-menu/global-navigation/utils.cjs +14 -1
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +785 -3
- package/dist/components/navigation-menu/global-navigation/utils.js +14 -1
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +160 -159
- package/dist/components/radio-card-group/radio-card-group-item-title.js +161 -160
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { AppKey } from './utils';
|
|
2
|
+
import { AppKey, CustomLinksConfig } from './utils';
|
|
3
3
|
|
|
4
4
|
export declare const rootClassName = "teddy-global-navigation";
|
|
5
5
|
type User = {
|
|
@@ -19,6 +19,7 @@ export type RootProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
|
19
19
|
onCartOpenChange?: (open: boolean) => void;
|
|
20
20
|
drawerSize: 'md' | 'lg';
|
|
21
21
|
isSimplified?: boolean;
|
|
22
|
+
customLinks?: CustomLinksConfig;
|
|
22
23
|
currentPath: string | undefined;
|
|
23
24
|
onSearchInputChange?: (e: React.ChangeEvent<HTMLInputElement>, value?: string) => void;
|
|
24
25
|
onSearchKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -34,9 +35,10 @@ type RootContext = {
|
|
|
34
35
|
setPathname: (v: string) => void;
|
|
35
36
|
specifiedLink?: string;
|
|
36
37
|
setSpecifiedLink: (v: string) => void;
|
|
38
|
+
customLinks?: CustomLinksConfig;
|
|
37
39
|
} & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize' | 'onSearchInputChange' | 'onSearchKeyDown' | 'searchValue' | 'onClear'>;
|
|
38
40
|
export declare const RootContext: React.Context<RootContext | null>;
|
|
39
|
-
export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, onSearchInputChange, onSearchKeyDown, searchValue, onClear, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, customLinks, currentPath, onSearchInputChange, onSearchKeyDown, searchValue, onClear, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
40
42
|
export declare namespace Root {
|
|
41
43
|
var displayName: string;
|
|
42
44
|
}
|
|
@@ -1097,7 +1097,16 @@ const MDU_LINKS = {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
]
|
|
1099
1099
|
};
|
|
1100
|
-
const
|
|
1100
|
+
const DEFAULT_PRIVATE_LINKS = PRIVATE_LINKS;
|
|
1101
|
+
const DEFAULT_BUSINESS_LINKS = BUSINESS_LINKS;
|
|
1102
|
+
const DEFAULT_BUSINESS_UKKO_LINKS = BUSINESS_UKKO_LINKS;
|
|
1103
|
+
const DEFAULT_MDU_LINKS = MDU_LINKS;
|
|
1104
|
+
const getLinks = (ukko = false, customLinks) => {
|
|
1105
|
+
const privateLinks = (customLinks == null ? void 0 : customLinks.privateLinks) || DEFAULT_PRIVATE_LINKS;
|
|
1106
|
+
const businessLinks = ukko ? (customLinks == null ? void 0 : customLinks.businessUkkoLinks) || DEFAULT_BUSINESS_UKKO_LINKS : (customLinks == null ? void 0 : customLinks.businessLinks) || DEFAULT_BUSINESS_LINKS;
|
|
1107
|
+
const mduLinks = (customLinks == null ? void 0 : customLinks.mduLinks) || DEFAULT_MDU_LINKS;
|
|
1108
|
+
return [privateLinks, businessLinks, mduLinks];
|
|
1109
|
+
};
|
|
1101
1110
|
const getActiveSubLink = (path, links) => {
|
|
1102
1111
|
let activeLink = "";
|
|
1103
1112
|
links.forEach((link) => {
|
|
@@ -1111,6 +1120,10 @@ exports.APP_KEYS = APP_KEYS;
|
|
|
1111
1120
|
exports.BUSINESS_LINKS = BUSINESS_LINKS;
|
|
1112
1121
|
exports.BUSINESS_NET_LINKS = BUSINESS_NET_LINKS;
|
|
1113
1122
|
exports.BUSINESS_UKKO_LINKS = BUSINESS_UKKO_LINKS;
|
|
1123
|
+
exports.DEFAULT_BUSINESS_LINKS = DEFAULT_BUSINESS_LINKS;
|
|
1124
|
+
exports.DEFAULT_BUSINESS_UKKO_LINKS = DEFAULT_BUSINESS_UKKO_LINKS;
|
|
1125
|
+
exports.DEFAULT_MDU_LINKS = DEFAULT_MDU_LINKS;
|
|
1126
|
+
exports.DEFAULT_PRIVATE_LINKS = DEFAULT_PRIVATE_LINKS;
|
|
1114
1127
|
exports.LOGGED_IN_LINKS = LOGGED_IN_LINKS;
|
|
1115
1128
|
exports.LOGGED_IN_LINKS_BUSINESS = LOGGED_IN_LINKS_BUSINESS;
|
|
1116
1129
|
exports.MDU_LINKS = MDU_LINKS;
|