@telia/teddy 0.7.47 → 0.7.49

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 (24) hide show
  1. package/dist/components/checkbox-card-group/checkbox-card-group-indicator.cjs +4 -3
  2. package/dist/components/checkbox-card-group/checkbox-card-group-indicator.js +4 -3
  3. package/dist/components/shopping-cart/index.d.ts +2 -2
  4. package/dist/components/shopping-cart/shopping-cart-context.cjs +2 -1
  5. package/dist/components/shopping-cart/shopping-cart-context.d.ts +1 -0
  6. package/dist/components/shopping-cart/shopping-cart-context.js +2 -1
  7. package/dist/components/shopping-cart/shopping-cart-continue.cjs +1 -1
  8. package/dist/components/shopping-cart/shopping-cart-continue.js +1 -1
  9. package/dist/components/shopping-cart/shopping-cart-item.cjs +33 -33
  10. package/dist/components/shopping-cart/shopping-cart-item.js +33 -33
  11. package/dist/components/shopping-cart/shopping-cart-items.cjs +1 -1
  12. package/dist/components/shopping-cart/shopping-cart-items.js +1 -1
  13. package/dist/components/shopping-cart/shopping-cart-payment.cjs +93 -69
  14. package/dist/components/shopping-cart/shopping-cart-payment.d.ts +10 -1
  15. package/dist/components/shopping-cart/shopping-cart-payment.js +94 -70
  16. package/dist/components/shopping-cart/shopping-cart-root.cjs +3 -3
  17. package/dist/components/shopping-cart/shopping-cart-root.d.ts +1 -1
  18. package/dist/components/shopping-cart/shopping-cart-root.js +3 -3
  19. package/dist/shopping-cart.module-C9EOksct.cjs +62 -0
  20. package/dist/shopping-cart.module-ClaAAxQV.js +63 -0
  21. package/dist/style.css +114 -75
  22. package/package.json +1 -1
  23. package/dist/shopping-cart.module-BCoLrcMI.cjs +0 -48
  24. package/dist/shopping-cart.module-DA25l2hr.js +0 -49
@@ -255,10 +255,11 @@ const RadioCardGroup = Object.assign(components_radioCardGroup_radioCardGroupRoo
255
255
  });
