@telia/teddy 0.0.35 → 0.0.37

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.
Files changed (41) hide show
  1. package/dist/components/badge/badge.cjs +10 -10
  2. package/dist/components/badge/badge.js +10 -10
  3. package/dist/components/card/card.cjs +18 -2
  4. package/dist/components/card/card.d.ts +2 -0
  5. package/dist/components/card/card.js +18 -2
  6. package/dist/components/drawer/drawer-close.cjs +1 -1
  7. package/dist/components/drawer/drawer-close.js +1 -1
  8. package/dist/components/drawer/drawer-content.cjs +2 -2
  9. package/dist/components/drawer/drawer-content.js +2 -2
  10. package/dist/components/drawer/drawer-description.cjs +1 -1
  11. package/dist/components/drawer/drawer-description.js +1 -1
  12. package/dist/components/drawer/drawer-footer.cjs +1 -1
  13. package/dist/components/drawer/drawer-footer.js +1 -1
  14. package/dist/components/drawer/drawer-overlay.cjs +1 -1
  15. package/dist/components/drawer/drawer-overlay.js +1 -1
  16. package/dist/components/drawer/drawer-title.cjs +1 -1
  17. package/dist/components/drawer/drawer-title.js +1 -1
  18. package/dist/components/expandable-card/expandable-card-indicator.cjs +0 -1
  19. package/dist/components/expandable-card/expandable-card-indicator.js +0 -1
  20. package/dist/components/expandable-card/expandable-card-root.cjs +15 -15
  21. package/dist/components/expandable-card/expandable-card-root.js +15 -15
  22. package/dist/components/expandable-card/index.cjs +4 -1
  23. package/dist/components/expandable-card/index.d.ts +3 -0
  24. package/dist/components/expandable-card/index.js +4 -1
  25. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop-simplified.cjs +9 -0
  26. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop-simplified.d.ts +8 -0
  27. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop-simplified.js +9 -0
  28. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile-simplified.cjs +12 -0
  29. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile-simplified.d.ts +7 -0
  30. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile-simplified.js +12 -0
  31. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +52 -2
  32. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +53 -3
  33. package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +2 -1
  34. package/dist/components/navigation-menu/global-navigation/global-navigation-root.js +2 -2
  35. package/dist/components/notification/notification.d.ts +3 -0
  36. package/dist/drawer.module-BNPErv-x.js +16 -0
  37. package/dist/drawer.module-CTowTFmf.cjs +15 -0
  38. package/dist/style.css +135 -116
  39. package/package.json +1 -1
  40. package/dist/drawer.module-BPXo6-Q2.js +0 -15
  41. package/dist/drawer.module-_pUdp_M1.cjs +0 -14
@@ -327,6 +327,47 @@ function Mobile(props) {
327
327
  ] }) });
328
328
  }
329
329
  Mobile.displayName = "Mobile";
330
+ const DesktopSimplified = React.forwardRef(() => {
331
+ const rootContext = React.useContext(RootContext);
332
+ if (!rootContext)
333
+ return null;
334
+ const { setSelectedMenuItem, linkComponent: Link } = rootContext;
335
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
336
+ components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.List, { value: link.name, children: [
337
+ link.links.map((subLink) => /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { value: subLink.name, children: subLink.name === "Logo" && /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
338
+ "img",
339
+ {
340
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
341
+ draggable: "false",
342
+ alt: "Telia logo"
343
+ }
344
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
345
+ "img",
346
+ {
347
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
348
+ draggable: "false",
349
+ alt: "Telia logo"
350
+ }
351
+ ) }) }) }, subLink.name)),
352
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
353
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) })
354
+ ] }, link.name)),
355
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Viewport, { className: styles[`${rootClassName}__viewport`] })
356
+ ] });
357
+ });
358
+ DesktopSimplified.displayName = "DesktopSimplified";
359
+ function MobileSimplified(props) {
360
+ const rootContext = React.useContext(RootContext);
361
+ if (!rootContext)
362
+ return null;
363
+ const { linkComponent: NavLink } = rootContext;
364
+ const classes = clsx([styles[`${rootClassName}__mobile`]], props.className);
365
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { flexGrow: "1", justify: "between", align: "center", gap: "200", children: [
366
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { flexShrink: "0", children: /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: rootContext.appKey === "open-pages" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) }) }),
367
+ /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { flexBasis: "0", gap: { sm: "100", md: "200" }, children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) })
368
+ ] }) });
369
+ }
370
+ MobileSimplified.displayName = "MobileSimplified";
330
371
  const rootClassName = "teddy-global-navigation";
