@telia/teddy 0.7.48 → 0.7.50
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/checkbox-card-group/checkbox-card-group-indicator.cjs +1 -1
- package/dist/components/checkbox-card-group/checkbox-card-group-indicator.js +1 -1
- package/dist/components/modal/modal-close.cjs +1 -1
- package/dist/components/modal/modal-close.js +1 -1
- package/dist/components/modal/modal-content.cjs +6 -7
- package/dist/components/modal/modal-content.d.ts +7 -2
- package/dist/components/modal/modal-content.js +6 -7
- package/dist/components/modal/modal-group.cjs +1 -1
- package/dist/components/modal/modal-group.js +1 -1
- package/dist/components/modal/modal-image.cjs +1 -1
- package/dist/components/modal/modal-image.js +1 -1
- package/dist/components/modal/modal-overlay.cjs +1 -1
- package/dist/components/modal/modal-overlay.js +1 -1
- package/dist/components/shopping-cart/index.d.ts +1 -1
- package/dist/components/shopping-cart/shopping-cart-continue.cjs +1 -1
- package/dist/components/shopping-cart/shopping-cart-continue.js +1 -1
- package/dist/components/shopping-cart/shopping-cart-items.cjs +1 -1
- package/dist/components/shopping-cart/shopping-cart-items.js +1 -1
- package/dist/components/shopping-cart/shopping-cart-payment.cjs +93 -69
- package/dist/components/shopping-cart/shopping-cart-payment.d.ts +10 -1
- package/dist/components/shopping-cart/shopping-cart-payment.js +94 -70
- package/dist/components/shopping-cart/shopping-cart-root.cjs +1 -1
- package/dist/components/shopping-cart/shopping-cart-root.js +1 -1
- package/dist/modal.module-1dzCSzkb.js +23 -0
- package/dist/modal.module-DC_f9KzI.cjs +22 -0
- package/dist/shopping-cart.module-C9EOksct.cjs +62 -0
- package/dist/shopping-cart.module-ClaAAxQV.js +63 -0
- package/dist/style.css +116 -63
- package/package.json +1 -1
- package/dist/modal.module-BfeNqXoN.cjs +0 -19
- package/dist/modal.module-DuP4in7f.js +0 -20
- package/dist/shopping-cart.module-BCoLrcMI.cjs +0 -48
- package/dist/shopping-cart.module-DA25l2hr.js +0 -49
|
@@ -85,7 +85,7 @@ require("../container/container.cjs");
|
|
|
85
85
|
require("../carousel/carousel-root.cjs");
|
|
86
86
|
require("../slider/slider.cjs");
|
|
87
87
|
require("../textarea/index.cjs");
|
|
88
|
-
const modal_module = require("../../modal.module-
|
|
88
|
+
const modal_module = require("../../modal.module-DC_f9KzI.cjs");
|
|
89
89
|
const components_modal_modalImage = require("../modal/modal-image.cjs");
|
|
90
90
|
const components_radioCardGroup_radioCardGroupIndicator = require("../radio-card-group/radio-card-group-indicator.cjs");
|
|
91
91
|
const components_radioCardGroup_radioCardGroupItemBody = require("../radio-card-group/radio-card-group-item-body.cjs");
|
|
@@ -83,7 +83,7 @@ import "../container/container.js";
|
|
|
83
83
|
import "../carousel/carousel-root.js";
|
|
84
84
|
import "../slider/slider.js";
|
|
85
85
|
import "../textarea/index.js";
|
|
86
|
-
import { s as styles$4 } from "../../modal.module-
|
|
86
|
+
import { s as styles$4 } from "../../modal.module-1dzCSzkb.js";
|
|
87
87
|
import { Image } from "../modal/modal-image.js";
|
|
88
88
|
import { Indicator as Indicator$2 } from "../radio-card-group/radio-card-group-indicator.js";
|
|
89
89
|
import { Body as Body$1 } from "../radio-card-group/radio-card-group-item-body.js";
|
|
@@ -67,6 +67,6 @@ require("../container/container.cjs");
|
|
|
67
67
|
require("../carousel/carousel-root.cjs");
|
|
68
68
|
require("../slider/slider.cjs");
|
|
69
69
|
require("../textarea/index.cjs");
|
|
70
|
-
require("../../modal.module-
|
|
70
|
+
require("../../modal.module-DC_f9KzI.cjs");
|
|
71
71
|
require("./modal-root.cjs");
|
|
72
72
|
exports.Close = components_checkboxCardGroup_checkboxCardGroupIndicator.Close$1;
|
|
@@ -65,7 +65,7 @@ import "../container/container.js";
|
|
|
65
65
|
import "../carousel/carousel-root.js";
|
|
66
66
|
import "../slider/slider.js";
|
|
67
67
|
import "../textarea/index.js";
|
|
68
|
-
import "../../modal.module-
|
|
68
|
+
import "../../modal.module-1dzCSzkb.js";
|
|
69
69
|
import "./modal-root.js";
|
|
70
70
|
export {
|
|
71
71
|
g as Close
|
|
@@ -5,7 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const DrawerPrimitive = require("@radix-ui/react-dialog");
|
|
6
6
|
const components_flex_flex = require("../flex/flex.cjs");
|
|
7
7
|
const clsx = require("clsx");
|
|
8
|
-
const modal_module = require("../../modal.module-
|
|
8
|
+
const modal_module = require("../../modal.module-DC_f9KzI.cjs");
|
|
9
9
|
const components_modal_modalRoot = require("./modal-root.cjs");
|
|
10
10
|
const components_modal_modalOverlay = require("./modal-overlay.cjs");
|
|
11
11
|
function _interopNamespaceDefault(e) {
|
|
@@ -26,7 +26,7 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
}
|
|
27
27
|
const DrawerPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DrawerPrimitive);
|
|
28
28
|
const InnerContent = React.forwardRef(
|
|
29
|
-
function InnerContent2({ asChild, children, className, ...props }, forwardedRef) {
|
|
29
|
+
function InnerContent2({ asChild, children, className, size, ...props }, forwardedRef) {
|
|
30
30
|
const classes = clsx([modal_module.styles[`${components_modal_modalRoot.rootClassName}__scroll`]], className);
|
|
31
31
|
const context = React.useContext(components_modal_modalRoot.RootContext);
|
|
32
32
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -34,7 +34,7 @@ const InnerContent = React.forwardRef(
|
|
|
34
34
|
{
|
|
35
35
|
...props,
|
|
36
36
|
ref: forwardedRef,
|
|
37
|
-
className: clsx([modal_module.styles[`${components_modal_modalRoot.rootClassName}__content`]]),
|
|
37
|
+
className: clsx([modal_module.styles[`${components_modal_modalRoot.rootClassName}__content`], size && modal_module.styles[`${components_modal_modalRoot.rootClassName}__content--${size}`]]),
|
|
38
38
|
asChild: true,
|
|
39
39
|
children: /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
40
|
components_flex_flex.Flex,
|
|
@@ -42,7 +42,6 @@ const InnerContent = React.forwardRef(
|
|
|
42
42
|
...asChild ? { as: void 0, asChild } : {},
|
|
43
43
|
direction: "column",
|
|
44
44
|
align: "start",
|
|
45
|
-
maxWidth: { md: "600px" },
|
|
46
45
|
className: classes,
|
|
47
46
|
ref: context.scrollRef,
|
|
48
47
|
children
|
|
@@ -54,11 +53,11 @@ const InnerContent = React.forwardRef(
|
|
|
54
53
|
);
|
|
55
54
|
InnerContent.displayName = "InnerContent";
|
|
56
55
|
const Content = React.forwardRef(
|
|
57
|
-
({ forceMount, ...contentProps }, forwardedRef) => {
|
|
56
|
+
({ forceMount, size, ...contentProps }, forwardedRef) => {
|
|
58
57
|
const hasOverlay = React.useContext(components_modal_modalOverlay.OverlayContext);
|
|
59
58
|
if (!hasOverlay)
|
|
60
|
-
return /* @__PURE__ */ jsxRuntime.jsx(components_modal_modalOverlay.Overlay, { forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, ...contentProps }) });
|
|
61
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, ...contentProps });
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_modal_modalOverlay.Overlay, { forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, size, ...contentProps }) });
|
|
60
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, size, ...contentProps });
|
|
62
61
|
}
|
|
63
62
|
);
|
|
64
63
|
Content.displayName = "Content";
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
-
type
|
|
5
|
-
|
|
4
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
type ContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
6
|
+
size?: Size;
|
|
7
|
+
};
|
|
8
|
+
declare const Content: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
|
+
size?: Size | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
11
|
export { Content };
|
|
7
12
|
export type { ContentProps };
|
|
@@ -3,11 +3,11 @@ import React__default from "react";
|
|
|
3
3
|
import * as DrawerPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
import { Flex } from "../flex/flex.js";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import { s as styles } from "../../modal.module-
|
|
6
|
+
import { s as styles } from "../../modal.module-1dzCSzkb.js";
|
|
7
7
|
import { rootClassName, RootContext } from "./modal-root.js";
|
|
8
8
|
import { OverlayContext, Overlay } from "./modal-overlay.js";
|
|
9
9
|
const InnerContent = React__default.forwardRef(
|
|
10
|
-
function InnerContent2({ asChild, children, className, ...props }, forwardedRef) {
|
|
10
|
+
function InnerContent2({ asChild, children, className, size, ...props }, forwardedRef) {
|
|
11
11
|
const classes = clsx([styles[`${rootClassName}__scroll`]], className);
|
|
12
12
|
const context = React__default.useContext(RootContext);
|
|
13
13
|
return /* @__PURE__ */ jsx(
|
|
@@ -15,7 +15,7 @@ const InnerContent = React__default.forwardRef(
|
|
|
15
15
|
{
|
|
16
16
|
...props,
|
|
17
17
|
ref: forwardedRef,
|
|
18
|
-
className: clsx([styles[`${rootClassName}__content`]]),
|
|
18
|
+
className: clsx([styles[`${rootClassName}__content`], size && styles[`${rootClassName}__content--${size}`]]),
|
|
19
19
|
asChild: true,
|
|
20
20
|
children: /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(
|
|
21
21
|
Flex,
|
|
@@ -23,7 +23,6 @@ const InnerContent = React__default.forwardRef(
|
|
|
23
23
|
...asChild ? { as: void 0, asChild } : {},
|
|
24
24
|
direction: "column",
|
|
25
25
|
align: "start",
|
|
26
|
-
maxWidth: { md: "600px" },
|
|
27
26
|
className: classes,
|
|
28
27
|
ref: context.scrollRef,
|
|
29
28
|
children
|
|
@@ -35,11 +34,11 @@ const InnerContent = React__default.forwardRef(
|
|
|
35
34
|
);
|
|
36
35
|
InnerContent.displayName = "InnerContent";
|
|
37
36
|
const Content = React__default.forwardRef(
|
|
38
|
-
({ forceMount, ...contentProps }, forwardedRef) => {
|
|
37
|
+
({ forceMount, size, ...contentProps }, forwardedRef) => {
|
|
39
38
|
const hasOverlay = React__default.useContext(OverlayContext);
|
|
40
39
|
if (!hasOverlay)
|
|
41
|
-
return /* @__PURE__ */ jsx(Overlay, { forceMount, children: /* @__PURE__ */ jsx(InnerContent, { ref: forwardedRef, ...contentProps }) });
|
|
42
|
-
return /* @__PURE__ */ jsx(InnerContent, { ref: forwardedRef, ...contentProps });
|
|
40
|
+
return /* @__PURE__ */ jsx(Overlay, { forceMount, children: /* @__PURE__ */ jsx(InnerContent, { ref: forwardedRef, size, ...contentProps }) });
|
|
41
|
+
return /* @__PURE__ */ jsx(InnerContent, { ref: forwardedRef, size, ...contentProps });
|
|
43
42
|
}
|
|
44
43
|
);
|
|
45
44
|
Content.displayName = "Content";
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const components_flex_flex = require("../flex/flex.cjs");
|
|
6
6
|
const clsx = require("clsx");
|
|
7
|
-
const modal_module = require("../../modal.module-
|
|
7
|
+
const modal_module = require("../../modal.module-DC_f9KzI.cjs");
|
|
8
8
|
const components_modal_modalRoot = require("./modal-root.cjs");
|
|
9
9
|
const GroupContext = React.createContext(false);
|
|
10
10
|
const Group = React.forwardRef(
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default, { useEffect } from "react";
|
|
3
3
|
import { Flex } from "../flex/flex.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { s as styles } from "../../modal.module-
|
|
5
|
+
import { s as styles } from "../../modal.module-1dzCSzkb.js";
|
|
6
6
|
import { RootContext, rootClassName } from "./modal-root.js";
|
|
7
7
|
const GroupContext = React__default.createContext(false);
|
|
8
8
|
const Group = React__default.forwardRef(
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const clsx = require("clsx");
|
|
6
|
-
const modal_module = require("../../modal.module-
|
|
6
|
+
const modal_module = require("../../modal.module-DC_f9KzI.cjs");
|
|
7
7
|
const reactSlot = require("@radix-ui/react-slot");
|
|
8
8
|
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
9
9
|
const components_modal_modalRoot = require("./modal-root.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { s as styles } from "../../modal.module-
|
|
4
|
+
import { s as styles } from "../../modal.module-1dzCSzkb.js";
|
|
5
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
6
|
import { composeRefs } from "../../utils/composeRefs.js";
|
|
7
7
|
import { rootClassName, RootContext } from "./modal-root.js";
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const DrawerPrimitive = require("@radix-ui/react-dialog");
|
|
6
6
|
const clsx = require("clsx");
|
|
7
|
-
const modal_module = require("../../modal.module-
|
|
7
|
+
const modal_module = require("../../modal.module-DC_f9KzI.cjs");
|
|
8
8
|
const components_modal_modalRoot = require("./modal-root.cjs");
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
|
10
10
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import * as DrawerPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { s as styles } from "../../modal.module-
|
|
5
|
+
import { s as styles } from "../../modal.module-1dzCSzkb.js";
|
|
6
6
|
import { rootClassName } from "./modal-root.js";
|
|
7
7
|
const OverlayContext = React__default.createContext(false);
|
|
8
8
|
const Overlay = React__default.forwardRef(
|
|
@@ -13,7 +13,7 @@ export declare const ShoppingCart: {
|
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
Payment: {
|
|
16
|
-
({ delivery, totalPriceUpfront, totalPriceMonthly, totalPriceFirstInvoice, paymentTooltip, monthlyPriceDetails, totalVAT, totalPriceWithoutVAT, className, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
({ delivery, totalPriceUpfront, totalPriceMonthly, totalPriceFirstInvoice, paymentTooltip, monthlyPriceDetails, totalVAT, totalPriceWithoutVAT, highlightedLine, className, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
Disclaimer: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const clsx = require("clsx");
|
|
5
|
-
const shoppingCart_module = require("../../shopping-cart.module-
|
|
5
|
+
const shoppingCart_module = require("../../shopping-cart.module-C9EOksct.cjs");
|
|
6
6
|
const Continue = ({ children, className }) => {
|
|
7
7
|
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: clsx.clsx(className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${shoppingCart_module.styles.sectionInner} ${shoppingCart_module.styles.continueContainer}`, children }) });
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
|
-
import { s as styles } from "../../shopping-cart.module-
|
|
3
|
+
import { s as styles } from "../../shopping-cart.module-ClaAAxQV.js";
|
|
4
4
|
const Continue = ({ children, className }) => {
|
|
5
5
|
return /* @__PURE__ */ jsx("section", { className: clsx(className), children: /* @__PURE__ */ jsx("div", { className: `${styles.sectionInner} ${styles.continueContainer}`, children }) });
|
|
6
6
|
};
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const clsx = require("clsx");
|
|
6
6
|
const components_shoppingCart_shoppingCartItem = require("./shopping-cart-item.cjs");
|
|
7
|
-
const shoppingCart_module = require("../../shopping-cart.module-
|
|
7
|
+
const shoppingCart_module = require("../../shopping-cart.module-C9EOksct.cjs");
|
|
8
8
|
const components_shoppingCart_utils = require("./utils.cjs");
|
|
9
9
|
const ItemGroup = ({ cartItem, onChangeQuantity, onRemoveItem }) => {
|
|
10
10
|
const renderCartItem = (item) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Fragment } from "react";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { Item } from "./shopping-cart-item.js";
|
|
5
|
-
import { s as styles } from "../../shopping-cart.module-
|
|
5
|
+
import { s as styles } from "../../shopping-cart.module-ClaAAxQV.js";
|
|
6
6
|
import { sortByType } from "./utils.js";
|
|
7
7
|
const ItemGroup = ({ cartItem, onChangeQuantity, onRemoveItem }) => {
|
|
8
8
|
const renderCartItem = (item) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7,8 +7,23 @@ const components_icon_icon = require("../icon/icon.cjs");
|
|
|
7
7
|
const components_tooltip_index = require("../tooltip/index.cjs");
|
|
8
8
|
const components_progressBar_progressBar = require("../progress-bar/progress-bar.cjs");
|
|
9
9
|
const components_shoppingCart_shoppingCartContext = require("./shopping-cart-context.cjs");
|
|
10
|
-
const shoppingCart_module = require("../../shopping-cart.module-
|
|
11
|
-
const
|
|
10
|
+
const shoppingCart_module = require("../../shopping-cart.module-C9EOksct.cjs");
|
|
11
|
+
const components_box_box = require("../box/box.cjs");
|
|
12
|
+
const HighlightedLine = ({ icon, heading, price, description }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.highlightedLine, children: [
|
|
13
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.highlightedLineTop, children: [
|
|
14
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.highlightedLineLeft, children: [
|
|
15
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: icon, className: shoppingCart_module.styles.highlightedLineIcon }),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.highlightedLineHeading, children: heading })
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.highlightedLinePrice, children: price })
|
|
19
|
+
] }),
|
|
20
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: shoppingCart_module.styles.highlightedLineDescription, children: description })
|
|
21
|
+
] });
|
|
22
|
+
const MonthlyPriceDetailsDisplay = ({
|
|
23
|
+
monthlyPriceDetails,
|
|
24
|
+
totalPriceMonthly,
|
|
25
|
+
highlightedLine
|
|
26
|
+
}) => {
|
|
12
27
|
const { formatPrice } = components_shoppingCart_shoppingCartContext.useShoppingCart();
|
|
13
28
|
if (!monthlyPriceDetails || monthlyPriceDetails.length === 0) {
|
|
14
29
|
return null;
|
|
@@ -24,6 +39,10 @@ const MonthlyPriceDetailsDisplay = ({ monthlyPriceDetails, totalPriceMonthly })
|
|
|
24
39
|
formatPrice(totalPriceMonthly || 0),
|
|
25
40
|
"/md."
|
|
26
41
|
] })
|
|
42
|
+
] }),
|
|
43
|
+
(highlightedLine == null ? void 0 : highlightedLine.isMonthly) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx("hr", { className: shoppingCart_module.styles.horizontalRule }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(HighlightedLine, { ...highlightedLine })
|
|
27
46
|
] })
|
|
28
47
|
] });
|
|
29
48
|
};
|
|
@@ -36,85 +55,90 @@ const Payment = ({
|
|
|
36
55
|
monthlyPriceDetails,
|
|
37
56
|
totalVAT,
|
|
38
57
|
totalPriceWithoutVAT,
|
|
58
|
+
highlightedLine,
|
|
39
59
|
className
|
|
40
60
|
}) => {
|
|
41
61
|
const { formatPrice, hasPaid } = components_shoppingCart_shoppingCartContext.useShoppingCart();
|
|
42
62
|
const hasDelivery = delivery && Object.keys(delivery).length > 0;
|
|
43
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.
|
|
47
|
-
/* @__PURE__ */ jsxRuntime.
|
|
48
|
-
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: clsx.clsx(shoppingCart_module.styles.section, className), children: [
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.sectionInner, children: [
|
|
66
|
+
hasDelivery && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryContainer, children: [
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryLeft, children: [
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: delivery.icon || "delivery", className: shoppingCart_module.styles.deliveryIcon }),
|
|
69
|
+
delivery.label || "Levering"
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: delivery.value })
|
|
49
72
|
] }),
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
73
|
+
hasDelivery && delivery.progressBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryProgressbar, children: [
|
|
74
|
+
delivery.progressBar.text || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryProgressbarText, children: [
|
|
75
|
+
"Du har",
|
|
76
|
+
" ",
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: shoppingCart_module.styles.labelMedium, children: [
|
|
78
|
+
Math.ceil(delivery.progressBar.max - delivery.progressBar.progress),
|
|
79
|
+
",-"
|
|
80
|
+
] }),
|
|
81
|
+
" ",
|
|
82
|
+
"igjen til ",
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "fri frakt" })
|
|
59
84
|
] }),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: shoppingCart_module.styles.progressBarWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
components_progressBar_progressBar.ProgressBar,
|
|
87
|
+
{
|
|
88
|
+
colorTheme: "light",
|
|
89
|
+
progress: delivery.progressBar.max > delivery.progressBar.min ? (delivery.progressBar.progress - delivery.progressBar.min) / (delivery.progressBar.max - delivery.progressBar.min) * 100 : 0
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
63
92
|
] }),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
paymentTooltip && /* @__PURE__ */ jsxRuntime.jsxs(components_tooltip_index.Tooltip, { children: [
|
|
78
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Trigger, { className: shoppingCart_module.styles.tooltipTrigger }),
|
|
79
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Content, { className: shoppingCart_module.styles.tooltipContent, children: /* @__PURE__ */ jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: paymentTooltip } }) })
|
|
93
|
+
hasDelivery && !!totalPriceMonthly && /* @__PURE__ */ jsxRuntime.jsx("hr", { className: shoppingCart_module.styles.horizontalRule }),
|
|
94
|
+
!!totalPriceMonthly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceMonthlyContainer, children: [
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.flexRow, children: [
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betale pr md:" }),
|
|
98
|
+
paymentTooltip && /* @__PURE__ */ jsxRuntime.jsxs(components_tooltip_index.Tooltip, { children: [
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Trigger, { className: shoppingCart_module.styles.tooltipTrigger }),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Content, { className: shoppingCart_module.styles.tooltipContent, children: /* @__PURE__ */ jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: paymentTooltip } }) })
|
|
101
|
+
] })
|
|
102
|
+
] }),
|
|
103
|
+
(!monthlyPriceDetails || monthlyPriceDetails.length === 0) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: shoppingCart_module.styles.labelMedium, children: [
|
|
104
|
+
formatPrice(totalPriceMonthly),
|
|
105
|
+
"/md."
|
|
80
106
|
] })
|
|
81
107
|
] }),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
MonthlyPriceDetailsDisplay,
|
|
110
|
+
{
|
|
111
|
+
monthlyPriceDetails,
|
|
112
|
+
totalPriceMonthly,
|
|
113
|
+
highlightedLine
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] })
|
|
117
|
+
] }),
|
|
118
|
+
(!!totalPriceUpfront || !!totalPriceFirstInvoice) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceUpfrontContainer, children: [
|
|
119
|
+
!!totalPriceWithoutVAT && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Sum:" }),
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceWithoutVAT) })
|
|
86
122
|
] }),
|
|
87
|
-
/* @__PURE__ */ jsxRuntime.
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
123
|
+
!!totalVAT && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "MVA:" }),
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalVAT) })
|
|
126
|
+
] }),
|
|
127
|
+
!!totalPriceUpfront && !hasPaid && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betale nå:" }),
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceUpfront) })
|
|
130
|
+
] }),
|
|
131
|
+
!!totalPriceUpfront && hasPaid && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betalt:" }),
|
|
133
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceUpfront) })
|
|
134
|
+
] }),
|
|
135
|
+
!!totalPriceFirstInvoice && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
136
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Å betale på første faktura:" }),
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceFirstInvoice) })
|
|
138
|
+
] })
|
|
94
139
|
] })
|
|
95
140
|
] }),
|
|
96
|
-
|
|
97
|
-
!!totalPriceWithoutVAT && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Sum:" }),
|
|
99
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceWithoutVAT) })
|
|
100
|
-
] }),
|
|
101
|
-
!!totalVAT && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "MVA:" }),
|
|
103
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalVAT) })
|
|
104
|
-
] }),
|
|
105
|
-
!!totalPriceUpfront && !hasPaid && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
106
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betale nå:" }),
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceUpfront) })
|
|
108
|
-
] }),
|
|
109
|
-
!!totalPriceUpfront && hasPaid && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
110
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betalt:" }),
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceUpfront) })
|
|
112
|
-
] }),
|
|
113
|
-
!!totalPriceFirstInvoice && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
|
|
114
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Å betale på første faktura:" }),
|
|
115
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: formatPrice(totalPriceFirstInvoice) })
|
|
116
|
-
] })
|
|
117
|
-
] })
|
|
141
|
+
highlightedLine && !highlightedLine.isMonthly && /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { p: "200", children: /* @__PURE__ */ jsxRuntime.jsx(HighlightedLine, { ...highlightedLine }) })
|
|
118
142
|
] });
|
|
119
143
|
};
|
|
120
144
|
Payment.displayName = "Payment";
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { IconName } from '../icon';
|
|
1
2
|
import { CartDelivery } from './types';
|
|
2
3
|
|
|
4
|
+
export interface HighlightedLineProps {
|
|
5
|
+
icon?: IconName;
|
|
6
|
+
heading: string;
|
|
7
|
+
price: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
isMonthly: boolean;
|
|
10
|
+
}
|
|
3
11
|
export interface PaymentProps {
|
|
4
12
|
delivery?: CartDelivery;
|
|
5
13
|
totalPriceFirstInvoice?: number;
|
|
@@ -12,9 +20,10 @@ export interface PaymentProps {
|
|
|
12
20
|
totalPriceUpfront?: number;
|
|
13
21
|
totalVAT?: number;
|
|
14
22
|
totalPriceWithoutVAT?: number;
|
|
23
|
+
highlightedLine?: HighlightedLineProps;
|
|
15
24
|
className?: string;
|
|
16
25
|
}
|
|
17
26
|
export declare const Payment: {
|
|
18
|
-
({ delivery, totalPriceUpfront, totalPriceMonthly, totalPriceFirstInvoice, paymentTooltip, monthlyPriceDetails, totalVAT, totalPriceWithoutVAT, className, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
({ delivery, totalPriceUpfront, totalPriceMonthly, totalPriceFirstInvoice, paymentTooltip, monthlyPriceDetails, totalVAT, totalPriceWithoutVAT, highlightedLine, className, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
19
28
|
displayName: string;
|
|
20
29
|
};
|