@ultraviolet/plus 3.4.5 → 3.5.0
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/.vite/license.md +3 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/defineProperty.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js +28 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js +18 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutPropertiesLoose.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPrimitive.js +17 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPropertyKey.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/typeof.js +14 -0
- package/dist/_virtual/_rolldown/runtime.js +9 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.js +111 -137
- package/dist/components/CodeEditor/styles.css.js +18 -15
- package/dist/components/ContentCard/Skeleton.d.ts.map +1 -1
- package/dist/components/ContentCard/Skeleton.js +31 -27
- package/dist/components/ContentCard/index.js +107 -140
- package/dist/components/ContentCard/styles.css.d.ts +1 -1
- package/dist/components/ContentCard/styles.css.js +24 -19
- package/dist/components/ContentCardGroup/Card.js +55 -69
- package/dist/components/ContentCardGroup/SkeletonCard.js +28 -14
- package/dist/components/ContentCardGroup/index.d.ts +7 -7
- package/dist/components/ContentCardGroup/index.js +20 -25
- package/dist/components/ContentCardGroup/styles.css.js +6 -11
- package/dist/components/Conversation/index.d.ts +29 -23
- package/dist/components/Conversation/index.d.ts.map +1 -1
- package/dist/components/Conversation/index.js +46 -48
- package/dist/components/Conversation/styles.css.js +18 -13
- package/dist/components/CustomerSatisfaction/assets/1-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/1-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
- package/dist/components/CustomerSatisfaction/index.d.ts.map +1 -1
- package/dist/components/CustomerSatisfaction/index.js +85 -100
- package/dist/components/CustomerSatisfaction/styles.css.js +18 -6
- package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/CustomUnitInput.js +39 -52
- package/dist/components/EstimateCost/Components/Item.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Item.js +223 -323
- package/dist/components/EstimateCost/Components/LineThrough.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/LineThrough.js +16 -16
- package/dist/components/EstimateCost/Components/NumberInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/NumberInput.js +33 -37
- package/dist/components/EstimateCost/Components/Region.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Region.js +34 -57
- package/dist/components/EstimateCost/Components/Regular.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Regular.js +21 -26
- package/dist/components/EstimateCost/Components/Strong.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Strong.js +14 -19
- package/dist/components/EstimateCost/Components/Unit.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Unit.js +47 -40
- package/dist/components/EstimateCost/Components/Zone.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Zone.js +33 -55
- package/dist/components/EstimateCost/Components/components.css.js +122 -86
- package/dist/components/EstimateCost/EstimateCost.d.ts +138 -121
- package/dist/components/EstimateCost/EstimateCost.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCost.js +79 -124
- package/dist/components/EstimateCost/EstimateCostContent.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostContent.js +284 -394
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.js +30 -37
- package/dist/components/EstimateCost/OverlayComponent.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayComponent.js +95 -93
- package/dist/components/EstimateCost/OverlayContext.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayContext.js +12 -10
- package/dist/components/EstimateCost/constants.js +19 -21
- package/dist/components/EstimateCost/helper.d.ts +2 -2
- package/dist/components/EstimateCost/helper.d.ts.map +1 -1
- package/dist/components/EstimateCost/helper.js +9 -14
- package/dist/components/EstimateCost/locales/en.js +24 -23
- package/dist/components/EstimateCost/styles.css.d.ts +2 -2
- package/dist/components/EstimateCost/styles.css.js +50 -36
- package/dist/components/EstimateCost/types.d.ts +1 -1
- package/dist/components/EstimateCost/types.d.ts.map +1 -1
- package/dist/components/FAQ/index.d.ts.map +1 -1
- package/dist/components/FAQ/index.js +37 -31
- package/dist/components/FAQ/styles.css.js +6 -4
- package/dist/components/InfoTable/InfoTable.d.ts +10 -13
- package/dist/components/InfoTable/InfoTable.d.ts.map +1 -1
- package/dist/components/InfoTable/InfoTable.js +24 -15
- package/dist/components/InfoTable/components/Cell.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Cell.js +37 -45
- package/dist/components/InfoTable/components/Row.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Row.js +19 -27
- package/dist/components/InfoTable/context.d.ts +1 -1
- package/dist/components/InfoTable/context.d.ts.map +1 -1
- package/dist/components/InfoTable/context.js +5 -3
- package/dist/components/InfoTable/styles.css.js +6 -10
- package/dist/components/Navigation/Footer.d.ts.map +1 -1
- package/dist/components/Navigation/Footer.js +59 -75
- package/dist/components/Navigation/Header.d.ts.map +1 -1
- package/dist/components/Navigation/Header.js +20 -17
- package/dist/components/Navigation/Navigation.d.ts +46 -43
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +23 -27
- package/dist/components/Navigation/NavigationContent.d.ts +1 -1
- package/dist/components/Navigation/NavigationContent.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationContent.js +100 -138
- package/dist/components/Navigation/NavigationProvider.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationProvider.js +116 -165
- package/dist/components/Navigation/components/Group.d.ts.map +1 -1
- package/dist/components/Navigation/components/Group.js +36 -43
- package/dist/components/Navigation/components/Item.d.ts +1 -1
- package/dist/components/Navigation/components/Item.d.ts.map +1 -1
- package/dist/components/Navigation/components/Item.js +440 -607
- package/dist/components/Navigation/components/ItemProvider.d.ts.map +1 -1
- package/dist/components/Navigation/components/ItemProvider.js +13 -8
- package/dist/components/Navigation/components/PinnedItems.d.ts.map +1 -1
- package/dist/components/Navigation/components/PinnedItems.js +101 -132
- package/dist/components/Navigation/components/Separator.js +10 -7
- package/dist/components/Navigation/components/ShowHide.d.ts +1 -1
- package/dist/components/Navigation/components/ShowHide.d.ts.map +1 -1
- package/dist/components/Navigation/components/ShowHide.js +51 -75
- package/dist/components/Navigation/components/items.css.js +72 -30
- package/dist/components/Navigation/components/styles.css.js +23 -13
- package/dist/components/Navigation/locales/en.js +12 -11
- package/dist/components/Navigation/styles.css.js +29 -14
- package/dist/components/Navigation/variables.css.js +4 -4
- package/dist/components/OfferList/OfferList.d.ts +5 -51
- package/dist/components/OfferList/OfferList.d.ts.map +1 -1
- package/dist/components/OfferList/OfferList.js +11 -78
- package/dist/components/OrderSummary/index.d.ts +5 -2
- package/dist/components/OrderSummary/index.d.ts.map +1 -1
- package/dist/components/OrderSummary/index.js +11 -204
- package/dist/components/Plans/index.d.ts +5 -21
- package/dist/components/Plans/index.d.ts.map +1 -1
- package/dist/components/Plans/index.js +11 -214
- package/dist/components/SteppedListCard/index.d.ts +5 -1
- package/dist/components/SteppedListCard/index.d.ts.map +1 -1
- package/dist/components/SteppedListCard/index.js +11 -0
- package/dist/index.js +5 -21
- package/dist/plus.css +2 -1
- package/package.json +8 -7
- package/LICENSE +0 -189
- package/dist/components/CustomerSatisfaction/assets/1-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.js +0 -4
- package/dist/components/Navigation/constants.js +0 -10
- package/dist/components/OfferList/OfferListProvider.d.ts +0 -30
- package/dist/components/OfferList/OfferListProvider.d.ts.map +0 -1
- package/dist/components/OfferList/OfferListProvider.js +0 -48
- package/dist/components/OfferList/components/Banner.d.ts +0 -13
- package/dist/components/OfferList/components/Banner.d.ts.map +0 -1
- package/dist/components/OfferList/components/Banner.js +0 -43
- package/dist/components/OfferList/components/Cell.d.ts +0 -4
- package/dist/components/OfferList/components/Cell.d.ts.map +0 -1
- package/dist/components/OfferList/components/Cell.js +0 -35
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts +0 -9
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts.map +0 -1
- package/dist/components/OfferList/components/OfferListRowProvider.js +0 -10
- package/dist/components/OfferList/components/Row.d.ts +0 -18
- package/dist/components/OfferList/components/Row.d.ts.map +0 -1
- package/dist/components/OfferList/components/Row.js +0 -258
- package/dist/components/OfferList/styles.css.d.ts +0 -44
- package/dist/components/OfferList/styles.css.d.ts.map +0 -1
- package/dist/components/OfferList/styles.css.js +0 -40
- package/dist/components/OrderSummary/NonScrollableContent.d.ts +0 -20
- package/dist/components/OrderSummary/NonScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/NonScrollableContent.js +0 -136
- package/dist/components/OrderSummary/Provider.d.ts +0 -15
- package/dist/components/OrderSummary/Provider.d.ts.map +0 -1
- package/dist/components/OrderSummary/Provider.js +0 -15
- package/dist/components/OrderSummary/ScrollableContent.d.ts +0 -2
- package/dist/components/OrderSummary/ScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/ScrollableContent.js +0 -314
- package/dist/components/OrderSummary/constants.d.ts +0 -3
- package/dist/components/OrderSummary/constants.d.ts.map +0 -1
- package/dist/components/OrderSummary/constants.js +0 -18
- package/dist/components/OrderSummary/helpers.d.ts +0 -28
- package/dist/components/OrderSummary/helpers.d.ts.map +0 -1
- package/dist/components/OrderSummary/helpers.js +0 -156
- package/dist/components/OrderSummary/locales/en.d.ts +0 -11
- package/dist/components/OrderSummary/locales/en.d.ts.map +0 -1
- package/dist/components/OrderSummary/locales/en.js +0 -12
- package/dist/components/OrderSummary/styles.css.d.ts +0 -21
- package/dist/components/OrderSummary/styles.css.d.ts.map +0 -1
- package/dist/components/OrderSummary/styles.css.js +0 -26
- package/dist/components/OrderSummary/types.d.ts +0 -125
- package/dist/components/OrderSummary/types.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.d.ts +0 -7
- package/dist/components/Plans/FeatureHint.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.js +0 -42
- package/dist/components/Plans/PlanHeader.d.ts +0 -14
- package/dist/components/Plans/PlanHeader.d.ts.map +0 -1
- package/dist/components/Plans/PlanHeader.js +0 -96
- package/dist/components/Plans/locales/en.d.ts +0 -7
- package/dist/components/Plans/locales/en.d.ts.map +0 -1
- package/dist/components/Plans/locales/en.js +0 -8
- package/dist/components/Plans/styles.css.d.ts +0 -67
- package/dist/components/Plans/styles.css.d.ts.map +0 -1
- package/dist/components/Plans/styles.css.js +0 -26
- package/dist/components/Plans/types.d.ts +0 -38
- package/dist/components/Plans/types.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.d.ts +0 -23
- package/dist/components/SteppedListCard/Step.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.js +0 -61
- package/dist/components/SteppedListCard/SteppedListCard.d.ts +0 -69
- package/dist/components/SteppedListCard/SteppedListCard.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListCard.js +0 -105
- package/dist/components/SteppedListCard/SteppedListContent.d.ts +0 -12
- package/dist/components/SteppedListCard/SteppedListContent.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListContent.js +0 -53
- package/dist/components/SteppedListCard/helper.d.ts +0 -27
- package/dist/components/SteppedListCard/helper.d.ts.map +0 -1
- package/dist/components/SteppedListCard/helper.js +0 -41
- package/dist/components/SteppedListCard/styles.css.d.ts +0 -9
- package/dist/components/SteppedListCard/styles.css.d.ts.map +0 -1
- package/dist/components/SteppedListCard/styles.css.js +0 -19
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { multiplier } from "./constants.js";
|
|
3
|
-
import { OrderSummaryContext } from "./Provider.js";
|
|
4
|
-
const formatNumber = (number, locale, currency, fractionDigits = 10) => {
|
|
5
|
-
const numberFormat = new Intl.NumberFormat(locale, {
|
|
6
|
-
currency,
|
|
7
|
-
maximumFractionDigits: fractionDigits,
|
|
8
|
-
style: "currency"
|
|
9
|
-
});
|
|
10
|
-
return numberFormat.format(number);
|
|
11
|
-
};
|
|
12
|
-
const calculatePrice = ({
|
|
13
|
-
price,
|
|
14
|
-
amount,
|
|
15
|
-
amountFree = 0,
|
|
16
|
-
timeUnit,
|
|
17
|
-
timeAmount,
|
|
18
|
-
discount = 0,
|
|
19
|
-
fixedPrice = false
|
|
20
|
-
}) => {
|
|
21
|
-
const nonNanTimeAmount = Number.isNaN(timeAmount) ? 1 : timeAmount;
|
|
22
|
-
const valueBeforeDiscount = price * (fixedPrice ? 1 : nonNanTimeAmount * multiplier[timeUnit]) * Math.max(amount - amountFree, 0);
|
|
23
|
-
const finalValue = valueBeforeDiscount * (1 - (discount <= 1 ? discount : 0)) - (discount > 1 ? Math.abs(discount) : 0);
|
|
24
|
-
return finalValue;
|
|
25
|
-
};
|
|
26
|
-
const calculateSubCategoryPrice = (subCategory, hideTimeUnit, timePeriodAmount, timePeriodUnit) => {
|
|
27
|
-
const timeAmount = hideTimeUnit ? 1 : timePeriodAmount;
|
|
28
|
-
const timeUnit = hideTimeUnit ? "hours" : timePeriodUnit;
|
|
29
|
-
if (Array.isArray(subCategory.amount)) {
|
|
30
|
-
const minAmount = subCategory.amount?.[0] ?? 1;
|
|
31
|
-
const maxAmount = subCategory.amount?.[1] ?? 1;
|
|
32
|
-
const subCategoryPrice2 = subCategory.price ?? 0;
|
|
33
|
-
const minPrice = calculatePrice({
|
|
34
|
-
amount: minAmount,
|
|
35
|
-
fixedPrice: subCategory.fixedPrice,
|
|
36
|
-
price: subCategoryPrice2,
|
|
37
|
-
timeAmount,
|
|
38
|
-
timeUnit
|
|
39
|
-
}) || 0;
|
|
40
|
-
const maxPrice = calculatePrice({
|
|
41
|
-
amount: maxAmount,
|
|
42
|
-
fixedPrice: subCategory.fixedPrice,
|
|
43
|
-
price: subCategoryPrice2,
|
|
44
|
-
timeAmount,
|
|
45
|
-
timeUnit
|
|
46
|
-
}) || 0;
|
|
47
|
-
const minPriceWithDiscount = calculatePrice({
|
|
48
|
-
amount: minAmount,
|
|
49
|
-
amountFree: subCategory.amountFree,
|
|
50
|
-
discount: subCategory.discount,
|
|
51
|
-
fixedPrice: subCategory.fixedPrice,
|
|
52
|
-
price: subCategoryPrice2,
|
|
53
|
-
timeAmount,
|
|
54
|
-
timeUnit
|
|
55
|
-
}) || 0;
|
|
56
|
-
const maxPriceWithDiscount = calculatePrice({
|
|
57
|
-
amount: maxAmount,
|
|
58
|
-
amountFree: subCategory.amountFree,
|
|
59
|
-
discount: subCategory.discount,
|
|
60
|
-
fixedPrice: subCategory.fixedPrice,
|
|
61
|
-
price: subCategoryPrice2,
|
|
62
|
-
timeAmount,
|
|
63
|
-
timeUnit
|
|
64
|
-
}) || 0;
|
|
65
|
-
return {
|
|
66
|
-
discounted: [minPriceWithDiscount, maxPriceWithDiscount],
|
|
67
|
-
default: [minPrice, maxPrice]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const subCategoryAmount = subCategory.amount ?? 1;
|
|
71
|
-
const subCategoryPrice = subCategory.price ?? 0;
|
|
72
|
-
const price = calculatePrice({
|
|
73
|
-
amount: subCategoryAmount,
|
|
74
|
-
fixedPrice: subCategory.fixedPrice,
|
|
75
|
-
price: subCategoryPrice,
|
|
76
|
-
timeAmount,
|
|
77
|
-
timeUnit
|
|
78
|
-
}) || 0;
|
|
79
|
-
const priceWithDiscount = calculatePrice({
|
|
80
|
-
amount: subCategoryAmount,
|
|
81
|
-
amountFree: subCategory.amountFree,
|
|
82
|
-
discount: subCategory.discount,
|
|
83
|
-
fixedPrice: subCategory.fixedPrice,
|
|
84
|
-
price: subCategoryPrice,
|
|
85
|
-
timeAmount,
|
|
86
|
-
timeUnit
|
|
87
|
-
}) || 0;
|
|
88
|
-
return {
|
|
89
|
-
discounted: [priceWithDiscount, priceWithDiscount],
|
|
90
|
-
default: [price, price]
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
const calculateCategoryPrice = (category, hideTimeUnit, timePeriodAmount, timePeriodUnit) => {
|
|
94
|
-
const categoryPrice = category.subCategories?.reduce(
|
|
95
|
-
(acc, subCategory) => {
|
|
96
|
-
const computedPrices = calculateSubCategoryPrice(
|
|
97
|
-
subCategory,
|
|
98
|
-
hideTimeUnit,
|
|
99
|
-
timePeriodAmount,
|
|
100
|
-
timePeriodUnit
|
|
101
|
-
);
|
|
102
|
-
return {
|
|
103
|
-
discounted: [
|
|
104
|
-
acc.discounted[0] + computedPrices.discounted[0],
|
|
105
|
-
acc.discounted[1] + computedPrices.discounted[1]
|
|
106
|
-
],
|
|
107
|
-
default: [
|
|
108
|
-
acc.default[0] + computedPrices.default[0],
|
|
109
|
-
acc.default[1] + computedPrices.default[1]
|
|
110
|
-
]
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
{ discounted: [0, 0], default: [0, 0] }
|
|
114
|
-
) ?? { discounted: [0, 0], default: [0, 0] };
|
|
115
|
-
const discountedPriceMin = category.discount && category.discount <= 1 ? categoryPrice.discounted[0] * (1 - category.discount) : categoryPrice.discounted[0] - (category.discount ?? 0);
|
|
116
|
-
const discountedPriceMax = category.discount && category.discount <= 1 ? categoryPrice.discounted[1] * (1 - category.discount) : categoryPrice.discounted[1] - (category.discount ?? 0);
|
|
117
|
-
const discountedPrice = category.allowNegative ? [discountedPriceMin, discountedPriceMax] : [Math.max(discountedPriceMin, 0), Math.max(discountedPriceMax, 0)];
|
|
118
|
-
categoryPrice.default.map(
|
|
119
|
-
(price) => Math.max(
|
|
120
|
-
category.discount && category.discount <= 1 ? price * category.discount : price - (category.discount ?? 0),
|
|
121
|
-
0
|
|
122
|
-
)
|
|
123
|
-
);
|
|
124
|
-
return { categoryPrice: categoryPrice.default, discountedPrice };
|
|
125
|
-
};
|
|
126
|
-
const DisplayPrice = ({
|
|
127
|
-
price,
|
|
128
|
-
beforeOrAfter,
|
|
129
|
-
divisor = 1
|
|
130
|
-
}) => {
|
|
131
|
-
const { localeFormat, currency, fractionDigits } = useContext(OrderSummaryContext);
|
|
132
|
-
const withDiscount = beforeOrAfter === "after" ? "WithDiscount" : "";
|
|
133
|
-
return price.totalPrice === price.maxPrice ? formatNumber(
|
|
134
|
-
price[`totalPrice${withDiscount}`] / divisor,
|
|
135
|
-
localeFormat,
|
|
136
|
-
currency,
|
|
137
|
-
fractionDigits ?? 2
|
|
138
|
-
) : `${formatNumber(
|
|
139
|
-
price[`totalPrice${withDiscount}`] / divisor,
|
|
140
|
-
localeFormat,
|
|
141
|
-
currency,
|
|
142
|
-
fractionDigits ?? 2
|
|
143
|
-
)} - ${formatNumber(
|
|
144
|
-
price[`maxPrice${withDiscount}`] / divisor,
|
|
145
|
-
localeFormat,
|
|
146
|
-
currency,
|
|
147
|
-
fractionDigits ?? 2
|
|
148
|
-
)}`;
|
|
149
|
-
};
|
|
150
|
-
export {
|
|
151
|
-
DisplayPrice,
|
|
152
|
-
calculateCategoryPrice,
|
|
153
|
-
calculatePrice,
|
|
154
|
-
calculateSubCategoryPrice,
|
|
155
|
-
formatNumber
|
|
156
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
readonly 'order.summary.total': "Estimated cost";
|
|
3
|
-
readonly 'order.summary.units.days.label': "Day(s)";
|
|
4
|
-
readonly 'order.summary.units.hours.label': "Hour(s)";
|
|
5
|
-
readonly 'order.summary.units.minutes.label': "Minute(s)";
|
|
6
|
-
readonly 'order.summary.units.months.label': "Month(s)";
|
|
7
|
-
readonly 'order.summary.units.seconds.label': "Second(s)";
|
|
8
|
-
readonly 'order.summary.units.years.label': "Year(s)";
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
//# sourceMappingURL=en.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/components/OrderSummary/locales/en.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wBAQU"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const orderSummaryLocales = {
|
|
2
|
-
"order.summary.total": "Estimated cost",
|
|
3
|
-
"order.summary.units.days.label": "Day(s)",
|
|
4
|
-
"order.summary.units.hours.label": "Hour(s)",
|
|
5
|
-
"order.summary.units.minutes.label": "Minute(s)",
|
|
6
|
-
"order.summary.units.months.label": "Month(s)",
|
|
7
|
-
"order.summary.units.seconds.label": "Second(s)",
|
|
8
|
-
"order.summary.units.years.label": "Year(s)"
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
orderSummaryLocales as default
|
|
12
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const orderSummaryContainer: string;
|
|
2
|
-
export declare const orderSummaryHeaderContainer: Record<"hideDetails" | "showDetails", string>;
|
|
3
|
-
export declare const orderSummaryStackBackground: string;
|
|
4
|
-
export declare const orderSummaryNonScrollableContainer: string;
|
|
5
|
-
export declare const orderSummaryNumberInput: string;
|
|
6
|
-
export declare const orderSummaryScrollableContainer: string;
|
|
7
|
-
export declare const orderSummaryDetails: string;
|
|
8
|
-
export declare const orderSummaryCategory: string;
|
|
9
|
-
export declare const orderSummaryAnchor: string;
|
|
10
|
-
export declare const orderSummaryAnchorIcon: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
11
|
-
size: {
|
|
12
|
-
medium: {
|
|
13
|
-
marginTop: `var(--${string})`;
|
|
14
|
-
};
|
|
15
|
-
small: {
|
|
16
|
-
marginTop: `var(--${string})`;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}>;
|
|
20
|
-
export declare const orderSummaryTotalPrice: Record<"default" | "priceInformation", string>;
|
|
21
|
-
//# sourceMappingURL=styles.css.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/OrderSummary/styles.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,QAShC,CAAA;AAQF,eAAO,MAAM,2BAA2B,+CAMtC,CAAA;AAEF,eAAO,MAAM,2BAA2B,QAEtC,CAAA;AAEF,eAAO,MAAM,kCAAkC,QAG7C,CAAA;AAEF,eAAO,MAAM,uBAAuB,QAGlC,CAAA;AAEF,eAAO,MAAM,+BAA+B,QAK1C,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAE9B,CAAA;AAEF,eAAO,MAAM,oBAAoB,QAO/B,CAAA;AAEF,eAAO,MAAM,kBAAkB,QAS7B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;EAuBjC,CAAA;AAEF,eAAO,MAAM,sBAAsB,gDAOjC,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* empty css */
|
|
2
|
-
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var orderSummaryContainer = "uv_plus_1q5g1ma0";
|
|
4
|
-
var orderSummaryHeaderContainer = { hideDetails: "uv_plus_1q5g1ma2 uv_plus_1q5g1ma1", showDetails: "uv_plus_1q5g1ma3 uv_plus_1q5g1ma1" };
|
|
5
|
-
var orderSummaryStackBackground = "uv_plus_1q5g1ma4";
|
|
6
|
-
var orderSummaryNonScrollableContainer = "uv_plus_1q5g1ma5";
|
|
7
|
-
var orderSummaryNumberInput = "uv_plus_1q5g1ma6";
|
|
8
|
-
var orderSummaryScrollableContainer = "uv_plus_1q5g1ma7";
|
|
9
|
-
var orderSummaryDetails = "uv_plus_1q5g1ma8";
|
|
10
|
-
var orderSummaryCategory = "uv_plus_1q5g1ma9";
|
|
11
|
-
var orderSummaryAnchor = "uv_plus_1q5g1maa";
|
|
12
|
-
var orderSummaryAnchorIcon = createRuntimeFn({ defaultClassName: "uv_plus_1q5g1mab", variantClassNames: { size: { medium: "uv_plus_1q5g1mac", small: "uv_plus_1q5g1mad" } }, defaultVariants: {}, compoundVariants: [] });
|
|
13
|
-
var orderSummaryTotalPrice = { priceInformation: "uv_plus_1q5g1mae", "default": "uv_plus_1q5g1maf" };
|
|
14
|
-
export {
|
|
15
|
-
orderSummaryAnchor,
|
|
16
|
-
orderSummaryAnchorIcon,
|
|
17
|
-
orderSummaryCategory,
|
|
18
|
-
orderSummaryContainer,
|
|
19
|
-
orderSummaryDetails,
|
|
20
|
-
orderSummaryHeaderContainer,
|
|
21
|
-
orderSummaryNonScrollableContainer,
|
|
22
|
-
orderSummaryNumberInput,
|
|
23
|
-
orderSummaryScrollableContainer,
|
|
24
|
-
orderSummaryStackBackground,
|
|
25
|
-
orderSummaryTotalPrice
|
|
26
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { UnitInput } from '@ultraviolet/ui';
|
|
2
|
-
import type { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import type orderSummaryLocales from './locales/en';
|
|
4
|
-
export type TimeUnit = 'seconds' | 'minutes' | 'hours' | 'days' | 'months';
|
|
5
|
-
type PeriodProps = {
|
|
6
|
-
hideTimeUnit: true;
|
|
7
|
-
periodOptions?: never;
|
|
8
|
-
valueUnitInput?: never;
|
|
9
|
-
unitUnitInput?: TimeUnit;
|
|
10
|
-
onChangeUnitInput?: never;
|
|
11
|
-
} | {
|
|
12
|
-
/**
|
|
13
|
-
* Optional time input allowing the user to estimate their cost on different time horizon.
|
|
14
|
-
* Pass the options to be displayed in the dropdown.
|
|
15
|
-
*/
|
|
16
|
-
hideTimeUnit?: false;
|
|
17
|
-
periodOptions?: TimeUnit[];
|
|
18
|
-
valueUnitInput?: ComponentProps<typeof UnitInput>['value'];
|
|
19
|
-
unitUnitInput?: TimeUnit;
|
|
20
|
-
onChangeUnitInput?: ComponentProps<typeof UnitInput>['onChangeUnitValue'];
|
|
21
|
-
};
|
|
22
|
-
type NumberInputType = {
|
|
23
|
-
/**
|
|
24
|
-
* Display a number input instead of the price
|
|
25
|
-
*/
|
|
26
|
-
numberInput?: boolean;
|
|
27
|
-
numberInputValue?: number | null;
|
|
28
|
-
numberInputUnit?: string;
|
|
29
|
-
numberInputControls?: boolean;
|
|
30
|
-
onChangeInput?: (value: number | null) => void;
|
|
31
|
-
};
|
|
32
|
-
export type PriceTypeSingle = {
|
|
33
|
-
maxPrice: number;
|
|
34
|
-
maxPriceWithDiscount: number;
|
|
35
|
-
totalPrice: number;
|
|
36
|
-
totalPriceWithDiscount: number;
|
|
37
|
-
timeUnit: TimeUnit;
|
|
38
|
-
};
|
|
39
|
-
export type PriceType = Record<string, PriceTypeSingle>;
|
|
40
|
-
export type SubCategoryType = {
|
|
41
|
-
title?: string;
|
|
42
|
-
icon?: ReactNode;
|
|
43
|
-
additionalInfo?: ReactNode;
|
|
44
|
-
price?: number;
|
|
45
|
-
/**
|
|
46
|
-
* List of elements to be displayed in the subcategory
|
|
47
|
-
*/
|
|
48
|
-
details?: ReactNode[];
|
|
49
|
-
discount?: number;
|
|
50
|
-
amount?: number[] | number;
|
|
51
|
-
amountFree?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Set to true if the price does not depend on the time
|
|
54
|
-
*/
|
|
55
|
-
fixedPrice?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Suffix to be displayed after the price - this will trigger to not display the overall price taking into account the amount for the subcategory.
|
|
58
|
-
*/
|
|
59
|
-
priceUnit?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Hide the price for the line (it will still be counted in the general price)
|
|
62
|
-
*/
|
|
63
|
-
hidePrice?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Custom content to display next to the price
|
|
66
|
-
*/
|
|
67
|
-
customContent?: ReactNode;
|
|
68
|
-
anchor?: string;
|
|
69
|
-
} & NumberInputType;
|
|
70
|
-
export type ItemsType = {
|
|
71
|
-
category: string;
|
|
72
|
-
additionalInfo?: ReactNode;
|
|
73
|
-
/** Information to add beneath the catecgory name */
|
|
74
|
-
subTitle?: ReactNode;
|
|
75
|
-
subCategories?: SubCategoryType[];
|
|
76
|
-
discount?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Hide the price of the category and display the custom content instead
|
|
79
|
-
*/
|
|
80
|
-
customContent?: ReactNode;
|
|
81
|
-
/**
|
|
82
|
-
* Whether the category price can be < 0 (e.g coupons)
|
|
83
|
-
*/
|
|
84
|
-
allowNegative?: boolean;
|
|
85
|
-
anchor?: string;
|
|
86
|
-
} & NumberInputType;
|
|
87
|
-
export type CurrencyType = 'EUR';
|
|
88
|
-
export type LocalesFormatType = Intl.LocalesArgument;
|
|
89
|
-
export type OrderSummaryProps = {
|
|
90
|
-
items: ItemsType[];
|
|
91
|
-
header?: string;
|
|
92
|
-
locales?: Record<keyof typeof orderSummaryLocales, string>;
|
|
93
|
-
currency?: CurrencyType;
|
|
94
|
-
/**
|
|
95
|
-
* Locale to format the numbers (prices)
|
|
96
|
-
*/
|
|
97
|
-
localeFormat?: LocalesFormatType;
|
|
98
|
-
/**
|
|
99
|
-
*Total applied to the final cost (due to commitment, beta...)
|
|
100
|
-
*/
|
|
101
|
-
discount?: number;
|
|
102
|
-
footer?: ReactNode;
|
|
103
|
-
children?: ReactNode;
|
|
104
|
-
totalPriceInfo?: ReactNode;
|
|
105
|
-
totalPriceInfoPlacement?: 'left' | 'right';
|
|
106
|
-
totalPriceDescription?: ReactNode;
|
|
107
|
-
additionalInfo?: string;
|
|
108
|
-
priceInformation?: ReactNode;
|
|
109
|
-
hideBeforePrice?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Number of fraction digit to display in the price details
|
|
112
|
-
*/
|
|
113
|
-
fractionDigits?: number;
|
|
114
|
-
/**
|
|
115
|
-
* Get the computed price for each category.
|
|
116
|
-
* `price.category = { before: [total, totalMax], after: [totalWithDiscount, totalMaxWithDiscount]}`
|
|
117
|
-
*/
|
|
118
|
-
onChange?: (price: PriceType, totalPrice: PriceTypeSingle) => void;
|
|
119
|
-
hideDetails?: boolean;
|
|
120
|
-
className?: string;
|
|
121
|
-
['data-testid']?: string;
|
|
122
|
-
style?: CSSProperties;
|
|
123
|
-
} & PeriodProps;
|
|
124
|
-
export {};
|
|
125
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/OrderSummary/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureHint.d.ts","sourceRoot":"","sources":["../../../src/components/Plans/FeatureHint.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,UAAU,gBAAgB,4CAsCrD,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { InformationOutlineIcon } from "@ultraviolet/icons/InformationOutlineIcon";
|
|
3
|
-
import { Tooltip, Popover } from "@ultraviolet/ui";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { plansIconWrapper } from "./styles.css.js";
|
|
6
|
-
const FeatureHint = ({ hint }) => {
|
|
7
|
-
const [visible, setVisible] = useState(false);
|
|
8
|
-
if (!hint) {
|
|
9
|
-
return /* @__PURE__ */ jsx("div", {});
|
|
10
|
-
}
|
|
11
|
-
if (hint.type === "tooltip") {
|
|
12
|
-
return /* @__PURE__ */ jsx(Tooltip, { text: hint.text, children: /* @__PURE__ */ jsx(InformationOutlineIcon, { prominence: "weak", sentiment: "neutral" }) });
|
|
13
|
-
}
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
Popover,
|
|
16
|
-
{
|
|
17
|
-
content: hint.content,
|
|
18
|
-
onClose: () => setVisible(false),
|
|
19
|
-
title: hint.title,
|
|
20
|
-
visible,
|
|
21
|
-
children: /* @__PURE__ */ jsx(
|
|
22
|
-
"button",
|
|
23
|
-
{
|
|
24
|
-
className: plansIconWrapper,
|
|
25
|
-
"data-testid": "hint-popover",
|
|
26
|
-
onClick: () => setVisible(true),
|
|
27
|
-
onKeyDown: (event) => {
|
|
28
|
-
if (event.key === "Space" || event.key === "Enter") {
|
|
29
|
-
setVisible(true);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
tabIndex: 0,
|
|
33
|
-
type: "button",
|
|
34
|
-
children: /* @__PURE__ */ jsx(InformationOutlineIcon, { prominence: "weak", sentiment: "neutral" })
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
FeatureHint
|
|
42
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import PlansLocales from './locales/en';
|
|
2
|
-
import type { PlanType } from './types';
|
|
3
|
-
type PlanHeaderProps = {
|
|
4
|
-
fieldName?: string;
|
|
5
|
-
setFocusedPlan: (planValue?: string) => void;
|
|
6
|
-
onChange?: (newPlanValue?: string) => void;
|
|
7
|
-
currentPlanValue?: string;
|
|
8
|
-
plan: PlanType<string>;
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
locales?: Record<keyof typeof PlansLocales, string>;
|
|
11
|
-
};
|
|
12
|
-
export declare const PlanHeader: ({ fieldName, setFocusedPlan, onChange, currentPlanValue, plan, disabled, locales, }: PlanHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=PlanHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlanHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Plans/PlanHeader.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAA;AAQvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,EAAE,MAAM,CAAC,CAAA;CACpD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,qFAQxB,eAAe,4CA6FjB,CAAA"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Stack, Badge, Text, Separator } from "@ultraviolet/ui";
|
|
3
|
-
import locales from "./locales/en.js";
|
|
4
|
-
import { plansHeaderInput, plansHeaderFullHeight, plansDescription, plansCurrentWrapper, plansFullSizeSeparator } from "./styles.css.js";
|
|
5
|
-
const PlanHeader = ({
|
|
6
|
-
fieldName,
|
|
7
|
-
setFocusedPlan,
|
|
8
|
-
onChange,
|
|
9
|
-
currentPlanValue,
|
|
10
|
-
plan,
|
|
11
|
-
disabled,
|
|
12
|
-
locales: locales$1 = locales
|
|
13
|
-
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
-
fieldName && onChange && !disabled ? /* @__PURE__ */ jsx(
|
|
15
|
-
"input",
|
|
16
|
-
{
|
|
17
|
-
className: plansHeaderInput,
|
|
18
|
-
"data-testid": plan.value,
|
|
19
|
-
id: plan.value,
|
|
20
|
-
name: fieldName,
|
|
21
|
-
onBlur: () => {
|
|
22
|
-
setFocusedPlan(void 0);
|
|
23
|
-
},
|
|
24
|
-
onChange: () => onChange(plan.value),
|
|
25
|
-
onFocus: () => {
|
|
26
|
-
setFocusedPlan(plan.value);
|
|
27
|
-
},
|
|
28
|
-
type: "radio",
|
|
29
|
-
value: plan.value
|
|
30
|
-
}
|
|
31
|
-
) : null,
|
|
32
|
-
/* @__PURE__ */ jsxs(
|
|
33
|
-
Stack,
|
|
34
|
-
{
|
|
35
|
-
alignItems: "center",
|
|
36
|
-
className: plansHeaderFullHeight,
|
|
37
|
-
gap: 2,
|
|
38
|
-
justifyContent: "space-between",
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 1, children: [
|
|
42
|
-
/* @__PURE__ */ jsx(
|
|
43
|
-
Badge,
|
|
44
|
-
{
|
|
45
|
-
disabled,
|
|
46
|
-
sentiment: plan.sentiment && plan.sentiment !== "black" && plan.sentiment !== "white" ? plan.sentiment : "primary",
|
|
47
|
-
children: /* @__PURE__ */ jsx("label", { htmlFor: plan.value, children: plan.title })
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
plan.titleHeader,
|
|
51
|
-
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", children: [
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
53
|
-
Text,
|
|
54
|
-
{
|
|
55
|
-
as: "span",
|
|
56
|
-
disabled,
|
|
57
|
-
sentiment: plan.sentiment ?? "primary",
|
|
58
|
-
variant: "headingSmallStrong",
|
|
59
|
-
children: plan.header.price
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ jsx(Stack, { style: { minHeight: "16px" }, children: plan.header.priceDescription ? /* @__PURE__ */ jsx(
|
|
63
|
-
Text,
|
|
64
|
-
{
|
|
65
|
-
as: "span",
|
|
66
|
-
disabled,
|
|
67
|
-
sentiment: plan.sentiment ?? "primary",
|
|
68
|
-
variant: "caption",
|
|
69
|
-
children: plan.header.priceDescription
|
|
70
|
-
}
|
|
71
|
-
) : null })
|
|
72
|
-
] })
|
|
73
|
-
] }),
|
|
74
|
-
plan.header.description ? /* @__PURE__ */ jsx("div", { className: plansDescription, children: /* @__PURE__ */ jsx(Text, { as: "div", disabled, variant: "caption", children: plan.header.description }) }) : null
|
|
75
|
-
] }),
|
|
76
|
-
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
|
|
77
|
-
plan.header.cta && currentPlanValue !== plan.value ? plan.header.cta : null,
|
|
78
|
-
plan.header.cta && currentPlanValue === plan.value ? /* @__PURE__ */ jsx("div", { className: plansCurrentWrapper, children: /* @__PURE__ */ jsx(
|
|
79
|
-
Text,
|
|
80
|
-
{
|
|
81
|
-
as: "span",
|
|
82
|
-
disabled,
|
|
83
|
-
sentiment: plan.sentiment ?? "primary",
|
|
84
|
-
variant: "bodySmallStrong",
|
|
85
|
-
children: locales$1["plans.currentPlan"]
|
|
86
|
-
}
|
|
87
|
-
) }) : null,
|
|
88
|
-
plan.header.separator ? /* @__PURE__ */ jsx(Separator, { className: plansFullSizeSeparator }) : null
|
|
89
|
-
] })
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
] });
|
|
94
|
-
export {
|
|
95
|
-
PlanHeader
|
|
96
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/components/Plans/locales/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO;;;;CAIZ,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const plansIconWrapper: string;
|
|
2
|
-
export declare const plans: string;
|
|
3
|
-
export declare const plansOutOfStockBadge: string;
|
|
4
|
-
export declare const plansCell: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
|
-
activeColor: {
|
|
6
|
-
true: {
|
|
7
|
-
selectors: {
|
|
8
|
-
'thead &:not(:first-child), tbody &:not(:first-child), tbody tr:last-child &:not(:first-child)': {
|
|
9
|
-
borderColor: `var(--${string})`;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
disabled: {
|
|
15
|
-
true: {
|
|
16
|
-
backgroundColor: `var(--${string})`;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
focus: {
|
|
20
|
-
true: {
|
|
21
|
-
selectors: {
|
|
22
|
-
'thead &:not(:first-child), tbody &:not(:first-child), tbody tr:last-child &:not(:first-child)': {
|
|
23
|
-
borderColor: "blue";
|
|
24
|
-
borderWidth: "2px 2px 0 2px";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
hide: {
|
|
30
|
-
true: {
|
|
31
|
-
display: "none";
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
hideLabels: {
|
|
35
|
-
true: {
|
|
36
|
-
paddingLeft: `var(--${string})`;
|
|
37
|
-
textAlign: "start";
|
|
38
|
-
selectors: {
|
|
39
|
-
'thead &': {
|
|
40
|
-
paddingLeft: `var(--${string})`;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
selectable: {
|
|
46
|
-
true: {
|
|
47
|
-
cursor: "pointer";
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
spaceAfter: {
|
|
51
|
-
true: {
|
|
52
|
-
selectors: {
|
|
53
|
-
'tbody &': {
|
|
54
|
-
paddingBottom: `var(--${string})`;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
}>;
|
|
60
|
-
export declare const plansRowHidden: string;
|
|
61
|
-
export declare const plansUppercaseText: string;
|
|
62
|
-
export declare const plansHeaderInput: string;
|
|
63
|
-
export declare const plansHeaderFullHeight: string;
|
|
64
|
-
export declare const plansDescription: string;
|
|
65
|
-
export declare const plansFullSizeSeparator: string;
|
|
66
|
-
export declare const plansCurrentWrapper: string;
|
|
67
|
-
//# sourceMappingURL=styles.css.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Plans/styles.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,QAA6C,CAAA;AAE1E,eAAO,MAAM,KAAK,QAWhB,CAAA;AAEF,eAAO,MAAM,oBAAoB,QAK/B,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GpB,CAAA;AAEF,eAAO,MAAM,cAAc,QAA6B,CAAA;AAExD,eAAO,MAAM,kBAAkB,QAAwC,CAAA;AAEvE,eAAO,MAAM,gBAAgB,QAK3B,CAAA;AAEF,eAAO,MAAM,qBAAqB,QAA4B,CAAA;AAE9D,eAAO,MAAM,gBAAgB,QAG3B,CAAA;AAEF,eAAO,MAAM,sBAAsB,QAA2B,CAAA;AAE9D,eAAO,MAAM,mBAAmB,QAK9B,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* empty css */
|
|
2
|
-
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var plansIconWrapper = "uv_plus_11wud800";
|
|
4
|
-
var plans = "uv_plus_11wud801";
|
|
5
|
-
var plansOutOfStockBadge = "uv_plus_11wud802";
|
|
6
|
-
var plansCell = createRuntimeFn({ defaultClassName: "uv_plus_11wud803", variantClassNames: { activeColor: { true: "uv_plus_11wud804" }, disabled: { true: "uv_plus_11wud805" }, focus: { true: "uv_plus_11wud806" }, hide: { true: "uv_plus_11wud807" }, hideLabels: { true: "uv_plus_11wud808" }, selectable: { true: "uv_plus_11wud809" }, spaceAfter: { true: "uv_plus_11wud80a" } }, defaultVariants: { activeColor: false, disabled: false, focus: false, hide: false, hideLabels: false, selectable: false, spaceAfter: false }, compoundVariants: [] });
|
|
7
|
-
var plansRowHidden = "uv_plus_11wud80b";
|
|
8
|
-
var plansUppercaseText = "uv_plus_11wud80c";
|
|
9
|
-
var plansHeaderInput = "uv_plus_11wud80d";
|
|
10
|
-
var plansHeaderFullHeight = "uv_plus_11wud80e";
|
|
11
|
-
var plansDescription = "uv_plus_11wud80f";
|
|
12
|
-
var plansFullSizeSeparator = "uv_plus_11wud80g";
|
|
13
|
-
var plansCurrentWrapper = "uv_plus_11wud80h";
|
|
14
|
-
export {
|
|
15
|
-
plans,
|
|
16
|
-
plansCell,
|
|
17
|
-
plansCurrentWrapper,
|
|
18
|
-
plansDescription,
|
|
19
|
-
plansFullSizeSeparator,
|
|
20
|
-
plansHeaderFullHeight,
|
|
21
|
-
plansHeaderInput,
|
|
22
|
-
plansIconWrapper,
|
|
23
|
-
plansOutOfStockBadge,
|
|
24
|
-
plansRowHidden,
|
|
25
|
-
plansUppercaseText
|
|
26
|
-
};
|