331
372
  const RootContext = React.createContext(null);
332
373
  function Root({
@@ -341,6 +382,7 @@ function Root({
341
382
  isCartOpen,
342
383
  onCartOpenChange,
343
384
  drawerSize = "md",
385
+ isSimplified,
344
386
  ...props
345
387
  }) {
346
388
  const [selectedMenuItem, setSelectedMenuItem] = React.useState(getInitialMenuItem());
@@ -380,8 +422,14 @@ function Root({
380
422
  setSelectedMenuItem(v);
381
423
  },
382
424
  children: [
383
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { display: { sm: "none", lg: "block" }, children: /* @__PURE__ */ jsxRuntime.jsx(Desktop, {}) }),
384
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { display: { lg: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(Mobile, {}) })
425
+ /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { display: { sm: "none", lg: "block" }, children: [
426
+ isSimplified && /* @__PURE__ */ jsxRuntime.jsx(DesktopSimplified, {}),
427
+ !isSimplified && /* @__PURE__ */ jsxRuntime.jsx(Desktop, {})
428
+ ] }),
429
+ /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { display: { lg: "none" }, children: [
430
+ isSimplified && /* @__PURE__ */ jsxRuntime.jsx(MobileSimplified, {}),
431
+ !isSimplified && /* @__PURE__ */ jsxRuntime.jsx(Mobile, {})
432
+ ] })
385
433
  ]
386
434
  }
387
435
  ) })
@@ -419,8 +467,10 @@ function getInitialMenuItem() {
419
467
  Root.displayName = "GlobalNavigation";
420
468
  const GlobalNavigation = Root;
421
469
  exports.Desktop = Desktop;
470
+ exports.DesktopSimplified = DesktopSimplified;
422
471
  exports.GlobalNavigation = GlobalNavigation;
423
472
  exports.Mobile = Mobile;
473
+ exports.MobileSimplified = MobileSimplified;
424
474
  exports.MyPages = MyPages;
425
475
  exports.Root = Root;
426
476
  exports.RootContext = RootContext;
@@ -325,6 +325,47 @@ function Mobile(props) {
325
325
  ] }) });
326
326
  }
327
327
  Mobile.displayName = "Mobile";
