@telia/teddy 0.7.38 → 0.7.40
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-content.cjs +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-content.js +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-indicator.cjs +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-indicator.js +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-item-title.cjs +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-item-title.js +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-item.cjs +1 -0
- package/dist/components/checkbox-card-group/checkbox-card-group-item.js +1 -0
- package/dist/components/index.cjs +4 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/modal/modal-close.cjs +1 -0
- package/dist/components/modal/modal-close.js +1 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +1 -0
- package/dist/components/navigation-menu/navigation-menu.js +1 -0
- package/dist/components/radio-card-group/radio-card-group-content.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-content.js +1 -0
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-item-title.js +1 -0
- package/dist/components/radio-card-group/radio-card-group-item.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-item.js +1 -0
- package/dist/components/shopping-cart/index.cjs +21 -0
- package/dist/components/shopping-cart/index.d.ts +42 -0
- package/dist/components/shopping-cart/index.js +21 -0
- package/dist/components/shopping-cart/shopping-cart-context.cjs +13 -0
- package/dist/components/shopping-cart/shopping-cart-context.d.ts +8 -0
- package/dist/components/shopping-cart/shopping-cart-context.js +13 -0
- package/dist/components/shopping-cart/shopping-cart-continue.cjs +10 -0
- package/dist/components/shopping-cart/shopping-cart-continue.d.ts +9 -0
- package/dist/components/shopping-cart/shopping-cart-continue.js +10 -0
- package/dist/components/shopping-cart/shopping-cart-disclaimer.cjs +75 -0
- package/dist/components/shopping-cart/shopping-cart-disclaimer.d.ts +11 -0
- package/dist/components/shopping-cart/shopping-cart-disclaimer.js +75 -0
- package/dist/components/shopping-cart/shopping-cart-item.cjs +269 -0
- package/dist/components/shopping-cart/shopping-cart-item.d.ts +12 -0
- package/dist/components/shopping-cart/shopping-cart-item.js +269 -0
- package/dist/components/shopping-cart/shopping-cart-items.cjs +20 -0
- package/dist/components/shopping-cart/shopping-cart-items.d.ts +12 -0
- package/dist/components/shopping-cart/shopping-cart-items.js +20 -0
- package/dist/components/shopping-cart/shopping-cart-payment.cjs +121 -0
- package/dist/components/shopping-cart/shopping-cart-payment.d.ts +20 -0
- package/dist/components/shopping-cart/shopping-cart-payment.js +121 -0
- package/dist/components/shopping-cart/shopping-cart-root.cjs +15 -0
- package/dist/components/shopping-cart/shopping-cart-root.d.ts +11 -0
- package/dist/components/shopping-cart/shopping-cart-root.js +15 -0
- package/dist/components/shopping-cart/types.cjs +30 -0
- package/dist/components/shopping-cart/types.d.ts +193 -0
- package/dist/components/shopping-cart/types.js +30 -0
- package/dist/components/shopping-cart/utils.cjs +62 -0
- package/dist/components/shopping-cart/utils.d.ts +6 -0
- package/dist/components/shopping-cart/utils.js +62 -0
- package/dist/components/textarea/textarea-group.cjs +12 -12
- package/dist/components/textarea/textarea-group.js +12 -12
- package/dist/main.cjs +4 -0
- package/dist/main.js +4 -0
- package/dist/shopping-cart.module-BCoLrcMI.cjs +48 -0
- package/dist/shopping-cart.module-DA25l2hr.js +49 -0
- package/dist/style.css +970 -484
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ require("clsx");
|
|
|
5
5
|
require("react");
|
|
6
6
|
require("./checkbox-card-group-root.cjs");
|
|
7
7
|
require("../dashed-button/dashed-button-root.cjs");
|
|
8
|
+
require("../shopping-cart/index.cjs");
|
|
8
9
|
require("../step-indicator/index.cjs");
|
|
9
10
|
require("../metric-meter/metric-meter.cjs");
|
|
10
11
|
require("../footer/index.cjs");
|
|
@@ -3,6 +3,7 @@ import "clsx";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "./checkbox-card-group-root.js";
|
|
5
5
|
import "../dashed-button/dashed-button-root.js";
|
|
6
|
+
import "../shopping-cart/index.js";
|
|
6
7
|
import "../step-indicator/index.js";
|
|
7
8
|
import "../metric-meter/metric-meter.js";
|
|
8
9
|
import "../footer/index.js";
|
|
@@ -13,6 +13,7 @@ const reactUseControllableState = require("@radix-ui/react-use-controllable-stat
|
|
|
13
13
|
const utils_generateStyling_index = require("../../utils/generate-styling/index.cjs");
|
|
14
14
|
const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
|
|
15
15
|
require("../dashed-button/dashed-button-root.cjs");
|
|
16
|
+
require("../shopping-cart/index.cjs");
|
|
16
17
|
require("../step-indicator/index.cjs");
|
|
17
18
|
require("../metric-meter/metric-meter.cjs");
|
|
18
19
|
require("../footer/index.cjs");
|
|
@@ -11,6 +11,7 @@ import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
|
11
11
|
import { mergeStyles } from "../../utils/generate-styling/index.js";
|
|
12
12
|
import { teddyMotionDuration300 } from "../../tokens/motion/variables.js";
|
|
13
13
|
import "../dashed-button/dashed-button-root.js";
|
|
14
|
+
import "../shopping-cart/index.js";
|
|
14
15
|
import "../step-indicator/index.js";
|
|
15
16
|
import "../metric-meter/metric-meter.js";
|
|
16
17
|
import "../footer/index.js";
|
|
@@ -6,6 +6,7 @@ require("react");
|
|
|
6
6
|
require("./checkbox-card-group-root.cjs");
|
|
7
7
|
require("@radix-ui/react-slot");
|
|
8
8
|
require("../dashed-button/dashed-button-root.cjs");
|
|
9
|
+
require("../shopping-cart/index.cjs");
|
|
9
10
|
require("../step-indicator/index.cjs");
|
|
10
11
|
require("../metric-meter/metric-meter.cjs");
|
|
11
12
|
require("../footer/index.cjs");
|
|
@@ -4,6 +4,7 @@ import "react";
|
|
|
4
4
|
import "./checkbox-card-group-root.js";
|
|
5
5
|
import "@radix-ui/react-slot";
|
|
6
6
|
import "../dashed-button/dashed-button-root.js";
|
|
7
|
+
import "../shopping-cart/index.js";
|
|
7
8
|
import "../step-indicator/index.js";
|
|
8
9
|
import "../metric-meter/metric-meter.js";
|
|
9
10
|
import "../footer/index.js";
|
|
@@ -5,6 +5,7 @@ require("clsx");
|
|
|
5
5
|
require("react");
|
|
6
6
|
require("./checkbox-card-group-root.cjs");
|
|
7
7
|
require("../dashed-button/dashed-button-root.cjs");
|
|
8
|
+
require("../shopping-cart/index.cjs");
|
|
8
9
|
require("../step-indicator/index.cjs");
|
|
9
10
|
require("../metric-meter/metric-meter.cjs");
|
|
10
11
|
require("../footer/index.cjs");
|
|
@@ -3,6 +3,7 @@ import "clsx";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "./checkbox-card-group-root.js";
|
|
5
5
|
import "../dashed-button/dashed-button-root.js";
|
|
6
|
+
import "../shopping-cart/index.js";
|
|
6
7
|
import "../step-indicator/index.js";
|
|
7
8
|
import "../metric-meter/metric-meter.js";
|
|
8
9
|
import "../footer/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const components_dashedButton_dashedButtonRoot = require("./dashed-button/dashed-button-root.cjs");
|
|
4
|
+
const components_shoppingCart_index = require("./shopping-cart/index.cjs");
|
|
4
5
|
const components_stepIndicator_index = require("./step-indicator/index.cjs");
|
|
5
6
|
const components_metricMeter_metricMeter = require("./metric-meter/metric-meter.cjs");
|
|
6
7
|
const components_footer_index = require("./footer/index.cjs");
|
|
@@ -65,10 +66,12 @@ const components_slider_slider = require("./slider/slider.cjs");
|
|
|
65
66
|
const components_circleBar_circleBar = require("./circle-bar/circle-bar.cjs");
|
|
66
67
|
const components_textarea_index = require("./textarea/index.cjs");
|
|
67
68
|
const components_video_video = require("./video/video.cjs");
|
|
69
|
+
const components_shoppingCart_types = require("./shopping-cart/types.cjs");
|
|
68
70
|
const sonner = require("sonner");
|
|
69
71
|
const components_input_inputGroup = require("./input/input-group.cjs");
|
|
70
72
|
const components_textarea_textareaGroup = require("./textarea/textarea-group.cjs");
|
|
71
73
|
exports.DashedButton = components_dashedButton_dashedButtonRoot.DashedButton;
|
|
74
|
+
exports.ShoppingCart = components_shoppingCart_index.ShoppingCart;
|
|
72
75
|
exports.StepIndicator = components_stepIndicator_index.StepIndicator;
|
|
73
76
|
exports.MetricMeter = components_metricMeter_metricMeter.MetricMeter;
|
|
74
77
|
exports.Footer = components_footer_index.Footer;
|
|
@@ -137,6 +140,7 @@ exports.Slider = components_slider_slider.Slider;
|
|
|
137
140
|
exports.CircleBar = components_circleBar_circleBar.CircleBar;
|
|
138
141
|
exports.TextareaGroup = components_textarea_index.TextareaGroup;
|
|
139
142
|
exports.Video = components_video_video;
|
|
143
|
+
exports.CART_ITEM_TYPE = components_shoppingCart_types.CART_ITEM_TYPE;
|
|
140
144
|
Object.defineProperty(exports, "toast", {
|
|
141
145
|
enumerable: true,
|
|
142
146
|
get: () => sonner.toast
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DashedButton } from "./dashed-button/dashed-button-root.js";
|
|
2
|
+
import { ShoppingCart } from "./shopping-cart/index.js";
|
|
2
3
|
import { StepIndicator } from "./step-indicator/index.js";
|
|
3
4
|
import { MetricMeter } from "./metric-meter/metric-meter.js";
|
|
4
5
|
import { Footer } from "./footer/index.js";
|
|
@@ -63,6 +64,7 @@ import { Slider } from "./slider/slider.js";
|
|
|
63
64
|
import { CircleBar } from "./circle-bar/circle-bar.js";
|
|
64
65
|
import { TextareaGroup } from "./textarea/index.js";
|
|
65
66
|
import { default as default3 } from "./video/video.js";
|
|
67
|
+
import { CART_ITEM_TYPE } from "./shopping-cart/types.js";
|
|
66
68
|
import { toast } from "sonner";
|
|
67
69
|
import { I } from "./input/input-group.js";
|
|
68
70
|
import { T } from "./textarea/textarea-group.js";
|
|
@@ -75,6 +77,7 @@ export {
|
|
|
75
77
|
Box,
|
|
76
78
|
Breadcrumbs,
|
|
77
79
|
Button,
|
|
80
|
+
CART_ITEM_TYPE,
|
|
78
81
|
Card,
|
|
79
82
|
Carousel,
|
|
80
83
|
ChannelButton,
|
|
@@ -120,6 +123,7 @@ export {
|
|
|
120
123
|
Ribbon,
|
|
121
124
|
ScrollArea,
|
|
122
125
|
Select,
|
|
126
|
+
ShoppingCart,
|
|
123
127
|
Skeleton,
|
|
124
128
|
Slider,
|
|
125
129
|
Spinner,
|
|
@@ -4,6 +4,7 @@ require("react/jsx-runtime");
|
|
|
4
4
|
require("react");
|
|
5
5
|
require("@radix-ui/react-dialog");
|
|
6
6
|
require("../dashed-button/dashed-button-root.cjs");
|
|
7
|
+
require("../shopping-cart/index.cjs");
|
|
7
8
|
require("../step-indicator/index.cjs");
|
|
8
9
|
require("../metric-meter/metric-meter.cjs");
|
|
9
10
|
require("../footer/index.cjs");
|
|
@@ -2,6 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "@radix-ui/react-dialog";
|
|
4
4
|
import "../dashed-button/dashed-button-root.js";
|
|
5
|
+
import "../shopping-cart/index.js";
|
|
5
6
|
import "../step-indicator/index.js";
|
|
6
7
|
import "../metric-meter/metric-meter.js";
|
|
7
8
|
import "../footer/index.js";
|
|
@@ -13,6 +13,7 @@ require("@radix-ui/react-use-controllable-state");
|
|
|
13
13
|
require("../../utils/generate-styling/index.cjs");
|
|
14
14
|
require("../../tokens/motion/variables.cjs");
|
|
15
15
|
require("../dashed-button/dashed-button-root.cjs");
|
|
16
|
+
require("../shopping-cart/index.cjs");
|
|
16
17
|
require("../step-indicator/index.cjs");
|
|
17
18
|
require("../metric-meter/metric-meter.cjs");
|
|
18
19
|
require("../footer/index.cjs");
|
|
@@ -11,6 +11,7 @@ import "@radix-ui/react-use-controllable-state";
|
|
|
11
11
|
import "../../utils/generate-styling/index.js";
|
|
12
12
|
import "../../tokens/motion/variables.js";
|
|
13
13
|
import "../dashed-button/dashed-button-root.js";
|
|
14
|
+
import "../shopping-cart/index.js";
|
|
14
15
|
import "../step-indicator/index.js";
|
|
15
16
|
import "../metric-meter/metric-meter.js";
|
|
16
17
|
import "../footer/index.js";
|
|
@@ -5,6 +5,7 @@ require("clsx");
|
|
|
5
5
|
require("react");
|
|
6
6
|
require("./radio-card-group-root.cjs");
|
|
7
7
|
require("../dashed-button/dashed-button-root.cjs");
|
|
8
|
+
require("../shopping-cart/index.cjs");
|
|
8
9
|
require("../step-indicator/index.cjs");
|
|
9
10
|
require("../metric-meter/metric-meter.cjs");
|
|
10
11
|
require("../footer/index.cjs");
|
|
@@ -3,6 +3,7 @@ import "clsx";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "./radio-card-group-root.js";
|
|
5
5
|
import "../dashed-button/dashed-button-root.js";
|
|
6
|
+
import "../shopping-cart/index.js";
|
|
6
7
|
import "../step-indicator/index.js";
|
|
7
8
|
import "../metric-meter/metric-meter.js";
|
|
8
9
|
import "../footer/index.js";
|
|
@@ -6,6 +6,7 @@ require("react");
|
|
|
6
6
|
require("./radio-card-group-root.cjs");
|
|
7
7
|
require("@radix-ui/react-slot");
|
|
8
8
|
require("../dashed-button/dashed-button-root.cjs");
|
|
9
|
+
require("../shopping-cart/index.cjs");
|
|
9
10
|
require("../step-indicator/index.cjs");
|
|
10
11
|
require("../metric-meter/metric-meter.cjs");
|
|
11
12
|
require("../footer/index.cjs");
|
|
@@ -4,6 +4,7 @@ import "react";
|
|
|
4
4
|
import "./radio-card-group-root.js";
|
|
5
5
|
import "@radix-ui/react-slot";
|
|
6
6
|
import "../dashed-button/dashed-button-root.js";
|
|
7
|
+
import "../shopping-cart/index.js";
|
|
7
8
|
import "../step-indicator/index.js";
|
|
8
9
|
import "../metric-meter/metric-meter.js";
|
|
9
10
|
import "../footer/index.js";
|
|
@@ -6,6 +6,7 @@ require("react");
|
|
|
6
6
|
require("./radio-card-group-root.cjs");
|
|
7
7
|
require("@radix-ui/react-radio-group");
|
|
8
8
|
require("../dashed-button/dashed-button-root.cjs");
|
|
9
|
+
require("../shopping-cart/index.cjs");
|
|
9
10
|
require("../step-indicator/index.cjs");
|
|
10
11
|
require("../metric-meter/metric-meter.cjs");
|
|
11
12
|
require("../footer/index.cjs");
|
|
@@ -4,6 +4,7 @@ import "react";
|
|
|
4
4
|
import "./radio-card-group-root.js";
|
|
5
5
|
import "@radix-ui/react-radio-group";
|
|
6
6
|
import "../dashed-button/dashed-button-root.js";
|
|
7
|
+
import "../shopping-cart/index.js";
|
|
7
8
|
import "../step-indicator/index.js";
|
|
8
9
|
import "../metric-meter/metric-meter.js";
|
|
9
10
|
import "../footer/index.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_shoppingCart_shoppingCartRoot = require("./shopping-cart-root.cjs");
|
|
4
|
+
const components_shoppingCart_shoppingCartItems = require("./shopping-cart-items.cjs");
|
|
5
|
+
const components_shoppingCart_shoppingCartPayment = require("./shopping-cart-payment.cjs");
|
|
6
|
+
const components_shoppingCart_shoppingCartDisclaimer = require("./shopping-cart-disclaimer.cjs");
|
|
7
|
+
const components_shoppingCart_shoppingCartContinue = require("./shopping-cart-continue.cjs");
|
|
8
|
+
const components_shoppingCart_types = require("./types.cjs");
|
|
9
|
+
components_shoppingCart_shoppingCartRoot.Root.displayName = "ShoppingCart";
|
|
10
|
+
components_shoppingCart_shoppingCartItems.Items.displayName = "ShoppingCart.Items";
|
|
11
|
+
components_shoppingCart_shoppingCartPayment.Payment.displayName = "ShoppingCart.Payment";
|
|
12
|
+
components_shoppingCart_shoppingCartDisclaimer.Disclaimer.displayName = "ShoppingCart.Disclaimer";
|
|
13
|
+
components_shoppingCart_shoppingCartContinue.Continue.displayName = "ShoppingCart.Continue";
|
|
14
|
+
const ShoppingCart = Object.assign(components_shoppingCart_shoppingCartRoot.Root, {
|
|
15
|
+
Items: components_shoppingCart_shoppingCartItems.Items,
|
|
16
|
+
Payment: components_shoppingCart_shoppingCartPayment.Payment,
|
|
17
|
+
Disclaimer: components_shoppingCart_shoppingCartDisclaimer.Disclaimer,
|
|
18
|
+
Continue: components_shoppingCart_shoppingCartContinue.Continue
|
|
19
|
+
});
|
|
20
|
+
exports.CART_ITEM_TYPE = components_shoppingCart_types.CART_ITEM_TYPE;
|
|
21
|
+
exports.ShoppingCart = ShoppingCart;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RootProps } from './shopping-cart-root';
|
|
2
|
+
import { ItemsProps } from './shopping-cart-items';
|
|
3
|
+
import { PaymentProps } from './shopping-cart-payment';
|
|
4
|
+
import { DisclaimerProps } from './shopping-cart-disclaimer';
|
|
5
|
+
import { ContinueProps } from './shopping-cart-continue';
|
|
6
|
+
|
|
7
|
+
export declare const ShoppingCart: {
|
|
8
|
+
({ heading, children, formatPrice, hasPaid, isAllowedToDelete, className }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
} & {
|
|
11
|
+
Items: {
|
|
12
|
+
({ cartItems, onChangeQuantity, onRemoveItem, className }: ItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Payment: {
|
|
16
|
+
({ delivery, totalPriceUpfront, totalPriceMonthly, totalPriceFirstInvoice, paymentTooltip, monthlyPriceDetails, totalVAT, totalPriceWithoutVAT, className, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Disclaimer: {
|
|
20
|
+
({ disclaimer, onOpenDisclaimer, className }: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
Continue: {
|
|
24
|
+
({ children, className }: ContinueProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type ShoppingCartProps = {
|
|
29
|
+
Root: RootProps;
|
|
30
|
+
Items: ItemsProps;
|
|
31
|
+
Payment: PaymentProps;
|
|
32
|
+
Disclaimer: DisclaimerProps;
|
|
33
|
+
Continue: ContinueProps;
|
|
34
|
+
};
|
|
35
|
+
export type { CartType, CartItem, CartItemPrice, CartItemImage, CartDelivery, CartDeliveryProgressBar, CartSubscription, CartSubscriptions, CartDiscountType, BadgeVariant, DisclaimerItem, } from './types';
|
|
36
|
+
export { CART_ITEM_TYPE } from './types';
|
|
37
|
+
export type { RootProps as ShoppingCartRootProps } from './shopping-cart-root';
|
|
38
|
+
export type { ItemsProps as ShoppingCartItemsProps } from './shopping-cart-items';
|
|
39
|
+
export type { PaymentProps as ShoppingCartPaymentProps } from './shopping-cart-payment';
|
|
40
|
+
export type { DisclaimerProps as ShoppingCartDisclaimerProps } from './shopping-cart-disclaimer';
|
|
41
|
+
export type { ContinueProps as ShoppingCartContinueProps } from './shopping-cart-continue';
|
|
42
|
+
export type { ItemProps as ShoppingCartItemProps } from './shopping-cart-item';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Root } from "./shopping-cart-root.js";
|
|
2
|
+
import { Items } from "./shopping-cart-items.js";
|
|
3
|
+
import { Payment } from "./shopping-cart-payment.js";
|
|
4
|
+
import { Disclaimer } from "./shopping-cart-disclaimer.js";
|
|
5
|
+
import { Continue } from "./shopping-cart-continue.js";
|
|
6
|
+
import { CART_ITEM_TYPE } from "./types.js";
|
|
7
|
+
Root.displayName = "ShoppingCart";
|
|
8
|
+
Items.displayName = "ShoppingCart.Items";
|
|
9
|
+
Payment.displayName = "ShoppingCart.Payment";
|
|
10
|
+
Disclaimer.displayName = "ShoppingCart.Disclaimer";
|
|
11
|
+
Continue.displayName = "ShoppingCart.Continue";
|
|
12
|
+
const ShoppingCart = Object.assign(Root, {
|
|
13
|
+
Items,
|
|
14
|
+
Payment,
|
|
15
|
+
Disclaimer,
|
|
16
|
+
Continue
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
CART_ITEM_TYPE,
|
|
20
|
+
ShoppingCart
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const components_shoppingCart_utils = require("./utils.cjs");
|
|
5
|
+
const ShoppingCartContext = React.createContext({
|
|
6
|
+
formatPrice: components_shoppingCart_utils.defaultFormatPrice,
|
|
7
|
+
hasPaid: false,
|
|
8
|
+
isAllowedToDelete: true
|
|
9
|
+
});
|
|
10
|
+
const ShoppingCartProvider = ShoppingCartContext.Provider;
|
|
11
|
+
const useShoppingCart = () => React.useContext(ShoppingCartContext);
|
|
12
|
+
exports.ShoppingCartProvider = ShoppingCartProvider;
|
|
13
|
+
exports.useShoppingCart = useShoppingCart;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ShoppingCartContextValue {
|
|
3
|
+
formatPrice: (price: string | number) => string;
|
|
4
|
+
hasPaid?: boolean;
|
|
5
|
+
isAllowedToDelete?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShoppingCartProvider: import('react').Provider<ShoppingCartContextValue>;
|
|
8
|
+
export declare const useShoppingCart: () => ShoppingCartContextValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { defaultFormatPrice } from "./utils.js";
|
|
3
|
+
const ShoppingCartContext = createContext({
|
|
4
|
+
formatPrice: defaultFormatPrice,
|
|
5
|
+
hasPaid: false,
|
|
6
|
+
isAllowedToDelete: true
|
|
7
|
+
});
|
|
8
|
+
const ShoppingCartProvider = ShoppingCartContext.Provider;
|
|
9
|
+
const useShoppingCart = () => useContext(ShoppingCartContext);
|
|
10
|
+
export {
|
|
11
|
+
ShoppingCartProvider,
|
|
12
|
+
useShoppingCart
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const clsx = require("clsx");
|
|
5
|
+
const shoppingCart_module = require("../../shopping-cart.module-BCoLrcMI.cjs");
|
|
6
|
+
const Continue = ({ children, className }) => {
|
|
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
|
+
};
|
|
9
|
+
Continue.displayName = "Continue";
|
|
10
|
+
exports.Continue = Continue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ContinueProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Continue: {
|
|
7
|
+
({ children, className }: ContinueProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { s as styles } from "../../shopping-cart.module-DA25l2hr.js";
|
|
4
|
+
const Continue = ({ children, className }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx("section", { className: clsx(className), children: /* @__PURE__ */ jsx("div", { className: `${styles.sectionInner} ${styles.continueContainer}`, children }) });
|
|
6
|
+
};
|
|
7
|
+
Continue.displayName = "Continue";
|
|
8
|
+
export {
|
|
9
|
+
Continue
|
|
10
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
require("../../assets/sprite.6511e521-teddy.svg");
|
|
7
|
+
const components_icon_icon = require("../icon/icon.cjs");
|
|
8
|
+
const components_collapsible_index = require("../collapsible/index.cjs");
|
|
9
|
+
const singleDisclaimer = "_singleDisclaimer_1995d_1";
|
|
10
|
+
const disclaimer = "_disclaimer_1995d_6";
|
|
11
|
+
const disclaimerHeader = "_disclaimerHeader_1995d_12";
|
|
12
|
+
const disclaimerHeaderLeft = "_disclaimerHeaderLeft_1995d_17";
|
|
13
|
+
const disclaimerIcon = "_disclaimerIcon_1995d_25";
|
|
14
|
+
const disclaimerItem = "_disclaimerItem_1995d_30";
|
|
15
|
+
const disclaimerItemTotal = "_disclaimerItemTotal_1995d_38";
|
|
16
|
+
const disclaimerItemSubtitle = "_disclaimerItemSubtitle_1995d_42";
|
|
17
|
+
const disclaimerTotal = "_disclaimerTotal_1995d_47";
|
|
18
|
+
const styles = {
|
|
19
|
+
singleDisclaimer,
|
|
20
|
+
disclaimer,
|
|
21
|
+
disclaimerHeader,
|
|
22
|
+
disclaimerHeaderLeft,
|
|
23
|
+
disclaimerIcon,
|
|
24
|
+
disclaimerItem,
|
|
25
|
+
disclaimerItemTotal,
|
|
26
|
+
disclaimerItemSubtitle,
|
|
27
|
+
disclaimerTotal
|
|
28
|
+
};
|
|
29
|
+
const Disclaimer = ({ disclaimer: disclaimer2, onOpenDisclaimer, className }) => {
|
|
30
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
31
|
+
if (typeof disclaimer2 === "string") {
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(styles.singleDisclaimer, className), children: disclaimer2 });
|
|
33
|
+
}
|
|
34
|
+
const minimumTotalPrice = disclaimer2.reduce((acc, cur) => acc + cur.total, 0);
|
|
35
|
+
const handleOpenChange = (open) => {
|
|
36
|
+
setIsExpanded(open);
|
|
37
|
+
if (open && onOpenDisclaimer) {
|
|
38
|
+
onOpenDisclaimer();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(components_collapsible_index.Collapsible, { open: isExpanded, onOpenChange: handleOpenChange, className, children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_collapsible_index.Collapsible.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.disclaimer, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.disclaimerHeader, children: [
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.disclaimerHeaderLeft, children: [
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: isExpanded ? "chevron-up" : "chevron-down", className: styles.disclaimerIcon }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Minste totalpris" })
|
|
46
|
+
] }),
|
|
47
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
48
|
+
minimumTotalPrice,
|
|
49
|
+
",-"
|
|
50
|
+
] })
|
|
51
|
+
] }) }) }),
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_collapsible_index.Collapsible.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
53
|
+
disclaimer2.map((disclaimerItem2) => {
|
|
54
|
+
const descriptionsArray = typeof disclaimerItem2.description === "string" ? [disclaimerItem2.description] : disclaimerItem2.description;
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.disclaimerItem, children: [
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: disclaimerItem2.name }),
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.disclaimerItemTotal, children: [
|
|
58
|
+
disclaimerItem2.total,
|
|
59
|
+
",-"
|
|
60
|
+
] }),
|
|
61
|
+
descriptionsArray == null ? void 0 : descriptionsArray.map((description) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.disclaimerItemSubtitle, children: description }, description))
|
|
62
|
+
] }, disclaimerItem2.name);
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles.disclaimerItem} ${styles.disclaimerTotal}`, children: [
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "Minste totalpris" }),
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.disclaimerItemTotal, children: [
|
|
67
|
+
minimumTotalPrice,
|
|
68
|
+
",-"
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
] }) })
|
|
72
|
+
] });
|
|
73
|
+
};
|
|
74
|
+
Disclaimer.displayName = "Disclaimer";
|
|
75
|
+
exports.Disclaimer = Disclaimer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DisclaimerItem } from './types';
|
|
2
|
+
|
|
3
|
+
export interface DisclaimerProps {
|
|
4
|
+
disclaimer: string | DisclaimerItem[];
|
|
5
|
+
onOpenDisclaimer?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Disclaimer: {
|
|
9
|
+
({ disclaimer, onOpenDisclaimer, className }: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import "../../assets/sprite.6511e521-teddy.svg";
|
|
5
|
+
import { Icon } from "../icon/icon.js";
|
|
6
|
+
import { Collapsible } from "../collapsible/index.js";
|
|
7
|
+
const singleDisclaimer = "_singleDisclaimer_1995d_1";
|
|
8
|
+
const disclaimer = "_disclaimer_1995d_6";
|
|
9
|
+
const disclaimerHeader = "_disclaimerHeader_1995d_12";
|
|
10
|
+
const disclaimerHeaderLeft = "_disclaimerHeaderLeft_1995d_17";
|
|
11
|
+
const disclaimerIcon = "_disclaimerIcon_1995d_25";
|
|
12
|
+
const disclaimerItem = "_disclaimerItem_1995d_30";
|
|
13
|
+
const disclaimerItemTotal = "_disclaimerItemTotal_1995d_38";
|
|
14
|
+
const disclaimerItemSubtitle = "_disclaimerItemSubtitle_1995d_42";
|
|
15
|
+
const disclaimerTotal = "_disclaimerTotal_1995d_47";
|
|
16
|
+
const styles = {
|
|
17
|
+
singleDisclaimer,
|
|
18
|
+
disclaimer,
|
|
19
|
+
disclaimerHeader,
|
|
20
|
+
disclaimerHeaderLeft,
|
|
21
|
+
disclaimerIcon,
|
|
22
|
+
disclaimerItem,
|
|
23
|
+
disclaimerItemTotal,
|
|
24
|
+
disclaimerItemSubtitle,
|
|
25
|
+
disclaimerTotal
|
|
26
|
+
};
|
|
27
|
+
const Disclaimer = ({ disclaimer: disclaimer2, onOpenDisclaimer, className }) => {
|
|
28
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
29
|
+
if (typeof disclaimer2 === "string") {
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(styles.singleDisclaimer, className), children: disclaimer2 });
|
|
31
|
+
}
|
|
32
|
+
const minimumTotalPrice = disclaimer2.reduce((acc, cur) => acc + cur.total, 0);
|
|
33
|
+
const handleOpenChange = (open) => {
|
|
34
|
+
setIsExpanded(open);
|
|
35
|
+
if (open && onOpenDisclaimer) {
|
|
36
|
+
onOpenDisclaimer();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ jsxs(Collapsible, { open: isExpanded, onOpenChange: handleOpenChange, className, children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Collapsible.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: styles.disclaimer, children: /* @__PURE__ */ jsxs("div", { className: styles.disclaimerHeader, children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: styles.disclaimerHeaderLeft, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Icon, { name: isExpanded ? "chevron-up" : "chevron-down", className: styles.disclaimerIcon }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { children: "Minste totalpris" })
|
|
44
|
+
] }),
|
|
45
|
+
!isExpanded && /* @__PURE__ */ jsxs("span", { children: [
|
|
46
|
+
minimumTotalPrice,
|
|
47
|
+
",-"
|
|
48
|
+
] })
|
|
49
|
+
] }) }) }),
|
|
50
|
+
/* @__PURE__ */ jsx(Collapsible.Content, { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
51
|
+
disclaimer2.map((disclaimerItem2) => {
|
|
52
|
+
const descriptionsArray = typeof disclaimerItem2.description === "string" ? [disclaimerItem2.description] : disclaimerItem2.description;
|
|
53
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.disclaimerItem, children: [
|
|
54
|
+
/* @__PURE__ */ jsx("div", { children: disclaimerItem2.name }),
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: styles.disclaimerItemTotal, children: [
|
|
56
|
+
disclaimerItem2.total,
|
|
57
|
+
",-"
|
|
58
|
+
] }),
|
|
59
|
+
descriptionsArray == null ? void 0 : descriptionsArray.map((description) => /* @__PURE__ */ jsx("div", { className: styles.disclaimerItemSubtitle, children: description }, description))
|
|
60
|
+
] }, disclaimerItem2.name);
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { className: `${styles.disclaimerItem} ${styles.disclaimerTotal}`, children: [
|
|
63
|
+
/* @__PURE__ */ jsx("div", { children: "Minste totalpris" }),
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: styles.disclaimerItemTotal, children: [
|
|
65
|
+
minimumTotalPrice,
|
|
66
|
+
",-"
|
|
67
|
+
] })
|
|
68
|
+
] })
|
|
69
|
+
] }) })
|
|
70
|
+
] });
|
|
71
|
+
};
|
|
72
|
+
Disclaimer.displayName = "Disclaimer";
|
|
73
|
+
export {
|
|
74
|
+
Disclaimer
|
|
75
|
+
};
|