@telia/teddy 0.7.46 → 0.7.48
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 +4 -3
- package/dist/components/checkbox-card-group/checkbox-card-group-indicator.js +4 -3
- package/dist/components/navigation-menu/global-navigation/utils.cjs +22 -10
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +20 -10
- package/dist/components/navigation-menu/global-navigation/utils.js +22 -10
- package/dist/components/shopping-cart/index.d.ts +1 -1
- package/dist/components/shopping-cart/shopping-cart-context.cjs +2 -1
- package/dist/components/shopping-cart/shopping-cart-context.d.ts +1 -0
- package/dist/components/shopping-cart/shopping-cart-context.js +2 -1
- package/dist/components/shopping-cart/shopping-cart-item.cjs +33 -33
- package/dist/components/shopping-cart/shopping-cart-item.js +33 -33
- package/dist/components/shopping-cart/shopping-cart-root.cjs +2 -2
- package/dist/components/shopping-cart/shopping-cart-root.d.ts +1 -1
- package/dist/components/shopping-cart/shopping-cart-root.js +2 -2
- package/dist/style.css +45 -44
- package/package.json +1 -1
|
@@ -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(
|
|
259
|
-
|
|
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(
|
|
238
|
-
|
|
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(() => {
|
|
@@ -42,21 +42,27 @@ const MY_PAGE_LINKS = {
|
|
|
42
42
|
]
|
|
43
43
|
};
|
|
44
44
|
const MY_PAGE_RETAILER_LINKS = {
|
|
45
|
-
name: "
|
|
45
|
+
name: "Forhandler",
|
|
46
46
|
link: "/forhandler",
|
|
47
47
|
appKey: APP_KEYS["web-shop"],
|
|
48
48
|
links: [
|
|
49
49
|
{
|
|
50
|
-
name: "
|
|
51
|
-
link: "/forhandler/
|
|
50
|
+
name: "Ordreoversikt",
|
|
51
|
+
link: "/forhandler/ordreoversikt",
|
|
52
52
|
appKey: APP_KEYS["web-shop"],
|
|
53
|
-
icon: "
|
|
53
|
+
icon: "report"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
name: "
|
|
57
|
-
link: "/forhandler/
|
|
56
|
+
name: "Salgsrapporter",
|
|
57
|
+
link: "/forhandler/salgsrapporter/",
|
|
58
58
|
appKey: APP_KEYS["web-shop"],
|
|
59
|
-
icon: "
|
|
59
|
+
icon: "graph"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "Salgsstøtte",
|
|
63
|
+
link: "/forhandler/salgsstotte/",
|
|
64
|
+
appKey: APP_KEYS["web-shop"],
|
|
65
|
+
icon: "end-user"
|
|
60
66
|
},
|
|
61
67
|
{
|
|
62
68
|
name: "Administrasjon",
|
|
@@ -65,10 +71,16 @@ const MY_PAGE_RETAILER_LINKS = {
|
|
|
65
71
|
icon: "settings"
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
|
-
name: "
|
|
69
|
-
link: "/forhandler/
|
|
74
|
+
name: "Velg Butikk",
|
|
75
|
+
link: "/forhandler/butikker",
|
|
70
76
|
appKey: APP_KEYS["web-shop"],
|
|
71
|
-
icon: "
|
|
77
|
+
icon: "store"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "Start ny ordre",
|
|
81
|
+
link: "/forhandler/nyordre",
|
|
82
|
+
appKey: APP_KEYS["web-shop"],
|
|
83
|
+
icon: "new-group"
|
|
72
84
|
}
|
|
73
85
|
]
|
|
74
86
|
};
|
|
@@ -46,29 +46,39 @@ export declare const MY_PAGE_LINKS: {
|
|
|
46
46
|
}];
|
|
47
47
|
};
|
|
48
48
|
export declare const MY_PAGE_RETAILER_LINKS: {
|
|
49
|
-
readonly name: "
|
|
49
|
+
readonly name: "Forhandler";
|
|
50
50
|
readonly link: "/forhandler";
|
|
51
51
|
readonly appKey: "web-shop";
|
|
52
52
|
readonly links: [{
|
|
53
|
-
readonly name: "
|
|
54
|
-
readonly link: "/forhandler/
|
|
53
|
+
readonly name: "Ordreoversikt";
|
|
54
|
+
readonly link: "/forhandler/ordreoversikt";
|
|
55
55
|
readonly appKey: "web-shop";
|
|
56
|
-
readonly icon: "
|
|
56
|
+
readonly icon: "report";
|
|
57
57
|
}, {
|
|
58
|
-
readonly name: "
|
|
59
|
-
readonly link: "/forhandler/
|
|
58
|
+
readonly name: "Salgsrapporter";
|
|
59
|
+
readonly link: "/forhandler/salgsrapporter/";
|
|
60
60
|
readonly appKey: "web-shop";
|
|
61
|
-
readonly icon: "
|
|
61
|
+
readonly icon: "graph";
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "Salgsstøtte";
|
|
64
|
+
readonly link: "/forhandler/salgsstotte/";
|
|
65
|
+
readonly appKey: "web-shop";
|
|
66
|
+
readonly icon: "end-user";
|
|
62
67
|
}, {
|
|
63
68
|
readonly name: "Administrasjon";
|
|
64
69
|
readonly link: "/forhandler/administrasjon";
|
|
65
70
|
readonly appKey: "web-shop";
|
|
66
71
|
readonly icon: "settings";
|
|
67
72
|
}, {
|
|
68
|
-
readonly name: "
|
|
69
|
-
readonly link: "/forhandler/
|
|
73
|
+
readonly name: "Velg Butikk";
|
|
74
|
+
readonly link: "/forhandler/butikker";
|
|
70
75
|
readonly appKey: "web-shop";
|
|
71
|
-
readonly icon: "
|
|
76
|
+
readonly icon: "store";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "Start ny ordre";
|
|
79
|
+
readonly link: "/forhandler/nyordre";
|
|
80
|
+
readonly appKey: "web-shop";
|
|
81
|
+
readonly icon: "new-group";
|
|
72
82
|
}];
|
|
73
83
|
};
|
|
74
84
|
export declare const MY_BUSINESS_LINKS: {
|
|
@@ -40,21 +40,27 @@ const MY_PAGE_LINKS = {
|
|
|
40
40
|
]
|
|
41
41
|
};
|
|
42
42
|
const MY_PAGE_RETAILER_LINKS = {
|
|
43
|
-
name: "
|
|
43
|
+
name: "Forhandler",
|
|
44
44
|
link: "/forhandler",
|
|
45
45
|
appKey: APP_KEYS["web-shop"],
|
|
46
46
|
links: [
|
|
47
47
|
{
|
|
48
|
-
name: "
|
|
49
|
-
link: "/forhandler/
|
|
48
|
+
name: "Ordreoversikt",
|
|
49
|
+
link: "/forhandler/ordreoversikt",
|
|
50
50
|
appKey: APP_KEYS["web-shop"],
|
|
51
|
-
icon: "
|
|
51
|
+
icon: "report"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
name: "
|
|
55
|
-
link: "/forhandler/
|
|
54
|
+
name: "Salgsrapporter",
|
|
55
|
+
link: "/forhandler/salgsrapporter/",
|
|
56
56
|
appKey: APP_KEYS["web-shop"],
|
|
57
|
-
icon: "
|
|
57
|
+
icon: "graph"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "Salgsstøtte",
|
|
61
|
+
link: "/forhandler/salgsstotte/",
|
|
62
|
+
appKey: APP_KEYS["web-shop"],
|
|
63
|
+
icon: "end-user"
|
|
58
64
|
},
|
|
59
65
|
{
|
|
60
66
|
name: "Administrasjon",
|
|
@@ -63,10 +69,16 @@ const MY_PAGE_RETAILER_LINKS = {
|
|
|
63
69
|
icon: "settings"
|
|
64
70
|
},
|
|
65
71
|
{
|
|
66
|
-
name: "
|
|
67
|
-
link: "/forhandler/
|
|
72
|
+
name: "Velg Butikk",
|
|
73
|
+
link: "/forhandler/butikker",
|
|
68
74
|
appKey: APP_KEYS["web-shop"],
|
|
69
|
-
icon: "
|
|
75
|
+
icon: "store"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Start ny ordre",
|
|
79
|
+
link: "/forhandler/nyordre",
|
|
80
|
+
appKey: APP_KEYS["web-shop"],
|
|
81
|
+
icon: "new-group"
|
|
70
82
|
}
|
|
71
83
|
]
|
|
72
84
|
};
|
|
@@ -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: {
|
|
@@ -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);
|
|
@@ -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 = "
|
|
18
|
-
const breakageFeeInfo = "
|
|
19
|
-
const nameWrapper = "
|
|
20
|
-
const link = "
|
|
21
|
-
const cartLink = "
|
|
22
|
-
const discountDescription = "
|
|
23
|
-
const name = "
|
|
24
|
-
const nameContainer = "
|
|
25
|
-
const subtitle = "
|
|
26
|
-
const quantityPickerWrapper = "
|
|
27
|
-
const pricePer = "
|
|
28
|
-
const quantityPicker = "
|
|
29
|
-
const priceContainer = "
|
|
30
|
-
const priceCost = "
|
|
31
|
-
const priceLabel = "
|
|
32
|
-
const priceLinethrough = "
|
|
33
|
-
const priceLinethroughDisclaimer = "
|
|
34
|
-
const imageContainer = "
|
|
35
|
-
const noImageContainer = "
|
|
36
|
-
const image = "
|
|
37
|
-
const iconImage = "
|
|
38
|
-
const deleteButtonContainer = "
|
|
39
|
-
const uniqueDiscount = "
|
|
40
|
-
const uniqueDiscountLabel = "
|
|
41
|
-
const uniqueDiscountPrice = "
|
|
42
|
-
const onlyInShops = "
|
|
43
|
-
const onlyInShopsLabel = "
|
|
44
|
-
const tooltipTrigger = "
|
|
45
|
-
const priceWrapper = "
|
|
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 = "
|
|
16
|
-
const breakageFeeInfo = "
|
|
17
|
-
const nameWrapper = "
|
|
18
|
-
const link = "
|
|
19
|
-
const cartLink = "
|
|
20
|
-
const discountDescription = "
|
|
21
|
-
const name = "
|
|
22
|
-
const nameContainer = "
|
|
23
|
-
const subtitle = "
|
|
24
|
-
const quantityPickerWrapper = "
|
|
25
|
-
const pricePer = "
|
|
26
|
-
const quantityPicker = "
|
|
27
|
-
const priceContainer = "
|
|
28
|
-
const priceCost = "
|
|
29
|
-
const priceLabel = "
|
|
30
|
-
const priceLinethrough = "
|
|
31
|
-
const priceLinethroughDisclaimer = "
|
|
32
|
-
const imageContainer = "
|
|
33
|
-
const noImageContainer = "
|
|
34
|
-
const image = "
|
|
35
|
-
const iconImage = "
|
|
36
|
-
const deleteButtonContainer = "
|
|
37
|
-
const uniqueDiscount = "
|
|
38
|
-
const uniqueDiscountLabel = "
|
|
39
|
-
const uniqueDiscountPrice = "
|
|
40
|
-
const onlyInShops = "
|
|
41
|
-
const onlyInShopsLabel = "
|
|
42
|
-
const tooltipTrigger = "
|
|
43
|
-
const priceWrapper = "
|
|
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";
|
|
@@ -5,8 +5,8 @@ const clsx = require("clsx");
|
|
|
5
5
|
const components_heading_heading = require("../heading/heading.cjs");
|
|
6
6
|
const components_shoppingCart_shoppingCartContext = require("./shopping-cart-context.cjs");
|
|
7
7
|
const shoppingCart_module = require("../../shopping-cart.module-BCoLrcMI.cjs");
|
|
8
|
-
const Root = ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, className }) => {
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsx(components_shoppingCart_shoppingCartContext.ShoppingCartProvider, { value: { formatPrice, hasPaid, isAllowedToDelete }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(shoppingCart_module.styles.shoppingCart, className), children: [
|
|
8
|
+
const Root = ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, readonly, className }) => {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_shoppingCart_shoppingCartContext.ShoppingCartProvider, { value: { formatPrice, hasPaid, isAllowedToDelete, readonly }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(shoppingCart_module.styles.shoppingCart, className), children: [
|
|
10
10
|
heading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: shoppingCart_module.styles.sectionInner, children: /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { className: shoppingCart_module.styles.heading, as: "h2", variant: "title-100", children: heading }) }),
|
|
11
11
|
children
|
|
12
12
|
] }) });
|
|
@@ -6,6 +6,6 @@ export interface RootProps extends ShoppingCartContextValue {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const Root: {
|
|
9
|
-
({ heading, children, formatPrice, hasPaid, isAllowedToDelete, className }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
({ heading, children, formatPrice, hasPaid, isAllowedToDelete, readonly, className }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
@@ -3,8 +3,8 @@ import { clsx } from "clsx";
|
|
|
3
3
|
import { Heading } from "../heading/heading.js";
|
|
4
4
|
import { ShoppingCartProvider } from "./shopping-cart-context.js";
|
|
5
5
|
import { s as styles } from "../../shopping-cart.module-DA25l2hr.js";
|
|
6
|
-
const Root = ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, className }) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(ShoppingCartProvider, { value: { formatPrice, hasPaid, isAllowedToDelete }, children: /* @__PURE__ */ jsxs("div", { className: clsx(styles.shoppingCart, className), children: [
|
|
6
|
+
const Root = ({ heading, children, formatPrice, hasPaid, isAllowedToDelete, readonly, className }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(ShoppingCartProvider, { value: { formatPrice, hasPaid, isAllowedToDelete, readonly }, children: /* @__PURE__ */ jsxs("div", { className: clsx(styles.shoppingCart, className), children: [
|
|
8
8
|
heading && /* @__PURE__ */ jsx("div", { className: styles.sectionInner, children: /* @__PURE__ */ jsx(Heading, { className: styles.heading, as: "h2", variant: "title-100", children: heading }) }),
|
|
9
9
|
children
|
|
10
10
|
] }) });
|
package/dist/style.css
CHANGED
|
@@ -1151,13 +1151,13 @@
|
|
|
1151
1151
|
opacity: 1;
|
|
1152
1152
|
transform: translateX(0);
|
|
1153
1153
|
}
|
|
1154
|
-
}.
|
|
1154
|
+
}._item_1rldv_1 {
|
|
1155
1155
|
position: relative;
|
|
1156
1156
|
background-color: var(--teddy-color-functional-white);
|
|
1157
1157
|
border-radius: var(--teddy-border-radius-md);
|
|
1158
1158
|
}
|
|
1159
1159
|
|
|
1160
|
-
.
|
|
1160
|
+
._breakageFeeInfo_1rldv_7 {
|
|
1161
1161
|
position: relative;
|
|
1162
1162
|
font-family: var(--teddy-typography-family-default);
|
|
1163
1163
|
font-weight: var(--teddy-typography-weight-normal);
|
|
@@ -1165,7 +1165,7 @@
|
|
|
1165
1165
|
font-size: var(--teddy-typography-scale-100);
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
|
-
.
|
|
1168
|
+
._itemIcon_1rldv_15 {
|
|
1169
1169
|
display: flex;
|
|
1170
1170
|
height: 2rem;
|
|
1171
1171
|
width: 2rem;
|
|
@@ -1176,14 +1176,14 @@
|
|
|
1176
1176
|
color: var(--teddy-color-purple-700);
|
|
1177
1177
|
}
|
|
1178
1178
|
|
|
1179
|
-
.
|
|
1179
|
+
._nameWrapper_1rldv_26 {
|
|
1180
1180
|
max-width: 18rem;
|
|
1181
1181
|
display: flex;
|
|
1182
1182
|
align-items: flex-start;
|
|
1183
1183
|
flex-direction: column;
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
1186
|
-
.
|
|
1186
|
+
._link_1rldv_33 {
|
|
1187
1187
|
display: flex;
|
|
1188
1188
|
align-items: center;
|
|
1189
1189
|
padding-right: var(--teddy-spacing-400);
|
|
@@ -1194,77 +1194,78 @@
|
|
|
1194
1194
|
}
|
|
1195
1195
|
|
|
1196
1196
|
@media all and (min-width: 600px) {
|
|
1197
|
-
.
|
|
1197
|
+
._link_1rldv_33 {
|
|
1198
1198
|
padding-right: 0;
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
1201
|
|
|
1202
|
-
.
|
|
1202
|
+
._link_1rldv_33 span {
|
|
1203
1203
|
margin-right: var(--teddy-spacing-100);
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
.
|
|
1206
|
+
._cartLink_1rldv_51 {
|
|
1207
1207
|
font-weight: var(--teddy-typography-weight-bold);
|
|
1208
1208
|
color: var(--teddy-color-functional-black);
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
-
.
|
|
1211
|
+
._cartLink_1rldv_51:hover, ._cartLink_1rldv_51:active, ._cartLink_1rldv_51:focus {
|
|
1212
1212
|
color: var(--teddy-color-text-interactive-primary);
|
|
1213
1213
|
}
|
|
1214
1214
|
|
|
1215
|
-
.
|
|
1215
|
+
._discountDescription_1rldv_59 {
|
|
1216
1216
|
margin-right: var(--teddy-spacing-600);
|
|
1217
1217
|
overflow: visible;
|
|
1218
1218
|
margin-top: var(--teddy-spacing-50);
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
-
.
|
|
1221
|
+
._name_1rldv_26 {
|
|
1222
1222
|
box-sizing: border-box;
|
|
1223
1223
|
width: 100%;
|
|
1224
1224
|
padding: var(--teddy-spacing-200) var(--teddy-spacing-200) 0 0;
|
|
1225
1225
|
font-size: var(--teddy-typography-scale-100);
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
|
-
.
|
|
1228
|
+
._nameContainer_1rldv_72 {
|
|
1229
1229
|
display: flex;
|
|
1230
1230
|
}
|
|
1231
1231
|
|
|
1232
|
-
.
|
|
1232
|
+
._subtitle_1rldv_76 {
|
|
1233
1233
|
display: flex;
|
|
1234
1234
|
flex-direction: column;
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
|
-
.
|
|
1237
|
+
._subtitle_1rldv_76 p {
|
|
1238
1238
|
margin: 0;
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
|
-
.
|
|
1241
|
+
._quantityPickerWrapper_1rldv_84 {
|
|
1242
1242
|
display: flex;
|
|
1243
1243
|
justify-content: flex-start;
|
|
1244
1244
|
align-items: center;
|
|
1245
1245
|
flex-wrap: wrap;
|
|
1246
1246
|
}
|
|
1247
1247
|
|
|
1248
|
-
.
|
|
1248
|
+
._pricePer_1rldv_91 {
|
|
1249
1249
|
margin-left: var(--teddy-spacing-200);
|
|
1250
1250
|
}
|
|
1251
1251
|
|
|
1252
|
-
.
|
|
1252
|
+
._quantityPicker_1rldv_84 {
|
|
1253
1253
|
display: flex;
|
|
1254
1254
|
align-items: center;
|
|
1255
1255
|
}
|
|
1256
1256
|
|
|
1257
|
-
.
|
|
1257
|
+
._quantityPicker_1rldv_84 p {
|
|
1258
1258
|
margin: 0 var(--teddy-spacing-100);
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
|
-
.
|
|
1261
|
+
._priceContainer_1rldv_103 {
|
|
1262
1262
|
display: flex;
|
|
1263
1263
|
justify-content: space-between;
|
|
1264
1264
|
margin-bottom: var(--teddy-spacing-100);
|
|
1265
|
+
gap: var(--teddy-spacing-100);
|
|
1265
1266
|
}
|
|
1266
1267
|
|
|
1267
|
-
.
|
|
1268
|
+
._priceCost_1rldv_110 {
|
|
1268
1269
|
display: flex;
|
|
1269
1270
|
flex-direction: column;
|
|
1270
1271
|
font-family: var(--teddy-typography-family-default);
|
|
@@ -1272,12 +1273,12 @@
|
|
|
1272
1273
|
margin-bottom: 0;
|
|
1273
1274
|
}
|
|
1274
1275
|
|
|
1275
|
-
.
|
|
1276
|
+
._priceLabel_1rldv_118 {
|
|
1276
1277
|
text-align: right;
|
|
1277
1278
|
margin-bottom: 0;
|
|
1278
1279
|
}
|
|
1279
1280
|
|
|
1280
|
-
.
|
|
1281
|
+
._priceLinethrough_1rldv_123 {
|
|
1281
1282
|
font-size: var(--teddy-typography-scale-100);
|
|
1282
1283
|
font-family: var(--teddy-typography-family-default);
|
|
1283
1284
|
font-weight: var(--teddy-typography-weight-normal);
|
|
@@ -1287,7 +1288,7 @@
|
|
|
1287
1288
|
color: var(--teddy-color-gray-500);
|
|
1288
1289
|
}
|
|
1289
1290
|
|
|
1290
|
-
.
|
|
1291
|
+
._priceLinethroughDisclaimer_1rldv_133 {
|
|
1291
1292
|
font-size: var(--teddy-typography-scale-100);
|
|
1292
1293
|
font-family: var(--teddy-typography-family-default);
|
|
1293
1294
|
font-weight: var(--teddy-typography-weight-normal);
|
|
@@ -1296,39 +1297,39 @@
|
|
|
1296
1297
|
color: var(--teddy-color-gray-500);
|
|
1297
1298
|
}
|
|
1298
1299
|
|
|
1299
|
-
.
|
|
1300
|
+
._imageContainer_1rldv_142 {
|
|
1300
1301
|
max-width: 2.5rem;
|
|
1301
1302
|
width: 2.5rem;
|
|
1302
1303
|
margin: var(--teddy-spacing-200) var(--teddy-spacing-200) 0 var(--teddy-spacing-200);
|
|
1303
1304
|
}
|
|
1304
1305
|
|
|
1305
|
-
.
|
|
1306
|
-
.
|
|
1307
|
-
.
|
|
1308
|
-
.
|
|
1306
|
+
._imageContainer_1rldv_142 a:hover,
|
|
1307
|
+
._imageContainer_1rldv_142 a:active,
|
|
1308
|
+
._imageContainer_1rldv_142 a:focus,
|
|
1309
|
+
._imageContainer_1rldv_142 a:focus-within {
|
|
1309
1310
|
color: var(--teddy-color-text-interactive-primary);
|
|
1310
1311
|
}
|
|
1311
1312
|
|
|
1312
|
-
.
|
|
1313
|
+
._noImageContainer_1rldv_154 {
|
|
1313
1314
|
max-width: 2.5rem;
|
|
1314
1315
|
width: 2.5rem;
|
|
1315
1316
|
margin: var(--teddy-spacing-200) var(--teddy-spacing-200) 0 var(--teddy-spacing-200);
|
|
1316
1317
|
}
|
|
1317
1318
|
|
|
1318
|
-
.
|
|
1319
|
+
._image_1rldv_142 {
|
|
1319
1320
|
display: block;
|
|
1320
1321
|
height: auto;
|
|
1321
1322
|
max-width: 2.5rem;
|
|
1322
1323
|
width: 2.5rem;
|
|
1323
1324
|
}
|
|
1324
1325
|
|
|
1325
|
-
.
|
|
1326
|
+
._iconImage_1rldv_167 {
|
|
1326
1327
|
display: block;
|
|
1327
1328
|
width: 2.5rem;
|
|
1328
1329
|
height: 2.5rem;
|
|
1329
1330
|
}
|
|
1330
1331
|
|
|
1331
|
-
.
|
|
1332
|
+
._deleteButtonContainer_1rldv_173 {
|
|
1332
1333
|
box-sizing: border-box;
|
|
1333
1334
|
display: flex;
|
|
1334
1335
|
justify-content: center;
|
|
@@ -1346,71 +1347,71 @@
|
|
|
1346
1347
|
padding: var(--teddy-spacing-50) var(--teddy-spacing-100);
|
|
1347
1348
|
}
|
|
1348
1349
|
|
|
1349
|
-
.
|
|
1350
|
+
._deleteButtonContainer_1rldv_173:active, ._deleteButtonContainer_1rldv_173:hover, ._deleteButtonContainer_1rldv_173:focus {
|
|
1350
1351
|
background-color: var(--teddy-color-purple-700);
|
|
1351
1352
|
color: var(--teddy-color-functional-white);
|
|
1352
1353
|
}
|
|
1353
1354
|
|
|
1354
|
-
.
|
|
1355
|
+
._deleteButtonContainer_1rldv_173 svg {
|
|
1355
1356
|
width: 1.06rem;
|
|
1356
1357
|
height: 1.1rem;
|
|
1357
1358
|
margin-bottom: 1px;
|
|
1358
1359
|
}
|
|
1359
1360
|
|
|
1360
|
-
.
|
|
1361
|
+
._uniqueDiscount_1rldv_200 {
|
|
1361
1362
|
display: flex;
|
|
1362
1363
|
justify-content: space-between;
|
|
1363
1364
|
margin-top: var(--teddy-spacing-100);
|
|
1364
1365
|
margin-bottom: var(--teddy-spacing-100);
|
|
1365
1366
|
}
|
|
1366
1367
|
|
|
1367
|
-
.
|
|
1368
|
+
._uniqueDiscountLabel_1rldv_207 {
|
|
1368
1369
|
font-family: var(--teddy-typography-family-default);
|
|
1369
1370
|
font-weight: var(--teddy-typography-weight-normal);
|
|
1370
1371
|
font-style: italic;
|
|
1371
1372
|
}
|
|
1372
1373
|
|
|
1373
|
-
.
|
|
1374
|
+
._uniqueDiscountPrice_1rldv_213 {
|
|
1374
1375
|
font-family: var(--teddy-typography-family-default);
|
|
1375
1376
|
font-weight: var(--teddy-typography-weight-bold);
|
|
1376
1377
|
}
|
|
1377
1378
|
|
|
1378
|
-
.
|
|
1379
|
+
._onlyInShops_1rldv_218 {
|
|
1379
1380
|
display: flex;
|
|
1380
1381
|
align-items: center;
|
|
1381
1382
|
margin-top: var(--teddy-spacing-100);
|
|
1382
1383
|
margin-bottom: var(--teddy-spacing-100);
|
|
1383
1384
|
}
|
|
1384
1385
|
|
|
1385
|
-
.
|
|
1386
|
+
._onlyInShopsLabel_1rldv_225 {
|
|
1386
1387
|
font-style: italic;
|
|
1387
1388
|
font-family: var(--teddy-typography-family-default);
|
|
1388
1389
|
font-weight: var(--teddy-typography-weight-normal);
|
|
1389
1390
|
}
|
|
1390
1391
|
|
|
1391
|
-
.
|
|
1392
|
+
._onlyInShopsTooltipWrapper_1rldv_231 {
|
|
1392
1393
|
margin-left: var(--teddy-spacing-100);
|
|
1393
1394
|
display: flex;
|
|
1394
1395
|
align-items: center;
|
|
1395
1396
|
}
|
|
1396
1397
|
|
|
1397
|
-
.
|
|
1398
|
+
._onlyInShopsTooltipIcon_1rldv_237 {
|
|
1398
1399
|
cursor: pointer;
|
|
1399
1400
|
width: 1.2rem;
|
|
1400
1401
|
height: 1.2rem;
|
|
1401
1402
|
color: var(--teddy-color-functional-black);
|
|
1402
1403
|
}
|
|
1403
1404
|
|
|
1404
|
-
.
|
|
1405
|
+
._tooltipTrigger_1rldv_244 {
|
|
1405
1406
|
padding: var(--teddy-spacing-100);
|
|
1406
1407
|
}
|
|
1407
1408
|
|
|
1408
|
-
.
|
|
1409
|
+
._tooltipTrigger_1rldv_244 svg {
|
|
1409
1410
|
width: 1.25rem;
|
|
1410
1411
|
height: 1.25rem;
|
|
1411
1412
|
}
|
|
1412
1413
|
|
|
1413
|
-
.
|
|
1414
|
+
._priceWrapper_1rldv_252 {
|
|
1414
1415
|
display: flex;
|
|
1415
1416
|
align-items: center;
|
|
1416
1417
|
justify-content: flex-end;
|