328
+ const DesktopSimplified = React__default.forwardRef(() => {
329
+ const rootContext = React__default.useContext(RootContext);
330
+ if (!rootContext)
331
+ return null;
332
+ const { setSelectedMenuItem, linkComponent: Link2 } = rootContext;
333
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
334
+ LINKS.map((link) => /* @__PURE__ */ jsxs(NavigationMenu.List, { value: link.name, children: [
335
+ link.links.map((subLink) => /* @__PURE__ */ jsx(NavigationMenu.Item, { value: subLink.name, children: subLink.name === "Logo" && /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsx(
336
+ "img",
337
+ {
338
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
339
+ draggable: "false",
340
+ alt: "Telia logo"
341
+ }
342
+ ) }) : /* @__PURE__ */ jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsx(
343
+ "img",
344
+ {
345
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
346
+ draggable: "false",
347
+ alt: "Telia logo"
348
+ }
349
+ ) }) }) }, subLink.name)),
350
+ /* @__PURE__ */ jsx(Box, { ml: "auto" }),
351
+ /* @__PURE__ */ jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsx(ShoppingCart, {}) })
352
+ ] }, link.name)),
353
+ /* @__PURE__ */ jsx(NavigationMenu.Viewport, { className: styles[`${rootClassName}__viewport`] })
354
+ ] });
355
+ });
356
+ DesktopSimplified.displayName = "DesktopSimplified";
357
+ function MobileSimplified(props) {
358
+ const rootContext = React__default.useContext(RootContext);
359
+ if (!rootContext)
360
+ return null;
361
+ const { linkComponent: NavLink } = rootContext;
362
+ const classes = clsx([styles[`${rootClassName}__mobile`]], props.className);
363
+ return /* @__PURE__ */ jsx(Flex, { ...props, className: classes, children: /* @__PURE__ */ jsxs(Flex, { flexGrow: "1", justify: "between", align: "center", gap: "200", children: [
364
+ /* @__PURE__ */ jsx(Box, { flexShrink: "0", children: /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: rootContext.appKey === "open-pages" ? /* @__PURE__ */ jsx(NavLink, { href: "/", children: /* @__PURE__ */ jsx(Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) : /* @__PURE__ */ jsx("a", { href: "/", children: /* @__PURE__ */ jsx(Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) }) }),
365
+ /* @__PURE__ */ jsx(Flex, { flexBasis: "0", gap: { sm: "100", md: "200" }, children: /* @__PURE__ */ jsx(ShoppingCart, {}) })
366
+ ] }) });
367
+ }
368
+ MobileSimplified.displayName = "MobileSimplified";
328
369
  const rootClassName = "teddy-global-navigation";
329
370
  const RootContext = React__default.createContext(null);
330
371
  function Root({
@@ -339,6 +380,7 @@ function Root({
339
380
  isCartOpen,
340
381
  onCartOpenChange,
341
382
  drawerSize = "md",
383
+ isSimplified,
342
384
  ...props
343
385
  }) {
344
386
  const [selectedMenuItem, setSelectedMenuItem] = React__default.useState(getInitialMenuItem());
@@ -378,8 +420,14 @@ function Root({
378
420
  setSelectedMenuItem(v);
379
421
  },
380
422
  children: [
381
- /* @__PURE__ */ jsx(Box, { display: { sm: "none", lg: "block" }, children: /* @__PURE__ */ jsx(Desktop, {}) }),
382
- /* @__PURE__ */ jsx(Box, { display: { lg: "none" }, children: /* @__PURE__ */ jsx(Mobile, {}) })
423
+ /* @__PURE__ */ jsxs(Box, { display: { sm: "none", lg: "block" }, children: [
424
+ isSimplified && /* @__PURE__ */ jsx(DesktopSimplified, {}),
425
+ !isSimplified && /* @__PURE__ */ jsx(Desktop, {})
426
+ ] }),
427
+ /* @__PURE__ */ jsxs(Box, { display: { lg: "none" }, children: [
428
+ isSimplified && /* @__PURE__ */ jsx(MobileSimplified, {}),
429
+ !isSimplified && /* @__PURE__ */ jsx(Mobile, {})
430
+ ] })
383
431
  ]
384
432
  }
385
433
  ) })
@@ -425,6 +473,8 @@ export {
425
473
  SearchField as S,
426
474
  Search as a,
427
475
  ShoppingCart as b,
428
- Root as c,
476
+ DesktopSimplified as c,
477
+ MobileSimplified as d,
478
+ Root as e,
429
479
  rootClassName as r
430
480
  };
@@ -16,6 +16,7 @@ export type RootProps = React.ComponentPropsWithoutRef<'div'> & {
16
16
  isCartOpen?: boolean;
17
17
  onCartOpenChange?: (open: boolean) => void;
18
18
  drawerSize: 'md' | 'lg';
19
+ isSimplified?: boolean;
19
20
  };
20
21
  type RootContext = {
21
22
  selectedMenuItem: string | undefined;
@@ -26,7 +27,7 @@ type RootContext = {
26
27
  setPathname: (v: string) => void;
27
28
  } & Pick<RootProps, 'onSearchSubmit' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
28
29
  export declare const RootContext: React.Context<RootContext | null>;
29
- export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, isCartOpen, onCartOpenChange, drawerSize, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, isCartOpen, onCartOpenChange, drawerSize, isSimplified, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
30
31
  export declare namespace Root {
31
32
  var displayName: string;
32
33
  }
@@ -1,12 +1,12 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "clsx";
4
- import { c, R, r } from "./global-navigation-my-pages.js";
4
+ import { e, R, r } from "./global-navigation-my-pages.js";
5
5
  import "./utils.js";
6
6
  import "../../box/box.js";
7
7
  import "../navigation-menu.js";
8
8
  export {
9
- c as Root,
9
+ e as Root,
10
10
  R as RootContext,
11
11
  r as rootClassName
12
12
  };
@@ -45,6 +45,7 @@ declare const Notification: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<
45
45
  bordered?: boolean | undefined;
46
46
  shadow?: boolean | undefined;
47
47
  backgroundImageSrc?: string | undefined;
48
+ imageGradient?: ("dark" | "light") | undefined;
48
49
  layout?: ("navigation-vertical" | "navigation-horizontal-small" | "navigation-horizontal-large" | "rich-card") | undefined;
49
50
  } & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
50
51
  display?: import('../../utils/generate-styling').DisplayChildren | undefined;
@@ -60,6 +61,7 @@ declare const Notification: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<
60
61
  bordered?: boolean | undefined;
61
62
  shadow?: boolean | undefined;
62
63
  backgroundImageSrc?: string | undefined;
64
+ imageGradient?: ("dark" | "light") | undefined;
63
65
  layout?: ("navigation-vertical" | "navigation-horizontal-small" | "navigation-horizontal-large" | "rich-card") | undefined;
64
66
  } & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
65
67
  display?: import('../../utils/generate-styling').DisplayChildren | undefined;
@@ -75,6 +77,7 @@ declare const Notification: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<
75
77
  bordered?: boolean | undefined;
76
78
  shadow?: boolean | undefined;
77
79
  backgroundImageSrc?: string | undefined;
80
+ imageGradient?: ("dark" | "light") | undefined;
78
81
  layout?: ("navigation-vertical" | "navigation-horizontal-small" | "navigation-horizontal-large" | "rich-card") | undefined;
79
82
  } & React.RefAttributes<HTMLDivElement>, "ref">, "as" | "variant"> & {
80
83
  variant?: "error" | "warning" | "success" | "information" | undefined;
@@ -0,0 +1,16 @@
1
+ const styles = {
2
+ "teddy-drawer__overlay": "_teddy-drawer__overlay_ugum0_26",
3
+ "teddy-overlay-no-op": "_teddy-overlay-no-op_ugum0_1",
4
+ "teddy-fade-in": "_teddy-fade-in_ugum0_1",
5
+ "teddy-fade-out": "_teddy-fade-out_ugum0_1",
6
+ "teddy-drawer__overlay--container": "_teddy-drawer__overlay--container_ugum0_59",
7
+ "teddy-drawer__content": "_teddy-drawer__content_ugum0_65",
8
+ "teddy-drawer__title": "_teddy-drawer__title_ugum0_69",
9
+ "drawer-content-show": "_drawer-content-show_ugum0_1",
10
+ "drawer-content-hide": "_drawer-content-hide_ugum0_1",
11
+ "teddy-drawer__content--lg": "_teddy-drawer__content--lg_ugum0_99",
12
+ "teddy-drawer__close--floating": "_teddy-drawer__close--floating_ugum0_104"
13
+ };
14
+ export {
15
+ styles as s
16
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ const styles = {
3
+ "teddy-drawer__overlay": "_teddy-drawer__overlay_ugum0_26",
4
+ "teddy-overlay-no-op": "_teddy-overlay-no-op_ugum0_1",
5
+ "teddy-fade-in": "_teddy-fade-in_ugum0_1",
6
+ "teddy-fade-out": "_teddy-fade-out_ugum0_1",
7
+ "teddy-drawer__overlay--container": "_teddy-drawer__overlay--container_ugum0_59",
8
+ "teddy-drawer__content": "_teddy-drawer__content_ugum0_65",
9
+ "teddy-drawer__title": "_teddy-drawer__title_ugum0_69",
10
+ "drawer-content-show": "_drawer-content-show_ugum0_1",
11
+ "drawer-content-hide": "_drawer-content-hide_ugum0_1",
12
+ "teddy-drawer__content--lg": "_teddy-drawer__content--lg_ugum0_99",
13
+ "teddy-drawer__close--floating": "_teddy-drawer__close--floating_ugum0_104"
14
+ };
15
+ exports.styles = styles;