256
256
  const Close = React.forwardRef(
257
257
  ({ className, ...props }, forwardedRef) => {
258
- const classes = clsx([modal_module.styles[`${components_modal_modalRoot.rootClassName}__close`]], {
259
- [modal_module.styles[`${components_modal_modalRoot.rootClassName}__close--floating`]]: props.slot === "floating",
258
+ const classes = clsx(
259
+ modal_module.styles[`${components_modal_modalRoot.rootClassName}__close`],
260
+ { [modal_module.styles[`${components_modal_modalRoot.rootClassName}__close--floating`]]: props.slot === "floating" },
260
261
  className
261
- });
262
+ );
262
263
  const imageRef = React.useContext(components_modal_modalRoot.RootContext).imageRef;
263
264
  const [hasImage, setHasImage] = React.useState(false);
264
265
  React.useEffect(() => {
@@ -234,10 +234,11 @@ const RadioCardGroup = Object.assign(Root$3, {
234
234
  });
235
235
  const Close = React__default.forwardRef(
236
236
  ({ className, ...props }, forwardedRef) => {
237
- const classes = clsx([styles$4[`${rootClassName$4}__close`]], {
238
- [styles$4[`${rootClassName$4}__close--floating`]]: props.slot === "floating",
237
+ const classes = clsx(
238
+ styles$4[`${rootClassName$4}__close`],
239
+ { [styles$4[`${rootClassName$4}__close--floating`]]: props.slot === "floating" },
239
240
  className
240
- });
241
+ );
241
242
  const imageRef = React__default.useContext(RootContext$1).imageRef;
242
243
  const [hasImage, setHasImage] = React__default.useState(false);
243
244
  useEffect(() => {
@@ -5,7 +5,7 @@ import { DisclaimerProps } from './shopping-cart-disclaimer';
5
5
  import { ContinueProps } from './shopping-cart-continue';
6
6
 
7
7
  export declare const ShoppingCart: {
8
- ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, className }: RootProps): import("react/jsx-runtime").JSX.Element;
8
+ ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, readonly, className }: RootProps): import("react/jsx-runtime").JSX.Element;
9
9
  displayName: string;
10
10
  } & {
11
11
  Items: {
@@ -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: {
@@ -5,7 +5,8 @@ const components_shoppingCart_utils = require("./utils.cjs");
5
5
  const ShoppingCartContext = React.createContext({
6
6
  formatPrice: components_shoppingCart_utils.defaultFormatPrice,
7
7
  hasPaid: false,
8
- isAllowedToDelete: true
8
+ isAllowedToDelete: true,
9
+ readonly: false
9
10
  });
10
11
  const ShoppingCartProvider = ShoppingCartContext.Provider;
11
12
  const useShoppingCart = () => React.useContext(ShoppingCartContext);
@@ -3,6 +3,7 @@ export interface ShoppingCartContextValue {
3
3
  formatPrice: (price: string | number) => string;
4
4
  hasPaid?: boolean;
5
5
  isAllowedToDelete?: boolean;
6
+ readonly?: boolean;
6
7
  }
7
8
  export declare const ShoppingCartProvider: import('react').Provider<ShoppingCartContextValue>;
8
9
  export declare const useShoppingCart: () => ShoppingCartContextValue;
@@ -3,7 +3,8 @@ import { defaultFormatPrice } from "./utils.js";
3
3
  const ShoppingCartContext = createContext({
4
4
  formatPrice: defaultFormatPrice,
5
5
  hasPaid: false,
6
- isAllowedToDelete: true
6
+ isAllowedToDelete: true,
7
+ readonly: false
7
8
  });
8
9
  const ShoppingCartProvider = ShoppingCartContext.Provider;
9
10
  const useShoppingCart = () => useContext(ShoppingCartContext);
@@ -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-BCoLrcMI.cjs");
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-DA25l2hr.js";
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
  };
@@ -14,35 +14,35 @@ const components_tooltip_index = require("../tooltip/index.cjs");
14
14
  const components_shoppingCart_types = require("./types.cjs");
15
15
  const components_shoppingCart_shoppingCartContext = require("./shopping-cart-context.cjs");
16
16
  const components_shoppingCart_utils = require("./utils.cjs");
17
- const item = "_item_16o96_1";
18
- const breakageFeeInfo = "_breakageFeeInfo_16o96_7";
19
- const nameWrapper = "_nameWrapper_16o96_26";
20
- const link = "_link_16o96_33";
21
- const cartLink = "_cartLink_16o96_51";
22
- const discountDescription = "_discountDescription_16o96_59";
23
- const name = "_name_16o96_26";
24
- const nameContainer = "_nameContainer_16o96_72";
25
- const subtitle = "_subtitle_16o96_76";
26
- const quantityPickerWrapper = "_quantityPickerWrapper_16o96_84";
27
- const pricePer = "_pricePer_16o96_91";
28
- const quantityPicker = "_quantityPicker_16o96_84";
29
- const priceContainer = "_priceContainer_16o96_103";
30
- const priceCost = "_priceCost_16o96_109";
31
- const priceLabel = "_priceLabel_16o96_117";
32
- const priceLinethrough = "_priceLinethrough_16o96_122";
33
- const priceLinethroughDisclaimer = "_priceLinethroughDisclaimer_16o96_132";
34
- const imageContainer = "_imageContainer_16o96_141";
35
- const noImageContainer = "_noImageContainer_16o96_153";
36
- const image = "_image_16o96_141";
37
- const iconImage = "_iconImage_16o96_166";
38
- const deleteButtonContainer = "_deleteButtonContainer_16o96_172";
39
- const uniqueDiscount = "_uniqueDiscount_16o96_199";
40
- const uniqueDiscountLabel = "_uniqueDiscountLabel_16o96_206";
41
- const uniqueDiscountPrice = "_uniqueDiscountPrice_16o96_212";
42
- const onlyInShops = "_onlyInShops_16o96_217";
43
- const onlyInShopsLabel = "_onlyInShopsLabel_16o96_224";
44
- const tooltipTrigger = "_tooltipTrigger_16o96_243";
45
- const priceWrapper = "_priceWrapper_16o96_251";
17
+ const item = "_item_1rldv_1";
18
+ const breakageFeeInfo = "_breakageFeeInfo_1rldv_7";
19
+ const nameWrapper = "_nameWrapper_1rldv_26";
20
+ const link = "_link_1rldv_33";
21
+ const cartLink = "_cartLink_1rldv_51";
22
+ const discountDescription = "_discountDescription_1rldv_59";
23
+ const name = "_name_1rldv_26";
24
+ const nameContainer = "_nameContainer_1rldv_72";
25
+ const subtitle = "_subtitle_1rldv_76";
26
+ const quantityPickerWrapper = "_quantityPickerWrapper_1rldv_84";
27
+ const pricePer = "_pricePer_1rldv_91";
28
+ const quantityPicker = "_quantityPicker_1rldv_84";
29
+ const priceContainer = "_priceContainer_1rldv_103";
30
+ const priceCost = "_priceCost_1rldv_110";
31
+ const priceLabel = "_priceLabel_1rldv_118";
32
+ const priceLinethrough = "_priceLinethrough_1rldv_123";
33
+ const priceLinethroughDisclaimer = "_priceLinethroughDisclaimer_1rldv_133";
34
+ const imageContainer = "_imageContainer_1rldv_142";
35
+ const noImageContainer = "_noImageContainer_1rldv_154";
36
+ const image = "_image_1rldv_142";
37
+ const iconImage = "_iconImage_1rldv_167";
38
+ const deleteButtonContainer = "_deleteButtonContainer_1rldv_173";
39
+ const uniqueDiscount = "_uniqueDiscount_1rldv_200";
40
+ const uniqueDiscountLabel = "_uniqueDiscountLabel_1rldv_207";
41
+ const uniqueDiscountPrice = "_uniqueDiscountPrice_1rldv_213";
42
+ const onlyInShops = "_onlyInShops_1rldv_218";
43
+ const onlyInShopsLabel = "_onlyInShopsLabel_1rldv_225";
44
+ const tooltipTrigger = "_tooltipTrigger_1rldv_244";
45
+ const priceWrapper = "_priceWrapper_1rldv_252";
46
46
  const styles = {
47
47
  item,
48
48
  breakageFeeInfo,
@@ -141,7 +141,7 @@ const CartItemImage = ({ cartItem }) => {
141
141
  };
142
142
  const CartItemPriceDisplay = ({ cartItem, hasPaid, onChangeQuantity }) => {
143
143
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
144
- const { formatPrice } = components_shoppingCart_shoppingCartContext.useShoppingCart();
144
+ const { formatPrice, readonly } = components_shoppingCart_shoppingCartContext.useShoppingCart();
145
145
  const quantity = ((_a = cartItem.quantity) == null ? void 0 : _a.value) ?? 1;
146
146
  const isQuantityModifiable = !!((_b = cartItem.quantity) == null ? void 0 : _b.modifiable);
147
147
  const shouldShowPricePerUnit = (!!cartItem.price.upfront || !!cartItem.price.firstInvoice) && quantity > 1;
@@ -170,7 +170,7 @@ const CartItemPriceDisplay = ({ cartItem, hasPaid, onChangeQuantity }) => {
170
170
  `${cartItem.bundleId}-${cartItem.id}-${sub}`
171
171
  )) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
172
172
  quantity > 1 && !shouldShowPricePerUnit && /* @__PURE__ */ jsxRuntime.jsx("span", { children: `${quantity} stk` }),
173
- isQuantityModifiable && /* @__PURE__ */ jsxRuntime.jsx(
173
+ isQuantityModifiable && !readonly && /* @__PURE__ */ jsxRuntime.jsx(
174
174
  QuantityPicker,
175
175
  {
176
176
  quantity,
@@ -252,7 +252,7 @@ const CartItemName = ({ cartItem }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntim
252
252
  ] });
253
253
  const Item = ({ cartItem, onChangeQuantity, onRemoveItem, className }) => {
254
254
  var _a;
255
- const { hasPaid, isAllowedToDelete } = components_shoppingCart_shoppingCartContext.useShoppingCart();
255
+ const { hasPaid, isAllowedToDelete, readonly } = components_shoppingCart_shoppingCartContext.useShoppingCart();
256
256
  const isRemovable = !!((_a = cartItem.quantity) == null ? void 0 : _a.removable);
257
257
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(styles.item, className), children: [
258
258
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.nameContainer, children: [
@@ -262,7 +262,7 @@ const Item = ({ cartItem, onChangeQuantity, onRemoveItem, className }) => {
262
262
  /* @__PURE__ */ jsxRuntime.jsx(CartItemPriceDisplay, { cartItem, onChangeQuantity, hasPaid })
263
263
  ] })
264
264
  ] }),
265
- isRemovable && isAllowedToDelete && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onRemoveItem(cartItem), className: styles.deleteButtonContainer, children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "remove" }) })
265
+ isRemovable && isAllowedToDelete && !readonly && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onRemoveItem(cartItem), className: styles.deleteButtonContainer, children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "remove" }) })
266
266
  ] });
267
267
  };
268
268
  Item.displayName = "Item";
@@ -12,35 +12,35 @@ import { Tooltip } from "../tooltip/index.js";
12
12
  import { CART_ITEM_TYPE } from "./types.js";
13
13
  import { useShoppingCart } from "./shopping-cart-context.js";
14
14
  import { getDiscountPrice, getPrice, defaultFormatPrice } from "./utils.js";
15
- const item = "_item_16o96_1";
16
- const breakageFeeInfo = "_breakageFeeInfo_16o96_7";
17
- const nameWrapper = "_nameWrapper_16o96_26";
18
- const link = "_link_16o96_33";
19
- const cartLink = "_cartLink_16o96_51";
20
- const discountDescription = "_discountDescription_16o96_59";
21
- const name = "_name_16o96_26";
22
- const nameContainer = "_nameContainer_16o96_72";
23
- const subtitle = "_subtitle_16o96_76";
24
- const quantityPickerWrapper = "_quantityPickerWrapper_16o96_84";
25
- const pricePer = "_pricePer_16o96_91";
26
- const quantityPicker = "_quantityPicker_16o96_84";
27
- const priceContainer = "_priceContainer_16o96_103";
28
- const priceCost = "_priceCost_16o96_109";
29
- const priceLabel = "_priceLabel_16o96_117";
30
- const priceLinethrough = "_priceLinethrough_16o96_122";
31
- const priceLinethroughDisclaimer = "_priceLinethroughDisclaimer_16o96_132";
32
- const imageContainer = "_imageContainer_16o96_141";
33
- const noImageContainer = "_noImageContainer_16o96_153";
34
- const image = "_image_16o96_141";
35
- const iconImage = "_iconImage_16o96_166";
36
- const deleteButtonContainer = "_deleteButtonContainer_16o96_172";
37
- const uniqueDiscount = "_uniqueDiscount_16o96_199";
38
- const uniqueDiscountLabel = "_uniqueDiscountLabel_16o96_206";
39
- const uniqueDiscountPrice = "_uniqueDiscountPrice_16o96_212";
40
- const onlyInShops = "_onlyInShops_16o96_217";
41
- const onlyInShopsLabel = "_onlyInShopsLabel_16o96_224";
42
- const tooltipTrigger = "_tooltipTrigger_16o96_243";
43
- const priceWrapper = "_priceWrapper_16o96_251";
15
+ const item = "_item_1rldv_1";
16
+ const breakageFeeInfo = "_breakageFeeInfo_1rldv_7";
17
+ const nameWrapper = "_nameWrapper_1rldv_26";
18
+ const link = "_link_1rldv_33";
19
+ const cartLink = "_cartLink_1rldv_51";
20
+ const discountDescription = "_discountDescription_1rldv_59";
21
+ const name = "_name_1rldv_26";
22
+ const nameContainer = "_nameContainer_1rldv_72";
23
+ const subtitle = "_subtitle_1rldv_76";
24
+ const quantityPickerWrapper = "_quantityPickerWrapper_1rldv_84";
25
+ const pricePer = "_pricePer_1rldv_91";
26
+ const quantityPicker = "_quantityPicker_1rldv_84";
27
+ const priceContainer = "_priceContainer_1rldv_103";
28
+ const priceCost = "_priceCost_1rldv_110";
29
+ const priceLabel = "_priceLabel_1rldv_118";
30
+ const priceLinethrough = "_priceLinethrough_1rldv_123";
31
+ const priceLinethroughDisclaimer = "_priceLinethroughDisclaimer_1rldv_133";
32
+ const imageContainer = "_imageContainer_1rldv_142";
33
+ const noImageContainer = "_noImageContainer_1rldv_154";
34
+ const image = "_image_1rldv_142";
35
+ const iconImage = "_iconImage_1rldv_167";
36
+ const deleteButtonContainer = "_deleteButtonContainer_1rldv_173";
37
+ const uniqueDiscount = "_uniqueDiscount_1rldv_200";
38
+ const uniqueDiscountLabel = "_uniqueDiscountLabel_1rldv_207";
39
+ const uniqueDiscountPrice = "_uniqueDiscountPrice_1rldv_213";
40
+ const onlyInShops = "_onlyInShops_1rldv_218";
41
+ const onlyInShopsLabel = "_onlyInShopsLabel_1rldv_225";
42
+ const tooltipTrigger = "_tooltipTrigger_1rldv_244";
43
+ const priceWrapper = "_priceWrapper_1rldv_252";
44
44
  const styles = {
45
45
  item,
46
46
  breakageFeeInfo,
@@ -139,7 +139,7 @@ const CartItemImage = ({ cartItem }) => {
139
139
  };
140
140
  const CartItemPriceDisplay = ({ cartItem, hasPaid, onChangeQuantity }) => {
141
141
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
142
- const { formatPrice } = useShoppingCart();
142
+ const { formatPrice, readonly } = useShoppingCart();
143
143
  const quantity = ((_a = cartItem.quantity) == null ? void 0 : _a.value) ?? 1;
144
144
  const isQuantityModifiable = !!((_b = cartItem.quantity) == null ? void 0 : _b.modifiable);
145
145
  const shouldShowPricePerUnit = (!!cartItem.price.upfront || !!cartItem.price.firstInvoice) && quantity > 1;
@@ -168,7 +168,7 @@ const CartItemPriceDisplay = ({ cartItem, hasPaid, onChangeQuantity }) => {
168
168
  `${cartItem.bundleId}-${cartItem.id}-${sub}`
169
169
  )) : /* @__PURE__ */ jsx("span", {}),
170
170
  quantity > 1 && !shouldShowPricePerUnit && /* @__PURE__ */ jsx("span", { children: `${quantity} stk` }),
171
- isQuantityModifiable && /* @__PURE__ */ jsx(
171
+ isQuantityModifiable && !readonly && /* @__PURE__ */ jsx(
172
172
  QuantityPicker,
173
173
  {
174
174
  quantity,
@@ -250,7 +250,7 @@ const CartItemName = ({ cartItem }) => /* @__PURE__ */ jsxs(Fragment, { children
250
250
  ] });
251
251
  const Item = ({ cartItem, onChangeQuantity, onRemoveItem, className }) => {
252
252
  var _a;
253
- const { hasPaid, isAllowedToDelete } = useShoppingCart();
253
+ const { hasPaid, isAllowedToDelete, readonly } = useShoppingCart();
254
254
  const isRemovable = !!((_a = cartItem.quantity) == null ? void 0 : _a.removable);
255
255
  return /* @__PURE__ */ jsxs("div", { className: clsx(styles.item, className), children: [
256
256
  /* @__PURE__ */ jsxs("div", { className: styles.nameContainer, children: [
@@ -260,7 +260,7 @@ const Item = ({ cartItem, onChangeQuantity, onRemoveItem, className }) => {
260
260
  /* @__PURE__ */ jsx(CartItemPriceDisplay, { cartItem, onChangeQuantity, hasPaid })
261
261
  ] })
262
262
  ] }),
263
- isRemovable && isAllowedToDelete && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onRemoveItem(cartItem), className: styles.deleteButtonContainer, children: /* @__PURE__ */ jsx(Icon, { name: "remove" }) })
263
+ isRemovable && isAllowedToDelete && !readonly && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onRemoveItem(cartItem), className: styles.deleteButtonContainer, children: /* @__PURE__ */ jsx(Icon, { name: "remove" }) })
264
264
  ] });
265
265
  };
266
266
  Item.displayName = "Item";
@@ -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-BCoLrcMI.cjs");
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-DA25l2hr.js";
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-BCoLrcMI.cjs");
11
- const MonthlyPriceDetailsDisplay = ({ monthlyPriceDetails, totalPriceMonthly }) => {
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("section", { className: clsx.clsx(shoppingCart_module.styles.section, className), children: [
44
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.sectionInner, children: [
45
- hasDelivery && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryContainer, children: [
46
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryLeft, children: [
47
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: delivery.icon || "delivery", className: shoppingCart_module.styles.deliveryIcon }),
48
- delivery.label || "Levering"
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.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: delivery.value })
51
- ] }),
52
- hasDelivery && delivery.progressBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryProgressbar, children: [
53
- delivery.progressBar.text || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.deliveryProgressbarText, children: [
54
- "Du har",
55
- " ",
56
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: shoppingCart_module.styles.labelMedium, children: [
57
- Math.ceil(delivery.progressBar.max - delivery.progressBar.progress),
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
- "igjen til ",
62
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "fri frakt" })
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("div", { className: shoppingCart_module.styles.progressBarWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(
65
- components_progressBar_progressBar.ProgressBar,
66
- {
67
- colorTheme: "light",
68
- progress: delivery.progressBar.max > delivery.progressBar.min ? (delivery.progressBar.progress - delivery.progressBar.min) / (delivery.progressBar.max - delivery.progressBar.min) * 100 : 0
69
- }
70
- ) })
71
- ] }),
72
- hasDelivery && !!totalPriceMonthly && /* @__PURE__ */ jsxRuntime.jsx("hr", { className: shoppingCart_module.styles.horizontalRule }),
73
- !!totalPriceMonthly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceMonthlyContainer, children: [
74
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceRow, children: [
75
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.flexRow, children: [
76
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: shoppingCart_module.styles.labelMedium, children: "Betale pr md:" }),
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
- (!monthlyPriceDetails || monthlyPriceDetails.length === 0) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: shoppingCart_module.styles.labelMedium, children: [
83
- formatPrice(totalPriceMonthly),
84
- "/md."
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.jsx(
88
- MonthlyPriceDetailsDisplay,
89
- {
90
- monthlyPriceDetails,
91
- totalPriceMonthly
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
- (!!totalPriceUpfront || !!totalPriceFirstInvoice) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: shoppingCart_module.styles.priceUpfrontContainer, children: [
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
  };